From 180282d2089fb7e16b52c2a8d2ca633504556bc1 Mon Sep 17 00:00:00 2001 From: sylvain Date: Thu, 15 May 2025 17:41:07 +0000 Subject: [PATCH 01/20] Supprimer src/.htconfig.php --- src/.htconfig.php | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 src/.htconfig.php diff --git a/src/.htconfig.php b/src/.htconfig.php deleted file mode 100644 index a2621c2..0000000 --- a/src/.htconfig.php +++ /dev/null @@ -1,23 +0,0 @@ - Date: Thu, 15 May 2025 17:42:51 +0000 Subject: [PATCH 02/20] Actualiser dockerfile --- dockerfile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/dockerfile b/dockerfile index 63fdb82..39f8878 100644 --- a/dockerfile +++ b/dockerfile @@ -45,12 +45,6 @@ RUN sed -i "s/{{SMTP_EMAIL}}/${SMTP_EMAIL}/g" /etc/msmtprc && sed -i "s/{{SMTP_S RUN chmod 600 /etc/msmtprc && chown www-data:www-data /etc/msmtprc RUN echo "sendmail_path = /usr/bin/msmtp -t" >> /etc/php/8.2/apache2/php.ini -# Fichier .htconfig.php -COPY src/.htconfig.php /var/www/html/.htconfig.php -RUN LOCATION_HASH=$(cat /dev/urandom | tr -dc 'a-f0-9' | fold -w 64 | head -n 1) && \ - sed -i "s/{{DOMAIN}}/${DOMAIN}/g" /var/www/html/.htconfig.php && \ - sed -i "s/{{LOCATION_HASH}}/${LOCATION_HASH}/g" /var/www/html/.htconfig.php && \ - sed -i "s/{{ADMIN_EMAIL}}/${ADMIN_EMAIL}/g" /var/www/html/.htconfig.php # Cron RUN echo "*/15 * * * * cd /var/www/html; /usr/bin/php Zotlabs/Daemon/Master.php Cron" | crontab -u www-data - -- 2.49.1 From ee581aa5b562e383a2cb0c2918a2309324f0df1c Mon Sep 17 00:00:00 2001 From: sylvain Date: Thu, 15 May 2025 17:53:49 +0000 Subject: [PATCH 03/20] Actualiser dockerfile --- dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerfile b/dockerfile index 39f8878..6133167 100644 --- a/dockerfile +++ b/dockerfile @@ -11,8 +11,8 @@ ARG SMTP_PASS ARG ADMIN_EMAIL # Installer les paquets nécessaires -RUN apt-get update && apt-get install -y apache2 php php-cli php-mysql php-curl php-fpm php-gd php-json php-xml php-zip php-mbstring \ - software-properties-common git openssl msmtp mariadb-client cron curl unzip nano +RUN apt-get update && apt-get install -y apache2 php php-cli php-mysql php-curl php-fpm php-gd php-json php-xml php-zip php-zip php-mbstring \ +php-bcmath php-gmp software-properties-common git openssl msmtp mariadb-client cron curl unzip nano # Nettoyer RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -- 2.49.1 From eb2f038f957825a15220a27201f359eb63d68fb8 Mon Sep 17 00:00:00 2001 From: sylvain Date: Thu, 15 May 2025 18:05:20 +0000 Subject: [PATCH 04/20] Actualiser dockerfile --- dockerfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dockerfile b/dockerfile index 6133167..58a6538 100644 --- a/dockerfile +++ b/dockerfile @@ -26,8 +26,12 @@ RUN mkdir -p /etc/ssl/private && mkdir -p /etc/ssl/certs && \ COPY src/container_apache.conf /etc/apache2/sites-available/$DOMAIN.conf RUN sed -i "s/{{DOMAIN}}/$DOMAIN/g" /etc/apache2/sites-available/$DOMAIN.conf RUN a2dissite 000-default default-ssl -RUN a2ensite $DOMAIN.conf +#RUN a2ensite $DOMAIN.conf +RUN a2ensite ${DOMAIN}.conf RUN a2enmod ssl rewrite +#derniers ajout +RUN a2enmod rewrite + # Installer Hubzilla RUN rm -r /var/www/html/ @@ -45,6 +49,9 @@ RUN sed -i "s/{{SMTP_EMAIL}}/${SMTP_EMAIL}/g" /etc/msmtprc && sed -i "s/{{SMTP_S RUN chmod 600 /etc/msmtprc && chown www-data:www-data /etc/msmtprc RUN echo "sendmail_path = /usr/bin/msmtp -t" >> /etc/php/8.2/apache2/php.ini +#config php.ini## +RUN echo "upload_max_filesize = 20M" >> /etc/php/8.2/apache2/php.ini && \ + echo "post_max_size = 20M" >> /etc/php/8.2/apache2/php.ini # Cron RUN echo "*/15 * * * * cd /var/www/html; /usr/bin/php Zotlabs/Daemon/Master.php Cron" | crontab -u www-data - -- 2.49.1 From 6ca4a8796ed7ecea9aeb4d40454270015fb64a95 Mon Sep 17 00:00:00 2001 From: sylvain Date: Thu, 15 May 2025 18:06:35 +0000 Subject: [PATCH 05/20] Actualiser dockerfile --- dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dockerfile b/dockerfile index 58a6538..bc2fc79 100644 --- a/dockerfile +++ b/dockerfile @@ -18,9 +18,9 @@ php-bcmath php-gmp software-properties-common git openssl msmtp mariadb-client c RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Générer un certificat SSL auto-signé -RUN mkdir -p /etc/ssl/private && mkdir -p /etc/ssl/certs && \ - openssl req -x509 -nodes -subj "/C=FR/ST=France/L=Paris/O=organization/OU=Org/CN=${DOMAIN}" \ - -newkey rsa:4096 -keyout /etc/ssl/private/${DOMAIN}.key -out /etc/ssl/certs/${DOMAIN}.crt -days 365 +#RUN mkdir -p /etc/ssl/private && mkdir -p /etc/ssl/certs && \ +# openssl req -x509 -nodes -subj "/C=FR/ST=France/L=Paris/O=organization/OU=Org/CN=${DOMAIN}" \ +# -newkey rsa:4096 -keyout /etc/ssl/private/${DOMAIN}.key -out /etc/ssl/certs/${DOMAIN}.crt -days 365 # Copier et activer la config Apache COPY src/container_apache.conf /etc/apache2/sites-available/$DOMAIN.conf -- 2.49.1 From b3e734c3c69da668b95a88e1da98c33ec5a020d1 Mon Sep 17 00:00:00 2001 From: sylvain Date: Thu, 15 May 2025 18:12:23 +0000 Subject: [PATCH 06/20] Actualiser dockerfile --- dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfile b/dockerfile index bc2fc79..d3d136b 100644 --- a/dockerfile +++ b/dockerfile @@ -11,7 +11,7 @@ ARG SMTP_PASS ARG ADMIN_EMAIL # Installer les paquets nécessaires -RUN apt-get update && apt-get install -y apache2 php php-cli php-mysql php-curl php-fpm php-gd php-json php-xml php-zip php-zip php-mbstring \ +RUN apt-get update && apt-get install -y apache2 php php-cli php-mysql php-curl php-fpm php-gd php-json php-xml php-zip php-intl php-mbstring \ php-bcmath php-gmp software-properties-common git openssl msmtp mariadb-client cron curl unzip nano # Nettoyer -- 2.49.1 From 75bcbab3e6a9e2480c0bb618831b4ce72d687ca7 Mon Sep 17 00:00:00 2001 From: sylvain Date: Thu, 15 May 2025 18:17:48 +0000 Subject: [PATCH 07/20] Actualiser src/container_apache.conf --- src/container_apache.conf | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/container_apache.conf b/src/container_apache.conf index a71cbb3..4e10429 100644 --- a/src/container_apache.conf +++ b/src/container_apache.conf @@ -1,21 +1,14 @@ ServerName {{DOMAIN}} - Redirect permanent / https://{{DOMAIN}}/ - - - - ServerName {{DOMAIN}} DocumentRoot /var/www/html + + Options Indexes FollowSymLinks AllowOverride All Require all granted - SSLEngine on - SSLCertificateFile /etc/ssl/certs/{{DOMAIN}}.crt - SSLCertificateKeyFile /etc/ssl/private/{{DOMAIN}}.key - ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined - + \ No newline at end of file -- 2.49.1 From 95b6f19a4f3b5e5e0125d722c5e9e9475de16c9e Mon Sep 17 00:00:00 2001 From: sylvain Date: Thu, 15 May 2025 18:20:24 +0000 Subject: [PATCH 08/20] Actualiser dockerfile --- dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfile b/dockerfile index d3d136b..695fb93 100644 --- a/dockerfile +++ b/dockerfile @@ -28,7 +28,7 @@ RUN sed -i "s/{{DOMAIN}}/$DOMAIN/g" /etc/apache2/sites-available/$DOMAIN.conf RUN a2dissite 000-default default-ssl #RUN a2ensite $DOMAIN.conf RUN a2ensite ${DOMAIN}.conf -RUN a2enmod ssl rewrite +#RUN a2enmod ssl rewrite #derniers ajout RUN a2enmod rewrite -- 2.49.1 From dfcca6af8f928a1a4427e64ed3dca6a3a505a56e Mon Sep 17 00:00:00 2001 From: sylvain Date: Thu, 15 May 2025 19:03:25 +0000 Subject: [PATCH 09/20] Actualiser dockerfile --- dockerfile | 65 +++++++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/dockerfile b/dockerfile index 695fb93..5ea3588 100644 --- a/dockerfile +++ b/dockerfile @@ -11,47 +11,52 @@ ARG SMTP_PASS ARG ADMIN_EMAIL # Installer les paquets nécessaires -RUN apt-get update && apt-get install -y apache2 php php-cli php-mysql php-curl php-fpm php-gd php-json php-xml php-zip php-intl php-mbstring \ -php-bcmath php-gmp software-properties-common git openssl msmtp mariadb-client cron curl unzip nano +RUN apt-get update && apt-get install -y \ + apache2 \ + php php-cli php-mysql php-curl php-fpm php-gd php-json php-xml php-zip php-mbstring php-bcmath php-gmp php-intl \ + software-properties-common git msmtp mariadb-client cron curl unzip nano # Nettoyer RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -# Générer un certificat SSL auto-signé -#RUN mkdir -p /etc/ssl/private && mkdir -p /etc/ssl/certs && \ -# openssl req -x509 -nodes -subj "/C=FR/ST=France/L=Paris/O=organization/OU=Org/CN=${DOMAIN}" \ -# -newkey rsa:4096 -keyout /etc/ssl/private/${DOMAIN}.key -out /etc/ssl/certs/${DOMAIN}.crt -days 365 - -# Copier et activer la config Apache -COPY src/container_apache.conf /etc/apache2/sites-available/$DOMAIN.conf -RUN sed -i "s/{{DOMAIN}}/$DOMAIN/g" /etc/apache2/sites-available/$DOMAIN.conf -RUN a2dissite 000-default default-ssl -#RUN a2ensite $DOMAIN.conf -RUN a2ensite ${DOMAIN}.conf -#RUN a2enmod ssl rewrite -#derniers ajout -RUN a2enmod rewrite - +# Copier et activer la config Apache (HTTP uniquement) +COPY src/container_apache.conf /etc/apache2/sites-available/${DOMAIN}.conf +RUN sed -i "s/{{DOMAIN}}/${DOMAIN}/g" /etc/apache2/sites-available/${DOMAIN}.conf && \ + a2dissite 000-default.conf && \ + a2ensite ${DOMAIN}.conf && \ + a2enmod rewrite # Installer Hubzilla -RUN rm -r /var/www/html/ -RUN git clone https://framagit.org/hubzilla/core.git /var/www/html/ -RUN cd /var/www/html/ && util/add_addon_repo https://framagit.org/hubzilla/addons.git official -RUN mkdir -p "/var/www/html/store/[data]/smarty3" && \ - chown -R www-data:www-data /var/www/html/ +WORKDIR /var/www/html +RUN git clone https://framagit.org/hubzilla/core.git . && \ + util/add_addon_repo https://framagit.org/hubzilla/addons.git official && \ + mkdir -p store/[data]/smarty3 && \ + chown -R www-data:www-data /var/www/html # Configurer msmtp COPY src/msmtprc /etc/msmtprc -RUN sed -i "s/{{SMTP_EMAIL}}/${SMTP_EMAIL}/g" /etc/msmtprc && sed -i "s/{{SMTP_SERVER}}/${SMTP_SERVER}/g" /etc/msmtprc && \ - sed -i "s/{{SMTP_PORT}}/${SMTP_PORT}/g" /etc/msmtprc && sed -i "s/{{SMTP_USER}}/${SMTP_USER}/g" /etc/msmtprc && \ - sed -i "s/{{SMTP_PASS}}/${SMTP_PASS}/g" /etc/msmtprc - -RUN chmod 600 /etc/msmtprc && chown www-data:www-data /etc/msmtprc +RUN sed -i "s/{{SMTP_EMAIL}}/${SMTP_EMAIL}/g" /etc/msmtprc && \ + sed -i "s/{{SMTP_SERVER}}/${SMTP_SERVER}/g" /etc/msmtprc && \ + sed -i "s/{{SMTP_PORT}}/${SMTP_PORT}/g" /etc/msmtprc && \ + sed -i "s/{{SMTP_USER}}/${SMTP_USER}/g" /etc/msmtprc && \ + sed -i "s/{{SMTP_PASS}}/${SMTP_PASS}/g" /etc/msmtprc && \ + chmod 600 /etc/msmtprc && \ + chown www-data:www-data /etc/msmtprc + +# Activer msmtp dans PHP RUN echo "sendmail_path = /usr/bin/msmtp -t" >> /etc/php/8.2/apache2/php.ini -#config php.ini## +# Config PHP (upload size + register_argc_argv) RUN echo "upload_max_filesize = 20M" >> /etc/php/8.2/apache2/php.ini && \ - echo "post_max_size = 20M" >> /etc/php/8.2/apache2/php.ini + echo "post_max_size = 20M" >> /etc/php/8.2/apache2/php.ini && \ + echo "register_argc_argv = On" >> /etc/php/8.2/apache2/php.ini + +# Fichier .htconfig.php (préconfiguré) +COPY src/.htconfig.php /var/www/html/.htconfig.php +RUN LOCATION_HASH=$(cat /dev/urandom | tr -dc 'a-f0-9' | fold -w 64 | head -n 1) && \ + sed -i "s/{{DOMAIN}}/${DOMAIN}/g" /var/www/html/.htconfig.php && \ + sed -i "s/{{LOCATION_HASH}}/${LOCATION_HASH}/g" /var/www/html/.htconfig.php && \ + sed -i "s/{{ADMIN_EMAIL}}/${ADMIN_EMAIL}/g" /var/www/html/.htconfig.php # Cron RUN echo "*/15 * * * * cd /var/www/html; /usr/bin/php Zotlabs/Daemon/Master.php Cron" | crontab -u www-data - @@ -59,4 +64,4 @@ RUN echo "*/15 * * * * cd /var/www/html; /usr/bin/php Zotlabs/Daemon/Master.php # Script de démarrage COPY src/start.sh /start.sh RUN chmod +x /start.sh -CMD ["/bin/bash", "/start.sh"] \ No newline at end of file +CMD ["/bin/bash", "/start.sh"] -- 2.49.1 From b9e9d8af228e875d3c8b4bd224f3deed110d7bab Mon Sep 17 00:00:00 2001 From: sylvain Date: Thu, 15 May 2025 19:04:33 +0000 Subject: [PATCH 10/20] Actualiser src/container_apache.conf --- src/container_apache.conf | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/container_apache.conf b/src/container_apache.conf index 4e10429..42318e2 100644 --- a/src/container_apache.conf +++ b/src/container_apache.conf @@ -1,14 +1,12 @@ ServerName {{DOMAIN}} - DocumentRoot /var/www/html - Options Indexes FollowSymLinks AllowOverride All Require all granted - ErrorLog ${APACHE_LOG_DIR}/error.log - CustomLog ${APACHE_LOG_DIR}/access.log combined + ErrorLog ${APACHE_LOG_DIR}/hubzilla_error.log + CustomLog ${APACHE_LOG_DIR}/hubzilla_access.log combined \ No newline at end of file -- 2.49.1 From bae256f0c952ea7532ab0a0a86cb44dc0a04d532 Mon Sep 17 00:00:00 2001 From: sylvain Date: Thu, 15 May 2025 19:06:43 +0000 Subject: [PATCH 11/20] Ajouter src/.htconfig.php --- src/.htconfig.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/.htconfig.php diff --git a/src/.htconfig.php b/src/.htconfig.php new file mode 100644 index 0000000..17d09d2 --- /dev/null +++ b/src/.htconfig.php @@ -0,0 +1,23 @@ + Date: Thu, 15 May 2025 19:10:26 +0000 Subject: [PATCH 12/20] Actualiser dockerfile --- dockerfile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dockerfile b/dockerfile index 5ea3588..42a94bf 100644 --- a/dockerfile +++ b/dockerfile @@ -26,9 +26,10 @@ RUN sed -i "s/{{DOMAIN}}/${DOMAIN}/g" /etc/apache2/sites-available/${DOMAIN}.con a2ensite ${DOMAIN}.conf && \ a2enmod rewrite -# Installer Hubzilla -WORKDIR /var/www/html -RUN git clone https://framagit.org/hubzilla/core.git . && \ +# Cloner Hubzilla dans /var/www/html +RUN rm -rf /var/www/html && \ + git clone https://framagit.org/hubzilla/core.git /var/www/html && \ + cd /var/www/html && \ util/add_addon_repo https://framagit.org/hubzilla/addons.git official && \ mkdir -p store/[data]/smarty3 && \ chown -R www-data:www-data /var/www/html @@ -52,11 +53,11 @@ RUN echo "upload_max_filesize = 20M" >> /etc/php/8.2/apache2/php.ini && \ echo "register_argc_argv = On" >> /etc/php/8.2/apache2/php.ini # Fichier .htconfig.php (préconfiguré) -COPY src/.htconfig.php /var/www/html/.htconfig.php +COPY src/.htconfig.php /tmp/.htconfig.php RUN LOCATION_HASH=$(cat /dev/urandom | tr -dc 'a-f0-9' | fold -w 64 | head -n 1) && \ - sed -i "s/{{DOMAIN}}/${DOMAIN}/g" /var/www/html/.htconfig.php && \ - sed -i "s/{{LOCATION_HASH}}/${LOCATION_HASH}/g" /var/www/html/.htconfig.php && \ - sed -i "s/{{ADMIN_EMAIL}}/${ADMIN_EMAIL}/g" /var/www/html/.htconfig.php + sed "s/{{DOMAIN}}/${DOMAIN}/g; s/{{LOCATION_HASH}}/${LOCATION_HASH}/g; s/{{ADMIN_EMAIL}}/${ADMIN_EMAIL}/g" /tmp/.htconfig.php > /var/www/html/.htconfig.php && \ + chown www-data:www-data /var/www/html/.htconfig.php && \ + rm /tmp/.htconfig.php # Cron RUN echo "*/15 * * * * cd /var/www/html; /usr/bin/php Zotlabs/Daemon/Master.php Cron" | crontab -u www-data - -- 2.49.1 From 43c722b5d587ca6b3ed90a7db68c5a9edc20a1f0 Mon Sep 17 00:00:00 2001 From: sylvain Date: Thu, 15 May 2025 19:15:01 +0000 Subject: [PATCH 13/20] Actualiser dockerfile --- dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dockerfile b/dockerfile index 42a94bf..60a2673 100644 --- a/dockerfile +++ b/dockerfile @@ -26,9 +26,9 @@ RUN sed -i "s/{{DOMAIN}}/${DOMAIN}/g" /etc/apache2/sites-available/${DOMAIN}.con a2ensite ${DOMAIN}.conf && \ a2enmod rewrite -# Cloner Hubzilla dans /var/www/html -RUN rm -rf /var/www/html && \ - git clone https://framagit.org/hubzilla/core.git /var/www/html && \ +# Installer Hubzilla +RUN git clone https://framagit.org/hubzilla/core.git /tmp/hubzilla && \ + mv /tmp/hubzilla /var/www/html && \ cd /var/www/html && \ util/add_addon_repo https://framagit.org/hubzilla/addons.git official && \ mkdir -p store/[data]/smarty3 && \ @@ -56,8 +56,7 @@ RUN echo "upload_max_filesize = 20M" >> /etc/php/8.2/apache2/php.ini && \ COPY src/.htconfig.php /tmp/.htconfig.php RUN LOCATION_HASH=$(cat /dev/urandom | tr -dc 'a-f0-9' | fold -w 64 | head -n 1) && \ sed "s/{{DOMAIN}}/${DOMAIN}/g; s/{{LOCATION_HASH}}/${LOCATION_HASH}/g; s/{{ADMIN_EMAIL}}/${ADMIN_EMAIL}/g" /tmp/.htconfig.php > /var/www/html/.htconfig.php && \ - chown www-data:www-data /var/www/html/.htconfig.php && \ - rm /tmp/.htconfig.php + chown www-data:www-data /var/www/html/.htconfig.php # Cron RUN echo "*/15 * * * * cd /var/www/html; /usr/bin/php Zotlabs/Daemon/Master.php Cron" | crontab -u www-data - -- 2.49.1 From 4d4ccf465a743d714da26a6a6bbbc00c7c499b3e Mon Sep 17 00:00:00 2001 From: sylvain Date: Thu, 15 May 2025 19:16:44 +0000 Subject: [PATCH 14/20] Actualiser dockerfile --- dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dockerfile b/dockerfile index 60a2673..55a45b0 100644 --- a/dockerfile +++ b/dockerfile @@ -27,13 +27,12 @@ RUN sed -i "s/{{DOMAIN}}/${DOMAIN}/g" /etc/apache2/sites-available/${DOMAIN}.con a2enmod rewrite # Installer Hubzilla -RUN git clone https://framagit.org/hubzilla/core.git /tmp/hubzilla && \ - mv /tmp/hubzilla /var/www/html && \ - cd /var/www/html && \ - util/add_addon_repo https://framagit.org/hubzilla/addons.git official && \ - mkdir -p store/[data]/smarty3 && \ +RUN git clone https://framagit.org/hubzilla/core.git /var/www/html && \ + bash -c "cd /var/www/html && ./util/add_addon_repo https://framagit.org/hubzilla/addons.git official" && \ + mkdir -p /var/www/html/store/[data]/smarty3 && \ chown -R www-data:www-data /var/www/html + # Configurer msmtp COPY src/msmtprc /etc/msmtprc RUN sed -i "s/{{SMTP_EMAIL}}/${SMTP_EMAIL}/g" /etc/msmtprc && \ -- 2.49.1 From 4ff4e74b956180af9ac23e577648e8c6600add4f Mon Sep 17 00:00:00 2001 From: sylvain Date: Thu, 15 May 2025 19:18:42 +0000 Subject: [PATCH 15/20] Actualiser dockerfile --- dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfile b/dockerfile index 55a45b0..6569fa2 100644 --- a/dockerfile +++ b/dockerfile @@ -28,7 +28,7 @@ RUN sed -i "s/{{DOMAIN}}/${DOMAIN}/g" /etc/apache2/sites-available/${DOMAIN}.con # Installer Hubzilla RUN git clone https://framagit.org/hubzilla/core.git /var/www/html && \ - bash -c "cd /var/www/html && ./util/add_addon_repo https://framagit.org/hubzilla/addons.git official" && \ + /bin/bash -c "cd /var/www/html && ./util/add_addon_repo https://framagit.org/hubzilla/addons.git official" && \ mkdir -p /var/www/html/store/[data]/smarty3 && \ chown -R www-data:www-data /var/www/html -- 2.49.1 From 5cb32932c59410ddf8846bd94ae09817042adff3 Mon Sep 17 00:00:00 2001 From: sylvain Date: Thu, 15 May 2025 19:23:06 +0000 Subject: [PATCH 16/20] Supprimer dockerfile --- dockerfile | 66 ------------------------------------------------------ 1 file changed, 66 deletions(-) delete mode 100644 dockerfile diff --git a/dockerfile b/dockerfile deleted file mode 100644 index 6569fa2..0000000 --- a/dockerfile +++ /dev/null @@ -1,66 +0,0 @@ -FROM debian:12 - -ENV DEBIAN_FRONTEND=noninteractive - -ARG DOMAIN -ARG SMTP_EMAIL -ARG SMTP_SERVER -ARG SMTP_PORT -ARG SMTP_USER -ARG SMTP_PASS -ARG ADMIN_EMAIL - -# Installer les paquets nécessaires -RUN apt-get update && apt-get install -y \ - apache2 \ - php php-cli php-mysql php-curl php-fpm php-gd php-json php-xml php-zip php-mbstring php-bcmath php-gmp php-intl \ - software-properties-common git msmtp mariadb-client cron curl unzip nano - -# Nettoyer -RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -# Copier et activer la config Apache (HTTP uniquement) -COPY src/container_apache.conf /etc/apache2/sites-available/${DOMAIN}.conf -RUN sed -i "s/{{DOMAIN}}/${DOMAIN}/g" /etc/apache2/sites-available/${DOMAIN}.conf && \ - a2dissite 000-default.conf && \ - a2ensite ${DOMAIN}.conf && \ - a2enmod rewrite - -# Installer Hubzilla -RUN git clone https://framagit.org/hubzilla/core.git /var/www/html && \ - /bin/bash -c "cd /var/www/html && ./util/add_addon_repo https://framagit.org/hubzilla/addons.git official" && \ - mkdir -p /var/www/html/store/[data]/smarty3 && \ - chown -R www-data:www-data /var/www/html - - -# Configurer msmtp -COPY src/msmtprc /etc/msmtprc -RUN sed -i "s/{{SMTP_EMAIL}}/${SMTP_EMAIL}/g" /etc/msmtprc && \ - sed -i "s/{{SMTP_SERVER}}/${SMTP_SERVER}/g" /etc/msmtprc && \ - sed -i "s/{{SMTP_PORT}}/${SMTP_PORT}/g" /etc/msmtprc && \ - sed -i "s/{{SMTP_USER}}/${SMTP_USER}/g" /etc/msmtprc && \ - sed -i "s/{{SMTP_PASS}}/${SMTP_PASS}/g" /etc/msmtprc && \ - chmod 600 /etc/msmtprc && \ - chown www-data:www-data /etc/msmtprc - -# Activer msmtp dans PHP -RUN echo "sendmail_path = /usr/bin/msmtp -t" >> /etc/php/8.2/apache2/php.ini - -# Config PHP (upload size + register_argc_argv) -RUN echo "upload_max_filesize = 20M" >> /etc/php/8.2/apache2/php.ini && \ - echo "post_max_size = 20M" >> /etc/php/8.2/apache2/php.ini && \ - echo "register_argc_argv = On" >> /etc/php/8.2/apache2/php.ini - -# Fichier .htconfig.php (préconfiguré) -COPY src/.htconfig.php /tmp/.htconfig.php -RUN LOCATION_HASH=$(cat /dev/urandom | tr -dc 'a-f0-9' | fold -w 64 | head -n 1) && \ - sed "s/{{DOMAIN}}/${DOMAIN}/g; s/{{LOCATION_HASH}}/${LOCATION_HASH}/g; s/{{ADMIN_EMAIL}}/${ADMIN_EMAIL}/g" /tmp/.htconfig.php > /var/www/html/.htconfig.php && \ - chown www-data:www-data /var/www/html/.htconfig.php - -# Cron -RUN echo "*/15 * * * * cd /var/www/html; /usr/bin/php Zotlabs/Daemon/Master.php Cron" | crontab -u www-data - - -# Script de démarrage -COPY src/start.sh /start.sh -RUN chmod +x /start.sh -CMD ["/bin/bash", "/start.sh"] -- 2.49.1 From 7033b21c881ffaf4c989010118e3b69b700f67a3 Mon Sep 17 00:00:00 2001 From: sylvain Date: Thu, 15 May 2025 19:24:17 +0000 Subject: [PATCH 17/20] Ajouter dockerfile --- dockerfile | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 dockerfile diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..ca74807 --- /dev/null +++ b/dockerfile @@ -0,0 +1,52 @@ +FROM debian:12 + +ENV DEBIAN_FRONTEND=noninteractive + +# Installation des dépendances nécessaires +RUN apt-get update && apt-get install -y \ + apache2 \ + mariadb-client \ + php \ + php-cli \ + php-mysql \ + php-curl \ + php-gd \ + php-json \ + php-xml \ + php-zip \ + php-mbstring \ + php-bcmath \ + php-gmp \ + php-intl \ + git \ + curl \ + unzip \ + nano \ + cron \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Configuration du répertoire de travail +WORKDIR /var/www/html + +# Clonage du dépôt Hubzilla +RUN git clone https://framagit.org/hubzilla/core.git . && \ + mkdir -p store/[data]/smarty3 && \ + chown -R www-data:www-data /var/www/html + +# Activation des modules Apache nécessaires +RUN a2enmod rewrite ssl + +# Configuration de PHP +RUN echo "upload_max_filesize = 20M" >> /etc/php/8.2/apache2/php.ini && \ + echo "post_max_size = 20M" >> /etc/php/8.2/apache2/php.ini && \ + echo "register_argc_argv = On" >> /etc/php/8.2/apache2/php.ini + +# Configuration du site Apache +COPY src/hubzilla.conf /etc/apache2/sites-available/hubzilla.conf +RUN a2dissite 000-default.conf && a2ensite hubzilla.conf + +# Copie du script de démarrage +COPY src/start.sh /start.sh +RUN chmod +x /start.sh + +CMD ["/bin/bash", "/start.sh"] -- 2.49.1 From a53dff8f464f833a1617695d5d1bd518cbc3864c Mon Sep 17 00:00:00 2001 From: sylvain Date: Thu, 15 May 2025 19:25:43 +0000 Subject: [PATCH 18/20] Actualiser src/container_apache.conf --- src/container_apache.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/container_apache.conf b/src/container_apache.conf index 42318e2..a3e3ed3 100644 --- a/src/container_apache.conf +++ b/src/container_apache.conf @@ -1,5 +1,5 @@ - ServerName {{DOMAIN}} + ServerName yourdomain.com DocumentRoot /var/www/html @@ -7,6 +7,6 @@ Require all granted - ErrorLog ${APACHE_LOG_DIR}/hubzilla_error.log - CustomLog ${APACHE_LOG_DIR}/hubzilla_access.log combined + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined \ No newline at end of file -- 2.49.1 From 8303f92ee330bb9155f6f896d22336d53998fa7f Mon Sep 17 00:00:00 2001 From: sylvain Date: Thu, 15 May 2025 19:29:13 +0000 Subject: [PATCH 19/20] Actualiser src/start.sh --- src/start.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/start.sh b/src/start.sh index e3c8b18..98cd5ec 100755 --- a/src/start.sh +++ b/src/start.sh @@ -1,7 +1,7 @@ #!/bin/bash -echo "[INFO] Lancement du service cron..." -service cron start +# Démarrage du service Apache +service apache2 start -echo "[INFO] Lancement du serveur Apache..." -apachectl -D FOREGROUND +# Attente indéfinie pour maintenir le conteneur en cours d'exécution +tail -f /dev/null \ No newline at end of file -- 2.49.1 From af92eb6c18aef54164b4abd769f8c0da24979ea1 Mon Sep 17 00:00:00 2001 From: sylvain Date: Fri, 16 May 2025 21:42:18 +0200 Subject: [PATCH 20/20] marche --- dockerfile | 1 + src/hubzilla.conf | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 src/hubzilla.conf diff --git a/dockerfile b/dockerfile index ca74807..71560ec 100644 --- a/dockerfile +++ b/dockerfile @@ -29,6 +29,7 @@ RUN apt-get update && apt-get install -y \ WORKDIR /var/www/html # Clonage du dépôt Hubzilla +RUN rm -r /var/www/html/ RUN git clone https://framagit.org/hubzilla/core.git . && \ mkdir -p store/[data]/smarty3 && \ chown -R www-data:www-data /var/www/html diff --git a/src/hubzilla.conf b/src/hubzilla.conf new file mode 100644 index 0000000..f22afa5 --- /dev/null +++ b/src/hubzilla.conf @@ -0,0 +1,12 @@ + + ServerName yourdomain.com + DocumentRoot /var/www/html + + + AllowOverride All + Require all granted + + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + -- 2.49.1