From b4a318ae28392bcc96bc3a40e6a3e95ddcdc1cb6 Mon Sep 17 00:00:00 2001 From: afornerot Date: Thu, 26 Dec 2024 19:02:09 +0100 Subject: [PATCH] add ninecompta --- env/.env | 6 +++ services/10-nineapache/apache/apache.conf | 9 ++-- services/50-ninecompta/apache/apache.conf | 4 ++ .../dockercompose/dockercompose.yml | 13 ++++++ services/50-ninecompta/env/.env | 6 +++ services/50-ninecompta/misc/nine.sh | 45 +++++++++++++++++++ 6 files changed, 79 insertions(+), 4 deletions(-) create mode 100644 services/50-ninecompta/apache/apache.conf create mode 100644 services/50-ninecompta/dockercompose/dockercompose.yml create mode 100644 services/50-ninecompta/env/.env create mode 100644 services/50-ninecompta/misc/nine.sh diff --git a/env/.env b/env/.env index dafa2fc..933c762 100644 --- a/env/.env +++ b/env/.env @@ -185,6 +185,12 @@ NINEBOARD_ACTIVATE=1 NINEBOARD_LOCAL=1 NINEBOARD_URL=${PROTOCOLE}://${WEB_URL}/nineboard +# NINECOMPTA +NINECOMPTA_SERVICE_NAME=ninecompta +NINECOMPTA_ACTIVATE=0 +NINECOMPTA_LOCAL=1 +NINECOMPTA_URL=${PROTOCOLE}://${WEB_URL}/ninecompta + # NINEFOLIO NINEFOLIO_SERVICE_NAME=ninefolio NINEFOLIO_ACTIVATE=0 diff --git a/services/10-nineapache/apache/apache.conf b/services/10-nineapache/apache/apache.conf index be32988..c178b90 100644 --- a/services/10-nineapache/apache/apache.conf +++ b/services/10-nineapache/apache/apache.conf @@ -20,11 +20,12 @@ ProxyPreserveHost On Require all granted -RequestHeader set X-Forwarded-Host "%{HTTP_HOST}s" -RequestHeader set X-Forwarded-Server "%{HTTP_HOST}s" -RequestHeader set X-Forwarded-For "%{REMOTE_ADDR}s" +#RequestHeader unset X-Forwarded-Host +#RequestHeader set X-Forwarded-Host "%{HTTP_HOST}s" +#RequestHeader set X-Forwarded-Server "%{HTTP_HOST}s" +#RequestHeader set X-Forwarded-For "%{REMOTE_ADDR}s" RequestHeader set Host "%{HTTP_HOST}s" -RequestHeader set X-Forwarded-Proto "http" +RequestHeader set X-Forwarded-Proto "https" # Alias pour le répertoire de validation de Certbot Alias /.well-known/acme-challenge /usr/local/apache2/htdocs/.well-known/acme-challenge diff --git a/services/50-ninecompta/apache/apache.conf b/services/50-ninecompta/apache/apache.conf new file mode 100644 index 0000000..a818c9f --- /dev/null +++ b/services/50-ninecompta/apache/apache.conf @@ -0,0 +1,4 @@ + +# Ninecompta +ProxyPass /ninecompta http://ninecompta/ninecompta retry=0 keepalive=On +ProxyPassReverse /ninecompta http://ninecompta/ninecompta retry=0 diff --git a/services/50-ninecompta/dockercompose/dockercompose.yml b/services/50-ninecompta/dockercompose/dockercompose.yml new file mode 100644 index 0000000..85a892b --- /dev/null +++ b/services/50-ninecompta/dockercompose/dockercompose.yml @@ -0,0 +1,13 @@ +services: + # Ninecompta + # Petite comptabilité + # Port interne 80 + ninecompta: + image: reg.cadoles.com/envole/ninecompta + container_name: nine-ninecompta + restart: unless-stopped + env_file: ./services/50-ninecompta/env/.env.merge + networks: + - nine-network + volumes: + - ./services/50-ninecompta/volume/data/public:/app/public/uploads diff --git a/services/50-ninecompta/env/.env b/services/50-ninecompta/env/.env new file mode 100644 index 0000000..cac8a9d --- /dev/null +++ b/services/50-ninecompta/env/.env @@ -0,0 +1,6 @@ + +# == NINECOMPTA ============================================================================================================================= + +APP_SECRET=${ADMIN_PASSWORD} +DATABASE_URL="mysql://${MARIADB_USER}:${MARIADB_PASSWORD}@${MARIADB_SERVICE_NAME}:3306/ninecompta" + diff --git a/services/50-ninecompta/misc/nine.sh b/services/50-ninecompta/misc/nine.sh new file mode 100644 index 0000000..1e70f99 --- /dev/null +++ b/services/50-ninecompta/misc/nine.sh @@ -0,0 +1,45 @@ +#!/bin/bash + + +function upninecompta { + if [[ $NINECOMPTA_ACTIVATE == 1 && $NINECOMPTA_LOCAL == 1 ]] + then + Title ${NINECOMPTA_SERVICE_NAME^^} + + if [[ $MARIADB_ACTIVATE == 1 && $MARIADB_LOCAL == 1 ]] + then + EchoVert "DATABASE" + Echo ${NINECOMPTA_SERVICE_NAME^^} + docker-compose exec $MARIADB_SERVICE_NAME /nine/init.sh $NINECOMPTA_SERVICE_NAME + Echo + fi + + EchoVert "CONTAINER" + upservice ${NINECOMPTA_SERVICE_NAME} + chmod -R a+wr ./services/50-ninecompta/volume/data + Echo + fi +} + +function destroyninecompta { + if [[ $NINECOMPTA_LOCAL == 1 ]] + then + Title "DESTROY $NINECOMPTA_SERVICE_NAME" + + stop $NINECOMPTA_SERVICE_NAME 1 + docker-compose rm -s -v -f "$NINECOMPTA_SERVICE_NAME" + + if [[ -z $1 ]]; then + Question_ouinon "Souhaitez-vous supprimer la BDD associé à $NINECOMPTA_SERVICE_NAME ?"; + response=$? + fi + if [[ "$response" == 0 || ! -z $1 ]] + then + EchoRouge "Delete BDD = $NINECOMPTA_SERVICE_NAME" + docker-compose exec $MARIADB_SERVICE_NAME /nine/delete.sh $NINECOMPTA_SERVICE_NAME + rm -rf services/50-ninecompta/volume/data + fi + + echo "" + fi +} \ No newline at end of file