{"id":13579282,"url":"https://github.com/SynoCommunity/spkrepo","last_synced_at":"2025-04-05T20:33:32.514Z","repository":{"id":23927981,"uuid":"27308743","full_name":"SynoCommunity/spkrepo","owner":"SynoCommunity","description":"Synology Package Repository","archived":false,"fork":false,"pushed_at":"2024-04-12T22:13:57.000Z","size":952,"stargazers_count":139,"open_issues_count":13,"forks_count":25,"subscribers_count":21,"default_branch":"main","last_synced_at":"2024-04-14T08:49:15.267Z","etag":null,"topics":["python","synology"],"latest_commit_sha":null,"homepage":"http://spkrepo.readthedocs.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"jitpack/android-example","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SynoCommunity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"synocommunity","open_collective":"synocommunity"}},"created_at":"2014-11-29T16:59:00.000Z","updated_at":"2024-04-15T22:01:58.292Z","dependencies_parsed_at":"2023-12-30T10:32:51.793Z","dependency_job_id":"15cccc89-9069-472c-bdcf-026d44e8b99e","html_url":"https://github.com/SynoCommunity/spkrepo","commit_stats":{"total_commits":146,"total_committers":13,"mean_commits":11.23076923076923,"dds":0.726027397260274,"last_synced_commit":"c2b385e60ce7cbf6bb6007bae1ad03a1c6e3aabe"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SynoCommunity%2Fspkrepo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SynoCommunity%2Fspkrepo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SynoCommunity%2Fspkrepo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SynoCommunity%2Fspkrepo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SynoCommunity","download_url":"https://codeload.github.com/SynoCommunity/spkrepo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399874,"owners_count":20932876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","synology"],"created_at":"2024-08-01T15:01:38.021Z","updated_at":"2025-04-05T20:33:27.506Z","avatar_url":"https://github.com/SynoCommunity.png","language":"Python","funding_links":["https://github.com/sponsors/synocommunity","https://opencollective.com/synocommunity"],"categories":["Python"],"sub_categories":[],"readme":"# spkrepo\nSynology Package Repository\n\n![Build](https://img.shields.io/github/actions/workflow/status/SynoCommunity/spkrepo/build.yml?branch=main\u0026style=for-the-badge)\n[![Discord](https://img.shields.io/discord/732558169863225384?color=7289DA\u0026label=Discord\u0026logo=Discord\u0026logoColor=white\u0026style=for-the-badge)](https://discord.gg/nnN9fgE7EF)\n\n\n## Development\n### Requirements\n1. Install docker and docker-compose\n2. Install python and poetry\n3. Optionally install direnv and a working poetry layout as described [here](https://github.com/direnv/direnv/issues/592#issuecomment-856227234) in your `~/.config/direnv/direnvrc`\n\n### Installation\n1. Run postgres, e.g. using docker with `docker compose up db`\n2. Install dependencies with `poetry install`\n3. Run the next commands in the virtual environment `poetry shell`\n4. Create the tables with `flask db upgrade`\n5. Populate the database with some fake packages with `flask spkrepo populate_db`\n6. Add a user with `flask spkrepo create_user -u admin -e admin@synocommunity.com -p adminadmin`\n7. Grant the created user with Administrator permissions `flask roles add admin@synocommunity.com admin`\n8. Grant the created user with Package Administrator permissions `flask roles add admin@synocommunity.com package_admin`\n9. Grant the created user with Developer permissions `flask roles add admin@synocommunity.com developer`\n\nTo clean data created by fake packages, run `flask spkrepo depopulate_db`\n\n### Run\n1. Start postgres with `docker compose up db`\n2. Start the development server with `flask run`\n3. Website is available at http://localhost:5000\n4. Admin interface is available at http://localhost:5000/admin\n5. NAS interface is available at http://localhost:5000/nas\n6. API is available at http://localhost:5000/api\n7. Run the test suite with `pytest -v`\n\n## Docker Compose Run\n- If you also want to run the app in docker you can with `docker compose up app`\n- You can run both postgres and the app with `docker compose up`\n\n\n## Deployment\n### Configuration\nCreate a config file `./config.py` to disable debug logs, connect to a database, set a secure key and optionally set a cache:\n\nUse `LC_CTYPE=C tr -cd '[:print:]' \u003c /dev/urandom | head -c 64` or `base64 \u003c /dev/urandom | head -c 64` to get a random string\n\n```python\nDEBUG = False\nTESTING = False\nSECRET_KEY = \"Please-change-me-to-some-random-string\"\nSQLALCHEMY_ECHO = False\nSQLALCHEMY_DATABASE_URI = \"postgresql://user:pass@localhost/dbname\"\n# https://pythonhosted.org/Flask-Caching/#configuring-flask-caching\nCACHE_TYPE= \"SimpleCache\"\n# For signing packages\nGNUPG_PATH= \"/usr/local/bin/gpg\"\n```\n\n\n### Docker\nExample usage:\n\n```bash\ndocker run -it --rm --name spkrepo -v $(pwd)/data:/data -p 8000:8000 ghcr.io/synocommunity/spkrepo\n```\n\nAdditional configuration can be mounted in the container and loaded by putting\nthe path into `SPKREPO_CONFIG` environment variable.\n\ne.g.\n```bash\ndocker 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\n```\n\n\n### Serve app via [a WSGI server](https://flask.palletsprojects.com/en/1.1.x/deploying/).\nExample:\n\n```bash\npip install gunicorn\nSPKREPO_CONFIG=\"$PWD/config.py\" gunicorn -w 4 'wsgi:app'\n```\n\n## Add migration\n\n```\ncd migrations/\nalembic revision -m \"update build path length\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSynoCommunity%2Fspkrepo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSynoCommunity%2Fspkrepo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSynoCommunity%2Fspkrepo/lists"}