Compare commits

...
Sign in to create a new pull request.

3 commits

Author SHA1 Message Date
45990c890d fix ci 2025-11-05 21:17:04 +01:00
2629151a04 update dockerfile 2025-11-05 20:27:30 +01:00
2c7cd2e83c fix memory leak 2025-07-31 14:40:21 +02:00
6 changed files with 51 additions and 42 deletions

View file

@ -1,19 +1,28 @@
image: docker:latest default:
image: quay.io/podman/stable
variables: variables:
IMAGE_NAME: "ci.perditum.com/perditum/rnex-splatoon" DOCKER_TLS_CERTDIR: "/certs"
IMAGE_TAG: "${CI_COMMIT_REF_SLUG}" IMAGE_TAG: "${CI_COMMIT_REF_SLUG}"
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" ci.perditum.com
stages: stages:
- build-and-push - test
- build-and-push-image
- push-retagged-branch
- push-retagged-latest
build-and-push: build-and-push-image:
stage: build-and-push stage: build-and-push-image
script: script:
- docker build -t "$IMAGE_NAME:$IMAGE_TAG" . - git submodule update --init
- docker tag "$IMAGE_NAME:$IMAGE_TAG" "$IMAGE_NAME:latest" - podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push "$IMAGE_NAME:$IMAGE_TAG" - podman build -t "$CI_REGISTRY_IMAGE/node-holder:$CI_COMMIT_SHORT_SHA" --target=node-holder .
- docker push "$IMAGE_NAME:latest" - podman build -t "$CI_REGISTRY_IMAGE/proxy-secure-v1:$CI_COMMIT_SHORT_SHA" --target=proxy-secure-v1 .
- podman build -t "$CI_REGISTRY_IMAGE/proxy-insecure-v1:$CI_COMMIT_SHORT_SHA" --target=proxy-insecure-v1 .
- podman build -t "$CI_REGISTRY_IMAGE/backend-auth:$CI_COMMIT_SHORT_SHA" --target=backend-auth .
- podman build -t "$CI_REGISTRY_IMAGE/backend-secure:$CI_COMMIT_SHORT_SHA" --target=backend-secure .
- podman push "$CI_REGISTRY_IMAGE/node-holder:$CI_COMMIT_SHORT_SHA"
- podman push "$CI_REGISTRY_IMAGE/proxy-secure-v1:$CI_COMMIT_SHORT_SHA"
- podman push "$CI_REGISTRY_IMAGE/proxy-insecure-v1:$CI_COMMIT_SHORT_SHA"
- podman push "$CI_REGISTRY_IMAGE/backend-auth:$CI_COMMIT_SHORT_SHA"
- podman push "$CI_REGISTRY_IMAGE/backend-secure:$CI_COMMIT_SHORT_SHA"

View file

@ -9,12 +9,26 @@ RUN apk add --no-cache protobuf-dev git musl-dev lld openssl-dev openssl-libs-st
RUN git submodule update --init --recursive RUN git submodule update --init --recursive
RUN OPENSSL_LIB_DIR=/usr/lib OPENSSL_INCLUDE_DIR=/usr/include/openssl OPENSSL_STATIC=1 RUSTFLAGS="-C relocation-model=static -C linker=ld.lld" cargo test --target x86_64-unknown-linux-musl RUN OPENSSL_LIB_DIR=/usr/lib OPENSSL_INCLUDE_DIR=/usr/include/openssl OPENSSL_STATIC=1 RUSTFLAGS="-C relocation-model=static -C linker=ld.lld" cargo test --target x86_64-unknown-linux-musl
RUN OPENSSL_LIB_DIR=/usr/lib OPENSSL_INCLUDE_DIR=/usr/include/openssl OPENSSL_STATIC=1 RUSTFLAGS="-C relocation-model=static -C linker=ld.lld" cargo build --profile prod --target x86_64-unknown-linux-musl RUN OPENSSL_LIB_DIR=/usr/lib OPENSSL_INCLUDE_DIR=/usr/include/openssl OPENSSL_STATIC=1 RUSTFLAGS="-C relocation-model=static -C linker=ld.lld" cargo build --profile prod --target x86_64-unknown-linux-musl #
FROM scratch AS final FROM scratch AS node-holder
COPY --from=builder /app/target/x86_64-unknown-linux-musl/prod/edge_node_holder_server /edge_node_holder_server
ENTRYPOINT ["/edge_node_holder_server"]
# Copy the compiled binary from the builder stage
COPY --from=builder /app/target/x86_64-unknown-linux-musl/prod/splatoon-server-rust /splatoon-server-rust
# Command to run the application FROM scratch AS proxy-insecure-v1
ENTRYPOINT ["/splatoon-server-rust"] COPY --from=builder /app/target/x86_64-unknown-linux-musl/prod/proxy_insecure /proxy_insecure
ENTRYPOINT ["/proxy_insecure"]
FROM scratch AS proxy-secure-v1
COPY --from=builder /app/target/x86_64-unknown-linux-musl/prod/proxy_secure /proxy_secure
ENTRYPOINT ["/proxy_secure"]
FROM scratch AS backend-auth
COPY --from=builder /app/target/x86_64-unknown-linux-musl/prod/backend_server_insecure /backend_server_insecure
ENTRYPOINT ["/backend_server_secure"]
FROM scratch AS backend-secure
COPY --from=builder /app/target/x86_64-unknown-linux-musl/prod/backend_server_secure /backend_server_secure
ENTRYPOINT ["/backend_server_secure"]

View file

@ -325,10 +325,5 @@ impl ToTokens for RmcProtocolData{
self.generate_raw_trait(tokens); self.generate_raw_trait(tokens);
self.generate_raw_info(tokens); self.generate_raw_info(tokens);
self.generate_raw_remote_trait(tokens); self.generate_raw_remote_trait(tokens);
} }
} }

View file

@ -137,20 +137,3 @@ impl Client{
} }
} }
*/ */
#[cfg(test)]
mod test{
use crate::grpc::account::Client;
#[tokio::test]
async fn test(){
dotenv::dotenv().ok();
let mut client = Client::new().await.unwrap();
let cli = client.get_nex_password(1699562916).await.unwrap();
println!("{:?}", cli);
}
}

View file

@ -50,7 +50,7 @@ impl MatchmakeManager{
async fn garbage_collect(&self){ async fn garbage_collect(&self){
info!("running rnex garbage collector over all sessions and users"); info!("running rnex garbage collector over all sessions and users");
let idx = 0; let mut idx = 0;
let mut to_be_deleted_gids = Vec::new(); let mut to_be_deleted_gids = Vec::new();
@ -69,6 +69,8 @@ impl MatchmakeManager{
if !session.is_reachable(){ if !session.is_reachable(){
to_be_deleted_gids.push(gid); to_be_deleted_gids.push(gid);
} }
idx += 1;
} }
let mut sessions = self.sessions.write().await; let mut sessions = self.sessions.write().await;

View file

@ -269,6 +269,12 @@ impl MatchmakeExtension for User {
let session = self.matchmake_manager.get_session(join_session_param.gid).await?; let session = self.matchmake_manager.get_session(join_session_param.gid).await?;
let mut session = session.lock().await; let mut session = session.lock().await;
if session.session.user_password_enabled{
if join_session_param.user_password != session.session.user_password{
return Err(ErrorCode::RendezVous_InvalidPassword)
}
}
session.connected_players.retain(|v| v.upgrade().is_some_and(|v| v.pid != self.pid)); session.connected_players.retain(|v| v.upgrade().is_some_and(|v| v.pid != self.pid));