From 9c17fcac509ce656cc59d556ef236cdf862227f1 Mon Sep 17 00:00:00 2001 From: Maik Laschober Date: Fri, 24 Jul 2020 08:53:22 +0200 Subject: [PATCH] initial commit --- Dockerfile | 27 ++ NOTE.md | 17 + README.md | 3 + build-custom-example/Dockerfile | 16 + build-custom-example/README.md | 14 + build-custom-example/run/docker-compose.yml | 12 + build-custom-example/serverconfig.json | 347 ++++++++++++++++++++ serverconfig.json | 347 ++++++++++++++++++++ 8 files changed, 783 insertions(+) create mode 100644 Dockerfile create mode 100644 NOTE.md create mode 100644 README.md create mode 100644 build-custom-example/Dockerfile create mode 100644 build-custom-example/README.md create mode 100644 build-custom-example/run/docker-compose.yml create mode 100644 build-custom-example/serverconfig.json create mode 100644 serverconfig.json diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..11a8bc0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +# ============== download stage ================== +FROM alpine as downloader + +WORKDIR /download + +ENV VSVERSION 1.12.14 + +RUN wget "https://cdn.vintagestory.at/gamefiles/stable/vs_server_${VSVERSION}.tar.gz" +RUN tar xzf "vs_server_${VSVERSION}.tar.gz" +RUN rm "vs_server_${VSVERSION}.tar.gz" + +# ============== runtime stage ================== +FROM mono:latest as runtime + +WORKDIR /game + +ENV VSDATAPATH vs + +COPY --from=downloader "./download/" "/game" +COPY "./serverconfig.json" "/gamedata/${VSDATAPATH}/serverconfig.json" + + +# CMD [ "mono" , "VintagestoryServer.exe", "--dataPath", "/gamedata/${VSDATAPATH}" ] +CMD mono VintagestoryServer.exe --dataPath "/gamedata/${VSDATAPATH}" + +# Expose ports +EXPOSE 42420/tcp \ No newline at end of file diff --git a/NOTE.md b/NOTE.md new file mode 100644 index 0000000..ad89af4 --- /dev/null +++ b/NOTE.md @@ -0,0 +1,17 @@ +# Contribution note +just some notes for myself in case i forgot how to upgrade the image + +```sh +#build +docker build -t devidian/vintagestory . +#push +docker push devidian/vintagestory +#run +docker run -pd 42420:42420 --name VintageStoryServer vintagestory +# -------------------------------------- +# --------- using composer ------------- +#start +docker-compose up -d +#stop +docker-compose down +``` \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..c95b4c2 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Run this image +To run this image you can use `docker run -pd 42420:42420 --name VintageStoryServer devidian/vintagestory`, but you may want to use a customized version for your needs so see `./build-custom-example/README.md` + diff --git a/build-custom-example/Dockerfile b/build-custom-example/Dockerfile new file mode 100644 index 0000000..0de3cf3 --- /dev/null +++ b/build-custom-example/Dockerfile @@ -0,0 +1,16 @@ +# ============== runtime stage ================== +FROM devidian/vintagestory:latest as runtime + +WORKDIR /game + +ENV VSDATAPATH vs-custom + +# update with your own serverconfig +COPY "./serverconfig.json" "/gamedata/${VSDATAPATH}/serverconfig.json" + + +# CMD [ "mono" , "VintagestoryServer.exe", "--dataPath", "/gamedata/${VSDATAPATH}" ] +CMD mono VintagestoryServer.exe --dataPath "/gamedata/${VSDATAPATH}" + +# Expose ports +EXPOSE 42420/tcp \ No newline at end of file diff --git a/build-custom-example/README.md b/build-custom-example/README.md new file mode 100644 index 0000000..8e4cbad --- /dev/null +++ b/build-custom-example/README.md @@ -0,0 +1,14 @@ +# Create custom docker image +You can use this `Dockerfile` to create your own serverconfig using `devidian/vintagestory` as base. Just edit serverconfig.json and run `docker build -t YOUR_IMAGE_NAME`. You may also add / override additional files like mods. + +## Run custom docker image +to run the image you can either use `docker run -pd 42420:42420 --name VintageStoryServer YOUR_IMAGE_NAME` or use the composer file as follows (dont forget to change `YOUR_IMAGE_NAME` in `docker-composer.yml`) + +```bash +cd run; + +#start +docker-compose up -d +#stop +docker-compose down +``` \ No newline at end of file diff --git a/build-custom-example/run/docker-compose.yml b/build-custom-example/run/docker-compose.yml new file mode 100644 index 0000000..d6976be --- /dev/null +++ b/build-custom-example/run/docker-compose.yml @@ -0,0 +1,12 @@ +version: '3' + +services: + vsserver: + image: YOUR_IMAGE_NAME + container_name: vsserver + volumes: + - gamedata:/gamedata + ports: + - "42420:42420" +volumes: + gamedata: \ No newline at end of file diff --git a/build-custom-example/serverconfig.json b/build-custom-example/serverconfig.json new file mode 100644 index 0000000..f0d3934 --- /dev/null +++ b/build-custom-example/serverconfig.json @@ -0,0 +1,347 @@ +{ + "ConfigVersion": "1.3", + "ServerMonitor": true, + "MasterserverUrl": "http://masterserver.vintagestory.at/api/v1/servers/", + "ClientConnectionTimeout": 600, + "ClientPlayingTimeout": 60, + "BuildLogging": false, + "EntityDebugMode": false, + "MapSizeX": 1000000, + "MapSizeY": 256, + "MapSizeZ": 1000000, + "ServerLanguage": "de", + "SkipEveryChunkRow": 0, + "SkipEveryChunkRowWidth": 0, + "ModPaths": [ + "Mods", + "/gamedata/vs-custom/Mods" + ], + "WorldConfig": { + "Seed": null, + "SaveFileLocation": "/gamedata/vs-custom/Saves/default.vcdbs", + "WorldName": "VintageDockerExample", + "AllowCreativeMode": true, + "PlayStyle": "surviveandbuild", + "PlayStyleLangCode": "surviveandbuild-bands", + "WorldType": "standard", + "WorldConfiguration": null, + "MapSizeY": null, + "CreatedByPlayerName": null, + "DisabledMods": null + }, + "NextPlayerGroupUid": 10, + "GroupChatHistorySize": 20, + "MaxOwnedGroupChannelsPerUser": 10, + "ServerName": "DE - VintageDockerExample - CustomBuild", + "ServerUrl": null, + "ServerDescription": "VintageServer running in Docker container", + "WelcomeMessage": "Welcome {0}, may you survive well and prosper", + "Ip": null, + "Port": 42420, + "Upnp": false, + "CompressPackets": true, + "AdvertiseServer": true, + "MaxClients": 16, + "Password": "", + "MaxChunkRadius": 12, + "TickTime": 33.3333321, + "BlockTickChunkRange": 3, + "MaxMainThreadBlockTicks": 10000, + "RandomBlockTicksPerChunk": 16, + "BlockTickInterval": 300, + "Roles": [ + { + "Code": "suvisitor", + "Name": "Survival Visitor", + "Description": "Can only visit this world and chat but not use/place/break anything", + "PrivilegeLevel": -1, + "DefaultSpawn": null, + "ForcedSpawn": null, + "Privileges": [ + "chat" + ], + "RuntimePrivileges": [], + "DefaultGameMode": 1, + "Color": "Green", + "LandClaimAllowance": 0, + "LandClaimMinSize": { + "X": 5, + "Y": 5, + "Z": 5 + }, + "LandClaimMaxAreas": 3, + "AutoGrant": false + }, + { + "Code": "crvisitor", + "Name": "Creative Visitor", + "Description": "Can only visit this world, chat and fly but not use/place/break anything", + "PrivilegeLevel": -1, + "DefaultSpawn": null, + "ForcedSpawn": null, + "Privileges": [ + "chat" + ], + "RuntimePrivileges": [], + "DefaultGameMode": 2, + "Color": "DarkGray", + "LandClaimAllowance": 0, + "LandClaimMinSize": { + "X": 5, + "Y": 5, + "Z": 5 + }, + "LandClaimMaxAreas": 3, + "AutoGrant": false + }, + { + "Code": "limitedsuplayer", + "Name": "Limited Survival Player", + "Description": "Can use/place/break blocks only in permitted areas (priv level -1), create/manage player groups and chat", + "PrivilegeLevel": -1, + "DefaultSpawn": null, + "ForcedSpawn": null, + "Privileges": [ + "controlplayergroups", + "manageplayergroups", + "chat", + "build", + "useblock", + "attackcreatures", + "attackplayers" + ], + "RuntimePrivileges": [], + "DefaultGameMode": 1, + "Color": "White", + "LandClaimAllowance": 0, + "LandClaimMinSize": { + "X": 5, + "Y": 5, + "Z": 5 + }, + "LandClaimMaxAreas": 3, + "AutoGrant": false + }, + { + "Code": "limitedcrplayer", + "Name": "Limited Creative Player", + "Description": "Can use/place/break blocks in only in permitted areas (priv level -1), create/manage player groups, chat, fly and set his own game mode (= allows fly and change of move speed)", + "PrivilegeLevel": -1, + "DefaultSpawn": null, + "ForcedSpawn": null, + "Privileges": [ + "controlplayergroups", + "manageplayergroups", + "chat", + "build", + "useblock", + "gamemode", + "freemove", + "attackcreatures", + "attackplayers" + ], + "RuntimePrivileges": [], + "DefaultGameMode": 2, + "Color": "LightGreen", + "LandClaimAllowance": 0, + "LandClaimMinSize": { + "X": 5, + "Y": 5, + "Z": 5 + }, + "LandClaimMaxAreas": 3, + "AutoGrant": false + }, + { + "Code": "suplayer", + "Name": "Survival Player", + "Description": "Can use/place/break blocks in unprotected areas (priv level 0), create/manage player groups and chat. Can claim an area of up to 8 chunks.", + "PrivilegeLevel": 0, + "DefaultSpawn": null, + "ForcedSpawn": null, + "Privileges": [ + "controlplayergroups", + "manageplayergroups", + "chat", + "areamodify", + "build", + "useblock", + "attackcreatures", + "attackplayers" + ], + "RuntimePrivileges": [], + "DefaultGameMode": 1, + "Color": "White", + "LandClaimAllowance": 262144, + "LandClaimMinSize": { + "X": 5, + "Y": 5, + "Z": 5 + }, + "LandClaimMaxAreas": 3, + "AutoGrant": false + }, + { + "Code": "crplayer", + "Name": "Creative Player", + "Description": "Can use/place/break blocks in all areas (priv level 100), create/manage player groups, chat, fly and set his own game mode (= allows fly and change of move speed). Can claim an area of up to 40 chunks.", + "PrivilegeLevel": 100, + "DefaultSpawn": null, + "ForcedSpawn": null, + "Privileges": [ + "controlplayergroups", + "manageplayergroups", + "chat", + "areamodify", + "build", + "useblock", + "gamemode", + "freemove", + "attackcreatures", + "attackplayers" + ], + "RuntimePrivileges": [], + "DefaultGameMode": 2, + "Color": "LightGreen", + "LandClaimAllowance": 1310720, + "LandClaimMinSize": { + "X": 5, + "Y": 5, + "Z": 5 + }, + "LandClaimMaxAreas": 6, + "AutoGrant": false + }, + { + "Code": "sumod", + "Name": "Survival Moderator", + "Description": "Can use/place/break blocks everywhere (priv level 200), create/manage player groups, chat, kick/ban players and do serverwide announcements. Can claim an area of up to 4 chunks.", + "PrivilegeLevel": 200, + "DefaultSpawn": null, + "ForcedSpawn": null, + "Privileges": [ + "controlplayergroups", + "manageplayergroups", + "chat", + "areamodify", + "build", + "useblock", + "buildblockseverywhere", + "useblockseverywhere", + "kick", + "ban", + "announce", + "readlists", + "attackcreatures", + "attackplayers" + ], + "RuntimePrivileges": [], + "DefaultGameMode": 1, + "Color": "Cyan", + "LandClaimAllowance": 1310720, + "LandClaimMinSize": { + "X": 5, + "Y": 5, + "Z": 5 + }, + "LandClaimMaxAreas": 60, + "AutoGrant": false + }, + { + "Code": "crmod", + "Name": "Creative Moderator", + "Description": "Can use/place/break blocks everywhere (priv level 500), create/manage player groups, chat, kick/ban players, fly and set his own or other players game modes (= allows fly and change of move speed). Can claim an area of up to 40 chunks.", + "PrivilegeLevel": 500, + "DefaultSpawn": null, + "ForcedSpawn": null, + "Privileges": [ + "controlplayergroups", + "manageplayergroups", + "chat", + "areamodify", + "build", + "useblock", + "buildblockseverywhere", + "useblockseverywhere", + "kick", + "ban", + "gamemode", + "freemove", + "commandplayer", + "announce", + "readlists", + "attackcreatures", + "attackplayers" + ], + "RuntimePrivileges": [], + "DefaultGameMode": 2, + "Color": "Cyan", + "LandClaimAllowance": 1310720, + "LandClaimMinSize": { + "X": 5, + "Y": 5, + "Z": 5 + }, + "LandClaimMaxAreas": 60, + "AutoGrant": false + }, + { + "Code": "admin", + "Name": "Admin", + "Description": "Has all privileges, including giving other players admin status.", + "PrivilegeLevel": 99999, + "DefaultSpawn": null, + "ForcedSpawn": null, + "Privileges": [ + "build", + "useblock", + "buildblockseverywhere", + "useblockseverywhere", + "attackplayers", + "attackcreatures", + "freemove", + "gamemode", + "pickingrange", + "chat", + "kick", + "ban", + "whitelist", + "setwelcome", + "announce", + "readlists", + "give", + "areamodify", + "setspawn", + "controlserver", + "tp", + "time", + "grantrevoke", + "root", + "commandplayer", + "controlplayergroups", + "manageplayergroups", + "worldedit", + "denybreakreinforced" + ], + "RuntimePrivileges": [], + "DefaultGameMode": 1, + "Color": "LightBlue", + "LandClaimAllowance": 2147483647, + "LandClaimMinSize": { + "X": 5, + "Y": 5, + "Z": 5 + }, + "LandClaimMaxAreas": 99999, + "AutoGrant": true + } + ], + "DefaultRoleCode": "suplayer", + "AntiAbuse": 0, + "OnlyWhitelisted": false, + "VerifyPlayerAuth": true, + "DefaultSpawn": null, + "AllowPvP": false, + "AllowFireSpread": true, + "AllowFallingBlocks": true +} \ No newline at end of file diff --git a/serverconfig.json b/serverconfig.json new file mode 100644 index 0000000..c10f746 --- /dev/null +++ b/serverconfig.json @@ -0,0 +1,347 @@ +{ + "ConfigVersion": "1.3", + "ServerMonitor": true, + "MasterserverUrl": "http://masterserver.vintagestory.at/api/v1/servers/", + "ClientConnectionTimeout": 600, + "ClientPlayingTimeout": 60, + "BuildLogging": false, + "EntityDebugMode": false, + "MapSizeX": 1000000, + "MapSizeY": 256, + "MapSizeZ": 1000000, + "ServerLanguage": "de", + "SkipEveryChunkRow": 0, + "SkipEveryChunkRowWidth": 0, + "ModPaths": [ + "Mods", + "/gamedata/vs/Mods" + ], + "WorldConfig": { + "Seed": null, + "SaveFileLocation": "/gamedata/vs/Saves/default.vcdbs", + "WorldName": "VintageDockerExample", + "AllowCreativeMode": true, + "PlayStyle": "surviveandbuild", + "PlayStyleLangCode": "surviveandbuild-bands", + "WorldType": "standard", + "WorldConfiguration": null, + "MapSizeY": null, + "CreatedByPlayerName": null, + "DisabledMods": null + }, + "NextPlayerGroupUid": 10, + "GroupChatHistorySize": 20, + "MaxOwnedGroupChannelsPerUser": 10, + "ServerName": "DE - VintageDockerExample", + "ServerUrl": null, + "ServerDescription": "VintageServer running in Docker container", + "WelcomeMessage": "Welcome {0}, may you survive well and prosper", + "Ip": null, + "Port": 42420, + "Upnp": false, + "CompressPackets": true, + "AdvertiseServer": true, + "MaxClients": 16, + "Password": "", + "MaxChunkRadius": 12, + "TickTime": 33.3333321, + "BlockTickChunkRange": 3, + "MaxMainThreadBlockTicks": 10000, + "RandomBlockTicksPerChunk": 16, + "BlockTickInterval": 300, + "Roles": [ + { + "Code": "suvisitor", + "Name": "Survival Visitor", + "Description": "Can only visit this world and chat but not use/place/break anything", + "PrivilegeLevel": -1, + "DefaultSpawn": null, + "ForcedSpawn": null, + "Privileges": [ + "chat" + ], + "RuntimePrivileges": [], + "DefaultGameMode": 1, + "Color": "Green", + "LandClaimAllowance": 0, + "LandClaimMinSize": { + "X": 5, + "Y": 5, + "Z": 5 + }, + "LandClaimMaxAreas": 3, + "AutoGrant": false + }, + { + "Code": "crvisitor", + "Name": "Creative Visitor", + "Description": "Can only visit this world, chat and fly but not use/place/break anything", + "PrivilegeLevel": -1, + "DefaultSpawn": null, + "ForcedSpawn": null, + "Privileges": [ + "chat" + ], + "RuntimePrivileges": [], + "DefaultGameMode": 2, + "Color": "DarkGray", + "LandClaimAllowance": 0, + "LandClaimMinSize": { + "X": 5, + "Y": 5, + "Z": 5 + }, + "LandClaimMaxAreas": 3, + "AutoGrant": false + }, + { + "Code": "limitedsuplayer", + "Name": "Limited Survival Player", + "Description": "Can use/place/break blocks only in permitted areas (priv level -1), create/manage player groups and chat", + "PrivilegeLevel": -1, + "DefaultSpawn": null, + "ForcedSpawn": null, + "Privileges": [ + "controlplayergroups", + "manageplayergroups", + "chat", + "build", + "useblock", + "attackcreatures", + "attackplayers" + ], + "RuntimePrivileges": [], + "DefaultGameMode": 1, + "Color": "White", + "LandClaimAllowance": 0, + "LandClaimMinSize": { + "X": 5, + "Y": 5, + "Z": 5 + }, + "LandClaimMaxAreas": 3, + "AutoGrant": false + }, + { + "Code": "limitedcrplayer", + "Name": "Limited Creative Player", + "Description": "Can use/place/break blocks in only in permitted areas (priv level -1), create/manage player groups, chat, fly and set his own game mode (= allows fly and change of move speed)", + "PrivilegeLevel": -1, + "DefaultSpawn": null, + "ForcedSpawn": null, + "Privileges": [ + "controlplayergroups", + "manageplayergroups", + "chat", + "build", + "useblock", + "gamemode", + "freemove", + "attackcreatures", + "attackplayers" + ], + "RuntimePrivileges": [], + "DefaultGameMode": 2, + "Color": "LightGreen", + "LandClaimAllowance": 0, + "LandClaimMinSize": { + "X": 5, + "Y": 5, + "Z": 5 + }, + "LandClaimMaxAreas": 3, + "AutoGrant": false + }, + { + "Code": "suplayer", + "Name": "Survival Player", + "Description": "Can use/place/break blocks in unprotected areas (priv level 0), create/manage player groups and chat. Can claim an area of up to 8 chunks.", + "PrivilegeLevel": 0, + "DefaultSpawn": null, + "ForcedSpawn": null, + "Privileges": [ + "controlplayergroups", + "manageplayergroups", + "chat", + "areamodify", + "build", + "useblock", + "attackcreatures", + "attackplayers" + ], + "RuntimePrivileges": [], + "DefaultGameMode": 1, + "Color": "White", + "LandClaimAllowance": 262144, + "LandClaimMinSize": { + "X": 5, + "Y": 5, + "Z": 5 + }, + "LandClaimMaxAreas": 3, + "AutoGrant": false + }, + { + "Code": "crplayer", + "Name": "Creative Player", + "Description": "Can use/place/break blocks in all areas (priv level 100), create/manage player groups, chat, fly and set his own game mode (= allows fly and change of move speed). Can claim an area of up to 40 chunks.", + "PrivilegeLevel": 100, + "DefaultSpawn": null, + "ForcedSpawn": null, + "Privileges": [ + "controlplayergroups", + "manageplayergroups", + "chat", + "areamodify", + "build", + "useblock", + "gamemode", + "freemove", + "attackcreatures", + "attackplayers" + ], + "RuntimePrivileges": [], + "DefaultGameMode": 2, + "Color": "LightGreen", + "LandClaimAllowance": 1310720, + "LandClaimMinSize": { + "X": 5, + "Y": 5, + "Z": 5 + }, + "LandClaimMaxAreas": 6, + "AutoGrant": false + }, + { + "Code": "sumod", + "Name": "Survival Moderator", + "Description": "Can use/place/break blocks everywhere (priv level 200), create/manage player groups, chat, kick/ban players and do serverwide announcements. Can claim an area of up to 4 chunks.", + "PrivilegeLevel": 200, + "DefaultSpawn": null, + "ForcedSpawn": null, + "Privileges": [ + "controlplayergroups", + "manageplayergroups", + "chat", + "areamodify", + "build", + "useblock", + "buildblockseverywhere", + "useblockseverywhere", + "kick", + "ban", + "announce", + "readlists", + "attackcreatures", + "attackplayers" + ], + "RuntimePrivileges": [], + "DefaultGameMode": 1, + "Color": "Cyan", + "LandClaimAllowance": 1310720, + "LandClaimMinSize": { + "X": 5, + "Y": 5, + "Z": 5 + }, + "LandClaimMaxAreas": 60, + "AutoGrant": false + }, + { + "Code": "crmod", + "Name": "Creative Moderator", + "Description": "Can use/place/break blocks everywhere (priv level 500), create/manage player groups, chat, kick/ban players, fly and set his own or other players game modes (= allows fly and change of move speed). Can claim an area of up to 40 chunks.", + "PrivilegeLevel": 500, + "DefaultSpawn": null, + "ForcedSpawn": null, + "Privileges": [ + "controlplayergroups", + "manageplayergroups", + "chat", + "areamodify", + "build", + "useblock", + "buildblockseverywhere", + "useblockseverywhere", + "kick", + "ban", + "gamemode", + "freemove", + "commandplayer", + "announce", + "readlists", + "attackcreatures", + "attackplayers" + ], + "RuntimePrivileges": [], + "DefaultGameMode": 2, + "Color": "Cyan", + "LandClaimAllowance": 1310720, + "LandClaimMinSize": { + "X": 5, + "Y": 5, + "Z": 5 + }, + "LandClaimMaxAreas": 60, + "AutoGrant": false + }, + { + "Code": "admin", + "Name": "Admin", + "Description": "Has all privileges, including giving other players admin status.", + "PrivilegeLevel": 99999, + "DefaultSpawn": null, + "ForcedSpawn": null, + "Privileges": [ + "build", + "useblock", + "buildblockseverywhere", + "useblockseverywhere", + "attackplayers", + "attackcreatures", + "freemove", + "gamemode", + "pickingrange", + "chat", + "kick", + "ban", + "whitelist", + "setwelcome", + "announce", + "readlists", + "give", + "areamodify", + "setspawn", + "controlserver", + "tp", + "time", + "grantrevoke", + "root", + "commandplayer", + "controlplayergroups", + "manageplayergroups", + "worldedit", + "denybreakreinforced" + ], + "RuntimePrivileges": [], + "DefaultGameMode": 1, + "Color": "LightBlue", + "LandClaimAllowance": 2147483647, + "LandClaimMinSize": { + "X": 5, + "Y": 5, + "Z": 5 + }, + "LandClaimMaxAreas": 99999, + "AutoGrant": true + } + ], + "DefaultRoleCode": "suplayer", + "AntiAbuse": 0, + "OnlyWhitelisted": false, + "VerifyPlayerAuth": true, + "DefaultSpawn": null, + "AllowPvP": false, + "AllowFireSpread": true, + "AllowFallingBlocks": true +} \ No newline at end of file