Skip to content

Commit b0b5809

Browse files
committed
Initial Commit
0 parents  commit b0b5809

20 files changed

Lines changed: 912 additions & 0 deletions
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: "🐞 Bug Report"
2+
description: Report a bug or unexpected behavior
3+
title: "[Bug]: "
4+
labels: [bug]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: "## 🐞 Bug Report\nPlease provide a clear description of the issue."
9+
10+
- type: textarea
11+
id: description
12+
attributes:
13+
label: "🐞 Description"
14+
description: "Provide a detailed description about the bug you are experiencing"
15+
placeholder: "When I launch my game, it sold my kidney on Facebook Marketplace.... etc"
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
id: reproduction_steps
21+
attributes:
22+
label: "🔄 Steps to reproduce"
23+
description: "List the steps to reproduce this bug."
24+
placeholder: "1. Do this... 2. Click that... 3. See error"
25+
validations:
26+
required: true
27+
28+
- type: textarea
29+
id: expected_behavior
30+
attributes:
31+
label: "✅ Expected behavior"
32+
description: "What should have happened?"
33+
placeholder: "I expected that..."
34+
validations:
35+
required: true
36+
37+
- type: textarea
38+
id: actual_behavior
39+
attributes:
40+
label: "❌ Actual behavior"
41+
description: "What actually happened?"
42+
placeholder: "Instead, I saw..."
43+
validations:
44+
required: true
45+
46+
- type: input
47+
id: server_version
48+
attributes:
49+
label: "Version"
50+
description: "Which version of the relay server are you using?"
51+
placeholder: "e.g., 1.0.0"
52+
validations:
53+
required: true
54+
55+
- type: input
56+
id: environment
57+
attributes:
58+
label: "Environment"
59+
description: "How are you running the server?"
60+
placeholder: "e.g., Docker"
61+
validations:
62+
required: true
63+
64+
- type: textarea
65+
id: logs
66+
attributes:
67+
label: "📜 Logs & Screenshots"
68+
description: "Upload logs, screenshots, or error messages."
69+
placeholder: "Drag and drop files here or paste logs."
70+
validations:
71+
required: false

.github/ISSUE_TEMPLATES/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: 💬 Join our Discord
4+
url: https://discord.firstdark.dev
5+
about: Need help or want to discuss something? Join our Discord community!
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "✨ Feature Request"
2+
description: Suggest a new feature or improvement
3+
title: "[Feature]: "
4+
labels: [enhancement]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: "## ✨ Feature Request\nDescribe the feature or improvement."
9+
10+
- type: textarea
11+
id: feature_description
12+
attributes:
13+
label: "🚀 Description"
14+
description: "What would you like to see?"
15+
placeholder: "I want to add..."
16+
17+
- type: textarea
18+
id: use_case
19+
attributes:
20+
label: "💡 Use Case"
21+
description: "Why would this be useful?"
22+
placeholder: "This feature helps because..."

