les 3 years ago
parent
commit
04bd584e84

+ 2 - 3
roles/stable/etherpad/defaults/main.yml

@@ -4,8 +4,8 @@ favicon: "favicon.ico"
 listen_ip: "0.0.0.0"
 listen_ip: "0.0.0.0"
 listen_port: "8001"
 listen_port: "8001"
 log_level: "INFO"
 log_level: "INFO"
-database_password: "{{lookup('community.general.passwordstore', '{{passwordstore_path}}/etherpad/db_password create=True nosymbols=true')}}"
-pad_admin_password: "{{lookup('community.general.passwordstore', '{{passwordstore_path}}/etherpad/admin_password create=True nosymbols=true')}}"
+database_password: "{{lookup('community.general.passwordstore', '{{passwordstore_path}}/etherpad_{{ansible_hostname}}/db_password create=True nosymbols=true')}}"
+pad_admin_password: "{{lookup('community.general.passwordstore', '{{passwordstore_path}}/etherpad_{{ansible_hostname}}/admin_password create=True nosymbols=true')}}"
 
 
 plugins: ['ep_headings2', 'ep_table_of_contents', 'ep_comments_page', 'ep_align', 'ep_delete_after_delay_lite']
 plugins: ['ep_headings2', 'ep_table_of_contents', 'ep_comments_page', 'ep_align', 'ep_delete_after_delay_lite']
 
 
@@ -15,4 +15,3 @@ pad_default_text: |
   Welcome to Etherpad!
   Welcome to Etherpad!
   This pad text is synchronized as you type, so that everyone viewing this page sees the same text. 
   This pad text is synchronized as you type, so that everyone viewing this page sees the same text. 
   This allows you to collaborate seamlessly on documents!
   This allows you to collaborate seamlessly on documents!
-  Get involved with Etherpad at

+ 0 - 22
roles/stable/etherpad/tasks/postgresql.yml

@@ -1,22 +0,0 @@
----
-- name: Install postgresql
-  apt:
-    pkg:
-      - postgresql
-      - python3-psycopg2
-
-- name: Create etherpad postgresql db
-  become: yes
-  become_user: postgres
-  postgresql_db:
-    name: etherpad
-
-- name: Create etherpad postgresql user
-  become: yes
-  become_user: postgres
-  postgresql_user:
-    db: etherpad
-    name: etherpad
-    password: etherpad
-
-

+ 11 - 6
roles/stable/nginx/templates/reverse_proxy.conf.j2

