diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-06-23 14:02:48 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-06-26 00:50:56 +0200 |
commit | 580bd7fc5d4b078f8dec2fd440e5989b5f963f61 (patch) | |
tree | 74538bdb1512615ce5ddc2a51090af5e3b7e4456 | |
parent | f568173a3d8a43ac30fa9294a75c260042b9e415 (diff) | |
download | Puppet-580bd7fc5d4b078f8dec2fd440e5989b5f963f61.tar.gz Puppet-580bd7fc5d4b078f8dec2fd440e5989b5f963f61.tar.zst Puppet-580bd7fc5d4b078f8dec2fd440e5989b5f963f61.zip |
Add json file
-rw-r--r-- | modules/role/manifests/etherpad.pp | 26 | ||||
-rw-r--r-- | modules/role/templates/etherpad/settings.json.erb | 93 |
2 files changed, 114 insertions, 5 deletions
diff --git a/modules/role/manifests/etherpad.pp b/modules/role/manifests/etherpad.pp index a43f146..109da96 100644 --- a/modules/role/manifests/etherpad.pp +++ b/modules/role/manifests/etherpad.pp | |||
@@ -1,6 +1,20 @@ | |||
1 | class role::etherpad ( | 1 | class role::etherpad ( |
2 | ) { | 2 | ) { |
3 | $password_seed = lookup("base_installation::puppet_pass_seed") | 3 | $password_seed = lookup("base_installation::puppet_pass_seed") |
4 | $web_host = lookup("base_installation::real_hostname") | ||
5 | $web_listen = "0.0.0.0" | ||
6 | $web_port = 18000 | ||
7 | $pg_db = "etherpad-lite" | ||
8 | $pg_user = "etherpad-lite" | ||
9 | $pg_password = generate_password(24, $password_seed, "postgres_etherpad") | ||
10 | |||
11 | $ldap_server = lookup("base_installation::ldap_server") | ||
12 | $ldap_base = lookup("base_installation::ldap_base") | ||
13 | $ldap_dn = lookup("base_installation::ldap_dn") | ||
14 | $ldap_account_pattern = "(&(memberOf=cn=users,cn=etherpad,ou=services,dc=immae,dc=eu)(uid={{username}}))" | ||
15 | $ldap_group_pattern = "(memberOf=cn=groups,cn=etherpad,ou=services,dc=immae,dc=eu)" | ||
16 | $ldap_password = generate_password(24, $password_seed, "ldap") | ||
17 | |||
4 | 18 | ||
5 | include "base_installation" | 19 | include "base_installation" |
6 | 20 | ||
@@ -16,6 +30,13 @@ class role::etherpad ( | |||
16 | -> patch::file { "/usr/share/etherpad-lite/src/node/utils/LibreOffice.js": | 30 | -> patch::file { "/usr/share/etherpad-lite/src/node/utils/LibreOffice.js": |
17 | diff_source => "puppet:///modules/role/etherpad/libreoffice_patch.diff", | 31 | diff_source => "puppet:///modules/role/etherpad/libreoffice_patch.diff", |
18 | } | 32 | } |
33 | -> file { "/etc/etherpad-lite/settings.json": | ||
34 | ensure => present, | ||
35 | owner => "etherpad-lite", | ||
36 | group => "etherpad-lite", | ||
37 | notify => Service["etherpad-lite"], | ||
38 | content => template("role/etherpad/settings.json.erb"), | ||
39 | } | ||
19 | 40 | ||
20 | $modules = [ | 41 | $modules = [ |
21 | "ep_aa_file_menu_toolbar", | 42 | "ep_aa_file_menu_toolbar", |
@@ -66,11 +87,6 @@ class role::etherpad ( | |||
66 | subscribe => Aur::Package["etherpad-lite"], | 87 | subscribe => Aur::Package["etherpad-lite"], |
67 | } | 88 | } |
68 | 89 | ||
69 | $web_host = "outils-1.v.immae.eu" | ||
70 | $pg_db = "etherpad-lite" | ||
71 | $pg_user = "etherpad-lite" | ||
72 | $pg_password = generate_password(24, $password_seed, "postgres_etherpad") | ||
73 | |||
74 | profile::postgresql_master { "postgresql master for etherpad": | 90 | profile::postgresql_master { "postgresql master for etherpad": |
75 | letsencrypt_host => $web_host, | 91 | letsencrypt_host => $web_host, |
76 | backup_hosts => ["backup-1"], | 92 | backup_hosts => ["backup-1"], |
diff --git a/modules/role/templates/etherpad/settings.json.erb b/modules/role/templates/etherpad/settings.json.erb new file mode 100644 index 0000000..dfd69c1 --- /dev/null +++ b/modules/role/templates/etherpad/settings.json.erb | |||
@@ -0,0 +1,93 @@ | |||
1 | { | ||
2 | "title": "Etherpad", | ||
3 | "favicon": "favicon.ico", | ||
4 | |||
5 | "ip": "<%= @web_listen %>", | ||
6 | "port" : <%= @web_port %>, | ||
7 | "showSettingsInAdminPage" : false, | ||
8 | "dbType" : "postgres", | ||
9 | "dbSettings" : { | ||
10 | "user" : "<%= @pg_user %>", | ||
11 | "host" : "/run/postgresql", | ||
12 | "password": "", | ||
13 | "database": "<%= @pg_db %>", | ||
14 | "charset" : "utf8mb4" | ||
15 | }, | ||
16 | |||
17 | "defaultPadText" : "Welcome to Etherpad!\n\nThis 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!\n\nGet involved with Etherpad at http:\/\/etherpad.org\n", | ||
18 | "padOptions": { | ||
19 | "noColors": false, | ||
20 | "showControls": true, | ||
21 | "showChat": true, | ||
22 | "showLineNumbers": true, | ||
23 | "useMonospaceFont": false, | ||
24 | "userName": false, | ||
25 | "userColor": false, | ||
26 | "rtl": false, | ||
27 | "alwaysShowChat": false, | ||
28 | "chatAndUsers": false, | ||
29 | "lang": "en-gb" | ||
30 | }, | ||
31 | |||
32 | "suppressErrorsInPadText" : false, | ||
33 | "requireSession" : false, | ||
34 | "editOnly" : false, | ||
35 | "sessionNoPassword" : false, | ||
36 | "minify" : true, | ||
37 | "maxAge" : 21600, | ||
38 | "abiword" : "/usr/bin/abiword", | ||
39 | "soffice" : "/usr/bin/soffice", | ||
40 | "tidyHtml" : "/usr/bin/tidy", | ||
41 | "allowUnknownFileEnds" : true, | ||
42 | "requireAuthentication" : false, | ||
43 | "requireAuthorization" : false, | ||
44 | "trustProxy" : false, | ||
45 | "disableIPlogging" : false, | ||
46 | "automaticReconnectionTimeout" : 0, | ||
47 | "scrollWhenFocusLineIsOutOfViewport": { | ||
48 | "percentage": { | ||
49 | "editionAboveViewport": 0, | ||
50 | "editionBelowViewport": 0 | ||
51 | }, | ||
52 | "duration": 0, | ||
53 | "scrollWhenCaretIsInTheLastLineOfViewport": false, | ||
54 | "percentageToScrollWhenUserPressesArrowUp": 0 | ||
55 | }, | ||
56 | "users": { | ||
57 | "ldapauth": { | ||
58 | "url": "ldaps://<%= @ldap_server %>", | ||
59 | "accountBase": "<%= @ldap_base %>", | ||
60 | "accountPattern": "<%= @ldap_account_pattern %>", | ||
61 | "displayNameAttribute": "cn", | ||
62 | "searchDN": "<%= @ldap_dn %>", | ||
63 | "searchPWD": "<%= @ldap_password %>", | ||
64 | "groupSearchBase": "<%= @ldap_base %>", | ||
65 | "groupAttribute": "member", | ||
66 | "groupAttributeIsDN": true, | ||
67 | "searchScope": "sub", | ||
68 | "groupSearch": "<%= @ldap_group_pattern %>", | ||
69 | "anonymousReadonly": false | ||
70 | } | ||
71 | }, | ||
72 | "socketTransportProtocols" : ["xhr-polling", "jsonp-polling", "htmlfile"], | ||
73 | "loadTest": false, | ||
74 | "indentationOnNewLine": false, | ||
75 | "toolbar": { | ||
76 | "left": [ | ||
77 | ["bold", "italic", "underline", "strikethrough"], | ||
78 | ["orderedlist", "unorderedlist", "indent", "outdent"], | ||
79 | ["undo", "redo"], | ||
80 | ["clearauthorship"] | ||
81 | ], | ||
82 | "right": [ | ||
83 | ["importexport", "timeslider", "savedrevision"], | ||
84 | ["settings", "embed"], | ||
85 | ["showusers"] | ||
86 | ], | ||
87 | "timeslider": [ | ||
88 | ["timeslider_export", "timeslider_returnToPad"] | ||
89 | ] | ||
90 | }, | ||
91 | "loglevel": "INFO", | ||
92 | "logconfig" : { "appenders": [ { "type": "console" } ] } | ||
93 | } | ||