Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
4rthem committed Dec 10, 2024
1 parent 403a914 commit 97d0e68
Show file tree
Hide file tree
Showing 173 changed files with 686 additions and 32,299 deletions.
9 changes: 1 addition & 8 deletions .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
COMPOSE_PROJECT_NAME=ps
COMPOSE_FILE=docker-compose.yml
COMPOSE_PROFILES=databox,expose,notify,uploader,db,report,tools,mailhog,dashboard,soketi,novu
COMPOSE_PROFILES=databox,expose,uploader,db,report,tools,mailhog,dashboard,soketi,novu

# Leave empty if 443, include ':' otherwise
HTTPS_PORT_PREFIX=${HTTPS_PORT_PREFIX:-}
Expand All @@ -25,7 +25,6 @@ S3_ENDPOINT=https://minio.${PHRASEA_DOMAIN}${HTTPS_PORT_PREFIX}
UPLOADER_API_URL=https://api-uploader.${PHRASEA_DOMAIN}${HTTPS_PORT_PREFIX}
EXPOSE_API_URL=https://api-expose.${PHRASEA_DOMAIN}${HTTPS_PORT_PREFIX}
DATABOX_API_URL=https://api-databox.${PHRASEA_DOMAIN}${HTTPS_PORT_PREFIX}
NOTIFY_API_URL=https://api-notify.${PHRASEA_DOMAIN}${HTTPS_PORT_PREFIX}
DATABOX_CLIENT_URL=https://databox.${PHRASEA_DOMAIN}${HTTPS_PORT_PREFIX}
EXPOSE_CLIENT_URL=https://expose.${PHRASEA_DOMAIN}${HTTPS_PORT_PREFIX}
UPLOADER_CLIENT_URL=https://uploader.${PHRASEA_DOMAIN}${HTTPS_PORT_PREFIX}
Expand Down Expand Up @@ -109,9 +108,6 @@ EXPOSE_ADMIN_CLIENT_SECRET=__CHANGE_ME_cli3nt_s3cr3t
UPLOADER_ADMIN_CLIENT_ID=uploader-admin
UPLOADER_ADMIN_CLIENT_SECRET=__CHANGE_ME_cli3nt_s3cr3t

NOTIFY_ADMIN_CLIENT_ID=notify-admin
NOTIFY_ADMIN_CLIENT_SECRET=__CHANGE_ME_cli3nt_s3cr3t

DATABOX_ADMIN_CLIENT_ID=databox-admin
DATABOX_ADMIN_CLIENT_SECRET=__CHANGE_ME_cli3nt_s3cr3t

Expand All @@ -135,9 +131,6 @@ EXPOSE_CLOUD_FRONT_TTL=86400
EXPOSE_DISABLE_INDEX_PAGE=0
EXPOSE_MATOMO_SITE_ID=1

# Notify
NOTIFY_RABBITMQ_VHOST=notify

# RabbitMQ
RABBITMQ_HOST=rabbitmq
RABBITMQ_PORT=5672
Expand Down
15 changes: 1 addition & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
DOCKER_TAG: ${{ github.sha }}
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
VERIFY_SSL: "false"
COMPOSE_PROFILES: databox,expose,notify,uploader,databox-worker,expose-worker,notify-worker,uploader-worker,db,report,mailhog,dashboard
COMPOSE_PROFILES: databox,expose,uploader,db,report,mailhog,dashboard

jobs:
build_keycloak:
Expand Down Expand Up @@ -159,18 +159,6 @@ jobs:
context: ./infra/docker/matomo-nginx
secrets: inherit

build_notify_api:
name: 'Build Notify API'
uses: ./.github/workflows/build_api.yaml
with:
prefix: notify
context: ./notify/api
withLibs: true
secrets: inherit
needs:
- build_php-fpm-base
- build_nginx-fpm-base

build_report_api:
name: 'Build Report API'
uses: ./.github/workflows/build.yaml
Expand Down Expand Up @@ -216,7 +204,6 @@ jobs:
- build_keycloak
- build_matomo_nginx
- build_matomo_php
- build_notify_api
- build_report_api
- build_uploader_api
- build_uploader_client
Expand Down
1 change: 0 additions & 1 deletion bin/dev/restart-nginx-services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ load-env
docker compose restart \
databox-api-nginx \
expose-api-nginx \
notify-api-nginx \
uploader-api-nginx
1 change: 0 additions & 1 deletion bin/migrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ docker compose run --rm dockerize

APPS="
expose-api-php
notify-api-php
databox-api-php
uploader-api-php
"
Expand Down
2 changes: 0 additions & 2 deletions bin/ops/db/db.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/bin/sh

DATABASES="
auth
databox
expose
uploader
notify
"
6 changes: 0 additions & 6 deletions bin/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ COMPOSE_PROFILES="${COMPOSE_PROFILES},setup" docker compose run --rm -T --entryp
&& mc mb --ignore-existing minio/$EXPOSE_S3_BUCKET_NAME \
"

