From f8b4cf08fecdd4caa638ce5d00ac5b583308dafb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 31 Dec 2021 11:22:19 +0000 Subject: [PATCH] syncserver, nixos/syncserver: remove They have been broken for multiple releases. --- nixos/modules/module-list.nix | 1 - nixos/modules/rename.nix | 3 +- .../networking/firefox/sync-server.nix | 183 ------------------ pkgs/servers/syncserver/default.nix | 47 ----- pkgs/top-level/all-packages.nix | 2 - 5 files changed, 1 insertion(+), 235 deletions(-) delete mode 100644 nixos/modules/services/networking/firefox/sync-server.nix delete mode 100644 pkgs/servers/syncserver/default.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index c4aae9553c88..955355e9e608 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -739,7 +739,6 @@ ./services/networking/eternal-terminal.nix ./services/networking/fakeroute.nix ./services/networking/ferm.nix - ./services/networking/firefox/sync-server.nix ./services/networking/fireqos.nix ./services/networking/firewall.nix ./services/networking/flannel.nix diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index c290741da043..292f613084f5 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -21,8 +21,7 @@ with lib; (mkRemovedOptionModule [ "services" "quagga" ] "the corresponding package has been removed from nixpkgs") (mkRemovedOptionModule [ "services" "chronos" ] "The corresponding package was removed from nixpkgs.") (mkRemovedOptionModule [ "services" "deepin" ] "The corresponding packages were removed from nixpkgs.") - (mkRemovedOptionModule [ "services" "firefox" "syncserver" "user" ] "") - (mkRemovedOptionModule [ "services" "firefox" "syncserver" "group" ] "") + (mkRemovedOptionModule [ "services" "firefox" "syncserver" ] "The corresponding package was removed from nixpkgs.") (mkRemovedOptionModule [ "services" "marathon" ] "The corresponding package was removed from nixpkgs.") (mkRemovedOptionModule [ "services" "moinmoin" ] "The corresponding package was removed from nixpkgs.") (mkRemovedOptionModule [ "services" "mesos" ] "The corresponding package was removed from nixpkgs.") diff --git a/nixos/modules/services/networking/firefox/sync-server.nix b/nixos/modules/services/networking/firefox/sync-server.nix deleted file mode 100644 index 1ad573abfca3..000000000000 --- a/nixos/modules/services/networking/firefox/sync-server.nix +++ /dev/null @@ -1,183 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let - cfg = config.services.firefox.syncserver; - - defaultDbLocation = "/var/db/firefox-sync-server/firefox-sync-server.db"; - defaultSqlUri = "sqlite:///${defaultDbLocation}"; - - syncServerIni = pkgs.writeText "syncserver.ini" '' - [DEFAULT] - overrides = ${cfg.privateConfig} - - [server:main] - use = egg:gunicorn - host = ${cfg.listen.address} - port = ${toString cfg.listen.port} - - [app:main] - use = egg:syncserver - - [syncserver] - public_url = ${cfg.publicUrl} - ${optionalString (cfg.sqlUri != "") "sqluri = ${cfg.sqlUri}"} - allow_new_users = ${boolToString cfg.allowNewUsers} - - [browserid] - backend = tokenserver.verifiers.LocalVerifier - audiences = ${removeSuffix "/" cfg.publicUrl} - ''; - - user = "syncserver"; - group = "syncserver"; -in - -{ - meta.maintainers = with lib.maintainers; [ nadrieril ]; - - options = { - services.firefox.syncserver = { - enable = mkOption { - type = types.bool; - default = false; - description = '' - Whether to enable a Firefox Sync Server, this give the opportunity to - Firefox users to store all synchronized data on their own server. To use this - server, Firefox users should visit the , and - replicate the following change - - - services.sync.tokenServerURI: http://localhost:5000/token/1.0/sync/1.5 - - - where corresponds to the - public url of the server. - ''; - }; - - listen.address = mkOption { - type = types.str; - default = "127.0.0.1"; - example = "0.0.0.0"; - description = '' - Address on which the sync server listen to. - ''; - }; - - listen.port = mkOption { - type = types.port; - default = 5000; - description = '' - Port on which the sync server listen to. - ''; - }; - - publicUrl = mkOption { - type = types.str; - default = "http://localhost:5000/"; - example = "http://sync.example.com/"; - description = '' - Public URL with which firefox users can use to access the sync server. - ''; - }; - - allowNewUsers = mkOption { - type = types.bool; - default = true; - description = '' - Whether to allow new-user signups on the server. Only request by - existing accounts will be honored. - ''; - }; - - sqlUri = mkOption { - type = types.str; - default = defaultSqlUri; - example = "postgresql://scott:tiger@localhost/test"; - description = '' - The location of the database. This URL is composed of - , - where is a database name such as - , , , - etc., and the name of a DBAPI, such as - , , , - etc. The - SQLAlchemy documentation provides more examples and describe the syntax of - the expected URL. - ''; - }; - - privateConfig = mkOption { - type = types.str; - default = "/etc/firefox/syncserver-secret.ini"; - description = '' - The private config file is used to extend the generated config with confidential - information, such as the setting if it contains a - password, and the setting is used by the server to - generate cryptographically-signed authentication tokens. - - If this file does not exist, then it is created with a generated - settings. - ''; - }; - }; - }; - - config = mkIf cfg.enable { - - systemd.services.syncserver = { - after = [ "network.target" ]; - description = "Firefox Sync Server"; - wantedBy = [ "multi-user.target" ]; - path = [ - pkgs.coreutils - (pkgs.python.withPackages (ps: [ pkgs.syncserver ps.gunicorn ])) - ]; - - serviceConfig = { - User = user; - Group = group; - PermissionsStartOnly = true; - }; - - preStart = '' - if ! test -e ${cfg.privateConfig}; then - mkdir -p $(dirname ${cfg.privateConfig}) - echo > ${cfg.privateConfig} '[syncserver]' - chmod 600 ${cfg.privateConfig} - echo >> ${cfg.privateConfig} "secret = $(head -c 20 /dev/urandom | sha1sum | tr -d ' -')" - fi - chmod 600 ${cfg.privateConfig} - chmod 755 $(dirname ${cfg.privateConfig}) - chown ${user}:${group} ${cfg.privateConfig} - - '' + optionalString (cfg.sqlUri == defaultSqlUri) '' - if ! test -e $(dirname ${defaultDbLocation}); then - mkdir -m 700 -p $(dirname ${defaultDbLocation}) - chown ${user}:${group} $(dirname ${defaultDbLocation}) - fi - - # Move previous database file if it exists - oldDb="/var/db/firefox-sync-server.db" - if test -f $oldDb; then - mv $oldDb ${defaultDbLocation} - chown ${user}:${group} ${defaultDbLocation} - fi - ''; - - script = '' - gunicorn --paste ${syncServerIni} - ''; - }; - - users.users.${user} = { - inherit group; - isSystemUser = true; - }; - - users.groups.${group} = {}; - }; -} diff --git a/pkgs/servers/syncserver/default.nix b/pkgs/servers/syncserver/default.nix deleted file mode 100644 index 24c093fde505..000000000000 --- a/pkgs/servers/syncserver/default.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ lib -, python2 -, fetchFromGitHub -}: - -let - python = python2.override { - packageOverrides = self: super: { - # Older version, used by syncserver, tokenserver and serversyncstorage - cornice = super.cornice.overridePythonAttrs (oldAttrs: rec { - version = "0.17"; - src = oldAttrs.src.override { - inherit version; - sha256 = "1vvymhf6ydc885ygqiqpa39xr9v302i1l6nzirjnczqy9llyqvpj"; - }; - }); - }; - }; - -# buildPythonPackage is necessary for syncserver to work with gunicorn or paster scripts -in python.pkgs.buildPythonPackage rec { - pname = "syncserver"; - version = "1.8.0"; - - src = fetchFromGitHub { - owner = "mozilla-services"; - repo = "syncserver"; - rev = version; - sha256 = "0hxjns9hz7a8r87iqr1yfvny4vwj1rlhwcf8bh7j6lsf92mkmgy8"; - }; - - # There are no tests - doCheck = false; - - propagatedBuildInputs = with python.pkgs; [ - cornice gunicorn pyramid requests simplejson sqlalchemy mozsvc tokenserver - serversyncstorage configparser - ]; - - meta = with lib; { - description = "Run-Your-Own Firefox Sync Server"; - homepage = "https://github.com/mozilla-services/syncserver"; - platforms = platforms.unix; - license = licenses.mpl20; - maintainers = with maintainers; [ nadrieril ]; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e945605b0f20..5718bda2e7fc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21806,8 +21806,6 @@ with pkgs; systemd-journal2gelf = callPackage ../tools/system/systemd-journal2gelf { }; - syncserver = callPackage ../servers/syncserver { }; - tailscale = callPackage ../servers/tailscale { buildGoModule = buildGo117Module; };