'';
};
+ envFile = mkOption {
+ default = {};
+ type = types.attrsOf types.string;
+ example = literalExample ''
+ { mypool = "path/to/file";
+ }
+ '';
+ description = ''
+ Extra environment file go into the service script.
+ '';
+ };
+
poolPhpConfigs = mkOption {
default = {};
type = types.attrsOf types.lines;
cfgFile = fpmCfgFile pool poolConfig;
poolPhpIni = cfg.poolPhpConfigs.${pool} or "";
in {
+ EnvironmentFile = if builtins.hasAttr pool cfg.envFile then [cfg.envFile.${pool}] else [];
Slice = "phpfpm.slice";
PrivateDevices = true;
ProtectSystem = "full";
kanboard.keys
// ldap.keys
// roundcubemail.keys
+ // shaarli.keys
// ttrss.keys
// wallabag.keys
// yourls.keys;
];
};
+ services.myPhpfpm.envFile = {
+ shaarli = shaarli.phpFpm.envFile;
+ };
+
services.myPhpfpm.serviceDependencies = {
dokuwiki = dokuwiki.phpFpm.serviceDeps;
kanboard = kanboard.phpFpm.serviceDeps;
ldap = ldap.phpFpm.serviceDeps;
rainloop = rainloop.phpFpm.serviceDeps;
roundcubemail = roundcubemail.phpFpm.serviceDeps;
+ shaarli = shaarli.phpFpm.serviceDeps;
ttrss = ttrss.phpFpm.serviceDeps;
wallabag = wallabag.phpFpm.serviceDeps;
yourls = yourls.phpFpm.serviceDeps;
Alias /Shaarli "${root}"
<Directory "${root}">
- SetEnv SHAARLI_LDAP_PASSWORD "${env.ldap.password}"
- SetEnv SHAARLI_LDAP_DN "${env.ldap.dn}"
- SetEnv SHAARLI_LDAP_HOST "ldaps://${env.ldap.host}"
- SetEnv SHAARLI_LDAP_BASE "${env.ldap.base}"
- SetEnv SHAARLI_LDAP_FILTER "${env.ldap.search}"
-
DirectoryIndex index.php index.htm index.html
Options Indexes FollowSymLinks MultiViews Includes
AllowOverride All
</Directory>
'';
};
+ keys.tools-shaarli = {
+ destDir = "/run/keys/webapps";
+ user = apache.user;
+ group = apache.group;
+ permissions = "0700";
+ text = ''
+ SHAARLI_LDAP_PASSWORD="${env.ldap.password}"
+ SHAARLI_LDAP_DN="${env.ldap.dn}"
+ SHAARLI_LDAP_HOST="ldaps://${env.ldap.host}"
+ SHAARLI_LDAP_BASE="${env.ldap.base}"
+ SHAARLI_LDAP_FILTER="${env.ldap.search}"
+ '';
+ };
phpFpm = rec {
+ serviceDeps = [ "openldap.service" "tools-shaarli-key.service" ];
+ envFile = "/run/keys/webapps/tools-shaarli";
basedir = builtins.concatStringsSep ":" [ webRoot varDir ];
socket = "/var/run/phpfpm/shaarli.sock";
pool = ''
pm = ondemand
pm.max_children = 60
pm.process_idle_timeout = 60
+ clear_env = no
; Needed to avoid clashes in browser cookies (same domain)
php_value[session.name] = ShaarliPHPSESSID