From 35a6076f26e5bba4b5db3c725e85daffec4200f0 Mon Sep 17 00:00:00 2001 From: Florent Guiotte Date: Fri, 23 Sep 2022 15:31:53 +0200 Subject: [PATCH] Create slides notes server for revealjs --- docker-compose.yml | 15 ++ slides-notes/Dockerfile | 43 +++++ swag/nginx/nginx.conf | 2 +- .../proxy-confs/slides-notes.subdomain.conf | 38 +++++ swag/nginx/site-confs/default | 160 ------------------ 5 files changed, 97 insertions(+), 161 deletions(-) create mode 100644 slides-notes/Dockerfile create mode 100644 swag/nginx/proxy-confs/slides-notes.subdomain.conf delete mode 100644 swag/nginx/site-confs/default diff --git a/docker-compose.yml b/docker-compose.yml index 2069510..d767f9c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -52,6 +52,8 @@ services: container_name: flood user: 1000:100 restart: unless-stopped + depends_on: + - rtorrent command: --port 3001 --allowedpath /data environment: HOME: /config @@ -64,6 +66,7 @@ services: rtorrent: image: jesec/rtorrent container_name: rtorrent + hostname: rtorrent user: 1000:100 restart: unless-stopped command: -o network.port_range.set=6881-6881,system.daemon.set=true @@ -187,6 +190,18 @@ services: - ./taskserver/client_certs:/client_certs + slides-notes: + build: slides-notes + container_name: slides-notes + restart: always + environment: + - PUID=1000 + - PGID=1000 + - TZ=Europe/Paris + volumes: + - ./slides-notes/slides:/app/slides + + volumes: money-data: zotero-data: diff --git a/slides-notes/Dockerfile b/slides-notes/Dockerfile new file mode 100644 index 0000000..39e39ca --- /dev/null +++ b/slides-notes/Dockerfile @@ -0,0 +1,43 @@ +FROM ghcr.io/linuxserver/baseimage-alpine:3.16 + +WORKDIR /app + +# environment settings +ENV HOME="/app" +ENV NODE_ENV="production" + +RUN \ + echo "**** install build packages ****" && \ + apk --no-cache add \ + alpine-base \ + nodejs \ + npm && \ + echo "**** install reveal-notes-server ****" && \ + npm install reveal-notes-server && \ + echo "**** cleanup ****" && \ + rm -rf \ + /root/.cache \ + /tmp/* + + + #node node_modules/reveal-notes-server && \ +# copy local files +#COPY root/ / + +# ports and volumes +EXPOSE 1947 +VOLUME /app/slides + +RUN ln -s /app/slides/index.html /app/index.html && \ + ln -s /app/slides/img /app/img && \ + ln -s /app/slides/cache /app/cache && \ + ln -s /app/slides/vid /app/vid + + +#RUN echo hello world > /app/index.html + +CMD ["node", "node_modules/reveal-notes-server"] + + +#ENTRYPOINT ["/init"] +#ENTRYPOINT node node_modules/reveal-notes-server && \ diff --git a/swag/nginx/nginx.conf b/swag/nginx/nginx.conf index c6a7504..525f0c6 100644 --- a/swag/nginx/nginx.conf +++ b/swag/nginx/nginx.conf @@ -120,7 +120,7 @@ http { ## # Virtual Host Configs ## - include /config/nginx/site-confs/*; + include /config/nginx/site-confs/*.conf; #Removed lua. Do not remove this comment } diff --git a/swag/nginx/proxy-confs/slides-notes.subdomain.conf b/swag/nginx/proxy-confs/slides-notes.subdomain.conf new file mode 100644 index 0000000..1aea887 --- /dev/null +++ b/swag/nginx/proxy-confs/slides-notes.subdomain.conf @@ -0,0 +1,38 @@ +server { + listen 443 ssl; + listen [::]:443 ssl; + + server_name slides.*; + + include /config/nginx/ssl.conf; + + client_max_body_size 0; + + # enable for ldap auth, fill in ldap details in ldap.conf + #include /config/nginx/ldap.conf; + + # enable for Authelia + #include /config/nginx/authelia-server.conf; + + location / { + # enable the next two lines for http auth + #auth_basic "Restricted"; + #auth_basic_user_file /config/nginx/.htpasswd; + + # enable the next two lines for ldap auth + #auth_request /auth; + #error_page 401 =200 /ldaplogin; + + # enable for Authelia + #include /config/nginx/authelia-location.conf; + + include /config/nginx/proxy.conf; + include /config/nginx/resolver.conf; + set $upstream_app slides-notes; + set $upstream_port 1947; + set $upstream_proto http; + proxy_pass $upstream_proto://$upstream_app:$upstream_port; + + } +} + diff --git a/swag/nginx/site-confs/default b/swag/nginx/site-confs/default deleted file mode 100644 index 82e19e8..0000000 --- a/swag/nginx/site-confs/default +++ /dev/null @@ -1,160 +0,0 @@ -## Version 2021/04/27 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/default - -error_page 502 /502.html; - -# redirect all traffic to https -server { - listen 80 default_server; - listen [::]:80 default_server; - server_name _; - return 301 https://$host$request_uri; -} - -# main server block -server { - listen 443 ssl http2 default_server; - listen [::]:443 ssl http2 default_server; - - root /config/www; - index index.html index.htm index.php; - - server_name _; - - # enable subfolder method reverse proxy confs - include /config/nginx/proxy-confs/*.subfolder.conf; - - # all ssl related config moved to ssl.conf - include /config/nginx/ssl.conf; - - # enable for ldap auth - #include /config/nginx/ldap.conf; - - # enable for Authelia - #include /config/nginx/authelia-server.conf; - - client_max_body_size 0; - - location / { - # enable the next two lines for http auth - #auth_basic "Restricted"; - #auth_basic_user_file /config/nginx/.htpasswd; - - # enable the next two lines for ldap auth - #auth_request /auth; - #error_page 401 =200 /ldaplogin; - - # enable for Authelia - #include /config/nginx/authelia-location.conf; - - try_files $uri $uri/ /index.html /index.php?$args =404; - } - - location ~ \.php$ { - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - include /etc/nginx/fastcgi_params; - } - -# sample reverse proxy config for password protected couchpotato running at IP 192.168.1.50 port 5050 with base url "cp" -# notice this is within the same server block as the base -# don't forget to generate the .htpasswd file as described on docker hub -# location ^~ /cp { -# auth_basic "Restricted"; -# auth_basic_user_file /config/nginx/.htpasswd; -# include /config/nginx/proxy.conf; -# proxy_pass http://192.168.1.50:5050/cp; -# } - -} - -# sample reverse proxy config without url base, but as a subdomain "cp", ip and port same as above -# notice this is a new server block, you need a new server block for each subdomain -#server { -# listen 443 ssl http2; -# listen [::]:443 ssl http2; -# -# root /config/www; -# index index.html index.htm index.php; -# -# server_name cp.*; -# -# include /config/nginx/ssl.conf; -# -# client_max_body_size 0; -# -# location / { -# auth_basic "Restricted"; -# auth_basic_user_file /config/nginx/.htpasswd; -# include /config/nginx/proxy.conf; -# proxy_pass http://192.168.1.50:5050; -# } -#} - -# sample reverse proxy config for "heimdall" via subdomain, with ldap authentication -# ldap-auth container has to be running and the /config/nginx/ldap.conf file should be filled with ldap info -# notice this is a new server block, you need a new server block for each subdomain -#server { -# listen 443 ssl http2; -# listen [::]:443 ssl http2; -# -# root /config/www; -# index index.html index.htm index.php; -# -# server_name heimdall.*; -# -# include /config/nginx/ssl.conf; -# -# include /config/nginx/ldap.conf; -# -# client_max_body_size 0; -# -# location / { -# # the next two lines will enable ldap auth along with the included ldap.conf in the server block -# auth_request /auth; -# error_page 401 =200 /ldaplogin; -# -# include /config/nginx/proxy.conf; -# resolver 127.0.0.11 valid=30s; -# set $upstream_app heimdall; -# set $upstream_port 443; -# set $upstream_proto https; -# proxy_pass $upstream_proto://$upstream_app:$upstream_port; -# } -#} - -# sample reverse proxy config for "heimdall" via subdomain, with Authelia -# Authelia container has to be running in the same user defined bridge network, with container name "authelia", and with 'path: "authelia"' set in its configuration.yml -# notice this is a new server block, you need a new server block for each subdomain -#server { -# listen 443 ssl http2; -# listen [::]:443 ssl http2; -# -# root /config/www; -# index index.html index.htm index.php; -# -# server_name heimdall.*; -# -# include /config/nginx/ssl.conf; -# -# include /config/nginx/authelia-server.conf; -# -# client_max_body_size 0; -# -# location / { -# # the next line will enable Authelia along with the included authelia-server.conf in the server block -# include /config/nginx/authelia-location.conf; -# -# include /config/nginx/proxy.conf; -# resolver 127.0.0.11 valid=30s; -# set $upstream_app heimdall; -# set $upstream_port 443; -# set $upstream_proto https; -# proxy_pass $upstream_proto://$upstream_app:$upstream_port; -# } -#} - -# enable subdomain method reverse proxy confs -include /config/nginx/proxy-confs/*.subdomain.conf; -# enable proxy cache for auth -proxy_cache_path cache/ keys_zone=auth_cache:10m;