🔒️ Limit folder config in UI to necessities

uploads, timelapse and watched folder should be
configurable in the UI, but limiting anything else
to the config.yaml file is fair considering it
rarely should have to be touched. This reduces
the likelihood of misconfiguration or abuse.
This commit is contained in:
Gina Häußge committed 2022-09-12 18:30:30 +02:00
1 parent 3c8f8c84f4
commit 0db80dc0c9
3 files changed
+8 -31

No files matched your search

+2 -8
View File
@@ -18,8 +18,7 @@ from octoprint.settings import settings, valid_boolean_trues
# ~~ settings
FOLDER_TYPES = ("uploads", "timelapse", "timelapse_tmp", "logs", "watched")
FOLDER_MAPPING = {"timelapseTmp": "timelapse_tmp"}
FOLDER_TYPES = ("uploads", "timelapse", "watched")
TIMELAPSE_BITRATE_PATTERN = re.compile(r"\d+[KMGTPEZY]?i?B?", flags=re.IGNORECASE)
@@ -269,8 +268,6 @@ def getSettings():
"folder": {
"uploads": s.getBaseFolder("uploads"),
"timelapse": s.getBaseFolder("timelapse"),
"timelapseTmp": s.getBaseFolder("timelapse_tmp"),
"logs": s.getBaseFolder("logs"),
"watched": s.getBaseFolder("watched"),
},
"temperature": {
@@ -464,10 +461,7 @@ def _saveSettings(data):
if "folder" in data:
try:
folders = {
FOLDER_MAPPING.get(folder, folder): path
for folder, path in data["folder"].items()
}
folders = data["folder"]
future = {}
for folder in FOLDER_TYPES:
future[folder] = s.getBaseFolder(folder)