Ready for container

This commit is contained in:
2022-05-25 16:30:38 -05:00
parent e4cb23b58c
commit 8eab598895
3 changed files with 504 additions and 7 deletions

View File

@@ -84,13 +84,13 @@ func RecursiveZip(pathToZip, destinationPath string) error {
func backup(c *gin.Context) {
err := RecursiveZip("/root/.wine/drive_c/users/root/AppData/LocalLow/Stunlock Studios/VRisingServer/Saves", "data/backup.zip")
err := RecursiveZip("/root/.wine/drive_c/users/root/AppData/LocalLow/Stunlock Studios/VRisingServer/Saves", "root/.wine/drive_c/vrisingserver/VRisingServer_Data/StreamingAssets/Settings/backup.zip")
if err != nil {
c.String(http.StatusBadRequest, err.Error())
return
}
backup, err := os.ReadFile("data/backup.zip")
backup, err := os.ReadFile("root/.wine/drive_c/vrisingserver/VRisingServer_Data/StreamingAssets/Settings/backup.zip")
if err != nil {
c.String(http.StatusBadRequest, err.Error())
return
@@ -102,22 +102,22 @@ func backup(c *gin.Context) {
func configure(c *gin.Context) {
file, err := c.FormFile("ServerHostSettings.json")
if err == nil {
c.SaveUploadedFile(file, "data/ServerHostSettings.json")
c.SaveUploadedFile(file, "root/.wine/drive_c/vrisingserver/VRisingServer_Data/StreamingAssets/Settings/ServerHostSettings.json")
}
file, err = c.FormFile("ServerGameSettings.json")
if err == nil {
c.SaveUploadedFile(file, "data/ServerGameSettings.json")
c.SaveUploadedFile(file, "root/.wine/drive_c/vrisingserver/VRisingServer_Data/StreamingAssets/Settings/ServerGameSettings.json")
}
file, err = c.FormFile("adminlist.txt")
if err == nil {
c.SaveUploadedFile(file, "data/adminlist.txt")
c.SaveUploadedFile(file, "root/.wine/drive_c/vrisingserver/VRisingServer_Data/StreamingAssets/Settings/adminlist.txt")
}
file, err = c.FormFile("banlist.txt")
if err == nil {
c.SaveUploadedFile(file, "data/banlist.txt")
c.SaveUploadedFile(file, "root/.wine/drive_c/vrisingserver/VRisingServer_Data/StreamingAssets/Settings/banlist.txt")
}
updated_page, err := indexHTML.ReadFile("html/updated.html")