diff options
author | Milo Gertjejansen <milo@milogert.com> | 2021-06-25 16:34:32 -0400 |
---|---|---|
committer | Milo Gertjejansen <milo@milogert.com> | 2021-07-06 18:46:21 -0400 |
commit | 97cb387fb97a41ee455c129935ce12e38c789d55 (patch) | |
tree | b9584b419d2f047a9c3c6704a7ecb5ea500e59e6 | |
parent | e1bc891aec5e3c5ba26349f9664829b0cbbd18e8 (diff) | |
download | nixpkgs-97cb387fb97a41ee455c129935ce12e38c789d55.tar nixpkgs-97cb387fb97a41ee455c129935ce12e38c789d55.tar.gz nixpkgs-97cb387fb97a41ee455c129935ce12e38c789d55.tar.bz2 nixpkgs-97cb387fb97a41ee455c129935ce12e38c789d55.tar.lz nixpkgs-97cb387fb97a41ee455c129935ce12e38c789d55.tar.xz nixpkgs-97cb387fb97a41ee455c129935ce12e38c789d55.tar.zst nixpkgs-97cb387fb97a41ee455c129935ce12e38c789d55.zip |
tt-rss: 2021-01-29 -> 2021-06-23 and modules/tt-rss: updated config.php creation
The version of tt-rss in nixpkgs was pre-php 8. This updates tt-rss to the most recent version, which uses php 8. The updates to the module are required changes, per https://community.tt-rss.org/t/rip-config-php-hello-classes-config-php/4337.
-rw-r--r-- | nixos/modules/services/web-apps/tt-rss.nix | 156 | ||||
-rw-r--r-- | pkgs/servers/tt-rss/default.nix | 6 |
2 files changed, 85 insertions, 77 deletions
diff --git a/nixos/modules/services/web-apps/tt-rss.nix b/nixos/modules/services/web-apps/tt-rss.nix index b78487cc928..b9feea7ffc5 100644 --- a/nixos/modules/services/web-apps/tt-rss.nix +++ b/nixos/modules/services/web-apps/tt-rss.nix @@ -22,80 +22,6 @@ let tt-rss-config = pkgs.writeText "config.php" '' <?php - define('PHP_EXECUTABLE', '${pkgs.php}/bin/php'); - - define('LOCK_DIRECTORY', '${lockDir}'); - define('CACHE_DIR', '${cacheDir}'); - define('ICONS_DIR', '${feedIconsDir}'); - define('ICONS_URL', '${feedIconsDir}'); - define('SELF_URL_PATH', '${cfg.selfUrlPath}'); - - define('MYSQL_CHARSET', 'UTF8'); - - define('DB_TYPE', '${cfg.database.type}'); - define('DB_HOST', '${optionalString (cfg.database.host != null) cfg.database.host}'); - define('DB_USER', '${cfg.database.user}'); - define('DB_NAME', '${cfg.database.name}'); - define('DB_PASS', ${ - if (cfg.database.password != null) then - "'${(escape ["'" "\\"] cfg.database.password)}'" - else if (cfg.database.passwordFile != null) then - "file_get_contents('${cfg.database.passwordFile}')" - else - "''" - }); - define('DB_PORT', '${toString dbPort}'); - - define('AUTH_AUTO_CREATE', ${boolToString cfg.auth.autoCreate}); - define('AUTH_AUTO_LOGIN', ${boolToString cfg.auth.autoLogin}); - - define('FEED_CRYPT_KEY', '${escape ["'" "\\"] cfg.feedCryptKey}'); - - - define('SINGLE_USER_MODE', ${boolToString cfg.singleUserMode}); - - define('SIMPLE_UPDATE_MODE', ${boolToString cfg.simpleUpdateMode}); - - // Never check for updates - the running version of the code should be - // controlled entirely by the version of TT-RSS active in the current Nix - // profile. If TT-RSS updates itself to a version requiring a database - // schema upgrade, and then the SystemD tt-rss.service is restarted, the - // old code copied from the Nix store will overwrite the updated version, - // causing the code to detect the need for a schema "upgrade" (since the - // schema version in the database is different than in the code), but the - // update schema operation in TT-RSS will do nothing because the schema - // version in the database is newer than that in the code. - define('CHECK_FOR_UPDATES', false); - - define('FORCE_ARTICLE_PURGE', ${toString cfg.forceArticlePurge}); - define('SESSION_COOKIE_LIFETIME', ${toString cfg.sessionCookieLifetime}); - define('ENABLE_GZIP_OUTPUT', ${boolToString cfg.enableGZipOutput}); - - define('PLUGINS', '${builtins.concatStringsSep "," cfg.plugins}'); - - define('LOG_DESTINATION', '${cfg.logDestination}'); - define('CONFIG_VERSION', ${toString configVersion}); - - - define('PUBSUBHUBBUB_ENABLED', ${boolToString cfg.pubSubHubbub.enable}); - define('PUBSUBHUBBUB_HUB', '${cfg.pubSubHubbub.hub}'); - - define('SPHINX_SERVER', '${cfg.sphinx.server}'); - define('SPHINX_INDEX', '${builtins.concatStringsSep "," cfg.sphinx.index}'); - - define('ENABLE_REGISTRATION', ${boolToString cfg.registration.enable}); - define('REG_NOTIFY_ADDRESS', '${cfg.registration.notifyAddress}'); - define('REG_MAX_USERS', ${toString cfg.registration.maxUsers}); - - define('SMTP_SERVER', '${cfg.email.server}'); - define('SMTP_LOGIN', '${cfg.email.login}'); - define('SMTP_PASSWORD', '${escape ["'" "\\"] cfg.email.password}'); - define('SMTP_SECURE', '${cfg.email.security}'); - - define('SMTP_FROM_NAME', '${escape ["'" "\\"] cfg.email.fromName}'); - define('SMTP_FROM_ADDRESS', '${escape ["'" "\\"] cfg.email.fromAddress}'); - define('DIGEST_SUBJECT', '${escape ["'" "\\"] cfg.email.digestSubject}'); - ${cfg.extraConfig} ''; @@ -604,6 +530,9 @@ let ''} ln -sf "${tt-rss-config}" "${cfg.root}/config.php" chmod -R 755 "${cfg.root}" + chmod -R 777 "${cfg.root}/${lockDir}" + chmod -R 777 "${cfg.root}/${cacheDir}" + chmod -R 777 "${cfg.root}/${feedIconsDir}" '' + (optionalString (cfg.database.type == "pgsql") '' @@ -637,6 +566,85 @@ let SyslogIdentifier = "tt-rss"; }; + environment = let + password = + if (cfg.database.password != null) then + "${(escape ["'" "\\"] cfg.database.password)}" + else if (cfg.database.passwordFile != null) then + "file_get_contents('${cfg.database.passwordFile}'" + else + "" + ; + in { + TTRSS_PHP_EXECUTABLE = "${pkgs.php}/bin/php"; + + TTRSS_LOCK_DIRECTORY = "${lockDir}"; + TTRSS_CACHE_DIR = "${cacheDir}"; + TTRSS_ICONS_DIR = "${feedIconsDir}"; + TTRSS_ICONS_URL = "${feedIconsDir}"; + TTRSS_SELF_URL_PATH = "${cfg.selfUrlPath}"; + + TTRSS_MYSQL_CHARSET = "UTF8"; + + TTRSS_DB_TYPE = "${cfg.database.type}"; + TTRSS_DB_HOST = "${optionalString (cfg.database.host != null) cfg.database.host}"; + TTRSS_DB_USER = "${cfg.database.user}"; + TTRSS_DB_NAME = "${cfg.database.name}"; + TTRSS_DB_PASS = "${password}"; + TTRSS_DB_PORT = "${toString dbPort}"; + + TTRSS_AUTH_AUTO_CREATE = "${boolToString cfg.auth.autoCreate}"; + TTRSS_AUTH_AUTO_LOGIN = "${boolToString cfg.auth.autoLogin}"; + + TTRSS_FEED_CRYPT_KEY = "${escape ["'" "\\"] cfg.feedCryptKey}"; + + + TTRSS_SINGLE_USER_MODE = "${boolToString cfg.singleUserMode}"; + + TTRSS_SIMPLE_UPDATE_MODE = "${boolToString cfg.simpleUpdateMode}"; + + # Never check for updates - the running version of the code should + # be controlled entirely by the version of TT-RSS active in the + # current Nix profile. If TT-RSS updates itself to a version + # requiring a database schema upgrade, and then the SystemD + # tt-rss.service is restarted, the old code copied from the Nix + # store will overwrite the updated version, causing the code to + # detect the need for a schema "upgrade" (since the schema version + # in the database is different than in the code), but the update + # schema operation in TT-RSS will do nothing because the schema + # version in the database is newer than that in the code. + TTRSS_CHECK_FOR_UPDATES = "false"; + + TTRSS_FORCE_ARTICLE_PURGE = "${toString cfg.forceArticlePurge}"; + TTRSS_SESSION_COOKIE_LIFETIME = "${toString cfg.sessionCookieLifetime}"; + TTRSS_ENABLE_GZIP_OUTPUT = "${boolToString cfg.enableGZipOutput}"; + + TTRSS_PLUGINS = "${builtins.concatStringsSep "," cfg.plugins}"; + + TTRSS_LOG_DESTINATION = "${cfg.logDestination}"; + TTRSS_CONFIG_VERSION = "${toString configVersion}"; + + + TTRSS_PUBSUBHUBBUB_ENABLED = "${boolToString cfg.pubSubHubbub.enable}"; + TTRSS_PUBSUBHUBBUB_HUB = "${cfg.pubSubHubbub.hub}"; + + TTRSS_SPHINX_SERVER = "${cfg.sphinx.server}"; + TTRSS_SPHINX_INDEX = "${builtins.concatStringsSep "," cfg.sphinx.index}"; + + TTRSS_ENABLE_REGISTRATION = "${boolToString cfg.registration.enable}"; + TTRSS_REG_NOTIFY_ADDRESS = "${cfg.registration.notifyAddress}"; + TTRSS_REG_MAX_USERS = "${toString cfg.registration.maxUsers}"; + + TTRSS_SMTP_SERVER = "${cfg.email.server}"; + TTRSS_SMTP_LOGIN = "${cfg.email.login}"; + TTRSS_SMTP_PASSWORD = "${escape ["'" "\\"] cfg.email.password}"; + TTRSS_SMTP_SECURE = "${cfg.email.security}"; + + TTRSS_SMTP_FROM_NAME = "${escape ["'" "\\"] cfg.email.fromName}"; + TTRSS_SMTP_FROM_ADDRESS = "${escape ["'" "\\"] cfg.email.fromAddress}"; + TTRSS_DIGEST_SUBJECT = "${escape ["'" "\\"] cfg.email.digestSubject}"; + }; + wantedBy = [ "multi-user.target" ]; requires = optional mysqlLocal "mysql.service" ++ optional pgsqlLocal "postgresql.service"; after = [ "network.target" ] ++ optional mysqlLocal "mysql.service" ++ optional pgsqlLocal "postgresql.service"; diff --git a/pkgs/servers/tt-rss/default.nix b/pkgs/servers/tt-rss/default.nix index e91fed5ee16..bd82f8d2890 100644 --- a/pkgs/servers/tt-rss/default.nix +++ b/pkgs/servers/tt-rss/default.nix @@ -2,12 +2,12 @@ stdenv.mkDerivation rec { pname = "tt-rss"; - version = "2021-01-29"; - rev = "6d8f2221b82b6a31becbeed8baf5e05ad9e053fe"; + version = "2021-06-21"; + rev = "cd26dbe64c9b14418f0b2d826a38a35c6bf8a270"; src = fetchurl { url = "https://git.tt-rss.org/fox/tt-rss/archive/${rev}.tar.gz"; - sha256 = "124c62hck631xlq5aa1miz9rbg711ygk7z1yx92m5dfcy630l7x5"; + sha256 = "1dpmzi7hknv5rk2g1iw13r8zcxcwrhkd5hhf292ml0dw3cwki0gm"; }; installPhase = '' |