1 { lib, pkgs, config, ... }:
3 env = config.myEnv.tools.mediagoblin;
4 cfg = config.myServices.websites.tools.mediagoblin;
5 mcfg = config.services.mediagoblin;
7 options.myServices.websites.tools.mediagoblin = {
8 enable = lib.mkEnableOption "enable mediagoblin's website";
11 config = lib.mkIf cfg.enable {
12 myServices.chatonsProperties.services.mediagoblin = {
13 file.datetime = "2022-08-21T20:00:00";
16 description = "MediaGoblin is a free software media publishing platform that anyone can run";
17 website = "https://mgoblin.immae.eu/";
18 logo = "https://mgoblin.immae.eu/mgoblin_static/images/goblin.ico";
20 status.description = "OK";
21 registration."" = ["MEMBER" "CLIENT"];
22 registration.load = "OPEN";
23 install.type = "PACKAGE";
27 website = "https://mediagoblin.org/";
28 license.url = "http://www.gnu.org/licenses/agpl.html";
29 license.name = "GNU Affero General Public License";
30 version = mcfg.package.version;
31 source.url = "https://git.savannah.gnu.org/git/mediagoblin.git";
32 modules = map (a: a.pluginName) mcfg.package.plugins;
35 secrets.keys."webapps/tools-mediagoblin" = {
37 group = "mediagoblin";
41 psql_url = with env.postgresql; "postgresql://${user}:${password}@:${port}/${database}?host=${socket}";
42 redis_url = with env.redis; "redis+socket://${socket}?virtual_host=${db}";
46 data_basedir = "${mcfg.dataDir}"
49 direct_remote_path = /mgoblin_static/
50 email_sender_address = "mediagoblin@tools.immae.eu"
52 #sql_engine = sqlite:///%(data_basedir)s/mediagoblin.db
53 sql_engine = ${psql_url}
55 email_debug_mode = false
56 allow_registration = false
57 allow_reporting = true
61 user_privilege_scheme = "uploader,commenter,reporter"
63 # We need to redefine them here since we override data_basedir
64 # cf /usr/share/webapps/mediagoblin/mediagoblin/config_spec.ini
65 workbench_path = %(data_basedir)s/media/workbench
66 crypto_path = %(data_basedir)s/crypto
67 theme_install_dir = %(data_basedir)s/themes/
68 theme_linked_assets_dir = %(data_basedir)s/theme_static/
69 plugin_linked_assets_dir = %(data_basedir)s/plugin_static/
72 base_dir = %(data_basedir)s/media/queue
75 base_dir = %(data_basedir)s/media/public
76 base_url = /mgoblin_media/
79 CELERY_RESULT_DBURI = ${redis_url}
80 BROKER_URL = ${redis_url}
81 CELERYD_CONCURRENCY = 1
84 [[mediagoblin.plugins.geolocation]]
85 [[mediagoblin.plugins.ldap]]
87 LDAP_SERVER_URI = 'ldaps://${env.ldap.host}:636'
88 LDAP_SEARCH_BASE = '${env.ldap.base}'
89 LDAP_BIND_DN = '${env.ldap.dn}'
90 LDAP_BIND_PW = '${env.ldap.password}'
91 LDAP_SEARCH_FILTER = '${env.ldap.filter}'
92 EMAIL_SEARCH_FIELD = 'mail'
93 [[mediagoblin.plugins.basicsearch]]
94 [[mediagoblin.plugins.piwigo]]
95 [[mediagoblin.plugins.processing_info]]
96 [[mediagoblin.media_types.image]]
97 [[mediagoblin.media_types.video]]
101 users.users.mediagoblin.extraGroups = [ "keys" ];
103 services.mediagoblin = {
105 package = pkgs.webapps.mediagoblin.withPlugins (p: [p.basicsearch]);
106 configFile = config.secrets.fullPaths."webapps/tools-mediagoblin";
108 services.filesWatcher.mediagoblin-web = {
110 paths = [ mcfg.configFile ];
112 services.filesWatcher.mediagoblin-celeryd = {
114 paths = [ mcfg.configFile ];
117 services.websites.env.tools.modules = [
120 users.users.wwwrun.extraGroups = [ "mediagoblin" ];
121 services.websites.env.tools.vhostConfs.mgoblin = {
122 certName = "eldiron";
124 hosts = ["mgoblin.immae.eu" ];
127 Alias /mgoblin_media ${mcfg.dataDir}/media/public
128 <Directory ${mcfg.dataDir}/media/public>
129 Options -Indexes +FollowSymLinks +MultiViews +Includes
133 Alias /theme_static ${mcfg.dataDir}/theme_static
134 <Directory ${mcfg.dataDir}/theme_static>
135 Options -Indexes +FollowSymLinks +MultiViews +Includes
139 Alias /plugin_static ${mcfg.dataDir}/plugin_static
140 <Directory ${mcfg.dataDir}/plugin_static>
141 Options -Indexes +FollowSymLinks +MultiViews +Includes
148 ProxyPass /mgoblin_media !
149 ProxyPass /theme_static !
150 ProxyPass /plugin_static !
151 ProxyPassMatch ^/.well-known/acme-challenge !
152 ProxyPass / unix://${mcfg.sockets.paster}|http://mgoblin.immae.eu/
153 ProxyPassReverse / unix://${mcfg.sockets.paster}|http://mgoblin.immae.eu/