Backend: - User.role (user/uploader/staff) with can_upload; uploads and downloads gated to uploader+; owners and staff can edit their items - MediaItem.uploaded_by plus J-<id> identity (serializer, admin, scan_files --user, first superuser as default owner) - API resolves J-<id>, bare numeric ids and MD5s; neighbors and lookup return j_ids - Guest safety: mirror e621's anonymous default blacklist into Redis (parses comments, negations and wildcards), flag hidden_from_guests and filter lists, details and lookups for anonymous users - POST /api/online/downloads/ writes an e621 file into the watched folder and indexes it for the uploader - MariaDB + Redis via docker compose (host ports 3307/6380), PyMySQL driver shim, Redis cache replacing the file cache; SQLite data dumped and loaded into MariaDB Frontend: - Single /detail/:itemId route with an adaptive shell: J-<id> renders the library item, bare numbers render the e621 post - Legacy /view/<md5> and /online/view/<id> redirect to canonical URLs - Cards expose J-IDs; library custom-data editor is read-only for non-owners - Role gating: Upload hidden/blocked for regular users, account shows the role, guest hint on the library
21 lines
601 B
Bash
21 lines
601 B
Bash
SECRET_KEY=change-me-to-a-long-random-string
|
|
DEBUG=True
|
|
ALLOWED_HOSTS=localhost,127.0.0.1
|
|
# Absolute path to your media folder, or relative to the backend/ folder.
|
|
WATCHED_FOLDER=media/library
|
|
|
|
# MariaDB (docker compose at the repo root)
|
|
DB_HOST=127.0.0.1
|
|
DB_PORT=3307
|
|
DB_NAME=j621
|
|
DB_USER=j621
|
|
DB_PASSWORD=j621
|
|
|
|
# Redis (docker compose at the repo root)
|
|
REDIS_URL=redis://127.0.0.1:6380/1
|
|
|
|
# Guest visibility: e621's anonymous default blacklist is mirrored into
|
|
# Redis by `manage.py refresh_guest_blacklist`.
|
|
# GUEST_BLACKLIST_FALLBACK=young,cub,shota,loli,child,underage
|
|
# GUEST_BLACKLIST_TTL=3600
|