From a027a1ee426cea56e78b6380c55fa44f22977026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Sun, 8 Jan 2023 09:36:16 +0100 Subject: [PATCH] Disable moa --- config/nas.nix | 1 - config/services/moa/config.py | 69 ----------------------------- config/services/moa/default.nix | 78 --------------------------------- zones/chir.rs.nix | 3 +- 4 files changed, 1 insertion(+), 150 deletions(-) delete mode 100644 config/services/moa/config.py delete mode 100644 config/services/moa/default.nix diff --git a/config/nas.nix b/config/nas.nix index ba6817ab..d39cd1a2 100644 --- a/config/nas.nix +++ b/config/nas.nix @@ -34,7 +34,6 @@ ./services/drone-runner-docker.nix ./services/docker.nix ./services/gitlab-runner - ./services/moa ]; hardware.cpu.amd.updateMicrocode = true; diff --git a/config/services/moa/config.py b/config/services/moa/config.py deleted file mode 100644 index 0114a559..00000000 --- a/config/services/moa/config.py +++ /dev/null @@ -1,69 +0,0 @@ -class DefaultConfig(object): - DEBUG = False - DEVELOPMENT = False - TESTING = False - CSRF_ENABLED = True - # secret key for flask sessions http://flask.pocoo.org/docs/1.0/quickstart/#sessions - #SECRET_KEY = 'this-really-needs-to-be-changed' - SQLALCHEMY_TRACK_MODIFICATIONS = False - #TWITTER_CONSUMER_KEY = '' - #TWITTER_CONSUMER_SECRET = '' - INSTAGRAM_CLIENT_ID = '' - INSTAGRAM_SECRET = '' - # define in config.py - # SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://moa:moa@localhost/moa' - # SQLALCHEMY_DATABASE_URI = 'sqlite:///moa.db' - SEND = True - SENTRY_DSN = 'https://3e96c064de2044dc8d8fd7ccec6d85bd@o559172.ingest.sentry.io/5733551' - HEALTHCHECKS = [] - MAIL_SERVER = None - MAIL_PORT = 587 - MAIL_USE_TLS = True - MAIL_USERNAME = '' - MAIL_PASSWORD = '' - MAIL_TO = '' - MAIL_DEFAULT_SENDER = '' - MAX_MESSAGES_PER_RUN = 5 - - # This option prevents Twitter replies and mentions from occuring when a toot contains @user@twitter.com. This - # behavior is against Twitter's rules. - SANITIZE_TWITTER_HANDLES = True - - SEND_DEFERRED_EMAIL = False - SEND_DEFER_FAILED_EMAIL = False - MAINTENANCE_MODE = False - - STATS_POSTER_BASE_URL = None - STATS_POSTER_ACCESS_TOKEN = None - - TRUST_PROXY_HEADERS = False - - SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://moa:moapartyforall@localhost/moa' - TWITTER_BLACKLIST = [r'andri000me_.*'] - MASTODON_BLACKLIST = [ - r'spinster.xyz', r'gab.com', r'kag.social', r'social.quodverum.com' - ] - SECRET_KEY = '1Cl7ET1t3MKQb3kGEkiAy' - TWITTER_CONSUMER_KEY = '4qJKzkQK4FcXYCiiiHKjB2cSE' - TWITTER_CONSUMER_SECRET = 'vahm3TpA0TKfBilJbrUsEz5ABvpUKuJPWTtNCWGLrMNLVDHVwUP' - WORKER_JOBS = 1 - - -class ProductionConfig(DefaultConfig): - SECRET_KEY = open("/run/secrets/services/moa/secret").read() - TWITTER_CONSUMER_KEY = open( - "/run/secrets/services/moa/twitter_consumer_key").read() - TWITTER_CONSUMER_SECRET = open( - "/run/secrets/services/moa/twitter_consumer_secret").read() - SQLALCHEMY_DATABASE_URI = "postgresql+psycopg2://moa@/moa?host=/run/postgresql" - MASTODON_ALLOWLIST = [r'akko.chir.rs'] - - -class DevelopmentConfig(DefaultConfig): - DEBUG = True - DEVELOPMENT = True - SEND = False - - -class TestingConfig(DefaultConfig): - TESTING = True diff --git a/config/services/moa/default.nix b/config/services/moa/default.nix deleted file mode 100644 index b0c81016..00000000 --- a/config/services/moa/default.nix +++ /dev/null @@ -1,78 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - systemd.services = { - moa-app = { - description = "Moa web app"; - after = ["network.target"]; - wantedBy = ["multi-user.target"]; - environment = { - PYTHONPATH = toString ./.; - MOA_CONFIG = "ProductionConfig"; - }; - serviceConfig = { - Type = "simple"; - User = "moa"; - Group = "moa"; - ExecStart = "${pkgs.moa}/start-app.sh"; - Restart = "always"; - }; - }; - moa-worker = { - description = "Moa worker"; - environment = { - PYTHONPATH = toString ./.; - MOA_CONFIG = "ProductionConfig"; - }; - serviceConfig = { - Type = "oneshot"; - User = "moa"; - Group = "moa"; - ExecStart = "${pkgs.moa}/start-worker.sh"; - }; - }; - }; - systemd.timers.moa-worker = { - description = "Moa worker"; - after = ["network.target"]; - wantedBy = ["multi-user.target"]; - requires = ["moa-worker.service"]; - timerConfig = { - OnUnitActiveSec = 300; - RandomizedDelaySec = 60; - }; - }; - users.users.moa = { - description = "Moa"; - useDefaultShell = true; - group = "moa"; - isSystemUser = true; - }; - users.groups.moa = {}; - services.postgresql.ensureDatabases = [ - "moa" - ]; - services.postgresql.ensureUsers = [ - { - name = "moa"; - ensurePermissions = { - "DATABASE moa" = "ALL PRIVILEGES"; - }; - } - ]; - services.caddy.virtualHosts."moa.int.chir.rs" = { - useACMEHost = "int.chir.rs"; - logFormat = pkgs.lib.mkForce ""; - extraConfig = '' - import baseConfig - reverse_proxy http://localhost:5000 { - header_up Host "moa.chir.rs" - } - ''; - }; - sops.secrets."services/moa/secret".owner = "moa"; - sops.secrets."services/moa/twitter_consumer_key".owner = "moa"; - sops.secrets."services/moa/twitter_consumer_secret".owner = "moa"; -} diff --git a/zones/chir.rs.nix b/zones/chir.rs.nix index e0764052..c3007b54 100644 --- a/zones/chir.rs.nix +++ b/zones/chir.rs.nix @@ -124,7 +124,7 @@ with dns.lib.combinators; let SOA = { nameServer = "ns1.chir.rs."; adminEmail = "lotte@chir.rs"; - serial = 23; + serial = 24; }; NS = [ "ns1.chir.rs." @@ -217,7 +217,6 @@ with dns.lib.combinators; let matrix = createZone {}; drone = createZone {}; akko = createZone {}; - moa = createZone {}; cache.CNAME = [ "cache-chir-rs.b-cdn.net." ];