Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@ jobs:
composer-options: "--no-scripts"

- name: Rector
run: make rector
run: make rector
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ test-functional: data config htdocs/uploads tmp
CURRENT_UID=$(CURRENT_UID) $(DOCKER_COMPOSE_BIN) stop dbtest apachephptest mailcatcher
CURRENT_UID=$(CURRENT_UID) $(DOCKER_COMPOSE_BIN) up -d dbtest apachephptest mailcatcher
make clean-test-deprecated-log
CURRENT_UID=$(CURRENT_UID) $(DOCKER_COMPOSE_BIN) run --no-deps --rm -u localUser apachephp ./bin/behat
CURRENT_UID=$(CURRENT_UID) $(DOCKER_COMPOSE_BIN) run --no-deps --rm -u localUser apachephp ./bin/behat --colors
make var/logs/test.deprecations_grouped.log
CURRENT_UID=$(CURRENT_UID) $(DOCKER_COMPOSE_BIN) stop dbtest apachephptest mailcatcher

Expand Down
32 changes: 0 additions & 32 deletions app/config/config.php

This file was deleted.

37 changes: 22 additions & 15 deletions app/config/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
imports:
- { resource: config.php }
- { resource: security.yml }
- { resource: services.yml }
- { resource: packages/http_client.yaml }
Expand Down Expand Up @@ -160,6 +159,14 @@ parameters:
forum_sessions:
nom: 'Conférences'
niveau: 'ROLE_FORUM'
admin_event_themes_list:
nom: 'Thèmes'
niveau: 'ROLE_FORUM'
url: '/admin/event/themes'
extra_routes:
- admin_event_themes_list
- admin_event_themes_add
- admin_event_themes_edit
forum_vote_github:
nom: 'Votes visiteurs'
niveau: 'ROLE_FORUM'
Expand Down Expand Up @@ -315,7 +322,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 Expand Up @@ -351,7 +358,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"
Expand All @@ -363,9 +370,9 @@ ting:
charset: utf8mb4
master:
host: "%database_host%"
port: "%database_port%"
user: "%database_user%"
password: "%database_password%"
port: "%env(int:DATABASE_PORT)%"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

est-ce que ce genre de changement technique ne serait pas à faire dans une PR dédiée pour ne déployer que ça, suivre le changement en prod, puis ensuite livrer en prod la fonctionnalité, mais bien dissocier les deux pour réduire les risques au déploiement / avoir un meilleur suivi) ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comme la fonctionnalité ne s'active pas par défaut, on peut envisager de faire la mep globale sans activer la feature, pour ne rien casser en cas de rollback, qu'en dis-tu ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

poke @agallou ^^

user: "%env(DATABASE_USER)%"
password: "%env(DATABASE_PASSWORD)%"

repositories:
event:
Expand All @@ -374,50 +381,50 @@ 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)%'

association:
namespace : AppBundle\Association\Model\Repository
directory : "@AppBundle/Association/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)%"

knpu_oauth2_client:
clients:
# 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

ewz_recaptcha:
public_key: '%recaptcha_public_key%'
private_key: '%recaptcha_private_key%'
public_key: '%env(RECAPTCHA_PUBLIC_KEY)%'
private_key: '%env(RECAPTCHA_PRIVATE_KEY)%'


ekino_new_relic:
Expand Down
1 change: 1 addition & 0 deletions app/config/config_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ monolog:

parameters:
paybox_ips: [127.0.0.1, 192.168.42.1]
database_host: "db"

#swiftmailer:
# delivery_address: [email protected]
3 changes: 3 additions & 0 deletions app/config/config_prod.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
imports:
- { resource: config.yml }

parameters:
database_host: "%env(DATABASE_HOST)%"

#doctrine:
# orm:
# metadata_cache_driver: apc
Expand Down
19 changes: 19 additions & 0 deletions app/config/routing/admin_event.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,22 @@ admin_event_restore:
admin_event_votes:
path: /votes
defaults: {_controller: AppBundle\Controller\Admin\Event\VotesListeAction}

admin_event_themes_add:
path: /themes/add
defaults:
_controller: AppBundle\Controller\Admin\Event\EventThemeAddEditAction
id: null

admin_event_themes_edit:
path: /themes/edit/{id}
defaults: {_controller: AppBundle\Controller\Admin\Event\EventThemeAddEditAction}
requirements:
id: \d+

admin_event_themes_list:
path: /themes/
requirements:
id: \d+
defaults:
_controller: AppBundle\Controller\Admin\Event\EventThemeAction
2 changes: 1 addition & 1 deletion app/config/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,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
34 changes: 19 additions & 15 deletions app/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ 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)%"
database_name: "%env(DATABASE_NAME)%"
database_user: "%env(DATABASE_USER)%"
database_password: "%env(DATABASE_PASSWORD)%"
database_port: "%env(DATABASE_PORT)%"

services:
# service_name:
Expand All @@ -25,9 +29,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=%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

AppBundle\:
Expand Down Expand Up @@ -78,19 +82,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 @@ -100,7 +104,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 @@ -111,13 +115,13 @@ 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)%"

Afup\Site\Utils\Configuration:
autowire: true
Expand All @@ -130,7 +134,7 @@ services:
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,7 +144,7 @@ services:

AppBundle\Event\Ticket\QrCodeGenerator:
autowire: true
arguments: ["%qr_code_salt%"]
arguments: ["%env(QR_CODE_SALT)%"]

Afup\Site\Forum\AppelConferencier:
class: Afup\Site\Forum\AppelConferencier
Expand Down Expand Up @@ -185,7 +189,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 Down
2 changes: 2 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Dotenv\Dotenv;

// if you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
Expand All @@ -16,6 +17,7 @@ $loader = require __DIR__.'/../vendor/autoload.php';
$input = new ArgvInput();
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev');
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod';
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');

$kernel = new AppKernel($env, $debug);
$application = new Application($kernel);
Expand Down
1 change: 1 addition & 0 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ services:
ENABLE_XDEBUG: ${ENABLE_XDEBUG:-false}
environment:
SYMFONY_ENV: "test"
APP_ENV: "test"
HOST_PWD: ${PWD}
SYMFONY_IDE: "%env(IDE_USED)%://open?url=file://%%f&line=%%l&/var/www/html/>%env(HOST_PWD)%/"
env_file:
Expand Down
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"symfony/asset": "7.3.*",
"symfony/clock": "7.2.*",
"symfony/console": "7.3.*",
"symfony/dotenv": "7.3.*",
"symfony/expression-language": "7.3.*",
"symfony/form": "7.3.*",
"symfony/framework-bundle": "7.3.*",
Expand Down Expand Up @@ -99,7 +100,10 @@
"symfony-web-dir": "htdocs",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
"symfony-tests-dir": "tests"
"symfony-tests-dir": "tests",
"symfony": {
"require": "7.3.*"
}
},
"autoload": {
"psr-4": {
Expand Down
Loading