Dark mode - Lyntr
Light mode - Lyntr
First, we need to setup the .env
file with the right secrets.
.env.example
to .env
Firstly we have to setup the database. Head to https://supabase.com and create an account.
Now, click "New project".
For the project name, choose whatever name you wish. For the database password, you could generate a random password or input yours. Make sure to save it. For the region, choose the region closer to your machine.
Then click Create new project. It will take a few minutes, so in the meantime you can copy the secrets.
On this page we can see the Project API keys and Project configuration sections.anon public
secret and put it in your .env
:PUBLIC_SUPABASE_ANON_KEY="ey........................"
Project Configuration
> URL
:PUBLIC_SUPABASE_URL="https://.....supabase.co"
Project Configuration
> JWT Secret
:JWT_SECRET="..........x............x........."
.env
:
DATABASE_URL="postgresql://postgres.USERNAME:PASSWORD/options"
If you clicked Copy
on the Connect page, you should already have the USERNAME
. Simply replace PASSWORD
with the one you put at:
For the database password, you could generate a random password or input yours. Make sure to save it.
Now simply split the DATABASE_URL
components:
DB_HOST="LOCATION.pooler.supabase.com" # Change "LOCATION"
DB_USER="postgres.USERNAME" # Change "USERNAME"
DB_PASSWORD="PASSWORD" # Change "PASSWORD"
DB_NAME="postgres" # Can be left like this
Now run the following:
npx drizzle-kit generate
npx drizzle-kit migrate
npx drizzle-kit push
And follow this guide on how to enable the Discord auth in Supabase, until the code part. It should look something like this.
We need Min.io for images. This and the next step can be omitted if you don't need Image support / reporting.
Install Docker and run the following command:
MINIO_USER=admin MINIO_PASS=admin docker compose up --build -d
ā¼ This may fail if you haven't followed the Supabase step properly (because the compose.yml
file also starts Lyntr in production at 5999 port.)
After that's done, navigate to https://localhost:9001
. You will see this.
admin
. Log in.
Create a bucket.
Input a bucket name and click Create Bucket.
And change the .env
:
S3_BUCKET_NAME="the_name_you_chose"
Now navigate to "Access Keys" and click "Create Access key"
Simply copy the Access key and Secret key and update your .env
accordingly:
MINIO_ACCESS_KEY="first_field"
MINIO_SECRET_KEY="second_field"
Then click "Create".
http://localhost:9000/lyntr/
without a token.Run this:
docker exec -it minio sh -c "mc alias set myminio http://localhost:9000 "admin" "admin" && mc anonymous set public myminio/lyntr"
And you're good to go! You can now simply go to http://localhost:5999
to access Lyntr locally, or run npm i && npm run dev
in your terminal for dev mode and access it at http://localhost:5173/
.
If you wish to get Reporting to work, follow the last step.
Now update the .env
:
DISCORD_BOT_TOKEN="discord.token.here"
DISCORD_CHANNEL_ID="channel.id.here"
ADMIN_KEY="can.be.anything.just.make.sure.its.secure"
SUDO_USER_ID="your.lyntr.account.id" # Create a Lyntr account and copy its ID. If this field won't be filled, your bot will fail to fetch `api/lynt` at GET for info on report. Check the Network tab for the `api/me` request and copy the ID it returns.
DISCORD_ADMIN_ROLE="your.admin.role"
If you wish to contribute, you are free to do so. Please keep in mind:
This project is licensed under Attribution-NonCommercial 2.0 International.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Created by FaceDev