# Setup Notify
## Create rabbitmq vhost
exec_container rabbitmq "rabbitmqctl add_vhost ${NOTIFY_RABBITMQ_VHOST} && rabbitmqctl set_permissions -p ${NOTIFY_RABBITMQ_VHOST} ${RABBITMQ_USER} '.*' '.*' '.*'"
## Setup container
exec_container_as notify-api-php "bin/setup.sh" app

# Setup Databox
## Create rabbitmq vhost
exec_container rabbitmq "rabbitmqctl add_vhost ${DATABOX_RABBITMQ_VHOST} && rabbitmqctl set_permissions -p ${DATABOX_RABBITMQ_VHOST} ${RABBITMQ_USER} '.*' '.*' '.*'"
Expand Down
4 changes: 1 addition & 3 deletions bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -ex
export APP_ENV=test
export XDEBUG_ENABLED=0
export VERIFY_SSL=false
export COMPOSE_PROFILES=db,uploader,report,databox,expose,notify
export COMPOSE_PROFILES=db,uploader,report,databox,expose

docker compose up -d

Expand All @@ -18,7 +18,6 @@ docker compose run --rm dockerize
SF_SERVICES="
databox-api-php
expose-api-php
notify-api-php
uploader-api-php
"

Expand All @@ -30,7 +29,6 @@ LIBS="
admin-bundle
api-test
auth-bundle
notify-bundle
report-bundle
report-sdk
"
Expand Down
1 change: 0 additions & 1 deletion bin/vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ SYMFONY_PROJECTS="
databox/api
expose/api
uploader/api
notify/api
"

