Added cryptpad role

This commit is contained in:
2021-01-05 13:53:15 +01:00
parent 6de3c4633f
commit d398c22b56
14 changed files with 115 additions and 0 deletions

View File

@ -0,0 +1,24 @@
---
- name: copy config
copy:
remote_src: yes
src: ~/cryptpad/config/config.example.js
dest: ~/cryptpad/config/config.js
- name: update config
block:
- name: set domain as safe origin
lineinfile:
path: ~/cryptpad/config/config.js
regex: '/?/?httpSafeOrigin'
line: "httpSafeOrigin: 'https://{{ domain }}',"
- name: set http address
lineinfile:
path: ~/cryptpad/config/config.js
regex: '/?/?httpAddress'
line: "httpAddress: '::',"
- name: change email address
lineinfile:
path: ~/cryptpad/config/config.js
regex: 'adminEmail'
line: 'adminEmail: {{ cryptpad_email }},'

View File

@ -0,0 +1,8 @@
---
- name: download cryptpad
git:
dest: ~/cryptpad
repo: https://github.com/xwiki-labs/cryptpad.git
version: "{{ cryptpad_version }}"
depth: 1
accept_hostkey: yes

View File

@ -0,0 +1,11 @@
---
- include: download.yml
- include: npm.yml
- include: config.yml
- include: service.yml
- name: list web backends
command: uberspace web backend list
register: web_backends
- name: set up web backend
command: uberspace web backend set / --http --port 3000
when: web_backends.stdout.find('http:3000') == -1

View File

@ -0,0 +1,12 @@
---
- name: install bower
community.general.npm:
name: bower
global: yes
- name: install npm dependencies
community.general.npm:
path: ~/cryptpad
- name: install bower dependencies
community.general.bower:
path: ~/cryptpad
relative_execpath: ~/lib/node_modules/bower/bin

View File

@ -0,0 +1,9 @@
---
- name: create service
template:
src: cryptpad_service.j2
dest: ~/etc/services.d/cryptpad.ini
mode: 0644
notify:
- reload supervisorctl
- update supervisorctl