Merge branch 'main' into develop

This commit is contained in:
Ethan Lane 2024-04-28 17:05:53 +01:00
commit c33b4a8fdb
31 changed files with 9241 additions and 4991 deletions

View file

@ -7,7 +7,7 @@
# any secret values.
BOT_TOKEN=
BOT_VER=3.2.2
BOT_VER=3.2.1
BOT_AUTHOR=Vylpes
BOT_OWNERID=147392775707426816
BOT_CLIENTID=682942374040961060

View file

@ -0,0 +1,67 @@
name: Deploy To Production
on:
push:
branches:
- main
jobs:
build:
environment: prod
runs-on: node
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 18.x
- run: npm ci
- run: npm run build
- run: npm test
- name: "Copy files over to location"
run: cp -r . ${{ secrets.PROD_REPO_PATH }}
deploy:
environment: prod
needs: build
runs-on: node
steps:
- uses: https://github.com/appleboy/ssh-action@v1.0.0
env:
DB_NAME: ${{ secrets.PROD_DB_NAME }}
DB_AUTH_USER: ${{ secrets.PROD_DB_AUTH_USER }}
DB_AUTH_PASS: ${{ secrets.PROD_DB_AUTH_PASS }}
DB_HOST: ${{ secrets.PROD_DB_HOST }}
DB_PORT: ${{ secrets.PROD_DB_PORT }}
DB_ROOT_HOST: ${{ secrets.PROD_DB_ROOT_HOST }}
DB_SYNC: ${{ secrets.PROD_DB_SYNC }}
DB_LOGGING: ${{ secrets.PROD_DB_LOGGING }}
DB_DATA_LOCATION: ${{ secrets.PROD_DB_DATA_LOCATION }}
SERVER_PATH: ${{ secrets.PROD_SSH_SERVER_PATH }}
BOT_TOKEN: ${{ secrets.PROD_BOT_TOKEN }}
BOT_VER: ${{ vars.PROD_BOT_VER }}
BOT_AUTHOR: ${{ vars.PROD_BOT_AUTHOR }}
BOT_OWNERID: ${{ vars.PROD_BOT_OWNERID }}
BOT_CLIENTID: ${{ vars.PROD_BOT_CLIENTID }}
ABOUT_FUNDING: ${{ vars.PROD_ABOUT_FUNDING }}
ABOUT_REPO: ${{ vars.PROD_ABOUT_REPO }}
CACHE_INTERVAL: ${{ vars.PROD_CACHE_INTERVAL }}
with:
host: ${{ secrets.PROD_SSH_HOST }}
username: ${{ secrets.PROD_SSH_USER }}
key: ${{ secrets.PROD_SSH_KEY }}
port: ${{ secrets.PROD_SSH_PORT }}
envs: DB_NAME,DB_AUTH_USER,DB_AUTH_PASS,DB_HOST,DB_PORT,DB_ROOT_HOST,DB_SYNC,DB_LOGGING,DB_DATA_LOCATION,BOT_TOKEN,BOT_VER,BOT_AUTHOR,BOT_OWNERID,BOT_CLIENTID,ABOUT_FUNDING,ABOUT_REPO,CACHE_INTERVAL
script: |
source .sshrc \
&& cd /home/vylpes/apps/vylbot/vylbot_prod \
&& docker compose down \
&& (pm2 stop vylbot_prod || true) \
&& (pm2 delete vylbot_prod || true) \
&& docker compose up -d \
&& sleep 10 \
&& npm run db:up \
&& pm2 start --name vylbot_prod dist/vylbot.js

View file

@ -1,26 +0,0 @@
# Security Warning! Do not commit this file to any VCS!
# This is a local file to speed up development process,
# so you don't have to change your environment variables.
#
# This is not applied to `.env.template`!
# Template files must be committed to the VCS, but must not contain
# any secret values.
BOT_TOKEN=
BOT_VER=3.2.2
BOT_AUTHOR=Vylpes
BOT_OWNERID=147392775707426816
BOT_CLIENTID=680083120896081954
ABOUT_FUNDING=https://ko-fi.com/vylpes
ABOUT_REPO=https://gitea.vylpes.xyz/RabbitLabs/vylbot-app
CACHE_INTERVAL=1800000 # 30 minutes
DB_HOST=127.0.0.1
DB_PORT=3121
DB_NAME=vylbot
DB_AUTH_USER=prod
DB_AUTH_PASS=prod
DB_SYNC=false
DB_LOGGING=false

