Go to file
slice 8b3d09a9b1
God is dead.
Is that what God does? He helps? Tell me, why didn't God help my
innocent friend who died for no reason while the guilty ran free? Okay.
Fine. Forget the one offs. How about the countless wars declared in his
name? Okay. Fine. Let's skip the random, meaningless murder for a
second, shall we? How about the racist, sexist, phobia soup we've all
been drowning in because of him? And I'm not just talking about Jesus.
I'm talking about all organized religion. Exclusive groups created to
manage control. A dealer getting people hooked on the drug of hope. His
followers, nothing but addicts who want their hit of bullshit to keep
their dopamine of ignorance. Addicts. Afraid to believe the truth. That
there's no order. There's no power. That all religions are just
metastasizing mind worms, meant to divide us so it's easier to rule us
by the charlatans that wanna run us. All we are to them are paying
fanboys of their poorly-written sci-fi franchise. If I don't listen to
my imaginary friend, why the fuck should I listen to yours? People think
their worship's some key to happiness. That's just how he owns you. Even
I'm not crazy enough to believe that distortion of reality. So fuck God.
He's not a good enough scapegoat for me.
2018-12-03 23:17:00 -08:00
images all: add guild icon support 2018-11-13 21:12:40 -03:00
litecord pubsub.guild: remove print debug 2018-12-04 02:22:38 -03:00
manage Fix migration on windows + make generate_token generate only bot ids 2018-12-03 03:26:50 +01:00
static Add project logo 2018-12-03 22:45:22 -08:00
tests tests.test_main: remove 'hewwo' content check 2018-11-21 22:06:10 -03:00
.gitignore Ignore macOS .DS_Store files 2018-12-03 22:45:09 -08:00
.gitlab-ci.yml .gitlab-ci.yml: add gifsicle to main apk add command 2018-11-21 20:08:19 -03:00
LICENSE Initial Commit 👌 😂 2018-06-15 21:59:52 -03:00
Pipfile blueprints: add icons blueprint 2018-11-13 17:33:28 -03:00
Pipfile.lock user.billing: add create_payment 2018-11-14 19:49:36 -03:00
README.md God is dead. 2018-12-03 23:17:00 -08:00
__init__.py tests: add basic test 2018-11-12 04:10:31 -03:00
config.ci.py config.ci.py: add MAIN_URL and NAME 2018-11-21 23:02:33 -03:00
config.example.py config.example.py: add NAME attribute 2018-11-21 21:40:56 -03:00
discord_endpoints.txt small fixes 2018-12-03 01:46:37 +01:00
manage.py add manage.py 2018-11-06 17:42:27 -03:00
nginx.conf README: add "Checking if it is working" section 2018-11-15 18:08:12 -03:00
requirements.txt Pipfile: add pyflakes 2018-11-12 18:11:04 -03:00
run.py user: add fake_store bp 2018-11-30 17:33:23 -03:00
schema.sql schema.sql: change roles.color default to 0 2018-12-02 22:48:01 -03:00
setup.py Pipfile: add pyflakes 2018-11-12 18:11:04 -03:00
tox.ini tox.ini: use py3.7 due to pipfile requiring it 2018-12-02 19:49:12 -03:00

README.md

Litecord logo

Litecord is an open source, clean-room design reimplementation of Discord's HTTP API and Gateway in Python 3.

This project is a rewrite of litecord-reference.

Project Goals

  • Being able to unit test bots in an autonomous fashion.
  • Doing research and exploration on the Discord API.

Non-goals

  • Being used as a "self-hostable Discord alternative".

Caveats

  • Unit testing is incomplete.
  • Currently, there are no plans to support voice chat.
  • You must figure out how to connect to a Litecord instance. Litecord will not distribute official client code from Discord nor provide ways to modify the official client.

Installation

Requirements:

  • Python 3.7+
  • PostgreSQL (tested using 9.6+)
  • gifsicle for GIF emoji and avatar handling
  • pipenv

Download the code

$ git clone https://gitlab.com/litecord/litecord.git && cd litecord

Setting up the database

It's recommended to create a separate user for the litecord database.

# Create the PostgreSQL database.
$ createdb litecord

# Apply the base schema to the database.
$ psql -f schema.sql litecord

Then, you should run database migrations:

$ pipenv run ./manage.py migrate

Configuring

Copy the config.example.py file and edit it to configure your instance:

$ cp config.example.py config.py
$ $EDITOR config.py

Install packages

$ pipenv install --dev

Running

Hypercorn is used to run Litecord. By default, it will bind to 0.0.0.0:5000. This will expose your Litecord instance to the world. You can use the -b option to change it (e.g. -b 0.0.0.0:45000).

$ pipenv run hypercorn run:app

You can use --access-log - to output access logs to stdout.

It is recommended to run litecord behind NGINX. You can use the nginx.conf file at the root of the repository as a template.

Does it work?

You can check if your instance is running by performing an HTTP GET request on the /api/v6/gateway endpoint. For basic websocket testing, a tool such as ws can be used.

Updating

Update the code and run any new database migrations:

$ git pull
$ pipenv run ./manage.py migrate

Running tests

Running tests involves creating dummy users with known passwords. Because of this, you should never setup a testing environment in production.

# Setup any testing users:
$ pipenv run ./manage.py setup_tests

# Install tox:
$ pip install tox

# Run lints and tests:
$ tox