Public Access
Release 0.1.0
This commit is contained in:
+7
-1
@@ -1,7 +1,13 @@
|
||||
[package]
|
||||
name = "tg-dev-srv-bot"
|
||||
version = "0.0.2"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
license = "GPL-3.0-or-later"
|
||||
description = "Bot for the TeenGovernment Development Server"
|
||||
authors = ["Elias Wendland <eliaswendland@pm.me"]
|
||||
readme = "README.md"
|
||||
repository = "https://git.ewenlau.net/ewenlau/tg-dev-srv-bot"
|
||||
homepage = "https://git.ewenlau.net/ewenlau/tg-dev-srv-bot"
|
||||
|
||||
[dependencies]
|
||||
dotenv = "0.15.0"
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ WORKDIR /usr/src/tg-dev-srv-bot
|
||||
COPY . .
|
||||
RUN SQLX_OFFLINE=true cargo install --path .
|
||||
|
||||
FROM debian:bullseye-slim
|
||||
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
|
||||
FROM debian:trixie
|
||||
RUN apt-get update && apt-get install -y ca-certificates libgmp-dev libmpfr-dev libmpc-dev && rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=builder /usr/local/cargo/bin/tg-dev-srv-bot /usr/local/bin/tg-dev-srv-bot
|
||||
CMD ["tg-dev-srv-bot"]
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# TG Dev Server Bot
|
||||
|
||||
This is the bot meant for the TeenGovernment Development Server.
|
||||
|
||||
Not really meant for any other server, but feel free to use it if you'd like.
|
||||
|
||||
The bot is really made to be used with Docker, but you can run it locally.
|
||||
|
||||
An image is available at git.ewenlau.net/ewenlau/tg-dev-srv-bot:release for the stable version and git.ewenlau.net/ewenlau/tg-dev-srv-bot:dev for the development (or testing) version.
|
||||
@@ -4,9 +4,9 @@ services:
|
||||
container_name: tg-dev-srv-bot-postgres
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_USER: ${TG_BOT_POSTGRES_USER:-postgres}
|
||||
POSTGRES_PASSWORD: ${TG_BOT_POSTGRES_PASSWORD:-postgres}
|
||||
POSTGRES_DB: ${TG_BOT_POSTGRES_DB:-tg_dev_srv_bot}
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: YOUR_POSTGRES_PASSWORD_HERE
|
||||
POSTGRES_DB: tg_dev_srv_bot
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
@@ -19,15 +19,18 @@ services:
|
||||
tg-dev-srv-bot:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: DOCKERFILE
|
||||
dockerfile: Dockerfile
|
||||
# OR pull from registry
|
||||
# image: git.ewenlau.net/ewenlau/tg-dev-srv-bot:release
|
||||
# image: git.ewenlau.net/ewenlau/tg-dev-srv-bot:dev
|
||||
container_name: tg-dev-srv-bot
|
||||
restart: always
|
||||
depends_on:
|
||||
- postgres
|
||||
environment:
|
||||
TG_BOT_DISCORD_TOKEN: ${TG_BOT_DISCORD_TOKEN}
|
||||
TG_BOT_DATABASE_URL: ${TG_BOT_DATABASE_URL}
|
||||
TG_BOT_LOG: ${TG_BOT_LOG}
|
||||
TG_BOT_DISCORD_TOKEN: YOUR_DISCORD_TOKEN_HERE
|
||||
TG_BOT_DATABASE_URL: postgres://postgres:YOUR_POSTGRES_PASSWORD_HERE@postgres:5432/tg_dev_srv_bot
|
||||
TG_BOT_LOG: info
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
+6
-3
@@ -56,9 +56,12 @@ async fn main() {
|
||||
let pool = sqlx::postgres::PgPoolOptions::new().connect(&database_url).await.expect("Failed to connect to database");
|
||||
debug!("Database connected");
|
||||
|
||||
trace!("Applying sqlschema");
|
||||
let _res = sqlx::raw_sql(include_str!("../sqlschema.txt")).execute(&pool).await.expect("Failed to execute sqlschema");
|
||||
debug!("Sqlschema applied");
|
||||
trace!("Applying migrations");
|
||||
sqlx::migrate!()
|
||||
.run(&pool)
|
||||
.await
|
||||
.expect("Failed to apply database migrations");
|
||||
debug!("Migrations applied");
|
||||
|
||||
trace!("Loading intents");
|
||||
let intents = sere::GatewayIntents::non_privileged()
|
||||
|
||||
Reference in New Issue
Block a user