3 Cheat database for Dragonfire clientsmods, and texture packs.\
4 Developed by EliasFleckenstein03, license GPLv3.0+.
5 Forked from ContentDB by rubenwardy.
7 ## Getting started (debug/dev)
9 Docker is the recommended way to develop and deploy CheatDB.
11 1. Install `docker` and `docker-compose`.
15 sudo apt install docker-ce docker-compose
17 2. Copy `config.example.cfg` to `config.cfg`.
19 3. (Optional) Set up mail in config.cfg.
20 Make sure to set `USER_ENABLE_EMAIL` to True.
22 4. (Optional) Set up GitHub integration
23 1. Make a Github OAuth Client at <https://github.com/settings/developers>:
24 2. Homepage URL - `http://localhost:5123/`
25 3. Authorization callback URL - `http://localhost:5123/user/github/callback/`
26 4. Put client id and client secret in `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET` in config.cfg.
30 POSTGRES_USER=contentdb
31 POSTGRES_PASSWORD=password
35 6. Start docker images:
37 docker-compose up --build
41 ./utils/run_migrations.sh
43 8. Create initial data
45 2. Either `python utils/setup.py -t` or `python utils/setup.py -o`:
46 1. `-o` creates just the admin, and static data like tags, and licenses.
47 2. `-t` will do `-o` and also create test packages. (Recommended)
49 9. View at <http://localhost:5123>.
50 The admin username is `Fleckenstein` and the password is `tuckfrump`.
52 In the future, starting CDB is as simple as:
54 docker-compose up --build
56 To hot/live update CDB whilst it is running, use:
60 This will only work with python code and templates, it won't update tasks or config.
66 # Hot/live reload (only works with FLASK_DEBUG=1)
69 # Cold update a running version of CDB with minimal downtime (production)
76 ./utils/run_migrations.sh
78 # Create new migration
79 ./utils/create_migration.sh
83 ### VSCode: Setting up Linting
85 * (optional) Install the [Docker extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker)
86 * Install the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
87 * Click no to installing pylint (we don't want it to be installed outside of a virtual env)
88 * Set up a virtual env
89 * Replace `psycopg2` with `psycopg2_binary` in requirements.txt (because postgresql won't be installed on the system)
90 * `python3 -m venv env`
91 * Click yes to prompt to select virtual env for workspace
92 * Click yes to any prompts about installing pylint
93 * `source env/bin/activate`
94 * `pip install -r requirements`
95 * `pip install pylint` (if a prompt didn't appear)
96 * Undo changes to requirements.txt
98 ### VSCode: Material Icon Folder Designations
101 "material-icon-theme.folders.associations": {
106 "blueprints": "routes",
108 "flatpages": "markdown",
110 "migrations": "archive",
111 "textures": "images",
123 User "1" --> "*" Package
124 User --> UserEmailVerification
125 User "1" --> "*" Notification
126 Package "1" --> "*" Release
127 Package "1" --> "*" Dependency
128 Package "1" --> "*" Tag
129 Package "1" --> "*" MetaPackage : provides
130 Release --> MinetestVersion
132 Dependency --> Package
133 Dependency --> MetaPackage
134 MetaPackage "1" --> "*" Package
135 Package "1" --> "*" Screenshot
136 Package "1" --> "*" Thread
137 Thread "1" --> "*" Reply
138 Thread "1" --> "*" User : watchers
139 User "1" --> "*" Thread
140 User "1" --> "*" Reply
141 User "1" --> "*" ForumTopic
143 User --> "0..1" EmailPreferences
144 User "1" --> "*" APIToken