Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .env
Empty file.
74 changes: 74 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
APP_ENV=test

## App configuration
DATABASE_HOST=dbtest
DATABASE_PORT=3306
DATABASE_NAME=web
DATABASE_USER=afup
DATABASE_PASSWORD=afup

SECRET=ThisTokenIsNotSoSecretChangeIt

GITHUB_CLIENT_ID=id
GITHUB_CLIENT_SECRET=secret

ALGOLIA_APP_ID=DVB92YWTPE
ALGOLIA_BACKEND_API_KEY=78e71e5r5c2Rb353f5a03376gb9878779
ALGOLIA_FRONTEND_API_KEY=74e71e5r5c2Rb353f5a03376gb9878777

HOME_ALGOLIA_ENABLED=false

SLACK_URL=http://yolo

BLUESKY_API_IDENTIFIER=xxx
BLUESKY_API_APP_PASSWORD=yyy

MAILCHIMP_API_KEY=xxx-yyyy
MAILCHIMP_MEMBERS_LIST=
MAILCHIMP_SUBSCRIBERS_LIST=
MAILCHIMP_TECHLETTER_LIST=
MAILCHIMP_TECHLETTER_API_KEY=xxx-yyyy
MAILCHIMP_TECHLETTER_WEBHOOK_KEY="abc"

GOOGLE_MAPS_API_KEY=

MEETUP_API_CONSUMER_KEY=
MEETUP_API_CONSUMER_SECRET=

TECHNO_WATCH_CALENDAR_URL=https://docs.google.com/spreadsheets/d/2cUeAk86Ov7BLYyn0Ad9ge3ecbsdboeQH64wIU9a9Zzp/export?format=csv
TECHNO_WATCH_CALENDAR_KEY=9Yt0feebMyMrUWx

SUPER_APERO_CSV_URL=../tests/behat/files/super_apero.csv

GOOGLE_ANALYTICS_ENABLED=false
GOOGLE_ANALYTICS_ID=G-CHPWDR3C1M

TECHLETTER_TEST_EMAIL_ADDRESS=pole-veille@afup.org

SLACK_MEMBERS_LEGACY_TOKEN=aaaa-90909097

SLACK_API_URL=https://slack.com/api
SLACK_MEMBRE_TOKEN=

RECAPTCHA_PUBLIC_KEY=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
RECAPTCHA_PRIVATE_KEY=6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe

PAYBOX_DOMAIN_SERVER=preprod-tpeweb.paybox.com
PAYBOX_SECRET_KEY=0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
PAYBOX_SITE=1999888
PAYBOX_RANG=32
PAYBOX_IDENTIFIANT=110647233

BLOG_API_KEY=123456

SMTP_HOST="localhost"
SMTP_PORT=1025
SMTP_TLS=0
SMTP_USERNAME=""
SMTP_PASSWORD=""

QR_CODE_SALT=""
# https://symfony.com/doc/current/reference/configuration/framework.html#ide
IDE_USED="phpstorm"

AFUP_GLOBAL_MENU_EVENT_LABEL="Forum PHP"
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.env
/.env.local
/.env.local.php
/.env.*.local

deps.lock
.idea
Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
-include .env
default: help

# Variables
Expand Down Expand Up @@ -51,7 +50,7 @@ init: htdocs/uploads
##@ Docker

### Démarrer les containers
docker-up: .env var/logs/.docker-build data compose.override.yml
docker-up: .env.local var/logs/.docker-build data compose.override.yml
$(DOCKER_COMP) up $(DOCKER_UP_OPTIONS)