View file

@ -1,26 +0,0 @@
# Security Warning! Do not commit this file to any VCS!
# This is a local file to speed up development process,
# so you don't have to change your environment variables.
#
# This is not applied to `.env.template`!
# Template files must be committed to the VCS, but must not contain
# any secret values.
BOT_TOKEN=
BOT_VER=3.2.2
BOT_AUTHOR=Vylpes
BOT_OWNERID=147392775707426816
BOT_CLIENTID=1016767908740857949
ABOUT_FUNDING=https://ko-fi.com/vylpes
ABOUT_REPO=https://gitea.vylpes.xyz/RabbitLabs/vylbot-app
CACHE_INTERVAL=1800000 # 30 minutes
DB_HOST=127.0.0.1
DB_PORT=3111
DB_NAME=vylbot
DB_AUTH_USER=stage
DB_AUTH_PASS=stage
DB_SYNC=false
DB_LOGGING=false

View file

@ -1,31 +0,0 @@
version: "3.9"
volumes:
prod_database_data:
services:
# discord:
# build: .
database:
image: mysql/mysql-server
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
- MYSQL_DATABASE=vylbot
- MYSQL_USER=prod
- MYSQL_PASSWORD=prod
- MYSQL_ROOT_PASSWORD=root
- MYSQL_ROOT_HOST=0.0.0.0
ports:
- "3121:3306"
volumes:
- prod_database_data:/var/lib/mysql
phpmyadmin:
image: phpmyadmin
restart: always
ports:
- "3122:80"
environment:
- PMA_ARBITRARY=1

View file

@ -1,31 +0,0 @@
version: "3.9"
volumes:
stage_database_data:
services:
# discord:
# build: .
database:
image: mysql/mysql-server
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
- MYSQL_DATABASE=vylbot
- MYSQL_USER=stage
- MYSQL_PASSWORD=stage
- MYSQL_ROOT_PASSWORD=root
- MYSQL_ROOT_HOST=0.0.0.0
ports:
- "3111:3306"
volumes:
- stage_database_data:/var/lib/mysql
phpmyadmin:
image: phpmyadmin
restart: always
ports:
- "3112:80"
environment:
- PMA_ARBITRARY=1

View file

@ -1,31 +1,17 @@
version: "3.9"
volumes:
dev_database_data:
services:
# discord:
# build: .
database:
image: mysql/mysql-server
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
- MYSQL_DATABASE=vylbot
- MYSQL_USER=dev
- MYSQL_PASSWORD=dev
- MYSQL_ROOT_PASSWORD=root
- MYSQL_ROOT_HOST=0.0.0.0
- MYSQL_DATABASE=$DB_NAME
- MYSQL_USER=$DB_AUTH_USER
- MYSQL_PASSWORD=$DB_AUTH_PASS
- MYSQL_ROOT_PASSWORD=$DB_AUTH_PASS
- MYSQL_ROOT_HOST=$DB_ROOT_HOST
ports:
- "3101:3306"
- "$DB_PORT:3306"
volumes:
- dev_database_data:/var/lib/mysql
phpmyadmin:
image: phpmyadmin
restart: always
ports:
- "3102:80"
environment:
- PMA_ARBITRARY=1
- $DB_DATA_LOCATION:/var/lib/mysql

9144
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -6,7 +6,7 @@ export default class AddRole extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName('addlobby')
.setDescription('Add lobby channel')
.setDefaultMemberPermissions(PermissionsBitField.Flags.ModerateMembers)

View file

@ -7,7 +7,7 @@ export default class ListLobby extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName('listlobby')
.setDescription('Lists all channels set up as lobbies')
.setDefaultMemberPermissions(PermissionsBitField.Flags.ModerateMembers);

View file

@ -6,7 +6,7 @@ export default class Lobby extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName('lobby')
.setDescription('Attempt to organise a lobby');
}

View file