CLIENT_PROJECTS="
Expand Down
8 changes: 0 additions & 8 deletions configs/config.dist.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@
}
}
},
"notify": {
"admin": {
"logo": {
"src": "https://www.phraseanet.com/wp-content/uploads/2014/05/PICTO_PHRASEANET.png",
"with": "80px"
}
}
},
"expose": {
"admin": {
"logo": {
Expand Down
4 changes: 0 additions & 4 deletions configurator/config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ doctrine:
<<: *doctrine_commons
url: '%env(resolve:EXPOSE_DATABASE_URL)%'

notify:
<<: *doctrine_commons
url: '%env(resolve:NOTIFY_DATABASE_URL)%'

uploader:
<<: *doctrine_commons
url: '%env(resolve:UPLOADER_DATABASE_URL)%'
Expand Down
1 change: 0 additions & 1 deletion configurator/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ services:
array $symfonyApplications:
- databox
- expose
- notify
- uploader
array $frontendApplications:
- databox
Expand Down
5 changes: 0 additions & 5 deletions configurator/src/Command/Migration20230807Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,6 @@ public function execute(InputInterface $input, OutputInterface $output): int
'user_id',
],
],
'notify' => [
'contact' => [
'user_id',
],
],
'uploader' => [
'asset' => [
'user_id',
Expand Down
2 changes: 0 additions & 2 deletions configurator/src/Doctrine/DoctrineConnectionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@ public function __construct(
Connection $authConnection,
Connection $databoxConnection,
Connection $exposeConnection,
Connection $notifyConnection,
Connection $uploaderConnection,
) {
$this->connections = [
'auth' => $authConnection,
'databox' => $databoxConnection,
'expose' => $exposeConnection,
'notify' => $notifyConnection,
'uploader' => $uploaderConnection,
];
}
Expand Down
1 change: 0 additions & 1 deletion dashboard/client/config-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
'SOKETI_USAGE_URL',
'NOVU_DASHBOARD_URL',
'NOVU_STUDIO_URL',
'NOVU_BRIDGE_URL',
];

const e = {};
Expand Down
40 changes: 6 additions & 34 deletions dashboard/client/src/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ import {
import Service from './Service';
import ClientApp from './ClientApp.tsx';
import config from './config.ts';
import ApiIcon from '@mui/icons-material/Api';
import SellIcon from '@mui/icons-material/Sell';
import keycloakImg from './images/keycloak.png';
import databoxImg from './images/databox.png';
import uploaderImg from './images/uploader.png';
import exposeImg from './images/expose.png';
import notifyImg from './images/notify.png';
import dashboardImg from './images/dashboard.png';
import DashboardBar from './DashboardBar';
import {useAuth} from '@alchemy/react-auth';
import AdminPanelSettingsIcon from '@mui/icons-material/AdminPanelSettings';
Expand Down Expand Up @@ -50,7 +49,6 @@ export default function Dashboard({}: Props) {
SOKETI_USAGE_URL,
NOVU_DASHBOARD_URL,
NOVU_STUDIO_URL,
NOVU_BRIDGE_URL,
} = config.env;

const roles = user?.roles ?? [];
Expand All @@ -68,12 +66,12 @@ export default function Dashboard({}: Props) {
},
}}
>
<div style={{ display: 'flex', alignItems: 'center' }}>
{
<div style={{ display: 'flex', alignItems: 'center' }}>
{
config.logo ? <img src={config.logo} alt={STACK_NAME} style={{ maxHeight:48, maxWidth:150 }}/>
: STACK_NAME
}

{user ? (
<Chip
icon={<SellIcon />}
Expand Down Expand Up @@ -162,27 +160,12 @@ export default function Dashboard({}: Props) {
isAdmin={roles.includes('uploader-admin')}
/>
)}
{NOTIFY_API_URL && roles.includes('notify-admin') && (
<Service
mainUrl={`${NOTIFY_API_URL}/admin`}
title={`Notify Admin`}
description={`Mail Sender`}
logo={notifyImg}
links={[
{
icon: <ApiIcon />,
href: NOTIFY_API_URL,
title: `API documentation of Notify`,
},
]}
/>
)}
{isInIframe ? (
<Service
mainUrl={`/`}
title={`Dashboard`}
description={`Phrasea entrypoint`}
logo={notifyImg}
logo={dashboardImg}
/>
) : (
''
Expand Down Expand Up @@ -291,18 +274,7 @@ export default function Dashboard({}: Props) {
</Link>
</Grid>
)}
{NOVU_BRIDGE_URL && (
<Grid item>
<Link
href={NOVU_BRIDGE_URL}
target={'_blank'}
rel={'noreferrer noopener'}
>
Novu Bridge
</Link>
</Grid>
)}
{NOVU_STUDIO_URL && (
{config.devMode && NOVU_STUDIO_URL && (
<Grid item>
<Link
href={NOVU_STUDIO_URL}
Expand Down
File renamed without changes
1 change: 0 additions & 1 deletion doc/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ bin/install-fixtures.sh
* Read group of services documentation to customize environment variables:
* [databox](../databox/README.md)
* [expose](../expose/README.md)
* [notify](../notify/README.md)
* [report](../report/README.md)
* [uploader](../uploader/README.md)

Expand Down
20 changes: 0 additions & 20 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,25 +94,6 @@ services:
volumes:
- ./uploader/api/public:/srv/app/public

notify-api-php:
environment:
- XDEBUG_ENABLED
- XDEBUG_SESSION
- XDEBUG_CLIENT_HOST=${PS_GATEWAY_IP}
- PHP_IDE_CONFIG=serverName=${PS_DEBUG_SERVER_NAME_PREFIX}notify
volumes:
- ./notify/api:/srv/app
- ./lib/php:/lib/php

notify-api-nginx:
volumes:
- ./notify/api/public:/srv/app/public

notify-worker:
volumes:
- ./notify/api:/srv/app
- ./lib/php:/lib/php

databox-api-php:
environment:
- SECRETS_SECRET_KEY=${DATABOX_SECRETS_SECRET_KEY} # secret should not be provided to API but is necessary in dev mode
Expand Down Expand Up @@ -247,7 +228,6 @@ services:
- api-uploader.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- api-expose.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- api-databox.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- api-notify.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- api-novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
- bridge-novu.${PHRASEA_DOMAIN}:${PS_GATEWAY_IP}
Expand Down
47 changes: 0 additions & 47 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -362,53 +362,6 @@ services:
- "traefik.project_name=${COMPOSE_PROJECT_NAME}"
- "traefik.http.routers.expose-api.rule=Host(`api-expose.${PHRASEA_DOMAIN}`)"

notify-api-php:
extends:
service: a_api-php
profiles:
- notify
image: ${REGISTRY_NAMESPACE}notify-api-php:${DOCKER_TAG}
build:
context: ./
dockerfile: ./notify/api/Dockerfile
environment:
- RABBITMQ_VHOST=${NOTIFY_RABBITMQ_VHOST}
- ADMIN_CLIENT_ID=${NOTIFY_ADMIN_CLIENT_ID}
- ADMIN_CLIENT_SECRET=${NOTIFY_ADMIN_CLIENT_SECRET}
- REPORT_API_URL
- MAILER_DSN
- MAIL_FROM
- NEWRELIC_APP_NAME=notify-api

notify-worker:
extends:
service: notify-api-php
image: ${REGISTRY_NAMESPACE}notify-worker:${DOCKER_TAG}
build:
target: worker
deploy:
replicas: $NOTIFY_WORKER_REPLICAS

notify-api-nginx:
profiles:
- notify
image: ${REGISTRY_NAMESPACE}notify-api-nginx:${DOCKER_TAG}
build:
context: ./
dockerfile: ./notify/api/Dockerfile
target: api-nginx
args:
BASE_TAG: ${DOCKER_TAG}
REGISTRY_NAMESPACE: ${REGISTRY_NAMESPACE}
networks:
- internal
depends_on:
- notify-api-php
labels:
- "traefik.enable=true"
- "traefik.project_name=${COMPOSE_PROJECT_NAME}"
- "traefik.http.routers.notify-api.rule=Host(`api-notify.${PHRASEA_DOMAIN}`)"

redis:
profiles:
- db
Expand Down
Loading

0 comments on commit 97d0e68

Please sign in to comment.