.github/workflows/publish.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Build and Publish Docker Image and JAR
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*'
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
18+
# --- Gradle Build ---
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v2
21+
with:
22+
distribution: 'temurin'
23+
java-version: '17'
24+
25+
- name: Grant execute permission to Gradle Wrapper
26+
run: chmod +x gradlew
27+
28+
- name: Build with Gradle
29+
run: ./gradlew build
30+
31+
- name: Find built JAR
32+
id: find_jar
33+
run: echo "JAR_PATH=$(find build/libs -name '*.jar' | head -n 1)" >> $GITHUB_ENV
34+
35+
# --- Docker Build & Push ---
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v1
38+
39+
- name: Log in to GitHub Container Registry
40+
uses: docker/login-action@v2
41+
with:
42+
registry: ghcr.io
43+
username: ${{ github.actor }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Build Docker image
47+
run: |
48+
docker build -t ghcr.io/${{ github.repository_owner }}/docktainer:${{ github.sha }} .
49+
50+
- name: Push Docker image
51+
run: |
52+
docker push ghcr.io/${{ github.repository_owner }}/docktainer:${{ github.sha }}
53+
54+
- name: Tag Docker image with version
55+
if: startsWith(github.ref, 'refs/tags')
56+
run: |
57+
docker tag ghcr.io/${{ github.repository_owner }}/docktainer:${{ github.sha }} ghcr.io/${{ github.repository_owner }}/docktainer:${{ github.ref_name }}
58+
docker push ghcr.io/${{ github.repository_owner }}/docktainer:${{ github.ref_name }}
59+
60+
- name: Tag Docker image as latest
61+
run: |
62+
docker tag ghcr.io/${{ github.repository_owner }}/docktainer:${{ github.sha }} ghcr.io/${{ github.repository_owner }}/docktainer:latest
63+
docker push ghcr.io/${{ github.repository_owner }}/docktainer:latest
64+
65+
release:
66+
if: startsWith(github.ref, 'refs/tags')
67+
needs: build
68+
runs-on: ubuntu-latest
69+
70+
steps:
71+
- name: Checkout code
72+
uses: actions/checkout@v2
73+
74+
- name: Find built JAR
75+
id: find_jar
76+
run: echo "JAR_PATH=$(find build/libs -name '*.jar' | head -n 1)" >> $GITHUB_ENV
77+
78+
- name: Create GitHub Release
79+
uses: softprops/action-gh-release@v1
80+
with:
81+
files: ${{ env.JAR_PATH }}
82+
tag_name: ${{ github.ref_name }}
83+
release_name: Release ${{ github.ref_name }}
84+
body: "Automated release for ${{ github.ref_name }}"
85+
draft: true
86+
prerelease: false
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
.gradle
2+
build/
3+
!gradle/wrapper/gradle-wrapper.jar
4+
!**/src/main/**/build/
5+
!**/src/test/**/build/
6+
7+
### IntelliJ IDEA ###
8+
.idea/modules.xml
9+
.idea/jarRepositories.xml
10+
.idea/compiler.xml
11+
.idea/libraries/
12+
*.iws
13+
*.iml
14+
*.ipr
15+
out/
16+
!**/src/main/**/out/
17+
!**/src/test/**/out/
18+
19+
### Eclipse ###
20+
.apt_generated
21+
.classpath
22+
.factorypath
23+
.project
24+
.settings
25+
.springBeans
26+
.sts4-cache
27+
bin/
28+
!**/src/main/**/bin/
29+
!**/src/test/**/bin/
30+
31+
### NetBeans ###
32+
/nbproject/private/
33+
/nbbuild/
34+
/dist/
35+
/nbdist/
36+
/.nb-gradle/
37+
38+
### VS Code ###
39+
.vscode/
40+
41+
### Mac OS ###
42+
.DS_Store
43+
44+
.idea
45+
*.iml
46+
sdlinkrelay.json

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM openjdk:17-alpine AS builder
2+
3+
WORKDIR /app
4+
COPY ./ .
5+
6+
RUN chmod +x gradlew
7+
RUN ./gradlew clean build -PisDockerBuild=true
8+
9+
FROM openjdk:17-alpine
10+
WORKDIR /app
11+
12+
COPY --from=builder /app/build/libs/server.jar /app/server.jar
13+
EXPOSE 6500
14+
15+
ENTRYPOINT ["java", "-jar", "server.jar"]

build.gradle

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
plugins {
2+
id 'java'
3+
id 'application'
4+
id 'com.github.johnrengelman.shadow' version '8.0.0'
5+
}
6+
7+
ext {
8+
is_docker = project.properties['isDockerBuild'] ?: false
9+
}
10+
11+
group = 'com.hypherionmc.sdlink'
12+
version = '1.0.0'
13+
mainClassName = "com.hypherionmc.sdlink.SDLinkRelayServerStandalone"
14+
15+
configurations {
16+
shaded
17+
implementation.extendsFrom shaded
18+
}
19+
20+
repositories {
21+
mavenCentral()
22+
23+
maven {
24+
url "https://maven.firstdark.dev/releases"
25+
}
26+
27+
maven {
28+
name = "papermc-repo"
29+
url = "https://repo.papermc.io/repository/maven-public/"
30+
}
31+
maven {
32+
name = "sonatype"
33+
url = "https://oss.sonatype.org/content/groups/public/"
34+
}
35+
}
36+
37+
dependencies {
38+
shaded("io.javalin:javalin:6.1.3")
39+
shaded 'com.google.code.gson:gson:2.11.0'
40+
shaded 'commons-io:commons-io:2.16.1'
41+
shaded("org.slf4j:slf4j-simple:2.0.10")
42+
43+
compileOnly 'org.projectlombok:lombok:1.18.32'
44+
annotationProcessor 'org.projectlombok:lombok:1.18.32'
45+
46+
compileOnly("com.velocitypowered:velocity-api:3.4.0-SNAPSHOT")
47+
annotationProcessor("com.velocitypowered:velocity-api:3.4.0-SNAPSHOT")
48+
}
49+
50+
jar {
51+
setArchiveClassifier('slim')
52+
finalizedBy(shadowJar)
53+
}
54+
55+
shadowJar {
56+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
57+
configurations = [project.configurations.getByName("shaded")]
58+
mergeServiceFiles()
59+
archiveClassifier.set(null)
60+
61+
if (is_docker) {
62+
archiveFileName.set("server.jar")
63+
}
64+
}
65+
66+
shadowJar.doLast {
67+
delete jar.archiveFile
68+
}

docker-compose.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
services:
2+
sdlinkrelay_watchtower:
3+
image: containrrr/watchtower
4+
command:
5+
- "--label-enable"
6+
- "--interval"
7+
- "30"
8+
- "--rolling-restart"
9+
volumes:
10+
- /var/run/docker.sock:/var/run/docker.sock
11+
12+
sdlinkrelay:
13+
image: ghcr.io/firstdarkdev/sdlinkrelay:latest
14+
container_name: "sdlinkrelay"
15+
restart: always
16+
labels:
17+
- "com.centurylinklabs.watchtower.enable=true"
18+
ports:
19+
- 6500:6500

gradle/wrapper/gradle-wrapper.jar

59.3 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Thu Mar 13 23:39:47 SAST 2025
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
5+
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)