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