Synology Package Repository
Synology Package Repository
~/.config/direnv/direnvrc
docker compose up db
poetry install
poetry shell
flask db upgrade
flask spkrepo populate_db
flask spkrepo create_user -u admin -e [email protected] -p adminadmin
flask roles add [email protected] admin
flask roles add [email protected] package_admin
flask roles add [email protected] developer
To clean data created by fake packages, run flask spkrepo depopulate_db
docker compose up db
flask run
pytest -v
docker compose up app
docker compose up
Create a config file ./config.py
to disable debug logs, connect to a database, set a secure key and optionally set a cache:
Use LC_CTYPE=C tr -cd '[:print:]' < /dev/urandom | head -c 64
or base64 < /dev/urandom | head -c 64
to get a random string
DEBUG = False
TESTING = False
SECRET_KEY = "Please-change-me-to-some-random-string"
SQLALCHEMY_ECHO = False
SQLALCHEMY_DATABASE_URI = "postgresql://user:pass@localhost/dbname"
# https://pythonhosted.org/Flask-Caching/#configuring-flask-caching
CACHE_TYPE= "SimpleCache"
# For signing packages
GNUPG_PATH= "/usr/local/bin/gpg"
Example usage:
docker run -it --rm --name spkrepo -v $(pwd)/data:/data -p 8000:8000 ghcr.io/synocommunity/spkrepo
Additional configuration can be mounted in the container and loaded by putting
the path into SPKREPO_CONFIG
environment variable.
e.g.
docker run -it --rm --name spkrepo -v $(pwd)/data:/data -v $(pwd)/docker-config.py:/docker-config.py -e SPKREPO_CONFIG=/docker-config.py -p 8000:8000 ghcr.io/synocommunity/spkrepo
Example:
pip install gunicorn
SPKREPO_CONFIG="$PWD/config.py" gunicorn -w 4 'wsgi:app'
cd migrations/
alembic revision -m "update build path length"