@ -7,7 +7,7 @@ export default class RemoveLobby extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName('removelobby')
.setDescription('Remove a lobby channel')
.setDefaultMemberPermissions(PermissionsBitField.Flags.ModerateMembers)

View file

@ -7,7 +7,7 @@ export default class Entry extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName('entry')
.setDescription('Sends the entry embed')
.setDefaultMemberPermissions(PermissionsBitField.Flags.ModerateMembers);

View file

@ -7,7 +7,7 @@ export default class ConfigRole extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName('configrole')
.setDescription('Toggle your roles')
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageRoles)

View file

@ -7,7 +7,7 @@ export default class Role extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName('role')
.setDescription('Toggle your roles')
.addSubcommand(subcommand =>

View file

@ -6,7 +6,7 @@ export default class About extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName('about')
.setDescription('About VylBot');
}

View file

@ -9,7 +9,7 @@ export default class Audits extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName("audits")
.setDescription("View audits of a particular user in the server")
.setDefaultMemberPermissions(PermissionsBitField.Flags.ModerateMembers)

View file

@ -9,7 +9,7 @@ export default class Ban extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName("ban")
.setDescription("Ban a member from the server with an optional reason")
.setDefaultMemberPermissions(PermissionsBitField.Flags.BanMembers)

View file

@ -5,7 +5,7 @@ export default class Clear extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName("clear")
.setDescription("Clears the channel of messages")
.setDefaultMemberPermissions(PermissionsBitField.Flags.ManageMessages)

View file

@ -7,7 +7,7 @@ export default class Code extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName('code')
.setDescription('Manage the verification code of the server')
.setDefaultMemberPermissions(PermissionsBitField.Flags.ModerateMembers)

View file

@ -10,7 +10,7 @@ export default class Config extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName('config')
.setDescription('Configure the current server')
.setDefaultMemberPermissions(PermissionsBitField.Flags.Administrator)

View file

@ -6,7 +6,7 @@ export default class Disable extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName('disable')
.setDescription('Disables a command')
.setDefaultMemberPermissions(PermissionsBitField.Flags.Administrator)

View file

@ -6,7 +6,7 @@ export default class Ignore extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName('ignore')
.setDescription('Ignore events in this channel')
.setDefaultMemberPermissions(PermissionsBitField.Flags.Administrator);

View file

@ -9,7 +9,7 @@ export default class Kick extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName("kick")
.setDescription("Kick a member from the server with an optional reason")
.setDefaultMemberPermissions(PermissionsBitField.Flags.KickMembers)

View file

@ -9,7 +9,7 @@ export default class Mute extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName("mute")
.setDescription("(DEPRECATED) Mute a member in the server with an optional reason")
.setDefaultMemberPermissions(PermissionsBitField.Flags.ModerateMembers)

View file

@ -7,7 +7,7 @@ export default class Poll extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName('poll')
.setDescription('Run a poll, automatically adding reaction emojis as options')
.addStringOption(option =>

View file

@ -6,7 +6,7 @@ export default class Setup extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName('setup')
.setDescription('Makes the server ready to be configured')
.setDefaultMemberPermissions(PermissionsBitField.Flags.Administrator);

View file

@ -10,7 +10,7 @@ export default class Timeout extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName("timeout")
.setDescription("Timeouts a user out, sending them a DM with the reason if possible")
.setDefaultMemberPermissions(PermissionsBitField.Flags.ModerateMembers)

View file

@ -7,7 +7,7 @@ export default class Unmute extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName("unmute")
.setDescription("(DEPRECATED) Unmute a member in the server with an optional reason")
.setDefaultMemberPermissions(PermissionsBitField.Flags.ModerateMembers)

View file

@ -9,7 +9,7 @@ export default class Warn extends Command {
constructor() {
super();
super.CommandBuilder = new SlashCommandBuilder()
this.CommandBuilder = new SlashCommandBuilder()
.setName("warn")
.setDescription("Warns a member in the server with an optional reason")
.setDefaultMemberPermissions(PermissionsBitField.Flags.ModerateMembers)

4833
yarn.lock

File diff suppressed because it is too large Load diff