default DEBUG ON

This commit is contained in:
Your Name 2023-09-25 23:22:34 +00:00 committed by Henri Dickson
parent eff92b94ed
commit 8e8d4d1b29
7 changed files with 24 additions and 19 deletions

View file

@ -15,7 +15,7 @@ environ.Env.read_env(os.path.join(BASE_DIR, ".env"))
# ====== List of user configuration variables ====== # ====== List of user configuration variables ======
env = environ.FileAwareEnv( env = environ.FileAwareEnv(
# WARNING: do not run with debug mode turned on in production # WARNING: do not run with debug mode turned on in production
NEODB_DEBUG=(bool, False), NEODB_DEBUG=(bool, True),
# WARNING: must use your own key and keep it secret # WARNING: must use your own key and keep it secret
NEODB_SECRET_KEY=(str), NEODB_SECRET_KEY=(str),
# Site information # Site information
@ -60,16 +60,16 @@ env = environ.FileAwareEnv(
# INTEGRATED TAKAHE CONFIGURATION # INTEGRATED TAKAHE CONFIGURATION
TAKAHE_DB_URL=(str, "postgres://takahe:takahepass@127.0.0.1:5432/takahe"), TAKAHE_DB_URL=(str, "postgres://takahe:takahepass@127.0.0.1:5432/takahe"),
# Spotify - https://developer.spotify.com/ # Spotify - https://developer.spotify.com/
SPOTIFY_API_KEY=(str, ""), SPOTIFY_API_KEY=(str, "TESTONLY"),
# The Movie Database (TMDB) - https://developer.themoviedb.org/ # The Movie Database (TMDB) - https://developer.themoviedb.org/
TMDB_API_V3_KEY=(str, ""), TMDB_API_V3_KEY=(str, "TESTONLY"),
# Google Books - https://developers.google.com/books/docs/v1/using - not used at the moment # Google Books - https://developers.google.com/books/docs/v1/using - not used at the moment
GOOGLE_API_KEY=(str, ""), GOOGLE_API_KEY=(str, "TESTONLY"),
# Discogs - personal access token from https://www.discogs.com/settings/developers # Discogs - personal access token from https://www.discogs.com/settings/developers
DISCOGS_API_KEY=(str, ""), DISCOGS_API_KEY=(str, "TESTONLY"),
# IGDB - https://api-docs.igdb.com/ # IGDB - https://api-docs.igdb.com/
IGDB_CLIENT_ID=(str, ""), IGDB_API_CLIENT_ID=(str, "TESTONLY"),
IGDB_CLIENT_SECRET=(str, ""), IGDB_API_CLIENT_SECRET=(str, ""),
# Discord webhooks # Discord webhooks
DISCORD_WEBHOOKS=(dict, {"user-report": None}), DISCORD_WEBHOOKS=(dict, {"user-report": None}),
# Slack API token, for sending exceptions to Slack, may deprecate in future # Slack API token, for sending exceptions to Slack, may deprecate in future
@ -198,8 +198,8 @@ TMDB_API3_KEY = env("TMDB_API_V3_KEY")
# TMDB_API4_KEY = env('TMDB_API_V4_KEY') # TMDB_API4_KEY = env('TMDB_API_V4_KEY')
# GOOGLE_API_KEY = env('GOOGLE_API_KEY') # GOOGLE_API_KEY = env('GOOGLE_API_KEY')
DISCOGS_API_KEY = env("DISCOGS_API_KEY") DISCOGS_API_KEY = env("DISCOGS_API_KEY")
IGDB_CLIENT_ID = env("IGDB_CLIENT_ID") IGDB_CLIENT_ID = env("IGDB_API_CLIENT_ID")
IGDB_CLIENT_SECRET = env("IGDB_CLIENT_SECRET") IGDB_CLIENT_SECRET = env("IGDB_API_CLIENT_SECRET")
SLACK_TOKEN = env("SLACK_API_TOKEN") SLACK_TOKEN = env("SLACK_API_TOKEN")
SLACK_CHANNEL = "alert" SLACK_CHANNEL = "alert"

View file

@ -19,6 +19,10 @@ _logger = logging.getLogger(__name__)
class DbIndexer: class DbIndexer:
@classmethod
def init(cls):
pass
@classmethod @classmethod
def search(cls, q, page=1, categories=None, tag=None, sort=None): def search(cls, q, page=1, categories=None, tag=None, sort=None):
result = lambda: None result = lambda: None

View file

@ -1,7 +1,7 @@
from django.conf import settings from django.conf import settings
from loguru import logger from loguru import logger
from catalog.search.typesense import Indexer from catalog.search.models import Indexer
from takahe.models import Config as TakaheConfig from takahe.models import Config as TakaheConfig
from takahe.models import Domain as TakaheDomain from takahe.models import Domain as TakaheDomain
from takahe.models import Follow as TakaheFollow from takahe.models import Follow as TakaheFollow

View file

@ -64,7 +64,7 @@ To run local source code with `docker compose`, add `NEODB_DEBUG=True` in `.env`
- code in `NEODB_SRC` (default: .) and `TAKAHE_SRC` (default: ./neodb-takahe) will be mounted and used in the container instead of code in the image - code in `NEODB_SRC` (default: .) and `TAKAHE_SRC` (default: ./neodb-takahe) will be mounted and used in the container instead of code in the image
- `runserver` with autoreload will be used instead of `gunicorn` for both neodb and takahe web server - `runserver` with autoreload will be used instead of `gunicorn` for both neodb and takahe web server
- /static/ and /s/ url are not map to pre-generated static file path - /static/ and /s/ url are not map to pre-generated/collected static file path, `NEODB_DEBUG=True` will locate static files from source code
- one `rqworker` container will be started, instead of two - one `rqworker` container will be started, instead of two
- use `dev-shell` and `dev-root` to invoke shells, instead of `shell` and `root` - use `dev-shell` and `dev-root` to invoke shells, instead of `shell` and `root`
- there's no automatic `migration` container, but it can be triggered manually via `docker compose run dev-shell neodb-init` - there's no automatic `migration` container, but it can be triggered manually via `docker compose run dev-shell neodb-init`

View file

@ -54,6 +54,7 @@ Change essential options like `NEODB_SITE_DOMAIN` in `.env` before starting the
- `NEODB_SITE_DOMAIN` - domain name of your site - `NEODB_SITE_DOMAIN` - domain name of your site
- `NEODB_SECRET_KEY` - encryption key of session data - `NEODB_SECRET_KEY` - encryption key of session data
- `NEODB_DATA` is the path to store db/media/cache, it's `../data` by default, but can be any path that's writable - `NEODB_DATA` is the path to store db/media/cache, it's `../data` by default, but can be any path that's writable
- `NEODB_DEBUG` - set to `False` for production deployment
Optionally, `robots.txt` and `logo.png` may be placed under `$NEODB_DATA/www-root/`. Optionally, `robots.txt` and `logo.png` may be placed under `$NEODB_DATA/www-root/`.

View file

@ -34,7 +34,7 @@ x-shared:
NEODB_REDIS_URL: redis://redis:6379/0 NEODB_REDIS_URL: redis://redis:6379/0
NEODB_SEARCH_URL: typesense://user:eggplant@typesense:8108/catalog NEODB_SEARCH_URL: typesense://user:eggplant@typesense:8108/catalog
NEODB_EMAIL_URL: NEODB_EMAIL_URL:
NEODB_FROM_EMAIL: no-reply@${NEODB_SITE_DOMAIN} NEODB_EMAIL_FROM: no-reply@${NEODB_SITE_DOMAIN}
NEODB_DOWNLOADER_PROXY_LIST: NEODB_DOWNLOADER_PROXY_LIST:
NEODB_DOWNLOADER_BACKUP_PROXY: NEODB_DOWNLOADER_BACKUP_PROXY:
NEODB_DOWNLOADER_SAVE_DIR: NEODB_DOWNLOADER_SAVE_DIR:
@ -51,14 +51,14 @@ x-shared:
TAKAHE_USE_PROXY_HEADERS: true TAKAHE_USE_PROXY_HEADERS: true
TAKAHE_STATOR_CONCURRENCY: 4 TAKAHE_STATOR_CONCURRENCY: 4
TAKAHE_STATOR_CONCURRENCY_PER_MODEL: 2 TAKAHE_STATOR_CONCURRENCY_PER_MODEL: 2
TAKAHE_DEBUG: ${NEODB_DEBUG:-False} TAKAHE_DEBUG: ${NEODB_DEBUG:-True}
TAKAHE_VENV: /takahe-venv TAKAHE_VENV: /takahe-venv
SPOTIFY_API_KEY: SPOTIFY_API_KEY:
TMDB_API_V3_KEY: TMDB_API_V3_KEY:
GOOGLE_API_KEY: GOOGLE_API_KEY:
DISCOGS_API_KEY: DISCOGS_API_KEY:
IGDB_CLIENT_ID: IGDB_API_CLIENT_ID:
IGDB_CLIENT_SECRET: IGDB_API_CLIENT_SECRET:
DISCORD_WEBHOOKS: DISCORD_WEBHOOKS:
SLACK_API_TOKEN: SLACK_API_TOKEN:
restart: "on-failure" restart: "on-failure"

View file

@ -10,7 +10,10 @@ NEODB_SITE_DOMAIN=example.site
NEODB_SITE_NAME=Example Site NEODB_SITE_NAME=Example Site
NEODB_SITE_LOGO=/logo.png NEODB_SITE_LOGO=/logo.png
NEODB_SITE_ICON=/icon.png NEODB_SITE_ICON=/icon.png
NEODB_SITE_LINKS=关注NiceDB=https://donotban.com/@testie,关注NeoDB=https://mastodon.social/@neodb NEODB_SITE_LINKS=@NiceDB=https://donotban.com/@testie,@NeoDB=https://mastodon.social/@neodb
# Turn off DEBUG if you are running as production service
NEODB_DEBUG=False
# HTTP port your reverse proxy should send request to # HTTP port your reverse proxy should send request to
# NEODB_PORT=8000 # NEODB_PORT=8000
@ -27,8 +30,5 @@ NEODB_SITE_LINKS=关注NiceDB=https://donotban.com/@testie,关注NeoDB=https://m
# TAKAHE_STATOR_CONCURRENCY=10 # TAKAHE_STATOR_CONCURRENCY=10
# TAKAHE_STATOR_CONCURRENCY_PER_MODEL=10 # TAKAHE_STATOR_CONCURRENCY_PER_MODEL=10
# Turn on DEBUG mode, either set this to True or don't set it at all
# NEODB_DEBUG=True
# pull NeoDB Docker image from another tag/branch # pull NeoDB Docker image from another tag/branch
# NEODB_IMAGE=neodb/neodb:latest # NEODB_IMAGE=neodb/neodb:latest