repo sync: ported all fixes from Tipimi
This commit is contained in:
parent
ef37239c07
commit
f49933bcd4
14 changed files with 52 additions and 38 deletions
1
.github/workflows/cd.yml
vendored
1
.github/workflows/cd.yml
vendored
|
|
@ -5,6 +5,7 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
permissions:
|
permissions:
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
id-token: write
|
id-token: write
|
||||||
|
|
|
||||||
20
.github/workflows/deploy.yml
vendored
20
.github/workflows/deploy.yml
vendored
|
|
@ -9,11 +9,6 @@ on:
|
||||||
payum-apikey:
|
payum-apikey:
|
||||||
description: Payum API Key
|
description: Payum API Key
|
||||||
required: true
|
required: true
|
||||||
sms-dsn:
|
|
||||||
description: SMS DSN
|
|
||||||
required: true
|
|
||||||
mailer-dsn:
|
|
||||||
description: MAILER DSN
|
|
||||||
storage-key:
|
storage-key:
|
||||||
description: storage key
|
description: storage key
|
||||||
required: true
|
required: true
|
||||||
|
|
@ -29,6 +24,12 @@ on:
|
||||||
database-url:
|
database-url:
|
||||||
description: Database URL
|
description: Database URL
|
||||||
required: true
|
required: true
|
||||||
|
mailer-dsn:
|
||||||
|
description: Mailer DSN
|
||||||
|
required: true
|
||||||
|
sms-dsn:
|
||||||
|
description: SMS DSN
|
||||||
|
required: true
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
@ -44,6 +45,7 @@ jobs:
|
||||||
project: ${{ steps.meta.outputs.project }}
|
project: ${{ steps.meta.outputs.project }}
|
||||||
namespace: ${{ steps.meta.outputs.namespace }}
|
namespace: ${{ steps.meta.outputs.namespace }}
|
||||||
storage_name: ${{ steps.meta.outputs.storage_name }}
|
storage_name: ${{ steps.meta.outputs.storage_name }}
|
||||||
|
trusted_host: ${{ steps.meta.outputs.trusted_host }}
|
||||||
steps:
|
steps:
|
||||||
- name: Generate metadata
|
- name: Generate metadata
|
||||||
id: meta
|
id: meta
|
||||||
|
|
@ -55,6 +57,9 @@ jobs:
|
||||||
ENVIRONMENT=prod
|
ENVIRONMENT=prod
|
||||||
IMAGE_TAG=sha-${GITHUB_SHA::7}
|
IMAGE_TAG=sha-${GITHUB_SHA::7}
|
||||||
RELEASE_NAME=prod
|
RELEASE_NAME=prod
|
||||||
|
TRUSTED_HOST=$(echo ${{ vars.DOMAIN }} | sed 's/\./\\\\\\\\./g')
|
||||||
|
|
||||||
|
echo "trusted_host=${TRUSTED_HOST}" >> $GITHUB_OUTPUT
|
||||||
echo "context=${CONTEXT}" >> $GITHUB_OUTPUT
|
echo "context=${CONTEXT}" >> $GITHUB_OUTPUT
|
||||||
echo "environment=${ENVIRONMENT}" >> $GITHUB_OUTPUT
|
echo "environment=${ENVIRONMENT}" >> $GITHUB_OUTPUT
|
||||||
echo "image_tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT
|
echo "image_tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT
|
||||||
|
|
@ -120,15 +125,18 @@ jobs:
|
||||||
--set=ingress.tls[0].hosts[0]=${{ vars.DOMAIN }} \
|
--set=ingress.tls[0].hosts[0]=${{ vars.DOMAIN }} \
|
||||||
--set=postgresql.url="${{ secrets.database-url }}" \
|
--set=postgresql.url="${{ secrets.database-url }}" \
|
||||||
--set=postgresql.enabled='${{ github.event_name == 'pull_request' }}' \
|
--set=postgresql.enabled='${{ github.event_name == 'pull_request' }}' \
|
||||||
--set=sms.dsn="${{ secrets.sms-dsn }}" \
|
|
||||||
--set=payum.apikey="${{ secrets.payum-apikey }}" \
|
--set=payum.apikey="${{ secrets.payum-apikey }}" \
|
||||||
--set=mailer.dsn="${{ secrets.mailer-dsn }}" \
|
--set=mailer.dsn="${{ secrets.mailer-dsn }}" \
|
||||||
|
--set=sms.dsn="${{ secrets.sms-dsn }}" \
|
||||||
--set=php.storage.bucket="${{ vars.STORAGE_BUCKET }}" \
|
--set=php.storage.bucket="${{ vars.STORAGE_BUCKET }}" \
|
||||||
--set=php.storage.endpoint="https://storage.googleapis.com" \
|
--set=php.storage.endpoint="https://storage.googleapis.com" \
|
||||||
--set=php.storage.region="eu-west-1" \
|
--set=php.storage.region="eu-west-1" \
|
||||||
--set=php.storage.usePathStyleEndpoint=true \
|
--set=php.storage.usePathStyleEndpoint=true \
|
||||||
--set=php.storage.key="${{ secrets.storage-key }}" \
|
--set=php.storage.key="${{ secrets.storage-key }}" \
|
||||||
--set=php.storage.secret="${{ secrets.storage-secret-key }}" \
|
--set=php.storage.secret="${{ secrets.storage-secret-key }}" \
|
||||||
|
--set=php.trustedHosts[2]=${{ needs.meta.outputs.trusted_host }} \
|
||||||
|
--set=php.fixtureJob.enabled=false \
|
||||||
|
--set=php.fixtureCron.enabled=false \
|
||||||
--values ./helm/chart/values-${{ needs.meta.outputs.context }}.yml \
|
--values ./helm/chart/values-${{ needs.meta.outputs.context }}.yml \
|
||||||
| sed --unbuffered '/USER-SUPPLIED VALUES/,$d' ; then
|
| sed --unbuffered '/USER-SUPPLIED VALUES/,$d' ; then
|
||||||
echo "Deployment has failed!"
|
echo "Deployment has failed!"
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
# https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
|
# https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
|
||||||
ARG PHP_VERSION=8.1
|
ARG PHP_VERSION=8.1
|
||||||
ARG CADDY_VERSION=2.8.4
|
ARG CADDY_VERSION=2.9.1
|
||||||
|
|
||||||
# yarn build
|
# yarn build
|
||||||
FROM gmolaire/yarn AS yarn_build
|
FROM gmolaire/yarn AS yarn_build
|
||||||
|
|
@ -183,12 +183,7 @@ RUN set -eux; \
|
||||||
RUN rm -f .env.local.php
|
RUN rm -f .env.local.php
|
||||||
|
|
||||||
# Build Caddy with the Mercure and Vulcain modules
|
# Build Caddy with the Mercure and Vulcain modules
|
||||||
# FROM caddy:${CADDY_VERSION}-builder-alpine AS app_caddy_builder
|
FROM caddy:${CADDY_VERSION}-builder-alpine AS app_caddy_builder
|
||||||
|
|
||||||
# Temporary fix for https://github.com/dunglas/mercure/issues/770
|
|
||||||
# https://github.com/dunglas/symfony-docker/pull/407/files
|
|
||||||
|
|
||||||
FROM caddy:2.8.4-builder-alpine AS app_caddy_builder
|
|
||||||
|
|
||||||
# RUN xcaddy build \
|
# RUN xcaddy build \
|
||||||
# --with github.com/dunglas/mercure \
|
# --with github.com/dunglas/mercure \
|
||||||
|
|
|
||||||
21
composer.lock
generated
21
composer.lock
generated
|
|
@ -4512,16 +4512,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/commonmark",
|
"name": "league/commonmark",
|
||||||
"version": "2.5.3",
|
"version": "2.6.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/thephpleague/commonmark.git",
|
"url": "https://github.com/thephpleague/commonmark.git",
|
||||||
"reference": "b650144166dfa7703e62a22e493b853b58d874b0"
|
"reference": "d150f911e0079e90ae3c106734c93137c184f932"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/b650144166dfa7703e62a22e493b853b58d874b0",
|
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d150f911e0079e90ae3c106734c93137c184f932",
|
||||||
"reference": "b650144166dfa7703e62a22e493b853b58d874b0",
|
"reference": "d150f911e0079e90ae3c106734c93137c184f932",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
|
@ -4546,8 +4546,9 @@
|
||||||
"phpstan/phpstan": "^1.8.2",
|
"phpstan/phpstan": "^1.8.2",
|
||||||
"phpunit/phpunit": "^9.5.21 || ^10.5.9 || ^11.0.0",
|
"phpunit/phpunit": "^9.5.21 || ^10.5.9 || ^11.0.0",
|
||||||
"scrutinizer/ocular": "^1.8.1",
|
"scrutinizer/ocular": "^1.8.1",
|
||||||
"symfony/finder": "^5.3 | ^6.0 || ^7.0",
|
"symfony/finder": "^5.3 | ^6.0 | ^7.0",
|
||||||
"symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 || ^7.0",
|
"symfony/process": "^5.4 | ^6.0 | ^7.0",
|
||||||
|
"symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 | ^7.0",
|
||||||
"unleashedtech/php-coding-standard": "^3.1.1",
|
"unleashedtech/php-coding-standard": "^3.1.1",
|
||||||
"vimeo/psalm": "^4.24.0 || ^5.0.0"
|
"vimeo/psalm": "^4.24.0 || ^5.0.0"
|
||||||
},
|
},
|
||||||
|
|
@ -4557,7 +4558,7 @@
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "2.6-dev"
|
"dev-main": "2.7-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
|
@ -4614,7 +4615,7 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-08-16T11:46:16+00:00"
|
"time": "2024-12-07T15:34:16+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/config",
|
"name": "league/config",
|
||||||
|
|
@ -19750,7 +19751,7 @@
|
||||||
],
|
],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
"minimum-stability": "beta",
|
"minimum-stability": "beta",
|
||||||
"stability-flags": {},
|
"stability-flags": [],
|
||||||
"prefer-stable": true,
|
"prefer-stable": true,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": {
|
"platform": {
|
||||||
|
|
@ -19762,6 +19763,6 @@
|
||||||
"ext-xsl": "*",
|
"ext-xsl": "*",
|
||||||
"ext-zip": "*"
|
"ext-zip": "*"
|
||||||
},
|
},
|
||||||
"platform-dev": {},
|
"platform-dev": [],
|
||||||
"plugin-api-version": "2.6.0"
|
"plugin-api-version": "2.6.0"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,6 @@ when@prod:
|
||||||
process_psr_3_messages: false
|
process_psr_3_messages: false
|
||||||
channels: ["!event", "!doctrine"]
|
channels: ["!event", "!doctrine"]
|
||||||
deprecation:
|
deprecation:
|
||||||
type: stream
|
type: "null"
|
||||||
channels: [deprecation]
|
channels: [deprecation]
|
||||||
path: php://stderr
|
path: php://stderr
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,10 @@ framework:
|
||||||
|
|
||||||
channel_policy:
|
channel_policy:
|
||||||
# use chat/slack, chat/telegram, sms/twilio or sms/nexmo
|
# use chat/slack, chat/telegram, sms/twilio or sms/nexmo
|
||||||
urgent: ['email']
|
urgent: ['sms','email']
|
||||||
high: ['email']
|
high: ['sms','email']
|
||||||
medium: ['email']
|
medium: ['sms','email']
|
||||||
low: ['email']
|
low: ['sms','email']
|
||||||
|
|
||||||
admin_recipients:
|
admin_recipients:
|
||||||
- { email: admin@example.com }
|
- { email: admin@example.com }
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
test/
|
prod-boot/
|
||||||
|
|
@ -10,7 +10,7 @@ data:
|
||||||
php-app-env: {{ .Values.php.appEnv | quote }}
|
php-app-env: {{ .Values.php.appEnv | quote }}
|
||||||
php-app-debug: {{ .Values.php.appDebug | quote }}
|
php-app-debug: {{ .Values.php.appDebug | quote }}
|
||||||
php-cors-allow-origin: {{ .Values.php.corsAllowOrigin | quote }}
|
php-cors-allow-origin: {{ .Values.php.corsAllowOrigin | quote }}
|
||||||
php-trusted-hosts: {{ .Values.php.trustedHosts | quote }}
|
php-trusted-hosts: {{ join "|" .Values.php.trustedHosts | quote }}
|
||||||
php-trusted-proxies: "{{ join "," .Values.php.trustedProxies }}"
|
php-trusted-proxies: "{{ join "," .Values.php.trustedProxies }}"
|
||||||
mercure-url: "http://{{ include "plateforme-ebs" . }}/.well-known/mercure"
|
mercure-url: "http://{{ include "plateforme-ebs" . }}/.well-known/mercure"
|
||||||
mercure-public-url: {{ .Values.mercure.publicUrl | default "http://127.0.0.1/.well-known/mercure" | quote }}
|
mercure-public-url: {{ .Values.mercure.publicUrl | default "http://127.0.0.1/.well-known/mercure" | quote }}
|
||||||
|
|
|
||||||
|
|
@ -200,4 +200,4 @@ spec:
|
||||||
periodSeconds: 3
|
periodSeconds: 3
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.resources.fixtures | nindent 16 }}
|
{{- toYaml .Values.resources.fixtures | nindent 16 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{{- if .Values.php.fixtureJob.enabled -}}
|
{{- if .Values.php.fixtureJob.enabled }}
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
kind: Job
|
kind: Job
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,6 @@ postgresql:
|
||||||
|
|
||||||
php:
|
php:
|
||||||
fixtureJob:
|
fixtureJob:
|
||||||
enabled: true
|
enabled: false
|
||||||
fixtureCron:
|
fixtureCron:
|
||||||
enabled: true
|
enabled: false
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,10 @@ php:
|
||||||
appDebug: "0"
|
appDebug: "0"
|
||||||
appSecret: ""
|
appSecret: ""
|
||||||
corsAllowOrigin: "^https?://.*?\\.chart-example\\.local$"
|
corsAllowOrigin: "^https?://.*?\\.chart-example\\.local$"
|
||||||
trustedHosts: "^127\\.0\\.0\\.1|localhost|.*\\.chart-example\\.local$"
|
trustedHosts:
|
||||||
|
- "^127\\.0\\.0\\.1"
|
||||||
|
- "localhost"
|
||||||
|
- ".*\\.chart-example\\.local$"
|
||||||
trustedProxies:
|
trustedProxies:
|
||||||
- "127.0.0.1"
|
- "127.0.0.1"
|
||||||
- "10.0.0.0/8"
|
- "10.0.0.0/8"
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,10 @@ final class SmsNotifier
|
||||||
|
|
||||||
public function notify(User $user, string $subject): ?SentMessage
|
public function notify(User $user, string $subject): ?SentMessage
|
||||||
{
|
{
|
||||||
|
$this->logger->info('SMS Notification');
|
||||||
if (!$user->canBeNotifiedBySms()) {
|
if (!$user->canBeNotifiedBySms()) {
|
||||||
|
$this->logger->warning('User cannot be notified by SMS');
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -43,10 +46,13 @@ final class SmsNotifier
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return $this->texter->send(new SmsMessage(
|
$response = $this->texter->send(new SmsMessage(
|
||||||
phone: $phoneNumber,
|
phone: $phoneNumber,
|
||||||
subject: $subject
|
subject: $subject
|
||||||
));
|
));
|
||||||
|
$this->logger->info('SMS Sent Successfully');
|
||||||
|
|
||||||
|
return $response;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
// OK, the sms cannot be delivered, but this is not critical as the an
|
// OK, the sms cannot be delivered, but this is not critical as the an
|
||||||
// email is always sent
|
// email is always sent
|
||||||
|
|
|
||||||
|
|
@ -61,13 +61,13 @@ final class ConfigurationRepository extends ServiceEntityRepository
|
||||||
|
|
||||||
public function getServicesParameter(): bool
|
public function getServicesParameter(): bool
|
||||||
{
|
{
|
||||||
/** @var array{configuration: array{ global: array{ globalServicesEnabled: bool }}} $config */
|
/** @var array{configuration: array{ global: array{ globalServicesEnabled: bool|null }}} $config */
|
||||||
$config = $this
|
$config = $this
|
||||||
->createQueryBuilder('c')
|
->createQueryBuilder('c')
|
||||||
->select('c.configuration')
|
->select('c.configuration')
|
||||||
->setMaxResults(1)
|
->setMaxResults(1)
|
||||||
->getQuery()->getOneOrNullResult();
|
->getQuery()->getOneOrNullResult();
|
||||||
|
|
||||||
return $config['configuration']['global']['globalServicesEnabled'];
|
return $config['configuration']['global']['globalServicesEnabled'] ?? false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue