From d08ff0c7ef31e64f3aa7340bbfab09eb6630e085 Mon Sep 17 00:00:00 2001 From: Dennis Schwerdel Date: Thu, 12 Nov 2020 12:01:14 +0100 Subject: [PATCH] First working version --- .dockerignore | 4 ++ .gitignore | 2 + CHANGELOG | 2 + CloudronManifest.json | 25 ++++++++++++ DESCRIPTION.md | 5 +++ Dockerfile | 50 +++++++++++++++++++++++ POSTINSTALL.md | 5 +++ README.md | 24 +++++++++++ config.sh | 2 + fpm.conf | 14 +++++++ logo.png | Bin 0 -> 548 bytes medialinks/medialink_0.png | Bin 0 -> 16388 bytes nginx.conf | 81 +++++++++++++++++++++++++++++++++++++ public/index.html | 34 ++++++++++++++++ rebuild-loop.sh | 8 ++++ rebuild.php | 3 ++ rebuild.sh | 33 +++++++++++++++ ssh.config | 3 ++ start.sh | 41 +++++++++++++++++++ supervisord.conf | 30 ++++++++++++++ 20 files changed, 366 insertions(+) create mode 100644 .dockerignore create mode 100644 .gitignore create mode 100644 CHANGELOG create mode 100644 CloudronManifest.json create mode 100644 DESCRIPTION.md create mode 100644 Dockerfile create mode 100644 POSTINSTALL.md create mode 100644 README.md create mode 100644 config.sh create mode 100644 fpm.conf create mode 100644 logo.png create mode 100644 medialinks/medialink_0.png create mode 100644 nginx.conf create mode 100644 public/index.html create mode 100755 rebuild-loop.sh create mode 100644 rebuild.php create mode 100755 rebuild.sh create mode 100644 ssh.config create mode 100755 start.sh create mode 100644 supervisord.conf diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6bbcb32 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +test/* +.git/* +screenshots/* + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d570088 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules/ + diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..7b70cb3 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,2 @@ +[0.1.0] +* First version \ No newline at end of file diff --git a/CloudronManifest.json b/CloudronManifest.json new file mode 100644 index 0000000..a873a04 --- /dev/null +++ b/CloudronManifest.json @@ -0,0 +1,25 @@ +{ + "id": "org.getzola.cloudronapp", + "title": "Zola", + "author": "Zola developers", + "description": "file://DESCRIPTION.md", + "tagline": "Zola static page generator", + "tags": [ + "webserver" + ], + "version": "0.1.0", + "healthCheckPath": "/", + "httpPort": 8000, + "manifestVersion": 1, + "website": "https://getzola.org", + "contactEmail": "support@cloudron.io", + "icon": "logo.png", + "addons": { + "localstorage": {} + }, + "mediaLinks": [ + "https://nginx.org/nginx.png" + ], + "changelog": "file://CHANGELOG", + "postInstallMessage": "file://POSTINSTALL.md" +} diff --git a/DESCRIPTION.md b/DESCRIPTION.md new file mode 100644 index 0000000..94c0fae --- /dev/null +++ b/DESCRIPTION.md @@ -0,0 +1,5 @@ +### Empty Website with Nginx + PHP. + +Use `cloudron push` to copy files into `/app/data/public/` and `cloudron exec` to get a remote terminal. + +Edit `/app/data/nginx.conf` to change the webserver configuration according to the [Nginx Documentation](https://nginx.org/en/docs/). diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3930997 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,50 @@ +FROM cloudron/base:1.0.0 + +RUN mkdir -p /app/code +WORKDIR /app/code + +RUN wget http://nginx.org/keys/nginx_signing.key && \ + apt-key add nginx_signing.key && \ + rm nginx_signing.key && \ + echo "deb http://nginx.org/packages/mainline/ubuntu/ $(lsb_release -cs) nginx" > /etc/apt/sources.list.d/nginx.list && \ + apt update && \ + apt install -y nginx zopfli + +ENV RUST=1.47.0 +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain ${RUST} && \ + export PATH=/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin && \ + cd /tmp && \ + git clone https://github.com/getzola/zola.git && \ + cd zola && \ + cargo build --release && \ + cp target/release/zola /usr/bin && \ + cd / && rm -rf /tmp/zola /root/.cargo /root/.rustup + +ADD supervisord.conf /etc/supervisor/conf.d/zola.conf +RUN sed -e 's,^logfile=.*$,logfile=/run/supervisord.log,' -i /etc/supervisor/supervisord.conf + +ADD nginx.conf /app/code/nginx.conf.default +ADD fpm.conf /etc/php/7.2/fpm/php-fpm.conf + +ADD public /app/code/public.default + +ADD start.sh /app/code/start.sh +ADD config.sh /app/code/config.sh.default +ADD rebuild.sh /app/code/rebuild.sh +ADD rebuild-loop.sh /app/code/rebuild-loop.sh +ADD rebuild.php /app/code/rebuild.php +ADD ssh.config /app/code/ssh.config.default + +RUN mkdir /run/nginx && \ + rm /var/log/nginx/*.log && \ + ln -s /dev/stderr /var/log/nginx/error.log && \ + ln -s /dev/stdout /var/log/nginx/access.log && \ + rmdir /var/cache/nginx && ln -s /tmp /var/cache/nginx && \ + ln -s /app/data/ssh /home/cloudron/.ssh + +RUN chown -R cloudron:cloudron /app/code /run/nginx + +WORKDIR /app/data + +CMD [ "/app/code/start.sh" ] + diff --git a/POSTINSTALL.md b/POSTINSTALL.md new file mode 100644 index 0000000..94c0fae --- /dev/null +++ b/POSTINSTALL.md @@ -0,0 +1,5 @@ +### Empty Website with Nginx + PHP. + +Use `cloudron push` to copy files into `/app/data/public/` and `cloudron exec` to get a remote terminal. + +Edit `/app/data/nginx.conf` to change the webserver configuration according to the [Nginx Documentation](https://nginx.org/en/docs/). diff --git a/README.md b/README.md new file mode 100644 index 0000000..bd2d439 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# Nginx Cloudron App + +This repository contains the Cloudron app package source for Nginx. + +## Installation + +[![Install](https://cloudron.io/img/button.svg)](https://cloudron.io/button.html?app=org.nginx.cloudronapp) + +or using the [Cloudron command line tooling](https://cloudron.io/references/cli.html) + +``` +cloudron install --appstore-id org.nginx.cloudronapp +``` + +## Building + +The app package can be built using the [Cloudron command line tooling](https://cloudron.io/references/cli.html). + +``` +cd nginx-app + +cloudron build +cloudron install +``` diff --git a/config.sh b/config.sh new file mode 100644 index 0000000..f643bad --- /dev/null +++ b/config.sh @@ -0,0 +1,2 @@ +REPO_URL="" +REBUILD_INTERVAL=3600 \ No newline at end of file diff --git a/fpm.conf b/fpm.conf new file mode 100644 index 0000000..5c91e92 --- /dev/null +++ b/fpm.conf @@ -0,0 +1,14 @@ +[global] +error_log = /dev/stderr + +[www] +listen = /var/run/php-fpm.sock +listen.mode = 0666 +user = cloudron +group = cloudron + +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 diff --git a/logo.png b/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..a59d02d4254506a0d007c8044e89a9259395798c GIT binary patch literal 548 zcmV+<0^9wGP)q{xCkN+hD1ZOwgxVS2;tJ=AW=_T-2#cG7lb4Z z{u_KyxHuT}2cA&A=k@jQd|Yhwo^ucHSVQNG=X*Y%bMCoZe&X1fN3xY=|(u0g%sYjt&R-GwT)fP-3RZ}7$ULv$W>9F{75M=Eu zNLdod_zQ9xQJ+On)`DdLF+EQaTYD2r_}gdD(31Af7`vx_Nz$f8;rX5EW($B-+T)Xc z_#Dq@02TUdSwF#Dz5#V+XbmB_%qIZ0>9VJN9?xq4Y7DsKlj2j1un*LE>NX>(;0hlx z7)o3VA;|C?fC|H|bCL<}a|9Ts$%YWzqzpibHuqWX_!ee3#_*lnNp|fX9ijppF-1!V zK_|NaY;ZNvsW}Q-Sp?u0caq`V1Zl?k2}C?eigy!SX9I)b9fc5rEOP+-U@$q}Mevvg zaLfeh5Q1KI09fLp58fuYz$^yC7jF6CZGy4Ww`YQ!ry#cY?b5n#NIKBG_Rmah>8)>7 zF<>pa048I1(1gP4vwz|BRWBU`Yq6vMFChPdAPUNl(%KFxC}&jDko~6S*?w#49DasK m9eSu`RhtSw)QTRdAe{gc?72^Ec^C8m0000qx2mB literal 0 HcmV?d00001 diff --git a/medialinks/medialink_0.png b/medialinks/medialink_0.png new file mode 100644 index 0000000000000000000000000000000000000000..1b676c055e5034370e67dc3df14827496b158803 GIT binary patch literal 16388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ER60&xsdT)Ygs~*Fc?>b=<@n!Rah6 z)Y#~*PXvb43}^>!nQ48jbXX%b%A^<>PNu)}F)Ha; + + + Zola + + + + +

Zola

+

To get started, fill in the repository URL in /app/data/config.sh.

+ +

Webhook

+

+ To trigger a site rebuild from a webhook, use the following URL: +

+
+

+ If you want to clone a protected repository, you can grant access to the following SSH key: +

+
%SSH_KEY%
+ + + + \ No newline at end of file diff --git a/rebuild-loop.sh b/rebuild-loop.sh new file mode 100755 index 0000000..c9661cb --- /dev/null +++ b/rebuild-loop.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +. /app/data/config.sh + +while true; do + /app/code/rebuild.sh + sleep $REBUILD_INTERVAL +done \ No newline at end of file diff --git a/rebuild.php b/rebuild.php new file mode 100644 index 0000000..6554589 --- /dev/null +++ b/rebuild.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/rebuild.sh b/rebuild.sh new file mode 100755 index 0000000..204821a --- /dev/null +++ b/rebuild.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +set -eu + +REPO_PATH=/run/repo +WEB_PATH=/run/html + +. /app/data/config.sh + +if [ "$REPO_URL" == "" ]; then + echo "No REPO_URL set!" + exit 1 +fi + +if ! [ -d "$REPO_PATH" ]; then + git clone "$REPO_URL" "$REPO_PATH" + (cd "$REPO_PATH" && git submodule init) +fi + +cd "$REPO_PATH" +git pull +git submodule update + +zola build + +echo "Compressing files..." +find public -type f -name '*.css' -size +5k -exec zopfli '{}' \; +find public -type f -name '*.js' -size +5k -exec zopfli '{}' \; +find public -type f -name '*.html' -size +5k -exec zopfli '{}' \; + +echo "Updating webpage..." +mkdir -p "$WEB_PATH" +rsync -av --del public/ "$WEB_PATH/" \ No newline at end of file diff --git a/ssh.config b/ssh.config new file mode 100644 index 0000000..f4f7e76 --- /dev/null +++ b/ssh.config @@ -0,0 +1,3 @@ +Host * + StrictHostKeyChecking no + UserKnownHostsFile=/dev/null \ No newline at end of file diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..eb9f604 --- /dev/null +++ b/start.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +set -eu + +if ! [ -e "/app/data/nginx.conf" ]; then + cp -a "/app/code/nginx.conf.default" "/app/data/nginx.conf" +fi + +if ! [ -e "/app/data/config.sh" ]; then + cp -a "/app/code/config.sh.default" "/app/data/config.sh" +fi + +if ! [ -e "/app/data/ssh" ]; then + mkdir -p /app/data/ssh + cp /app/code/ssh.config.default /app/data/ssh/config + ssh-keygen -f /app/data/ssh/id_rsa -q -N "" +fi + +if ! [ -e "/app/data/token.txt" ]; then + token="$(pwgen 20 1)" + echo "$token" > /app/data/token.txt +fi + +if ! [ -e "/app/data/htpasswd" ]; then + token="$(cat /app/data/token.txt)" + echo "$token" > /app/data/token.txt + htpasswd -bc /app/data/htpasswd token "$token" +fi + +chown -R cloudron:cloudron /app/data + +cp -a "/app/code/public.default" "/run/html" +token="$(cat /app/data/token.txt)" +sed -i -e "s/%TOKEN%/$token/g" /run/html/index.html +ssh_key="$(cat /app/data/ssh/id_rsa.pub | sed 's/\//\\\//g')" +sed -i -e "s/%SSH_KEY%/$ssh_key/g" /run/html/index.html +chown cloudron:cloudron /run/html /run + +export HOME=/app/data + +exec /usr/bin/supervisord --configuration /etc/supervisor/supervisord.conf --nodaemon -i Zola \ No newline at end of file diff --git a/supervisord.conf b/supervisord.conf new file mode 100644 index 0000000..ff3f79b --- /dev/null +++ b/supervisord.conf @@ -0,0 +1,30 @@ +[program:nginx] +directory=/app/data +command=/usr/sbin/nginx -c /app/data/nginx.conf -g 'daemon off;' +autostart=true +autorestart=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 + +[program:fpm] +directory=/app/data +command=/usr/sbin/php-fpm7.2 -F +autostart=true +autorestart=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 + +[program:rebuild] +directory=/app/data +command=/app/code/rebuild-loop.sh +user=cloudron +autostart=true +autorestart=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0