Compare commits
46
Commits
main
..
7257c51bdf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7257c51bdf | ||
|
|
641573842c | ||
|
|
abc3712d97 | ||
|
|
66cb356955 | ||
|
|
ffd20f5535 | ||
|
|
1b52f80448 | ||
|
|
b965f0f085 | ||
|
|
c4c989db4c | ||
|
|
37507bd169 | ||
|
|
732148a533 | ||
|
|
50d7ce745c | ||
|
|
a475c1a268 | ||
|
|
1ae0f651d8 | ||
|
|
8e933631b2 | ||
|
|
f8746207e6 | ||
|
|
e42966e618 | ||
|
|
e4976e51fa | ||
|
|
65070688ec | ||
|
|
e54c870f05 | ||
|
|
f5aabafcc5 | ||
|
|
de4b7bca6a | ||
|
|
c6adb00219 | ||
|
|
5f6ea89179 | ||
|
|
c384fc3dd5 | ||
|
|
78b570bd75 | ||
|
|
74f52db002 | ||
|
|
56590a901f | ||
|
|
49045bc696 | ||
|
|
28ee969c29 | ||
|
|
7230520551 | ||
|
|
59c1d97d84 | ||
|
|
3de1e907f2 | ||
|
|
91c0c3e6d1 | ||
|
|
8e3807e079 | ||
|
|
10c3dbc066 | ||
|
|
af13be2196 | ||
|
|
c0aa2ad44e | ||
|
|
d3cff2ef58 | ||
|
|
24b76f9700 | ||
|
|
03994dd54e | ||
|
|
499e699dbd | ||
|
|
c8b0a6e966 | ||
|
|
5b6bfaf5ad | ||
|
|
af61a3b920 | ||
|
|
0d6628e7c9 | ||
|
|
534175efb3 |
@@ -1,25 +0,0 @@
|
|||||||
# Git
|
|
||||||
.git
|
|
||||||
.gitignore
|
|
||||||
|
|
||||||
|
|
||||||
# Symfony
|
|
||||||
var/cache/*
|
|
||||||
var/log/*
|
|
||||||
var/sessions/*
|
|
||||||
!var/cache/.gitkeep
|
|
||||||
!var/log/.gitkeep
|
|
||||||
!var/sessions/.gitkeep
|
|
||||||
|
|
||||||
# Node
|
|
||||||
node_modules
|
|
||||||
npm-debug.log
|
|
||||||
|
|
||||||
# Other
|
|
||||||
.env.local
|
|
||||||
.env.local.php
|
|
||||||
.env.dev.local
|
|
||||||
.env.test.local
|
|
||||||
.env.prod.local
|
|
||||||
vendor
|
|
||||||
public/build
|
|
||||||
+18
-33
@@ -11,21 +11,14 @@
|
|||||||
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
|
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
|
||||||
# https://symfony.com/doc/current/configuration/secrets.html
|
# https://symfony.com/doc/current/configuration/secrets.html
|
||||||
#
|
#
|
||||||
# Copy this file to .env (and .env.dev / .env.prod / .env.test as needed) and
|
|
||||||
# fill in real values. Those files are gitignored and never committed.
|
|
||||||
#
|
|
||||||
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
|
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
|
||||||
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
|
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
|
||||||
|
|
||||||
###> symfony/framework-bundle ###
|
###> symfony/framework-bundle ###
|
||||||
APP_ENV=prod
|
APP_ENV=dev
|
||||||
APP_SECRET=CHANGEME_APP_SECRET
|
APP_SECRET=
|
||||||
TRUSTED_PROXIES=127.0.0.1,172.20.0.1,172.20.0.0/16
|
|
||||||
TRUSTED_HOSTS=^.*$
|
|
||||||
###< symfony/framework-bundle ###
|
###< symfony/framework-bundle ###
|
||||||
|
|
||||||
SITE_BASE_URL=https://escapepage.com
|
|
||||||
|
|
||||||
###> doctrine/doctrine-bundle ###
|
###> doctrine/doctrine-bundle ###
|
||||||
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
|
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
|
||||||
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
|
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
|
||||||
@@ -36,11 +29,10 @@ DB_DRIVER=pdo_mysql
|
|||||||
DB_SERVER_VERSION=8.0.32
|
DB_SERVER_VERSION=8.0.32
|
||||||
DB_CHARSET=utf8mb4
|
DB_CHARSET=utf8mb4
|
||||||
DB_USER=escapepage
|
DB_USER=escapepage
|
||||||
DB_PASSWORD=CHANGEME_DB_PASSWORD
|
DB_PASSWORD="b.0nqrxJ/D*Luf9N"
|
||||||
DB_HOST=database
|
DB_HOST=localhost
|
||||||
DB_PORT=3306
|
DB_PORT=3306
|
||||||
DB_NAME=escapepage
|
DB_NAME=escapepage
|
||||||
MYSQL_ROOT_PASSWORD=CHANGEME_MYSQL_ROOT_PASSWORD
|
|
||||||
DATABASE_URL="${DB_DRIVER}://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?serverVersion=${DB_SERVER_VERSION}&charset=${DB_CHARSET}"
|
DATABASE_URL="${DB_DRIVER}://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?serverVersion=${DB_SERVER_VERSION}&charset=${DB_CHARSET}"
|
||||||
###< doctrine/doctrine-bundle ###
|
###< doctrine/doctrine-bundle ###
|
||||||
|
|
||||||
@@ -53,36 +45,29 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
|
|||||||
|
|
||||||
###> symfony/mailer ###
|
###> symfony/mailer ###
|
||||||
# Development: use Mailpit (docker compose override provides service `mailer` on port 1025)
|
# Development: use Mailpit (docker compose override provides service `mailer` on port 1025)
|
||||||
MAILGUN_API_KEY=REPLACE_WITH_MAILGUN_API_KEY
|
MAILER_DSN=smtp://mailer:1025
|
||||||
MAILGUN_DOMAIN=REPLACE_WITH_MAILGUN_SENDING_DOMAIN
|
# Production/Stage (uncomment and set SENDGRID_API_KEY in real env or secrets):
|
||||||
MAILER_DSN=mailgun+api://${MAILGUN_API_KEY}:${MAILGUN_DOMAIN}@default?region=eu
|
# MAILER_DSN=sendgrid+api://%env(SENDGRID_API_KEY)%
|
||||||
MAILER_FROM=mailer@escapepage.nl
|
# Alternatively, via SMTP (no extra package needed):
|
||||||
|
# MAILER_DSN="smtp://apikey:%env(SENDGRID_API_KEY)%@smtp.sendgrid.net:587?encryption=tls"
|
||||||
# Optional default sender (used by test command if --from not passed):
|
# Optional default sender (used by test command if --from not passed):
|
||||||
|
# MAILER_FROM=no-reply@your-domain.tld
|
||||||
|
# SENDGRID_API_KEY=your_real_key_goes_here # Do NOT commit this; set in .env.local or deployment env
|
||||||
###< symfony/mailer ###
|
###< symfony/mailer ###
|
||||||
|
|
||||||
|
###> symfony/sendgrid-mailer ###
|
||||||
|
# MAILER_DSN=sendgrid://KEY@default
|
||||||
|
###< symfony/sendgrid-mailer ###
|
||||||
|
|
||||||
###> mercure ###
|
###> mercure ###
|
||||||
# Internal hub URL used by the PHP app (reachable from the php container)
|
# Internal hub URL used by the PHP app (reachable from the php container)
|
||||||
MERCURE_URL=http://mercure/.well-known/mercure
|
MERCURE_URL=http://mercure/.well-known/mercure
|
||||||
# Public hub URL used by browsers
|
# Public hub URL used by browsers
|
||||||
MERCURE_PUBLIC_URL=https://mercure.escapepage.com/.well-known/mercure
|
MERCURE_PUBLIC_URL=http://localhost:8090/.well-known/mercure
|
||||||
# Shared secret for signing JWTs (dev only). In prod, set via real env/secrets.
|
# Shared secret for signing JWTs (dev only). In prod, set via real env/secrets.
|
||||||
MERCURE_JWT_SECRET=!ChangeThisMercureJWTSignedBySymfonySecretKey!
|
MERCURE_JWT_SECRET=!ChangeThisMercureJWTSignedBySymfonySecretKey!
|
||||||
# Pre-generated JWT tokens for convenience (signed with the dev secret above)
|
|
||||||
MERCURE_PUBLISHER_JWT_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJtZXJjdXJlIjp7InB1Ymxpc2giOlsiKiJdfX0.E5b7ma4k-kA7lVGOQtICh7r2sspwX4G1iOhwtbxHQck
|
|
||||||
MERCURE_SUBSCRIBER_JWT_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJtZXJjdXJlIjp7InN1YnNjcmliZSI6WyIqIl19fQ.mwSAjvbm6vOnjMoRSHMdcqapNCwyGZs1s57uLK4T3UM
|
|
||||||
# CORS allowed origins (default)
|
# CORS allowed origins (default)
|
||||||
MERCURE_CORS_ALLOWED_ORIGINS="https://www.escapepage.com https://escapepage.com"
|
MERCURE_CORS_ALLOWED_ORIGINS=http://localhost:8080
|
||||||
# Base URL for Mercure topics.
|
# Base URL for Mercure topics.
|
||||||
MERCURE_TOPIC_BASE=https://escapepage.com
|
MERCURE_TOPIC_BASE=https://escapepage.dev
|
||||||
###< mercure ###
|
###< mercure ###
|
||||||
|
|
||||||
###> docker ###
|
|
||||||
USER_ID=1000
|
|
||||||
GROUP_ID=1000
|
|
||||||
###< docker ###
|
|
||||||
|
|
||||||
###> karser/karser-recaptcha3-bundle ###
|
|
||||||
# Get your API key and secret from https://g.co/recaptcha/v3
|
|
||||||
RECAPTCHA3_KEY=CHANGEME_RECAPTCHA3_KEY
|
|
||||||
RECAPTCHA3_SECRET=CHANGEME_RECAPTCHA3_SECRET
|
|
||||||
###< karser/karser-recaptcha3-bundle ###
|
|
||||||
-11
@@ -1,18 +1,11 @@
|
|||||||
|
|
||||||
###> symfony/framework-bundle ###
|
###> symfony/framework-bundle ###
|
||||||
/.env
|
|
||||||
/.env.dev
|
|
||||||
/.env.prod
|
|
||||||
/.env.test
|
|
||||||
/.env.local
|
/.env.local
|
||||||
/.env.local.php
|
/.env.local.php
|
||||||
/.env.*.local
|
/.env.*.local
|
||||||
/config/secrets/prod/prod.decrypt.private.php
|
/config/secrets/prod/prod.decrypt.private.php
|
||||||
/public/bundles/
|
/public/bundles/
|
||||||
/var/
|
/var/
|
||||||
!/var/volumes/
|
|
||||||
/var/volumes/*
|
|
||||||
!/var/volumes/.gitignore
|
|
||||||
/vendor/
|
/vendor/
|
||||||
###< symfony/framework-bundle ###
|
###< symfony/framework-bundle ###
|
||||||
|
|
||||||
@@ -34,7 +27,3 @@ yarn-error.log
|
|||||||
###< symfony/webpack-encore-bundle ###
|
###< symfony/webpack-encore-bundle ###
|
||||||
|
|
||||||
/.idea
|
/.idea
|
||||||
|
|
||||||
###> docker env ###
|
|
||||||
/docker/.env
|
|
||||||
###< docker env ###
|
|
||||||
|
|||||||
Generated
-1
@@ -140,7 +140,6 @@
|
|||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/webpack-encore-bundle" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/webpack-encore-bundle" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfonycasts/reset-password-bundle" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfonycasts/reset-password-bundle" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfonycasts/verify-email-bundle" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfonycasts/verify-email-bundle" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/karser/karser-recaptcha3-bundle" />
|
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
|||||||
Generated
+1
-2
@@ -153,7 +153,6 @@
|
|||||||
<path value="$PROJECT_DIR$/vendor/lcobucci/jwt" />
|
<path value="$PROJECT_DIR$/vendor/lcobucci/jwt" />
|
||||||
<path value="$PROJECT_DIR$/vendor/symfonycasts/verify-email-bundle" />
|
<path value="$PROJECT_DIR$/vendor/symfonycasts/verify-email-bundle" />
|
||||||
<path value="$PROJECT_DIR$/vendor/symfonycasts/reset-password-bundle" />
|
<path value="$PROJECT_DIR$/vendor/symfonycasts/reset-password-bundle" />
|
||||||
<path value="$PROJECT_DIR$/vendor/karser/karser-recaptcha3-bundle" />
|
|
||||||
</include_path>
|
</include_path>
|
||||||
</component>
|
</component>
|
||||||
<component name="PhpProjectSharedConfiguration" php_language_level="8.2" />
|
<component name="PhpProjectSharedConfiguration" php_language_level="8.2" />
|
||||||
@@ -178,4 +177,4 @@
|
|||||||
<component name="PsalmOptionsConfiguration">
|
<component name="PsalmOptionsConfiguration">
|
||||||
<option name="transferred" value="true" />
|
<option name="transferred" value="true" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ This repository contains a Symfony 7.3 (PHP >= 8.5.1) application for a collabor
|
|||||||
6. Run tests: `vendor/bin/phpunit`
|
6. Run tests: `vendor/bin/phpunit`
|
||||||
|
|
||||||
- With Docker:
|
- With Docker:
|
||||||
1. `cd docker && docker compose up -d`
|
1. From `docker/`: `docker compose up -d`
|
||||||
2. Install vendors inside the PHP container:
|
2. Install vendors inside the PHP container:
|
||||||
- `docker compose exec php bash`
|
- `docker compose exec php bash`
|
||||||
- `composer install`
|
- `composer install`
|
||||||
@@ -25,25 +25,23 @@ This repository contains a Symfony 7.3 (PHP >= 8.5.1) application for a collabor
|
|||||||
- `php bin/console doctrine:migrations:migrate -n`
|
- `php bin/console doctrine:migrations:migrate -n`
|
||||||
4. App is at http://localhost:8080
|
4. App is at http://localhost:8080
|
||||||
|
|
||||||
## Email (Mailpit in dev, Mailgun for prod)
|
## Email (Mailpit in dev, SendGrid for prod)
|
||||||
- Dev: a `mailer` service (Mailpit) runs in Docker.
|
- Dev: a `mailer` service (Mailpit) runs in Docker.
|
||||||
- SMTP DSN in `.env`: `MAILER_DSN=smtp://mailer:1025`
|
- SMTP DSN in `.env`: `MAILER_DSN=smtp://mailer:1025`
|
||||||
- Mailpit UI: http://localhost:8025 (or mapped port 8025)
|
- Mailpit UI: http://localhost:8025
|
||||||
- Send a test mail: `php bin/console app:mail:test you@example.com`
|
- Send a test mail: `php bin/console app:mail:test you@example.com`
|
||||||
- Staging/Prod: use Mailgun.
|
- Staging/Prod: use SendGrid.
|
||||||
- Require package (already in composer): `symfony/mailgun-mailer`.
|
- Require package (already in composer): `symfony/sendgrid-mailer`.
|
||||||
- Set environment variables (do NOT commit secrets):
|
- Set environment variables (do NOT commit secrets):
|
||||||
- `MAILER_DSN=mailgun+api://${MAILGUN_API_KEY}:${MAILGUN_DOMAIN}@default?region=eu`
|
- `MAILER_DSN=sendgrid+api://%env(SENDGRID_API_KEY)%`
|
||||||
- `MAILGUN_API_KEY=YOUR_REAL_KEY`
|
- `SENDGRID_API_KEY=YOUR_REAL_KEY`
|
||||||
- `MAILGUN_DOMAIN=YOUR_SENDING_DOMAIN` (e.g. `mg.escapepage.nl`)
|
|
||||||
- Optional: `MAILER_FROM=no-reply@your-domain.tld`
|
- Optional: `MAILER_FROM=no-reply@your-domain.tld`
|
||||||
- Drop `region=eu` (or use `region=us`) depending on which region your Mailgun domain was created in.
|
|
||||||
- Alternatively via SMTP (no extra package):
|
- Alternatively via SMTP (no extra package):
|
||||||
- `MAILER_DSN="mailgun+smtp://USERNAME:PASSWORD@default?region=eu"`
|
- `MAILER_DSN="smtp://apikey:%env(SENDGRID_API_KEY)%@smtp.sendgrid.net:587?encryption=tls"`
|
||||||
|
|
||||||
Troubleshooting:
|
Troubleshooting:
|
||||||
- If emails don’t appear in dev, open Mailpit at http://localhost:8025 and verify messages.
|
- If emails don’t appear in dev, open Mailpit at http://localhost:8025 and verify messages.
|
||||||
- In prod, check logs for HTTP 2xx responses from Mailgun and verify sender domain is verified (SPF/DKIM) in Mailgun.
|
- In prod, check logs for HTTP 2xx responses from SendGrid and verify sender domain is verified in SendGrid.
|
||||||
|
|
||||||
## Frontend assets with Webpack Encore
|
## Frontend assets with Webpack Encore
|
||||||
We use Webpack Encore to build and minify JS/CSS from the `assets/` directory into `public/build/`.
|
We use Webpack Encore to build and minify JS/CSS from the `assets/` directory into `public/build/`.
|
||||||
@@ -83,9 +81,9 @@ See doc/CONTRIBUTING.md for code style and more details.
|
|||||||
We use a Mercure hub (Docker service) to push server updates to browsers via Server‑Sent Events (SSE).
|
We use a Mercure hub (Docker service) to push server updates to browsers via Server‑Sent Events (SSE).
|
||||||
|
|
||||||
Quick start (dev):
|
Quick start (dev):
|
||||||
1. Start Docker stack:
|
1. Start Docker stack from `docker/`:
|
||||||
```
|
```
|
||||||
cd docker && docker compose up -d
|
docker compose up -d
|
||||||
```
|
```
|
||||||
This starts `mercure` at http://localhost:8090 and the app at http://localhost:8080.
|
This starts `mercure` at http://localhost:8090 and the app at http://localhost:8080.
|
||||||
2. Install PHP deps inside the PHP container if you haven't yet:
|
2. Install PHP deps inside the PHP container if you haven't yet:
|
||||||
@@ -93,6 +91,12 @@ Quick start (dev):
|
|||||||
docker compose exec php bash
|
docker compose exec php bash
|
||||||
composer install
|
composer install
|
||||||
```
|
```
|
||||||
|
3. Open the Game Hub page in your browser: http://localhost:8080/game
|
||||||
|
- The page subscribes to a demo topic and logs messages in the console.
|
||||||
|
4. Publish a test update (in the PHP container):
|
||||||
|
```
|
||||||
|
php bin/console app:mercure:publish
|
||||||
|
```
|
||||||
You should see a console log like `[Mercure] Update received: { ... }` on the Game Hub page.
|
You should see a console log like `[Mercure] Update received: { ... }` on the Game Hub page.
|
||||||
|
|
||||||
Configuration:
|
Configuration:
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
document.addEventListener('DOMContentLoaded', () => {
|
|
||||||
const buttons = document.querySelectorAll('[data-tab-target]');
|
|
||||||
if (!buttons.length) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const activate = (id) => {
|
|
||||||
document.querySelectorAll('.admin-tab-panel').forEach(el => el.style.display = 'none');
|
|
||||||
const target = document.getElementById(id);
|
|
||||||
if (target) {
|
|
||||||
target.style.display = 'block';
|
|
||||||
}
|
|
||||||
|
|
||||||
buttons.forEach(btn => {
|
|
||||||
const active = btn.dataset.tabTarget === id;
|
|
||||||
btn.style.background = active ? '#fff' : '#f8fafc';
|
|
||||||
btn.style.color = active ? '#1e40af' : '#64748b';
|
|
||||||
btn.style.fontWeight = active ? '600' : '400';
|
|
||||||
btn.style.borderColor = active ? '#3b82f6' : '#e2e8f0';
|
|
||||||
btn.style.borderBottom = active ? '1px solid #fff' : '1px solid #e2e8f0';
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
buttons.forEach(btn => {
|
|
||||||
btn.addEventListener('click', () => activate(btn.dataset.tabTarget));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
+3
-7
@@ -1,10 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Welcome to your app's main JavaScript file!
|
* Welcome to your app's main JavaScript file!
|
||||||
*/
|
*/
|
||||||
import './styles/app.scss';
|
import './styles/app.css';
|
||||||
import 'bootstrap/js/dist/collapse';
|
|
||||||
import 'bootstrap/js/dist/alert';
|
console.log('This log comes from assets/app.js built by Webpack Encore! 🎉');
|
||||||
import 'bootstrap/js/dist/dropdown';
|
|
||||||
import './game-waiting';
|
|
||||||
import './game-lobby';
|
|
||||||
import './admin-session-tabs';
|
|
||||||
|
|||||||
@@ -1,62 +0,0 @@
|
|||||||
document.addEventListener('DOMContentLoaded', () => {
|
|
||||||
const config = document.getElementById('game-lobby-config');
|
|
||||||
if (!config) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const publicUrl = config.dataset.mercurePublicUrl;
|
|
||||||
const topic = config.dataset.topic;
|
|
||||||
const chatLog = document.getElementById('lobby-chat-log');
|
|
||||||
|
|
||||||
function appendLobbyMessage(username, content, createdAt) {
|
|
||||||
if (!chatLog) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const emptyNotice = document.getElementById('lobby-chat-empty');
|
|
||||||
if (emptyNotice) {
|
|
||||||
emptyNotice.remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
const time = createdAt
|
|
||||||
? new Date(createdAt).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })
|
|
||||||
: '';
|
|
||||||
|
|
||||||
const wrapper = document.createElement('div');
|
|
||||||
wrapper.className = 'lobby-message';
|
|
||||||
|
|
||||||
const author = document.createElement('strong');
|
|
||||||
author.textContent = username;
|
|
||||||
|
|
||||||
const timestamp = document.createElement('span');
|
|
||||||
timestamp.className = 'text-muted small';
|
|
||||||
timestamp.textContent = ' ' + time;
|
|
||||||
|
|
||||||
const body = document.createElement('div');
|
|
||||||
body.textContent = content;
|
|
||||||
|
|
||||||
wrapper.appendChild(author);
|
|
||||||
wrapper.appendChild(timestamp);
|
|
||||||
wrapper.appendChild(body);
|
|
||||||
chatLog.appendChild(wrapper);
|
|
||||||
chatLog.scrollTop = chatLog.scrollHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (publicUrl && topic) {
|
|
||||||
const url = new URL(publicUrl);
|
|
||||||
url.searchParams.append('topic', topic);
|
|
||||||
|
|
||||||
const eventSource = new EventSource(url);
|
|
||||||
eventSource.onmessage = event => {
|
|
||||||
const data = JSON.parse(event.data);
|
|
||||||
if (data.type === 'lobby_message') {
|
|
||||||
appendLobbyMessage(data.username, data.content, data.createdAt);
|
|
||||||
} else if (data.type === 'player_joined' || data.type === 'session_started') {
|
|
||||||
window.location.reload();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (chatLog) {
|
|
||||||
chatLog.scrollTop = chatLog.scrollHeight;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
document.addEventListener('DOMContentLoaded', () => {
|
|
||||||
const config = document.getElementById('game-waiting-config');
|
|
||||||
if (!config) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const publicUrl = config.dataset.mercurePublicUrl;
|
|
||||||
const topic = config.dataset.topic;
|
|
||||||
const readyAt = config.dataset.readyAt;
|
|
||||||
|
|
||||||
let reloading = false;
|
|
||||||
const reloadOnce = (eventSource) => {
|
|
||||||
if (reloading) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
reloading = true;
|
|
||||||
if (eventSource) {
|
|
||||||
eventSource.close();
|
|
||||||
}
|
|
||||||
window.location.reload();
|
|
||||||
};
|
|
||||||
|
|
||||||
if (publicUrl && topic) {
|
|
||||||
const url = new URL(publicUrl);
|
|
||||||
url.searchParams.append('topic', topic);
|
|
||||||
|
|
||||||
const eventSource = new EventSource(url);
|
|
||||||
eventSource.onmessage = event => {
|
|
||||||
const data = JSON.parse(event.data);
|
|
||||||
if (data.type === 'all_ready' || data.type === 'player_ready') {
|
|
||||||
reloadOnce(eventSource);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Our own ready status expires 60s after we set it - proactively tell the
|
|
||||||
// server as close to that deadline as possible, so the other players find
|
|
||||||
// out live instead of only whenever someone else's request happens to
|
|
||||||
// trigger the lazy check.
|
|
||||||
if (readyAt) {
|
|
||||||
const timeoutMs = 61000; // slightly more than the server-side 60s
|
|
||||||
const readyAtMs = readyAt * 1000;
|
|
||||||
const countdownEl = document.getElementById('ready-countdown');
|
|
||||||
const expireForm = document.getElementById('expire-ready-form');
|
|
||||||
|
|
||||||
const updateCountdown = () => {
|
|
||||||
const remaining = Math.max(0, Math.ceil((readyAtMs + timeoutMs - Date.now()) / 1000));
|
|
||||||
if (countdownEl) {
|
|
||||||
const m = Math.floor(remaining / 60);
|
|
||||||
const s = remaining % 60;
|
|
||||||
countdownEl.textContent = m + ':' + s.toString().padStart(2, '0');
|
|
||||||
}
|
|
||||||
return remaining;
|
|
||||||
};
|
|
||||||
|
|
||||||
const remaining = updateCountdown();
|
|
||||||
if (remaining <= 0) {
|
|
||||||
expireForm?.submit();
|
|
||||||
} else {
|
|
||||||
const countdownInterval = setInterval(() => {
|
|
||||||
if (updateCountdown() <= 0) {
|
|
||||||
clearInterval(countdownInterval);
|
|
||||||
expireForm?.submit();
|
|
||||||
}
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
+20
-205
@@ -3,14 +3,8 @@ import './styles/game1.css';
|
|||||||
|
|
||||||
let sequenceFinished = false;
|
let sequenceFinished = false;
|
||||||
let stillPlayingSound = true;
|
let stillPlayingSound = true;
|
||||||
let navigatingAway = false;
|
|
||||||
|
|
||||||
function goTo(url) {
|
function subscribeToMercure(mercurePublicUrl, topic, myScreen) {
|
||||||
navigatingAway = true;
|
|
||||||
window.location.href = url;
|
|
||||||
}
|
|
||||||
|
|
||||||
function subscribeToMercure(mercurePublicUrl, topic, myScreen, wonUrl, lostUrl) {
|
|
||||||
try {
|
try {
|
||||||
const url = mercurePublicUrl + '?topic=' + encodeURIComponent(topic);
|
const url = mercurePublicUrl + '?topic=' + encodeURIComponent(topic);
|
||||||
const es = new EventSource(url);
|
const es = new EventSource(url);
|
||||||
@@ -20,15 +14,7 @@ function subscribeToMercure(mercurePublicUrl, topic, myScreen, wonUrl, lostUrl)
|
|||||||
const data = JSON.parse(event.data);
|
const data = JSON.parse(event.data);
|
||||||
console.log('[Mercure][game1] Update:', data);
|
console.log('[Mercure][game1] Update:', data);
|
||||||
|
|
||||||
if (data && !Array.isArray(data) && data.type === 'game_finished') {
|
// data is [sendTo, message]
|
||||||
const destination = data.status === 'won' ? wonUrl : lostUrl;
|
|
||||||
if (destination) {
|
|
||||||
goTo(destination);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// data is [sendTo, message, messageType?] - messageType defaults to 'mainframe' (green)
|
|
||||||
if (Array.isArray(data) && data.length >= 2) {
|
if (Array.isArray(data) && data.length >= 2) {
|
||||||
const sendTo = parseInt(data[0]);
|
const sendTo = parseInt(data[0]);
|
||||||
// Filter: 0 means everyone, otherwise must match myScreen
|
// Filter: 0 means everyone, otherwise must match myScreen
|
||||||
@@ -39,7 +25,12 @@ function subscribeToMercure(mercurePublicUrl, topic, myScreen, wonUrl, lostUrl)
|
|||||||
|
|
||||||
const messageContainer = document.getElementById('message-container');
|
const messageContainer = document.getElementById('message-container');
|
||||||
if (messageContainer) {
|
if (messageContainer) {
|
||||||
appendResultMessage(messageContainer, data[1], data[2] || 'mainframe');
|
const msgEl = document.createElement('div');
|
||||||
|
msgEl.className = 'message';
|
||||||
|
msgEl.textContent = data[1];
|
||||||
|
msgEl.style.color = '#0F0'; // Green for incoming messages
|
||||||
|
msgEl.style.marginBottom = '10px';
|
||||||
|
messageContainer.appendChild(msgEl);
|
||||||
window.scrollTo(0, document.body.scrollHeight);
|
window.scrollTo(0, document.body.scrollHeight);
|
||||||
if(stillPlayingSound)
|
if(stillPlayingSound)
|
||||||
playSound();
|
playSound();
|
||||||
@@ -86,148 +77,6 @@ function flashRed() {
|
|||||||
}, 150);
|
}, 150);
|
||||||
}
|
}
|
||||||
|
|
||||||
let lockRevealTimer = null;
|
|
||||||
let lockExpireTimer = null;
|
|
||||||
let lockCountdownTimer = null;
|
|
||||||
let currentLockedAt = null;
|
|
||||||
|
|
||||||
function lockMessageClass(messageType) {
|
|
||||||
if (messageType === 'virus') return 'message-virus';
|
|
||||||
if (messageType === 'mainframe') return 'message-mainframe';
|
|
||||||
if (messageType === 'hint') return 'message-hint';
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
function appendResultMessage(container, text, messageType) {
|
|
||||||
const msgEl = document.createElement('div');
|
|
||||||
msgEl.className = ('message ' + lockMessageClass(messageType)).trim();
|
|
||||||
msgEl.textContent = text;
|
|
||||||
container.appendChild(msgEl);
|
|
||||||
}
|
|
||||||
|
|
||||||
function setInputDisabled(disabled) {
|
|
||||||
const inputField = document.getElementById('input-message');
|
|
||||||
if (inputField) {
|
|
||||||
inputField.disabled = disabled;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearLockTimers() {
|
|
||||||
if (lockRevealTimer) { clearTimeout(lockRevealTimer); lockRevealTimer = null; }
|
|
||||||
if (lockExpireTimer) { clearTimeout(lockExpireTimer); lockExpireTimer = null; }
|
|
||||||
if (lockCountdownTimer) { clearInterval(lockCountdownTimer); lockCountdownTimer = null; }
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearLock() {
|
|
||||||
clearLockTimers();
|
|
||||||
currentLockedAt = null;
|
|
||||||
document.body.classList.remove('locked');
|
|
||||||
const banner = document.getElementById('lock-banner');
|
|
||||||
if (banner) banner.style.display = 'none';
|
|
||||||
setInputDisabled(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateLockCountdown(unlockAtMs) {
|
|
||||||
const countdownEl = document.getElementById('lock-countdown');
|
|
||||||
if (!countdownEl) return;
|
|
||||||
const remaining = Math.max(0, Math.ceil((unlockAtMs - Date.now()) / 1000));
|
|
||||||
countdownEl.textContent = remaining + 's';
|
|
||||||
}
|
|
||||||
|
|
||||||
async function fetchLockReveal(apiEchoUrl, messageContainer) {
|
|
||||||
if (!apiEchoUrl) return;
|
|
||||||
try {
|
|
||||||
const response = await fetchJson(apiEchoUrl, {
|
|
||||||
method: 'POST',
|
|
||||||
body: { message: '', ts: new Date().toISOString() },
|
|
||||||
});
|
|
||||||
const result = response && response.result;
|
|
||||||
if (result && Array.isArray(result.result)) {
|
|
||||||
result.result.forEach(text => appendResultMessage(messageContainer, text, result.messageType));
|
|
||||||
window.scrollTo(0, document.body.scrollHeight);
|
|
||||||
}
|
|
||||||
if (result && result.locked === false) {
|
|
||||||
clearLock();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Code has been revealed (or already was), let the player try /unlock
|
|
||||||
setInputDisabled(false);
|
|
||||||
} catch (e) {
|
|
||||||
console.error('[Game1] Failed to fetch lock reveal:', e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function applyLock(lockData, apiEchoUrl, messageContainer) {
|
|
||||||
if (currentLockedAt === lockData.lockedAt) {
|
|
||||||
return; // already tracking this lock, avoid re-fetching/duplicating messages
|
|
||||||
}
|
|
||||||
currentLockedAt = lockData.lockedAt;
|
|
||||||
|
|
||||||
clearLockTimers();
|
|
||||||
|
|
||||||
const banner = document.getElementById('lock-banner');
|
|
||||||
if (banner) banner.style.display = 'flex';
|
|
||||||
document.body.classList.add('locked');
|
|
||||||
|
|
||||||
const revealAtMs = lockData.revealAt * 1000;
|
|
||||||
const unlockAtMs = lockData.unlockAt * 1000;
|
|
||||||
const now = Date.now();
|
|
||||||
|
|
||||||
if (now < revealAtMs) {
|
|
||||||
setInputDisabled(true);
|
|
||||||
lockRevealTimer = setTimeout(() => fetchLockReveal(apiEchoUrl, messageContainer), revealAtMs - now);
|
|
||||||
} else {
|
|
||||||
fetchLockReveal(apiEchoUrl, messageContainer);
|
|
||||||
}
|
|
||||||
|
|
||||||
lockExpireTimer = setTimeout(() => clearLock(), Math.max(0, unlockAtMs - now));
|
|
||||||
|
|
||||||
updateLockCountdown(unlockAtMs);
|
|
||||||
lockCountdownTimer = setInterval(() => {
|
|
||||||
updateLockCountdown(unlockAtMs);
|
|
||||||
if (Date.now() >= unlockAtMs) {
|
|
||||||
clearInterval(lockCountdownTimer);
|
|
||||||
lockCountdownTimer = null;
|
|
||||||
}
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
let filesRemovalTimer = null;
|
|
||||||
let scheduledFilesRemovalDeadline = null;
|
|
||||||
|
|
||||||
async function pingFilesRemovalDeadline(apiEchoUrl) {
|
|
||||||
if (!apiEchoUrl) return;
|
|
||||||
try {
|
|
||||||
// A no-op message is enough to make the server evaluate the deadline server-side;
|
|
||||||
// the actual restore notice (if any) arrives for everyone via the Mercure broadcast.
|
|
||||||
await fetchJson(apiEchoUrl, {
|
|
||||||
method: 'POST',
|
|
||||||
body: { message: '', ts: new Date().toISOString() },
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
console.error('[Game1] Failed to ping files-removal deadline:', e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function scheduleFilesRemovalCheck(deadline, apiEchoUrl) {
|
|
||||||
if (!deadline || scheduledFilesRemovalDeadline === deadline) {
|
|
||||||
return; // nothing to (re)schedule
|
|
||||||
}
|
|
||||||
scheduledFilesRemovalDeadline = deadline;
|
|
||||||
|
|
||||||
if (filesRemovalTimer) {
|
|
||||||
clearTimeout(filesRemovalTimer);
|
|
||||||
filesRemovalTimer = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const delay = Math.max(0, deadline * 1000 - Date.now());
|
|
||||||
filesRemovalTimer = setTimeout(() => {
|
|
||||||
filesRemovalTimer = null;
|
|
||||||
scheduledFilesRemovalDeadline = null;
|
|
||||||
pingFilesRemovalDeadline(apiEchoUrl);
|
|
||||||
}, delay);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function fetchJson(url, options = {}) {
|
async function fetchJson(url, options = {}) {
|
||||||
const opts = { ...options };
|
const opts = { ...options };
|
||||||
const headers = new Headers(opts.headers || {});
|
const headers = new Headers(opts.headers || {});
|
||||||
@@ -264,11 +113,8 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||||||
// Look for config injected by Twig in the page
|
// Look for config injected by Twig in the page
|
||||||
const cfgEl = document.getElementById('mercure-config');
|
const cfgEl = document.getElementById('mercure-config');
|
||||||
|
|
||||||
// Prevent/warn on page reload, except for our own win/lose redirects
|
// Prevent/warn on page reload
|
||||||
window.addEventListener('beforeunload', (event) => {
|
window.addEventListener('beforeunload', (event) => {
|
||||||
if (navigatingAway) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Standard way to trigger the browser's confirmation dialog
|
// Standard way to trigger the browser's confirmation dialog
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
// Included for compatibility with older browsers
|
// Included for compatibility with older browsers
|
||||||
@@ -287,19 +133,9 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||||||
const apiEchoUrl = cfgEl.dataset.apiEchoUrl;
|
const apiEchoUrl = cfgEl.dataset.apiEchoUrl;
|
||||||
const apiCheckFinishedUrl = cfgEl.dataset.apiCheckFinishedUrl;
|
const apiCheckFinishedUrl = cfgEl.dataset.apiCheckFinishedUrl;
|
||||||
const lostUrl = cfgEl.dataset.lostUrl;
|
const lostUrl = cfgEl.dataset.lostUrl;
|
||||||
const wonUrl = cfgEl.dataset.wonUrl;
|
|
||||||
const lockLockedAt = cfgEl.dataset.lockLockedAt;
|
|
||||||
const lockRevealAt = cfgEl.dataset.lockRevealAt;
|
|
||||||
const lockUnlockAt = cfgEl.dataset.lockUnlockAt;
|
|
||||||
const filesRemovalDeadline = cfgEl.dataset.filesRemovalDeadline;
|
|
||||||
|
|
||||||
// Resume the auto-restore timer after a page refresh, if a window is already running
|
|
||||||
if (filesRemovalDeadline) {
|
|
||||||
scheduleFilesRemovalCheck(parseInt(filesRemovalDeadline, 10), apiEchoUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mercurePublicUrl && topic) {
|
if (mercurePublicUrl && topic) {
|
||||||
subscribeToMercure(mercurePublicUrl, topic, screen, wonUrl, lostUrl);
|
subscribeToMercure(mercurePublicUrl, topic, screen);
|
||||||
} else {
|
} else {
|
||||||
console.warn('[Mercure][game1] Missing data attributes on #mercure-config');
|
console.warn('[Mercure][game1] Missing data attributes on #mercure-config');
|
||||||
}
|
}
|
||||||
@@ -321,7 +157,7 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||||||
try {
|
try {
|
||||||
const response = await fetchJson(apiCheckFinishedUrl, { method: 'POST' });
|
const response = await fetchJson(apiCheckFinishedUrl, { method: 'POST' });
|
||||||
if (response && response.finished) {
|
if (response && response.finished) {
|
||||||
goTo(response.status === 'won' && wonUrl ? wonUrl : lostUrl);
|
window.location.href = lostUrl;
|
||||||
return; // Stop the timer loop
|
return; // Stop the timer loop
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -400,6 +236,7 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||||||
|
|
||||||
msgEl.className = 'message ' + extraClass;
|
msgEl.className = 'message ' + extraClass;
|
||||||
msgEl.textContent = msg[0];
|
msgEl.textContent = msg[0];
|
||||||
|
msgEl.style.marginBottom = '10px';
|
||||||
messageContainer.appendChild(msgEl);
|
messageContainer.appendChild(msgEl);
|
||||||
window.scrollTo(0, document.body.scrollHeight);
|
window.scrollTo(0, document.body.scrollHeight);
|
||||||
|
|
||||||
@@ -428,6 +265,7 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||||||
const msgEl = document.createElement('div');
|
const msgEl = document.createElement('div');
|
||||||
msgEl.className = 'message';
|
msgEl.className = 'message';
|
||||||
msgEl.textContent = message;
|
msgEl.textContent = message;
|
||||||
|
msgEl.style.marginBottom = '10px';
|
||||||
messageContainer.appendChild(msgEl);
|
messageContainer.appendChild(msgEl);
|
||||||
|
|
||||||
if (message && apiEchoUrl) {
|
if (message && apiEchoUrl) {
|
||||||
@@ -439,29 +277,15 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||||||
});
|
});
|
||||||
console.log('[API][game1] message sent →', response);
|
console.log('[API][game1] message sent →', response);
|
||||||
if (response && response.result && Array.isArray(response.result.result)) {
|
if (response && response.result && Array.isArray(response.result.result)) {
|
||||||
response.result.result.forEach(text => appendResultMessage(messageContainer, text, response.result.messageType));
|
response.result.result.forEach(text => {
|
||||||
|
const msgEl = document.createElement('div');
|
||||||
|
msgEl.className = 'message';
|
||||||
|
msgEl.textContent = text;
|
||||||
|
msgEl.style.marginBottom = '10px';
|
||||||
|
messageContainer.appendChild(msgEl);
|
||||||
|
});
|
||||||
window.scrollTo(0, document.body.scrollHeight);
|
window.scrollTo(0, document.body.scrollHeight);
|
||||||
}
|
}
|
||||||
if (response && response.result) {
|
|
||||||
if (response.result.gameWon === true && wonUrl) {
|
|
||||||
goTo(wonUrl);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (response.result.locked === true) {
|
|
||||||
applyLock({
|
|
||||||
lockedAt: response.result.lockedAt,
|
|
||||||
revealAt: response.result.revealAt,
|
|
||||||
unlockAt: response.result.unlockAt,
|
|
||||||
}, apiEchoUrl, messageContainer);
|
|
||||||
} else if (response.result.locked === false) {
|
|
||||||
clearLock();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (response.result.filesRemovalDeadline) {
|
|
||||||
scheduleFilesRemovalCheck(response.result.filesRemovalDeadline, apiEchoUrl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('[API][game1] Failed to send message:', err);
|
console.error('[API][game1] Failed to send message:', err);
|
||||||
}
|
}
|
||||||
@@ -472,15 +296,6 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||||||
console.log('[Game1] message-container height changed to 400vh and input enabled');
|
console.log('[Game1] message-container height changed to 400vh and input enabled');
|
||||||
sequenceFinished = true;
|
sequenceFinished = true;
|
||||||
console.log('[Game1] sequenceFinished is now TRUE');
|
console.log('[Game1] sequenceFinished is now TRUE');
|
||||||
|
|
||||||
// Restore an in-progress lock after a page refresh
|
|
||||||
if (lockUnlockAt && parseInt(lockUnlockAt, 10) * 1000 > Date.now()) {
|
|
||||||
applyLock({
|
|
||||||
lockedAt: parseInt(lockLockedAt, 10),
|
|
||||||
revealAt: parseInt(lockRevealAt, 10),
|
|
||||||
unlockAt: parseInt(lockUnlockAt, 10),
|
|
||||||
}, apiEchoUrl, messageContainer);
|
|
||||||
}
|
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
ServerRoot "/etc/apache2"
|
|
||||||
Listen 80
|
|
||||||
User www-data
|
|
||||||
Group www-data
|
|
||||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
|
||||||
LogLevel warn
|
|
||||||
IncludeOptional mods-enabled/*.load
|
|
||||||
IncludeOptional sites-enabled/*.conf
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
deb http://deb.debian.org/debian bookworm main contrib non-free-firmware
|
|
||||||
deb http://deb.debian.org/debian bookworm-updates main contrib non-free-firmware
|
|
||||||
deb http://security.debian.org/debian-security bookworm-security main contrib non-free-firmware
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# /etc/crontab: system-wide crontab
|
|
||||||
SHELL=/bin/sh
|
|
||||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|
||||||
|
|
||||||
17 * * * * root cd / && run-parts --report /etc/cron.hourly
|
|
||||||
25 6 * * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily
|
|
||||||
47 6 * * 7 root test -x /usr/sbin/anacron || run-parts --report /etc/cron.weekly
|
|
||||||
52 6 1 * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.monthly
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
# /etc/fstab: static file system information.
|
|
||||||
UUID=8f14e45f-ceea-4a63-9b3f-1a2b3c4d5e6f / ext4 errors=remount-ro 0 1
|
|
||||||
UUID=1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d /boot ext4 defaults 0 2
|
|
||||||
/swapfile none swap sw 0 0
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
archive-node-04
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
127.0.0.1 localhost
|
|
||||||
127.0.1.1 archive-node-04
|
|
||||||
::1 localhost ip6-localhost ip6-loopback
|
|
||||||
ff02::1 ip6-allnodes
|
|
||||||
ff02::2 ip6-allrouters
|
|
||||||
10.0.0.4 archive-node-04.internal
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Debian GNU/Linux 12 \n \l
|
|
||||||
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Welcome to archive-node-04.
|
|
||||||
All connections are logged and monitored for internal review purposes.
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
source /etc/network/interfaces.d/*
|
|
||||||
|
|
||||||
auto lo
|
|
||||||
iface lo inet loopback
|
|
||||||
|
|
||||||
auto eth0
|
|
||||||
iface eth0 inet static
|
|
||||||
address 10.0.0.4
|
|
||||||
netmask 255.255.255.0
|
|
||||||
gateway 10.0.0.1
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
user www-data;
|
|
||||||
worker_processes auto;
|
|
||||||
pid /run/nginx.pid;
|
|
||||||
|
|
||||||
events {
|
|
||||||
worker_connections 768;
|
|
||||||
}
|
|
||||||
|
|
||||||
http {
|
|
||||||
sendfile on;
|
|
||||||
keepalive_timeout 65;
|
|
||||||
include /etc/nginx/mime.types;
|
|
||||||
include /etc/nginx/sites-enabled/*;
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
passwd: files
|
|
||||||
group: files
|
|
||||||
shadow: files
|
|
||||||
hosts: files dns
|
|
||||||
networks: files
|
|
||||||
protocols: db files
|
|
||||||
services: db files
|
|
||||||
ethers: db files
|
|
||||||
rpc: db files
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
|
|
||||||
NAME="Debian GNU/Linux"
|
|
||||||
VERSION_ID="12"
|
|
||||||
VERSION="12 (bookworm)"
|
|
||||||
VERSION_CODENAME=bookworm
|
|
||||||
ID=debian
|
|
||||||
HOME_URL="https://www.debian.org/"
|
|
||||||
SUPPORT_URL="https://www.debian.org/support"
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
root:x:0:0:root:/root:/bin/bash
|
|
||||||
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
|
|
||||||
bin:x:2:2:bin:/bin:/usr/sbin/nologin
|
|
||||||
sys:x:3:3:sys:/dev:/usr/sbin/nologin
|
|
||||||
sync:x:4:65534:sync:/bin:/bin/sync
|
|
||||||
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
|
|
||||||
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
|
|
||||||
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
|
|
||||||
sshd:x:105:65534::/run/sshd:/usr/sbin/nologin
|
|
||||||
admin:x:1000:1000:admin,,,:/home/admin:/bin/bash
|
|
||||||
guest:x:1001:1001:guest,,,:/home/guest:/bin/bash
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
nameserver 1.1.1.1
|
|
||||||
nameserver 9.9.9.9
|
|
||||||
options edns0
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
root:$6$rounds=656000$xJ2kLQmZ$aFq9zN3vQwErTyUiOpAsDfGhJkLzXcVbNm1234567890abcdefgh:19700:0:99999:7:::
|
|
||||||
daemon:*:19700:0:99999:7:::
|
|
||||||
bin:*:19700:0:99999:7:::
|
|
||||||
sys:*:19700:0:99999:7:::
|
|
||||||
sshd:*:19700:0:99999:7:::
|
|
||||||
admin:$6$rounds=656000$k3PqR8tW$bGr0oPqLmNbVcXzAsDfGhJkLqWeRtYuIoP0987654321zyxwvu:19700:0:99999:7:::
|
|
||||||
guest:*:19700:0:99999:7:::
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
Host *
|
|
||||||
SendEnv LANG LC_*
|
|
||||||
HashKnownHosts yes
|
|
||||||
GSSAPIAuthentication yes
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
Port 22
|
|
||||||
PermitRootLogin no
|
|
||||||
PasswordAuthentication yes
|
|
||||||
PubkeyAuthentication yes
|
|
||||||
X11Forwarding no
|
|
||||||
PrintMotd no
|
|
||||||
Subsystem sftp /usr/lib/openssh/sftp-server
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Europe/Amsterdam
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
app:
|
|
||||||
name: internal-archive-sync
|
|
||||||
version: 2.3.1
|
|
||||||
log_level: info
|
|
||||||
port: 8080
|
|
||||||
database:
|
|
||||||
driver: sqlite
|
|
||||||
path: /opt/app/data.db
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
apt update
|
|
||||||
apt upgrade -y
|
|
||||||
systemctl restart nginx
|
|
||||||
df -h
|
|
||||||
journalctl -xe
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
# ~/.bashrc: executed by bash for non-login shells
|
|
||||||
|
|
||||||
case $- in
|
|
||||||
*i*) ;;
|
|
||||||
*) return;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
export PS1='\u@\h:\w\$ '
|
|
||||||
alias ll='ls -alF'
|
|
||||||
alias la='ls -A'
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGZ8pQxT2mN0vRkLwYb6cJhU3sEoAeKdVmXpZq7tRnBs admin@archive-node-04
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
update-alternatives 2026-05-30 03:10:04: link group editor updated to point to /usr/bin/vim.basic
|
|
||||||
update-alternatives 2026-05-30 03:10:04: link group pager updated to point to /usr/bin/less
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
Jun 12 09:41:55 archive-node-04 sshd[10233]: Accepted publickey for admin from 10.0.0.7 port 51422 ssh2
|
|
||||||
Jun 12 09:41:55 archive-node-04 sshd[10233]: pam_unix(sshd:session): session opened for user admin by (uid=0)
|
|
||||||
Jun 12 09:55:02 archive-node-04 sudo: admin : TTY=pts/0 ; PWD=/home/admin ; USER=root ; COMMAND=/usr/bin/apt update
|
|
||||||
Jun 12 10:12:40 archive-node-04 sshd[10233]: pam_unix(sshd:session): session closed for user admin
|
|
||||||
Jun 12 22:03:11 archive-node-04 sshd[15092]: Failed password for invalid user test from 203.0.113.44 port 39102 ssh2
|
|
||||||
Jun 12 22:03:14 archive-node-04 sshd[15092]: Connection closed by 203.0.113.44 port 39102 [preauth]
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
[ OK ] Started Network Manager.
|
|
||||||
[ OK ] Started OpenSSH server daemon.
|
|
||||||
[ OK ] Started Nginx HTTP server.
|
|
||||||
[ OK ] Reached target Multi-User System.
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Jun 12 04:00:11 archive-node-04 CRON[9021]: (root) CMD (test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily)
|
|
||||||
Jun 12 18:30:02 archive-node-04 CRON[15544]: (root) CMD (test -x /usr/sbin/anacron || run-parts --report /etc/cron.hourly)
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Jun 12 03:00:05 archive-node-04 systemd-udevd[512]: Using default interface naming scheme 'v252'.
|
|
||||||
Jun 12 03:00:11 archive-node-04 dbus-daemon[601]: [system] Successfully activated service 'org.freedesktop.hostname1'
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
[ 0.000000] Linux version 6.1.0-21-amd64 (debian-kernel@lists.debian.org)
|
|
||||||
[ 0.004211] Command line: BOOT_IMAGE=/boot/vmlinuz-6.1.0-21-amd64 root=UUID=8f14e45f
|
|
||||||
[ 0.512033] ACPI: Core revision 20221020
|
|
||||||
[ 1.221004] usb 1-1: new high-speed USB device number 2
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
2026-05-30 03:10:02 startup archives unpack
|
|
||||||
2026-05-30 03:10:04 install curl:amd64 <none> 8.4.0-2
|
|
||||||
2026-05-30 03:10:05 status installed curl:amd64 8.4.0-2
|
|
||||||
2026-06-02 09:44:11 upgrade openssh-server:amd64 1:9.2p1-2 1:9.2p1-2+deb12u2
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
Jun 12 03:00:02 archive-node-04 kernel: [ 0.000000] Linux version 6.1.0-21-amd64
|
|
||||||
Jun 12 03:00:02 archive-node-04 kernel: [ 0.004211] Command line: BOOT_IMAGE=/boot/vmlinuz-6.1.0-21-amd64 root=UUID=8f14e45f
|
|
||||||
Jun 12 03:00:03 archive-node-04 kernel: [ 1.221004] usb 1-1: new high-speed USB device number 2
|
|
||||||
Jun 12 03:00:03 archive-node-04 kernel: [ 1.552210] eth0: link up, 1000Mbps, full-duplex
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Jun 12 05:11:02 archive-node-04 postfix/qmgr[812]: 3F2A1C0021: removed
|
|
||||||
Jun 12 05:11:02 archive-node-04 postfix/smtp[9944]: 3F2A1C0021: to=<root@localhost>, status=sent
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
Jun 12 03:12:01 archive-node-04 systemd[1]: Starting Daily apt download activities...
|
|
||||||
Jun 12 03:12:04 archive-node-04 systemd[1]: apt-daily.service: Deactivated successfully.
|
|
||||||
Jun 12 04:00:11 archive-node-04 CRON[9021]: (root) CMD (test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily)
|
|
||||||
Jun 12 06:25:00 archive-node-04 anacron[1122]: Job `cron.daily' terminated
|
|
||||||
Jun 12 09:41:55 archive-node-04 sshd[10233]: Accepted publickey for admin from 10.0.0.7 port 51422 ssh2
|
|
||||||
Jun 12 09:41:55 archive-node-04 sshd[10233]: pam_unix(sshd:session): session opened for user admin
|
|
||||||
Jun 12 12:03:19 archive-node-04 systemd[1]: Reloading nginx.service
|
|
||||||
Jun 12 18:30:02 archive-node-04 CRON[15544]: (root) CMD (test -x /usr/sbin/anacron || run-parts --report /etc/cron.hourly)
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
From cron@archive-node-04 Wed Jun 10 06:25:01 2026
|
|
||||||
Subject: Cron <root@archive-node-04> run-parts --report /etc/cron.daily
|
|
||||||
|
|
||||||
Daily housekeeping completed without errors.
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
body {
|
||||||
|
background-color: skyblue;
|
||||||
|
}
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
// Brand palette derived from public/images/logo.png (teal key/globe on dark navy)
|
|
||||||
$brand-teal: #2f8fae;
|
|
||||||
$brand-teal-dark: #1c5a70;
|
|
||||||
$brand-teal-light:#6fb8d1;
|
|
||||||
$brand-navy: #0d1f26;
|
|
||||||
$brand-navy-soft: #16323f;
|
|
||||||
$brand-bg: #f4f8f9;
|
|
||||||
|
|
||||||
// Bootstrap variable overrides (must come before the bootstrap import)
|
|
||||||
$primary: $brand-teal;
|
|
||||||
$secondary: $brand-navy-soft;
|
|
||||||
$dark: $brand-navy;
|
|
||||||
$body-bg: $brand-bg;
|
|
||||||
$body-color: $brand-navy-soft;
|
|
||||||
$link-color: $brand-teal;
|
|
||||||
$link-hover-color: $brand-teal-dark;
|
|
||||||
$border-radius: .5rem;
|
|
||||||
|
|
||||||
@import "bootstrap/scss/bootstrap";
|
|
||||||
@import "bootstrap-icons/font/bootstrap-icons.css";
|
|
||||||
|
|
||||||
:root {
|
|
||||||
--brand-teal: #{$brand-teal};
|
|
||||||
--brand-teal-dark: #{$brand-teal-dark};
|
|
||||||
--brand-navy: #{$brand-navy};
|
|
||||||
--brand-navy-soft: #{$brand-navy-soft};
|
|
||||||
--brand-bg: #{$brand-bg};
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
min-height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.site-main {
|
|
||||||
flex: 1 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.site-header {
|
|
||||||
background: linear-gradient(90deg, $brand-navy, $brand-navy-soft);
|
|
||||||
}
|
|
||||||
|
|
||||||
.site-header .navbar-brand {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: .5rem;
|
|
||||||
font-weight: 700;
|
|
||||||
letter-spacing: .02em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.site-header .navbar-brand img {
|
|
||||||
height: 36px;
|
|
||||||
width: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.site-footer {
|
|
||||||
flex-shrink: 0;
|
|
||||||
background: $brand-navy;
|
|
||||||
color: rgba(255, 255, 255, .65);
|
|
||||||
}
|
|
||||||
|
|
||||||
.auth-card {
|
|
||||||
max-width: 440px;
|
|
||||||
margin: 3rem auto;
|
|
||||||
}
|
|
||||||
+3
-52
@@ -47,61 +47,12 @@ div#message-container {
|
|||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
min-height: calc(100vh - 100px); /* Fill most of the viewport initially */
|
min-height: calc(100vh - 100px); /* Fill most of the viewport initially */
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-size: 14px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.message {
|
div.message {
|
||||||
color: #C0C0C0;
|
color: #C0C0C0;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
line-height: 1.35;
|
|
||||||
margin-bottom: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.message-virus {
|
|
||||||
color: #F00;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.message-mainframe {
|
|
||||||
color: #0F0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.message-hint {
|
|
||||||
color: #FF0;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
div#lock-banner {
|
|
||||||
position: fixed;
|
|
||||||
top: 68px;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
padding: 12px 20px;
|
|
||||||
background-color: #200;
|
|
||||||
border-top: 1px solid #F00;
|
|
||||||
border-bottom: 1px solid #F00;
|
|
||||||
color: #F00;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: bold;
|
|
||||||
letter-spacing: 1px;
|
|
||||||
z-index: 99;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
animation: lock-banner-pulse 1s ease-in-out infinite;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes lock-banner-pulse {
|
|
||||||
0%, 100% {
|
|
||||||
background-color: #200;
|
|
||||||
}
|
|
||||||
50% {
|
|
||||||
background-color: #400;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
body.locked div#message-container {
|
|
||||||
padding-top: 130px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
div#input {
|
div#input {
|
||||||
@@ -110,11 +61,11 @@ div#input {
|
|||||||
|
|
||||||
input#input-message {
|
input#input-message {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 6px 10px;
|
padding: 10px;
|
||||||
background: #111;
|
background: #111;
|
||||||
border: 1px solid #A00000;
|
border: 1px solid #A00000;
|
||||||
color: #C0C0C0;
|
color: #C0C0C0;
|
||||||
font-size: 14px;
|
font-size: 18px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
services:
|
||||||
|
###> symfony/mercure-bundle ###
|
||||||
|
mercure:
|
||||||
|
ports:
|
||||||
|
- "80"
|
||||||
|
###< symfony/mercure-bundle ###
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
services:
|
||||||
|
###> symfony/mercure-bundle ###
|
||||||
|
mercure:
|
||||||
|
image: dunglas/mercure
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
# Uncomment the following line to disable HTTPS,
|
||||||
|
#SERVER_NAME: ':80'
|
||||||
|
MERCURE_PUBLISHER_JWT_KEY: ${MERCURE_JWT_SECRET}
|
||||||
|
MERCURE_SUBSCRIBER_JWT_KEY: ${MERCURE_JWT_SECRET}
|
||||||
|
# Set the URL of your Symfony project (without trailing slash!) as value of the cors_origins directive
|
||||||
|
MERCURE_EXTRA_DIRECTIVES: |
|
||||||
|
cors_origins ${MERCURE_CORS_ALLOWED_ORIGINS:-http://localhost:8080}
|
||||||
|
# Comment the following line to disable the development mode
|
||||||
|
command: /usr/bin/caddy run --config /etc/caddy/dev.Caddyfile
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "curl", "-f", "https://localhost/healthz"]
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
start_period: 60s
|
||||||
|
volumes:
|
||||||
|
- mercure_data:/data
|
||||||
|
- mercure_config:/config
|
||||||
|
###< symfony/mercure-bundle ###
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
###> symfony/mercure-bundle ###
|
||||||
|
mercure_data:
|
||||||
|
mercure_config:
|
||||||
|
###< symfony/mercure-bundle ###
|
||||||
+49
-51
@@ -7,50 +7,48 @@
|
|||||||
"php": ">=8.2",
|
"php": ">=8.2",
|
||||||
"ext-ctype": "*",
|
"ext-ctype": "*",
|
||||||
"ext-iconv": "*",
|
"ext-iconv": "*",
|
||||||
"doctrine/dbal": "^3.10.5",
|
"doctrine/dbal": "^3",
|
||||||
"doctrine/doctrine-bundle": "^2.18.3",
|
"doctrine/doctrine-bundle": "^2.16",
|
||||||
"doctrine/doctrine-migrations-bundle": "^3.7",
|
"doctrine/doctrine-migrations-bundle": "^3.4",
|
||||||
"doctrine/orm": "^3.6.7",
|
"doctrine/orm": "^3.5",
|
||||||
"karser/karser-recaptcha3-bundle": "^0.3.0",
|
"phpdocumentor/reflection-docblock": "^5.6",
|
||||||
"phpdocumentor/reflection-docblock": "^5.6.7",
|
"phpstan/phpdoc-parser": "^2.3",
|
||||||
"phpstan/phpdoc-parser": "^2.3.2",
|
"symfony/asset": "7.3.*",
|
||||||
"symfony/asset": "7.4.*",
|
"symfony/asset-mapper": "7.3.*",
|
||||||
"symfony/asset-mapper": "7.4.*",
|
"symfony/console": "7.3.*",
|
||||||
"symfony/console": "7.4.*",
|
"symfony/doctrine-messenger": "7.3.*",
|
||||||
"symfony/doctrine-messenger": "7.4.*",
|
"symfony/dotenv": "7.3.*",
|
||||||
"symfony/dotenv": "7.4.*",
|
"symfony/expression-language": "7.3.*",
|
||||||
"symfony/expression-language": "7.4.*",
|
"symfony/flex": "^2",
|
||||||
"symfony/flex": "^2.11",
|
"symfony/form": "7.3.*",
|
||||||
"symfony/form": "7.4.*",
|
"symfony/framework-bundle": "7.3.*",
|
||||||
"symfony/framework-bundle": "7.4.*",
|
"symfony/http-client": "7.3.*",
|
||||||
"symfony/http-client": "7.4.*",
|
"symfony/intl": "7.3.*",
|
||||||
"symfony/intl": "7.4.*",
|
"symfony/mailer": "7.3.*",
|
||||||
"symfony/mailer": "7.4.*",
|
"symfony/mercure-bundle": "^0.3",
|
||||||
"symfony/mailgun-mailer": "7.4.*",
|
"symfony/mime": "7.3.*",
|
||||||
"symfony/mercure-bundle": "^0.3.9",
|
"symfony/monolog-bundle": "^3.0",
|
||||||
"symfony/mime": "7.4.*",
|
"symfony/notifier": "7.3.*",
|
||||||
"symfony/monolog-bundle": "^3.11.2",
|
"symfony/process": "7.3.*",
|
||||||
"symfony/notifier": "7.4.*",
|
"symfony/property-access": "7.3.*",
|
||||||
"symfony/process": "7.4.*",
|
"symfony/property-info": "7.3.*",
|
||||||
"symfony/property-access": "7.4.*",
|
"symfony/runtime": "7.3.*",
|
||||||
"symfony/property-info": "7.4.*",
|
"symfony/security-bundle": "7.3.*",
|
||||||
"symfony/rate-limiter": "7.4.*",
|
"symfony/sendgrid-mailer": "7.3.*",
|
||||||
"symfony/runtime": "7.4.*",
|
"symfony/serializer": "7.3.*",
|
||||||
"symfony/security-bundle": "7.4.*",
|
"symfony/stimulus-bundle": "^2.30",
|
||||||
"symfony/serializer": "7.4.*",
|
"symfony/string": "7.3.*",
|
||||||
"symfony/stimulus-bundle": "^2.36",
|
"symfony/translation": "7.3.*",
|
||||||
"symfony/string": "7.4.*",
|
"symfony/twig-bundle": "7.3.*",
|
||||||
"symfony/translation": "7.4.*",
|
"symfony/ux-turbo": "^2.30",
|
||||||
"symfony/twig-bundle": "7.4.*",
|
"symfony/validator": "7.3.*",
|
||||||
"symfony/ux-turbo": "^2.36",
|
"symfony/web-link": "7.3.*",
|
||||||
"symfony/validator": "7.4.*",
|
"symfony/webpack-encore-bundle": "^2.1",
|
||||||
"symfony/web-link": "7.4.*",
|
"symfony/yaml": "7.3.*",
|
||||||
"symfony/webpack-encore-bundle": "^2.4.1",
|
"symfonycasts/reset-password-bundle": "^1.24",
|
||||||
"symfony/yaml": "7.4.*",
|
|
||||||
"symfonycasts/reset-password-bundle": "^1.25",
|
|
||||||
"symfonycasts/verify-email-bundle": "^1.18",
|
"symfonycasts/verify-email-bundle": "^1.18",
|
||||||
"twig/extra-bundle": "^2.12|^3.24",
|
"twig/extra-bundle": "^2.12|^3.0",
|
||||||
"twig/twig": "^2.12|^3.28.0"
|
"twig/twig": "^2.12|^3.0"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"allow-plugins": {
|
"allow-plugins": {
|
||||||
@@ -100,16 +98,16 @@
|
|||||||
"extra": {
|
"extra": {
|
||||||
"symfony": {
|
"symfony": {
|
||||||
"allow-contrib": false,
|
"allow-contrib": false,
|
||||||
"require": "7.4.*"
|
"require": "7.3.*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^11.5.55",
|
"phpunit/phpunit": "^11.5",
|
||||||
"symfony/browser-kit": "7.4.*",
|
"symfony/browser-kit": "7.3.*",
|
||||||
"symfony/css-selector": "7.4.*",
|
"symfony/css-selector": "7.3.*",
|
||||||
"symfony/debug-bundle": "7.4.*",
|
"symfony/debug-bundle": "7.3.*",
|
||||||
"symfony/maker-bundle": "^1.67",
|
"symfony/maker-bundle": "^1.0",
|
||||||
"symfony/stopwatch": "7.4.*",
|
"symfony/stopwatch": "7.3.*",
|
||||||
"symfony/web-profiler-bundle": "7.4.*"
|
"symfony/web-profiler-bundle": "7.3.*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+1143
-1443
File diff suppressed because it is too large
Load Diff
@@ -17,5 +17,4 @@ return [
|
|||||||
Symfony\Bundle\MercureBundle\MercureBundle::class => ['all' => true],
|
Symfony\Bundle\MercureBundle\MercureBundle::class => ['all' => true],
|
||||||
SymfonyCasts\Bundle\VerifyEmail\SymfonyCastsVerifyEmailBundle::class => ['all' => true],
|
SymfonyCasts\Bundle\VerifyEmail\SymfonyCastsVerifyEmailBundle::class => ['all' => true],
|
||||||
SymfonyCasts\Bundle\ResetPassword\SymfonyCastsResetPasswordBundle::class => ['all' => true],
|
SymfonyCasts\Bundle\ResetPassword\SymfonyCastsResetPasswordBundle::class => ['all' => true],
|
||||||
Karser\Recaptcha3Bundle\KarserRecaptcha3Bundle::class => ['all' => true],
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
# Enable stateless CSRF protection for forms and logins/logouts
|
# Enable stateless CSRF protection for forms and logins/logouts
|
||||||
framework:
|
framework:
|
||||||
# form:
|
form:
|
||||||
# csrf_protection:
|
csrf_protection:
|
||||||
# token_id: submit
|
token_id: submit
|
||||||
# csrf_protection:
|
|
||||||
# stateless_token_ids:
|
csrf_protection:
|
||||||
# - submit
|
stateless_token_ids:
|
||||||
# - authenticate
|
- submit
|
||||||
# - logout
|
- authenticate
|
||||||
|
- logout
|
||||||
|
|||||||
@@ -8,27 +8,7 @@ framework:
|
|||||||
fallbacks: ['en', 'nl']
|
fallbacks: ['en', 'nl']
|
||||||
|
|
||||||
# Note that the session will be started ONLY if you read or write from it.
|
# Note that the session will be started ONLY if you read or write from it.
|
||||||
session:
|
session: true
|
||||||
handler_id: null
|
|
||||||
cookie_secure: auto
|
|
||||||
cookie_samesite: lax
|
|
||||||
storage_factory_id: session.storage.factory.native
|
|
||||||
save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'
|
|
||||||
|
|
||||||
rate_limiter:
|
|
||||||
invite_code_join:
|
|
||||||
policy: 'sliding_window'
|
|
||||||
limit: 10
|
|
||||||
interval: '1 minute'
|
|
||||||
|
|
||||||
when@prod:
|
|
||||||
framework:
|
|
||||||
session:
|
|
||||||
handler_id: null
|
|
||||||
cookie_secure: true
|
|
||||||
cookie_samesite: lax
|
|
||||||
storage_factory_id: session.storage.factory.native
|
|
||||||
save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'
|
|
||||||
|
|
||||||
#esi: true
|
#esi: true
|
||||||
#fragments: true
|
#fragments: true
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
karser_recaptcha3:
|
|
||||||
site_key: '%env(RECAPTCHA3_KEY)%'
|
|
||||||
secret_key: '%env(RECAPTCHA3_SECRET)%'
|
|
||||||
score_threshold: 0.5
|
|
||||||
enabled: true
|
|
||||||
@@ -47,14 +47,6 @@ when@prod:
|
|||||||
excluded_http_codes: [404, 405]
|
excluded_http_codes: [404, 405]
|
||||||
buffer_size: 50 # How many messages should be saved? Prevent memory leaks
|
buffer_size: 50 # How many messages should be saved? Prevent memory leaks
|
||||||
nested:
|
nested:
|
||||||
type: group
|
|
||||||
members: [nested_file, nested_stderr]
|
|
||||||
nested_file:
|
|
||||||
type: stream
|
|
||||||
path: "%kernel.logs_dir%/php/prod.log"
|
|
||||||
level: debug
|
|
||||||
formatter: monolog.formatter.json
|
|
||||||
nested_stderr:
|
|
||||||
type: stream
|
type: stream
|
||||||
path: php://stderr
|
path: php://stderr
|
||||||
level: debug
|
level: debug
|
||||||
@@ -64,14 +56,7 @@ when@prod:
|
|||||||
process_psr_3_messages: false
|
process_psr_3_messages: false
|
||||||
channels: ["!event", "!doctrine"]
|
channels: ["!event", "!doctrine"]
|
||||||
deprecation:
|
deprecation:
|
||||||
type: group
|
type: stream
|
||||||
channels: [deprecation]
|
channels: [deprecation]
|
||||||
members: [deprecation_file, deprecation_stderr]
|
|
||||||
deprecation_file:
|
|
||||||
type: stream
|
|
||||||
path: "%kernel.logs_dir%/php/deprecation.log"
|
|
||||||
formatter: monolog.formatter.json
|
|
||||||
deprecation_stderr:
|
|
||||||
type: stream
|
|
||||||
path: php://stderr
|
path: php://stderr
|
||||||
formatter: monolog.formatter.json
|
formatter: monolog.formatter.json
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
framework:
|
framework:
|
||||||
notifier:
|
notifier:
|
||||||
chatter_transports:
|
chatter_transports:
|
||||||
texter_transports:␍
|
texter_transports:
|
||||||
channel_policy:
|
sendgrid: '%env(MAILER_DSN)%'
|
||||||
# use chat/slack, chat/telegram, sms/twilio or sms/nexmo
|
channel_policy:
|
||||||
urgent: ['email']
|
# use chat/slack, chat/telegram, sms/twilio or sms/nexmo
|
||||||
high: ['email']
|
urgent: ['email']
|
||||||
medium: ['email']
|
high: ['email']
|
||||||
low: ['email']
|
medium: ['email']
|
||||||
admin_recipients:
|
low: ['email']
|
||||||
- { email: admin@example.com }
|
admin_recipients:
|
||||||
|
- { email: admin@example.com }
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ framework:
|
|||||||
router:
|
router:
|
||||||
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
|
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
|
||||||
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
|
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
|
||||||
default_uri: '%env(SITE_BASE_URL)%'
|
#default_uri: http://localhost
|
||||||
|
|
||||||
when@prod:
|
when@prod:
|
||||||
framework:
|
framework:
|
||||||
|
|||||||
@@ -22,9 +22,6 @@ security:
|
|||||||
enable_csrf: true
|
enable_csrf: true
|
||||||
username_parameter: username
|
username_parameter: username
|
||||||
password_parameter: password
|
password_parameter: password
|
||||||
login_throttling:
|
|
||||||
max_attempts: 5
|
|
||||||
interval: '15 minutes'
|
|
||||||
logout:
|
logout:
|
||||||
path: app_logout
|
path: app_logout
|
||||||
# where to redirect after logout
|
# where to redirect after logout
|
||||||
@@ -33,7 +30,6 @@ security:
|
|||||||
# Easy way to control access for large sections of your site
|
# Easy way to control access for large sections of your site
|
||||||
# Note: Only the *first* access control that matches will be used
|
# Note: Only the *first* access control that matches will be used
|
||||||
access_control:
|
access_control:
|
||||||
- { path: ^/, roles: PUBLIC_ACCESS, requires_channel: https }
|
|
||||||
# - { path: ^/admin, roles: ROLE_ADMIN }
|
# - { path: ^/admin, roles: ROLE_ADMIN }
|
||||||
# - { path: ^/profile, roles: ROLE_USER }
|
# - { path: ^/profile, roles: ROLE_USER }
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
karser_recaptcha3:
|
|
||||||
enabled: false
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
twig:
|
twig:
|
||||||
form_themes: ['bootstrap_5_layout.html.twig']
|
|
||||||
globals:
|
globals:
|
||||||
mercure_public_url: '%env(MERCURE_PUBLIC_URL)%'
|
mercure_public_url: '%env(MERCURE_PUBLIC_URL)%'
|
||||||
mercure_topic_base: '%env(MERCURE_TOPIC_BASE)%'
|
mercure_topic_base: '%env(MERCURE_TOPIC_BASE)%'
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
# Put parameters here that don't need to change on each machine where the app is deployed
|
# Put parameters here that don't need to change on each machine where the app is deployed
|
||||||
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
|
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
|
||||||
parameters:
|
parameters:
|
||||||
mailer_from: '%env(MAILER_FROM)%'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# default configuration for services in *this* file
|
# default configuration for services in *this* file
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ Use this index to quickly locate files and directories during development and in
|
|||||||
|
|
||||||
## Top-Level
|
## Top-Level
|
||||||
- docker/compose.yaml / docker/compose.override.yaml — Docker services.
|
- docker/compose.yaml / docker/compose.override.yaml — Docker services.
|
||||||
- docker/ — Docker build contexts and configs (php Dockerfile, nginx vhost).
|
- docker/ — Docker build contexts and configs (php Dockerfile, nginx vhost, compose files).
|
||||||
- composer.json / composer.lock — Dependencies and scripts.
|
- composer.json / composer.lock — Dependencies and scripts.
|
||||||
- importmap.php — Importmap configuration for JS dependencies.
|
- importmap.php — Importmap configuration for JS dependencies.
|
||||||
- phpunit.dist.xml — PHPUnit configuration.
|
- phpunit.dist.xml — PHPUnit configuration.
|
||||||
|
|||||||
+9
-15
@@ -9,7 +9,7 @@ This app can run fully in Docker using docker compose with PHP-FPM, Nginx and My
|
|||||||
- mailer (dev only via compose.override.yaml): Mailpit (SMTP/UI)
|
- mailer (dev only via compose.override.yaml): Mailpit (SMTP/UI)
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
- Docker and Docker Compose (docker compose)
|
- Docker and Docker Compose (v2)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@@ -21,42 +21,36 @@ App will be served at http://localhost:8080
|
|||||||
|
|
||||||
Alternatively (manual):
|
Alternatively (manual):
|
||||||
```
|
```
|
||||||
cd docker
|
docker compose -f docker/compose.yaml -f docker/compose.override.yaml up -d --build
|
||||||
docker compose up -d --build
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2) Install dependencies
|
### 2) Install dependencies
|
||||||
The setup script already runs composer install. To run manually:
|
The setup script already runs composer install. To run manually:
|
||||||
```
|
```
|
||||||
cd docker
|
docker compose -f docker/compose.yaml -f docker/compose.override.yaml exec php composer install
|
||||||
docker compose exec php composer install
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3) Prepare DB
|
### 3) Prepare DB
|
||||||
The setup script already prepares the DB. To run manually:
|
The setup script already prepares the DB. To run manually:
|
||||||
```
|
```
|
||||||
cd docker
|
docker compose -f docker/compose.yaml -f docker/compose.override.yaml exec php php bin/console doctrine:database:create --if-not-exists
|
||||||
docker compose exec php php bin/console doctrine:database:create --if-not-exists
|
docker compose -f docker/compose.yaml -f docker/compose.override.yaml exec php php bin/console doctrine:migrations:migrate -n
|
||||||
docker compose exec php php bin/console doctrine:migrations:migrate -n
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 4) Run tests
|
### 4) Run tests
|
||||||
```
|
```
|
||||||
cd docker
|
docker compose -f docker/compose.yaml -f docker/compose.override.yaml exec php vendor/bin/phpunit
|
||||||
docker compose exec php vendor/bin/phpunit
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 5) Logs
|
### 5) Logs
|
||||||
```
|
```
|
||||||
cd docker
|
docker compose -f docker/compose.yaml -f docker/compose.override.yaml logs -f nginx
|
||||||
docker compose logs -f nginx
|
docker compose -f docker/compose.yaml -f docker/compose.override.yaml logs -f php
|
||||||
docker compose logs -f php
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 6) Stop
|
### 6) Stop
|
||||||
```
|
```
|
||||||
cd docker
|
docker compose -f docker/compose.yaml -f docker/compose.override.yaml down
|
||||||
docker compose down
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|||||||
+11
-14
@@ -1,9 +1,9 @@
|
|||||||
# Email Delivery: Dev Mailcatcher & Production Mailgun
|
# Email Delivery: Dev Mailcatcher & Production SendGrid
|
||||||
|
|
||||||
This application uses Symfony Mailer. We separate development and production delivery:
|
This application uses Symfony Mailer. We separate development and production delivery:
|
||||||
|
|
||||||
- Development: Mailpit (mailcatcher) via SMTP in Docker.
|
- Development: Mailpit (mailcatcher) via SMTP in Docker.
|
||||||
- Production: Mailgun via API transport.
|
- Production: SendGrid via API transport.
|
||||||
|
|
||||||
## Development (Mailpit)
|
## Development (Mailpit)
|
||||||
|
|
||||||
@@ -18,31 +18,28 @@ MAILER_DSN=smtp://mailer:1025
|
|||||||
```
|
```
|
||||||
|
|
||||||
- Usage:
|
- Usage:
|
||||||
1. Start stack: `docker-compose up -d`
|
1. Start stack: `docker compose up -d`
|
||||||
2. Send an email from the app.
|
2. Send an email from the app.
|
||||||
3. Open http://localhost:8025 to view captured emails.
|
3. Open http://localhost:8025 to view captured emails.
|
||||||
|
|
||||||
## Production (Mailgun)
|
## Production (SendGrid)
|
||||||
|
|
||||||
Use the Mailgun API transport (`symfony/mailgun-mailer` bridge). Do not commit secrets.
|
Use the SendGrid API transport. Do not commit secrets.
|
||||||
|
|
||||||
- Example configuration is in `.env.prod`:
|
- Example configuration is in `.env.prod`:
|
||||||
|
|
||||||
```
|
```
|
||||||
MAILER_DSN=mailgun+api://${MAILGUN_API_KEY}:${MAILGUN_DOMAIN}@default?region=eu
|
MAILER_DSN=sendgrid+api://%env(resolve:SENDGRID_API_KEY)%@default
|
||||||
```
|
```
|
||||||
|
|
||||||
- `region=eu` is only needed if the Mailgun account/domain was created in Mailgun's EU region (common for `.nl`/EU-based senders). Drop it (or use `region=us`) if the domain lives in the US region.
|
- Provide `SENDGRID_API_KEY` via:
|
||||||
- Provide `MAILGUN_API_KEY` and `MAILGUN_DOMAIN` via:
|
- Real environment variable on the server/container, or
|
||||||
- Real environment variables on the server/container, or
|
- Symfony secrets: `php bin/console secrets:set SENDGRID_API_KEY` (and dump for prod), or
|
||||||
- Symfony secrets: `php bin/console secrets:set MAILGUN_API_KEY` (and dump for prod), or
|
|
||||||
- Orchestration secret stores (e.g., Docker/K8s).
|
- Orchestration secret stores (e.g., Docker/K8s).
|
||||||
- The sending domain must be added and DNS-verified (SPF/DKIM/tracking CNAME) in the Mailgun dashboard before production sending will work reliably; unverified domains are rate-limited/sandboxed.
|
|
||||||
|
|
||||||
### Notes
|
### Notes
|
||||||
- No Mailpit container is defined in the base `compose.yaml`, only in `compose.override.yaml`. This ensures it is used in development only.
|
- No Mailpit container is defined in the base `compose.yaml`, only in `compose.override.yaml`. This ensures it is used in development only.
|
||||||
- To test email locally without Docker, you can:
|
- To test email locally without Docker, you can:
|
||||||
- Run Mailpit on your host (ports 1025/8025) and set `MAILER_DSN=smtp://127.0.0.1:1025` in `.env.local`.
|
- Run Mailpit on your host (ports 1025/8025) and set `MAILER_DSN=smtp://127.0.0.1:1025` in `.env.local`.
|
||||||
- If you need to use Mailgun SMTP instead of API, a DSN example:
|
- If you need to use SendGrid SMTP instead of API, a DSN example:
|
||||||
`mailgun+smtp://USERNAME:PASSWORD@default?region=eu` (username/password come from the Mailgun domain's SMTP credentials).
|
`smtp://apikey:YOUR_SENDGRID_API_KEY@smtp.sendgrid.net:587`.
|
||||||
- Use `php bin/console app:mail:test you@example.com` to send a quick test email against whatever `MAILER_DSN` is currently configured.
|
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
# User and Group IDs
|
|
||||||
USER_ID=1000
|
|
||||||
GROUP_ID=1000
|
|
||||||
|
|
||||||
# Application
|
|
||||||
APP_ENV=prod
|
|
||||||
SITE_BASE_URL=https://escapepage.com
|
|
||||||
|
|
||||||
# Mailer
|
|
||||||
MAILGUN_API_KEY=CHANGEME_MAILGUN_API_KEY
|
|
||||||
MAILGUN_DOMAIN=CHANGEME_MAILGUN_DOMAIN
|
|
||||||
MAILER_DSN=mailgun+api://CHANGEME_MAILGUN_API_KEY:CHANGEME_MAILGUN_DOMAIN@default?region=eu
|
|
||||||
MAILER_FROM=mailer@escapepage.nl
|
|
||||||
|
|
||||||
# Database
|
|
||||||
DATABASE_URL=mysql://escapepage:CHANGEME_DB_PASSWORD@database:3306/escapepage?serverVersion=8.0.32&charset=utf8mb4
|
|
||||||
DB_NAME=escapepage
|
|
||||||
DB_USER=escapepage
|
|
||||||
DB_PASSWORD=CHANGEME_DB_PASSWORD
|
|
||||||
MYSQL_ROOT_PASSWORD=CHANGEME_MYSQL_ROOT_PASSWORD
|
|
||||||
|
|
||||||
# Mercure
|
|
||||||
MERCURE_URL=http://mercure/.well-known/mercure
|
|
||||||
MERCURE_PUBLIC_URL=https://mercure.escapepage.com/.well-known/mercure
|
|
||||||
MERCURE_JWT_SECRET=CHANGEME_MERCURE_JWT_SECRET
|
|
||||||
MERCURE_CORS_ALLOWED_ORIGINS=https://www.escapepage.com https://escapepage.com
|
|
||||||
MERCURE_TOPIC_BASE=https://escapepage.com
|
|
||||||
|
|
||||||
# Recaptcha
|
|
||||||
RECAPTCHA3_KEY=CHANGEME_RECAPTCHA3_KEY
|
|
||||||
RECAPTCHA3_SECRET=CHANGEME_RECAPTCHA3_SECRET
|
|
||||||
@@ -1,19 +1,20 @@
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
php:
|
php:
|
||||||
environment:
|
environment:
|
||||||
XDEBUG_MODE: "off"
|
XDEBUG_MODE: off
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- "host.docker.internal:host-gateway"
|
- "host.docker.internal:host-gateway"
|
||||||
depends_on:
|
depends_on:
|
||||||
- mailer
|
- mailer
|
||||||
# networks:
|
|
||||||
# backend:
|
|
||||||
# ipv4_address: 172.23.0.10
|
|
||||||
|
|
||||||
###> doctrine/doctrine-bundle ###
|
###> doctrine/doctrine-bundle ###
|
||||||
###< doctrine/doctrine-bundle ###
|
database:
|
||||||
|
ports:
|
||||||
|
- "3306"
|
||||||
|
###< doctrine/doctrine-bundle ###
|
||||||
|
|
||||||
###> symfony/mailer ###
|
###> symfony/mailer ###
|
||||||
mailer:
|
mailer:
|
||||||
image: axllent/mailpit
|
image: axllent/mailpit
|
||||||
ports:
|
ports:
|
||||||
@@ -22,17 +23,4 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
MP_SMTP_AUTH_ACCEPT_ANY: 1
|
MP_SMTP_AUTH_ACCEPT_ANY: 1
|
||||||
MP_SMTP_AUTH_ALLOW_INSECURE: 1
|
MP_SMTP_AUTH_ALLOW_INSECURE: 1
|
||||||
# networks:
|
|
||||||
# backend:
|
|
||||||
# ipv4_address: 172.23.0.13
|
|
||||||
|
|
||||||
# networks:
|
|
||||||
# backend:
|
|
||||||
# name: escapepage_network
|
|
||||||
# driver: bridge
|
|
||||||
# ipam:
|
|
||||||
# config:
|
|
||||||
# - subnet: 172.23.0.0/16
|
|
||||||
# gateway: 172.23.0.1
|
|
||||||
# attachable: true
|
|
||||||
###< symfony/mailer ###
|
###< symfony/mailer ###
|
||||||
|
|||||||
+32
-108
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
version: '3.7'
|
version: '3.7'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
@@ -5,98 +6,33 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: ..
|
context: ..
|
||||||
dockerfile: docker/php/Dockerfile
|
dockerfile: docker/php/Dockerfile
|
||||||
args:
|
|
||||||
USER_ID: ${USER_ID}
|
|
||||||
GROUP_ID: ${GROUP_ID}
|
|
||||||
container_name: escapepage-php
|
container_name: escapepage-php
|
||||||
volumes:
|
volumes:
|
||||||
- ../:/var/www/html:delegated
|
- ../:/var/www/html:delegated
|
||||||
- /etc/hosts:/etc/hosts:ro
|
|
||||||
environment:
|
environment:
|
||||||
APP_ENV: ${APP_ENV}
|
APP_ENV: dev
|
||||||
SITE_BASE_URL: ${SITE_BASE_URL}
|
|
||||||
MAILER_DSN: ${MAILER_DSN}
|
|
||||||
MAILER_FROM: ${MAILER_FROM}
|
|
||||||
DATABASE_URL: ${DATABASE_URL}
|
|
||||||
MERCURE_URL: ${MERCURE_URL}
|
|
||||||
MERCURE_PUBLIC_URL: ${MERCURE_PUBLIC_URL}
|
|
||||||
MERCURE_JWT_SECRET: ${MERCURE_JWT_SECRET}
|
|
||||||
MERCURE_CORS_ALLOWED_ORIGINS: ${MERCURE_CORS_ALLOWED_ORIGINS}
|
|
||||||
MERCURE_TOPIC_BASE: ${MERCURE_TOPIC_BASE}
|
|
||||||
RECAPTCHA3_KEY: ${RECAPTCHA3_KEY}
|
|
||||||
RECAPTCHA3_SECRET: ${RECAPTCHA3_SECRET}
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- database
|
- database
|
||||||
- mercure
|
- mercure
|
||||||
# networks:
|
networks:
|
||||||
# backend:
|
- backend
|
||||||
# ipv4_address: 172.23.0.10
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
php-worker:
|
php-worker:
|
||||||
build:
|
build:
|
||||||
context: ..
|
context: ..
|
||||||
dockerfile: docker/php/Dockerfile
|
dockerfile: docker/php/Dockerfile
|
||||||
args:
|
|
||||||
USER_ID: ${USER_ID}
|
|
||||||
GROUP_ID: ${GROUP_ID}
|
|
||||||
container_name: escapepage-php-worker
|
container_name: escapepage-php-worker
|
||||||
volumes:
|
volumes:
|
||||||
- ../:/var/www/html:delegated
|
- ../:/var/www/html:delegated
|
||||||
- /etc/hosts:/etc/hosts:ro
|
|
||||||
environment:
|
environment:
|
||||||
APP_ENV: ${APP_ENV}
|
APP_ENV: dev
|
||||||
SITE_BASE_URL: ${SITE_BASE_URL}
|
|
||||||
MAILER_DSN: ${MAILER_DSN}
|
|
||||||
MAILER_FROM: ${MAILER_FROM}
|
|
||||||
DATABASE_URL: ${DATABASE_URL}
|
|
||||||
MERCURE_URL: ${MERCURE_URL}
|
|
||||||
MERCURE_PUBLIC_URL: ${MERCURE_PUBLIC_URL}
|
|
||||||
MERCURE_JWT_SECRET: ${MERCURE_JWT_SECRET}
|
|
||||||
MERCURE_CORS_ALLOWED_ORIGINS: ${MERCURE_CORS_ALLOWED_ORIGINS}
|
|
||||||
MERCURE_TOPIC_BASE: ${MERCURE_TOPIC_BASE}
|
|
||||||
RECAPTCHA3_KEY: ${RECAPTCHA3_KEY}
|
|
||||||
RECAPTCHA3_SECRET: ${RECAPTCHA3_SECRET}
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- database
|
- database
|
||||||
- mercure
|
- mercure
|
||||||
command: ["php", "bin/console", "messenger:consume", "async", "-vv"]
|
command: ["php", "bin/console", "messenger:consume", "async", "-vv"]
|
||||||
# networks:
|
networks:
|
||||||
# backend:
|
- backend
|
||||||
# ipv4_address: 172.23.0.11
|
|
||||||
restart: unless-stopped
|
|
||||||
|
|
||||||
php-cron:
|
|
||||||
build:
|
|
||||||
context: ..
|
|
||||||
dockerfile: docker/php/Dockerfile
|
|
||||||
args:
|
|
||||||
USER_ID: ${USER_ID}
|
|
||||||
GROUP_ID: ${GROUP_ID}
|
|
||||||
container_name: escapepage-php-cron
|
|
||||||
volumes:
|
|
||||||
- ../:/var/www/html:delegated
|
|
||||||
- /etc/hosts:/etc/hosts:ro
|
|
||||||
environment:
|
|
||||||
APP_ENV: ${APP_ENV}
|
|
||||||
SITE_BASE_URL: ${SITE_BASE_URL}
|
|
||||||
MAILER_DSN: ${MAILER_DSN}
|
|
||||||
MAILER_FROM: ${MAILER_FROM}
|
|
||||||
DATABASE_URL: ${DATABASE_URL}
|
|
||||||
MERCURE_URL: ${MERCURE_URL}
|
|
||||||
MERCURE_PUBLIC_URL: ${MERCURE_PUBLIC_URL}
|
|
||||||
MERCURE_JWT_SECRET: ${MERCURE_JWT_SECRET}
|
|
||||||
MERCURE_CORS_ALLOWED_ORIGINS: ${MERCURE_CORS_ALLOWED_ORIGINS}
|
|
||||||
MERCURE_TOPIC_BASE: ${MERCURE_TOPIC_BASE}
|
|
||||||
RECAPTCHA3_KEY: ${RECAPTCHA3_KEY}
|
|
||||||
RECAPTCHA3_SECRET: ${RECAPTCHA3_SECRET}
|
|
||||||
depends_on:
|
|
||||||
- database
|
|
||||||
- mercure
|
|
||||||
command: ["crond", "-f", "-l", "2"]
|
|
||||||
# networks:
|
|
||||||
# backend:
|
|
||||||
# ipv4_address: 172.23.0.16
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
@@ -104,17 +40,13 @@ services:
|
|||||||
container_name: escapepage-nginx
|
container_name: escapepage-nginx
|
||||||
ports:
|
ports:
|
||||||
- "8080:80"
|
- "8080:80"
|
||||||
- "8443:443"
|
|
||||||
volumes:
|
volumes:
|
||||||
- ../:/var/www/html:ro
|
- ../:/var/www/html:ro
|
||||||
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
|
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
|
||||||
- ./nginx/ssl:/etc/nginx/ssl:ro
|
|
||||||
- /etc/hosts:/etc/hosts:ro
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- php
|
- php
|
||||||
# networks:
|
networks:
|
||||||
# backend:
|
- backend
|
||||||
# ipv4_address: 172.23.0.12
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
mailer:
|
mailer:
|
||||||
@@ -122,68 +54,60 @@ services:
|
|||||||
container_name: escapepage-mailer
|
container_name: escapepage-mailer
|
||||||
ports:
|
ports:
|
||||||
- "8025:8025"
|
- "8025:8025"
|
||||||
volumes:
|
|
||||||
- /etc/hosts:/etc/hosts:ro
|
|
||||||
networks:
|
networks:
|
||||||
- default
|
- backend
|
||||||
- nginx_proxy
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
mercure:
|
mercure:
|
||||||
image: dunglas/mercure:v0.21
|
image: dunglas/mercure:v0.21
|
||||||
container_name: escapepage-mercure
|
container_name: escapepage-mercure
|
||||||
environment:
|
environment:
|
||||||
SERVER_NAME: "http://:80"
|
SERVER_NAME: ":80"
|
||||||
MERCURE_PUBLISHER_JWT_KEY: ${MERCURE_JWT_SECRET}
|
MERCURE_PUBLISHER_JWT_KEY: ${MERCURE_JWT_SECRET}
|
||||||
MERCURE_SUBSCRIBER_JWT_KEY: ${MERCURE_JWT_SECRET}
|
MERCURE_SUBSCRIBER_JWT_KEY: ${MERCURE_JWT_SECRET}
|
||||||
MERCURE_CORS_ALLOWED_ORIGINS: ${MERCURE_CORS_ALLOWED_ORIGINS}
|
MERCURE_CORS_ALLOWED_ORIGINS: ${MERCURE_CORS_ALLOWED_ORIGINS:-http://localhost:8080}
|
||||||
MERCURE_PUBLISH_ALLOWED_ORIGINS: ${MERCURE_CORS_ALLOWED_ORIGINS}
|
MERCURE_PUBLISH_ALLOWED_ORIGINS: ${MERCURE_CORS_ALLOWED_ORIGINS:-http://localhost:8080}
|
||||||
MERCURE_EXTRA_DIRECTIVES: |
|
MERCURE_EXTRA_DIRECTIVES: |
|
||||||
cors_origins ${MERCURE_CORS_ALLOWED_ORIGINS}
|
cors_origins ${MERCURE_CORS_ALLOWED_ORIGINS:-http://localhost:8080}
|
||||||
publish_origins ${MERCURE_CORS_ALLOWED_ORIGINS}
|
# Allow anonymous subscribers in dev only
|
||||||
anonymous
|
anonymous
|
||||||
ports:
|
ports:
|
||||||
- "8090:80"
|
- "8090:80"
|
||||||
volumes:
|
|
||||||
- /etc/hosts:/etc/hosts:ro
|
|
||||||
networks:
|
networks:
|
||||||
- default
|
- backend
|
||||||
- nginx_proxy
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
###> doctrine/doctrine-bundle ###
|
###> doctrine/doctrine-bundle ###
|
||||||
database:
|
database:
|
||||||
image: mysql:8.0
|
image: mysql:8.0
|
||||||
container_name: escapepage-db
|
container_name: escapepage-db
|
||||||
environment:
|
environment:
|
||||||
MYSQL_DATABASE: ${DB_NAME}
|
MYSQL_DATABASE: ${DB_NAME:-app}
|
||||||
MYSQL_USER: ${DB_USER}
|
MYSQL_USER: ${DB_USER:-app}
|
||||||
MYSQL_PASSWORD: ${DB_PASSWORD}
|
MYSQL_PASSWORD: ${DB_PASSWORD:-!ChangeMe!}
|
||||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-uroot", "-p${MYSQL_ROOT_PASSWORD}"]
|
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-uroot", "-p${MYSQL_ROOT_PASSWORD:-root}"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 10
|
retries: 10
|
||||||
start_period: 30s
|
start_period: 30s
|
||||||
command: ["--default-authentication-plugin=mysql_native_password", "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci", "--lower-case-table-names=1", "--innodb-use-native-aio=0"]
|
command: ["--default-authentication-plugin=mysql_native_password", "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci"]
|
||||||
volumes:
|
volumes:
|
||||||
- ../var/volumes/db:/var/lib/mysql:rw
|
- database_data:/var/lib/mysql:rw
|
||||||
- ./mysql/init:/docker-entrypoint-initdb.d:ro
|
|
||||||
- /etc/hosts:/etc/hosts:ro
|
|
||||||
# Uncomment the two lines below if you need to access MySQL from your host (workbench, etc.)
|
# Uncomment the two lines below if you need to access MySQL from your host (workbench, etc.)
|
||||||
ports:
|
# ports:
|
||||||
- "3306:3306"
|
# - "3306:3306"
|
||||||
# networks:
|
networks:
|
||||||
# backend:
|
- backend
|
||||||
# ipv4_address: 172.23.0.15
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
###< doctrine/doctrine-bundle ###
|
###< doctrine/doctrine-bundle ###
|
||||||
|
|
||||||
|
volumes:
|
||||||
###> doctrine/doctrine-bundle ###
|
###> doctrine/doctrine-bundle ###
|
||||||
|
database_data:
|
||||||
###< doctrine/doctrine-bundle ###
|
###< doctrine/doctrine-bundle ###
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
nginx_proxy:
|
backend:
|
||||||
external: true
|
driver: bridge
|
||||||
name: nginx_default
|
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
-- This script ensures the user has correct privileges.
|
|
||||||
-- The user is actually created by the official MySQL image using environment variables.
|
|
||||||
|
|
||||||
GRANT ALL PRIVILEGES ON *.* TO 'escapepage'@'%';
|
|
||||||
FLUSH PRIVILEGES;
|
|
||||||
@@ -1,18 +1,6 @@
|
|||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name _;
|
server_name _;
|
||||||
return 301 https://$host$request_uri;
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 443 ssl;
|
|
||||||
server_name _;
|
|
||||||
|
|
||||||
ssl_certificate /etc/nginx/ssl/server.crt;
|
|
||||||
ssl_certificate_key /etc/nginx/ssl/server.key;
|
|
||||||
|
|
||||||
ssl_protocols TLSv1.2 TLSv1.3;
|
|
||||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
|
||||||
|
|
||||||
root /var/www/html/public;
|
root /var/www/html/public;
|
||||||
index index.php index.html;
|
index index.php index.html;
|
||||||
@@ -30,14 +18,6 @@ server {
|
|||||||
fastcgi_param DOCUMENT_ROOT $realpath_root;
|
fastcgi_param DOCUMENT_ROOT $realpath_root;
|
||||||
fastcgi_pass php:9000;
|
fastcgi_pass php:9000;
|
||||||
fastcgi_read_timeout 120;
|
fastcgi_read_timeout 120;
|
||||||
|
|
||||||
# Ensure HTTPS is correctly detected by Symfony if Nginx is behind a TLS termination proxy
|
|
||||||
fastcgi_param HTTPS $https if_not_empty;
|
|
||||||
# Standard forwarded headers
|
|
||||||
fastcgi_param HTTP_X_FORWARDED_FOR $proxy_add_x_forwarded_for;
|
|
||||||
fastcgi_param HTTP_X_FORWARDED_PROTO $scheme;
|
|
||||||
fastcgi_param HTTP_X_FORWARDED_HOST $host;
|
|
||||||
fastcgi_param HTTP_X_FORWARDED_PORT $server_port;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ /\.ht {
|
location ~ /\.ht {
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
-----BEGIN CERTIFICATE-----
|
|
||||||
MIIDrTCCApWgAwIBAgIURXHwywjcTFR43Q8+qtMAMuhHmW0wDQYJKoZIhvcNAQEL
|
|
||||||
BQAwZjELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVN0YXRlMQ0wCwYDVQQHDARDaXR5
|
|
||||||
MRUwEwYDVQQKDAxPcmdhbml6YXRpb24xDTALBgNVBAsMBFVuaXQxEjAQBgNVBAMM
|
|
||||||
CWxvY2FsaG9zdDAeFw0yNjAxMTAxMjMzNTNaFw0yNzAxMTAxMjMzNTNaMGYxCzAJ
|
|
||||||
BgNVBAYTAlVTMQ4wDAYDVQQIDAVTdGF0ZTENMAsGA1UEBwwEQ2l0eTEVMBMGA1UE
|
|
||||||
CgwMT3JnYW5pemF0aW9uMQ0wCwYDVQQLDARVbml0MRIwEAYDVQQDDAlsb2NhbGhv
|
|
||||||
c3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC0dQIpm6SeY/Qt1zTr
|
|
||||||
GDfQuRAqowde6vzlNDwwC5hNQUaA4MCsDcmqmxj/YPUA8qG4MWQzYsj3HEn8l863
|
|
||||||
a7BELIYy2kvHTO7mgZMsBiH6HzHilIOsZkMJEV3QLlFn7VRb7i6WSw48pbRJk77l
|
|
||||||
sOX/e3vzE2pemnx4ggSORzNorrQ7UwyBpK374yisKSFzs6KKPnkVDbfBNX2k+fUT
|
|
||||||
8Ncjq5WkllA93ztPzh1iHNcFThx+MiH5fcs9obdMbfNkcQy22J9Nbi0OT9Tf8R7k
|
|
||||||
OaBEVPxFkT+moj6bCwetLkdQDGaoGA6AXTR1lrN812eU1TJ6KA4TAOj4ZAuygWa0
|
|
||||||
kqi3AgMBAAGjUzBRMB0GA1UdDgQWBBSayyPInKCPbaliYycRx9GEK2tTFjAfBgNV
|
|
||||||
HSMEGDAWgBSayyPInKCPbaliYycRx9GEK2tTFjAPBgNVHRMBAf8EBTADAQH/MA0G
|
|
||||||
CSqGSIb3DQEBCwUAA4IBAQCT3r5wZd8fN/ognHFopJRKxjw3ZBBYl54ELb32OSVS
|
|
||||||
NcKR63/2kZc7KQY5LjPbBMpDutLUPsVtJ97OSYY/JQDm/VVkJy0jIUtPD/bLnjEI
|
|
||||||
bhMoIGKwUDtnSaYF3oXhwMX3XchDCLmpsk+E17LTTq+tHUzkhXZu+sHoHrE70Wls
|
|
||||||
XfziM0O/zpApJQSeCLi8UDGffLVChFQd4uU//YW+4OMyk/mbu7dV4ckJXQVIvqTr
|
|
||||||
7UuC7SgRChcYkaQpkDUnaoX+miKbr9SHUmBSbCsXDyPDth5TOUSZWbP6ewDKVWW7
|
|
||||||
37OURA5UqT2RvnX75+FdLnBtqJrt/3X8wafOOLXILwmA
|
|
||||||
-----END CERTIFICATE-----
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
-----BEGIN PRIVATE KEY-----
|
|
||||||
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC0dQIpm6SeY/Qt
|
|
||||||
1zTrGDfQuRAqowde6vzlNDwwC5hNQUaA4MCsDcmqmxj/YPUA8qG4MWQzYsj3HEn8
|
|
||||||
l863a7BELIYy2kvHTO7mgZMsBiH6HzHilIOsZkMJEV3QLlFn7VRb7i6WSw48pbRJ
|
|
||||||
k77lsOX/e3vzE2pemnx4ggSORzNorrQ7UwyBpK374yisKSFzs6KKPnkVDbfBNX2k
|
|
||||||
+fUT8Ncjq5WkllA93ztPzh1iHNcFThx+MiH5fcs9obdMbfNkcQy22J9Nbi0OT9Tf
|
|
||||||
8R7kOaBEVPxFkT+moj6bCwetLkdQDGaoGA6AXTR1lrN812eU1TJ6KA4TAOj4ZAuy
|
|
||||||
gWa0kqi3AgMBAAECggEAfwOccgzK4XEY/OrspEx3fMHFTz1Qgs6DEhCiDG8c08OO
|
|
||||||
DEglVPSfbSWdgqKL0A73JN4e2Mw/By8yJEf1h8SUXGe6TTC5BZ5wyG2LWQE4CQTL
|
|
||||||
598AjuerZ0aB8XWodq3lIo+S2tYZPzainucPBjxsplYT+BNCWzQBSBC7hCk5VgPx
|
|
||||||
6BvzlzBEWJYizpnT55Ta7zDV1tofP2RUt5Q6GT27Qm5fMlAj3a3LsmgeDLIPHhQd
|
|
||||||
RCo0kEc56X4vZyojaNUrmTzh6+Ljoj7ahEsW9fr8kfQvIlvuR1qjkuuCEUDU7kS/
|
|
||||||
iblwVkY1Lfrfm9mI82EYI287m28LBTP99ULk9KRhAQKBgQDpEjK0/OmsHSQfjiG7
|
|
||||||
PHQXrmIdMzaz+BYttiGV9Fx5hsdVPvihdjzzwZck2MkSg5ODMtEthb7uBareS3Nl
|
|
||||||
CG7a7brY8a/x5ZdnUPNXGykfix/oz557EENembKaWpsV8qiHM8vuADOWEvmqBTVt
|
|
||||||
C0iXrwvyxgy/GuNz9A9Tfyya3wKBgQDGNb9Pr903/JzJKFkT+4dGpAgE0a3eQsDm
|
|
||||||
HEJimbhNoOw79AyOHWbpV2f74kz0GdG2MjU3988lZ/VJ7FM0eyDkuBvv3c2YdKCm
|
|
||||||
A/5tprB/8PefdNJD0HuVm4BE2XDLV74DbOCgoqsFMC1BdeUVBAhSqmRNrYFQYRqj
|
|
||||||
DvqtDQiFKQKBgB5p6YQEnNmA0/3qJiywrtWIQ/VbgX/ql7pPUgKnaInTNJ/DH96x
|
|
||||||
9zI3yOleAJ8R3GX6c6FlGo0k4C8x2VUNzKl07DTzFOqT8zXgMmDjgnJDTV6r+RpF
|
|
||||||
/QSTOeM6f5JVn/hEog/kptamkz3EgDxChK6GgSClB3TIpXW0G2vh5IgxAoGBAIIl
|
|
||||||
WHDicMcKP4h1zcepKLHhksJXS2rdOfveIljLxpByUassG/JUq/YbRlPFy/Gb4m9X
|
|
||||||
mEoflQxirlTTr+6NypNjsDRX1197dOCNTsqA4POhLXauJkIQ6pTZfee3PrDF9CYb
|
|
||||||
n4LaTKEjeRO6bajW9QASkbnPa1Fz8SGP/FkUbbvBAoGAKIuvVLwht1A8C0BXaFrb
|
|
||||||
znZu3u90SB9TEcm2V9pU1ptiU6Q/CGlxm8UYvx1ahmxNYL6Ip/QNIFyb+HCqvIUf
|
|
||||||
Id3C+4LlLeXVBP0uBCX828zREhuQutq3kju2iOQfsOkwc1McS4WXk6tExXoVwkzl
|
|
||||||
2WYMu+GpSZLcti71L58tOf4=
|
|
||||||
-----END PRIVATE KEY-----
|
|
||||||
+3
-46
@@ -6,33 +6,15 @@ RUN apk add --no-cache \
|
|||||||
git \
|
git \
|
||||||
icu-dev \
|
icu-dev \
|
||||||
libzip-dev \
|
libzip-dev \
|
||||||
libxml2-dev \
|
|
||||||
oniguruma-dev \
|
oniguruma-dev \
|
||||||
g++ \
|
g++ \
|
||||||
make \
|
make \
|
||||||
nodejs \
|
nodejs \
|
||||||
npm \
|
npm
|
||||||
shadow \
|
|
||||||
logrotate
|
|
||||||
|
|
||||||
# Install PHP extension installer
|
|
||||||
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
|
|
||||||
|
|
||||||
# Install PHP extensions
|
# Install PHP extensions
|
||||||
RUN install-php-extensions \
|
RUN docker-php-ext-configure intl \
|
||||||
intl \
|
&& docker-php-ext-install -j$(nproc) intl pdo pdo_mysql opcache zip
|
||||||
pdo_mysql \
|
|
||||||
opcache \
|
|
||||||
zip \
|
|
||||||
tokenizer \
|
|
||||||
ctype \
|
|
||||||
iconv \
|
|
||||||
mbstring \
|
|
||||||
dom \
|
|
||||||
xml \
|
|
||||||
simplexml \
|
|
||||||
xmlreader \
|
|
||||||
xmlwriter
|
|
||||||
|
|
||||||
# Install composer
|
# Install composer
|
||||||
ENV COMPOSER_ALLOW_SUPERUSER=1 \
|
ENV COMPOSER_ALLOW_SUPERUSER=1 \
|
||||||
@@ -42,32 +24,7 @@ COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
|||||||
# Configure PHP
|
# Configure PHP
|
||||||
COPY docker/php/php.ini $PHP_INI_DIR/conf.d/zz-custom.ini
|
COPY docker/php/php.ini $PHP_INI_DIR/conf.d/zz-custom.ini
|
||||||
|
|
||||||
# Cron daemon (BusyBox's built-in crond) for the php-cron container.
|
|
||||||
# Harmless for the php/php-worker containers too, since they never invoke crond.
|
|
||||||
COPY docker/php/crontab /etc/crontabs/root
|
|
||||||
RUN chmod 0600 /etc/crontabs/root
|
|
||||||
|
|
||||||
# Log rotation for the cron hint-check and PHP error logs: 25MB per file, kept for 3 months.
|
|
||||||
COPY docker/php/logrotate/cron-hints.conf /etc/logrotate.d/cron-hints
|
|
||||||
COPY docker/php/logrotate/php-logs.conf /etc/logrotate.d/php-logs
|
|
||||||
|
|
||||||
# Adjust www-data UID/GID to match host user (default 1000)
|
|
||||||
ARG USER_ID=1000
|
|
||||||
ARG GROUP_ID=1000
|
|
||||||
|
|
||||||
RUN if [ ${USER_ID:-0} -ne 0 ] && [ ${GROUP_ID:-0} -ne 0 ]; then \
|
|
||||||
userdel -f www-data &&\
|
|
||||||
if getent group www-data ; then groupdel www-data; fi &&\
|
|
||||||
groupadd -g ${GROUP_ID} www-data &&\
|
|
||||||
useradd -l -u ${USER_ID} -g www-data www-data &&\
|
|
||||||
install -d -m 0755 -o www-data -g www-data /home/www-data \
|
|
||||||
;fi
|
|
||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
# Set permissions for Symfony directories
|
|
||||||
RUN mkdir -p var/cache var/log/cron var/log/php var/sessions && \
|
|
||||||
chown -R www-data:www-data var
|
|
||||||
|
|
||||||
# Default command
|
# Default command
|
||||||
CMD ["php-fpm"]
|
CMD ["php-fpm"]
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
* * * * * php /var/www/html/bin/console app:hints:check >> /var/www/html/var/log/cron/cron.log 2>&1
|
|
||||||
5 3 * * * logrotate -s /var/www/html/var/log/.logrotate.state /etc/logrotate.d/cron-hints /etc/logrotate.d/php-logs
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
/var/www/html/var/log/cron/cron.log {
|
|
||||||
size 25M
|
|
||||||
rotate 100
|
|
||||||
maxage 90
|
|
||||||
missingok
|
|
||||||
notifempty
|
|
||||||
compress
|
|
||||||
delaycompress
|
|
||||||
dateext
|
|
||||||
dateformat -%Y%m%d-%s
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
/var/www/html/var/log/php/*.log {
|
|
||||||
size 25M
|
|
||||||
rotate 100
|
|
||||||
maxage 90
|
|
||||||
missingok
|
|
||||||
notifempty
|
|
||||||
compress
|
|
||||||
delaycompress
|
|
||||||
dateext
|
|
||||||
dateformat -%Y%m%d-%s
|
|
||||||
}
|
|
||||||
@@ -7,8 +7,3 @@ opcache.enable=1
|
|||||||
opcache.enable_cli=1
|
opcache.enable_cli=1
|
||||||
opcache.validate_timestamps=1
|
opcache.validate_timestamps=1
|
||||||
opcache.revalidate_freq=0
|
opcache.revalidate_freq=0
|
||||||
|
|
||||||
log_errors=On
|
|
||||||
error_log=/var/www/html/var/log/php/error.log
|
|
||||||
session.gc_maxlifetime=1440
|
|
||||||
session.cookie_lifetime=0
|
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
# Script to completely restart the project as requested
|
|
||||||
# Can be run from any directory
|
|
||||||
|
|
||||||
DOCKER_DIR=$(cd "$(dirname "$0")" && pwd)
|
|
||||||
ROOT_DIR=$(cd "$DOCKER_DIR/.." && pwd)
|
|
||||||
|
|
||||||
echo "Stopping and removing containers..."
|
|
||||||
(cd "$DOCKER_DIR" && docker compose -f compose.yaml -f compose.override.yaml down -v --remove-orphans) || true
|
|
||||||
docker network rm escapepage_network || true
|
|
||||||
docker network rm $(docker network ls -q --filter name=escapepage) || true
|
|
||||||
docker network prune -f || true
|
|
||||||
docker rm -f escapepage-db escapepage-php escapepage-nginx escapepage-mercure escapepage-mailer escapepage-php-worker escapepage-php-cron || true
|
|
||||||
docker system prune -f || true
|
|
||||||
|
|
||||||
echo "Clearing Docker build cache..."
|
|
||||||
docker builder prune -af
|
|
||||||
|
|
||||||
echo "Setting permissions for var/volumes/db and var directories..."
|
|
||||||
sudo chown -R 1000:1000 "$ROOT_DIR/var/volumes/db" || true
|
|
||||||
sudo chmod -R 777 "$ROOT_DIR/var/volumes/db" || true
|
|
||||||
sudo mkdir -p "$ROOT_DIR/var/cache" "$ROOT_DIR/var/log/cron" "$ROOT_DIR/var/log/php" "$ROOT_DIR/var/sessions"
|
|
||||||
sudo chown -R 1000:1000 "$ROOT_DIR/var" || true
|
|
||||||
sudo chmod -R 777 "$ROOT_DIR/var" || true
|
|
||||||
|
|
||||||
echo "Running setup script..."
|
|
||||||
"$DOCKER_DIR/setup.sh" --no-build
|
|
||||||
Executable → Regular
+7
-19
@@ -17,18 +17,18 @@ set -euo pipefail
|
|||||||
|
|
||||||
ROOT_DIR=$(cd "$(dirname "$0")"/.. && pwd)
|
ROOT_DIR=$(cd "$(dirname "$0")"/.. && pwd)
|
||||||
DOCKER_DIR="$ROOT_DIR/docker"
|
DOCKER_DIR="$ROOT_DIR/docker"
|
||||||
# Determine the docker-compose command
|
# Determine the docker compose command (V2 'docker compose' or V1 'docker-compose')
|
||||||
if docker compose version >/dev/null 2>&1; then
|
if docker compose version >/dev/null 2>&1; then
|
||||||
DOCKER_COMPOSE="docker compose"
|
DOCKER_COMPOSE="docker compose"
|
||||||
elif command -v docker-compose >/dev/null 2>&1; then
|
elif command -v docker-compose >/dev/null 2>&1; then
|
||||||
DOCKER_COMPOSE="docker-compose"
|
DOCKER_COMPOSE="docker-compose"
|
||||||
else
|
else
|
||||||
echo "Error: Neither 'docker-compose' nor 'docker compose' was found. Please install Docker Compose." >&2
|
echo "Error: Neither 'docker compose' nor 'docker-compose' was found. Please install Docker Compose." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Helper to run docker compose from the docker directory
|
# Helper to run docker compose from the docker/ directory
|
||||||
dc() { (cd "$DOCKER_DIR" && $DOCKER_COMPOSE -f compose.yaml -f compose.override.yaml "$@"); }
|
dc() { (cd "$DOCKER_DIR" && $DOCKER_COMPOSE -f compose.yaml "$@"); }
|
||||||
|
|
||||||
REBUILD=1
|
REBUILD=1
|
||||||
RECREATE=0
|
RECREATE=0
|
||||||
@@ -61,7 +61,7 @@ if [ "$RECREATE" -eq 1 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Start stack
|
# Start stack
|
||||||
dc up -d "${BUILD_ARGS[@]}"
|
dc up "${BUILD_ARGS[@]}"
|
||||||
|
|
||||||
# Helper to run commands in php container
|
# Helper to run commands in php container
|
||||||
pexec() { dc exec -T php "$@"; }
|
pexec() { dc exec -T php "$@"; }
|
||||||
@@ -104,17 +104,9 @@ fi
|
|||||||
|
|
||||||
# Prepare DB
|
# Prepare DB
|
||||||
echo "Creating database if it doesn't exist..."
|
echo "Creating database if it doesn't exist..."
|
||||||
if ! pexec php bin/console doctrine:database:create --if-not-exists; then
|
pexec php bin/console doctrine:database:create --if-not-exists
|
||||||
echo "Error: Database creation failed. Check Docker logs for details." >&2
|
|
||||||
dc logs database
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Running migrations..."
|
echo "Running migrations..."
|
||||||
if ! pexec php bin/console doctrine:migrations:migrate -n; then
|
pexec php bin/console doctrine:migrations:migrate -n
|
||||||
echo "Error: Migrations failed." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Import JS deps (Importmap/Asset Mapper)
|
# Import JS deps (Importmap/Asset Mapper)
|
||||||
if [ -f "$ROOT_DIR/importmap.php" ]; then
|
if [ -f "$ROOT_DIR/importmap.php" ]; then
|
||||||
@@ -143,10 +135,6 @@ Common commands:
|
|||||||
(cd "$DOCKER_DIR" && $DOCKER_COMPOSE logs -f nginx)
|
(cd "$DOCKER_DIR" && $DOCKER_COMPOSE logs -f nginx)
|
||||||
(cd "$DOCKER_DIR" && $DOCKER_COMPOSE logs -f php)
|
(cd "$DOCKER_DIR" && $DOCKER_COMPOSE logs -f php)
|
||||||
(cd "$DOCKER_DIR" && $DOCKER_COMPOSE logs -f php-worker)
|
(cd "$DOCKER_DIR" && $DOCKER_COMPOSE logs -f php-worker)
|
||||||
(cd "$DOCKER_DIR" && $DOCKER_COMPOSE logs -f php-cron) # crond scheduler activity
|
|
||||||
tail -f "$ROOT_DIR/var/log/cron/cron.log" # hint-check command output
|
|
||||||
tail -f "$ROOT_DIR/var/log/php/error.log" # raw PHP errors
|
|
||||||
tail -f "$ROOT_DIR/var/log/php/prod.log" # Symfony app errors (prod only)
|
|
||||||
(cd "$DOCKER_DIR" && $DOCKER_COMPOSE exec php bash)
|
(cd "$DOCKER_DIR" && $DOCKER_COMPOSE exec php bash)
|
||||||
(cd "$DOCKER_DIR" && $DOCKER_COMPOSE exec php npm run watch)
|
(cd "$DOCKER_DIR" && $DOCKER_COMPOSE exec php npm run watch)
|
||||||
(cd "$DOCKER_DIR" && $DOCKER_COMPOSE down)
|
(cd "$DOCKER_DIR" && $DOCKER_COMPOSE down)
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20260117143000 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return 'Make player.screen nullable';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('ALTER TABLE player CHANGE screen screen INT DEFAULT NULL');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('ALTER TABLE player CHANGE screen screen INT NOT NULL');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
final class Version20260627140000 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return 'Seed initial game: AI Virus Deflection';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql("INSERT INTO game (name, number_of_players, status) VALUES ('AI Virus Deflection', 3, 'inDevelopment')");
|
|
||||||
$this->addSql("INSERT INTO game_setting (game_id, name, value) VALUES (LAST_INSERT_ID(), 'totalTime', '1800')");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql("DELETE gs FROM game_setting gs INNER JOIN game g ON gs.game_id = g.id WHERE g.name = 'AI Virus Deflection'");
|
|
||||||
$this->addSql("DELETE FROM game WHERE name = 'AI Virus Deflection'");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
final class Version20260704160000 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return 'Add marketing_opt_in column to user table';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql('ALTER TABLE `user` ADD marketing_opt_in TINYINT(1) NOT NULL DEFAULT 0');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql('ALTER TABLE `user` DROP marketing_opt_in');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
final class Version20260711210000 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return 'Add deleted_at and last_login_at to user table; cascade-delete email_log and reset_password_request rows';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql('ALTER TABLE `user` ADD deleted_at DATETIME DEFAULT NULL, ADD last_login_at DATETIME DEFAULT NULL');
|
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE email_log DROP FOREIGN KEY FK_6FB4883A76ED395');
|
|
||||||
$this->addSql('ALTER TABLE email_log ADD CONSTRAINT FK_6FB4883A76ED395 FOREIGN KEY (user_id) REFERENCES `user` (id) ON DELETE CASCADE');
|
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE reset_password_request DROP FOREIGN KEY FK_7CE748AA76ED395');
|
|
||||||
$this->addSql('ALTER TABLE reset_password_request ADD CONSTRAINT FK_7CE748AA76ED395 FOREIGN KEY (user_id) REFERENCES `user` (id) ON DELETE CASCADE');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql('ALTER TABLE email_log DROP FOREIGN KEY FK_6FB4883A76ED395');
|
|
||||||
$this->addSql('ALTER TABLE email_log ADD CONSTRAINT FK_6FB4883A76ED395 FOREIGN KEY (user_id) REFERENCES `user` (id)');
|
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE reset_password_request DROP FOREIGN KEY FK_7CE748AA76ED395');
|
|
||||||
$this->addSql('ALTER TABLE reset_password_request ADD CONSTRAINT FK_7CE748AA76ED395 FOREIGN KEY (user_id) REFERENCES `user` (id)');
|
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE `user` DROP deleted_at, DROP last_login_at');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
final class Version20260810120000 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return 'Add lobby_message table for pre-game lobby chat';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql('CREATE TABLE lobby_message (id INT AUTO_INCREMENT NOT NULL, session_id INT NOT NULL, player_id INT NOT NULL, content VARCHAR(500) NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_LOBBY_MESSAGE_SESSION (session_id), INDEX IDX_LOBBY_MESSAGE_PLAYER (player_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
|
|
||||||
$this->addSql('ALTER TABLE lobby_message ADD CONSTRAINT FK_LOBBY_MESSAGE_SESSION FOREIGN KEY (session_id) REFERENCES session (id)');
|
|
||||||
$this->addSql('ALTER TABLE lobby_message ADD CONSTRAINT FK_LOBBY_MESSAGE_PLAYER FOREIGN KEY (player_id) REFERENCES player (id)');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql('ALTER TABLE lobby_message DROP FOREIGN KEY FK_LOBBY_MESSAGE_SESSION');
|
|
||||||
$this->addSql('ALTER TABLE lobby_message DROP FOREIGN KEY FK_LOBBY_MESSAGE_PLAYER');
|
|
||||||
$this->addSql('DROP TABLE lobby_message');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
final class Version20260810130000 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return 'Add finished_at column to session table';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql('ALTER TABLE session ADD finished_at DATETIME DEFAULT NULL');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql('ALTER TABLE session DROP finished_at');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Generated
-494
@@ -8,11 +8,6 @@
|
|||||||
"name": "escapepage",
|
"name": "escapepage",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"dependencies": {
|
|
||||||
"@popperjs/core": "^2.11.8",
|
|
||||||
"bootstrap": "^5.3.8",
|
|
||||||
"bootstrap-icons": "^1.13.1"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.25.0",
|
"@babel/core": "^7.25.0",
|
||||||
"@babel/preset-env": "^7.25.0",
|
"@babel/preset-env": "^7.25.0",
|
||||||
@@ -22,8 +17,6 @@
|
|||||||
"css-loader": "^7.1.2",
|
"css-loader": "^7.1.2",
|
||||||
"mini-css-extract-plugin": "^2.9.2",
|
"mini-css-extract-plugin": "^2.9.2",
|
||||||
"regenerator-runtime": "^0.14.1",
|
"regenerator-runtime": "^0.14.1",
|
||||||
"sass": "^1.101.0",
|
|
||||||
"sass-loader": "^14.2.1",
|
|
||||||
"webpack": "^5.95.0",
|
"webpack": "^5.95.0",
|
||||||
"webpack-cli": "^5.1.4",
|
"webpack-cli": "^5.1.4",
|
||||||
"webpack-notifier": "^1.15.0"
|
"webpack-notifier": "^1.15.0"
|
||||||
@@ -1750,340 +1743,6 @@
|
|||||||
"node": ">=4"
|
"node": ">=4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@parcel/watcher": {
|
|
||||||
"version": "2.5.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.6.tgz",
|
|
||||||
"integrity": "sha512-tmmZ3lQxAe/k/+rNnXQRawJ4NjxO2hqiOLTHvWchtGZULp4RyFeh6aU4XdOYBFe2KE1oShQTv4AblOs2iOrNnQ==",
|
|
||||||
"dev": true,
|
|
||||||
"hasInstallScript": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"dependencies": {
|
|
||||||
"detect-libc": "^2.0.3",
|
|
||||||
"is-glob": "^4.0.3",
|
|
||||||
"node-addon-api": "^7.0.0",
|
|
||||||
"picomatch": "^4.0.3"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 10.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/parcel"
|
|
||||||
},
|
|
||||||
"optionalDependencies": {
|
|
||||||
"@parcel/watcher-android-arm64": "2.5.6",
|
|
||||||
"@parcel/watcher-darwin-arm64": "2.5.6",
|
|
||||||
"@parcel/watcher-darwin-x64": "2.5.6",
|
|
||||||
"@parcel/watcher-freebsd-x64": "2.5.6",
|
|
||||||
"@parcel/watcher-linux-arm-glibc": "2.5.6",
|
|
||||||
"@parcel/watcher-linux-arm-musl": "2.5.6",
|
|
||||||
"@parcel/watcher-linux-arm64-glibc": "2.5.6",
|
|
||||||
"@parcel/watcher-linux-arm64-musl": "2.5.6",
|
|
||||||
"@parcel/watcher-linux-x64-glibc": "2.5.6",
|
|
||||||
"@parcel/watcher-linux-x64-musl": "2.5.6",
|
|
||||||
"@parcel/watcher-win32-arm64": "2.5.6",
|
|
||||||
"@parcel/watcher-win32-ia32": "2.5.6",
|
|
||||||
"@parcel/watcher-win32-x64": "2.5.6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@parcel/watcher-android-arm64": {
|
|
||||||
"version": "2.5.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.6.tgz",
|
|
||||||
"integrity": "sha512-YQxSS34tPF/6ZG7r/Ih9xy+kP/WwediEUsqmtf0cuCV5TPPKw/PQHRhueUo6JdeFJaqV3pyjm0GdYjZotbRt/A==",
|
|
||||||
"cpu": [
|
|
||||||
"arm64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"android"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 10.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/parcel"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@parcel/watcher-darwin-arm64": {
|
|
||||||
"version": "2.5.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.6.tgz",
|
|
||||||
"integrity": "sha512-Z2ZdrnwyXvvvdtRHLmM4knydIdU9adO3D4n/0cVipF3rRiwP+3/sfzpAwA/qKFL6i1ModaabkU7IbpeMBgiVEA==",
|
|
||||||
"cpu": [
|
|
||||||
"arm64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"darwin"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 10.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/parcel"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@parcel/watcher-darwin-x64": {
|
|
||||||
"version": "2.5.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.6.tgz",
|
|
||||||
"integrity": "sha512-HgvOf3W9dhithcwOWX9uDZyn1lW9R+7tPZ4sug+NGrGIo4Rk1hAXLEbcH1TQSqxts0NYXXlOWqVpvS1SFS4fRg==",
|
|
||||||
"cpu": [
|
|
||||||
"x64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"darwin"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 10.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/parcel"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@parcel/watcher-freebsd-x64": {
|
|
||||||
"version": "2.5.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.6.tgz",
|
|
||||||
"integrity": "sha512-vJVi8yd/qzJxEKHkeemh7w3YAn6RJCtYlE4HPMoVnCpIXEzSrxErBW5SJBgKLbXU3WdIpkjBTeUNtyBVn8TRng==",
|
|
||||||
"cpu": [
|
|
||||||
"x64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"freebsd"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 10.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/parcel"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@parcel/watcher-linux-arm-glibc": {
|
|
||||||
"version": "2.5.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.6.tgz",
|
|
||||||
"integrity": "sha512-9JiYfB6h6BgV50CCfasfLf/uvOcJskMSwcdH1PHH9rvS1IrNy8zad6IUVPVUfmXr+u+Km9IxcfMLzgdOudz9EQ==",
|
|
||||||
"cpu": [
|
|
||||||
"arm"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"linux"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 10.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/parcel"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@parcel/watcher-linux-arm-musl": {
|
|
||||||
"version": "2.5.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.6.tgz",
|
|
||||||
"integrity": "sha512-Ve3gUCG57nuUUSyjBq/MAM0CzArtuIOxsBdQ+ftz6ho8n7s1i9E1Nmk/xmP323r2YL0SONs1EuwqBp2u1k5fxg==",
|
|
||||||
"cpu": [
|
|
||||||
"arm"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"linux"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 10.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/parcel"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@parcel/watcher-linux-arm64-glibc": {
|
|
||||||
"version": "2.5.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.6.tgz",
|
|
||||||
"integrity": "sha512-f2g/DT3NhGPdBmMWYoxixqYr3v/UXcmLOYy16Bx0TM20Tchduwr4EaCbmxh1321TABqPGDpS8D/ggOTaljijOA==",
|
|
||||||
"cpu": [
|
|
||||||
"arm64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"linux"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 10.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/parcel"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@parcel/watcher-linux-arm64-musl": {
|
|
||||||
"version": "2.5.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.6.tgz",
|
|
||||||
"integrity": "sha512-qb6naMDGlbCwdhLj6hgoVKJl2odL34z2sqkC7Z6kzir8b5W65WYDpLB6R06KabvZdgoHI/zxke4b3zR0wAbDTA==",
|
|
||||||
"cpu": [
|
|
||||||
"arm64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"linux"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 10.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/parcel"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@parcel/watcher-linux-x64-glibc": {
|
|
||||||
"version": "2.5.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.6.tgz",
|
|
||||||
"integrity": "sha512-kbT5wvNQlx7NaGjzPFu8nVIW1rWqV780O7ZtkjuWaPUgpv2NMFpjYERVi0UYj1msZNyCzGlaCWEtzc+exjMGbQ==",
|
|
||||||
"cpu": [
|
|
||||||
"x64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"linux"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 10.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/parcel"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@parcel/watcher-linux-x64-musl": {
|
|
||||||
"version": "2.5.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.6.tgz",
|
|
||||||
"integrity": "sha512-1JRFeC+h7RdXwldHzTsmdtYR/Ku8SylLgTU/reMuqdVD7CtLwf0VR1FqeprZ0eHQkO0vqsbvFLXUmYm/uNKJBg==",
|
|
||||||
"cpu": [
|
|
||||||
"x64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"linux"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 10.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/parcel"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@parcel/watcher-win32-arm64": {
|
|
||||||
"version": "2.5.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.6.tgz",
|
|
||||||
"integrity": "sha512-3ukyebjc6eGlw9yRt678DxVF7rjXatWiHvTXqphZLvo7aC5NdEgFufVwjFfY51ijYEWpXbqF5jtrK275z52D4Q==",
|
|
||||||
"cpu": [
|
|
||||||
"arm64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"win32"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 10.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/parcel"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@parcel/watcher-win32-ia32": {
|
|
||||||
"version": "2.5.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.6.tgz",
|
|
||||||
"integrity": "sha512-k35yLp1ZMwwee3Ez/pxBi5cf4AoBKYXj00CZ80jUz5h8prpiaQsiRPKQMxoLstNuqe2vR4RNPEAEcjEFzhEz/g==",
|
|
||||||
"cpu": [
|
|
||||||
"ia32"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"win32"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 10.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/parcel"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@parcel/watcher-win32-x64": {
|
|
||||||
"version": "2.5.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.6.tgz",
|
|
||||||
"integrity": "sha512-hbQlYcCq5dlAX9Qx+kFb0FHue6vbjlf0FrNzSKdYK2APUf7tGfGxQCk2ihEREmbR6ZMc0MVAD5RIX/41gpUzTw==",
|
|
||||||
"cpu": [
|
|
||||||
"x64"
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"win32"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 10.0.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/parcel"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@parcel/watcher/node_modules/picomatch": {
|
|
||||||
"version": "4.0.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz",
|
|
||||||
"integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/jonschlinkert"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@popperjs/core": {
|
|
||||||
"version": "2.11.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
|
|
||||||
"integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==",
|
|
||||||
"license": "MIT",
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/popperjs"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@sinclair/typebox": {
|
"node_modules/@sinclair/typebox": {
|
||||||
"version": "0.27.8",
|
"version": "0.27.8",
|
||||||
"resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz",
|
"resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz",
|
||||||
@@ -3225,41 +2884,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/bootstrap": {
|
|
||||||
"version": "5.3.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.8.tgz",
|
|
||||||
"integrity": "sha512-HP1SZDqaLDPwsNiqRqi5NcP0SSXciX2s9E+RyqJIIqGo+vJeN5AJVM98CXmW/Wux0nQ5L7jeWUdplCEf0Ee+tg==",
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"type": "github",
|
|
||||||
"url": "https://github.com/sponsors/twbs"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/bootstrap"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"peerDependencies": {
|
|
||||||
"@popperjs/core": "^2.11.8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/bootstrap-icons": {
|
|
||||||
"version": "1.13.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.13.1.tgz",
|
|
||||||
"integrity": "sha512-ijombt4v6bv5CLeXvRWKy7CuM3TRTuPEuGaGKvTV5cz65rQSY8RQ2JcHt6b90cBBAC7s8fsf2EkQDldzCoXUjw==",
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"type": "github",
|
|
||||||
"url": "https://github.com/sponsors/twbs"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/bootstrap"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/brace-expansion": {
|
"node_modules/brace-expansion": {
|
||||||
"version": "1.1.12",
|
"version": "1.1.12",
|
||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
|
||||||
@@ -4094,17 +3718,6 @@
|
|||||||
"npm": "1.2.8000 || >= 1.4.16"
|
"npm": "1.2.8000 || >= 1.4.16"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/detect-libc": {
|
|
||||||
"version": "2.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
|
|
||||||
"integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"optional": true,
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/detect-node": {
|
"node_modules/detect-node": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz",
|
||||||
@@ -5164,13 +4777,6 @@
|
|||||||
"postcss": "^8.1.0"
|
"postcss": "^8.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/immutable": {
|
|
||||||
"version": "5.1.9",
|
|
||||||
"resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.9.tgz",
|
|
||||||
"integrity": "sha512-m8nVez3rwrgmWxtLMt1ZYXB2Lv7OKYn/disyxAlSDYAlKSlFoPPfIAmAM/M5xqL4m4C/wAPw7S2/CNaUii1Hxg==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/import-local": {
|
"node_modules/import-local": {
|
||||||
"version": "3.2.0",
|
"version": "3.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz",
|
||||||
@@ -5948,14 +5554,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/node-addon-api": {
|
|
||||||
"version": "7.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz",
|
|
||||||
"integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"node_modules/node-forge": {
|
"node_modules/node-forge": {
|
||||||
"version": "1.3.3",
|
"version": "1.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.3.tgz",
|
||||||
@@ -7263,98 +6861,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/sass": {
|
|
||||||
"version": "1.101.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.101.0.tgz",
|
|
||||||
"integrity": "sha512-OL3GoQyoUdDt843DpVmDO6y2k1sc5IhUDSpu8XucEI+35neq5QivZ1iuegnpraEVTJXlQGK1gl27zKcTLEPbQw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"chokidar": "^5.0.0",
|
|
||||||
"immutable": "^5.1.5",
|
|
||||||
"source-map-js": ">=0.6.2 <2.0.0"
|
|
||||||
},
|
|
||||||
"bin": {
|
|
||||||
"sass": "sass.js"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=20.19.0"
|
|
||||||
},
|
|
||||||
"optionalDependencies": {
|
|
||||||
"@parcel/watcher": "^2.4.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/sass-loader": {
|
|
||||||
"version": "14.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-14.2.1.tgz",
|
|
||||||
"integrity": "sha512-G0VcnMYU18a4N7VoNDegg2OuMjYtxnqzQWARVWCIVSZwJeiL9kg8QMsuIZOplsJgTzZLF6jGxI3AClj8I9nRdQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"neo-async": "^2.6.2"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 18.12.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "opencollective",
|
|
||||||
"url": "https://opencollective.com/webpack"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@rspack/core": "0.x || 1.x",
|
|
||||||
"node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0",
|
|
||||||
"sass": "^1.3.0",
|
|
||||||
"sass-embedded": "*",
|
|
||||||
"webpack": "^5.0.0"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"@rspack/core": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"node-sass": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"sass": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"sass-embedded": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"webpack": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/sass/node_modules/chokidar": {
|
|
||||||
"version": "5.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz",
|
|
||||||
"integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"readdirp": "^5.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 20.19.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://paulmillr.com/funding/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/sass/node_modules/readdirp": {
|
|
||||||
"version": "5.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.0.0.tgz",
|
|
||||||
"integrity": "sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 20.19.0"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "individual",
|
|
||||||
"url": "https://paulmillr.com/funding/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/schema-utils": {
|
"node_modules/schema-utils": {
|
||||||
"version": "4.3.3",
|
"version": "4.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz",
|
||||||
|
|||||||
@@ -18,15 +18,8 @@
|
|||||||
"css-loader": "^7.1.2",
|
"css-loader": "^7.1.2",
|
||||||
"mini-css-extract-plugin": "^2.9.2",
|
"mini-css-extract-plugin": "^2.9.2",
|
||||||
"regenerator-runtime": "^0.14.1",
|
"regenerator-runtime": "^0.14.1",
|
||||||
"sass": "^1.101.0",
|
|
||||||
"sass-loader": "^14.2.1",
|
|
||||||
"webpack": "^5.95.0",
|
"webpack": "^5.95.0",
|
||||||
"webpack-cli": "^5.1.4",
|
"webpack-cli": "^5.1.4",
|
||||||
"webpack-notifier": "^1.15.0"
|
"webpack-notifier": "^1.15.0"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@popperjs/core": "^2.11.8",
|
|
||||||
"bootstrap": "^5.3.8",
|
|
||||||
"bootstrap-icons": "^1.13.1"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 MiB |
@@ -1,18 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Kernel;
|
use App\Kernel;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
|
||||||
|
|
||||||
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
|
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
|
||||||
|
|
||||||
return function (array $context) {
|
return function (array $context) {
|
||||||
if ($trustedProxies = $context['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
|
|
||||||
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PREFIX);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($trustedHosts = $context['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
|
|
||||||
Request::setTrustedHosts([$trustedHosts]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
|
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,66 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Command;
|
|
||||||
|
|
||||||
use App\Tech\Entity\User;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
|
||||||
use Symfony\Component\Console\Attribute\AsCommand;
|
|
||||||
use Symfony\Component\Console\Command\Command;
|
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
|
||||||
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
|
||||||
|
|
||||||
#[AsCommand(
|
|
||||||
name: 'app:create-user',
|
|
||||||
description: 'Create a new user',
|
|
||||||
)]
|
|
||||||
class CreateUserCommand extends Command
|
|
||||||
{
|
|
||||||
public function __construct(
|
|
||||||
private EntityManagerInterface $entityManager,
|
|
||||||
private UserPasswordHasherInterface $passwordHasher,
|
|
||||||
) {
|
|
||||||
parent::__construct();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function configure(): void
|
|
||||||
{
|
|
||||||
$this
|
|
||||||
->addArgument('email', InputArgument::REQUIRED, 'Email address')
|
|
||||||
->addArgument('username', InputArgument::REQUIRED, 'Username')
|
|
||||||
->addArgument('password', InputArgument::REQUIRED, 'Plain-text password')
|
|
||||||
->addOption('admin', null, InputOption::VALUE_NONE, 'Grant ROLE_ADMIN');
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
|
||||||
{
|
|
||||||
$io = new SymfonyStyle($input, $output);
|
|
||||||
|
|
||||||
$email = $input->getArgument('email');
|
|
||||||
$username = $input->getArgument('username');
|
|
||||||
$password = $input->getArgument('password');
|
|
||||||
$isAdmin = $input->getOption('admin');
|
|
||||||
|
|
||||||
$user = new User();
|
|
||||||
$user->setEmail($email);
|
|
||||||
$user->setUsername($username);
|
|
||||||
$user->setPassword($this->passwordHasher->hashPassword($user, $password));
|
|
||||||
$user->setIsVerified(true);
|
|
||||||
$user->setRoles($isAdmin ? ['ROLE_ADMIN'] : []);
|
|
||||||
|
|
||||||
$this->entityManager->persist($user);
|
|
||||||
$this->entityManager->flush();
|
|
||||||
|
|
||||||
$io->success(sprintf(
|
|
||||||
'User "%s" (%s) created%s.',
|
|
||||||
$username,
|
|
||||||
$email,
|
|
||||||
$isAdmin ? ' with ROLE_ADMIN' : '',
|
|
||||||
));
|
|
||||||
|
|
||||||
return Command::SUCCESS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -27,7 +27,7 @@ final class MercurePublishCommand extends Command
|
|||||||
protected function configure(): void
|
protected function configure(): void
|
||||||
{
|
{
|
||||||
$this
|
$this
|
||||||
->addArgument('topic', InputArgument::OPTIONAL, 'Topic URL to publish to', '/game/hub/test')
|
->addArgument('topic', InputArgument::OPTIONAL, 'Topic URL to publish to', $_ENV['MERCURE_TOPIC_BASE'] . '/game/hub')
|
||||||
->addOption('type', null, InputOption::VALUE_REQUIRED, 'Update type (for clients to filter)', 'game.event')
|
->addOption('type', null, InputOption::VALUE_REQUIRED, 'Update type (for clients to filter)', 'game.event')
|
||||||
->addOption('data', null, InputOption::VALUE_REQUIRED, 'JSON payload to send', '{"message":"Hello from Mercure!"}')
|
->addOption('data', null, InputOption::VALUE_REQUIRED, 'JSON payload to send', '{"message":"Hello from Mercure!"}')
|
||||||
->addOption('private', null, InputOption::VALUE_NONE, 'Mark the update as private');
|
->addOption('private', null, InputOption::VALUE_NONE, 'Mark the update as private');
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
<?php
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Command;
|
|
||||||
|
|
||||||
use App\Tech\Repository\UserRepository;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
|
||||||
use Symfony\Component\Console\Attribute\AsCommand;
|
|
||||||
use Symfony\Component\Console\Command\Command;
|
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
|
||||||
|
|
||||||
#[AsCommand(
|
|
||||||
name: 'app:users:purge-deleted',
|
|
||||||
description: 'Permanently removes soft-deleted users who never played a game, 3 months after deletion.'
|
|
||||||
)]
|
|
||||||
final class PurgeDeletedUsersCommand extends Command
|
|
||||||
{
|
|
||||||
public function __construct(
|
|
||||||
private readonly UserRepository $userRepository,
|
|
||||||
private readonly EntityManagerInterface $entityManager,
|
|
||||||
) {
|
|
||||||
parent::__construct();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
|
||||||
{
|
|
||||||
$deletedBefore = new \DateTimeImmutable('-3 months');
|
|
||||||
$users = $this->userRepository->findPurgeableDeletedUsers($deletedBefore);
|
|
||||||
|
|
||||||
foreach ($users as $user) {
|
|
||||||
$this->entityManager->remove($user);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->entityManager->flush();
|
|
||||||
|
|
||||||
$output->writeln(sprintf('<info>Purged %d deleted user(s).</info>', count($users)));
|
|
||||||
|
|
||||||
return Command::SUCCESS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
<?php
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Command;
|
|
||||||
|
|
||||||
use App\Game\Entity\Session;
|
|
||||||
use App\Game\Enum\GameSettingType;
|
|
||||||
use App\Game\Enum\SessionSettingType;
|
|
||||||
use App\Game\Enum\SessionStatus;
|
|
||||||
use App\Game\Repository\GameSettingRepository;
|
|
||||||
use App\Game\Repository\SessionRepository;
|
|
||||||
use App\Game\Repository\SessionSettingRepository;
|
|
||||||
use Symfony\Component\Console\Attribute\AsCommand;
|
|
||||||
use Symfony\Component\Console\Command\Command;
|
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
|
||||||
use Symfony\Component\Mercure\HubInterface;
|
|
||||||
use Symfony\Component\Mercure\Update;
|
|
||||||
|
|
||||||
#[AsCommand(
|
|
||||||
name: 'app:hints:check',
|
|
||||||
description: 'Checks running game sessions and sends mainframe hints to players who are behind schedule.'
|
|
||||||
)]
|
|
||||||
final class SendMainframeHintsCommand extends Command
|
|
||||||
{
|
|
||||||
private const DEFAULT_TOTAL_TIME = 3600;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
private readonly SessionRepository $sessionRepository,
|
|
||||||
private readonly SessionSettingRepository $sessionSettingRepository,
|
|
||||||
private readonly GameSettingRepository $gameSettingRepository,
|
|
||||||
private readonly HubInterface $hub,
|
|
||||||
) {
|
|
||||||
parent::__construct();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
|
||||||
{
|
|
||||||
$sessions = $this->sessionRepository->findBy(['status' => SessionStatus::PLAYING]);
|
|
||||||
$hintsSent = 0;
|
|
||||||
|
|
||||||
foreach ($sessions as $session) {
|
|
||||||
if ($this->checkContactHint($session)) {
|
|
||||||
$hintsSent++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$output->writeln(sprintf('<info>Checked %d running session(s), sent %d hint(s).</info>', count($sessions), $hintsSent));
|
|
||||||
|
|
||||||
return Command::SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* "Get in touch" hint: if 5 minutes into the game the players haven't messaged
|
|
||||||
* everyone (a private message to each other player, plus one broadcast), nudge them.
|
|
||||||
* Repeats every run of this command for as long as the condition still holds.
|
|
||||||
*/
|
|
||||||
private function checkContactHint(Session $session): bool
|
|
||||||
{
|
|
||||||
$elapsed = $this->getElapsedPlayingSeconds($session);
|
|
||||||
if ($elapsed === null || $elapsed < 300) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->allPlayersHaveContactedEveryone($session)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->publishHint($session, 'Get in contact with your fellow agents to work together on defeating this AI virus.');
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function getElapsedPlayingSeconds(Session $session): ?int
|
|
||||||
{
|
|
||||||
$timer = $session->getTimer();
|
|
||||||
if ($timer === null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
$totalTimeSetting = $this->gameSettingRepository->getSetting($session->getGame(), GameSettingType::TOTAL_TIME);
|
|
||||||
$totalTime = $totalTimeSetting ? (int)$totalTimeSetting->getValue() : self::DEFAULT_TOTAL_TIME;
|
|
||||||
|
|
||||||
$startedAt = $timer - $totalTime;
|
|
||||||
|
|
||||||
return time() - $startedAt;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function allPlayersHaveContactedEveryone(Session $session): bool
|
|
||||||
{
|
|
||||||
$players = $session->getPlayers();
|
|
||||||
$screens = [];
|
|
||||||
|
|
||||||
foreach ($players as $player) {
|
|
||||||
if ($player->getScreen() === null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$screens[] = $player->getScreen();
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($players as $player) {
|
|
||||||
$screen = $player->getScreen();
|
|
||||||
$trackingSettingName = SessionSettingType::tryFrom('ChatTrackingForPlayer' . $screen);
|
|
||||||
if (!$trackingSettingName) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$setting = $this->sessionSettingRepository->getSetting($session, $trackingSettingName, $player);
|
|
||||||
$tracking = $setting ? (json_decode($setting->getValue() ?? '[]', true) ?? []) : [];
|
|
||||||
|
|
||||||
if (!in_array(0, $tracking)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($screens as $otherScreen) {
|
|
||||||
if ($otherScreen !== $screen && !in_array($otherScreen, $tracking)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function publishHint(Session $session, string $message): void
|
|
||||||
{
|
|
||||||
$topic = '/game/hub/' . $session->getId();
|
|
||||||
try {
|
|
||||||
$this->hub->publish(new Update($topic, json_encode([0, $message, 'hint'])));
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
// Mercure might be down
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -15,7 +15,7 @@ use Symfony\Component\Mime\Email;
|
|||||||
|
|
||||||
#[AsCommand(
|
#[AsCommand(
|
||||||
name: 'app:mail:test',
|
name: 'app:mail:test',
|
||||||
description: 'Sends a simple test email using the configured mail transport (Mailgun in prod).'
|
description: 'Sends a simple test email using the configured mail transport (SendGrid in prod).'
|
||||||
)]
|
)]
|
||||||
final class TestEmailCommand extends Command
|
final class TestEmailCommand extends Command
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Game\Controller;
|
namespace App\Game\Controller;
|
||||||
|
|
||||||
use App\Game\Entity\Session;
|
use App\Game\Entity\Session;
|
||||||
use App\Game\Enum\SessionStatus;
|
|
||||||
use App\Game\Repository\GameRepository;
|
|
||||||
use App\Game\Repository\LobbyMessageRepository;
|
|
||||||
use App\Game\Repository\SessionRepository;
|
use App\Game\Repository\SessionRepository;
|
||||||
use App\Tech\Repository\UserRepository;
|
use App\Tech\Repository\UserRepository;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
@@ -29,43 +25,39 @@ final class GameAdminController extends AbstractController
|
|||||||
#[Route('', name: 'game_admin_dashboard', methods: ['GET'])]
|
#[Route('', name: 'game_admin_dashboard', methods: ['GET'])]
|
||||||
public function index(
|
public function index(
|
||||||
UserRepository $userRepository,
|
UserRepository $userRepository,
|
||||||
SessionRepository $sessionRepository,
|
SessionRepository $sessionRepository
|
||||||
GameRepository $gameRepository,
|
|
||||||
): Response {
|
): Response {
|
||||||
$allUsers = $userRepository->findAll();
|
$players = $userRepository->findByRole('ROLE_PLAYER');
|
||||||
$allSessions = $sessionRepository->findAll();
|
$sessions = $sessionRepository->findAll();
|
||||||
$activeSessions = array_filter(
|
|
||||||
$allSessions,
|
|
||||||
fn(Session $s) => in_array($s->getStatus(), [SessionStatus::CREATED, SessionStatus::READY, SessionStatus::PLAYING])
|
|
||||||
);
|
|
||||||
|
|
||||||
return $this->render('game/admin/index.html.twig', [
|
return $this->render('game/admin/index.html.twig', [
|
||||||
'totalUsers' => count($allUsers),
|
'players' => $players,
|
||||||
'totalPlayers' => count($userRepository->findByRole('ROLE_PLAYER')),
|
'sessions' => $sessions,
|
||||||
'totalAdmins' => count($userRepository->findByRole('ROLE_ADMIN')),
|
|
||||||
'totalGames' => count($gameRepository->findAll()),
|
|
||||||
'totalSessions' => count($allSessions),
|
|
||||||
'activeSessions' => count($activeSessions),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/session/{session}', name: 'game_admin_view_session', methods: ['GET'])]
|
#[Route('/session/{session}', name: 'game_admin_view_session', methods: ['GET'])]
|
||||||
public function viewSession(Session $session, LobbyMessageRepository $lobbyMessageRepository): Response
|
public function viewSession(Session $session): Response
|
||||||
{
|
{
|
||||||
$playersLogs = [];
|
$playersLogs = [];
|
||||||
foreach ($session->getPlayers() as $player) {
|
foreach ($session->getPlayers() as $player) {
|
||||||
$logFile = $this->projectDir . '/var/log/sessions/' . $session->getId() . '/' . $player->getLogFileBasename() . '.txt';
|
$username = $player->getUser()->getUsername();
|
||||||
|
$logFile = $this->projectDir . '/var/log/sessions/' . $session->getId() . '/' . $username . '.txt';
|
||||||
|
|
||||||
|
$logs = '';
|
||||||
|
if (file_exists($logFile)) {
|
||||||
|
$logs = file_get_contents($logFile);
|
||||||
|
}
|
||||||
|
|
||||||
$playersLogs[] = [
|
$playersLogs[] = [
|
||||||
'username' => $player->getUser()->getUsername(),
|
'username' => $username,
|
||||||
'logs' => file_exists($logFile) ? file_get_contents($logFile) : '',
|
'logs' => $logs,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('game/admin/sessions/view.html.twig', [
|
return $this->render('game/admin/session.html.twig', [
|
||||||
'session' => $session,
|
'session' => $session,
|
||||||
'playersLogs' => $playersLogs,
|
'playersLogs' => $playersLogs,
|
||||||
'lobbyMessages' => $lobbyMessageRepository->findForSession($session),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Game\Controller;
|
|
||||||
|
|
||||||
use App\Tech\Repository\EmailLogRepository;
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
|
||||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
|
||||||
|
|
||||||
#[Route('/admin/email-log')]
|
|
||||||
#[IsGranted('ROLE_ADMIN')]
|
|
||||||
final class GameAdminEmailLogController extends AbstractController
|
|
||||||
{
|
|
||||||
#[Route('', name: 'game_admin_email_log', methods: ['GET'])]
|
|
||||||
public function index(EmailLogRepository $emailLogRepository): Response
|
|
||||||
{
|
|
||||||
return $this->render('game/admin/email_log/index.html.twig', [
|
|
||||||
'logs' => $emailLogRepository->findBy([], ['sentAt' => 'DESC']),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Game\Controller;
|
|
||||||
|
|
||||||
use App\Game\Entity\GameSetting;
|
|
||||||
use App\Game\Enum\GameSettingType;
|
|
||||||
use App\Game\Form\AdminGameType;
|
|
||||||
use App\Game\Entity\Game;
|
|
||||||
use App\Game\Repository\GameRepository;
|
|
||||||
use App\Game\Repository\GameSettingRepository;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
|
||||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
|
||||||
|
|
||||||
#[Route('/admin/games')]
|
|
||||||
#[IsGranted('ROLE_ADMIN')]
|
|
||||||
final class GameAdminGameController extends AbstractController
|
|
||||||
{
|
|
||||||
#[Route('', name: 'game_admin_games', methods: ['GET'])]
|
|
||||||
public function index(GameRepository $gameRepository): Response
|
|
||||||
{
|
|
||||||
return $this->render('game/admin/games/index.html.twig', [
|
|
||||||
'games' => $gameRepository->findBy([], ['id' => 'ASC']),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Route('/{id}/edit', name: 'game_admin_game_edit', methods: ['GET', 'POST'])]
|
|
||||||
public function edit(
|
|
||||||
Game $game,
|
|
||||||
Request $request,
|
|
||||||
EntityManagerInterface $em,
|
|
||||||
GameSettingRepository $gameSettingRepository,
|
|
||||||
): Response {
|
|
||||||
$totalTimeSetting = $gameSettingRepository->getSetting($game, GameSettingType::TOTAL_TIME);
|
|
||||||
|
|
||||||
$form = $this->createForm(AdminGameType::class, $game, [
|
|
||||||
'total_time' => $totalTimeSetting?->getValue(),
|
|
||||||
]);
|
|
||||||
$form->handleRequest($request);
|
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
|
||||||
$totalTime = $form->get('totalTime')->getData();
|
|
||||||
|
|
||||||
if ($totalTime !== null) {
|
|
||||||
if (!$totalTimeSetting) {
|
|
||||||
$totalTimeSetting = new GameSetting();
|
|
||||||
$totalTimeSetting->setGame($game);
|
|
||||||
$totalTimeSetting->setName(GameSettingType::TOTAL_TIME);
|
|
||||||
}
|
|
||||||
$totalTimeSetting->setValue((string) $totalTime);
|
|
||||||
$em->persist($totalTimeSetting);
|
|
||||||
}
|
|
||||||
|
|
||||||
$em->flush();
|
|
||||||
$this->addFlash('success', sprintf('Game "%s" updated.', $game->getName()));
|
|
||||||
|
|
||||||
return $this->redirectToRoute('game_admin_games');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->render('game/admin/games/edit.html.twig', [
|
|
||||||
'game' => $game,
|
|
||||||
'form' => $form,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Game\Controller;
|
|
||||||
|
|
||||||
use App\Game\Entity\Session;
|
|
||||||
use App\Game\Enum\SessionStatus;
|
|
||||||
use App\Game\Repository\SessionRepository;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
|
||||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
|
||||||
|
|
||||||
#[Route('/admin/sessions')]
|
|
||||||
#[IsGranted('ROLE_ADMIN')]
|
|
||||||
final class GameAdminSessionController extends AbstractController
|
|
||||||
{
|
|
||||||
#[Route('', name: 'game_admin_sessions', methods: ['GET'])]
|
|
||||||
public function index(SessionRepository $sessionRepository): Response
|
|
||||||
{
|
|
||||||
return $this->render('game/admin/sessions/index.html.twig', [
|
|
||||||
'sessions' => $sessionRepository->findBy([], ['created' => 'DESC']),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Route('/{id}/close', name: 'game_admin_session_close', methods: ['POST'])]
|
|
||||||
public function close(Session $session, Request $request, EntityManagerInterface $em): Response
|
|
||||||
{
|
|
||||||
if (!$this->isCsrfTokenValid('close_session_' . $session->getId(), $request->request->get('_token'))) {
|
|
||||||
$this->addFlash('danger', 'Invalid CSRF token.');
|
|
||||||
return $this->redirectToRoute('game_admin_sessions');
|
|
||||||
}
|
|
||||||
|
|
||||||
$session->setStatus(SessionStatus::LOST);
|
|
||||||
$session->setFinishedAt(new \DateTime());
|
|
||||||
$em->flush();
|
|
||||||
|
|
||||||
$this->addFlash('success', sprintf('Session #%d closed.', $session->getId()));
|
|
||||||
|
|
||||||
return $this->redirectToRoute('game_admin_sessions');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Game\Controller;
|
|
||||||
|
|
||||||
use App\Tech\Entity\User;
|
|
||||||
use App\Tech\Form\AdminUserType;
|
|
||||||
use App\Tech\Repository\UserRepository;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
|
||||||
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
|
||||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
|
||||||
|
|
||||||
#[Route('/admin/users')]
|
|
||||||
#[IsGranted('ROLE_ADMIN')]
|
|
||||||
final class GameAdminUserController extends AbstractController
|
|
||||||
{
|
|
||||||
#[Route('', name: 'game_admin_users', methods: ['GET'])]
|
|
||||||
public function index(UserRepository $userRepository): Response
|
|
||||||
{
|
|
||||||
$users = $userRepository->findBy([], ['id' => 'ASC']);
|
|
||||||
|
|
||||||
return $this->render('game/admin/users/index.html.twig', [
|
|
||||||
'users' => $users,
|
|
||||||
'marketingOptInCount' => count(array_filter($users, static fn (User $user) => $user->isMarketingOptIn())),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Route('/{id}/edit', name: 'game_admin_user_edit', methods: ['GET', 'POST'])]
|
|
||||||
public function edit(
|
|
||||||
User $user,
|
|
||||||
Request $request,
|
|
||||||
EntityManagerInterface $em,
|
|
||||||
UserPasswordHasherInterface $passwordHasher,
|
|
||||||
): Response {
|
|
||||||
$form = $this->createForm(AdminUserType::class, $user);
|
|
||||||
$form->handleRequest($request);
|
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
|
||||||
$plainPassword = $form->get('plainPassword')->getData();
|
|
||||||
if ($plainPassword) {
|
|
||||||
$user->setPassword($passwordHasher->hashPassword($user, $plainPassword));
|
|
||||||
}
|
|
||||||
|
|
||||||
$em->flush();
|
|
||||||
$this->addFlash('success', sprintf('User "%s" updated.', $user->getUsername()));
|
|
||||||
|
|
||||||
return $this->redirectToRoute('game_admin_users');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->render('game/admin/users/edit.html.twig', [
|
|
||||||
'user' => $user,
|
|
||||||
'form' => $form,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Route('/{id}/delete', name: 'game_admin_user_delete', methods: ['POST'])]
|
|
||||||
public function delete(User $user, Request $request, EntityManagerInterface $em): Response
|
|
||||||
{
|
|
||||||
if (!$this->isCsrfTokenValid('delete_user_' . $user->getId(), $request->request->get('_token'))) {
|
|
||||||
$this->addFlash('danger', 'Invalid CSRF token.');
|
|
||||||
return $this->redirectToRoute('game_admin_users');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$user->isDeleted()) {
|
|
||||||
$user->setDeletedAt(new \DateTimeImmutable());
|
|
||||||
$em->flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->addFlash('success', sprintf('User "%s" deleted.', $user->getUsername()));
|
|
||||||
|
|
||||||
return $this->redirectToRoute('game_admin_users');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user