This commit is contained in:
afornerot 2024-02-29 16:46:23 +01:00
parent 2270317594
commit 82a7598c15
18 changed files with 403 additions and 26 deletions

View File

@ -62,6 +62,9 @@
<variable type='oui/non' name='activer_nineboard' description='Activer Nineboard'><value>non</value></variable> <variable type='oui/non' name='activer_nineboard' description='Activer Nineboard'><value>non</value></variable>
<variable type='oui/non' name='activer_nextcloud' description='Activer Nextcloud'><value>non</value></variable> <variable type='oui/non' name='activer_nextcloud' description='Activer Nextcloud'><value>non</value></variable>
<variable type='oui/non' name='activer_wordpress' description='Activer Wordpress'><value>non</value></variable>
<variable type='oui/non' name='activer_adminer' description='Activer Adminer'><value>non</value></variable> <variable type='oui/non' name='activer_adminer' description='Activer Adminer'><value>non</value></variable>
<variable type='oui/non' name='activer_phpldapadmin' description='Activer Phpldapadmin'><value>non</value></variable> <variable type='oui/non' name='activer_phpldapadmin' description='Activer Phpldapadmin'><value>non</value></variable>
@ -75,6 +78,9 @@
<variable type='string' name='nineboard_secret' mandatory='True' description='Secret key Nineboard'></variable> <variable type='string' name='nineboard_secret' mandatory='True' description='Secret key Nineboard'></variable>
<!-- NINEGATE --> <!-- NINEGATE -->
<variable name='ninegate_local' type='oui/non' description='Ninegate local'><value>oui</value></variable>
<variable name='ninegate_url' type='string' mandatory='True' description='Ninegate URL'></variable>
<variable type='oui/non' name='ninegate_syncldap' description='Synchroniser les utilisateurs vers annuaire'><value>oui</value></variable> <variable type='oui/non' name='ninegate_syncldap' description='Synchroniser les utilisateurs vers annuaire'><value>oui</value></variable>
<variable type='oui/non' name='ninegate_scribegroup' description="Considérer les classes/options comme des groupes de travail"><value>oui</value></variable> <variable type='oui/non' name='ninegate_scribegroup' description="Considérer les classes/options comme des groupes de travail"><value>oui</value></variable>
@ -102,6 +108,9 @@
<variable name='nextcloud_samba_domaine' type='string' mandatory='True' description='Samba domaine name'><value>DOMSCRIBE</value></variable> <variable name='nextcloud_samba_domaine' type='string' mandatory='True' description='Samba domaine name'><value>DOMSCRIBE</value></variable>
<variable name='nextcloud_samba_name' type='string' mandatory='True' description='Samba root name'><value>nextcloud</value></variable> <variable name='nextcloud_samba_name' type='string' mandatory='True' description='Samba root name'><value>nextcloud</value></variable>
<!-- WORDPRESS -->
<variable name='wordpress_local' type='oui/non' description='Wordpress local'><value>oui</value></variable>
<variable name='wordpress_url' type='string' mandatory='True' description='Wordpress URL'></variable>
</family> </family>
<separators> <separators>
@ -111,9 +120,10 @@
<separator name="activer_openldap">Annuaire</separator> <separator name="activer_openldap">Annuaire</separator>
<separator name="activer_ninegate">Applications</separator> <separator name="activer_ninegate">Applications</separator>
<separator name="openldap_password">Secrets</separator> <separator name="openldap_password">Secrets</separator>
<separator name="ninegate_syncldap">Ninegate Portail</separator> <separator name="ninegate_local">Ninegate</separator>
<separator name="nineboard_local">Nineboard</separator> <separator name="nineboard_local">Nineboard</separator>
<separator name="nextcloud_local">Nextcloud</separator> <separator name="nextcloud_local">Nextcloud</separator>
<separator name="wordpress_local">Wordpress</separator>
</separators> </separators>
</variables> </variables>
@ -201,6 +211,7 @@
<target type='variable'>activer_ninegate</target> <target type='variable'>activer_ninegate</target>
<target type='variable'>activer_nineboard</target> <target type='variable'>activer_nineboard</target>
<target type='variable'>activer_nextcloud</target> <target type='variable'>activer_nextcloud</target>
<target type='variable'>activer_wordpress</target>
<target type='variable'>activer_adminer</target> <target type='variable'>activer_adminer</target>
</condition> </condition>
@ -249,7 +260,13 @@
<condition name='hidden_if_in' source='activer_ninegate'> <condition name='hidden_if_in' source='activer_ninegate'>
<param>non</param> <param>non</param>
<target type='variable'>ninegate_local</target>
<target type='variable'>ninegate_secret</target> <target type='variable'>ninegate_secret</target>
</condition>
<condition name='hidden_if_in' source='ninegate_local'>
<param>non</param>
<target type='variable'>ninegate_syncldap</target> <target type='variable'>ninegate_syncldap</target>
<target type='variable'>ninegate_ssosynchrogroup</target> <target type='variable'>ninegate_ssosynchrogroup</target>
<target type='variable'>ninegate_ssoreqgroup</target> <target type='variable'>ninegate_ssoreqgroup</target>
@ -267,6 +284,12 @@
<target type='variable'>ninegate_forcethemename</target> <target type='variable'>ninegate_forcethemename</target>
</condition> </condition>
<condition name='hidden_if_in' source='ninegate_local'>
<param>oui</param>
<target type='variable'>ninegate_url</target>
</condition>
<condition name='hidden_if_in' source='activer_nineboard'> <condition name='hidden_if_in' source='activer_nineboard'>
<param>non</param> <param>non</param>
<target type='variable'>nineboard_secret</target> <target type='variable'>nineboard_secret</target>
@ -349,6 +372,20 @@
<target type='variable'>nextcloud_samba_host</target> <target type='variable'>nextcloud_samba_host</target>
<target type='variable'>nextcloud_samba_domaine</target> <target type='variable'>nextcloud_samba_domaine</target>
<target type='variable'>nextcloud_samba_name</target> <target type='variable'>nextcloud_samba_name</target>
</condition> </condition>
<!-- WORDPRESS -->
<condition name='hidden_if_in' source='activer_wordpress'>
<param>non</param>
<target type='variable'>wordpress_local</target>
</condition>
<condition name='hidden_if_in' source='wordpress_local'>
<param>oui</param>
<target type='variable'>wordpress_url</target>
</condition>
</constraints> </constraints>
</creole> </creole>

