Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# FROM ghcr.io/linuxserver/baseimage-alpine:3.20
FROM python:3.11.9-alpine3.20
# BUILD COMMAND:
# docker build . --no-cache -t conreq
# mkdir config
# RUN COMMAND (Windows):
# docker run -p '7575:7575/tcp' -v $PWD/config:/config conreq
# RUN COMMAND (Linux/Mac):
# docker run -p '7575:7575/tcp' -v $(pwd)/config:/config conreq
FROM python:3.12.12-alpine3.21

ENV DATA_DIR=/config DEBUG=False

Expand Down Expand Up @@ -41,7 +47,9 @@ RUN \
&& \
echo "**** Install Python dependencies ****" \
&& \
pip3 install --no-cache-dir -U -r /app/conreq/requirements/main.txt \
pip3 install uv \
&& \
uv pip install --system --no-cache-dir -U -r /app/conreq/requirements/main.txt \
&& \
echo "**** Cleanup ****" \
&& \
Expand Down
4 changes: 1 addition & 3 deletions conreq/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
ASGI config for Conreq project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""

# pylint: disable=wrong-import-position
from django.core.asgi import get_asgi_application
from django.urls import path
Expand Down
Empty file removed conreq/core/api/__init__.py
Empty file.
5 changes: 0 additions & 5 deletions conreq/core/api/admin.py

This file was deleted.

6 changes: 0 additions & 6 deletions conreq/core/api/apps.py

This file was deleted.

Empty file.
15 changes: 0 additions & 15 deletions conreq/core/api/models.py

This file was deleted.

18 changes: 0 additions & 18 deletions conreq/core/api/permissions.py

This file was deleted.

33 changes: 0 additions & 33 deletions conreq/core/api/serializers.py

This file was deleted.

54 changes: 0 additions & 54 deletions conreq/core/api/urls.py

This file was deleted.

189 changes: 0 additions & 189 deletions conreq/core/api/views.py

This file was deleted.

4 changes: 2 additions & 2 deletions conreq/core/arrs/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
ARR_REFRESH_INTERNAL = get_str_from_env("ARR_REFRESH_INTERNAL", "*/1")


@db_periodic_task(crontab(minute=ARR_REFRESH_INTERNAL, strict=True))
@db_periodic_task(crontab(minute=ARR_REFRESH_INTERNAL, strict=True), expires=120)
def refresh_radarr_library():
"""Checks Radarr for new entries."""
RadarrManager().refresh_library()


@db_periodic_task(crontab(minute=ARR_REFRESH_INTERNAL, strict=True))
@db_periodic_task(crontab(minute=ARR_REFRESH_INTERNAL, strict=True), expires=120)
def refresh_sonarr_library():
"""Checks Sonarr for new entries."""
SonarrManager().refresh_library()
8 changes: 5 additions & 3 deletions conreq/core/base/management/commands/preconfig_conreq.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ def setup_sqlite_database(path, name, uid, gid, no_perms):
if not os.path.exists(path):
print("> Creating database")
with sqlite3.connect(path) as cursor:
print("> Optimizing database")
cursor.execute("PRAGMA optimize;")
print("> Vacuuming database")
cursor.execute("VACUUM")
print("> Configuring database")
cursor.execute("PRAGMA journal_mode = WAL;")
cursor.execute("VACUUM;")
print("> Reindexing database")
Comment on lines +82 to +86
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question (bug_risk): The SQLite preconfig now omits configuring WAL or other durability-related PRAGMAs, which might be unintentional given the runtime settings.

This function used to enforce PRAGMA journal_mode = WAL;, but now only runs PRAGMA optimize;, VACUUM;, and REINDEX;. Meanwhile, the runtime config attempts to set WAL via OPTIONS that sqlite3.connect ignores (see comment on init_command/transaction_mode), so the DB may silently stay in the default DELETE mode. If WAL (and related durability PRAGMAs) are required, we should either keep an explicit journal_mode = WAL here or switch to a runtime configuration mechanism that SQLite actually honors.

cursor.execute("REINDEX;")
if not no_perms and (uid != -1 or gid != -1) and sys.platform == "linux":
# pylint: disable=no-member
print("> Applying permissions")
Expand Down
Loading
Loading