Skip to content

Commit c731f66

Browse files
committed
feat: Add TOTP double authentication
1 parent f89fd9b commit c731f66

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1167
-175
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
uses: shivammathur/setup-php@v2
2727
with:
2828
coverage: pcov
29-
extensions: apcu, intl, opcache, pdo, pdo_mysql, pcov, redis, zip
29+
extensions: apcu, gd, intl, opcache, pdo, pdo_mysql, pcov, redis, zip
3030
php-version: 8.3
3131
- name: Cache Composer dependencies
3232
uses: actions/cache@v3

.gitlab-ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ stages:
44

55
install_dependencies:
66
stage: setup
7-
image: thomasagedev/template-symfony:1.0.0
7+
image: thomasagedev/template-symfony:1.0.1
88
script:
99
- composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
1010
artifacts:
@@ -14,15 +14,15 @@ install_dependencies:
1414

1515
php_cs_fixer:
1616
stage: test
17-
image: thomasagedev/template-symfony:1.0.0
17+
image: thomasagedev/template-symfony:1.0.1
1818
script:
1919
- vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run --show-progress=none
2020
dependencies:
2121
- install_dependencies
2222

2323
phpstan:
2424
stage: test
25-
image: thomasagedev/template-symfony:1.0.0
25+
image: thomasagedev/template-symfony:1.0.1
2626
script:
2727
- bin/console cache:clear --env=dev
2828
- vendor/bin/phpstan --memory-limit=1G --no-progress
@@ -31,7 +31,7 @@ phpstan:
3131

3232
phpunit:
3333
stage: test
34-
image: thomasagedev/template-symfony:1.0.0
34+
image: thomasagedev/template-symfony:1.0.1
3535
services:
3636
- name: mysql:8.4.3
3737
alias: mysql
@@ -50,15 +50,15 @@ phpunit:
5050

5151
rector:
5252
stage: test
53-
image: thomasagedev/template-symfony:1.0.0
53+
image: thomasagedev/template-symfony:1.0.1
5454
script:
5555
- vendor/bin/rector --dry-run --no-progress-bar
5656
dependencies:
5757
- install_dependencies
5858

5959
twig_cs_fixer:
6060
stage: test
61-
image: thomasagedev/template-symfony:1.0.0
61+
image: thomasagedev/template-symfony:1.0.1
6262
script:
6363
- vendor/bin/twig-cs-fixer lint templates
6464
dependencies:

.php-cs-fixer.dist.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@
1616
'@Symfony' => true,
1717
'@Symfony:risky' => true,
1818
'@PER-CS2.0' => true,
19+
'global_namespace_import' => [
20+
'import_classes' => true,
21+
],
1922
'ordered_interfaces' => true,
2023
]);

ROADMAP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
* Configure AWS
22
* Switch config from YAML => PHP
33
* Configure Vault
4-
* Add TOTP authentication
54
* Add mutation testing
65
* Add reset password
76
* Upgrade to PHP 8.4
7+
* Restore 2FA by email (allow TOTP and email)

bitbucket-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: thomasagedev/template-symfony:1.0.0
1+
image: thomasagedev/template-symfony:1.0.1
22

33
definitions:
44
services:

compose.yaml

Lines changed: 53 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,59 @@ name: acme
22

33
services:
44

5-
http:
6-
image: caddy:latest
7-
ports:
8-
- "80:80"
9-
- "443:443"
10-
volumes:
11-
- ./docker/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
12-
- ./docker/ssl:/etc/ssl:ro
13-
- ./public:/srv:ro
14-
- caddy_config:/config
15-
- caddy_data:/data
16-
depends_on:
17-
- php
18-
19-
php:
20-
build: docker/php
21-
volumes:
22-
- ./:/srv
23-
depends_on:
24-
- database
25-
26-
database:
27-
image: mysql:8.4.3
28-
ports:
29-
- "3306:3306"
30-
volumes:
31-
- mysql_data:/var/lib/mysql
32-
- ./docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
33-
environment:
34-
MYSQL_ROOT_PASSWORD: root
35-
MYSQL_DATABASE: acme
36-
MYSQL_USER: acme
37-
MYSQL_PASSWORD: acme
38-
39-
redis:
40-
image: redis
41-
42-
worker:
43-
build: docker/php
44-
volumes:
45-
- ./:/srv
46-
depends_on:
47-
- database
48-
- redis
49-
command: php /srv/bin/console messenger:consume -vv
5+
http:
6+
image: caddy:latest
7+
ports:
8+
- "80:80"
9+
- "443:443"
10+
volumes:
11+
- ./docker/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
12+
- ./docker/ssl:/etc/ssl:ro
13+
- ./public:/srv:ro
14+
- caddy_config:/config
15+
- caddy_data:/data
16+
depends_on:
17+
- php
18+
19+
php:
20+
build: docker/php
21+
volumes:
22+
- ./:/srv
23+
environment:
24+
TZ: America/Toronto
25+
depends_on:
26+
- database
27+
28+
database:
29+
image: mysql:8.4.3
30+
ports:
31+
- "3306:3306"
32+
volumes:
33+
- mysql_data:/var/lib/mysql
34+
- ./docker/mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
35+
environment:
36+
MYSQL_ROOT_PASSWORD: root
37+
MYSQL_DATABASE: acme
38+
MYSQL_USER: acme
39+
MYSQL_PASSWORD: acme
40+
TZ: America/Toronto
41+
42+
redis:
43+
image: redis
44+
45+
worker:
46+
build: docker/php
47+
volumes:
48+
- ./:/srv
49+
environment:
50+
TZ: America/Toronto
51+
depends_on:
52+
- database
53+
- redis
54+
command: php /srv/bin/console messenger:consume -vv
5055

5156
volumes:
5257

53-
caddy_config:
54-
caddy_data:
55-
mysql_data:
58+
caddy_config:
59+
caddy_data:
60+
mysql_data:

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@
77
"require": {
88
"php": ">=8.3",
99
"ext-ctype": "*",
10+
"ext-gd": "*",
1011
"ext-iconv": "*",
1112
"babdev/pagerfanta-bundle": "^4.5",
1213
"doctrine/dbal": "^4.2.2",
1314
"doctrine/doctrine-bundle": "^2.13.2",
1415
"doctrine/doctrine-migrations-bundle": "^3.4.1",
1516
"doctrine/orm": "^3.3.2",
17+
"endroid/qr-code": "^6.0",
1618
"pagerfanta/doctrine-orm-adapter": "^4.7.1",
1719
"pagerfanta/twig": "^4.7.1",
1820
"scheb/2fa-bundle": "^7.6",
1921
"scheb/2fa-email": "^7.6",
22+
"scheb/2fa-totp": "^7.6",
2023
"symfony/asset": "7.2.*",
2124
"symfony/asset-mapper": "7.2.*",
2225
"symfony/console": "7.2.*",

0 commit comments

Comments
 (0)