diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 01:35:06 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 02:11:48 +0200 |
commit | 1a64deeb894dc95e2645a75771732c6cc53a79ad (patch) | |
tree | 1b9df4838f894577a09b9b260151756272efeb53 /modules/private/websites/tools/diaspora | |
parent | fa25ffd4583cc362075cd5e1b4130f33306103f0 (diff) | |
download | Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip |
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them
contained personnal information about users. All thos changes got
stashed into a single commit (history is kept in a different place) and
private information was moved in a separate private repository
Diffstat (limited to 'modules/private/websites/tools/diaspora')
-rw-r--r-- | modules/private/websites/tools/diaspora/default.nix | 185 |
1 files changed, 0 insertions, 185 deletions
diff --git a/modules/private/websites/tools/diaspora/default.nix b/modules/private/websites/tools/diaspora/default.nix deleted file mode 100644 index 3a115ed..0000000 --- a/modules/private/websites/tools/diaspora/default.nix +++ /dev/null | |||
@@ -1,185 +0,0 @@ | |||
1 | { lib, pkgs, config, ... }: | ||
2 | let | ||
3 | env = config.myEnv.tools.diaspora; | ||
4 | root = "${dcfg.workdir}/public/"; | ||
5 | cfg = config.myServices.websites.tools.diaspora; | ||
6 | dcfg = config.services.diaspora; | ||
7 | in { | ||
8 | options.myServices.websites.tools.diaspora = { | ||
9 | enable = lib.mkEnableOption "enable diaspora's website"; | ||
10 | }; | ||
11 | |||
12 | config = lib.mkIf cfg.enable { | ||
13 | users.users.diaspora.extraGroups = [ "keys" ]; | ||
14 | |||
15 | secrets.keys = { | ||
16 | "webapps/diaspora" = { | ||
17 | isDir = true; | ||
18 | user = "diaspora"; | ||
19 | group = "diaspora"; | ||
20 | permissions = "0500"; | ||
21 | }; | ||
22 | "webapps/diaspora/diaspora.yml" = { | ||
23 | user = "diaspora"; | ||
24 | group = "diaspora"; | ||
25 | permissions = "0400"; | ||
26 | text = '' | ||
27 | configuration: | ||
28 | environment: | ||
29 | url: "https://diaspora.immae.eu/" | ||
30 | certificate_authorities: '${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt' | ||
31 | redis: 'redis://${env.redis.host}:${env.redis.port}/${env.redis.db}' | ||
32 | sidekiq: | ||
33 | s3: | ||
34 | assets: | ||
35 | logging: | ||
36 | logrotate: | ||
37 | debug: | ||
38 | server: | ||
39 | listen: '${dcfg.sockets.rails}' | ||
40 | rails_environment: 'production' | ||
41 | chat: | ||
42 | server: | ||
43 | bosh: | ||
44 | log: | ||
45 | map: | ||
46 | mapbox: | ||
47 | privacy: | ||
48 | piwik: | ||
49 | statistics: | ||
50 | camo: | ||
51 | settings: | ||
52 | enable_registrations: false | ||
53 | welcome_message: | ||
54 | invitations: | ||
55 | open: false | ||
56 | paypal_donations: | ||
57 | community_spotlight: | ||
58 | captcha: | ||
59 | enable: false | ||
60 | terms: | ||
61 | maintenance: | ||
62 | remove_old_users: | ||
63 | default_metas: | ||
64 | csp: | ||
65 | services: | ||
66 | twitter: | ||
67 | tumblr: | ||
68 | wordpress: | ||
69 | mail: | ||
70 | enable: true | ||
71 | sender_address: 'diaspora@tools.immae.eu' | ||
72 | method: 'sendmail' | ||
73 | smtp: | ||
74 | sendmail: | ||
75 | location: '/run/wrappers/bin/sendmail' | ||
76 | admins: | ||
77 | account: "ismael" | ||
78 | podmin_email: 'diaspora@tools.immae.eu' | ||
79 | relay: | ||
80 | outbound: | ||
81 | inbound: | ||
82 | ldap: | ||
83 | enable: true | ||
84 | host: ${env.ldap.host} | ||
85 | port: 636 | ||
86 | only_ldap: true | ||
87 | mail_attribute: mail | ||
88 | skip_email_confirmation: true | ||
89 | use_bind_dn: true | ||
90 | bind_dn: "${env.ldap.dn}" | ||
91 | bind_pw: "${env.ldap.password}" | ||
92 | search_base: "${env.ldap.base}" | ||
93 | search_filter: "${env.ldap.filter}" | ||
94 | production: | ||
95 | environment: | ||
96 | development: | ||
97 | environment: | ||
98 | ''; | ||
99 | }; | ||
100 | "webapps/diaspora/database.yml" = { | ||
101 | user = "diaspora"; | ||
102 | group = "diaspora"; | ||
103 | permissions = "0400"; | ||
104 | text = '' | ||
105 | postgresql: &postgresql | ||
106 | adapter: postgresql | ||
107 | host: "${env.postgresql.socket}" | ||
108 | port: "${env.postgresql.port}" | ||
109 | username: "${env.postgresql.user}" | ||
110 | password: "${env.postgresql.password}" | ||
111 | encoding: unicode | ||
112 | common: &common | ||
113 | <<: *postgresql | ||
114 | combined: &combined | ||
115 | <<: *common | ||
116 | development: | ||
117 | <<: *combined | ||
118 | database: diaspora_development | ||
119 | production: | ||
120 | <<: *combined | ||
121 | database: ${env.postgresql.database} | ||
122 | test: | ||
123 | <<: *combined | ||
124 | database: "diaspora_test" | ||
125 | integration1: | ||
126 | <<: *combined | ||
127 | database: diaspora_integration1 | ||
128 | integration2: | ||
129 | <<: *combined | ||
130 | database: diaspora_integration2 | ||
131 | ''; | ||
132 | }; | ||
133 | "webapps/diaspora/secret_token.rb" = { | ||
134 | user = "diaspora"; | ||
135 | group = "diaspora"; | ||
136 | permissions = "0400"; | ||
137 | text = '' | ||
138 | Diaspora::Application.config.secret_key_base = '${env.secret_token}' | ||
139 | ''; | ||
140 | }; | ||
141 | }; | ||
142 | |||
143 | services.diaspora = { | ||
144 | enable = true; | ||
145 | package = pkgs.webapps.diaspora.override { ldap = true; }; | ||
146 | dataDir = "/var/lib/diaspora_immae"; | ||
147 | adminEmail = "diaspora@tools.immae.eu"; | ||
148 | configDir = config.secrets.fullPaths."webapps/diaspora"; | ||
149 | }; | ||
150 | |||
151 | services.filesWatcher.diaspora = { | ||
152 | restart = true; | ||
153 | paths = [ dcfg.configDir ]; | ||
154 | }; | ||
155 | |||
156 | services.websites.env.tools.modules = [ | ||
157 | "headers" "proxy" "proxy_http" | ||
158 | ]; | ||
159 | services.websites.env.tools.vhostConfs.diaspora = { | ||
160 | certName = "eldiron"; | ||
161 | addToCerts = true; | ||
162 | hosts = [ "diaspora.immae.eu" ]; | ||
163 | root = root; | ||
164 | extraConfig = [ '' | ||
165 | RewriteEngine On | ||
166 | RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f | ||
167 | RewriteRule ^/(.*)$ unix://${dcfg.sockets.rails}|http://diaspora.immae.eu/%{REQUEST_URI} [P,NE,QSA,L] | ||
168 | |||
169 | ProxyRequests Off | ||
170 | ProxyVia On | ||
171 | ProxyPreserveHost On | ||
172 | RequestHeader set X_FORWARDED_PROTO https | ||
173 | |||
174 | <Proxy *> | ||
175 | Require all granted | ||
176 | </Proxy> | ||
177 | |||
178 | <Directory ${root}> | ||
179 | Require all granted | ||
180 | Options -MultiViews | ||
181 | </Directory> | ||
182 | '' ]; | ||
183 | }; | ||
184 | }; | ||
185 | } | ||