update to 2.2.6 + add vars (#37)

Co-authored-by: muppeth <muppeth@disroot.org>
Reviewed-on: #37
Reviewed-by: muppeth <muppeth@no-reply@disroot.org>
Co-authored-by: meaz <meaz@disroot.org>
Co-committed-by: meaz <meaz@disroot.org>
This commit is contained in:
meaz 2024-11-24 08:04:26 +01:00 committed by meaz
parent 22a0b7c5c1
commit e97e94590d
13 changed files with 163 additions and 129 deletions

6
.ansible-lint Normal file
View file

@ -0,0 +1,6 @@
skip_list:
- fqcn-builtins
- fqcn[action]
- fqcn[action-core]
- fqcn[canonical]
- name[casing]

View file

@ -1,15 +1,15 @@
--- ---
etherpad_version: '2.2.5' etherpad_version: '2.2.6'
etherpad_skin: 'colibris' etherpad_skin: 'colibris'
etherpad_skinVariants: 'super-light-toolbar super-light-editor light-background' etherpad_skin_variants: 'super-light-toolbar super-light-editor light-background'
etherpad_username: 'etherpad' etherpad_username: 'etherpad'
etherpad_group: 'etherpad' etherpad_group: 'etherpad'
etherpad_app_dir: '/var/www/etherpad-lite' etherpad_app_dir: '/var/www/etherpad-lite'
etherpad_instance_name: 'pads' etherpad_instance_name: 'pads'
etherpad_listen_ip: '0.0.0.0' etherpad_listen_ip: '0.0.0.0'
etherpad_listen_port: '9001' etherpad_listen_port: '9001'
etherpad_db_type: '0' #an integer. 0 or unset for mysql, 1 for postgres etherpad_db_type: '0' # an integer. 0 or unset for mysql, 1 for postgres
etherpad_db_user: 'etherpad' etherpad_db_user: 'etherpad'
etherpad_db_host: 'localhost' etherpad_db_host: 'localhost'
etherpad_db_passwd: 'changeme' etherpad_db_passwd: 'changeme'
@ -19,33 +19,36 @@ etherpad_welcome_text: 'Welcome to Etherpad!\n\nThis pad text is synchronized as
etherpad_group_only: 'false' etherpad_group_only: 'false'
etherpad_editonly: 'false' etherpad_editonly: 'false'
etherpad_minify: 'true' etherpad_minify: 'true'
etherpad_showSettingsInAdminPage: 'true' etherpad_show_settings_in_admin_page: 'true'
etherpad_suppressErrorsInPadText: 'false' etherpad_cleanup_enabled: 'false'
etherpad_allowUnknownFileEnds: 'true' etherpad_cleanup_keep_revisions: '5'
etherpad_automaticReconnectionTimeout: '0' etherpad_suppress_errors_in_pad_text: 'false'
etherpad_indentationOnNewLine: 'false' etherpad_allow_unknown_file_ends: 'true'
etherpad_importExportRateLimitingwindowMs: '90000' etherpad_automatic_reconnection_timeout: '0'
etherpad_importExportRateLimitingMax: '10' etherpad_indentation_on_new_line: 'false'
etherpad_importMaxFileSize: '52428800' # 50 MB -> 50 * 1024 * 1024 etherpad_import_export_rate_limiting_window_ms: '90000'
etherpad_import_export_rate_limiting_max: '10'
etherpad_import_max_file_size: '52428800' # 50 MB -> 50 * 1024 * 1024
etherpad_authmethod: 'sso' etherpad_authmethod: 'sso'
etherpad_exposeVersion: 'false' etherpad_expose_version: 'false'
etherpad_js_maxage: '21600' etherpad_js_maxage: '21600'
etherpad_max_log_size: '1024' etherpad_max_log_size: '1024'
etherpad_abiword: '/usr/bin/abiword' etherpad_abiword: '/usr/bin/abiword'
etherpad_auth: 'false' etherpad_auth: 'false'
etherpad_authorization: 'false' etherpad_authorization: 'false'
etherpad_proxy: 'false' etherpad_proxy: 'false'
etherpad_sessionLifetime: '864000000' #10d etherpad_session_lifetime: '864000000' # 10 days
etherpad_sessionRefreshInterval: '86400000' #1d etherpad_session_refresh_interval: '86400000' # 1 day
etherpad_ip_logging: 'false' etherpad_ip_logging: 'false'
etherpad_maxHttpBufferSize: '10000' etherpad_max_http_buffer_size: '10000'
etherpad_enableAdminUITests: 'false' etherpad_log_layout_type: 'colored'
etherpad_enable_admin_ui_tests: 'false'
etherpad_admin_pwd: 'changeme' etherpad_admin_pwd: 'changeme'
etherpad_ratelimit_duration: '1' etherpad_ratelimit_duration: '1'
etherpad_ratelimit_points: '100' etherpad_ratelimit_points: '100'
etherpad_loglevel: 'INFO' etherpad_loglevel: 'INFO'
etherpad_logfile: '/var/log/etherpad-lite.log' etherpad_logfile: '/var/log/etherpad-lite.log'
etherpad_dumpOnUncleanExit: 'false' etherpad_dump_on_unclean_exit: 'false'
etherpad_error_log_recipient: 'support@example.com' etherpad_error_log_recipient: 'support@example.com'
etherpad_smtp_host: 'localhost' etherpad_smtp_host: 'localhost'
etherpad_smtp_port: '587' etherpad_smtp_port: '587'
@ -59,7 +62,6 @@ etherpad_apt:
nodejs_version: '21' nodejs_version: '21'
etherpad_admin_page: 'true' # set to something else if you don't want to build admin page etherpad_admin_page: 'true' # set to something else if you don't want to build admin page
etherpad_plugins_list: # set to "removed" if you want to remove à plugin etherpad_plugins_list: # set to "removed" if you want to remove à plugin
ep_adminpads2: enabled ep_adminpads2: enabled
ep_comments_page: enabled ep_comments_page: enabled
@ -81,11 +83,11 @@ etherpad_plugins_list: # set to "removed" if you want to remove à plugin
# ep_delete_after_delay # ep_delete_after_delay
# Etherpad-Lite plugin that deletes your pads after a configured delay # Etherpad-Lite plugin that deletes your pads after a configured delay
delay: '7776000' # one day, in seconds Default is 86400 ep_delafter_delay: '7776000' # one day, in seconds Default is 86400
loopdeletion: 'true' ep_delafter_loopdeletion: 'true'
loopDelay: '86400' # one hour, in seconds Default is 3600 ep_delafter_loopdelay: '86400' # one hour, in seconds Default is 3600
deleteAtStart: 'true' ep_delafter_delete_at_start: 'true'
text: "The content of this pad has been deleted since it was older than the configured delay." ep_delafter_text: "The content of this pad has been deleted since it was older than the configured delay."
# MARIADB CONFIG # MARIADB CONFIG
mariadb_databases: mariadb_databases:

View file

@ -1,6 +1,6 @@
--- ---
- name: restart etherpad - name: 'Restart etherpad'
systemd: systemd:
name: etherpad name: 'etherpad'
state: restarted state: 'restarted'

View file

@ -2,6 +2,6 @@
- name: '[LIBRE-OFFICE] - Install Abiword' - name: '[LIBRE-OFFICE] - Install Abiword'
apt: apt:
name: abiword name: 'abiword'
state: present state: 'present'
update_cache: yes update_cache: true

View file

@ -2,20 +2,22 @@
- name: '[CONFIGURE] - Create log file' - name: '[CONFIGURE] - Create log file'
file: file:
path: "{{ etherpad_logfile }}" path: '{{ etherpad_logfile }}'
state: touch state: 'touch'
owner: "{{ etherpad_username }}" owner: '{{ etherpad_username }}'
group: "{{ etherpad_group }}" group: '{{ etherpad_group }}'
mode: 0755 mode: '0755'
tags: config tags:
- 'config'
- name: '[CONFIGURE] - Deploy config' - name: '[CONFIGURE] - Deploy config'
template: template:
src: var/www/etherpad-lite/settings.json.j2 src: 'var/www/etherpad-lite/settings.json.j2'
dest: "{{ etherpad_app_dir }}/app/settings.json" dest: '{{ etherpad_app_dir }}/app/settings.json'
owner: "{{ etherpad_username }}" owner: '{{ etherpad_username }}'
group: "{{ etherpad_group }}" group: '{{ etherpad_group }}'
mode: 0644 mode: '0644'
notify: notify:
restart etherpad - 'Restart etherpad'
tags: config tags:
- 'config'

View file

@ -2,19 +2,20 @@
- name: '[GIT] - Create directory' - name: '[GIT] - Create directory'
file: file:
path: "/var/www/" path: '/var/www/'
state: directory state: 'directory'
owner: "{{ etherpad_username }}" owner: '{{ etherpad_username }}'
group: "{{ etherpad_group }}" group: '{{ etherpad_group }}'
mode: 0755 mode: '0755'
- name: '[GIT] - Deploy source' - name: '[GIT] - Deploy source'
git: git:
repo: https://github.com/ether/etherpad-lite.git repo: 'https://github.com/ether/etherpad-lite.git'
dest: "{{ etherpad_app_dir }}/app" dest: '{{ etherpad_app_dir }}/app'
force: yes force: true
update: yes update: true
version: "{{ etherpad_version }}" version: '{{ etherpad_version }}'
become: true become: true
become_user: "{{ etherpad_username }}" become_user: '{{ etherpad_username }}'
notify: restart etherpad notify:
- 'Restart etherpad'

View file

@ -1,18 +1,18 @@
--- ---
- name: '[INSTALL] - Install with pnpm' - name: '[INSTALL] - Install with pnpm'
shell: command:
cmd: pnpm install cmd: 'pnpm install'
args: args:
chdir: "{{ etherpad_app_dir }}/app" chdir: '{{ etherpad_app_dir }}/app'
become: yes become: true
become_user: "{{ etherpad_username }}" become_user: '{{ etherpad_username }}'
- name: '[INSTALL] - Build admin pages with pnpm' - name: '[INSTALL] - Build admin pages with pnpm'
shell: command:
cmd: pnpm run build cmd: 'pnpm run build'
args: args:
chdir: "{{ etherpad_app_dir }}/app/admin" chdir: '{{ etherpad_app_dir }}/app/admin'
become: yes become: true
become_user: "{{ etherpad_username }}" become_user: '{{ etherpad_username }}'
when: etherpad_admin_page == "true" when: etherpad_admin_page == 'true'

View file

@ -2,11 +2,10 @@
- name: '[INSTALLDEPS] - Install dependencies' - name: '[INSTALLDEPS] - Install dependencies'
apt: apt:
name: "{{ etherpad_apt }}" name: '{{ etherpad_apt }}'
update_cache: yes update_cache: true
state: latest
- name: '[INSTALLDEPS] - Install pnpm' - name: '[INSTALLDEPS] - Install pnpm'
npm: npm:
name: pnpm name: 'pnpm'
global: true global: true

View file

@ -1,28 +1,28 @@
--- ---
- name: Install dependencies - name: 'Install dependencies'
include_tasks: installdeps.yml include_tasks: installdeps.yml
- name: Add user - name: 'Add user'
include_tasks: user.yml include_tasks: user.yml
- name: Clone / Update GIT - name: 'Clone / Update GIT'
include_tasks: git.yml include_tasks: git.yml
- name: Deploy configuration - name: 'Deploy configuration'
include_tasks: configure.yml include_tasks: configure.yml
tags: config tags: config
- name: Use abiword - name: 'Use abiword'
include_tasks: abiword.yml include_tasks: abiword.yml
when: etherpad_abiword != 'null' when: etherpad_abiword != 'null'
- name: Install etherpad - name: 'Install etherpad'
include_tasks: install.yml include_tasks: install.yml
- name: Install Modules - name: 'Install Modules'
include_tasks: modules.yml include_tasks: modules.yml
tags: modules tags: modules
- name: Systemd - name: 'Systemd'
include_tasks: systemd.yml include_tasks: systemd.yml

View file

@ -4,25 +4,27 @@
# selects only the enabled plugins # selects only the enabled plugins
# then uses filter to get all plugins names in one line, without comas or quotes as needed for npm # then uses filter to get all plugins names in one line, without comas or quotes as needed for npm
- name: '[Modules] - Install modules' - name: '[Modules] - Install modules'
shell: command:
cmd: "pnpm run install-plugins {{ etherpad_plugins_list| dict2items | selectattr('value', 'eq', 'enabled') | map(attribute='key') |join(',') | replace(\",\", \" \") }}" cmd: "pnpm run install-plugins {{ etherpad_plugins_list | dict2items | selectattr('value', 'eq', 'enabled') | map(attribute='key') | join(',') | replace(\",\", \" \") }}"
args: args:
chdir: "{{ etherpad_app_dir }}/app" chdir: '{{ etherpad_app_dir }}/app'
become: yes become: true
become_user: "{{ etherpad_username }}" become_user: '{{ etherpad_username }}'
when: etherpad_plugins_list| dict2items | selectattr('value', 'eq', 'enabled') |length > 0 when: etherpad_plugins_list| dict2items | selectattr('value', 'eq', 'enabled') |length > 0
notify: notify:
restart etherpad - 'Restart etherpad'
tags: modules tags:
- 'modules'
- name: '[Modules] - Remove modules' - name: '[Modules] - Remove modules'
shell: command:
cmd: "pnpm run plugins rm {{ etherpad_plugins_list| dict2items | selectattr('value', 'eq', 'removed') | map(attribute='key') |join(',') | replace(\",\", \" \") }}" cmd: "pnpm run plugins rm {{ etherpad_plugins_list | dict2items | selectattr('value', 'eq', 'removed') | map(attribute='key') | join(',') | replace(\",\", \" \") }}"
args: args:
chdir: "{{ etherpad_app_dir }}/app" chdir: '{{ etherpad_app_dir }}/app'
become: yes become: true
become_user: "{{ etherpad_username }}" become_user: '{{ etherpad_username }}'
when: etherpad_plugins_list| dict2items | selectattr('value', 'eq', 'removed') |length > 0 when: etherpad_plugins_list| dict2items | selectattr('value', 'eq', 'removed') |length > 0
notify: notify:
restart etherpad - 'Restart etherpad'
tags: modules tags:
- 'modules'

View file

@ -2,18 +2,17 @@
- name: '[SYSTEMD] - Deploy Systemd config' - name: '[SYSTEMD] - Deploy Systemd config'
template: template:
src: etc/systemd/system/etherpad.service.j2 src: 'etc/systemd/system/etherpad.service.j2'
dest: /etc/systemd/system/etherpad.service dest: '/etc/systemd/system/etherpad.service'
owner: root owner: 'root'
group: root group: 'root'
mode: 0644 mode: '0644'
register: etherpad_systemd
- name: '[SYSTEMD] - Enable systemd' - name: '[SYSTEMD] - Enable systemd'
systemd: systemd:
name: etherpad name: 'etherpad'
enabled: yes enabled: true
state: started state: 'started'
daemon_reload: yes daemon_reload: true
notify: notify:
restart etherpad - 'Restart etherpad'

View file

@ -3,20 +3,20 @@
- name: '[USER] - Add group' - name: '[USER] - Add group'
group: group:
name: '{{ etherpad_group }}' name: '{{ etherpad_group }}'
state: present state: 'present'
- name: '[USER] - Add user' - name: '[USER] - Add user'
user: user:
name: '{{ etherpad_username }}' name: '{{ etherpad_username }}'
shell: /bin/bash shell: '/bin/bash'
group: '{{ etherpad_group }}' group: '{{ etherpad_group }}'
home: '{{ etherpad_app_dir }}' home: '{{ etherpad_app_dir }}'
state: present state: 'present'
- name: '[USER] - Change ownership to etherpad user' - name: '[USER] - Change ownership to etherpad user'
file: file:
path: '{{ etherpad_app_dir }}' path: '{{ etherpad_app_dir }}'
owner: '{{ etherpad_username }}' owner: '{{ etherpad_username }}'
group: '{{ etherpad_group }}' group: '{{ etherpad_group }}'
state: directory state: 'directory'
recurse: yes recurse: true

View file

@ -140,7 +140,7 @@
* "full-width-editor" variant (by default editor is rendered as a page, with * "full-width-editor" variant (by default editor is rendered as a page, with
* a max-width of 900px). * a max-width of 900px).
*/ */
"skinVariants": "{{ etherpad_skinVariants }}", "skinVariants": "{{ etherpad_skin_variants }}",
/* /*
* IP and port which Etherpad should bind at. * IP and port which Etherpad should bind at.
@ -160,7 +160,15 @@
* *
* Default option is set to true * Default option is set to true
*/ */
"showSettingsInAdminPage": {{ etherpad_showSettingsInAdminPage }}, "showSettingsInAdminPage": {{ etherpad_show_settings_in_admin_page }},
/*
* Settings for cleanup of pads
*/
"cleanup": {
"enabled": {{ etherpad_cleanup_enabled }},
"keepRevisions": {{ etherpad_cleanup_keep_revisions }}
},
/* /*
* Node native SSL support * Node native SSL support
@ -270,10 +278,17 @@
"pageDown": true "pageDown": true
}, },
/*
* Enables the use of a different server. We have a different one that syncs changes from the original server.
* It is hosted on GitHub and should not be blocked by many firewalls.
* https://etherpad.org/ep_infos
"updateServer": "https://etherpad.org/ep_infos",
*/
/* /*
* Should we suppress errors from being visible in the default Pad Text? * Should we suppress errors from being visible in the default Pad Text?
*/ */
"suppressErrorsInPadText": {{ etherpad_suppressErrorsInPadText }}, "suppressErrorsInPadText": {{ etherpad_suppress_errors_in_pad_text }},
/* /*
* If this option is enabled, a user must have a session to access pads. * If this option is enabled, a user must have a session to access pads.
@ -326,7 +341,7 @@
* Allow import of file types other than the supported ones: * Allow import of file types other than the supported ones:
* txt, doc, docx, rtf, odt, html & htm * txt, doc, docx, rtf, odt, html & htm
*/ */
"allowUnknownFileEnds": {{ etherpad_allowUnknownFileEnds }}, "allowUnknownFileEnds": {{ etherpad_allow_unknown_file_ends }},
/* /*
* This setting is used if you require authentication of all users. * This setting is used if you require authentication of all users.
@ -408,7 +423,7 @@
* will delete the cookie when the browser exits, but a session record is * will delete the cookie when the browser exits, but a session record is
* kept in the database forever. * kept in the database forever.
*/ */
"sessionLifetime": {{ etherpad_sessionLifetime }}, // = 10d * 24h/d * 60m/h * 60s/m * 1000ms/s "sessionLifetime": {{ etherpad_session_lifetime }}, // = 10d * 24h/d * 60m/h * 60s/m * 1000ms/s
/* /*
* How long (in milliseconds) before the expiration time of an active user's * How long (in milliseconds) before the expiration time of an active user's
@ -426,7 +441,7 @@
* Automatic session refreshes can be disabled (not recommended) by setting * Automatic session refreshes can be disabled (not recommended) by setting
* this to null. * this to null.
*/ */
"sessionRefreshInterval": {{ etherpad_sessionRefreshInterval }} // = 1d * 24h/d * 60m/h * 60s/m * 1000ms/s "sessionRefreshInterval": {{ etherpad_session_refresh_interval }} // = 1d * 24h/d * 60m/h * 60s/m * 1000ms/s
}, },
/* /*
@ -440,7 +455,7 @@
* *
* Set to 0 to disable automatic reconnection. * Set to 0 to disable automatic reconnection.
*/ */
"automaticReconnectionTimeout": {{ etherpad_automaticReconnectionTimeout }}, "automaticReconnectionTimeout": {{ etherpad_automatic_reconnection_timeout }},
/* /*
* By default, when caret is moved out of viewport, it scrolls the minimum * By default, when caret is moved out of viewport, it scrolls the minimum
@ -527,11 +542,11 @@
{% for key, value in etherpad_plugins_list.items() %} {% for key, value in etherpad_plugins_list.items() %}
{% if key == "ep_delete_after_delay" and value == "enabled" %} {% if key == "ep_delete_after_delay" and value == "enabled" %}
"ep_delete_after_delay": { "ep_delete_after_delay": {
"delay": {{ delay }}, // one day, in seconds "delay": {{ ep_delafter_delay }}, // one day, in seconds
"loop": {{ loopdeletion }}, "loop": {{ ep_delafter_loopdeletion }},
"loopDelay": {{ loopDelay }}, // one hour, in seconds "loopDelay": {{ ep_delafter_loopdelay }}, // one hour, in seconds
"deleteAtStart": {{ deleteAtStart }}, "deleteAtStart": {{ ep_delafter_delete_at_start }},
"text": "{{ text }}" "text": "{{ ep_delafter_text }}"
}, },
{% endif %} {% endif %}
{% endfor %} {% endfor %}
@ -551,20 +566,21 @@
* value to work properly, but increasing the value increases susceptibility * value to work properly, but increasing the value increases susceptibility
* to denial of service attacks (malicious clients can exhaust memory). * to denial of service attacks (malicious clients can exhaust memory).
*/ */
"maxHttpBufferSize": {{ etherpad_maxHttpBufferSize }} "maxHttpBufferSize": {{ etherpad_max_http_buffer_size }}
}, },
/* /*
* Allow Load Testing tools to hit the Etherpad Instance. * Allow Load Testing tools to hit the Etherpad Instance.
* *
* WARNING: this will disable security on the instance. * WARNING: this will disable security on the instance./etherpad_logLayoutType
*/ */
"loadTest": false, "loadTest": false,
/** /**
* Disable dump of objects preventing a clean exit * Disable dump of objects preventing a clean exit
*/ */
"dumpOnUncleanExit": {{ etherpad_dumpOnUncleanExit }}, "dumpOnUncleanExit": {{ etherpad_dump_on_unclean_exit }},
/* /*
* Disable indentation on new line when previous line ends with some special * Disable indentation on new line when previous line ends with some special
@ -572,7 +588,7 @@
*/ */
/* /*
"indentationOnNewLine": {{ etherpad_indentationOnNewLine }}, "indentationOnNewLine": {{ etherpad_indentation_on_new_line }},
*/ */
/* /*
@ -586,10 +602,10 @@
*/ */
"importExportRateLimiting": { "importExportRateLimiting": {
// duration of the rate limit window (milliseconds) // duration of the rate limit window (milliseconds)
"windowMs": {{ etherpad_importExportRateLimitingwindowMs }}, "windowMs": {{ etherpad_import_export_rate_limiting_window_ms }},
// maximum number of requests per IP to allow during the rate limit window // maximum number of requests per IP to allow during the rate limit window
"max": {{ etherpad_importExportRateLimitingMax }} "max": {{ etherpad_import_export_rate_limiting_max }}
}, },
/* /*
@ -598,7 +614,7 @@
* *
* File size is specified in bytes. Default is 50 MB. * File size is specified in bytes. Default is 50 MB.
*/ */
"importMaxFileSize": {{ etherpad_importMaxFileSize }}, // 50 * 1024 * 1024 "importMaxFileSize": {{ etherpad_import_max_file_size }}, // 50 * 1024 * 1024
/* /*
The authentication method used by the server. The authentication method used by the server.
@ -653,7 +669,7 @@
* *
* Do not enable on production machines. * Do not enable on production machines.
*/ */
"exposeVersion": {{ etherpad_exposeVersion }}, "exposeVersion": {{ etherpad_expose_version }},
/* /*
* The log level we are using. * The log level we are using.
@ -662,11 +678,18 @@
*/ */
"loglevel": "{{ etherpad_loglevel }}", "loglevel": "{{ etherpad_loglevel }}",
/*
* The log layout type to use.
*
* Valid values: basic, colored
*/
"logLayoutType": "{{ etherpad_log_layout_type }}",
/* Override any strings found in locale directories */ /* Override any strings found in locale directories */
"customLocaleStrings": {}, "customLocaleStrings": {},
/* Disable Admin UI tests */ /* Disable Admin UI tests */
"enableAdminUITests": {{ etherpad_enableAdminUITests }}, "enableAdminUITests": {{ etherpad_enable_admin_ui_tests }},
/* /*
* Enable/Disable case-insensitive pad names. * Enable/Disable case-insensitive pad names.