Changed CSP, added handler to restart systemd service when config has

changed
main
Leo Maroni 2 years ago
parent 83f05276d3
commit 9df348b77b
Signed by: em0lar
GPG Key ID: B1ADA545CD2CBACD
  1. 5
      handlers/main.yml
  2. 2
      tasks/main.yml
  3. 82
      templates/config.json.j2

@ -0,0 +1,5 @@
---
- name: restart systemd service
systemd:
name: "codimd.service"
state: restarted

@ -48,6 +48,7 @@
dest: "{{ codimd_base_path }}/config.json"
owner: "{{ codimd_user }}"
group: "{{ codimd_group }}"
notify: restart systemd service
- name: Upload .sequelizerc
template:
@ -55,6 +56,7 @@
dest: "{{ codimd_base_path }}/.sequelizerc"
owner: "{{ codimd_user }}"
group: "{{ codimd_group }}"
notify: restart systemd service
- name: Upload codimd.service
template:

@ -1,38 +1,48 @@
{
"production": {
"loglevel": "{{ codimd_loglevel | default('warning') }}",
"imageUploadType": "filesystem",
"allowPDFExport": "{{ codimd_allow_pdf_export | default(true) }}",
"db": {
"username": "{{ codimd_db_username }}",
"password": "{{ codimd_db_password }}",
"database": "{{ codimd_db_database }}",
"host": "{{ codimd_db_host }}",
"port": "{{ codimd_db_port }}",
"dialect": "{{ codimd_db_dialect }}"
},
"tmpPath": "/tmp/",
"docsPath": "./public/docs",
"viewPath": "./public/views",
"uploadsPath": "./public/uploads",
"domain": "{{ codimd_domain }}",
"port": "{{ codimd_port }}",
"protocolUseSSL": true,
"urlAddPort": false,
"allowOrigin": "{{ codimd_allowed_origins }}",
"hsts": {
"enable": "{{ codimd_hsts_enable | default(false) }}",
"maxAgeSeconds": 31536000,
"includeSubDomains": true,
"preload": true
},
"allowAnonymous": "{{ codimd_allow_anonymous | default(true) }}",
"allowAnonymousEdits": "{{ codimd_allow_anonymous_edits | default(true) }}",
"allowFreeURL": "{{ codimd_allow_free_url | default(true) }}",
"defaultPermission": "editable",
"sessionLife": 1209600000,
"sessionSecret": "{{ codimd_session_secret }}",
"email": true,
"allowEmailRegister": "{{ codimd_allow_email_register | default(true) }}"
}
"production": {
"loglevel": "{{ codimd_loglevel | default('warn') }}",
"imageUploadType": "filesystem",
"allowPDFExport": "{{ codimd_allow_pdf_export | default(true) }}",
"db": {
"username": "{{ codimd_db_username }}",
"password": "{{ codimd_db_password }}",
"database": "{{ codimd_db_database }}",
"host": "{{ codimd_db_host }}",
"port": "{{ codimd_db_port }}",
"dialect": "{{ codimd_db_dialect }}"
},
"tmpPath": "/tmp/",
"docsPath": "./public/docs",
"viewPath": "./public/views",
"uploadsPath": "./public/uploads",
"domain": "{{ codimd_domain }}",
"port": "{{ codimd_port }}",
"protocolUseSSL": true,
"urlAddPort": false,
"allowOrigin": "{{ codimd_allowed_origins }}",
"hsts": {
"enable": "{{ codimd_hsts_enable | default(false) }}",
"maxAgeSeconds": 31536000,
"includeSubDomains": true,
"preload": true
},
"csp": {
"enable": true,
"directives": {
"scriptSrc": "{{ codimd_domain }}",
"styleSrc": "{{ codimd_domain }}",
"fontSrc": "{{ codimd_domain }}"
},
"upgradeInsecureRequests": "auto",
"addDefaults": "{{ codimd_csp_enable | default(true) }}"
},
"allowAnonymous": "{{ codimd_allow_anonymous | default(true) }}",
"allowAnonymousEdits": "{{ codimd_allow_anonymous_edits | default(true) }}",
"allowFreeURL": "{{ codimd_allow_free_url | default(true) }}",
"defaultPermission": "editable",
"sessionLife": 1209600000,
"sessionSecret": "{{ codimd_session_secret }}",
"email": true,
"allowEmailRegister": "{{ codimd_allow_email_register | default(true) }}"
}
}

Loading…
Cancel
Save