Prérequis:
- linux
- docker
- docker compose
- git
- bash
- un reverse proxy
git clone https://github.com/VEAF/website.git
# or ssh version
# git clone git@github.com:VEAF/website.git
cd website
./scripts/upgrade.shet charger les fixtures:
touch .fixtures
./scripts/dev/fixtures.shAccès par défaut:
- http://veaf.localhost: mitch@localhost / test1234
- http://pma.veaf.localhost: root / test (base website)
Tous les scripts sont dans le répertoire ./scripts/ et acceptent l'option --help.
| Commande | Description |
|---|---|
./scripts/upgrade.sh |
Mise à jour complète (pull, up, composer, migrations) |
./scripts/pull.sh |
Pull des images Docker |
./scripts/start.sh |
Démarrer les conteneurs |
./scripts/stop.sh |
ArrĂŞter les conteneurs |
./scripts/restart.sh |
Redémarrer les conteneurs |
./scripts/down.sh |
Supprimer les conteneurs et volumes |
./scripts/logs.sh |
Afficher les logs |
./scripts/ps.sh |
Statut des conteneurs |
./scripts/check.sh |
Vérifier les versions des services |
| Commande | Description |
|---|---|
./scripts/php.sh |
Shell dans le conteneur PHP (www-data) |
./scripts/php.sh --root |
Shell dans le conteneur PHP (root) |
./scripts/php.sh <commande> |
Exécuter une commande dans le conteneur PHP |
./scripts/console.sh |
Console Symfony (affiche l'aide) |
./scripts/console.sh <commande> |
Exécuter une commande Symfony |
./scripts/nginx.sh |
Shell dans le conteneur Nginx |
| Commande | Description |
|---|---|
./scripts/cc.sh |
Vider le cache Symfony |
./scripts/fix.sh |
Lancer PHP CS Fixer sur src/ |
./scripts/dev/test.sh |
Lancer les tests |
./scripts/dev/fixtures.sh |
Charger les fixtures (dev uniquement) |
cd website
./scripts/upgrade.shOptions disponibles pour upgrade.sh:
--no-docker-pull: ne pas pull les images--no-docker-up: ne pas démarrer les conteneurs--no-git-pull: ne pas pull les sources--no-composer: ne pas installer les dépendances--no-migrations: ne pas lancer les migrations
- Php: https://www.php.net/
- Symfony: https://symfony.com/
- MySQL: https://www.mysql.com/fr/
- Redis: https://redis.io/
- JQuery: https://jquery.com/
- Full Calendar: https://fullcalendar.io/docs
- Bootstrap: https://getbootstrap.com/
- Bootstrap Theme: https://bootswatch.com/cerulean/
- Docker: https://www.docker.com/
RECAPTCHA3_KEY=abcdefghijk
RECAPTCHA3_SECRET=6Ld9V1EaAAAAANvbtLUPODEB5aHT-8jb6BJ-vlvsabcdefghijk
RECAPTCHA3_ENABLED=1GOOGLE_AGENT=UA-abcdefghijk-1API_SLMOD_URL=http://hostname:8080API_TEAMSPEAK_URL=serverquery://ts.veaf.org:10011/?server_port=9987# veaf ou 51eg
WEBSITE=veaf#CDN_URL=https://cdn.localhost/websitevoir release
Exemple de planification, fichier /etc/cron.d/website:
*/20 * * * * debian /usr/local/bin/website-import-slmod-stats 2>&1 | ts >> /var/log/website/cron.log
* * * * * debian /usr/local/bin/website-minly 2>&1 | ts >> /var/log/website/cron.log
Exemple import des stats SLMOD, fichier /usr/local/bin/website-import-slmod-stats:
#!/bin/env bash
echo "Import Slmod Stats"
pushd /home/debian/docker/website > /dev/null
/usr/local/bin/docker-compose exec -T -u www-data php ./bin/console app:slmod:import public 2>&1 | ts >> var/log/slmod-public.log
/usr/local/bin/docker-compose exec -T -u www-data php ./bin/console app:slmod:import private 2>&1 | ts >> var/log/slmod-private.log
popd > /dev/null#!/bin/env bash
echo "Scan Team Speak"
pushd /home/debian/docker/website > /dev/null
/usr/local/bin/docker-compose exec -T -u www-data php ./bin/console app:team-speak:scan 2>&1 | ts >> var/log/team-speak.log
popd > /dev/null#!/bin/env bash
echo "Calendar"
pushd /home/debian/docker/website > /dev/null
/usr/local/bin/docker-compose exec -T -u www-data php ./bin/console app:calendar:event:auto 2>&1 | ts >> var/log/calendar.log
popd > /dev/nullExemple de rotation des logs, fichier /etc/logrotate.d/website:
/var/log/website/*.log {
rotate 12
monthly
compress
missingok
}
/home/debian/docker/website/var/log/*.log {
rotate 12
monthly
compress
missingok
}