fix(security) : replace real secrets in .env with placeholders and create .env.example
Secrets moved to .env.local (gitignored). Added .env.example for new developers. Also added .idea/ and docker/.env.docker.local to .gitignore and removed them from tracking. Tickets: T-001, T-013, T-018 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
6
.env
6
.env
@@ -1,5 +1,5 @@
|
|||||||
APP_ENV=dev
|
APP_ENV=dev
|
||||||
APP_SECRET="a64f5614357bf56aecb1d7470e431535"
|
APP_SECRET="change_me_in_env_local"
|
||||||
APP_DEBUG=1
|
APP_DEBUG=1
|
||||||
|
|
||||||
DEFAULT_URI=http://localhost/
|
DEFAULT_URI=http://localhost/
|
||||||
@@ -11,7 +11,7 @@ CORS_ALLOW_ORIGIN='^https?://(localhost|127.0.0.1)(:[0-9]+)?$'
|
|||||||
###> lexik/jwt-authentication-bundle ###
|
###> lexik/jwt-authentication-bundle ###
|
||||||
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
|
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
|
||||||
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
|
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
|
||||||
JWT_PASSPHRASE=c2dbeec8fa8255bdab24e88b9fc1e57927740c429ae3b930d03e51b92e13a85f
|
JWT_PASSPHRASE=change_me_in_env_local
|
||||||
JWT_COOKIE_SECURE=0
|
JWT_COOKIE_SECURE=0
|
||||||
JWT_TOKEN_TTL=86400
|
JWT_TOKEN_TTL=86400
|
||||||
JWT_COOKIE_TTL=86400
|
JWT_COOKIE_TTL=86400
|
||||||
@@ -20,4 +20,4 @@ JWT_COOKIE_TTL=86400
|
|||||||
|
|
||||||
DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:${POSTGRES_PORT}/${POSTGRES_DB}?serverVersion=16&charset=utf8"
|
DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:${POSTGRES_PORT}/${POSTGRES_DB}?serverVersion=16&charset=utf8"
|
||||||
|
|
||||||
ENCRYPTION_KEY=aaaaaaaaa
|
ENCRYPTION_KEY=change_me_in_env_local
|
||||||
99
.env.example
Normal file
99
.env.example
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
###############################################################################
|
||||||
|
# Lesstime — Fichier d'environnement de reference
|
||||||
|
#
|
||||||
|
# Copiez ce fichier en .env.local et remplissez les valeurs sensibles.
|
||||||
|
# Les valeurs par defaut dans .env suffisent pour le developpement ;
|
||||||
|
# seuls les secrets (APP_SECRET, JWT_PASSPHRASE, ENCRYPTION_KEY) doivent
|
||||||
|
# etre definis dans .env.local.
|
||||||
|
#
|
||||||
|
# Ne commitez JAMAIS de vrais secrets dans .env ou .env.example.
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
# ===========================================================================
|
||||||
|
# App
|
||||||
|
# ===========================================================================
|
||||||
|
|
||||||
|
# Environnement Symfony : dev, test, prod
|
||||||
|
APP_ENV=dev
|
||||||
|
|
||||||
|
# Secret applicatif Symfony (32 chars hex) — a generer pour chaque installation
|
||||||
|
# Generer avec : php -r "echo bin2hex(random_bytes(16));"
|
||||||
|
APP_SECRET="change_me_in_env_local"
|
||||||
|
|
||||||
|
# Active/desactive le mode debug (1 = oui, 0 = non)
|
||||||
|
APP_DEBUG=1
|
||||||
|
|
||||||
|
# URI par defaut de l'application (utilise pour les liens absolus)
|
||||||
|
DEFAULT_URI=http://localhost/
|
||||||
|
|
||||||
|
# ===========================================================================
|
||||||
|
# CORS (nelmio/cors-bundle)
|
||||||
|
# ===========================================================================
|
||||||
|
|
||||||
|
# Origines autorisees pour les requetes cross-origin (regex)
|
||||||
|
CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$'
|
||||||
|
|
||||||
|
# ===========================================================================
|
||||||
|
# JWT (lexik/jwt-authentication-bundle)
|
||||||
|
# ===========================================================================
|
||||||
|
|
||||||
|
# Chemin vers la cle privee RSA pour signer les tokens JWT
|
||||||
|
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
|
||||||
|
|
||||||
|
# Chemin vers la cle publique RSA pour verifier les tokens JWT
|
||||||
|
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
|
||||||
|
|
||||||
|
# Passphrase de la cle privee JWT — a generer pour chaque installation
|
||||||
|
# Generer avec : php -r "echo bin2hex(random_bytes(32));"
|
||||||
|
JWT_PASSPHRASE=change_me_in_env_local
|
||||||
|
|
||||||
|
# Cookie securise (1 = HTTPS uniquement, 0 = HTTP autorise — dev seulement)
|
||||||
|
JWT_COOKIE_SECURE=0
|
||||||
|
|
||||||
|
# Duree de vie du token JWT en secondes (86400 = 24h)
|
||||||
|
JWT_TOKEN_TTL=86400
|
||||||
|
|
||||||
|
# Duree de vie du cookie JWT en secondes (86400 = 24h)
|
||||||
|
JWT_COOKIE_TTL=86400
|
||||||
|
|
||||||
|
# ===========================================================================
|
||||||
|
# Base de donnees (Doctrine / PostgreSQL)
|
||||||
|
# ===========================================================================
|
||||||
|
|
||||||
|
# Les variables POSTGRES_* sont definies dans docker/.env.docker
|
||||||
|
# et injectees automatiquement par Docker Compose.
|
||||||
|
# DATABASE_URL est construite a partir de ces variables.
|
||||||
|
DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:${POSTGRES_PORT}/${POSTGRES_DB}?serverVersion=16&charset=utf8"
|
||||||
|
|
||||||
|
# ===========================================================================
|
||||||
|
# Chiffrement
|
||||||
|
# ===========================================================================
|
||||||
|
|
||||||
|
# Cle de chiffrement pour les donnees sensibles (64 chars hex = 256 bits)
|
||||||
|
# Generer avec : php -r "echo bin2hex(random_bytes(32));"
|
||||||
|
ENCRYPTION_KEY=change_me_in_env_local
|
||||||
|
|
||||||
|
# ===========================================================================
|
||||||
|
# Docker (docker/.env.docker)
|
||||||
|
#
|
||||||
|
# Ces variables sont lues par Docker Compose. Voir docker/.env.docker
|
||||||
|
# pour les valeurs par defaut. Creez docker/.env.docker.local pour
|
||||||
|
# surcharger localement.
|
||||||
|
# ===========================================================================
|
||||||
|
|
||||||
|
# DOCKER_APP_NAME=lesstime
|
||||||
|
# DOCKER_PHP_VERSION=8.4.6
|
||||||
|
# DOCKER_NODE_VERSION=24.12.0
|
||||||
|
# APP_USER=www-data
|
||||||
|
# POSTGRES_DB=lesstime
|
||||||
|
# POSTGRES_USER=root
|
||||||
|
# POSTGRES_PASSWORD=root
|
||||||
|
# POSTGRES_PORT=5435
|
||||||
|
# XDEBUG_CLIENT_HOST=host.docker.internal
|
||||||
|
|
||||||
|
# ===========================================================================
|
||||||
|
# Frontend (frontend/.env)
|
||||||
|
# ===========================================================================
|
||||||
|
|
||||||
|
# Base URL de l'API pour le client Nuxt (relative, proxifiee par Nginx)
|
||||||
|
# NUXT_PUBLIC_API_BASE=/api
|
||||||
8
.gitignore
vendored
8
.gitignore
vendored
@@ -22,3 +22,11 @@
|
|||||||
###> lexik/jwt-authentication-bundle ###
|
###> lexik/jwt-authentication-bundle ###
|
||||||
/config/jwt/*.pem
|
/config/jwt/*.pem
|
||||||
###< lexik/jwt-authentication-bundle ###
|
###< lexik/jwt-authentication-bundle ###
|
||||||
|
|
||||||
|
###> ide ###
|
||||||
|
.idea/
|
||||||
|
###< ide ###
|
||||||
|
|
||||||
|
###> docker local ###
|
||||||
|
docker/.env.docker.local
|
||||||
|
###< docker local ###
|
||||||
|
|||||||
10
.idea/.gitignore
generated
vendored
10
.idea/.gitignore
generated
vendored
@@ -1,10 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# Ignored default folder with query files
|
|
||||||
/queries/
|
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
||||||
# Editor-based HTTP Client requests
|
|
||||||
/httpRequests/
|
|
||||||
8
.idea/Lesstime.iml
generated
8
.idea/Lesstime.iml
generated
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="WEB_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<content url="file://$MODULE_DIR$" />
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
6
.idea/db-forest-config.xml
generated
6
.idea/db-forest-config.xml
generated
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="db-tree-configuration">
|
|
||||||
<option name="data" value="---------------------------------------- 1:0:9cad43df-2147-4989-b7a4-443067034884 2:0:ae622167-c834-4e7b-87a5-c1721036f5dc 3:0:f407a514-c6b4-4b26-9555-445a85892502 4:0:09e221b8-067a-488b-9c1d-4e155a333079 " />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
10
.idea/material_theme_project_new.xml
generated
10
.idea/material_theme_project_new.xml
generated
@@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="MaterialThemeProjectNewConfig">
|
|
||||||
<option name="metadata">
|
|
||||||
<MTProjectMetadataState>
|
|
||||||
<option name="userId" value="386cba74:19cc24e9181:-799b" />
|
|
||||||
</MTProjectMetadataState>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
8
.idea/modules.xml
generated
8
.idea/modules.xml
generated
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/Lesstime.iml" filepath="$PROJECT_DIR$/.idea/Lesstime.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
20
.idea/php.xml
generated
20
.idea/php.xml
generated
@@ -1,20 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="MessDetectorOptionsConfiguration">
|
|
||||||
<option name="transferred" value="true" />
|
|
||||||
</component>
|
|
||||||
<component name="PHPCSFixerOptionsConfiguration">
|
|
||||||
<option name="transferred" value="true" />
|
|
||||||
</component>
|
|
||||||
<component name="PHPCodeSnifferOptionsConfiguration">
|
|
||||||
<option name="highlightLevel" value="WARNING" />
|
|
||||||
<option name="transferred" value="true" />
|
|
||||||
</component>
|
|
||||||
<component name="PhpProjectSharedConfiguration" php_language_level="8.4" />
|
|
||||||
<component name="PhpStanOptionsConfiguration">
|
|
||||||
<option name="transferred" value="true" />
|
|
||||||
</component>
|
|
||||||
<component name="PsalmOptionsConfiguration">
|
|
||||||
<option name="transferred" value="true" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
6
.idea/vcs.xml
generated
6
.idea/vcs.xml
generated
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
DOCKER_APP_NAME=lesstime
|
|
||||||
DOCKER_PHP_VERSION=8.4.6
|
|
||||||
DOCKER_NODE_VERSION=24.12.0
|
|
||||||
APP_USER=www-data
|
|
||||||
POSTGRES_DB=lesstime
|
|
||||||
POSTGRES_USER=root
|
|
||||||
POSTGRES_PASSWORD=root
|
|
||||||
POSTGRES_PORT=5435
|
|
||||||
XDEBUG_CLIENT_HOST=192.168.0.124
|
|
||||||
Reference in New Issue
Block a user