forked from FreeTAKTeam/UI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
executable file
·84 lines (59 loc) · 2.11 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
import os
from os import environ
class Config(object):
basedir = os.path.abspath(os.path.dirname(__file__))
SECRET_KEY = 'key'
# This will connect to the FTS db
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + '/root/FTSDataBase.db'
# certificates path
certpath = "/usr/local/lib/python3.8/dist-packages/FreeTAKServer/certs/"
# crt file path
crtfilepath = f"{certpath}pubserver.pem"
# key file path
keyfilepath = f"{certpath}pubserver.key.unencrypted"
# this IP will be used to connect with the FTS API
IP = '127.0.0.1'
# Port the UI uses to communicate with the API
PORT = '19023'
# the public IP your server is exposing
APPIP = '127.0.0.1'
# this port will be used to listen
APPPort = 5000
# the webSocket key used by the UI to communicate with FTS.
WEBSOCKETKEY = 'YourWebsocketKey'
# the API key used by the UI to comunicate with FTS. generate a new system user and then set it
APIKEY = 'Bearer token'
# For 'in memory' database, please use:
# SQLALCHEMY_DATABASE_URI = 'sqlite:///:memory:'
SQLALCHEMY_TRACK_MODIFICATIONS = False
# THEME SUPPORT
# if set then url_for('static', filename='', theme='')
# will add the theme name to the static URL:
# /static/<DEFAULT_THEME>/filename
# DEFAULT_THEME = "themes/dark"
DEFAULT_THEME = None
class ProductionConfig(Config):
DEBUG = False
# Security
SESSION_COOKIE_HTTPONLY = True
REMEMBER_COOKIE_HTTPONLY = True
REMEMBER_COOKIE_DURATION = 3600
# PostgreSQL database
SQLALCHEMY_DATABASE_URI = 'postgresql://{}:{}@{}:{}/{}'.format(
environ.get('APPSEED_DATABASE_USER', 'appseed'),
environ.get('APPSEED_DATABASE_PASSWORD', 'appseed'),
environ.get('APPSEED_DATABASE_HOST', 'db'),
environ.get('APPSEED_DATABASE_PORT', 5432),
environ.get('APPSEED_DATABASE_NAME', 'appseed')
)
class DebugConfig(Config):
DEBUG = True
config_dict = {
'Production': ProductionConfig,
'Debug': DebugConfig
}