diff --git a/boofilsic/settings.py b/boofilsic/settings.py index c2a1f077..f0d2cdfe 100644 --- a/boofilsic/settings.py +++ b/boofilsic/settings.py @@ -66,6 +66,8 @@ NEODB_DOWNLOADER_CACHE_TIMEOUT=(int, 300), # Number of retries of downloader, when site is using RetryDownloader NEODB_DOWNLOADER_RETRIES=(int, 3), + # Disable cron jobs + NEODB_DISABLE_CRON=(bool, False), # INTEGRATED TAKAHE CONFIGURATION TAKAHE_DB_URL=(str, "postgres://takahe:takahepass@127.0.0.1:5432/takahe"), # Spotify - https://developer.spotify.com/ @@ -220,6 +222,8 @@ DOWNLOADER_CACHE_TIMEOUT = env("NEODB_DOWNLOADER_CACHE_TIMEOUT") DOWNLOADER_RETRIES = env("NEODB_DOWNLOADER_RETRIES") +DISABLE_CRON = env("NEODB_DISABLE_CRON") + # ====== USER CONFIGUTRATION END ====== DATABASE_ROUTERS = ["takahe.db_routes.TakaheRouter"] @@ -502,7 +506,7 @@ # CORS_ALLOWED_ORIGINS = [] # CORS_ALLOWED_ORIGIN_REGEXES = [] CORS_ALLOW_ALL_ORIGINS = True -CORS_URLS_REGEX = r"^/api/.*$" +CORS_URLS_REGEX = r"^/(api|nodeinfo)/.*$" CORS_ALLOW_METHODS = ( "DELETE", "GET", diff --git a/boofilsic/urls.py b/boofilsic/urls.py index 17576bfc..551bcc44 100644 --- a/boofilsic/urls.py +++ b/boofilsic/urls.py @@ -34,6 +34,10 @@ "users/OAuth2_login/", RedirectView.as_view(url="/account/login/oauth", query_string=True), ), + path( + "auth/edit", # some apps like elk will use this url + RedirectView.as_view(url="/account/profile", query_string=True), + ), path("", include("catalog.urls")), path("", include("journal.urls")), path("timeline/", include("social.urls")), diff --git a/common/setup.py b/common/setup.py index be1d9e07..93ae883e 100644 --- a/common/setup.py +++ b/common/setup.py @@ -152,6 +152,9 @@ def run(self): Indexer.init() # Register cron jobs if not yet - JobManager.schedule_all() + if settings.DISABLE_CRON: + logger.info("Cron jobs are disabled.") + else: + JobManager.schedule_all() logger.info("Finished post-migration setup.") diff --git a/compose.yml b/compose.yml index 64027a5d..c3e96dca 100644 --- a/compose.yml +++ b/compose.yml @@ -30,6 +30,7 @@ x-shared: NEODB_LOGIN_MASTODON_WHITELIST: NEODB_MASTODON_CLIENT_SCOPE: NEODB_DISABLE_DEFAULT_RELAY: + NEODB_DISABLE_CRON: NEODB_SENTRY_DSN: TAKAHE_SENTRY_DSN: NEODB_DB_URL: postgres://neodb:aubergine@neodb-db/neodb