From a287e741842f67d0a04c48276221d85f16079d55 Mon Sep 17 00:00:00 2001 From: Opal <847966@proton.me> Date: Sat, 15 Oct 2022 15:27:41 -0700 Subject: merging code between old emacsconf repo, to sachac's emacsconf repo --- pad-proxy/defaults/main.yml | 1 - pad-proxy/handlers/main.yml | 5 ---- pad-proxy/tasks/main.yml | 27 ------------------- pad-proxy/templates/etherpad.nginx.conf | 33 ----------------------- pad-proxy/templates/wikimedia.etherpad.nginx.conf | 33 ----------------------- 5 files changed, 99 deletions(-) delete mode 100644 pad-proxy/defaults/main.yml delete mode 100644 pad-proxy/handlers/main.yml delete mode 100644 pad-proxy/tasks/main.yml delete mode 100644 pad-proxy/templates/etherpad.nginx.conf delete mode 100644 pad-proxy/templates/wikimedia.etherpad.nginx.conf (limited to 'pad-proxy') diff --git a/pad-proxy/defaults/main.yml b/pad-proxy/defaults/main.yml deleted file mode 100644 index c548560..0000000 --- a/pad-proxy/defaults/main.yml +++ /dev/null @@ -1 +0,0 @@ -etherpad_server_name: pad.emacsconf.org diff --git a/pad-proxy/handlers/main.yml b/pad-proxy/handlers/main.yml deleted file mode 100644 index e01a9d0..0000000 --- a/pad-proxy/handlers/main.yml +++ /dev/null @@ -1,5 +0,0 @@ -- name: Restart etherpad - become: true - service: - name: etherpad - state: restarted diff --git a/pad-proxy/tasks/main.yml b/pad-proxy/tasks/main.yml deleted file mode 100644 index d47573a..0000000 --- a/pad-proxy/tasks/main.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -- name: Set up Nginx as root - become: true - block: - - name: Install Nginx - apt: - name: nginx - state: present - - name: Add proxy configuration - template: - src: etherpad.nginx.conf - dest: /etc/nginx/sites-available/etherpad.conf - when: not use_wikimedia - - name: Add rewrite configuration - template: - src: wikimedia.etherpad.nginx.conf - dest: /etc/nginx/sites-available/etherpad.conf - when: use_wikimedia - - name: Enable site - file: - src: /etc/nginx/sites-available/etherpad.conf - dest: /etc/nginx/sites-enabled/etherpad.conf - state: link - - name: Restart nginx - service: - name: nginx - state: restarted diff --git a/pad-proxy/templates/etherpad.nginx.conf b/pad-proxy/templates/etherpad.nginx.conf deleted file mode 100644 index 92ba974..0000000 --- a/pad-proxy/templates/etherpad.nginx.conf +++ /dev/null @@ -1,33 +0,0 @@ -upstream etherpad_upstream { - server 127.0.0.1:9001; -} - -server { - listen 80; - server_name {{ etherpad_server_name }}; - access_log /var/log/nginx/{{ etherpad_server_name }}.access.log; - location ~ ^/(locales/|locales.json|admin/|static/|pluginfw/|javascripts/|socket.io/|ep/|minified/|api/|ro/|error/|jserror/|favicon.ico|robots.txt) { - proxy_buffering off; - proxy_pass http://etherpad_upstream; - } - location /p/ { - rewrite ^/p/(.*) /$1 redirect; - } - location ~ ^/$ { - proxy_buffering off; - proxy_pass http://etherpad_upstream; - } - location ~ ^/pad-lister($|\/.*) { - proxy_buffering off; - proxy_pass http://etherpad_upstream; - } - location / { - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_pass http://etherpad_upstream/p/; - proxy_redirect / /p/; - proxy_read_timeout 90; - } -} diff --git a/pad-proxy/templates/wikimedia.etherpad.nginx.conf b/pad-proxy/templates/wikimedia.etherpad.nginx.conf deleted file mode 100644 index 2288c65..0000000 --- a/pad-proxy/templates/wikimedia.etherpad.nginx.conf +++ /dev/null @@ -1,33 +0,0 @@ -upstream etherpad_upstream { - server 127.0.0.1:9001; -} -server { - listen 80; - server_name {{ etherpad_server_name }}; - access_log /var/log/nginx/{{ etherpad_server_name }}.access.log; - location /p/ { - rewrite ^/p/(.*) /$1 redirect; - } - location ~ ^/$ { - return 302 https://etherpad.wikimedia.org/p/emacsconf-2022; - } - location ~ ^/(locales/|locales.json|admin/|static/|pluginfw/|javascripts/|socket.io/|ep/|minified/|api/|ro/|error/|jserror/|favicon.ico|robots.txt) { - proxy_buffering off; - proxy_pass http://etherpad_upstream; - } - location ~ ^/pad-lister($|\/.*) { - proxy_buffering off; - proxy_pass http://etherpad_upstream; - } - location /direct/ { - rewrite /direct/(.*) /$1 break; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_pass http://etherpad_upstream/p/; - } - location / { - rewrite /(.*) https://etherpad.wikimedia.org/p/emacsconf-$1 redirect; - } -} -- cgit v1.2.3