-
Notifications
You must be signed in to change notification settings - Fork 103
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
Added bootstrap to vanilla; enables use of env variables (a la tshock image) #68
Open
doctorjei
wants to merge
5
commits into
ryansheehan:master
Choose a base branch
from
doctorjei:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ab8baf6
Added bootstrap to vanilla to enable use of environment variables for…
doctorjei f0c3e6e
Added executable update for safety
doctorjei a24bd21
Update bootstrap.sh
doctorjei 0e74c09
Merge remote-tracking branch 'upstream/master'
doctorjei bf1b7a5
Merge remote-tracking branch 'upstream/master'
doctorjei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,8 +20,15 @@ LABEL maintainer="Ryan Sheehan <[email protected]>" | |
|
||
EXPOSE 7777 | ||
|
||
# env used in the bootstrap | ||
ENV CONFIGPATH=/root/.local/share/Terraria/Worlds | ||
ENV WORLD_FILENAME="" | ||
|
||
VOLUME ["/root/.local/share/Terraria/Worlds", "/config"] | ||
|
||
COPY --from=base /terraria-server/ /terraria-server/ | ||
|
||
ENTRYPOINT ["mono", "/terraria-server/TerrariaServer.exe"] | ||
# add the bootstrap file | ||
COPY bootstrap.sh /terraria-server/bootstrap.sh | ||
RUN chmod +x /terraria-server/bootstrap.sh | ||
ENTRYPOINT ["/terraria-server/bootstrap.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ -z "$WORLD_FILENAME" ]; then | ||
/terraria-server/TerrariaServer $@ | ||
else | ||
/terraria-server/TerrariaServer -world $CONFIGPATH/$WORLD_FILENAME $@ | ||
fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the intent is that worlds are volumed in the
/root/.local/share/Terraria/Worlds
path where the executable defaults saving world files. Is the intent that the configuration data lives side-by-side with the world file on the host machine?Making this change would force users through the bootstrapper. If they do not have a world file how would that work? They would have to volume in the directory to save the data and then copy the data to where they store their config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! You're right, I shouldn't have the "-world" on line 4. I can fix that.
The goal was to make it so that the bootstrapper is a pass-through if WORLD_FILENAME is not defined. I.e., if they do not define WORLD_FILENAME, it should just call "/terraria-server/TerrariaServer $@" (which should still work if the users append "-world somefile.wld").
With respect to the CONFIGPATH, this is really meant to sync up with the tshock version (which defaults to the world path - "ENV CONFIGPATH=/root/.local/share/Terraria/Worlds"). I actually moved over from the tshock version to vanilla (due to the most recent Terraria update), so my goal was to sync up with that. Alternatively, I could add another "WORLDPATH" variable if we wanted to separate the world and configuration paths.
The overall goal was to try avoiding the necessity of hardcoding world file paths into the entrypoint / command, but to do so by using an abstraction that might be helpful in the future (by adding a thin wrapper around the vanilla server launcher).