Sign inSign up

bthlabs/hotpocket

By bthlabs

Updated about 1 month ago

Minimal self-hosted bookmarking app :)

Image
0

1.1K

bthlabs/hotpocket repository overview

HotPocket by BTHLabs

HotPocket is a minimal, open-source bookmarking app. Save links from all the major browsers, across mobile and desktop devices. Built to be self-hosted, HotPocket puts you in control of your data.

Available images

There are two deployment images - aio and deployment.

The AIO image

The aio image is pre-configured for running small instances in a single container:

  • It defaults to SQLite database.
  • It defaults to running all background tasks in the foreground.
  • It defaults to accepting traffic with any Host HTTP header.

The aio image is recommended for self-hosting with minimal use, e.g. by a single user.

Example:

$ docker run --rm -it \
    -v `realpath run/`:/srv/run \
    -e HOTPOCKET_BACKEND_SECRET_KEY=thisisntright \
    -e HOTPOCKET_BACKEND_INITIAL_ACCOUNT_USERNAME=hotpocket \
    -e HOTPOCKET_BACKEND_INITIAL_ACCOUNT_PASSWORD=hotpocketm4st3r \
    -p 8000:8000 \
    bthlabs/hotpocket:aio-v25.11.26-01

The command above will set up and start the application. The SQLite file will be placed in run/hotpocket-backend-aio.sqlite and database migrations will be ran. The initial superuser account will be created with the specified credentials. The Web app will be reachable at http://127.0.0.1:8000/. The admin will be reachable at http://127.0.0.1:8000/admin/.

The DJANGO_SETTINGS_MODULE environment variable defaults to hotpocket_backend.settings.deployment.aio.

NOTE: The command above specifies wildly insecure SECRET_KEY which is used among other things to secure the session cookie. Please please please don't run it like this. Not even in your homelab :).

The deployment/aio/docker-compose.yaml file can be used as a starting point for AIO deployments.

The Deployment image

The deployment image doesn't make any assumptions about the env and in turn will require the operator to configure database, Celery broker and result backend etc. The final deployment will require services for at least the Web app, the Celery worker and Celery Beat. Admin is optional.

The DJANGO_SETTINGS_MODULE environment variable defaults to hotpocket_backend.settings.deployment.webapp. This should be set to hotpocket_backend.settings.deployment.admin in the Admin container.

The deployment/fullstack/docker-compose.yaml file can be used as a starting point for full-stack deployments.

Configuration environment variables

HotPocket deployment images provide extensive set of environment variables that can be used to configure the services.

VariableDefaultDescription
HOTPOCKET_BACKEND_ENVdeployment or aioThe environment name. See below.
HOTPOCKET_BACKEND_APPwebappThe app name. See below.
HOTPOCKET_BACKEND_DEBUGfalseDjango DEBUG setting. Do not enable in production. Only effective in the AIO image.
HOTPOCKET_BACKEND_ALLOWED_HOSTSN/A or *Django ALLOWED_HOSTS setting. Required in the Deployment image.
HOTPOCKET_BACKEND_SECRET_KEYN/ADjango SECRET_KEY setting. Recommended different for the Web app and Admin. Required.
HOTPOCKET_BACKEND_DATABASE_ENGINEdjango.db.backends.postgresql or django.db.backends.sqlite3The database configuration engine.
HOTPOCKET_BACKEND_DATABASE_NAMEN/A or /srv/run/hotpocket-backend-aio.sqliteThe database name.
HOTPOCKET_BACKEND_DATABASE_USERN/A or N/AThe database user.
HOTPOCKET_BACKEND_DATABASE_PASSWORDN/AThe database password.
HOTPOCKET_BACKEND_DATABASE_HOSTN/AThe database host.
HOTPOCKET_BACKEND_DATABASE_PORT5432 or N/AThe database port.
HOTPOCKET_BACKEND_MODEL_AUTH_IS_DISABLEDfalseSet to true to disable username and password login.
HOTPOCKET_BACKEND_OIDC_PAYLOADN/AThe OIDC configuration payload.
HOTPOCKET_BACKEND_CELERY_BROKER_URLN/AThe Celery broker URL.
HOTPOCKET_BACKEND_CELERY_RESULT_BACKENDN/AThe Celery result backend URL.
HOTPOCKET_BACKEND_CELERY_IGNORE_RESULTfalseSet to true to prevent Celery from saving task results.
HOTPOCKET_BACKEND_CELERY_ALWAYS_EAGERfalseSet to true to run Celery tasks in the foreground.
HOTPOCKET_BACKEND_UPLOADS_PATH/srv/uploads or /srv/run/uploadsThe absolute path to user-uploaded files.
HOTPOCKET_BACKEND_GUNICORN_WORKERS4 or 2The number of Gunicorn workers to run for Web servers.
HOTPOCKET_BACKEND_RUN_MIGRATIONSfalse or trueSet to true to run database muigrations when the container starts.
HOTPOCKET_BACKEND_INITIAL_ACCOUNT_USERNAMEN/AUsername for the initial account.
HOTPOCKET_BACKEND_INITIAL_ACCOUNT_PASSWORDN/APassword for the initial account.
HOTPOCKET_BACKEND_OPERATOR_EMAILN/AInstance operator's e-mail. Used to display extra language on login page.

Env and App settings

The HOTPOCKET_BACKEND_ENV and HOTPOCKET_BACKEND_APP variables are used internally to resolve other settings and identify the running app. HOTPOCKET_BACKEND_ENV should only be changed if when creating heavily customized version of the project. HOTPOCKET_BACKEND_APP should generally be set to admin only in the Admin container.

OIDC login configuration

The HOTPOCKET_BACKEND_OIDC_PAYLOAD can be used to enable OIDC login. It must be a JSON string that deserializes to the following object:

{
  "endpoint": "https://some.oidc.host/some-realm/",
  "key": "client-key",
  "secret": "client-secret",
  "scope": ["roles"],
  "display_name": "My OIDC server"
}

The scope field specified additional scopes to request from IdP. It can be ommited and defaults to ["roles"]. The display_name field specifies the method's name in the UI and defaults to OIDC.

NOTE: Currently, only Keycloak has been tested with this login method.

Volumes

Both images declare /srv/run to be a volume. It's intended to keep the service's runtime data, including but not limited to PID files, UNIX sockets etc. It's recommended to persist this volume.

Additionally, the deployment image declares /srv/uploads to be a volume. It's recommeded to persist this volume.

Author

HotPocket is developed by BTHLabs.

License

HotPocket is licensed under the Apache 2.0 License.

Tag summary

Content type

Image

Digest

sha256:a4edee9c5

Size

183.7 MB

Last updated

about 1 month ago

docker pull bthlabs/hotpocket:aio-v26.8.20-01