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