From 948a5dea105cc8ee3625099af1c9a032e14a11e2 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 7 Jun 2021 12:53:57 -0700 Subject: [PATCH] Cleans up .env and settings files Some outdated stuff doesn't need to be in there --- .env.dev.example | 11 +---------- .env.prod.example | 11 +---------- .github/workflows/django-tests.yml | 1 - bookwyrm/settings.py | 10 +++------- 4 files changed, 5 insertions(+), 28 deletions(-) diff --git a/.env.dev.example b/.env.dev.example index 03e6ef25..926a0e41 100644 --- a/.env.dev.example +++ b/.env.dev.example @@ -13,16 +13,10 @@ DEFAULT_LANGUAGE="English" ## Leave unset to allow all hosts # ALLOWED_HOSTS="localhost,127.0.0.1,[::1]" -OL_URL=https://openlibrary.org - -## Database backend to use. -## Default is postgres, sqlite is for dev quickstart only (NOT production!!!) -BOOKWYRM_DATABASE_BACKEND=postgres - MEDIA_ROOT=images/ POSTGRES_PORT=5432 -POSTGRES_PASSWORD=fedireads +POSTGRES_PASSWORD=securedbypassword123 POSTGRES_USER=fedireads POSTGRES_DB=fedireads POSTGRES_HOST=db @@ -47,6 +41,3 @@ EMAIL_HOST_USER=mail@your.domain.here EMAIL_HOST_PASSWORD=emailpassword123 EMAIL_USE_TLS=true EMAIL_USE_SSL=false - -# Set this to true when initializing certbot for domain, false when not -CERTBOT_INIT=false diff --git a/.env.prod.example b/.env.prod.example index dd15fbb7..4a7c87b6 100644 --- a/.env.prod.example +++ b/.env.prod.example @@ -13,16 +13,10 @@ DEFAULT_LANGUAGE="English" ## Leave unset to allow all hosts # ALLOWED_HOSTS="localhost,127.0.0.1,[::1]" -OL_URL=https://openlibrary.org - -## Database backend to use. -## Default is postgres, sqlite is for dev quickstart only (NOT production!!!) -BOOKWYRM_DATABASE_BACKEND=postgres - MEDIA_ROOT=images/ POSTGRES_PORT=5432 -POSTGRES_PASSWORD=securedbpassword123 +POSTGRES_PASSWORD=securedbypassword123 POSTGRES_USER=fedireads POSTGRES_DB=fedireads POSTGRES_HOST=db @@ -47,6 +41,3 @@ EMAIL_HOST_USER=mail@your.domain.here EMAIL_HOST_PASSWORD=emailpassword123 EMAIL_USE_TLS=true EMAIL_USE_SSL=false - -# Set this to true when initializing certbot for domain, false when not -CERTBOT_INIT=false diff --git a/.github/workflows/django-tests.yml b/.github/workflows/django-tests.yml index 75c1c4b4..f9159efe 100644 --- a/.github/workflows/django-tests.yml +++ b/.github/workflows/django-tests.yml @@ -50,7 +50,6 @@ jobs: SECRET_KEY: beepbeep DEBUG: true DOMAIN: your.domain.here - OL_URL: https://openlibrary.org BOOKWYRM_DATABASE_BACKEND: postgres MEDIA_ROOT: images/ POSTGRES_PASSWORD: hunter2 diff --git a/bookwyrm/settings.py b/bookwyrm/settings.py index 48e02b67..00c3d023 100644 --- a/bookwyrm/settings.py +++ b/bookwyrm/settings.py @@ -52,7 +52,6 @@ SECRET_KEY = env("SECRET_KEY") DEBUG = env.bool("DEBUG", True) ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", ["*"]) -OL_URL = env("OL_URL") # Application definition @@ -114,10 +113,8 @@ STREAMS = ["home", "local", "federated"] # Database # https://docs.djangoproject.com/en/3.2/ref/settings/#databases -BOOKWYRM_DATABASE_BACKEND = env("BOOKWYRM_DATABASE_BACKEND", "postgres") - -BOOKWYRM_DBS = { - "postgres": { +DATABASES = { + "default": { "ENGINE": "django.db.backends.postgresql_psycopg2", "NAME": env("POSTGRES_DB", "fedireads"), "USER": env("POSTGRES_USER", "fedireads"), @@ -127,8 +124,6 @@ BOOKWYRM_DBS = { }, } -DATABASES = {"default": BOOKWYRM_DBS[BOOKWYRM_DATABASE_BACKEND]} - LOGIN_URL = "/login/" AUTH_USER_MODEL = "bookwyrm.User" @@ -136,6 +131,7 @@ AUTH_USER_MODEL = "bookwyrm.User" # Password validation # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators +# pylint: disable=line-too-long AUTH_PASSWORD_VALIDATORS = [ { "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",