diff --git a/Dockerfile b/.docker/Dockerfile similarity index 77% rename from Dockerfile rename to .docker/Dockerfile index e4406cab..9bd45c49 100644 --- a/Dockerfile +++ b/.docker/Dockerfile @@ -29,7 +29,7 @@ COPY . ./ COPY --from=frontend-builder /src/UIMod /src/UIMod # Build the server (embed will include UIMod/* at build time) -RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /out/StationeersServerControl ./server.go +RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /out/StationeersServerUI ./server.go ############ # Runtime @@ -47,20 +47,18 @@ RUN dpkg --add-architecture i386 \ ca-certificates \ locales \ lib32gcc-s1 \ - file \ + file \ && rm -rf /var/lib/apt/lists/* -RUN useradd -m -d /app -s /bin/sh app - # Copy compiled binary and license -COPY --from=go-builder /out/StationeersServerControl /usr/local/bin/StationeersServerControl -COPY ./LICENSE /app/LICENSE -RUN chmod +x /usr/local/bin/StationeersServerControl - -RUN chown -R app:app /app +RUN mkdir -p /opt/SSUIBuildFiles +COPY --from=go-builder /out/StationeersServerUI /opt/SSUIBuildFiles/StationeersServerUI +COPY ./LICENSE /opt/SSUIBuildFiles/LICENSE +COPY ./.docker/entrypoint.sh /entrypoint.sh +RUN chmod +x /opt/SSUIBuildFiles/StationeersServerUI +RUN chmod +x /entrypoint.sh -USER app EXPOSE 8443/tcp 27016/udp 27015/udp -ENTRYPOINT ["/usr/local/bin/StationeersServerControl"] +ENTRYPOINT ["/entrypoint.sh"] diff --git a/compose.yml b/.docker/compose.yml similarity index 67% rename from compose.yml rename to .docker/compose.yml index aa382616..38e693bd 100644 --- a/compose.yml +++ b/.docker/compose.yml @@ -1,8 +1,12 @@ services: stationeers-server: container_name: stationeers-server - build : . + build: + context: .. + dockerfile: ./.docker/Dockerfile image: stationeers-server-ui:latest + stdin_open: true + tty: true deploy: resources: limits: @@ -18,14 +22,10 @@ services: - "27015:27015/udp" - "27015:27015/tcp" volumes: - # Persist app data between container restarts - app-data:/app - # Mount saves and config for easy access/editing outside the container - ./saves:/app/saves:rw - - ./UIMod/config:/app/UIMod/config:rw - - ./UIMod/tls:/app/UIMod/tls:rw + - ./UIMod:/app/UIMod:rw restart: unless-stopped - command: [] volumes: app-data: \ No newline at end of file diff --git a/.docker/entrypoint.sh b/.docker/entrypoint.sh new file mode 100644 index 00000000..0069b069 --- /dev/null +++ b/.docker/entrypoint.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +cp /opt/SSUIBuildFiles/StationeersServerUI /app/StationeersServerUI +cp /opt/SSUIBuildFiles/LICENSE /app/LICENSE +chmod +x /app/StationeersServerUI +exec /app/StationeersServerUI "$@" \ No newline at end of file diff --git a/.github/workflows/ghcr-build-nightly.yaml b/.github/workflows/ghcr-build-nightly.yaml index 302364ad..7fcfe13e 100644 --- a/.github/workflows/ghcr-build-nightly.yaml +++ b/.github/workflows/ghcr-build-nightly.yaml @@ -51,6 +51,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . + file: ./.docker/Dockerfile platforms: linux/amd64 push: true tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/ghcr-build-release.yaml b/.github/workflows/ghcr-build-release.yaml index 43e3df7e..560e0c05 100644 --- a/.github/workflows/ghcr-build-release.yaml +++ b/.github/workflows/ghcr-build-release.yaml @@ -50,6 +50,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . + file: ./.docker/Dockerfile platforms: linux/amd64 push: true tags: ${{ steps.meta.outputs.tags }} diff --git a/.gitignore b/.gitignore index a2349175..ecfce688 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ UIMod/tls/cert.pem UIMod/tls/key.pem steamapps/** steamcmd/** +Steam/** rocketstation_BurstDebugInformation_DoNotShip/** StationeersServerControlv* UnityPlayer.so diff --git a/.vscode/launch.json b/.vscode/launch.json index 5e1d543e..b5d9d441 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -19,6 +19,16 @@ "program": "${workspaceFolder}/server.go", "console": "integratedTerminal", "showLog": false, // Hides some Go Debugger(Delve) log stuff that is not useful for debugging atm + }, + { + "name": "Debug Go Server noSteamCMD noSvelte", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${workspaceFolder}/server.go", + "console": "integratedTerminal", + "showLog": false, // Hides some Go Debugger(Delve) log stuff that is not useful for debugging atm + "args": ["--NoSteamCMD"] } ] } \ No newline at end of file diff --git a/UIMod/onboard_bundled/twoboxform/twoboxform.js b/UIMod/onboard_bundled/twoboxform/twoboxform.js index 3423361b..57f2feb1 100644 --- a/UIMod/onboard_bundled/twoboxform/twoboxform.js +++ b/UIMod/onboard_bundled/twoboxform/twoboxform.js @@ -138,6 +138,12 @@ document.addEventListener('DOMContentLoaded', () => { } else if (configField === "SaveInfo") { const primaryValue = document.getElementById('primary-field').value.trim(); + // If the world name contains a space, it's invalid + if (primaryValue.includes(' ')) { + showNotification('The world name cannot contain spaces!', 'error'); + hidePreloader(); + return; // Prevent submission + } const secondaryValue = document.getElementById('secondary-field').value.trim(); if (secondaryValue === '' || secondaryValue === document.getElementById('secondary-field').placeholder) { showNotification('Please select a world type!', 'error'); diff --git a/UIMod/onboard_bundled/ui/index.html b/UIMod/onboard_bundled/ui/index.html index 3ffbd622..4e70928e 100644 --- a/UIMod/onboard_bundled/ui/index.html +++ b/UIMod/onboard_bundled/ui/index.html @@ -107,7 +107,7 @@

signature sentence

JacksonTheMaster

-
+