Documentation
Readme
View as plain text
# Enshrouded Server Configuration Tool
## Introduction
Tired of manually editing that pesky `enshrouded_server.json` file? Wish there was an easier way to manage your Enshrouded server settings, create backups, and even handle user groups? Then you've come to the right place! This handy Python script provides a clean, menu-driven interface to make server administration a breeze. No more JSON headaches!
## Explanation
This tool directly interacts with your `enshrouded_server.json` file. It reads the settings, presents them in an organized way, and allows you to modify them through a series of menus and prompts. It automatically creates backups *before* making any changes, so you can easily revert if something goes wrong. It even includes a user group management system, complete with password protection (using secure hashing, of course!).
## Requirements
* **Python 3.7+:** Make sure you have a relatively recent version of Python installed. You can check your version by running `python --version` or `python3 --version` in your terminal.
* **Requests Library:** This is used for fetching updated default settings. Install it with: `pip install requests` (or `pip3 install requests`, depending on your system).
* **getpass Library** This standard library comes with python.
* **hashlib Library** This standard library comes with python.
* **Direct Access to Server Files:** The script *must* be placed in the same directory as your `enshrouded_server.json` file.
## Features
* **Easy-to-Use Menu:** Navigate through options with simple number selections. No more digging through JSON!
* **Automatic Backups:** Timestamped backups are created *automatically* before *any* changes are saved. These are stored in an `old/` subdirectory.
* **Revert to Default Settings:** Quickly reset your configuration to the default values.
* **Revert to Most Recent Backup:** Restore your server configuration from the latest backup file.
* **Update Default Settings:** Download the latest default configuration from a specified GitHub repository (you can customize the URL).
* **Setting Descriptions:** Each setting is presented with a clear description of its purpose.
* **Input Validation:** The script checks for invalid input (like non-numeric values where numbers are expected, or out-of-range port numbers) to prevent errors.
* **Setting Randomization:** Randomize settings within specific categories (World, Enemy, Resource) for a fresh gameplay experience.
* **View Configuration:** See your current server settings displayed in a human-readable format (not just raw JSON!).
* **User Group Management:**
* Create, modify, and delete user groups.
* Assign permissions to groups (e.g., kick, ban, change settings). A predefined list of permissions is provided for easy selection.
* Set passwords for groups (passwords are securely hashed using SHA-256).
* **Merge Settings:** This tool will merge any manual changes made in a json file with any exisitng configurations.
## General Usage
1. **Download:** Download the Python script (enshrouded_config.py).
2. **Placement:** Place the script in the *same directory* as your `enshrouded_server.json` file.
3. **Run:**
* Open a terminal or command prompt.
* Navigate to the directory: `cd <your_server_directory>`
* Execute the script: `python enshrouded_server_config.py` (or `python3 enshrouded_server_config.py`)
4. **Navigate:** Use the number keys to select menu options.
5. **Edit Settings:** Follow the on-screen prompts. Press `Enter` without entering a value to keep the current setting.
6. **Manage Groups:** Select the "Manage User Groups" option from the main menu to add, delete, modify, or list groups, permissions, and passwords.
## Known Issues
* **No Extensive Permission Validation:** While the script provides a list of *suggested* permissions for user groups, it doesn't currently *enforce* these on the server-side. This means you could add a permission that the Enshrouded server doesn't actually recognize. *Always double-check the official Enshrouded server documentation for a definitive list of supported permissions.* This is an area for future improvement.
* **Limited support for custom settings:** The script has improved drastically to include merging of existing settings, it may still not see your custom settings if they do not adhere to the default settings structure.
## Credits
* **Original Concept and Code:** [LordBlackDude]
* **Inspired by:** The need for a simpler way to manage Enshrouded server configurations!
* **Uses:** Python's built-in `json`, `os`, `shutil`, `datetime`, `time`, `hashlib`, and `getpass` modules, and the `requests` library.
## Changelog
* **v1.0:** Initial Release. Basic menu, loading/saving, setting editing.
* **v1.1:** Added Automatic Backups.
* **v1.2:** Improved Error Handling (file not found, invalid JSON).
* **v1.3:** Enhanced Input Validation (port numbers, boolean values).
* **v1.4:** Added Display of Current Settings.
* **v1.5:** Added Revert to Default Functionality.
* **v1.6:** Added Remote Default Settings Update.
* **v1.7:** Added Setting Randomization.
* **v1.8:** Refinement, Bug Fixes, and more setting descriptions.
* **v1.9:** Code Cleanup and Boolean Handling.
* **v2.0:** Major Feature: User Group Management and Backup Restoration.
* **v2.1:** Improved JSON Viewing and User Experience.
* **v2.2:** Enhanced User Group Management(numeric choices for permissions, secure password handling).
* **v2.3:** Bug Fixes and Improvements.