2 [![Build status](https://gitlab.com/minetest/contentdb/badges/master/pipeline.svg)](https://gitlab.com/minetest/contentdb/pipelines)
4 Content database for Minetest mods, games, and more.\
5 Developed by rubenwardy, license GPLv3.0+.
7 ## Getting started (debug/dev)
9 Docker is the recommended way to develop and deploy ContentDB.
11 1. Install `docker` and `docker-compose`.
13 sudo apt install docker-ce docker-compose
15 1. Copy `config.example.cfg` to `config.cfg`.
17 2. Fill out `config.cfg`
18 1. Set `SQLALCHEMY_DATABASE_URI` = "postgres://contentdb:password@db:5432/contentdb"
19 2. Optionally, set the MAIL settings.
21 3. (Optional) Set up GitHub integration
22 1. Make a Github OAuth Client at <https://github.com/settings/developers>:
23 2. Homepage URL - `http://localhost:5123/`
24 3. Authorization callback URL - `http://localhost:5123/user/github/callback/`
25 4. Put client id and client secret in `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET` in config.cfg.
29 POSTGRES_USER=contentdb
30 POSTGRES_PASSWORD=password
34 5. Start docker images:
36 docker-compose up --build
40 ./utils/run_migrations.sh
42 8. (Optional) create initial data
44 2. Either `python setup.py -o` or `python setup.py -t`
45 1. `-o` creates just the admin, and static data like tags, and licenses.
46 2. `-t` will create test pacakges.
48 9. View at <http://localhost:5123>.
49 The admin username is `rubenwardy` and the password is `tuckfrump`.
51 In the future, starting CDB is as simple as:
53 docker-compose up --build
55 To hot/live update CDB whilst it is running, use:
59 This will only work with python code and templates, it won't update tasks or config.
65 # Hot/live reload (only works with FLASK_DEBUG=1)
68 # Cold update a running version of CDB with minimal downtime (production)
75 ./utils/run_migrations.sh
77 # Create new migration
78 ./utils/create_migration.sh
87 User "1" --> "*" Package
88 User --> UserEmailVerification
89 User "1" --> "*" Notification
90 Package "1" --> "*" Release
91 Package "1" --> "*" Dependency
92 Package "1" --> "*" Tag
93 Package "1" --> "*" MetaPackage : provides
94 Release --> MinetestVersion
96 Dependency --> Package
97 Dependency --> MetaPackage
98 MetaPackage "1" --> "*" Package
99 Package "1" --> "*" Screenshot
100 Package "1" --> "*" Thread
101 Thread "1" --> "*" Reply
102 Thread "1" --> "*" User : watchers
103 User "1" --> "*" Thread
104 User "1" --> "*" Reply
105 User "1" --> "*" ForumTopic
107 User --> "0..1" EmailPreferences
108 User "1" --> "*" APIToken