X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=nixops%2Fmodules%2Fwebsites%2Ftools%2Ftools%2Fdefault.nix;h=e0181c4f82a9bcd4d616e654fe818334b690ae92;hb=706060700aac9221861c29db639e89b9600e2f09;hp=333ffb0c79e9cf6129b34f7340dd1ccf20bb4650;hpb=01f21083a897b86bf148f1d2bb9c8edca4d3786a;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 333ffb0..e0181c4 100644 --- a/nixops/modules/websites/tools/tools/default.nix +++ b/nixops/modules/websites/tools/tools/default.nix @@ -18,6 +18,15 @@ let inherit (mylibs) fetchedGithub; env = myconfig.env.tools.rompr; }; + 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 { @@ -29,21 +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; + ++ rompr.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 @@ -51,6 +74,35 @@ in { wallabag.apache.vhostConf 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 + '' ]; }; @@ -61,6 +113,25 @@ in { wallabag = wallabag.phpFpm.pool; 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 = { @@ -69,6 +140,24 @@ in { wallabag = wallabag.activationScript; 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 = {