@@ -9,8 +9,6 @@ server {
 
 
   location / {
   location / {
     proxy_pass {{item.proxy_pass}};
     proxy_pass {{item.proxy_pass}};
-    proxy_http_version 1.1;
-
 
 
     # set host
     # set host
     proxy_set_header Host              $host;
     proxy_set_header Host              $host;
@@ -19,10 +17,17 @@ server {
     proxy_set_header X-Forwarded-Host  $host;
     proxy_set_header X-Forwarded-Host  $host;
     proxy_set_header X-Forwarded-Port  $server_port;
     proxy_set_header X-Forwarded-Port  $server_port;
 
 
-    # upgrade websocket
-    proxy_set_header Upgrade           $http_upgrade;
-    proxy_set_header Connection        "upgrade";
-
+    # websocket proxy
+    proxy_http_version 1.1;
+    proxy_set_header Upgrade $http_upgrade;
+    proxy_set_header Connection "upgrade";    
+
+    # compression
+    gzip on;
+    gzip_types      text/plain application/xml application/json;
+    gzip_proxied    no-cache no-store private expired auth;
+    gzip_min_length 1000;
+    
     # cache
     # cache
     proxy_cache STATIC;
     proxy_cache STATIC;
   }
   }

+ 3 - 0
roles/stable/nodejs/tasks/main.yml

@@ -7,6 +7,7 @@
   when: nodejs_install_npm_user is not defined
   when: nodejs_install_npm_user is not defined
 
 
 - name: Create npm global directory
 - name: Create npm global directory
+  become: yes
   file:
   file:
     path: "{{ npm_config_prefix }}"
     path: "{{ npm_config_prefix }}"
     owner: "{{ nodejs_install_npm_user }}"
     owner: "{{ nodejs_install_npm_user }}"
@@ -14,12 +15,14 @@
     state: directory
     state: directory
 
 
 - name: Add npm_config_prefix bin directory to global $PATH.
 - name: Add npm_config_prefix bin directory to global $PATH.
+  become: yes
   template:
   template:
     src: npm.sh.j2
     src: npm.sh.j2
     dest: /etc/profile.d/npm.sh
     dest: /etc/profile.d/npm.sh
     mode: 0644
     mode: 0644
 
 
 - name: Ensure npm global packages are installed.
 - name: Ensure npm global packages are installed.
+  become: yes
   npm:
   npm:
     name: "{{ item.name | default(item) }}"
     name: "{{ item.name | default(item) }}"
     version: "{{ item.version | default('latest') }}"
     version: "{{ item.version | default('latest') }}"

+ 8 - 1
roles/stable/nodejs/tasks/setup.yml

@@ -1,5 +1,6 @@
 ---
 ---
 - name: Ensure dependencies are present.
 - name: Ensure dependencies are present.
+  become: yes
   apt:
   apt:
     name:
     name:
       - apt-transport-https
       - apt-transport-https
@@ -8,12 +9,14 @@
     state: present
     state: present
 
 
 - name: Add Nodesource apt key.
 - name: Add Nodesource apt key.
+  become: yes
   apt_key:
   apt_key:
     url: https://keyserver.ubuntu.com/pks/lookup?op=get&fingerprint=on&search=0x1655A0AB68576280
     url: https://keyserver.ubuntu.com/pks/lookup?op=get&fingerprint=on&search=0x1655A0AB68576280
     id: "68576280"
     id: "68576280"
     state: present
     state: present
 
 
 - name: Add NodeSource repositories for Node.js.
 - name: Add NodeSource repositories for Node.js.
+  become: yes
   apt_repository:
   apt_repository:
     repo: "{{ item }}"
     repo: "{{ item }}"
     state: present
     state: present
@@ -23,11 +26,15 @@
   register: node_repo
   register: node_repo
 
 
 - name: Update apt cache if repo was added.
 - name: Update apt cache if repo was added.
-  apt: update_cache=yes
+  become: yes
+  apt:
+    update_cache: true
+    cache_valid_time: 43200   # 12 hours
   when: node_repo.changed
   when: node_repo.changed
   tags: ['skip_ansible_lint']
   tags: ['skip_ansible_lint']
 
 
 - name: Ensure Node.js and npm are installed.
 - name: Ensure Node.js and npm are installed.
+  become: yes
   apt:
   apt:
     name: "nodejs={{ nodejs_version|regex_replace('x', '') }}*"
     name: "nodejs={{ nodejs_version|regex_replace('x', '') }}*"
     state: present
     state: present

+ 1 - 0
roles/stable/postgresql/tasks/main.yml

@@ -1,5 +1,6 @@
 ---
 ---
 - name: Install postgresql
 - name: Install postgresql
+  become: yes
   apt:
   apt:
     pkg:
     pkg:
       - acl
       - acl

+ 4 - 4
vars/etherpad.yml

@@ -2,15 +2,15 @@
   title: "Pad@cisti"
   title: "Pad@cisti"
   pad_lang: "it-IT"
   pad_lang: "it-IT"
   pad_default_text: |
   pad_default_text: |
-    Sei su pad.cisti.org! Qui potrai usare usare PAD.
-    Un PAD è uno strumento di scrittura collaborativa per scrivere testi, comunicati o quello che vuoi assieme ad altre persone!
+    Sei sul pad di cisti.org!
+    Un PAD è uno strumento di scrittura collaborativa per scrivere testi, comunicati o quello che vuoi assieme ad altre persone.
     Questo è uno dei servizi di cisti.org, fuori dalle logiche del profitto e del capitalismo, dietro ci sono un gruppo di persone volontarie che si responsabilizzano a mantenere in piedi tutto questo.
     Questo è uno dei servizi di cisti.org, fuori dalle logiche del profitto e del capitalismo, dietro ci sono un gruppo di persone volontarie che si responsabilizzano a mantenere in piedi tutto questo.
 
 
     ALCUNE COSE DA SAPERE:
     ALCUNE COSE DA SAPERE:
     - Per iniziare cancella tutto questo testo e inizia a scrivere!
     - Per iniziare cancella tutto questo testo e inizia a scrivere!
     - Ogni pad può essere modificato da CHIUNQUE sia in possesso del sito (URL) o che possa indovinarlo facilmente, quindi scegli bene il nome del pad che vuoi creare!
     - Ogni pad può essere modificato da CHIUNQUE sia in possesso del sito (URL) o che possa indovinarlo facilmente, quindi scegli bene il nome del pad che vuoi creare!
-    - Questo pad verrà eliminato automaticamente dopo 60 giorni di inattività
-    - Una volta cancellato un pad NON ci sono modi di recuperarlo!
+    - Questo pad verrà eliminato automaticamente dopo 60 giorni di inattività.
+    - Una volta cancellato un pad NON ci sono modi di recuperarlo.
     - Questo pad ci tiene così tanto alla privacy che non sappiamo neanche chi sei, rispetta l'anonimato e usalo bene.
     - Questo pad ci tiene così tanto alla privacy che non sappiamo neanche chi sei, rispetta l'anonimato e usalo bene.
 
 
 
 

+ 1 - 1
vars/frontend.yml

@@ -4,7 +4,7 @@ certbot_email: info@cisti.org
 servers:
 servers:
   - cicles:
   - cicles:
     server_name: antani.cisti.org
     server_name: antani.cisti.org
-    proxy_pass: http://192.168.199.105:8080
+    proxy_pass: http://localhost:8001
     custom_config: |
     custom_config: |
       sendfile             on;
       sendfile             on;
       client_max_body_size 500m;
       client_max_body_size 500m;