Skip to content

Commit 656e097

Browse files
committed
Changed settings handling
1 parent 2e18e45 commit 656e097

File tree

6 files changed

+24
-8
lines changed

6 files changed

+24
-8
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## 0.2.0 - 19.04.2020
3+
## 0.2.1 - 19.04.2020
44

55
### Added
66

@@ -13,6 +13,7 @@
1313
#### Features
1414

1515
- Create has now a parameter `--start` that allows to start the server directly after creation.
16+
- Settings can be changed in the File `/etc/mcctl.conf`.
1617

1718
#### Under the hood
1819

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ The easiest way to install mcctl is via pip:
1818
sudo pip install mcctl
1919
```
2020

21+
In some cases, the `secure_path` of `sudo` must be changed. If `sudo mcctl` returns "Command not found", add `/usr/local/bin` to your `secure_path`.
22+
2123
## Getting started
2224

2325
As soon as mcctl is installed, you can create a new server:
@@ -51,6 +53,10 @@ Name Server Version Status Persistent
5153
myserver 1.15.2 Active True
5254
```
5355

56+
## Configuration
57+
58+
In case you need to change the Unit Name or the Server User, it can be changed in `/etc/mcctl.conf`. The Config is generated at runtime, so mcctl needs to be started at least once.
59+
5460
## Documentation
5561

5662
mcctl is not well documented (yet). However, you should be able to answer a lot of your questions with the help in the package:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
setup(
1111
name="mcctl",
1212
packages=find_packages(where="src", exclude=["tests"]),
13-
version="0.2.0",
13+
version="0.2.1",
1414
description="Manage, configure, create multiple Minecraft servers in a docker-like fashion.",
1515
long_description=README,
1616
long_description_content_type="text/markdown",

src/mcctl/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818

1919
from mcctl import config, proc, service, status, storage, web, common, settings
2020

21-
__version__ = "0.2.0"
21+
__version__ = "0.2.1"

src/mcctl/settings.ini

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/mcctl/settings.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,20 @@
2020
from pathlib import Path
2121

2222
PARSER = ConfigParser()
23-
PARSER.read(Path(__file__).parent / 'settings.ini')
23+
24+
CFGPATH = Path("/etc/mcctl.conf")
25+
26+
PARSER['settings'] = {
27+
'systemd_service': 'mcserver@', 'server_user': 'mcserver'}
28+
29+
# Overwrite default Values
30+
PARSER.read(CFGPATH)
31+
try:
32+
with open(CFGPATH, 'w') as configfile:
33+
PARSER.write(configfile)
34+
except PermissionError:
35+
pass
2436

2537
CFG_DICT = dict(PARSER.items('settings'))
2638

27-
del PARSER
39+
del PARSER, CFGPATH

0 commit comments

Comments
 (0)