Throat
A phoxy link and discussion aggregator with snek (python3)
Dependencies:
- A database server, MySQL, MariaDB and Postres have been tested. Sqlite should work for messing locally
- Redis
- Python >= 3.7
- A recent node/npm
- libmagic and gobject
Setup:
We recommend using a virtualenv or Pyenv
- Install Python dependencies with
pip install -r requirements.txt - Install Node dependencies with
npm install - Build the bundles with
npm run build - Copy
example.config.ymltoconfig.ymland edit it - Set up the database by executing
./scripts/migrate.py
And you're done! You can run a test server by executing ./throat.py. For production instances we recommend setting up gunicorn
Develop on Docker
If you prefer to develop on docker
- The provided Docker resources only support Postgres
- You still must copy
example.config.yamltoconfig.yamland make any changes you want - In addition, configs are overridden by environment variables set in docker-compose.yml which reference the redis and postgres services created by docker-compose.
make up will bring the containerized site up and mount your current working directory
inside the container for dev. It also runs the migrations on start-up. make down will spin down the containerized services.
To add an admin user to a running docker-compose application:
docker exec throat_throat_1 python3 scripts/admins.py --add {{username}}
If Wheezy templates are not automatically reloading in docker between changes, try docker restart throat_throat_1.
Docker Deployments
Gunicorn
CMD [ "gunicorn", \
"-w", "4", \
"-k", "geventwebsocket.gunicorn.workers.GeventWebSocketWorker", \
"-b", "0.0.0.0:5000", \
"throat:app" ]
Authenticating with a Keycloak server
Optionally, user authentication can be done using a Keycloak server.
You will need to create a realm for the users on the server, as well
as Keycloak clients with appropriate permissions. See
doc/keycloak.org for instructions.
Tests
Python tests
- Python, redis, libmagic and gobject are required, but node and postgres are not.
- Install dependencies with
pip install -r requirements.txt - Install the test dependencies with
pip install -r requirements-test.txt - Run the tests with
python -m pytest - The tests are not affected by your configuration in
config.yaml. If you wish to run the tests against production database or authentication servers (instead of the defaults, which are sqlite and local authentication), you may put configuration settings intest_config.yamland run the tests withTEST_CONFIG=test_config.yaml python -m pytest
Chat
If you have any questions, you can reach us on #throat:phuks.co on Matrix
You can manage default subs by using
- $ ./scripts/defaults.py
To add/remove administrators use
- $ ./scripts/admins.py
Metadata
Release files for throat 0.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| throat-0.0.0.tar.gz | 86.2 kB | Without provenance | Details for throat-0.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| throat-0.0.0-py3-none-any.whl | Python 3 | none | any | Details for throat-0.0.0-py3-none-any.whl |
Total release size: 183.6 kB
Release files / throat-0.0.0.tar.gz
| Download URL | throat-0.0.0.tar.gz |
|---|---|
| Size | 86.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
35f52a78294c931d27745975665f740ef1de737d4b20be03e2b9ddc33dedc8c3
|
|
BLAKE2b-256 checksum How to use checksums |
10b403f71d3c0a25e80bcb03d139150ccda4d3e85fe412659411446398566449
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2
|
Release files / throat-0.0.0-py3-none-any.whl
| Download URL | throat-0.0.0-py3-none-any.whl |
|---|---|
| Size | 97.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cd6ff14a821d92ba30c3b006afe7794e1c682147e46c95091b3b88fecb0f1f2b
|
|
BLAKE2b-256 checksum How to use checksums |
fb4e2ce0478a0a1ae16ea45ea270a299cb3681d02419889fbb6a207c3f436ad6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2
|
Security for throat 0.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.