@@ -7,37 +7,33 @@ Synology Package Repository
7
7
8
8
## Development
9
9
### Installation
10
- 1 . Install dependencies with ` poetry install `
11
- 2 . Run the next commands in the virtual environment ` poetry shell `
12
- 3 . Create the tables with ` python manage.py create `
13
- 4 . Populate the database with some fake packages with ` python manage.py populate `
14
- 5 . Add an user with
` python manage.py user create -u Admin -e [email protected] -p adminadmin `
15
- 6 . Grant the created user with Administrator permissions
` python manage.py roles add [email protected] admin `
16
- 7 . Grant the created user with Package Administrator permissions
` python manage.py roles add [email protected] package_admin `
17
- 8 . Grant the created user with Developer permissions
` python manage.py roles add [email protected] developer `
18
-
19
- To reset the environment, clean up with ` python manage.py clean ` .
10
+ 1 . Run postgres, e.g. using docker with ` docker-compose up db `
11
+ 2 . Install dependencies with ` poetry install `
12
+ 3 . Run the next commands in the virtual environment ` poetry shell `
13
+ 4 . Create the tables with ` flask db upgrade `
14
+ 5 . Populate the database with some fake packages with ` flask spkrepo populate_db `
15
+ 6 . Add a user with
` flask users create username:admin email:[email protected] --password adminadmin `
16
+ 7 . Grant the created user with Administrator permissions
` flask roles add [email protected] admin `
17
+ 8 . Grant the created user with Package Administrator permissions
` flask roles add [email protected] package_admin `
18
+ 9 . Grant the created user with Developer permissions
` flask roles add [email protected] developer `
19
+
20
+ To clean data created by fake packages, run ` flask spkrepo clean `
20
21
21
22
### Run
22
- 1 . Start the development server with ` python manage.py run `
23
- 2 . Website is available at http://localhost:5000
24
- 3 . Admin interface is available at http://localhost:5000/admin
25
- 4 . NAS interface is available at http://localhost:5000/nas
26
- 5 . API is available at http://localhost:5000/api
27
- 6 . Run the test suite with ` poetry run pytest -v `
23
+ 1 . Start postgres with ` docker-compose up db `
24
+ 2 . Start the development server with ` flask run `
25
+ 3 . Website is available at http://localhost:5000
26
+ 4 . Admin interface is available at http://localhost:5000/admin
27
+ 5 . NAS interface is available at http://localhost:5000/nas
28
+ 6 . API is available at http://localhost:5000/api
29
+ 7 . Run the test suite with ` pytest -v `
28
30
29
31
## Docker Compose Run
30
- It is also possible to start a development environment with postgres database
31
- using docker compose:
32
- 1 . Build and run ` docker-compose up --build `
33
- 2 . On first run you can apply database migrations with ` docker exec spkrepo_spkrepo_1 python manage.py db upgrade ` .
34
- Also run any other command that you need (populate the databse, create user) as mentioned above but by prefixing
35
- with ` docker exec {container_id} [...] ` .
36
- 3 . Browse to http://localhost:5000
37
- 4 . To tear down the environment, run ` docker-compose down --remove `
32
+ - If you also want to run the app in docker you can with ` docker-compose up app `
33
+ - You can run both postgres and the app with ` docker-compose up `
38
34
39
- ## Deployment
40
35
36
+ ## Deployment
41
37
### Configuration
42
38
Create a config file ` ./config.py ` to disable debug logs, connect to a database, set a secure key and optionally set a cache:
43
39
0 commit comments