Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
ffc1cdc
Renamed project XeniaBot.Data to XeniaBot.MongoData
ktwrd Oct 19, 2025
c8ea159
[dockerfile] Install fonts
ktwrd Nov 2, 2025
187ed20
[dockerfile] Install fontconfig
ktwrd Nov 2, 2025
898a933
Deleted e621 support
ktwrd Nov 2, 2025
3fb0d16
[XeniaBot.Shared] Removed CommandHandler (text-based commands)
ktwrd Nov 2, 2025
26fad9c
Replaced shit logging library with NLog
ktwrd Nov 2, 2025
8bacc75
Bump version to v1.15
ktwrd Nov 2, 2025
8699b7e
[WebPanel] Use GZip compression
ktwrd Nov 2, 2025
b4c7f97
[WebPanel] Install fonts-recommended in dockerfile
ktwrd Nov 2, 2025
48b4fbc
Created CHANGELOG.md
ktwrd Nov 2, 2025
916df80
Updated CHANGELOG.md
ktwrd Nov 2, 2025
217711a
Fixed docker builds
ktwrd Nov 2, 2025
6719013
Updated GH Actions
ktwrd Nov 2, 2025
e434d12
[github/workflows] Updated docker.yml
ktwrd Nov 2, 2025
8d4fdbd
[github/workflows/build] Enable PublishSingleFile
ktwrd Nov 2, 2025
29b42b2
Add localfonts.conf
ktwrd Nov 2, 2025
a54de9f
Optimize MediaManupliation file size
ktwrd Nov 2, 2025
5f64289
Format file size with NeoSmart.PrettySize
ktwrd Nov 2, 2025
2164f7a
[LevelSystemService] Ignore events when guild isn't set
ktwrd Nov 2, 2025
40a5c36
Created .wakatime-project
ktwrd Mar 3, 2026
e7fd24d
Code cleanup and better error messages
ktwrd Mar 3, 2026
26d08ff
[BanSyncService] Attach reason if it's too long & move NotifyBan indi…
ktwrd Mar 3, 2026
6a39314
[DiscordCacheService] Attach JSON files instead of in the reason
ktwrd Mar 3, 2026
aa019f8
More code cleanup
ktwrd Mar 3, 2026
52802d1
[BanSyncService] Properly paginate records
ktwrd Mar 3, 2026
b0ac9ad
[BanSyncInfoRepository] Use Async overloads when fetching records fro…
ktwrd Mar 3, 2026
cc049bc
Minor bug fixes
ktwrd Mar 3, 2026
aecfb14
[BanSyncService] Extra logging
ktwrd Mar 3, 2026
7a639af
[BanSyncService] Attempt to fix ban resync (again)
ktwrd Mar 3, 2026
d0b716d
[BanSyncInfoRepository] Minor optimization for fetching mutual bansyn…
ktwrd Mar 3, 2026
35a8279
[BanSyncService] ANOTHER attempt at fixing ban pagination
ktwrd Mar 3, 2026
d6e56a7
Updated dependencies
ktwrd Mar 3, 2026
250e8f1
[WebPanel] Show BanSync channel ID in admin panel
ktwrd Mar 3, 2026
65f4c7c
[BanSyncService] Actually fix logic for refreshing bans (yay!)
ktwrd Mar 3, 2026
12e0919
Upgrade to .NET 10
ktwrd Mar 3, 2026
e549d33
Created IBanSyncInfoRepository
ktwrd Mar 3, 2026
b0ed874
Created WIP Postgres project
ktwrd Mar 3, 2026
f6a52a2
Updated IBanSyncInfoRepository.cs
ktwrd Mar 3, 2026
caee6cc
Some code cleanup
ktwrd Mar 3, 2026
b0cf7b3
Add PostgreSQL support
ktwrd Mar 3, 2026
c7d6168
[XeniaBot.MongoData] Rename namespace to project name
ktwrd Mar 3, 2026
57e514b
Created DatabaseMigrationService and properly initialize postgres wit…
ktwrd Mar 3, 2026
0404b4f
Created SentryHelper
ktwrd Mar 4, 2026
83c7a03
Allow custom module importing to be customized via property CoreConte…
ktwrd Mar 4, 2026
3cdd66b
Start working on DataMigrationModule
ktwrd Mar 4, 2026
9c16968
Add logic for Bansync Data Migration to copy data from MongoDB, map t…
ktwrd Mar 4, 2026
383b969
[DataMigrationModule] Extra null/default value checking for Bansync
ktwrd Mar 4, 2026
bab4614
Moved DataMigrationModule to own class, partially refactor/clean up s…
ktwrd Mar 9, 2026
1d44dd7
[BanSync] Use EF Core for Services & Discord Modules & start rewritin…
ktwrd Mar 9, 2026
30c5e8a
[WebPanel/ServerSettings/BanSyncController] Formatting
ktwrd Mar 9, 2026
5c9b442
Fix EF Core migrations & add commands for doing discord cache guild r…
ktwrd Mar 9, 2026
fe88e8c
[Web Panel] Finished rewriting bansync related pages
ktwrd Mar 9, 2026
f52820e
Updated BanSyncService.cs
ktwrd Mar 9, 2026
d9b792f
[ErrorReportService] Show warning when some attachments are missing
ktwrd Mar 10, 2026
f01d4c1
[ErrorReportService] Add extraAttachments and exceptionJson as extra …
ktwrd Mar 10, 2026
05ac747
[BanSyncService] Use custom exceptions when handing UserBanned event
ktwrd Mar 10, 2026
6749fa8
[BanSyncService] Just do normal foreach loop in guilds when (optional…
ktwrd Mar 10, 2026
e27afff
[ErrorReportService] Partial rewrite to use builder class
ktwrd Mar 10, 2026
64bc79c
[ConfigData] Fix dashboard URL being referenced/used when it's invalid.
ktwrd Mar 13, 2026
2047680
[BanSyncService/BanSyncModule] Properly use ErrorReportService.Submit…
ktwrd Mar 13, 2026
3021a0f
Add curl to containers
ktwrd Mar 13, 2026
df91818
Fix builds (+ new db migration)
ktwrd Mar 13, 2026
1e49c9e
[DataMigrationModule] Make sure that FK is respected by weird guild ids
ktwrd Mar 13, 2026
6eda52a
Updated DataMigrationModule.cs
ktwrd Mar 13, 2026
6c1bb0e
Improve BanSync mutual record search performance with TVF
ktwrd Mar 13, 2026
627996d
[DiscordCacheAdminModule] Add support to update all guilds
ktwrd Mar 13, 2026
717e1bc
Create UserCacheModel & store guild icons in GuildCacheModel
ktwrd Mar 13, 2026
37ebd57
More optimization attempts lol
ktwrd Mar 13, 2026
01a0cf9
[BanSyncSearchController] Use page size of 10
ktwrd Mar 13, 2026
1fa8dbd
Use "Record*At" property style & store nickname for GuildMemberCacheM…
ktwrd Mar 14, 2026
1889320
Created DiscordGuildToGuildCacheModelMapper
ktwrd Mar 14, 2026
1a57488
Fixed cache repositories not updating new props
ktwrd Mar 14, 2026
3d43b19
Bumped version (bot: 1.16, dash: 0.16)
ktwrd Mar 14, 2026
249f2d2
Created GuildCacheService
ktwrd Mar 14, 2026
cddea25
[WebPanel] Suppress logging a bit
ktwrd Mar 14, 2026
d218175
[UserCacheService] Fix records updating all the time, and add param "…
ktwrd Mar 14, 2026
c83f748
[WebPanel] Pull user avatars & guild icon from respective cache servi…
ktwrd Mar 14, 2026
d3b1669
Web Panel v0.16.1
ktwrd Mar 14, 2026
d1c005b
[Data] Created AuditLogBanCacheModel
ktwrd Mar 15, 2026
671e0e0
[BanSyncService] Store Audit Log Ban info in DB
ktwrd Mar 15, 2026
f8db198
[BanSyncService] Always save ban information, and update DB functions…
ktwrd Mar 15, 2026
6812cd5
Updated dependencies
ktwrd Mar 21, 2026
5b591dc
Add developer commands for validating guild permissions
ktwrd Mar 21, 2026
890c379
Restrict some modules to only work in Guilds
ktwrd Mar 21, 2026
10e1dac
[BanSyncService] Fix ban events failing when no guild config is present
ktwrd Mar 22, 2026
7bcc032
(hopefully) Fixed Sentry integration
ktwrd Mar 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@ name: .NET Core Desktop

on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main", "develop" ]
branches: [ "main", "develop", "reborn" ]

jobs:

build:

strategy:
matrix:
configuration: [Debug, Release]
projectName: [XeniaBot.Core, XeniaBot.WebPanel]
runtime: [win-x64, linux-x64]
configuration: [ Debug, Release ]
projectName: [ XeniaBot.Core, XeniaBot.WebPanel ]
runtime: [ win-x64, linux-x64 ]

runs-on: windows-latest

Expand All @@ -28,17 +26,18 @@ jobs:
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

dotnet-version: |
10.0.x

- run: dotnet tool install -g dotnet-t4

- name: Clean
run: dotnet clean ./XeniaBot.sln --configuration ${{ matrix.configuration }} && dotnet nuget locals all --clear

- name: Publish Windows
run: |
dotnet publish ${{ matrix.projectName }} --self-contained true -c ${{ matrix.configuration }} --runtime ${{ matrix.runtime }}
Compress-Archive -Path ./${{ matrix.projectName }}/bin/${{ matrix.configuration }}/net8.0/${{ matrix.runtime }}/publish/* -Destination ${{ matrix.projectName }}.zip
dotnet publish ${{ matrix.projectName }} --self-contained true -c ${{ matrix.configuration }} --runtime ${{ matrix.runtime }} -p:PublishSingleFile=true
Compress-Archive -Path ./${{ matrix.projectName }}/bin/${{ matrix.configuration }}/net10.0/${{ matrix.runtime }}/publish/* -Destination ${{ matrix.projectName }}.zip

- name: Upload build artifacts
uses: actions/upload-artifact@v4
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: docker

on:
push:
branches: [ main, develop ]
tags: "v[0-9]+.[0-9]+.[0-9]+"

jobs:
docker:
strategy:
matrix:
include:
- dockerFilename: Dockerfile
imageName: ktwrd/xenia-discord
- dockerFilename: Dockerfile
imageName: ghcr.io/ktwrd/xenia-discord
- dockerFilename: WebPanel.Dockerfile
imageName: ktwrd/xenia-discord-dash
- dockerFilename: WebPanel.Dockerfile
imageName: ghcr.io/ktwrd/xenia-discord-dash
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set Environment Variables
run: |
echo "TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
echo "CONTAINER_VERSION=$(git describe --tags --abbrev=0).$([[ $GITHUB_REF = refs/tags/* ]] && echo 0 || echo 65534)-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "REVISION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "BUILD_DATE=$(date --iso-8601=s)" >> $GITHUB_ENV

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: 'Build and push (dev, ${{ matrix.imageName }}, ${{ matrix.dockerFilename }})'
uses: docker/build-push-action@v5
if: github.ref == 'refs/heads/develop'
with:
push: true
tags: |
${{ matrix.imageName }}:dev
${{ matrix.imageName }}:latest
${{ matrix.imageName }}:dev-${{ env.CONTAINER_VERSION }}
${{ matrix.imageName }}:latest-${{ env.CONTAINER_VERSION }}
file: ${{ matrix.dockerFilename }}

- name: 'Build and push (stable, ${{ matrix.imageName }}, ${{ matrix.dockerFilename }})'
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
uses: docker/build-push-action@v5
with:
push: true
tags: |
${{ matrix.imageName }}:${{ env.TAG }}
${{ matrix.imageName }}:${{ env.CONTAINER_VERSION }}
${{ matrix.imageName }}:stable
${{ matrix.imageName }}:stable-${{ env.CONTAINER_VERSION }}
file: ${{ matrix.dockerFilename }}
45 changes: 0 additions & 45 deletions .github/workflows/publish-docker-dev.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/publish-docker-stable.yml

This file was deleted.

1 change: 1 addition & 0 deletions .wakatime-project
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Xenia Bot
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## v1.15 (2nd Nov, 2025)

>[!IMPORTANT]
> I am aware of some issues in Xenia, like Ban Sync records not being visible (ones that were created before 2025).
> This should be fixed in the next update, since it's more of a database issue.
>
> In the "reborn" branch, this is mostly mitigated by using an actual database like PostgreSQL instead of MongoDB.
> To help with this transition to a new DB engine, I will will slowly move features across to the PostgreSQL instead of MongoDB.
>
> This may take a while to do since I have a full-time job and I spend a lot of my spare time working on [Open Fortress](https://openfortress.fun). When it comes to what projects are more important, Xenia has taken a bit of a backseat since it's fairly stable, and only requires some occasional maintenance.

- Replaced custom logging system with [NLog](https://nlog-project.org/) 6.x
- Use GZip Compression with Web Panel (for images, styles, javascript, and fonts)
- Removed e621/e926 commands
- The package `fonts-recommended` is now installed in bot/web panel dockerfile.
- This should fix non-ASCII characters like Emoji's and Kanji looking like boxes with hexadecimal characters in them.
43 changes: 43 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<Project>
<PropertyGroup>
<!-- Enable central package management, https://learn.microsoft.com/en-us/nuget/consume-packages/Central-Package-Management -->
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="AspNet.Security.OAuth.Discord" Version="10.0.0" />
<PackageVersion Include="CSharpFunctionalExtensions" Version="3.7.0" />
<PackageVersion Include="DiffPlex" Version="1.9.0" />
<PackageVersion Include="Discord.Net" Version="3.19.1" />
<PackageVersion Include="FastCloner" Version="3.5.2" />
<PackageVersion Include="Google.Cloud.Translation.V2" Version="3.5.0" />
<PackageVersion Include="IdGen" Version="3.0.7" />
<PackageVersion Include="Iminetsoft.CronNET" Version="8.0.2" />
<PackageVersion Include="kate.shared" Version="1.7.0" />
<PackageVersion Include="Magick.NET-Q16-HDRI-AnyCPU" Version="14.11.0" />
<PackageVersion Include="Markdig" Version="1.1.1" />
<PackageVersion Include="Microsoft.AspNetCore.Components" Version="10.0.5" />
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="10.0.5" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="10.0.5" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.5" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.5" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.5" />
<PackageVersion Include="Microsoft.IdentityModel.Logging" Version="8.16.0" />
<PackageVersion Include="MimeTypesMap" Version="1.0.9" />
<PackageVersion Include="MongoDB.Bson" Version="3.3.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.3.0" />
<PackageVersion Include="NeoSmart.PrettySize" Version="3.1.1" />
<PackageVersion Include="NetVips" Version="3.2.0" />
<PackageVersion Include="NetVips.Extensions" Version="3.2.0" />
<PackageVersion Include="NetVips.Native.linux-x64" Version="8.16.1" />
<PackageVersion Include="NetVips.Native.win-x64" Version="8.16.1" />
<PackageVersion Include="NLog" Version="6.1.1" />
<PackageVersion Include="NLog.Web.AspNetCore" Version="6.1.2" />
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.1" />
<PackageVersion Include="prometheus-net" Version="8.2.1" />
<PackageVersion Include="prometheus-net.AspNetCore" Version="8.2.1" />
<PackageVersion Include="Sentry" Version="6.2.0" />
<PackageVersion Include="Sentry.AspNetCore" Version="6.2.0" />
<PackageVersion Include="Sentry.NLog" Version="6.2.0" />
<PackageVersion Include="System.Resources.Extensions" Version="10.0.3" />
</ItemGroup>
</Project>
27 changes: 21 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base-pkg

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gnupg \
apt-transport-https \
ca-certificates \
adduser \
curl \
fonts-recommended fontconfig fonts-noto-cjk fonts-noto-cjk-extra fonts-liberation fonts-dejavu \
&& rm -rf /var/lib/apt/lists/*
ADD localfonts.conf /etc/fonts/local.conf
RUN fc-cache -f -v

FROM base-pkg AS base
WORKDIR /app

# Creates a non-root user with an explicit UID and adds permission to access the /app folder
# For more info, please refer to https://aka.ms/vscode-docker-dotnet-configure-containers
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
RUN /usr/sbin/adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
USER appuser

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
# --- compile project ---
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
RUN dotnet tool install -g dotnet-t4
ENV PATH="/root/.dotnet/tools:${PATH}"
WORKDIR /src
COPY ["./XeniaBot.Core/XeniaBot.Core.csproj", "./"]
RUN dotnet restore "XeniaBot.Core.csproj"
COPY . .
COPY . ./
RUN dotnet restore "XeniaBot.Core/XeniaBot.Core.csproj"
WORKDIR "/src/."
RUN dotnet build "./XeniaBot.Core/XeniaBot.Core.csproj" -c Release -o /app/build

# --- publish project ---
FROM build AS publish
RUN dotnet publish "./XeniaBot.Core/XeniaBot.Core.csproj" -c Release -o /app/publish

Expand Down
27 changes: 21 additions & 6 deletions WebPanel.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,38 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base-pkg

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gnupg \
apt-transport-https \
ca-certificates \
adduser \
curl \
fonts-recommended fontconfig fonts-noto-cjk fonts-noto-cjk-extra fonts-liberation fonts-dejavu \
&& rm -rf /var/lib/apt/lists/*
ADD localfonts.conf /etc/fonts/local.conf
RUN fc-cache -f -v

FROM base-pkg AS base
WORKDIR /app

EXPOSE 80 8080

# Creates a non-root user with an explicit UID and adds permission to access the /app folder
# For more info, please refer to https://aka.ms/vscode-docker-dotnet-configure-containers
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
RUN /usr/sbin/adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
USER appuser

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
# --- compile project ---
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
RUN dotnet tool install -g dotnet-t4
ENV PATH="/root/.dotnet/tools:${PATH}"
WORKDIR /src
COPY ["./XeniaBot.WebPanel/XeniaBot.WebPanel.csproj", "./"]
RUN dotnet restore "XeniaBot.WebPanel.csproj"
COPY . .
COPY . ./
RUN dotnet restore "XeniaBot.WebPanel/XeniaBot.WebPanel.csproj"
WORKDIR "/src/."
RUN dotnet build "./XeniaBot.WebPanel/XeniaBot.WebPanel.csproj" -c Release -o /app/build

# --- publish project ---
FROM build AS publish
RUN dotnet publish "./XeniaBot.WebPanel/XeniaBot.WebPanel.csproj" -c Release -o /app/publish

Expand Down
Loading
Loading