spkrepo
Synology Package Repository
Development
Requirements
- Install docker and docker-compose
- Install uv
- Install pre-commit e.g.
uv tool install pre-commit
Installation
- Run postgres, e.g. using docker with
docker compose up db - Install dependencies with
uv sync - Create the tables with
uv run flask db upgrade - Populate the database with some fake packages with
uv run flask spkrepo populate_db - Add an admin account with
uv run flask spkrepo create_admin -u admin -e admin@synocommunity.com -p adminadmin
To clean data created by fake packages, run uv run flask spkrepo depopulate_db
Run
- Start postgres with
docker compose up db - Start the development server with
uv run flask run - Website is available at http://localhost:5000
- Admin interface is available at http://localhost:5000/admin
- NAS interface is available at http://localhost:5000/nas
- API is available at http://localhost:5000/api
- Run the test suite with
uv run pytest -v
spkrepo CLI Usage
Usage: flask spkrepo [OPTIONS] COMMAND [ARGS]...
Spkrepo admin commands.
Options:
--help Show this message and exit.
Commands:
clean Clean data path.
create_admin Create a new admin user.
create_user Create a new user with an activated account.
depopulate_db Depopulate database.
populate_db Populate the database with some packages.
- Add a user with
uv run flask spkrepo create_user -u admin -e admin@synocommunity.com -p adminadmin - Grant the created user with Administrator permissions
uv run flask roles add admin@synocommunity.com admin - Grant the created user with Package Administrator permissions
uv run flask roles add admin@synocommunity.com package_admin - Grant the created user with Developer permissions
uv run flask roles add admin@synocommunity.com developer
Docker Compose Run
- If you also want to run the app in docker you can with
docker compose up app - You can run both postgres and the app with
docker compose up
Deployment
Configuration
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"
Run Tests & Linters
uv run pytest -v
uvx pre-commit run --all-files
Docker
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
Serve app via a WSGI server.
Example:
# Production
SPKREPO_CONFIG="$PWD/config.py" gunicorn -w 4 'wsgi:app'
# Development
SPKREPO_CONFIG="$PWD/config.py" uv run gunicorn -b 0.0.0.0:8080 -w 4 wsgi:app
Add migration
uv run flask db revision -m "update build path length"
Test NAS API
curl "http://localhost:5000/nas?package_update_channel=beta&build=24922&language=enu&major=6µ=2&arch=x86_64&minor=2"
Metadata
Release files for spkrepo 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| spkrepo-0.9.0.tar.gz | 1.2 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| spkrepo-0.9.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.2 MB
Release files / spkrepo-0.9.0.tar.gz
| Download URL | spkrepo-0.9.0.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e055e0ab43e3397937b672a3a7e6fe89bb62ad0293520a0239b08d9137a0021
|
|
BLAKE2b-256 checksum How to use checksums |
df7dea02634a772a9da523f422d131a9b6fdeb075ec1c4970bfaf745264bec4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / spkrepo-0.9.0-py3-none-any.whl
| Download URL | spkrepo-0.9.0-py3-none-any.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7d226faa5a1a5f1245d0f37aa9dfadea06c0ff390c3433fd7ff99df2a3f5d785
|
|
BLAKE2b-256 checksum How to use checksums |
b98e1e932007b12123e4edf97136f28258af870965c266cdb2f9f007c8d110c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for spkrepo 0.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.