Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ✨ Adds server startup information #32

Merged
merged 66 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
e503c07
build: add auto-labeler and sponsors information (#17)
JamesIves Jul 5, 2024
8a868bd
build(deps): bump softprops/action-gh-release from 1 to 2 (#18)
dependabot[bot] Jul 13, 2024
9fcf642
build(deps): bump actions/checkout from 3 to 4 (#19)
dependabot[bot] Jul 13, 2024
9dcb994
docs: 📝 Improve documentation (#21)
JamesIves Jul 13, 2024
9c30f76
Update label.yml
JamesIves Jul 13, 2024
2633daf
Merge branch 'beta' of github.com:JamesIves/hlds-docker into beta
JamesIves Jul 13, 2024
97bbe4b
Delete crowbar.png
JamesIves Jul 13, 2024
5eed023
Update README.md
JamesIves Jul 13, 2024
545633d
Merge branch 'main' into beta
JamesIves Jul 13, 2024
4b6bbce
Update sponsors.yml
JamesIves Jul 13, 2024
ee94d7c
docs: more doc improvements/spell checks etc
JamesIves Jul 13, 2024
514251e
Deploying to beta from @ JamesIves/hlds-docker@ee94d7ce3c59b132a08827…
JamesIves Jul 13, 2024
c85fe40
Update sponsors.yml
JamesIves Jul 13, 2024
072a29a
Merge branch 'beta' of github.com:JamesIves/hlds-docker into beta
JamesIves Jul 13, 2024
28ef0bd
Update README.md
JamesIves Jul 13, 2024
95571ff
docs: server -> joinable not error
JamesIves Jul 13, 2024
651866a
Update CUSTOM_MODS.md
JamesIves Jul 13, 2024
5c669df
Update SERVER_CONFIGS_AND_PLUGINS.md
JamesIves Jul 13, 2024
2b45d0f
Update README.md
JamesIves Jul 13, 2024
617234a
Update README.md
JamesIves Jul 13, 2024
1d0efe0
Update BUG.yml
JamesIves Jul 13, 2024
519c1b4
docs: fix clipping issue
JamesIves Jul 14, 2024
869bb2f
build: :wrench: adjust docker-compose.local to docker-compose.build a…
JamesIves Jul 14, 2024
84bca9d
feat: split things into container dir
JamesIves Jul 15, 2024
46ee10a
docs: shuffle docs around
JamesIves Jul 15, 2024
a24bd35
Update beta.yml
JamesIves Jul 15, 2024
35b121e
Update publish.yml
JamesIves Jul 15, 2024
9a17093
Update README.md
JamesIves Jul 15, 2024
5f4bbbb
docs: improve REAMDE
JamesIves Jul 15, 2024
98863fc
Update README.md
JamesIves Jul 15, 2024
81bf4e3
Update CONTRIBUTING.md
JamesIves Jul 15, 2024
dcd2e35
Merge branch 'main' into beta
JamesIves Jul 15, 2024
a2ca360
docs: remove old examples
JamesIves Jul 15, 2024
ea1412d
docs: cleanup docs
JamesIves Jul 15, 2024
04dff56
Update Dockerfile
JamesIves Jul 15, 2024
b7403b5
Update Dockerfile
JamesIves Jul 15, 2024
2da7ff4
Update Dockerfile
JamesIves Jul 15, 2024
dc324b1
docs: more doc examples.
JamesIves Jul 15, 2024
4080b77
Update docker-compose.yml
JamesIves Jul 15, 2024
4e78a8c
Update .gitignore
JamesIves Jul 15, 2024
96533b9
Update entrypoint.sh
JamesIves Jul 15, 2024
01b05f6
build(deps): bump anothrNick/github-tag-action from 1.69.0 to 1.70.0 …
dependabot[bot] Jul 15, 2024
1ead31a
docs: 📝 Improved bug report form and added rcon_password example (#26)
JamesIves Jul 16, 2024
d9630fe
Update BUG.yml
JamesIves Jul 16, 2024
46caecd
Update BUG.yml
JamesIves Jul 16, 2024
c254563
Merge branch 'main' into beta
JamesIves Jul 19, 2024
a7a117f
docs: include private sponsors [skip ci]
JamesIves Sep 1, 2024
cbc6a7c
chore: Update sponsors 💖 [skip ci]
JamesIves Sep 1, 2024
5295fa6
docs: update sponsors again [skip ci]
JamesIves Sep 1, 2024
11e9d32
Merge branch 'beta' of github.com:JamesIves/hlds-docker into beta
JamesIves Sep 1, 2024
7bb2e88
chore: Update sponsors 💖 [skip ci]
JamesIves Sep 1, 2024
763739c
Update sponsors.yml
JamesIves Sep 1, 2024
40d74e8
chore: Update sponsors 💖 [skip ci]
JamesIves Sep 1, 2024
b374306
chore: Update sponsors 💖 [skip ci]
JamesIves Sep 3, 2024
2fb6d66
feat: support titles with legacy beta versions, ie valve-legacy, cstr…
JamesIves Sep 5, 2024
8f195b4
fix: properly pass in flags
JamesIves Sep 5, 2024
82226b7
fix: adjust how flags are passed in
JamesIves Sep 5, 2024
614f117
build: :wrench: Rename FLAGS -> FLAG to mirror GAME
JamesIves Sep 5, 2024
fc8fc2d
fix: pass in correct game name
JamesIves Sep 5, 2024
4e88a24
Merge branch 'main' into beta
JamesIves Sep 5, 2024
9a2afb1
docs: remove build: docker as its not needed
JamesIves Sep 5, 2024
7d8aed0
Merge branch 'main' into beta
JamesIves Sep 5, 2024
6d010a1
build(startup): :wrench: Setup initial build debug scripts
JamesIves Sep 7, 2024
17a98ab
build: add meta data for image
JamesIves Sep 8, 2024
fab8ee5
fix: adjust ordering of ascii art
JamesIves Sep 9, 2024
df774a3
chore: adjust default startup to use hldm
JamesIves Sep 9, 2024
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
8 changes: 8 additions & 0 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,17 @@ jobs:
env:
GAME: ${{ env.GAME }}
FLAG: ${{ env.FLAG }}
VERSION: beta
IMAGE: jives/hlds:${{ matrix.game }}-beta
with:
context: ./container
push: true
tags: jives/hlds:${{ matrix.game }}-beta
build-args: |
GAME=${{ env.GAME }}
FLAG=${{ env.FLAG }}
IMAGE=jives/hlds:${{ matrix.game }}-beta
VERSION=beta

- name: Set repo owner to lowercase
id: repo_owner
Expand All @@ -88,10 +92,14 @@ jobs:
env:
GAME: ${{ env.GAME }}
FLAG: ${{ env.FLAG }}
VERSION: beta
IMAGE: ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-beta
with:
context: ./container
push: true
tags: ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-beta
build-args: |
GAME=${{ env.GAME }}
FLAG=${{ env.FLAG }}
VERSION=beta
IMAGE=ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-beta
9 changes: 8 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
DEFAULT_BUMP: patch
DRY_RUN: true

build:
Expand Down Expand Up @@ -91,6 +90,8 @@ jobs:
env:
GAME: ${{ env.GAME }}
FLAG: ${{ env.FLAG }}
VERSION: ${{ needs.version.outputs.version }}
IMAGE: jives/hlds:${{ matrix.game }}-${{ needs.version.outputs.version }}
with:
context: ./container
push: true
Expand All @@ -100,6 +101,8 @@ jobs:
build-args: |
GAME=${{ env.GAME}}
FLAG=${{ env.FLAG }}
VERSION=${{ needs.version.outputs.version }}
IMAGE: jives/hlds:${{ matrix.game }}-${{ needs.version.outputs.version }}

- name: Set repo owner to lowercase
id: repo_owner
Expand All @@ -110,6 +113,8 @@ jobs:
env:
GAME: ${{ matrix.game }}
FLAG: ${{ env.FLAG }}
VERSION: ${{ needs.version.outputs.version }}
IMAGE: ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-${{ needs.version.outputs.version }}
with:
context: ./container
push: true
Expand All @@ -119,6 +124,8 @@ jobs:
build-args: |
GAME=${{ env.GAME }}
FLAG=${{ env.FLAG }}
VERSION=${{ needs.version.outputs.version }}
IMAGE: ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-${{ needs.version.outputs.version }}

publish:
needs: build
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ docker run -d \
-p 27015:27015 \
-p 26900:26900/udp \
-e GAME=${GAME} \
jives/hlds:cstrike \
"+log on +rcon_password changeme +maxplayers 12 +map cs_italy" # 📣 Modify your server startup commands here. You can specify the image with the desired game you want the server to run in the line above.
jives/hlds:valve \
"+log on +rcon_password changeme +maxplayers 12 +map crossfire" # 📣 Modify your server startup commands here. You can specify the image with the desired game you want the server to run in the line above.
```

> [!TIP]
Expand Down
31 changes: 21 additions & 10 deletions container/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
FROM ubuntu:18.04

LABEL org.opencontainers.image.title="hlds"
LABEL org.opencontainers.image.description="🐋 📦 Half-Life Dedicated Server powered by Docker. Supports all the classic GoldSrc Half-Life games and mods, including the ability to add custom configurations and plugins."
LABEL org.opencontainers.image.vendor="https://jamesiv.es"
LABEL org.opencontainers.image.authors="James Ives"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.url="https://github.com/jamesives/hlds-docker"
LABEL org.opencontainers.image.documentation="https://github.com/jamesives/hlds-docker"
LABEL org.opencontainers.image.source="https://github.com/jamesives/hlds-docker"

# Sets an environment variable for the game to install.
# Supported games: valve, cstrike, czero, dod, dmc, gearbox, ricochet, tfc
# Default is valve. This get replaced when building the image with --build-arg GAME=<game>
Expand All @@ -21,6 +12,25 @@ ENV GAME ${GAME}
ARG FLAG
ENV FLAG ${FLAG}

# Sets an environment variable for the version of the image.
ARG VERSION=custom
ENV VERSION ${VERSION}

# Sets an environment variable for the image name.
ARG IMAGE=custom
ENV IMAGE ${IMAGE}

# Tags the image with the Open Containers Initiative (OCI) image format.
LABEL org.opencontainers.image.title="hlds:${GAME}"
LABEL org.opencontainers.image.description="🐋 📦 Half-Life Dedicated Server powered by Docker. Supports all the classic GoldSrc Half-Life games and mods, including the ability to add custom configurations and plugins."
LABEL org.opencontainers.image.vendor="https://jamesiv.es"
LABEL org.opencontainers.image.authors="James Ives (https://jamesiv.es)"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.url="https://github.com/jamesives/hlds-docker"
LABEL org.opencontainers.image.documentation="https://github.com/jamesives/hlds-docker"
LABEL org.opencontainers.image.source="https://github.com/jamesives/hlds-docker"
LABEL org.opencontainers.image.version="${VERSION}"

RUN dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y --no-install-recommends curl rsync file libc6:i386 lib32stdc++6 ca-certificates && \
Expand Down Expand Up @@ -60,4 +70,5 @@ COPY --chown=steam:steam mods .

RUN chmod +x ./entrypoint.sh

ENTRYPOINT ["./entrypoint.sh"]

ENTRYPOINT ["./entrypoint.sh"]
6 changes: 5 additions & 1 deletion container/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ services:
args:
- GAME=${GAME}
- FLAG=${FLAG}
- VERSION=${VERSION}
- IMAGE=${IMAGE}
volumes:
- "./config:/temp/config"
- "./mods:/temp/mods"
Expand All @@ -15,4 +17,6 @@ services:
environment:
- GAME=${GAME}
- FLAG=${FLAG}
command: +maxplayers 12 +log on
- VERSION=${VERSION}
- IMAGE=${IMAGE}
command: +maxplayers 12 +log on +rcon_password "changeme" +map crossfire
44 changes: 42 additions & 2 deletions container/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env sh

# Set GAME to its value if defined, or 'valve' if not
GAME=${GAME:-valve}
VERSION=${VERSION:-custom}
IMAGE=${IMAGE:-custom}

if echo "$@" | grep -qv "+map"; then
echo -e "\e[33mWarning: No +map specified in the command. Server will start but may not be joinable.\e[0m"
Expand All @@ -18,7 +19,46 @@ then
rsync --chown=steam:steam /temp/config/* /opt/steam/hlds/$GAME
fi

echo -e "\e[32mStarting Half-Life Dedicated Server for $GAME...\e[0m"

echo "
..::::::..
:-=++++++++++++=-:
:=++++=--::...::-=++++=:
:=+++=: :-++++:
=+++- =====: -+++=
++++. ===+++. .=+++
=+++ :+++ =+++
:+++. -+++= .+++:
=++= =+++++- =++=
=++- .=++-:+++: -+++
=++= .+++- -+++. =++=
:+++. :+++. =+++ .+++:
=+++ =++=. ++++++= =++=
=+++. -==- .+++=-: .=+++
=+++-. -+++=
:=+++=: :=+++=:
:=+++++=-::..::-=+++++=:
:-=++++++++++++=-:
..::::::..

hlds-docker

====================================================================
💿 Image: $IMAGE
📎 Version: $VERSION
🎮 Game: $GAME
====================================================================

▄▄ LINKS ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ █
█ 🔧 Maintained by Jives: https://jives.dev █
█ 💖 Support: https://github.com/sponsors/JamesIves █
█ 🔔 Feedback / Issues: https://github.com/JamesIves/hlds-docker █
█ █
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
"

echo "\e[32mStarting Half-Life Dedicated Server...\e[0m"

# Start the server with the specified game and any additional arguments.
./hlds_run "-game $GAME $@"
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
# 🔧 jives/hlds:valve-legacy (Half-Life Deathmatch) (Pre 25th Anniversary Edition)
# 🔧 jives/hlds:cstrike-legacy (Counter-Strike) (Pre 25th Anniversary Edition)
# 🔧 jives/hlds:czero-legacy (Counter-Strike: Condition Zero) (Pre 25th Anniversary Edition)
image: jives/hlds:cstrike
image: jives/hlds:valve
# 📣 Learn more about these volumes in the advanced setup guides: https://github.com/JamesIves/hlds-docker?tab=readme-ov-file#advanced-setup-%EF%B8%8F
volumes:
- "./config:/temp/config"
Expand All @@ -26,4 +26,4 @@ services:
# 📣 Modify your server startup commands here, you can add more FLAG as needed (see: https://developer.valvesoftware.com/wiki/Half-Life_Dedicated_Server),
# 📣 Remember: Stating map is based on the game, and will likely be different between images.
# 📣 You should also modify the rcon_password value so you can use server admin commands.
command: +log on +rcon_password "changeme" +maxplayers 12 +map cs_italy
command: +log on +rcon_password "changeme" +maxplayers 12 +map crossfire
Loading