1 { lib, pkgs, config, ... }:
3 env = config.myEnv.tools.diaspora;
4 root = "${dcfg.workdir}/public/";
5 cfg = config.myServices.websites.tools.diaspora;
6 dcfg = config.services.diaspora;
8 options.myServices.websites.tools.diaspora = {
9 enable = lib.mkEnableOption "enable diaspora's website";
12 config = lib.mkIf cfg.enable {
13 myServices.chatonsProperties.services.diaspora = {
14 file.datetime = "2022-08-21T01:39:00";
17 description = "The online social world where you are in control";
18 website = "https://diaspora.immae.eu";
19 logo = "https://diaspora.immae.eu/assets/apple-touch-icon-9f7c9cc3923b4817fbb25bfeb0dd5fd34638827fd9c82b5a03f7b68e6e90806f.png";
21 status.description = "OK";
22 registration."" = ["MEMBER" "CLIENT"];
23 registration.load = "OPEN";
24 install.type = "PACKAGE";
28 website = "https://diasporafoundation.org/";
29 license.url = "https://github.com/diaspora/diaspora/blob/develop/LICENSE";
30 license.name = "GNU Affero General Public License v3.0";
31 version = dcfg.package.version;
32 source.url = "https://github.com/diaspora/diaspora";
35 users.users.diaspora.extraGroups = [ "keys" ];
38 "webapps/diaspora" = {
44 "webapps/diaspora/diaspora.yml" = {
51 url: "https://diaspora.immae.eu/"
52 certificate_authorities: '${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt'
53 redis: 'redis://${env.redis.host}:${env.redis.port}/${env.redis.db}'
61 listen: '${dcfg.sockets.rails}'
62 rails_environment: 'production'
74 enable_registrations: false
93 sender_address: 'diaspora@tools.immae.eu'
97 location: '/run/wrappers/bin/sendmail'
100 podmin_email: 'diaspora@tools.immae.eu'
106 host: ${env.ldap.host}
110 skip_email_confirmation: true
112 bind_dn: "${env.ldap.dn}"
113 bind_pw: "${env.ldap.password}"
114 search_base: "${env.ldap.base}"
115 search_filter: "${env.ldap.filter}"
122 "webapps/diaspora/database.yml" = {
125 permissions = "0400";
127 postgresql: &postgresql
129 host: "${env.postgresql.socket}"
130 port: "${env.postgresql.port}"
131 username: "${env.postgresql.user}"
132 password: "${env.postgresql.password}"
140 database: diaspora_development
143 database: ${env.postgresql.database}
146 database: "diaspora_test"
149 database: diaspora_integration1
152 database: diaspora_integration2
155 "webapps/diaspora/secret_token.rb" = {
158 permissions = "0400";
160 Diaspora::Application.config.secret_key_base = '${env.secret_token}'
165 services.diaspora = {
168 dataDir = "/var/lib/diaspora_immae";
169 adminEmail = "diaspora@tools.immae.eu";
170 configDir = config.secrets.fullPaths."webapps/diaspora";
173 services.filesWatcher.diaspora = {
175 paths = [ dcfg.configDir ];
178 services.websites.env.tools.modules = [
179 "headers" "proxy" "proxy_http"
181 services.websites.env.tools.vhostConfs.diaspora = {
182 certName = "eldiron";
184 hosts = [ "diaspora.immae.eu" ];
188 RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
189 RewriteRule ^/(.*)$ unix://${dcfg.sockets.rails}|http://diaspora.immae.eu/%{REQUEST_URI} [P,NE,QSA,L]
194 RequestHeader set X_FORWARDED_PROTO https