Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
62 changes: 62 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.git/
.github/

# Build directories
build/
Build/
build-*/

# CMake generated files
CMakeFiles/
CMakeCache.txt
cmake_install.cmake
Makefile
install_manifest.txt
compile_commands.json

# Compiled artifacts
*.o
*.obj
*.lo
*.slo
*.d
*.gch
*.pch
*.ilk
*.pdb
*.so
*.dylib
*.dll
*.so.*
*.lai
*.la
*.a
*.lib
*.exe
*.out
*.app

# Temporary files
*.tmp
*.log
*.bak
*.swp
*.dwo

# vcpkg
vcpkg_installed/

# IDE
.vs/
CMakeSettings.json

# Runtime/output
bin/
.cache/
test/
proxy_settings.jsonc

# Docker
Dockerfile
.dockerignore
docker-compose.yml
Comment on lines +59 to +62
41 changes: 41 additions & 0 deletions .github/workflows/publishDocker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Docker image

on:
release:
types: [published]

push:
branches: [ "main", "development"]

jobs:
push_to_registries:
name: Push Docker image to multiple registries
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4

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

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ghcr.io/${{ github.repository }}

- name: Build and push Docker images
uses: docker/build-push-action@v6
with:
context: .
push: true
file: ./Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ vcpkg_installed/
proxy_settings.jsonc
/.vs
/CMakeSettings.json
.vscode
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM gcc:15 AS builder

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
cmake \
git \
libssl-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY . /app

RUN cmake -B build -DCMAKE_BUILD_TYPE=Release && \
cmake --build build --config Release -j$(nproc)

FROM debian:trixie-slim

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY --from=builder /app/bin/ProxyPass /app/ProxyPass

EXPOSE 19132/udp

ENTRYPOINT ["/app/ProxyPass"]
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
proxy:
container_name: SurvivalProxy
restart: unless-stopped
image: proxy
build: .
ports:
- 19134:19132/udp
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
description = "ProxyPass build environment";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};

outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
opensslStatic = pkgs.openssl.override { static = true; };
opensslCombined = pkgs.symlinkJoin {
name = "openssl-combined";
paths = [ opensslStatic.out opensslStatic.dev ];
};
in
{
devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [
gcc15
cmake
ninja
openssl
git
pkg-config
glibc.static
];

OPENSSL_ROOT_DIR = "${opensslCombined}";

shellHook = ''
echo "ProxyPass build environment"
echo "GCC: $(gcc --version | head -n1)"
echo "CMake: $(cmake --version | head -n1)"
echo "Ninja: $(ninja --version)"
echo ""
echo "Build with:"
echo " CC=gcc CXX=g++ cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release"
echo " cmake --build build --config Release --parallel"
'';
};
};
}
32 changes: 32 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{ pkgs ? import <nixpkgs> {} }:

let
opensslCombined = pkgs.symlinkJoin {
name = "openssl-combined";
paths = [ pkgs.openssl.out pkgs.openssl.dev ];
};
in

pkgs.mkShell {
buildInputs = with pkgs; [
gcc15
cmake
ninja
openssl
git
pkg-config
];

OPENSSL_ROOT_DIR = "${opensslCombined}";

shellHook = ''
echo "ProxyPass build environment"
echo "GCC: $(gcc --version | head -n1)"
echo "CMake: $(cmake --version | head -n1)"
echo "Ninja: $(ninja --version)"
echo ""
echo "Build with:"
echo " CC=gcc CXX=g++ cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release"
echo " cmake --build build --config Release --parallel"
'';
}
1 change: 1 addition & 0 deletions src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "ProxyPass.hpp"

int main() {
sculk::ProxyPass::setWorkingDirectory();
sculk::ProxyPass::initConsole();
auto proxyPass = sculk::ProxyPass();
if (!proxyPass.start()) {
Expand Down
Loading
Loading