comment server implemented in python to host comments on lbry
Go to file
2020-07-24 15:43:34 -04:00
config sets column names to be lowercase, uses utf8mb4 charset, utf8mb4_unicode_ci collation 2020-04-06 19:15:54 -04:00
logs Revert "Removes logs" 2019-08-24 00:49:11 -04:00
scripts Cleans up & adds todos for future 2020-04-07 16:16:34 -04:00
src Send parent id and comment text to internal-apis for notifications 2020-07-24 15:43:34 -04:00
test Improves database configuration 2020-03-31 13:57:30 -04:00
.gitignore Update .gitignore 2020-04-03 16:07:23 -04:00
.travis.yml update travis 2020-04-06 19:26:22 -04:00
docker-compose.yml sets column names to be lowercase, uses utf8mb4 charset, utf8mb4_unicode_ci collation 2020-04-06 19:15:54 -04:00
LICENSE.md Create LICENSE.md 2019-05-21 08:17:10 -04:00
Makefile Refactors unittest directory 2019-08-23 14:15:09 -04:00
README.md Update README.md 2020-04-07 16:08:29 -04:00
schema.png Updates schema diagram 2019-06-06 03:27:31 -05:00
setup.py replace oracle driver with pymysql driver 2020-04-01 18:50:09 -04:00

LBRY Comment Server

Build Status Maintainability

Before Installing

Install the lbry-sdk in order to validate & properly delete comments.

Installation

Installing the server:


$ git clone https://github.com/lbryio/comment-server
$ cd comment-server

# create a virtual environment
$ virtualenv --python=python3.8 venv

# Enter the virtual environment
$ source venv/bin/activate

# Install required dependencies
(venv) $ pip install -e .

# Run the server
(venv) $ python src/main.py \
          --port=5921 \          # use a different port besides the default
          --config=conf.yml \   # provide a custom config file
           & \  # detach and run the service in the background 

Installing the systemd Service Monitor

As a super-user, copy the .service and .target files to the systemd directory:

$ sudo cp config/comment-server* /etc/systemd/system

Then $ sudo systemctl daemon-reload to refresh the systemd service files.

Usage

Running the Server

To start the server, simply run:

$ sudo systemctl start comment-server.target

(Optional) Enable the server to run on booting:

$ sudo systemctl enable --now comment-server.target

Testing

To Test the database, simply run:

# To run the whole thing :
(venv) $ python -m unittest tests.database

# To run a specific TestName under a specified TestClass:
(venv) $ python -m unittest tests.database.TestClass.TestName` 

There are basic tests to run against the server, though they require that there is a server instance running, though the database chosen may have to be edited in config/conf.yml.

Additionally there are HTTP requests that can be send with whatever software you choose to test the integrity of the comment server.

Contributing

Contributions are welcome, verbosity is encouraged. Please be considerate in your posts, and make sure that you give as much context to the issue as possible, so that helping you is a slam dunk for us.

Issues

If you spotted an issue from the SDK side, please replicate it using curl and one of the HTTP request templates in tests/http_requests.

Then, just include that along with the rest of your information.

Pull Requests

Make sure the code works and has been tested beforehand. Although we love helping out, our job is to review your code, not test it - that's what your computer is for.

Try to document the changes you made in a human language, preferably English. (but we're always up for a challenge...) Use the level of verbosity you feel is correct, and when in doubt, just KISS.

General

For more details, please refer to lbry.tech/contribute.

License

This project is licensed by AGPLv3. See LICENSE for the full license.

Security

We take security seriously. Please contact security@lbry.io regarding any conerns you might have, issues you might encounter, or general outlooks on life. Our PGP key can be found here, should you need it.

Contact Us

The primary contact for this project is @osilkin98, and can be reached at (o.silkin98@gmail.com).