feat: OAuth implementation with Discord
CI / tests (push) Successful in 10m39s
CI / tests (pull_request) Successful in 11m17s

This commit separates the core features of GéJDR from the backend as
these will also be used by the bot in the future.

This commit also updates the dependencies of the project. It also
removes the dependency lettre as well as the mailpit docker service
for developers as it appears clearer this project won’t send emails
anytime soon.

The publication of a docker image is also postponed until later.
This commit is contained in:
2025-01-25 12:31:42 +01:00
parent 2013d04cf7
commit aac70e4131
49 changed files with 2699 additions and 720 deletions
+41 -11
View File
@@ -18,30 +18,61 @@
rustc = rustVersion;
};
appName = "gege-jdr-backend";
appNameBackend = "gejdr-backend";
appNameBot = "gejdr-bot";
appRustBuild = rustPlatform.buildRustPackage {
pname = appName;
appRustBuildBackend = rustPlatform.buildRustPackage {
pname = appNameBackend;
version = "0.1.0";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
buildPhase = ''
cd gejdr-backend
SQLX_OFFLINE="1" cargo build --release --bin gejdr-backend
'';
installPhase = ''
cargo install --path . --root "$out/bin/"
'';
};
appRustBuildBot = rustPlatform.buildRustPackage {
pname = appNameBot;
version = "0.1.0";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
buildPhase = ''
SQLX_OFFLINE="1" cargo build --release --bin gejdr-bot
'';
};
dockerImage = pkgs.dockerTools.buildLayeredImage {
name = appName;
dockerImageBackend = pkgs.dockerTools.buildLayeredImage {
name = appNameBackend;
tag = "latest";
config = {
Entrypoint = [ "${appRustBuild}/bin/${appName}" ];
Entrypoint = [ "${appRustBuildBackend}/bin/${appNameBackend}" ];
Env = [ "SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" ];
Tag = "latest";
};
contents = [ appRustBuild pkgs.cacert ];
contents = [ appRustBuildBackend pkgs.cacert ];
};
dockerImageBot = pkgs.dockerTools.buildLayeredImage {
name = appNameBot;
tag = "latest";
fromImageTag = "latest";
config = {
Entrypoint = [ "${appRustBuildBot}/bin/${appNameBot}" ];
Env = [ "SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" ];
Tag = "latest";
};
contents = [ appRustBuildBot pkgs.cacert ];
};
in {
packages = {
rustPackage = appRustBuild;
docker = dockerImage;
backend = appRustBuildBot;
bot = appRustBuildBot;
dockerBackend = dockerImageBackend;
dockerBot = dockerImageBot;
};
defaultPackage = dockerImage;
defaultPackage = dockerImageBackend;
devShell = with pkgs; mkShell {
buildInputs = [
bacon
@@ -49,7 +80,6 @@
cargo-audit
cargo-auditable
cargo-tarpaulin
cargo-msrv
just
rust-analyzer
(rustVersion.override { extensions = [ "rust-src" ]; })