inabahare / lewd2

A based file uploader
https://lewd.se
GNU General Public License v3.0
23 stars 3 forks source link

lewd.se uploader

Requirements

When using a non-LTS version of node the following dependencies may be needed to build bcrypt for password hashing

More about it here

Recommended

Config

Database

For simplicity we'll be using the default user and database.

First change the default users password:
$ sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'topsecret';"

and import the template:
$ sudo -u postgres psql postgres < SQL/template.sql

for the discord bot you'll also want to import that template:
$ sudo -u postgres psql postgres < SQL/discord_template.sql

Node

Copy .env.dist to .env and set DB_PASSWORD and UPLOAD_DESTINATION as a bare minimum.

Please take a moment to go through the different settings.

Reverse proxy

NGINX

Apache

Discord bot

If desire discord bot integration you first need to go here and create a new app. Nothing more is really needed under the General Information tab. Head over to the Bot tab and create a new bot. Give it a nice name and a good profile picture (or don't) and copy the token to BOT_TOKEN in the .env.

Actualy adding the bot to the discord servicer is done by going to the OAuth2 tab and generate a new bot invite link which is so the bot can log in to your server. Under scopes select bot and in the box pick Send Messages and embed links. This will give you a link you can then (in a new tab mighyt be a good idea )

Setup

Run $ npm run setup which will install all the needed dependencies and build the project.

Running

Change the path and user in the included systemd service files and copy them to /etc/systemd/system/
Then you can simply run # systemctl start lewd2.service.

If you're making your own solution or just debugging, you can launch them individually, like so:
$ node packages/backend/dist/index.js

At this point be able to log in with the credentials you set in .env and you're ready for action.