Skip to content

Commit

Permalink
Deprecate TShock
Browse files Browse the repository at this point in the history
  • Loading branch information
PassiveLemon committed May 18, 2024
1 parent d1e5756 commit 35dfde2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 40 deletions.
24 changes: 1 addition & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ jobs:
echo "latest_terraria=$TERRARIA" >> "$GITHUB_OUTPUT"
echo "latest_terraria_fix=$TERRARIAFIX" >> "$GITHUB_OUTPUT"
- name: Get tshock release
id: get_tshock_release
run: |
TSHOCK=$(echo ${{ github.event.release.tag_name }} | awk -F'-' '{print $2}')
echo "Latest tshock release is ${TSHOCK}"
echo "latest_tshock=$TSHOCK" >> "$GITHUB_OUTPUT"
- name: Check if version already exists
run: |
CHECK=$(curl -s "https://hub.docker.com/v2/repositories/passivelemon/terraria-docker/tags/${{ github.event.release.tag_name }}")
Expand All @@ -53,29 +46,14 @@ jobs:
- name: Build the image
run: |
docker buildx create --name mainbuilder --driver docker-container --platform linux/amd64,linux/arm64 --use
docker buildx build --push \
--build-arg TERRARIAVERSION=${{ steps.get_terraria_release.outputs.latest_terraria }} \
--build-arg TERRARIAVERSIONFIX=${{ steps.get_terraria_release.outputs.latest_terraria_fix }} \
--build-arg TSHOCKVERSION="NA"
--provenance=false \
--platform linux/amd64,linux/arm64 \
--tag ${{ secrets.DOCKER_USERNAME }}/terraria-docker:${{ steps.get_terraria_release.outputs.latest_terraria }} \
--tag ${{ secrets.DOCKER_USERNAME }}/terraria-docker:terraria \
--tag ${{ secrets.DOCKER_USERNAME }}/terraria-docker:latest \
--tag ghcr.io/${{ secrets.GHCR_USERNAME }}/terraria-docker:${{ steps.get_terraria_release.outputs.latest_terraria }} \
--tag ghcr.io/${{ secrets.GHCR_USERNAME }}/terraria-docker:terraria \
--tag ghcr.io/${{ secrets.GHCR_USERNAME }}/terraria-docker:latest \
.
docker buildx build --push \
--build-arg TERRARIAVERSION=${{ steps.get_terraria_release.outputs.latest_terraria }} \
--build-arg TERRARIAVERSIONFIX=${{ steps.get_terraria_release.outputs.latest_terraria_fix }} \
--build-arg TSHOCKVERSION=${{ steps.get_tshock_release.outputs.latest_tshock }} \
--provenance=false \
--platform linux/amd64,linux/arm64 \
--tag ${{ secrets.DOCKER_USERNAME }}/terraria-docker:${{ github.event.release.tag_name }} \
--tag ${{ secrets.DOCKER_USERNAME }}/terraria-docker:terraria-tshock \
--tag ghcr.io/${{ secrets.GHCR_USERNAME }}/terraria-docker:${{ github.event.release.tag_name }} \
--tag ghcr.io/${{ secrets.GHCR_USERNAME }}/terraria-docker:terraria-tshock \
.
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ ARG TARGETARCH
# These come from the workflow --build-args
ARG TERRARIAVERSION
ARG TERRARIAVERSIONFIX
ARG TSHOCKVERSION

RUN apk add --no-cache bash grep curl unzip icu-dev tmux jq netcat-openbsd

Expand All @@ -23,16 +22,14 @@ RUN chmod -R 755 /opt/terraria/ &&\

WORKDIR /opt/terraria/server/

RUN curl -Lo ./Terraria.zip https://terraria.org/api/download/pc-dedicated-server/terraria-server-${TERRARIAVERSIONFIX}.zip

RUN unzip -jo ./Terraria.zip "${TERRARIAVERSIONFIX}/Linux/*" &&\
RUN curl -Lo ./Terraria.zip https://terraria.org/api/download/pc-dedicated-server/terraria-server-${TERRARIAVERSIONFIX}.zip &&\
unzip -jo ./Terraria.zip "${TERRARIAVERSIONFIX}/Linux/*" &&\
rm ./Terraria.zip

RUN chmod +x ./TerrariaServer*

ENV TARGETARCH=$TARGETARCH
ENV TERRARIAVERSION=$TERRARIAVERSION
ENV TSHOCKVERSION=$TSHOCKVERSION

ENV SERVERCONFIG="0"

Expand Down
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Docker container for a Terraria dedicated server
Setup guide is also in the [Wiki](https://github.com/PassiveLemon/terraria-docker/wiki) for organization. </br>

# Quick setup
1. Setup a directory for you server files. Can be something like `/opt/TerrariaServer/` or `C:\TerrariaServer\`.
1. Setup a directory for you server files. Can be something like `/opt/TerrariaServer/`(Linux) or `C:\TerrariaServer\`(Windows).
3. Run the container: <b>(Make sure to modify any values that you need.)</b>
- ```docker run -d --name terraria -p 7777:7777/tcp -v /opt/TerrariaServer/:/opt/terraria/config/ -e WORLD=superworld passivelemon/terraria-docker:latest```
4. Set up port forwarding.
Expand All @@ -26,7 +26,7 @@ For every variable you want the server to use, add that variable to your docker
### Container variables </br>
| Variable | Options | Default | Details
|:-|:-|:-|:-|
SERVERCONFIG | `boolean` | `0` | Toggles whether the server will use a user provided serverconfig file. `0` to use environment variables and `1` for provided file.
SERVERCONFIG | `boolean` | `0` | Toggles whether the server will use a user provided serverconfig file. `0` to use environment variables and `1` for provided file.

Check out server details and examples [here on the wiki](https://terraria.fandom.com/wiki/Server#Server_config_file). </br>

Expand Down Expand Up @@ -67,10 +67,10 @@ If you provide a world file and correctly set the `WORLDNAME` variable, it will

The root of the terraria server files in the container is `/opt/terraria/server/` and user items in `(ConfDir)` are mounted at `/opt/terraria/config/` </br>

1. Set `SERVERCONFIG` to 1.
1. Set `SERVERCONFIG` to 1.
2. Put the `serverconfig.txt` into `(ConfDir)/`.

[Server configuration details on the Terraria Wiki](https://terraria.fandom.com/wiki/Server#Server_config_file) </br>
[Server configuration details on the Terraria Wiki](https://terraria.wiki.gg/wiki/Server#Command-line_parameters) </br>

# 6. Docker container
### Docker run </br>
Expand Down Expand Up @@ -99,11 +99,6 @@ services:
| `-v (ConfDir):/opt/terraria/config` | Yes | Sets the folder that holds the configs like your worlds and serverconfig.txt. This should be the place you just chose. |
| `passivelemon/terraria-docker:latest` | Yes | The repository on Docker hub. By default, it is the latest version that I have published. |

| Tag | Purpose |
| :- | :- |
| `latest` | The latest standard release. |
| `terraria` | The latest standard release. |
| `terraria-tshock` | The latest release of Terraria with Tshock. CURRENTLY TSHOCK IS NOT IMPLEMENTED. |

## Examples </br>
### Docker run
Expand Down
3 changes: 0 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/usr/bin/env bash
echo "Terraria version $TERRARIAVERSION on $TARGETARCH"
if [ "$TSHOCKVERSION" != "NA" ]; then
echo "TShock version $TSHOCKVERSION"
fi

# Run the variables script to check and process server variables
source /opt/terraria/variables.sh
Expand Down

0 comments on commit 35dfde2

Please sign in to comment.