Merge branch 'master' into devel

Conflicts:
	src/octoprint/settings.py
This commit is contained in:
Gina Häußge 2014-10-01 14:36:02 +02:00
commit 7336ed6eff
2 changed files with 13 additions and 3 deletions

View file

@ -39,9 +39,15 @@
## 1.1.1 (Unreleased)
### Improvements
* The API is now enabled by default and the API key -- if not yet set -- will be automatically generated on first
server start and written back into ``config.yaml``
### Bug Fixes
* [#580](https://github.com/foosel/OctoPrint/issues/580) - Properly unset job data when instructed so by callers
* [IRC] Also allow downloading .g files via Tornado
## 1.1.0 (2014-09-03)
@ -115,4 +121,4 @@
## 1.0.0 (2014-06-22)
First release with new versioning scheme.
First release with new versioning scheme.

View file

@ -145,8 +145,8 @@ default_settings = {
"subscriptions": []
},
"api": {
"enabled": False,
"key": ''.join('%02X' % ord(z) for z in uuid.uuid4().bytes),
"enabled": True,
"key": None,
"allowCrossOrigin": False
},
"terminalFilters": [
@ -190,6 +190,10 @@ class Settings(object):
self._configfile = os.path.join(self.settings_dir, "config.yaml")
self.load(migrate=True)
if self.get(["api", "key"]) is None:
self.set(["api", "key"], ''.join('%02X' % ord(z) for z in uuid.uuid4().bytes))
self.save(force=True)
def _init_settings_dir(self, basedir):
if basedir is not None:
self.settings_dir = basedir