Public Access
Release 0.1.0
This commit is contained in:
1 parent
68be3468bf
commit
b0bcc4d4ee
6 files changed
+34
-13
No files matched your search
+7
-1
@@ -1,7 +1,13 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "tg-dev-srv-bot"
|
name = "tg-dev-srv-bot"
|
||||||
version = "0.0.2"
|
version = "0.1.0"
|
||||||
edition = "2024"
|
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]
|
[dependencies]
|
||||||
dotenv = "0.15.0"
|
dotenv = "0.15.0"
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@ WORKDIR /usr/src/tg-dev-srv-bot
|
|||||||
COPY . .
|
COPY . .
|
||||||
RUN SQLX_OFFLINE=true cargo install --path .
|
RUN SQLX_OFFLINE=true cargo install --path .
|
||||||
|
|
||||||
FROM debian:bullseye-slim
|
FROM debian:trixie
|
||||||
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
|
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
|
COPY --from=builder /usr/local/cargo/bin/tg-dev-srv-bot /usr/local/bin/tg-dev-srv-bot
|
||||||
CMD ["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
|
container_name: tg-dev-srv-bot-postgres
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: ${TG_BOT_POSTGRES_USER:-postgres}
|
POSTGRES_USER: postgres
|
||||||
POSTGRES_PASSWORD: ${TG_BOT_POSTGRES_PASSWORD:-postgres}
|
POSTGRES_PASSWORD: YOUR_POSTGRES_PASSWORD_HERE
|
||||||
POSTGRES_DB: ${TG_BOT_POSTGRES_DB:-tg_dev_srv_bot}
|
POSTGRES_DB: tg_dev_srv_bot
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
- "5432:5432"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -19,15 +19,18 @@ services:
|
|||||||
tg-dev-srv-bot:
|
tg-dev-srv-bot:
|
||||||
build:
|
build:
|
||||||
context: .
|
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
|
container_name: tg-dev-srv-bot
|
||||||
restart: always
|
restart: always
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
environment:
|
environment:
|
||||||
TG_BOT_DISCORD_TOKEN: ${TG_BOT_DISCORD_TOKEN}
|
TG_BOT_DISCORD_TOKEN: YOUR_DISCORD_TOKEN_HERE
|
||||||
TG_BOT_DATABASE_URL: ${TG_BOT_DATABASE_URL}
|
TG_BOT_DATABASE_URL: postgres://postgres:YOUR_POSTGRES_PASSWORD_HERE@postgres:5432/tg_dev_srv_bot
|
||||||
TG_BOT_LOG: ${TG_BOT_LOG}
|
TG_BOT_LOG: info
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
|
|||||||
File renamed without changes.
+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");
|
let pool = sqlx::postgres::PgPoolOptions::new().connect(&database_url).await.expect("Failed to connect to database");
|
||||||
debug!("Database connected");
|
debug!("Database connected");
|
||||||
|
|
||||||
trace!("Applying sqlschema");
|
trace!("Applying migrations");
|
||||||
let _res = sqlx::raw_sql(include_str!("../sqlschema.txt")).execute(&pool).await.expect("Failed to execute sqlschema");
|
sqlx::migrate!()
|
||||||
debug!("Sqlschema applied");
|
.run(&pool)
|
||||||
|
.await
|
||||||
|
.expect("Failed to apply database migrations");
|
||||||
|
debug!("Migrations applied");
|
||||||
|
|
||||||
trace!("Loading intents");
|
trace!("Loading intents");
|
||||||
let intents = sere::GatewayIntents::non_privileged()
|
let intents = sere::GatewayIntents::non_privileged()
|
||||||
|
|||||||
Reference in new issue
Block a user