Skip to content

Commit f9d13b7

Browse files
committed
move mariadb to extras
1 parent b650eb2 commit f9d13b7

File tree

2 files changed

+29
-23
lines changed

2 files changed

+29
-23
lines changed

README.md

+24-21
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,31 @@ Widevine Utility Website and Remote Widevine Device API.
44

55
# Setup
66

7-
- Install Python Poetry: https://python-poetry.org/docs/master/#installation
8-
- Install depdencies: `poetry install`
9-
- Copy `.env.example` to `.env`.(#environment-variables)
10-
- Copy `getwvkeys/config.py.example` to `getwvkeys/config.py`
11-
- Edit `config.py` and `.env`
12-
- Run database migrations. see [Database Migrations](#database-migrations)
13-
- See [Deploy](#deploy)
7+
- Install Python Poetry: https://python-poetry.org/docs/master/#installation
8+
- Install Dependencies:
9+
- For MySQL: `poetry install -E mysql`
10+
- For MariaDB: `poetry install -E mariadb`
11+
- Copy `getwvkeys/config.toml.example` to `getwvkeys/config.toml` (or the appropriate name for the environment)
12+
- Edit `config.toml`
13+
- For a MySQL Database, use the prefix `mysql+mariadbconnector`
14+
- For a MariaDB Database, use the prefix `mariadb+mariadbconnector`
15+
- Run database migrations. see [Database Migrations](#database-migrations)
16+
- See [Deploy](#deploy)
1417

1518
# Local Development
1619

1720
For local development testing, you will need to disable the HTTPS requirement on the OAuth Callback URLs
1821
with the environment variable `OAUTHLIB_INSECURE_TRANSPORT=1` or you will get the error `InsecureTransportError`.
1922

20-
- For Unix: `export OAUTHLIB_INSECURE_TRANSPORT=1`
21-
- Windows (CMD): `set OAUTHLIB_INSECURE_TRANSPORT=1`
22-
- Windows (Powershell): `$env:OAUTHLIB_INSECURE_TRANSPORT=1`
23+
- For Unix: `export OAUTHLIB_INSECURE_TRANSPORT=1`
24+
- Windows (CMD): `set OAUTHLIB_INSECURE_TRANSPORT=1`
25+
- Windows (Powershell): `$env:OAUTHLIB_INSECURE_TRANSPORT=1`
2326

2427
You should also enable development mode with the `DEVELOPMENT` environment variable.
2528

26-
- For Unix: `export DEVELOPMENT=1`
27-
- Windows (CMD): `set DEVELOPMENT=1`
28-
- Windows (Powershell): `$env:DEVELOPMENT=1`
29+
- For Unix: `export DEVELOPMENT=1`
30+
- Windows (CMD): `set DEVELOPMENT=1`
31+
- Windows (Powershell): `$env:DEVELOPMENT=1`
2932

3033
For local development, you can use the built-in flask server with `poetry run serve`.
3134

@@ -35,23 +38,23 @@ For local development, you can use the built-in flask server with `poetry run se
3538

3639
# Environment Variables
3740

38-
- `OAUTHLIB_INSECURE_TRANSPORT`: disable ssl for oauth
39-
- `DEVELOPMENT`: Development mode, increased logging and reads environment variables from `.env.dev`
40-
- `STAGING`: Staging mode, reads environment variables from `.env.staging`
41+
- `OAUTHLIB_INSECURE_TRANSPORT`: Disable SSL requirement for OAuth2
42+
- `DEVELOPMENT`: Development mode, increased logging and loads configuration from `config.dev.toml`
43+
- `STAGING`: Staging mode, loads configuration from `config.staging.toml`
4144

4245
# Deploy
4346

4447
Gunicorn is the recommended to run the server in production.
4548

4649
Example command to run on port 8081 listening on all interfaces:
4750

48-
- `poetry run gunicorn -w 1 -b 0.0.0.0:8081 getwvkeys.main:app`
51+
- `poetry run gunicorn -w 1 -b 0.0.0.0:8081 getwvkeys.main:app`
4952

5053
_never use more than 1 worker, getwvkeys does not currently support that and you will encounter issues with sessions._
5154

5255
# Other Info
5356

54-
- Redis is used as a pub-sub system for communication with the Discord Bot. If you don't plan to use the bot, you don't need to setup redis and can comment it out in the `.env` file: `#REDIS_URI=redis://localhost:6379/0`
55-
- GetWVKeys uses dynamic injection for scripts, this means that when a user downloads a script and is logged in, the server injects certain values by replacing strings such as their API key. Available placeholders are:
56-
- `__getwvkeys_api_key__`: Authenticated users api key
57-
- `__getwvkeys_api_url__`: The instances API URL, this is used for staging and production mainly but can also be used for self hosted instances
57+
- Redis is used as a pub-sub system for communication with the Discord Bot. If you don't plan to use the bot, you don't need to setup redis and can comment it out in the `.env` file: `#REDIS_URI=redis://localhost:6379/0`
58+
- GetWVKeys uses dynamic injection for scripts, this means that when a user downloads a script and is logged in, the server injects certain values by replacing strings such as their API key. Available placeholders are:
59+
- `__getwvkeys_api_key__`: Authenticated users api key
60+
- `__getwvkeys_api_url__`: The instances API URL, this is used for staging and production mainly but can also be used for self hosted instances

pyproject.toml

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.1"
44
description = "Widevine License Proxy"
55
authors = [
66
"notaghost <[email protected]>",
7-
"Puyodead1 <[email protected]>"
7+
"Puyodead1 <[email protected]>",
88
]
99
license = "AGPL-3.0-only"
1010

@@ -25,7 +25,6 @@ Flask-SQLAlchemy = ">=3.1.1"
2525
gunicorn = "^20.1.0"
2626
redis = "^4.4.4"
2727
validators = "^0.20.0"
28-
mariadb = "^1.1.10"
2928
sqlalchemy = ">=2.0.16"
3029
waitress = "^3.0.0"
3130
flask-caching = "^2.3.0"
@@ -45,3 +44,7 @@ build-backend = "poetry.core.masonry.api"
4544

4645
[tool.isort]
4746
profile = "black"
47+
48+
[tool.poetry.extras]
49+
mysql = ["mysql-connector-python"]
50+
mariadb = ["mariadb"]

0 commit comments

Comments
 (0)