Config Options! - AugustusLongeye/Technic-Script GitHub Wiki
Config Options
Everything in this is configurable, from the location of all the folders to the log level. That's about all, really. Everything is a bit much. You can edit the config.txt file any way you like, the # symbol is a comment and the program will ignore anything written after one. You can add options, but they'll be ignored, and if you remove or don't fill an option it'll break and tell you off.
All config options MUST be entered like so:
option_name_here:option_here
There must be a colon in the middle, and no spaces between the end of the name and the beginning of the data. If not it'll tell you off again.
All options are also checked to not contain any of the following illegal characters, if an option DOES contain any it'll tell you which option and what character. These character can appear after comments:
;*?<>|()\"\'
Paths
There are 4 main paths we're worried about:
- server_dir - This is the directory where the server runs from, home to server.jar
- web_dir - This is where your pack will end up. Usually somewhere like /var/www/html/
- backup_dir - Name literally on the tin.
- master_dir - This is where all your master folders will be held.
Any of these can be set to what you want, but they must follow a few rules. Paths can contain spaces, as each line is parsed as a single argument. All paths must point to a valid location, if the folder (or folders) don't exist they will be created. If the script cannot create a folder it'll tell you.
Names
We can name everything!
- pack_name - Usually the name of your server, but can be anything. This is what we'll name the .zip.
- backup_name - What to call your backups. Can include "{0}" anywhere in it, which will be replaced with the date/time the script was run at.
- master_mods / master_config / master_bin / master_client_mods - Just the names for all those folders. Probably don't need to change these.
Misc!
Settings you might like to change? Really we've only got two we're worried about:
- log_level - How detailed the log should be. Options are silent, quite, normal, verbose, debug.
- log_location - Write the log to the screen, or to a file. Options are screen, file.
So, in general the logger runs in normal mode, which means it'll log in real-time what operation it's doing. With a verbose log it'll log all the output as well. Quiet log will only log a few messages, and silent will log nothing. Debug logging is great for reporting faults, as it generates a log of all the behaviour, the error, and will pump out a big log of the status of the program at the time of error.
With the log location you'll generally be running it to screen, with the log just prompting you where it's at. If you're doing anything with debug it's highly recommended to use file as it does put out about 200 lines of information for my test packs. The log file is not changeable, it'll create a file in the same folder as the logger.py file named "log-" with a long string of numbers that correspond to the date/time the script ran. You can open and view the log file, nothing about your computer is saved, but it's great for me.
Flags
The script can be run with optional flags in one of two ways.
Firstly, and traditionally, you can pass the flags as arguments when you run the program. For example:
python main.py --no-backup --master_dir:/home/
This would run the script without performing the backup step, and with changing the master directory to be /home/.
These changes are non-permanent, and can be changed on each invocation. The flags are listed below, but any config option can be changed in this way.
For a more permanent approach you can append flags to the bottom of the config.txt file. There's a flags section, and you can enter as many as you like, one per line, as you could on the command line.
--no-backup
-master_dir:/home/
This will apply these options every time the program is run. Obviously changing names isn't very useful when you've got options for that, but any implemented flag will work.
List of Flags
- --no-backup - skips the backup step completely.
- --s / --q / --n / --v / --d - these set the log level to be silent, quiet, normal, verbose or debug, respectively.
- --dump - when the program finishes it will create a dump of the program's state. This is done automatically when there's an error, but this'll force it to happen regardless.