X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=nixops%2Fmodules%2Fwebsites%2Ftools%2Ftools%2Fdefault.nix;h=e0181c4f82a9bcd4d616e654fe818334b690ae92;hb=706060700aac9221861c29db639e89b9600e2f09;hp=41f47a3f458305c072fac90711dd7b8d197d788d;hpb=95b20e17b97de1f05392d0c394a5efdc590311a9;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/nixops/modules/websites/tools/tools/default.nix b/nixops/modules/websites/tools/tools/default.nix index 41f47a3..e0181c4 100644 --- a/nixops/modules/websites/tools/tools/default.nix +++ b/nixops/modules/websites/tools/tools/default.nix @@ -21,6 +21,12 @@ let shaarli = pkgs.callPackage ./shaarli.nix { env = myconfig.env.tools.shaarli; }; + dokuwiki = pkgs.callPackage ./dokuwiki.nix { + inherit (mylibs) fetchedGithub; + }; + ldap = pkgs.callPackage ./ldap.nix { + env = myconfig.env.tools.phpldapadmin; + }; cfg = config.services.myWebsites.tools.tools; in { @@ -32,22 +38,35 @@ in { security.acme.certs."eldiron".extraDomains."tools.immae.eu" = null; services.myWebsites.tools.modules = - adminer.apache.modules + [ "proxy_fcgi" ] + ++ adminer.apache.modules ++ ympd.apache.modules ++ ttrss.apache.modules ++ roundcubemail.apache.modules ++ wallabag.apache.modules ++ yourls.apache.modules ++ rompr.apache.modules - ++ shaarli.apache.modules; + ++ shaarli.apache.modules + ++ dokuwiki.apache.modules + ++ ldap.apache.modules; services.ympd = ympd.config // { enable = true; }; services.myWebsites.tools.vhostConfs.tools = { certName = "eldiron"; hosts = ["tools.immae.eu" ]; - root = null; + root = "/var/lib/ftp/tools.immae.eu"; extraConfig = [ + '' + + DirectoryIndex index.php index.htm index.html + AllowOverride all + Require all granted + + SetHandler "proxy:unix:/var/run/phpfpm/tools.sock|fcgi://localhost" + + + '' adminer.apache.vhostConf ympd.apache.vhostConf ttrss.apache.vhostConf @@ -56,6 +75,34 @@ in { yourls.apache.vhostConf rompr.apache.vhostConf shaarli.apache.vhostConf + dokuwiki.apache.vhostConf + ldap.apache.vhostConf + ]; + }; + + security.acme.certs."eldiron".extraDomains."outils.immae.eu" = null; + services.myWebsites.tools.vhostConfs.outils = { + certName = "eldiron"; + hosts = [ "outils.immae.eu" ]; + root = null; + extraConfig = [ + '' + RedirectMatch 301 ^/mediagoblin(.*)$ https://mgoblin.immae.eu$1 + + RedirectMatch 301 ^/ether(.*)$ https://ether.immae.eu$1 + + RedirectMatch 301 ^/nextcloud(.*)$ https://cloud.immae.eu$1 + RedirectMatch 301 ^/owncloud(.*)$ https://cloud.immae.eu$1 + + RedirectMatch 301 ^/carddavmate(.*)$ https://dav.immae.eu/infcloud$1 + RedirectMatch 301 ^/caldavzap(.*)$ https://dav.immae.eu/infcloud$1 + RedirectMatch 301 ^/caldav.php(.*)$ https://dav.immae.eu/caldav.php$1 + RedirectMatch 301 ^/davical(.*)$ https://dav.immae.eu/davical$1 + + RedirectMatch 301 ^/taskweb(.*)$ https://task.immae.eu/taskweb$1 + + RedirectMatch 301 ^/(.*)$ https://tools.immae.eu/$1 + '' ]; }; @@ -67,6 +114,24 @@ in { yourls = yourls.phpFpm.pool; rompr = rompr.phpFpm.pool; shaarli = shaarli.phpFpm.pool; + dokuwiki = dokuwiki.phpFpm.pool; + ldap = ldap.phpFpm.pool; + tools = '' + listen = /var/run/phpfpm/tools.sock + user = wwwrun + group = wwwrun + listen.owner = wwwrun + listen.group = wwwrun + pm = dynamic + pm.max_children = 60 + pm.start_servers = 2 + pm.min_spare_servers = 1 + pm.max_spare_servers = 10 + + ; Needed to avoid clashes in browser cookies (same domain) + php_value[session.name] = ToolsPHPSESSID + php_admin_value[open_basedir] = "/run/wrappers/bin/sendmail:/var/lib/ftp/tools.immae.eu:/tmp" + ''; }; system.activationScripts = { @@ -76,6 +141,23 @@ in { yourls = yourls.activationScript; rompr = rompr.activationScript; shaarli = shaarli.activationScript; + dokuwiki = dokuwiki.activationScript; + }; + + system.extraSystemBuilderCmds = '' + mkdir -p $out/webapps + ln -s ${dokuwiki.webRoot} $out/webapps/${dokuwiki.apache.webappName} + ln -s ${ldap.webRoot}/htdocs $out/webapps/${ldap.apache.webappName} + ln -s ${rompr.webRoot} $out/webapps/${rompr.apache.webappName} + ln -s ${roundcubemail.webRoot} $out/webapps/${roundcubemail.apache.webappName} + ln -s ${shaarli.webRoot} $out/webapps/${shaarli.apache.webappName} + ln -s ${ttrss.webRoot} $out/webapps/${ttrss.apache.webappName} + ln -s ${wallabag.webRoot} $out/webapps/${wallabag.apache.webappName} + ln -s ${yourls.webRoot} $out/webapps/${yourls.apache.webappName} + ''; + + nixpkgs.config.packageOverrides = oldpkgs: rec { + ympd = oldpkgs.ympd.overrideAttrs(old: mylibs.fetchedGithub ./ympd.json); }; systemd.services.tt-rss = {