diff --git a/README.md b/README.md index e763193..5b4dffb 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,69 @@ Setup is easy from source, all you need is: - Run `./vssm` with no arguments to show usage ## Configuration -**For now, the configuration file is stored in `~/.config/vssm/config.json`, but this will be configurable later.** +The default configuration file is stored in `~/.local/share/vssm/config.json`, however you can pass the `--config ` flag to any command to use a custom configuration. You can also set the `VSSM_CONFIG_PATH` environment variable in lieu of using the config flag for every command. + +The default configuration: +```json +{ + "storage": { + "app_data_dir": "", + "install_dir": "/home/user/.local/share/vssm/vssm_data/installs", + "instances_dir": "/home/user/.local/share/vssm/vssm_data/instances", + "backup_dir": "/home/user/.local/share/vssm/vssm_data/backups", + "config_templates_dir": "/home/user/.local/share/vssm/vssm_data/config_templates" + }, + "daemon": { + "listen_address": "127.0.0.1", + "port": 65000 + }, + "instances": { + "test_server": { + "Version": "1.22.3", + "ServerName": "test_server", + "Port": 12345, + "config": null + } + } +``` + +- Storage + - install_dir - The directory where versioned server binaries are stored + - instances_dir - Directory for instances and their data + - backup_dir - Directory for automatic backups of instances + - config_templates_dir - Directory for versioned server configuration templates + +- Daemon + - port - The port the daemon listens on for http requests + - listen_address - The IP address the daemon listens on + +- Instances + - Version - The game version + - ServerName - The name of the instance + - Port - The port the instance is listening on + - config - This allows you to set ANY configuration item from the config, example below: + +Example instance with extra configuration: +```json +"test_server": { + "Version": "1.22.3", + "ServerName": "test_server", + "Port": 12345, + "config": { + "AllowPvP": true, + "WhiteListMode": 1, + "WelcomeMessage": "Welcome to the server, {0}!" + "WorldConfig": { + "Seed": "superawesomeseed", + "WorldName": "A new world", + "PlayStyle": "surviveandbuild" + } + } +} +``` + +**NOTE:** Most settings that are filepaths should be left alone in the config, and will probably be overwritten anyways (like the ModPaths setting). + ## Web Interface Alongside this project, I am developing a seperate web-based dashboard that can be used to manage you servers with a very simple UI. You can get it [here](https://git.bellsworne.tech/chrisbell/vssm_web). @@ -32,9 +94,10 @@ Alongside this project, I am developing a seperate web-based dashboard that can - [ ] Configuration - [x] Custom configuration path (passed to the daemon with a flag `--config`) - [x] Daemon instance remembers config path (*so you don't have to pass `--config` everytime you run an ipc command*) - - [ ] Daemon listen port (kind of implemented, could be cleaner) + - [x] Daemon listen port - [x] Declarative Server configuration (Create servers in config) - [x] All configuration options + - [ ] Endpoint for modifying instance configuration (for web ui) - [ ] Server management - [x] Create servers diff --git a/main.go b/main.go index 67d9c37..b4a8341 100644 --- a/main.go +++ b/main.go @@ -21,7 +21,7 @@ func main() { log.Fatalf("Could not locate user home dir: %v", err) } - defaultConfigPath := filepath.Join(home, ".config", "vssm", "config.json") + defaultConfigPath := filepath.Join(home, ".local", "share", "vssm", "config.json") configFlag := flag.String("config", defaultConfigPath, "Explicit path targeting a custom vssm config.json profile")