From 6056a1b83d7ec43b205389ccd748627c3450dcf3 Mon Sep 17 00:00:00 2001 From: Simon Boyer <36060258+Simon-Boyer@users.noreply.github.com> Date: Sat, 2 Dec 2023 15:21:57 -0500 Subject: [PATCH 1/8] Update entrypoint.sh --- grav/entrypoint.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/grav/entrypoint.sh b/grav/entrypoint.sh index b4f23ec..fa3891d 100644 --- a/grav/entrypoint.sh +++ b/grav/entrypoint.sh @@ -10,11 +10,17 @@ cd /var/www/html/user git pull origin $HEAD_BRANCH echo "done" -echo "Creating admin user..." -cp "/vault/secrets/$ADMIN_VAULT_SECRET" /var/www/html/user/accounts/admin.yaml +if [ ! -f "/var/www/html/user/accounts/admin.yaml" ]; then + echo "Creating admin user..." + cp "/vault/secrets/$ADMIN_VAULT_SECRET" /var/www/html/user/accounts/admin.yaml + echo done +fi + +echo "Creating sre user..." +cp "/vault/secrets/$SRE_VAULT_SECRET" /var/www/html/user/accounts/sre.yaml echo done rm /var/www/html/user/config/security.yaml ln -s /vault/secrets/salt /var/www/html/user/config/security.yaml -apache2-foreground \ No newline at end of file +apache2-foreground From 596256effd0677c1f6236b9368127524fe78fb96 Mon Sep 17 00:00:00 2001 From: SonOfLope Date: Mon, 25 Dec 2023 14:52:53 -0500 Subject: [PATCH 2/8] adds mongo custom dockerfile --- mongo/dockerfile | 4 ++++ mongo/init-script.sh | 15 +++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 mongo/dockerfile create mode 100755 mongo/init-script.sh diff --git a/mongo/dockerfile b/mongo/dockerfile new file mode 100644 index 0000000..20c013e --- /dev/null +++ b/mongo/dockerfile @@ -0,0 +1,4 @@ +FROM mongo:latest + +COPY init-script.sh /docker-entrypoint-initdb.d/ + diff --git a/mongo/init-script.sh b/mongo/init-script.sh new file mode 100755 index 0000000..ab1e25d --- /dev/null +++ b/mongo/init-script.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e + +mongo < Date: Mon, 25 Dec 2023 14:54:36 -0500 Subject: [PATCH 3/8] adds mongo to cd --- .github/workflows/deployment.yaml | 1 + mongo/{dockerfile => Dockerfile} | 0 2 files changed, 1 insertion(+) rename mongo/{dockerfile => Dockerfile} (100%) diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml index e6be0b9..7d2e5df 100644 --- a/.github/workflows/deployment.yaml +++ b/.github/workflows/deployment.yaml @@ -12,6 +12,7 @@ on: - grav - init-grav - vault + - mongo tag: required: true description: Version a tag l'image diff --git a/mongo/dockerfile b/mongo/Dockerfile similarity index 100% rename from mongo/dockerfile rename to mongo/Dockerfile From 84e6b92f3c6720bcd62b501db3ed627dfe69ddb4 Mon Sep 17 00:00:00 2001 From: SonOfLope Date: Tue, 26 Dec 2023 14:07:27 -0500 Subject: [PATCH 4/8] custom mongo image updated --- mongo/Dockerfile | 7 +++++-- mongo/init-script.sh | 15 --------------- mongo/mongo-init.js | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 17 deletions(-) delete mode 100755 mongo/init-script.sh create mode 100755 mongo/mongo-init.js diff --git a/mongo/Dockerfile b/mongo/Dockerfile index 20c013e..7fea796 100644 --- a/mongo/Dockerfile +++ b/mongo/Dockerfile @@ -1,4 +1,7 @@ -FROM mongo:latest +FROM mongo:6-jammy -COPY init-script.sh /docker-entrypoint-initdb.d/ +ENV MONGO_INITDB_ROOT_USERNAME admin +ENV MONGO_INITDB_ROOT_PASSWORD secret +ENV MONGO_INITDB_DATABASE admin +ADD mongo-init.js /docker-entrypoint-initdb.d/ \ No newline at end of file diff --git a/mongo/init-script.sh b/mongo/init-script.sh deleted file mode 100755 index ab1e25d..0000000 --- a/mongo/init-script.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -set -e - -mongo < Date: Tue, 26 Dec 2023 14:51:42 -0500 Subject: [PATCH 5/8] custom mongo image updated with entrypoint --- mongo/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mongo/Dockerfile b/mongo/Dockerfile index 7fea796..9eaaf08 100644 --- a/mongo/Dockerfile +++ b/mongo/Dockerfile @@ -4,4 +4,6 @@ ENV MONGO_INITDB_ROOT_USERNAME admin ENV MONGO_INITDB_ROOT_PASSWORD secret ENV MONGO_INITDB_DATABASE admin -ADD mongo-init.js /docker-entrypoint-initdb.d/ \ No newline at end of file +ADD mongo-init.js /docker-entrypoint-initdb.d/ + +ENTRYPOINT ["mongod", "--auth", "--bind_ip_all", "--port", "27017"] \ No newline at end of file From 8ce4219d07e2d0272c7d07e60b4c93bab010ce43 Mon Sep 17 00:00:00 2001 From: SonOfLope Date: Tue, 26 Dec 2023 15:53:17 -0500 Subject: [PATCH 6/8] update mongo again --- mongo/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/mongo/Dockerfile b/mongo/Dockerfile index 9eaaf08..500acf8 100644 --- a/mongo/Dockerfile +++ b/mongo/Dockerfile @@ -5,5 +5,3 @@ ENV MONGO_INITDB_ROOT_PASSWORD secret ENV MONGO_INITDB_DATABASE admin ADD mongo-init.js /docker-entrypoint-initdb.d/ - -ENTRYPOINT ["mongod", "--auth", "--bind_ip_all", "--port", "27017"] \ No newline at end of file From 53eade120173efde5d5a12f81547e5f4ea875850 Mon Sep 17 00:00:00 2001 From: Simon-Boyer Date: Thu, 25 Apr 2024 14:46:42 -0400 Subject: [PATCH 7/8] changed grav limit + update --- grav/Dockerfile | 7 ++++--- init-grav/init.sh | 31 ++++++++++++++++++------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/grav/Dockerfile b/grav/Dockerfile index a788651..558a967 100644 --- a/grav/Dockerfile +++ b/grav/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2.12-apache-bullseye +FROM php:8.3.6-apache-bullseye LABEL maintainer="Andy Miller (@rhukster)" @@ -45,6 +45,7 @@ RUN { \ echo 'upload_max_filesize=128M'; \ echo 'post_max_size=128M'; \ echo 'expose_php=off'; \ + echo 'memory_limit=2048M'; \ } > /usr/local/etc/php/conf.d/php-recommended.ini RUN pecl channel-update pecl.php.net @@ -58,7 +59,7 @@ RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf RUN echo "Listen 8080" > /etc/apache2/ports.conf # Define Grav specific version of Grav or use latest stable -ARG GRAV_VERSION=1.7.43 +ARG GRAV_VERSION=1.7.45 ARG GRAV_SKELETON_URL=https://github.com/getgrav/grav/releases/download/$GRAV_VERSION/grav-admin-v$GRAV_VERSION.zip ARG GRAV_SKELETON_FOLDER=grav-admin #https://github.com/getgrav/grav-skeleton-gateway-site/releases/download/1.0.1/grav-skeleton-gateway-site+admin-1.0.1.zip @@ -90,4 +91,4 @@ VOLUME ["/var/www/html"] ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] # CMD ["apache2-foreground"] -# CMD ["sh", "/entrypoint.sh"]pache2-foregroun \ No newline at end of file +# CMD ["sh", "/entrypoint.sh"]pache2-foregroun diff --git a/init-grav/init.sh b/init-grav/init.sh index 45989c5..957c671 100644 --- a/init-grav/init.sh +++ b/init-grav/init.sh @@ -1,29 +1,34 @@ -#!/bin/sh -# copy-theme.sh +cd /var/www/ -THEMES_DIR=/var/www/html/user/themes - -echo " Copying theme..." +# GRAV_SKELETON_URL=https://github.com/getgrav/grav-skeleton-gateway-site/releases/download/1.0.1/grav-skeleton-gateway-site+admin-1.0.1.zip +# THEMES_DIR=/var/www/html/user/themes # Create the themes directory if it does not exist [ ! -d "$THEMES_DIR" ] && mkdir -p "$THEMES_DIR" - # Use rsync to copy the initial content if [ -z "$(ls -A "$THEMES_DIR")" ]; then - rsync -av /initial-content/ /var/www/html/ - # Change ownership of the copied content to www-data - chown -R 33:33 /var/www/html - # Install git-sync plugin - cd /var/www/html + echo " Copying theme..." + cd /var/www/html/ + wget "$GRAV_SKELETON_URL" -O theme.zip + unzip theme.zip + rm theme.zip + git clone https://github.com/getgrav/grav.git grav + # Install git-sync plugin bin/gpm install git-sync - # Configures git-sync plugin + # Configures git-sync plugin ln -s /vault/secrets/grav /var/www/html/user/config/plugins/git-sync.yaml else echo "Themes directory is not empty. Skipping copying initial content." fi if [ -z "$(ls -A /var/www/html/user/.git)" ]; then -echo "git not initialized, running init script..." + echo "git not initialized, running init script..." + cd /var/www/html/ + wget "$GRAV_SKELETON_URL" -O skeleton.zip + unzip skeleton.zip + # Install git-sync plugin + bin/gpm install git-sync + cd /var/www/html rm /var/www/html/user/config/plugins/git-sync.yaml ln -s "/vault/secrets/$GIT_VAULT_SECRET" "/var/www/html/user/config/plugins/git-sync.yaml" git config --global --add safe.directory /var/www/html/user From 8f293cf1105c88c025f2bd50e82e542b04ebec89 Mon Sep 17 00:00:00 2001 From: Simon Boyer <36060258+Simon-Boyer@users.noreply.github.com> Date: Thu, 30 May 2024 22:38:30 -0400 Subject: [PATCH 8/8] Update entrypoint.sh --- grav/entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grav/entrypoint.sh b/grav/entrypoint.sh index fa3891d..50ba009 100644 --- a/grav/entrypoint.sh +++ b/grav/entrypoint.sh @@ -7,7 +7,8 @@ ln -s "/vault/secrets/$GIT_VAULT_SECRET" "/var/www/html/user/config/plugins/git- bin/plugin git-sync init bin/plugin git-sync sync > /dev/null cd /var/www/html/user -git pull origin $HEAD_BRANCH +git fetch origin +git reset --hard origin/master echo "done" if [ ! -f "/var/www/html/user/accounts/admin.yaml" ]; then