Giter Site home page Giter Site logo

ahuachen / spkrepo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from synocommunity/spkrepo

0.0 1.0 0.0 442 KB

Synology Package Repository

Home Page: http://spkrepo.readthedocs.org

License: MIT License

Python 92.97% CSS 0.35% JavaScript 0.03% Mako 0.17% HTML 6.28% Dockerfile 0.20%

spkrepo's Introduction

spkrepo

Synology Package Repository

Build

Development

Installation

  1. Install dependencies with poetry install
  2. Run the next commands in the virtual environment poetry shell
  3. Create the tables with python manage.py db create
  4. Populate the database with some fake packages with python manage.py db populate
  5. Add an user with python manage.py user create -u Admin -e [email protected] -p adminadmin
  6. Grant the created user with admin permissions python manage.py user add_role -u [email protected] -r admin

To reset the environment, clean up with python manage.py clean.

Run

  1. Start the development server with python manage.py runserver
  2. Website is available at http://localhost:5000
  3. Admin interface is available at http://localhost:5000/admin
  4. NAS interface is available at http://localhost:5000/nas
  5. API is available at http://localhost:5000/api
  6. Run the test suite with python manage.py test

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= "simple"
# For signing packages
GNUPG_PATH= "/usr/local/bin/gpg"

Docker

Example usage:

docker run -it --rm --name spkrepo -v $(pwd)/data:/data -v $(pwd)/docker-config.py:/usr/src/app/spkrepo/config.py -p 8000:8000 synocommunity/spkrepo

Serve app via a WSGI server.

Example:

pip install gunicorn
SPKREPO_CONFIG="$PWD/config.py" gunicorn -w 4 'wsgi:app'

spkrepo's People

Contributors

diaoul avatar hgy59 avatar ymartin59 avatar dr-bean avatar anonym-tsk avatar publicarray avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.