### Stopper les containers
Expand Down Expand Up @@ -154,8 +153,8 @@ var/logs/.docker-build: compose.yml compose.override.yml $(shell find docker -ty
CURRENT_UID=$(CURRENT_UID) ENABLE_XDEBUG=$(ENABLE_XDEBUG) $(DOCKER_COMPOSE_BIN) build
touch var/logs/.docker-build

.env:
cp .env.dist .env
.env.local:
cp .env.dist .env.local

compose.override.yml:
cp compose.override.yml-dist compose.override.yml
Expand Down
32 changes: 0 additions & 32 deletions app/config/config.php

This file was deleted.

1 change: 0 additions & 1 deletion app/config/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
imports:
- { resource: config.php }
- { resource: services.yml }
- { resource: packages/*.yaml }
4 changes: 2 additions & 2 deletions app/config/packages/ewz_recaptcha.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ewz_recaptcha:
public_key: '%recaptcha_public_key%'
private_key: '%recaptcha_private_key%'
public_key: '%env(RECAPTCHA_PUBLIC_KEY)%'
private_key: '%env(RECAPTCHA_PRIVATE_KEY)%'
2 changes: 1 addition & 1 deletion app/config/packages/framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ framework:
fallbacks: ["%locale%"]
enabled: true
default_path: "%kernel.project_dir%/../translations"
secret: "%secret%"
secret: "%env(SECRET)%"
router:
resource: "%kernel.project_dir%/config/routing.yml"
strict_requirements: ~
Expand Down
4 changes: 2 additions & 2 deletions app/config/packages/knpu_oauth2_client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ knpu_oauth2_client:
# will create a service: knpu.oauth2.client.facebook_main
github_main:
type: github
client_id: "%github_client_id%"
client_secret: "%github_client_secret%"
client_id: "%env(GITHUB_CLIENT_ID)%"
client_secret: "%env(GITHUB_CLIENT_SECRET)%"
# see below
redirect_route: connection_github_check
2 changes: 1 addition & 1 deletion app/config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ security:
- { path: ^/admin/(members/reporting|association/relances|talk|slackmembers/check|healthcheck), roles: ROLE_ADMIN}
- { path: ^/member, roles: [ROLE_USER, ROLE_MEMBER_EXPIRED]}
- { path: ^/admin/, roles: ROLE_MEMBER_EXPIRED }
- { path: ^/blog, allow_if: "request.getClientIp() in ['217.70.189.71', '127.0.0.1', '192.168.42.1'] or request.server.get('ALLOW_BLOG_FROM_ALL') == 1 or request.headers.get('x-afup-blog-api-key') == '%blog_api_key%'" }
- { path: ^/blog, allow_if: "request.getClientIp() in ['217.70.189.71', '127.0.0.1', '192.168.42.1'] or request.server.get('ALLOW_BLOG_FROM_ALL') == 1 or request.headers.get('x-afup-blog-api-key') == '%env(BLOG_API_KEY)%'" }
- { path: ^/blog, roles: ROLE_NO_ACCESS }
- { path: ^/(event/\w+/tickets|association)paybox-callback, roles: PUBLIC_ACCESS, ips: "%paybox_ips%" }
- { path: ^/(event/\w+/tickets|association)paybox-callback, roles: ROLE_SUPER_ADMIN }
Expand Down
22 changes: 11 additions & 11 deletions app/config/packages/ting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ ting:
namespace: CCMBenchmark\Ting\Driver\Mysqli
charset: utf8mb4
master:
host: "%database_host%"
port: "%database_port%"
user: "%database_user%"
password: "%database_password%"
host: "%env(DATABASE_HOST)%"
port: "%env(int:DATABASE_PORT)%"
user: "%env(DATABASE_USER)%"
password: "%env(DATABASE_PASSWORD)%"

repositories:
event:
Expand All @@ -16,46 +16,46 @@ ting:
options:
default:
connection: main
database: '%database_name%'
database: '%env(DATABASE_NAME)%'
site:
namespace : AppBundle\Site\Model\Repository
directory : "@AppBundle/Site/Model/Repository"
options:
default:
connection: main
database: '%database_name%'
database: '%env(DATABASE_NAME)%'
accounting:
namespace: AppBundle\Accounting\Model\Repository
directory: "@AppBundle/Accounting/Model/Repository"
options:
default:
connection: main
database: "%database_name%"
database: "%env(DATABASE_NAME)%"
association:
namespace : AppBundle\Association\Model\Repository
directory : "@AppBundle/Association/Model/Repository"
options:
default:
connection: main
database: '%database_name%'
database: '%env(DATABASE_NAME)%'
membershipfee:
namespace: AppBundle\MembershipFee\Model\Repository
directory: "@AppBundle/MembershipFee/Model/Repository"
options:
default:
connection: main
database: "%database_name%"
database: "%env(DATABASE_NAME)%"
throttling:
namespace : AppBundle\Security\ActionThrottling
directory : "@AppBundle/Security/ActionThrottling"
options:
default:
connection: main
database: '%database_name%'
database: '%env(DATABASE_NAME)%'
techletter:
namespace: AppBundle\TechLetter\Model\Repository
directory: "@AppBundle/TechLetter/Model/Repository"
options:
default:
connection: main
database: "%database_name%"
database: "%env(DATABASE_NAME)%"
2 changes: 1 addition & 1 deletion app/config/packages/twig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ twig:
strict_variables: "%kernel.debug%"
globals:
photo_storage: '@AppBundle\CFP\PhotoStorage'
global_menu_event_label: '%afup_global_menu_event_label%'
global_menu_event_label: '%env(AFUP_GLOBAL_MENU_EVENT_LABEL)%'
form_themes: ['form_theme.html.twig']
exception_controller: null
default_path: "%kernel.project_dir%/../templates"
45 changes: 23 additions & 22 deletions app/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ parameters:
app.badge_dir: "%kernel.project_dir%/../htdocs/uploads/badges"
app.members_logo_dir: "%kernel.project_dir%/../htdocs/uploads/members_logo"
app.general_meetings_dir: "%kernel.project_dir%/../htdocs/uploads/general_meetings_reports"
bluesky.api.identifier: "%bluesky_api_identifier%"
bluesky.api.app_password: "%bluesky_api_app_password%"
bluesky.api.identifier: "%env(BLUESKY_API_IDENTIFIER)%"
bluesky.api.app_password: "%env(BLUESKY_API_APP_PASSWORD)%"

services:
# service_name:
Expand All @@ -26,9 +26,9 @@ services:
Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler:
public: false
arguments:
- 'mysql:host=%database_host%;port=%database_port%;dbname=%database_name%'
- db_username: '%database_user%'
db_password: '%database_password%'
- 'mysql:host=%env(DATABASE_HOST)%;port=%env(int:DATABASE_PORT)%;dbname=%env(DATABASE_NAME)%'
- db_username: '%env(DATABASE_USER)%'
db_password: '%env(DATABASE_PASSWORD)%'
lock_mode: !php/const Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler::LOCK_NONE

Laminas\Feed\Reader\Http\ClientInterface: '@PlanetePHP\SymfonyFeedClient'
Expand Down Expand Up @@ -81,19 +81,19 @@ services:

AppBundle\Payment\PayboxFactory:
autowire: true
arguments: ["@router", "%paybox_domain_server%", "%paybox_secret_key%", "%paybox_site%", "%paybox_rang%", "%paybox_identifiant%"]
arguments: ["@router", "%env(PAYBOX_DOMAIN_SERVER)%", "%env(PAYBOX_SECRET_KEY)%", "%env(PAYBOX_SITE)%", "%env(PAYBOX_RANG)%", "%env(PAYBOX_IDENTIFIANT)%"]

AppBundle\Slack\LegacyClient:
arguments: ["%slack_members_legacy_token%"]
arguments: ["%env(SLACK_MEMBERS_LEGACY_TOKEN)%"]

Algolia\AlgoliaSearch\SearchClient:
factory: [ Algolia\AlgoliaSearch\SearchClient, create ]
arguments: ["%algolia_app_id%", "%algolia_backend_api_key%"]
arguments: ["%env(ALGOLIA_APP_ID)%", "%env(ALGOLIA_BACKEND_API_KEY)%"]

# API/Client Meetup techletter
app.mailchimp_techletter_client:
class: DrewM\MailChimp\MailChimp
arguments: ["%mailchimp_techletter_api_key%"]
arguments: ["%env(MAILCHIMP_TECHLETTER_API_KEY)%"]
public: false
app.mailchimp_techletter_api:
class: AppBundle\Mailchimp\Mailchimp
Expand All @@ -103,7 +103,7 @@ services:
# API/Client Meetup
app.mailchimp_client:
class: DrewM\MailChimp\MailChimp
arguments: ["%mailchimp_api_key%"]
arguments: ["%env(MAILCHIMP_API_KEY)%"]
public: false
app.mailchimp_api:
class: AppBundle\Mailchimp\Mailchimp
Expand All @@ -114,23 +114,27 @@ services:
autowire: true
arguments:
$mailchimp: '@app.mailchimp_techletter_api'
$listId: "%mailchimp_techletter_list%"
$listId: "%env(MAILCHIMP_TECHLETTER_LIST)%"

AppBundle\Mailchimp\MailchimpMembersAutoListSynchronizer:
autowire: true
arguments:
$mailchimp: '@app.mailchimp_api'
$listId: "%mailchimp_members_list%"
$listId: "%env(MAILCHIMP_MEMBERS_LIST)%"

AppBundle\Email\Mailer\Adapter\MailerAdapter:
class: AppBundle\Email\Mailer\Adapter\PhpMailerAdapter
factory: [AppBundle\Email\Mailer\Adapter\PhpMailerAdapter, createFromConfiguration]
arguments: ['@Afup\Site\Utils\Configuration']
class: AppBundle\Email\Mailer\Adapter\PhpMailerAdapter
arguments:
$smtpServer: '%env(SMTP_HOST)%'
$tls: '%env(SMTP_TLS)%'
$username: '%env(SMTP_USERNAME)%'
$password: '%env(SMTP_PASSWORD)%'
$port: '%env(SMTP_PORT)%'

AppBundle\Mailchimp\EventEventSubscriber:
arguments:
- '@app.mailchimp_api'
- "%mailchimp_members_list%"
- "%env(MAILCHIMP_MEMBERS_LIST)%"
tags:
- { name: kernel.event_listener, event: user.disabled, method: onUserDisabled }

Expand All @@ -140,10 +144,7 @@ services:

AppBundle\Event\Ticket\QrCodeGenerator:
autowire: true
arguments: ["%qr_code_salt%"]

Afup\Site\Utils\Configuration:
autowire: true
arguments: ["%env(QR_CODE_SALT)%"]

Afup\Site\Utils\LegacyConnectionFactory: ~
Afup\Site\Utils\Base_De_Donnees:
Expand Down Expand Up @@ -189,7 +190,7 @@ services:

geocoder_provider_google_maps:
class: Geocoder\Provider\GoogleMaps\GoogleMaps
arguments: ['@Psr\Http\Client\ClientInterface', null, "%google_maps_api_key%"]
arguments: ['@Psr\Http\Client\ClientInterface', null, "%env(GOOGLE_MAPS_API_KEY)%"]

AppBundle\Offices\OfficeFinder:
arguments: ['@geocoder']
Expand All @@ -203,7 +204,7 @@ services:
Doctrine\DBAL\Connection:
factory: '@AppBundle\Doctrine\ConnectionFactory'
arguments:
$url: 'mysql://%database_user%:%database_password%@%database_host%:%database_port%/%database_name%?charset=utf8mb4'
$url: 'mysql://%env(DATABASE_USER)%:%env(DATABASE_PASSWORD)%@%env(DATABASE_HOST)%:%env(DATABASE_PORT)%/%env(DATABASE_NAME)%?charset=utf8mb4'

AppBundle\Github\GithubClient:
arguments:
Expand Down
Loading
Loading