From 50c5044fe8fa6f7ab624a72e8dba78453241b127 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 1 Dec 2013 19:23:53 +0100 Subject: [PATCH 1/2] Add path separator for check --- couchpotato/core/plugins/renamer/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/couchpotato/core/plugins/renamer/main.py b/couchpotato/core/plugins/renamer/main.py index a03e1af..3734845 100755 --- a/couchpotato/core/plugins/renamer/main.py +++ b/couchpotato/core/plugins/renamer/main.py @@ -114,7 +114,7 @@ class Renamer(Plugin): return else: for item in no_process: - if from_folder in item: + if '%s%s' % (from_folder, os.path.sep) in item: log.error('To protect your data, the movie libraries can\'t be inside of or the same as the "from" folder.') return @@ -146,7 +146,7 @@ class Renamer(Plugin): if movie_folder: for item in no_process: - if movie_folder in item: + if '%s%s' % (movie_folder, os.path.sep) in item: log.error('To protect your data, the movie libraries can\'t be inside of or the same as the provided movie folder.') return From 966f8c36b18891214220c1a5da0cf5b6349092de Mon Sep 17 00:00:00 2001 From: Ruud Date: Mon, 2 Dec 2013 12:09:14 +0100 Subject: [PATCH 2/2] Make sure to use a valid cookie_secret. fix #2553 --- couchpotato/environment.py | 1 + couchpotato/runner.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/couchpotato/environment.py b/couchpotato/environment.py index 0f04d83..b393ef9 100644 --- a/couchpotato/environment.py +++ b/couchpotato/environment.py @@ -78,6 +78,7 @@ class Env(object): return s.get(attr, default = default, section = section, type = type) # Set setting + s.addSection(section) s.set(section, attr, value) s.save() diff --git a/couchpotato/runner.py b/couchpotato/runner.py index 571023e..452f005 100644 --- a/couchpotato/runner.py +++ b/couchpotato/runner.py @@ -8,6 +8,7 @@ from couchpotato.core.helpers.variable import getDataDir, tryInt from logging import handlers from tornado.httpserver import HTTPServer from tornado.web import Application, StaticFileHandler, RedirectHandler +from uuid import uuid4 import locale import logging import os.path @@ -144,7 +145,7 @@ def runCouchPotato(options, base_path, args, data_dir = None, log_dir = None, En Env.set('dev', development) # Disable logging for some modules - for logger_name in ['enzyme', 'guessit', 'subliminal', 'apscheduler']: + for logger_name in ['enzyme', 'guessit', 'subliminal', 'apscheduler', 'tornado']: logging.getLogger(logger_name).setLevel(logging.ERROR) for logger_name in ['gntp', 'migrate']: @@ -215,6 +216,10 @@ def runCouchPotato(options, base_path, args, data_dir = None, log_dir = None, En Env.set('web_base', web_base) api_key = Env.setting('api_key') + if not api_key: + api_key = uuid4().hex + Env.setting('api_key', value = api_key) + api_base = r'%sapi/%s/' % (web_base, api_key) Env.set('api_base', api_base)