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_port: "8001"
 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']
 
@@ -15,4 +15,3 @@ pad_default_text: |
   Welcome to Etherpad!
   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!
-  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 / {
     proxy_pass {{item.proxy_pass}};
-    proxy_http_version 1.1;
-
 
     # set host
     proxy_set_header Host              $host;
@@ -19,10 +17,17 @@ server {
     proxy_set_header X-Forwarded-Host  $host;
     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
     proxy_cache STATIC;
   }

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

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

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

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

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

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

+ 4 - 4
vars/etherpad.yml

@@ -2,15 +2,15 @@
   title: "Pad@cisti"
   pad_lang: "it-IT"
   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.
 
     ALCUNE COSE DA SAPERE:
     - 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!
-    - 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.
 
 

+ 1 - 1
vars/frontend.yml

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