Commit 77a65b6f authored by PidgeyL's avatar PidgeyL
Browse files

fix absolute/relative path issue

parent 5a38b4e7
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -104,6 +104,10 @@ class Configuration():
            sys.exit("Unable to connect to Mongo. Is it running on %s:%s?"%(mongoHost,mongoPort))
        return connect[mongoDB]

    @classmethod
    def toPath(cls, path):
        return path if os.path.isabs(path) else os.path.join(runPath, "..", path)

    # Redis
    @classmethod
    def getRedisHost(cls):
@@ -163,11 +167,11 @@ class Configuration():

    @classmethod
    def getSSLCert(cls):
        return os.path.join(runPath, "..", cls.readSetting("Webserver", "Certificate", cls.default['sslCertificate']))
        return cls.toPath(cls.readSetting("Webserver", "Certificate", cls.default['sslCertificate']))

    @classmethod
    def getSSLKey(cls):
        return os.path.join(runPath, "..", cls.readSetting("Webserver", "Key", cls.default['sslKey']))
        return cls.toPath(cls.readSetting("Webserver", "Key", cls.default['sslKey']))

    # CVE
    @classmethod
@@ -235,11 +239,11 @@ class Configuration():
    # Logging
    @classmethod
    def getLogfile(cls):
        return os.path.join(runPath, "..", cls.readSetting("Logging", "Logfile", cls.default['logfile']))
        return cls.toPath(cls.readSetting("Logging", "Logfile", cls.default['logfile']))

    @classmethod
    def getUpdateLogFile(cls):
        return os.path.join(runPath, "..", cls.readSetting("Logging", "Updatelogfile", cls.default['updatelogfile']))
        return cls.toPath(cls.readSetting("Logging", "Updatelogfile", cls.default['updatelogfile']))

    @classmethod
    def getLogging(cls):
@@ -275,12 +279,12 @@ class Configuration():
    # Indexing
    @classmethod
    def getTmpdir(cls):
        return os.path.join(runPath, "..", cls.readSetting("dbmgt", "Tmpdir", cls.default['Tmpdir']))
        return cls.toPath(cls.readSetting("dbmgt", "Tmpdir", cls.default['Tmpdir']))

    # Indexing
    @classmethod
    def getIndexdir(cls):
        return os.path.join(runPath, "..", cls.readSetting("FulltextIndex", "Indexdir", cls.default['Indexdir']))
        return cls.toPath(cls.readSetting("FulltextIndex", "Indexdir", cls.default['Indexdir']))

    # Enabled Feeds
    @classmethod
@@ -339,4 +343,3 @@ class Configuration():
                buf = BytesIO(response.read())
                data = gzip.GzipFile(fileobj=buf)
            return (data, response)