1
docker/.gitignore vendored
View File

@ -1,5 +1,6 @@
.env.local .env.local
/env/*.local /env/*.local
/tmp
/volume/mariadb/mysql /volume/mariadb/mysql

View File

@ -9,7 +9,7 @@ services:
test: /envole/check.sh test: /envole/check.sh
interval: 1s interval: 1s
timeout: 60s timeout: 60s
env_file: ./.env.local env_file: ./tmp/.env.mariadb
networks: networks:
- envole-network - envole-network
ports: ports:
@ -26,7 +26,7 @@ services:
test: /envole/check.sh test: /envole/check.sh
interval: 1s interval: 1s
timeout: 60s timeout: 60s
env_file: ./.env.local env_file: ./tmp/.env.openldap
networks: networks:
- envole-network - envole-network
ports: ports:
@ -51,7 +51,7 @@ services:
test: curl --fail http://127.0.0.1:9990 || exit 1 test: curl --fail http://127.0.0.1:9990 || exit 1
interval: 1s interval: 1s
timeout: 60s timeout: 60s
env_file: ./.env.local env_file: ./tmp/.env.keycloak
networks: networks:
- envole-network - envole-network
ports: ports:
@ -69,7 +69,7 @@ services:
test: curl --fail http://localhost/ninegate || exit 1 test: curl --fail http://localhost/ninegate || exit 1
interval: 1s interval: 1s
timeout: 60s timeout: 60s
env_file: ./.env.local env_file: ./tmp/.env.ninegate
networks: networks:
- envole-network - envole-network
ports: ports:
@ -86,7 +86,7 @@ services:
test: curl --fail http://localhost || exit 1 test: curl --fail http://localhost || exit 1
interval: 1s interval: 1s
timeout: 60s timeout: 60s
env_file: ./.env.local env_file: ./tmp/.env.nextcloud
networks: networks:
- envole-network - envole-network
ports: ports:
@ -106,7 +106,7 @@ services:
test: curl --fail http://localhost/nineboard || exit 1 test: curl --fail http://localhost/nineboard || exit 1
interval: 1s interval: 1s
timeout: 60s timeout: 60s
env_file: ./.env.local env_file: ./tmp/.env.nineboard
networks: networks:
- envole-network - envole-network
ports: ports:
@ -115,11 +115,27 @@ services:
- ./volume/nineboard/data/private:/app/uploads - ./volume/nineboard/data/private:/app/uploads
- ./volume/nineboard/data/public:/app/public/uploads - ./volume/nineboard/data/public:/app/public/uploads
wordpress:
image: wordpress
container_name: envole-wordpress
restart: always
healthcheck:
test: curl --fail http://localhost/wordpress || exit 1
interval: 1s
timeout: 60s
env_file: ./tmp/.env.wordpress
networks:
- envole-network
ports:
- "9003:80"
volumes:
- ./volume/wordpress/data:/var/www/html
adminer: adminer:
image: docker.io/library/adminer image: docker.io/library/adminer
container_name: envole-adminer container_name: envole-adminer
restart: always restart: always
env_file: ./.env.local env_file: ./tmp/.env.adminer
networks: networks:
- envole-network - envole-network
ports: ports:
@ -129,7 +145,7 @@ services:
image: docker.io/osixia/phpldapadmin:latest image: docker.io/osixia/phpldapadmin:latest
container_name: envole-phpldapadmin container_name: envole-phpldapadmin
restart: always restart: always
env_file: ./.env.local env_file: ./tmp/.env.phpldapadmin
networks: networks:
- envole-network - envole-network
ports: ports:
@ -143,7 +159,7 @@ services:
test: curl --fail http://localhost || exit 1 test: curl --fail http://localhost || exit 1
interval: 1s interval: 1s
timeout: 60s timeout: 60s
env_file: ./.env.local env_file: ./tmp/.env.nineapache
networks: networks:
- envole-network - envole-network
ports: ports:

6
docker/env/.env vendored
View File

@ -93,6 +93,12 @@ NINEBOARD_ACTIVATE=1
NINEBOARD_LOCAL=1 NINEBOARD_LOCAL=1
NINEBOARD_URL=${PROTOCOLE}://${WEB_URL}:9002 NINEBOARD_URL=${PROTOCOLE}://${WEB_URL}:9002
# WORDPRESS
WORDPRESS_SERVICE_NAME=nineboard
WORDPRESS_ACTIVATE=1
WORDPRESS_LOCAL=1
WORDPRESS_URL=${PROTOCOLE}://${WEB_URL}:9003
# ADMINER # ADMINER
ADMINER_SERVICE_NAME=adminer ADMINER_SERVICE_NAME=adminer
ADMINER_ACTIVATE=0 ADMINER_ACTIVATE=0

8
docker/env/.env.zapp.wordpress vendored Normal file
View File

@ -0,0 +1,8 @@
# == NEXTCLOUD ============================================================================================================================
WORDPRESS_DB_HOST=mariadb
WORDPRESS_DB_NAME=wordpress
WORDPRESS_DB_USER=${MARIADB_USER}
WORDPRESS_DB_PASSWORD=${MARIADB_PASSWORD}

View File

@ -53,7 +53,54 @@ fi
# Include # Include
. ./.env.local . ./.env.local
#===========================================================================================================================================
#== ENV ====================================================================================================================================
#===========================================================================================================================================
#1 = service to stop if null all service
destroyall(){
Question_ouinon "Souhaitez-vous supprimer l'ensemble des containers : Attention cela supprimera vraiment tout ?"
if [[ "$?" = 0 ]]
then
destroy $MARIADB_SERVICE_NAME 1
destroy $OPENLDAP_SERVICE_NAME 1
destroy $KEYCLOAK_SERVICE_NAME 1
destroy $NINEGATE_SERVICE_NAME 1
destroy $NINEBOARD_SERVICE_NAME 1
destroy $NEXTCLOUD_SERVICE_NAME 1
destroy $WORDPRESS_SERVICE_NAME 1
destroy $ADMINER_SERVICE_NAME 1
destroy $PHPLDAPADMIN_SERVICE_NAME 1
destroy $NINEAPACHE_SERVICE_NAME 1
fi
}
env() {
rm -rf ./tmp/.env.$1
mkdir -p ./tmp
cat ./env/.env >> ./tmp/.env.$1
if [[ -f ./env/.env.local ]]; then cat ./env/.env.local >> ./tmp/.env.$1; fi
if [[ -f ./env/.env.zapp.$1 ]]; then cat ./env/.env.zapp.$1 >> ./tmp/.env.$1; fi
if [[ -f ./env/.env.zapp.$1.local ]]; then cat ./env/.env.zapp.$1.local >> ./tmp/.env.$1; fi
};
#===========================================================================================================================================
#== ENVALL =================================================================================================================================
#===========================================================================================================================================
envall(){
env $MARIADB_SERVICE_NAME
env $OPENLDAP_SERVICE_NAME
env $KEYCLOAK_SERVICE_NAME
env $NINEGATE_SERVICE_NAME
env $NINEBOARD_SERVICE_NAME
env $NEXTCLOUD_SERVICE_NAME
env $WORDPRESS_SERVICE_NAME
env $ADMINER_SERVICE_NAME
env $PHPLDAPADMIN_SERVICE_NAME
env $NINEAPACHE_SERVICE_NAME
}
#=========================================================================================================================================== #===========================================================================================================================================
#== STOP =================================================================================================================================== #== STOP ===================================================================================================================================
@ -124,6 +171,9 @@ up(){
if [[ "$RELEASE_SYSTEM" == "eole" ]] if [[ "$RELEASE_SYSTEM" == "eole" ]]
then then
Title "NETWORK" Title "NETWORK"
EchoRouge "ATTENTION SOLUTION DE CONTOURNEMENT POUR LE POC"
EchoRouge "A résoudre si l'on souhaite mettre en production"
# On réinstall docker-ce car le reconf détruit le reseau docker, la reinstall de docker-ce rétablit le reseau # On réinstall docker-ce car le reconf détruit le reseau docker, la reinstall de docker-ce rétablit le reseau
apt-get install docker-ce --reinstall apt-get install docker-ce --reinstall
@ -162,6 +212,12 @@ up(){
EchoVert ${NEXTCLOUD_SERVICE_NAME^^} EchoVert ${NEXTCLOUD_SERVICE_NAME^^}
$PODCOMPOSEBIN exec $MARIADB_SERVICE_NAME /envole/init.sh $NEXTCLOUD_SERVICE_NAME $PODCOMPOSEBIN exec $MARIADB_SERVICE_NAME /envole/init.sh $NEXTCLOUD_SERVICE_NAME
fi fi
if [[ $WORDPRESS_ACTIVATE == 1 && $WORDPRESS_LOCAL == 1 ]]
then
EchoVert ${WORDPRESS_SERVICE_NAME^^}
$PODCOMPOSEBIN exec $MARIADB_SERVICE_NAME /envole/init.sh $WORDPRESS_SERVICE_NAME
fi
fi fi
# OPENLDAP # OPENLDAP
@ -211,6 +267,14 @@ up(){
echo echo
fi fi
# WORDPRESS
if [[ $WORDPRESS_ACTIVATE == 1 && $WORDPRESS_LOCAL == 1 ]]
then
Title ${WORDPRESS_SERVICE_NAME^^}
upservice ${WORDPRESS_SERVICE_NAME}
echo
fi
# ADMINER # ADMINER
if [[ $ADMINER_ACTIVATE == 1 && $ADMINER_LOCAL == 1 ]] if [[ $ADMINER_ACTIVATE == 1 && $ADMINER_LOCAL == 1 ]]
then then
@ -236,6 +300,7 @@ up(){
fi fi
else else
Title ${1^^} Title ${1^^}
env ${NINEAPACHE_SERVICE_NAME}
$PODCOMPOSEBIN up -d $1 $PODCOMPOSEBIN up -d $1
fi fi
} }
@ -248,15 +313,16 @@ destroyall(){
Question_ouinon "Souhaitez-vous supprimer l'ensemble des containers : Attention cela supprimera vraiment tout ?" Question_ouinon "Souhaitez-vous supprimer l'ensemble des containers : Attention cela supprimera vraiment tout ?"
if [[ "$?" = 0 ]] if [[ "$?" = 0 ]]
then then
destroy mariadb 1 destroy $MARIADB_SERVICE_NAME 1
destroy openldap 1 destroy $OPENLDAP_SERVICE_NAME 1
destroy keycloak 1 destroy $KEYCLOAK_SERVICE_NAME 1
destroy ninegate 1 destroy $NINEGATE_SERVICE_NAME 1
destroy nineboard 1 destroy $NINEBOARD_SERVICE_NAME 1
destroy nextcloud 1 destroy $NEXTCLOUD_SERVICE_NAME 1
destroy adminer 1 destroy $WORDPRESS_SERVICE_NAME 1
destroy phpldapadmin 1 destroy $ADMINER_SERVICE_NAME 1
destroy nineapache 1 destroy $PHPLDAPADMIN_SERVICE_NAME 1
destroy $NINEAPACHE_SERVICE_NAME 1
fi fi
} }
@ -334,13 +400,24 @@ destroy(){
sudo rm -rf volume/nextcloud/html sudo rm -rf volume/nextcloud/html
sudo rm -rf volume/nextcloud/app sudo rm -rf volume/nextcloud/app
fi fi
fi fi
if [[ "$1" == "$WORDPRESS_SERVICE_NAME" && $WORDPRESS_ACTIVATE == 1 && $WORDPRESS_LOCAL == 1 ]]
then
if [[ -z $2 ]]; then Question_ouinon "Souhaitez-vous supprimer la BDD associé à $1 ?";fi
if [[ "$?" = 0 || -z $2 ]]
then
$PODCOMPOSEBIN exec $MARIADB_SERVICE_NAME /envole/delete.sh $WORDPRESS_SERVICE_NAME
fi
fi
} }
#=========================================================================================================================================== #===========================================================================================================================================
#== MAIN =================================================================================================================================== #== MAIN ===================================================================================================================================
#=========================================================================================================================================== #===========================================================================================================================================
envall
if [[ $1 == "up" || $1 == "" ]] if [[ $1 == "up" || $1 == "" ]]
then then
up $2 up $2
@ -376,7 +453,35 @@ then
wait_for_container $2 wait_for_container $2
elif [[ $1 == "env" ]] elif [[ $1 == "env" ]]
then then
EchoVert "Fichier .env.local regénéré" if [[ -z $2 ]]
then
EchoRouge "Vous devez precisez un service"
EchoRouge "envole.sh env monservice"
else
env $2
EchoVert "Fichier tmp/.env.$1 regénéré"
fi
else
EchoRouge "Action possible ="
EchoRouge "envole.sh > UP de l'ensemble des services actifs"
EchoRouge "envole.sh up > UP de l'ensemble des services actifs"
EchoRouge "envole.sh up monservice> UP de monservice"
EchoRouge "envole.sh stop > STOP de l'ensemble des services"
EchoRouge "envole.sh stop monservice> STOP de monservice"
EchoRouge "envole.sh bash monservice> lance un terminel dans le conteneur de monservice"
EchoRouge "envole.sh destroyall> détruit l'ensemble des services avec l'ensemble des BDD et des volumes persistant"
EchoRouge "envole.sh destroy monservice> détruit monservices et si souhaitez sa BDD et ses volumes persistant"
EchoRouge "envole.sh logs > LOGS de l'ensemble des services"
EchoRouge "envole.sh logs monservice > LOGS de monservice"
EchoRouge "envole.sh iswait monservice > monservice est-il en cours de construction"
EchoRouge "envole.sh env monservice > regeneration du fichier d'environnement de monservice"
fi fi
echo echo
echo echo

View File

@ -0,0 +1 @@
CREATE DATABASE IF NOT EXISTS wordpress;

View File

@ -16,7 +16,7 @@ for f in $FILES
do do
if [ -f "$f" ] if [ -f "$f" ]
then then
EchoRouge $(basename $f) EchoVert $(basename $f)
CreoleCat -t $(basename $f) CreoleCat -t $(basename $f)
fi fi
done done

View File

@ -0,0 +1,61 @@
#!/bin/bash
set -eo pipefail
cd /app/public
if [[ ! -f /app/public/wp-config.php ]]
then
wp config create \
--allow-root \
--dbhost="${WORDPRESS_DB_HOST}" \
--dbname="${WORDPRESS_DB_NAME}" \
--dbuser="${WORDPRESS_DB_USER}" \
--dbpass="${WORDPRESS_DB_PASSWORD}" \
--dbcharset="utf8mb4" \
--locale="fr_FR"
fi
wp core multisite-install \
--allow-root \
--url="${WORDPRESS_PROTOCOL}://${WORDPRESS_DOMAINE}" \
--title="${WORDPRESS_TITLE}" \
--admin_user="${WORDPRESS_USER}" \
--admin_password="${WORDPRESS_PASSWORD}" \
--admin_email="${WORDPRESS_EMAIL}" \
--skip-email
wp config set --allow-root DB_HOST ${WORDPRESS_DB_HOST}
wp config set --allow-root DB_NAME ${WORDPRESS_DB_NAME}
wp config set --allow-root DB_USER ${WORDPRESS_DB_USER}
wp config set --allow-root DB_PASSWORD ${WORDPRESS_DB_PASSWORD}
wp config set --allow-root WP_HOME ${WORDPRESS_PROTOCOL}://${WORDPRESS_DOMAINE}${WORDPRESS_ALIAS}
wp config set --allow-root WP_SITEURL ${WORDPRESS_PROTOCOL}://${WORDPRESS_DOMAINE}${WORDPRESS_ALIAS}
wp config set --allow-root WP_ALLOW_MULTISITE true
wp config set --allow-root MULTISITE true
wp config set --allow-root SUBDOMAIN_INSTALL false
wp config set --allow-root DOMAIN_CURRENT_SITE ${WORDPRESS_DOMAINE}
wp config set --allow-root PATH_CURRENT_SITE ${WORDPRESS_ALIAS}
wp config set --allow-root FORCE_ADMIN_SSL false
# On fait croire à WP qu'il est en https
if grep -qF "_SERVER['HTTPS']='on'" "wp-config.php"; then
if [[ "${WORDPRESS_PROTOCOL}" == "https" ]]
then
echo "FORCE HTTPS already set"
fi
else
if [[ "${WORDPRESS_PROTOCOL}" == "https" ]]
then
echo "FORCE HTTPS set"
head -n 1 "wp-config.php" > "wp-config.tmp"
echo "\$_SERVER['HTTPS']='on';" >> "wp-config.tmp"
tail -n +2 "wp-config.php" >> "wp-config.tmp"
mv "wp-config.tmp" "wp-config.php"
fi
fi
exec $@

View File

@ -0,0 +1,11 @@
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

View File

@ -0,0 +1,23 @@
FROM reg.cadoles.com/envole/nineapache:8.1
# Paquet necessaire pour wordpress
RUN apk add php81-mysqli
# Installation de wp-cli
COPY wp-cli.phar /usr/local/bin/wp
RUN chmod +x /usr/local/bin/wp
# Installation des sources wordpress
COPY apache.conf /etc/apache2/conf.d/zapp.conf
RUN wp core download --path=/app/public --locale=fr_FR
#COPY .htaccess /app/public/.htaccess
RUN mkdir /docker
COPY entrypoint.sh /docker/entrypoint.sh
RUN chmod +x /docker/entrypoint.sh
RUN chown -R apache:apache /app/public
RUN find /app/public -type d -exec chmod 755 {} +
RUN find /app/public -type f -exec chmod 644 {} +
CMD /docker/entrypoint.sh && /etc/apache2/apache2.sh

View File

@ -0,0 +1,24 @@
LoadModule rewrite_module modules/mod_rewrite.so
ServerName nineapache.local
DocumentRoot "/app/public"
Alias /wordpress /app/public
<Directory "/app/public">
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
Require all granted
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
</Directory>

View File

@ -0,0 +1,25 @@
#!/bin/bash
set -eo pipefail
cd /app/public
wp config create \
--allow-root \
--dbhost="${WORDPRESS_DB_HOST}" \
--dbname="${WORDPRESS_DB_NAME}" \
--dbuser="${WORDPRESS_DB_USER}" \
--dbpass="${WORDPRESS_DB_PASSWORD}" \
--dbcharset="utf8mb4" \
--locale="fr_FR"
wp core multisite-install \
--allow-root \
--url="${WORDPRESS_WEBURL}" \
--title="${WORDPRESS_TITLE}" \
--admin_user="${WORDPRESS_USER}" \
--admin_password="${WORDPRESS_PASSWORD}" \
--admin_email="${WORDPRESS_EMAIL}" \
--skip-email
exec $@

Binary file not shown.

View File

@ -0,0 +1,51 @@
version: '3'
services:
mariadb:
image: mariadb
container_name: wordpress-mariadb
restart: always
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: changeme
MYSQL_DATABASE: wordpress
MYSQL_USER: user
MYSQL_PASSWORD: changeme
volumes:
- mariadb-data:/var/lib/mysql
wordpress:
build:
context: ./containers/wordpress
image: reg.cadoles.com/envole/wordpress
container_name: wordpress-app
depends_on:
- mariadb
ports:
- "9003:80"
environment:
- WORDPRESS_DB_HOST=mariadb
- WORDPRESS_DB_NAME=wordpress
- WORDPRESS_DB_USER=user
- WORDPRESS_DB_PASSWORD=changeme
- WORDPRESS_TITLE=wordpress
- WORDPRESS_USER=admin
- WORDPRESS_PASSWORD=changeme
- WORDPRESS_EMAIL=admin@noreply.fr
- WORDPRESS_PROTOCOL=https
- WORDPRESS_DOMAINE=eolebase.ac-test.fr
- WORDPRESS_ALIAS=/wordpress/
volumes:
- ./containers/volume:/docker
adminer:
image: docker.io/library/adminer
container_name: wordpress-adminer
restart: always
ports:
- 9100:8080
volumes:
mariadb-data:

View File

@ -1,4 +1,3 @@
ProxyPass /ninegate http://0.0.0.0:9000/ninegate retry=0 keepalive=On ProxyPass /ninegate http://0.0.0.0:9000/ninegate retry=0 keepalive=On
ProxyPassReverse /ninegate http://0.0.0.0:9000/ninegate retry=0 ProxyPassReverse /ninegate http://0.0.0.0:9000/ninegate retry=0
ProxyPass /wssninegate ws://0.0.0.0:9000/wssninegate retry=0 keepalive=On ProxyPass /wssninegate ws://0.0.0.0:9000/wssninegate retry=0 keepalive=On
@ -12,6 +11,9 @@ ProxyPassReverse /nineboard http://0.0.0.0:9002/nineboard retry=0
ProxyPass /wssnineboard ws://0.0.0.0:9002/wssnineboard retry=0 keepalive=On ProxyPass /wssnineboard ws://0.0.0.0:9002/wssnineboard retry=0 keepalive=On
ProxyPassReverse /wssnineboard ws://0.0.0.0:9002/wssnineboard retry=0 ProxyPassReverse /wssnineboard ws://0.0.0.0:9002/wssnineboard retry=0
ProxyPass /wordpress http://0.0.0.0:9003/wordpress retry=0 keepalive=On
ProxyPassReverse /wordpress http://0.0.0.0:9003/wordpress retry=0
ProxyPass /adminer http://0.0.0.0:9100 retry=0 keepalive=On ProxyPass /adminer http://0.0.0.0:9100 retry=0 keepalive=On
ProxyPassReverse /adminer http://0.0.0.0:9100 retry=0 ProxyPassReverse /adminer http://0.0.0.0:9100 retry=0

View File

@ -7,7 +7,7 @@ APP_ALIAS=nineboard/
%if %%getVar("activer_ninegate", "non") == "oui" %if %%getVar("activer_ninegate", "non") == "oui"
APP_MASTERIDENTITY=NINEGATE APP_MASTERIDENTITY=NINEGATE
APP_MASTERURL=/ninegate APP_MASTERURL=${NINEGATE_URL}
APP_MASTERKEY=%%getVar("ninegate_secret","") APP_MASTERKEY=%%getVar("ninegate_secret","")
%else %else
%if %%getVar("activer_openldap", "non") == "oui" %if %%getVar("activer_openldap", "non") == "oui"

View File

@ -57,7 +57,8 @@ CAS_PASSWORD=%%getVar("keycload_userpassword", "")
# NINEGATE # NINEGATE
NINEGATE_ACTIVATE=%%getBool(%%getVar("activer_ninegate", "non")) NINEGATE_ACTIVATE=%%getBool(%%getVar("activer_ninegate", "non"))
NINEGATE_URL=/ninegate NINEGATE_LOCAL=%%getBool(%%getVar("ninegate_local", "non"))
NINEGATE_URL=%%getVar("ninegate_url", "/ninegate")
# NINEBOARD # NINEBOARD
NINEBOARD_ACTIVATE=%%getBool(%%getVar("activer_nineboard", "non")) NINEBOARD_ACTIVATE=%%getBool(%%getVar("activer_nineboard", "non"))
@ -69,6 +70,11 @@ NEXTCLOUD_ACTIVATE=%%getBool(%%getVar("activer_nextcloud", "non"))
NEXTCLOUD_LOCAL=%%getBool(%%getVar("nextcloud_local", "non")) NEXTCLOUD_LOCAL=%%getBool(%%getVar("nextcloud_local", "non"))
NEXTCLOUD_URL=%%getVar("nextcloud_url", "/nextcloud") NEXTCLOUD_URL=%%getVar("nextcloud_url", "/nextcloud")
# WORDPRESS
WORDPRESS_ACTIVATE=%%getBool(%%getVar("activer_wordpress", "non"))
WORDPRESS_LOCAL=%%getBool(%%getVar("wordpress_local", "non"))
WORDPRESS_URL=%%getVar("wordpress_url", "/wordpress")
# ADMINER # ADMINER
ADMINER_ACTIVATE=%%getBool(%%getVar("activer_adminer", "non")) ADMINER_ACTIVATE=%%getBool(%%getVar("activer_adminer", "non"))
ADMINER_LOCAL=1 ADMINER_LOCAL=1