-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathlocal_config.py.example
More file actions
103 lines (77 loc) · 2.9 KB
/
local_config.py.example
File metadata and controls
103 lines (77 loc) · 2.9 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# coding: utf-8
# vi: ft=python
DEBUG = DEVELOP_MODE = True
SENTRY_DSN = ''
SESSION_SECRET_KEY = 'NVzLYJSMyw'
SESSION_TTL = 24 * 3600
TRUSTED_HOSTS = ['127.0.0.1', '10.0.0.1', 'localhost']
ALLOW_ORIGINS = ['https://example.org', 'https://www.example.org'] # use ['*'] to allow any origin.
ALLOW_ORIGINS_REG = r"https://.*\.example\.org" # See https://www.starlette.io/middleware/#corsmiddleware for ref
SYSTEM_USER = 'admin'
SYSTEM_USER_PASSWORD = 'admin'
ADMIN_ROLES = ['admin', 'system_admin']
PARAM_FILLUP = {
# 'reason': 'hehe',
'ldap_id': lambda user: user.name,
}
# DATABASE_URL = 'sqlite:///tmp/helpdesk.db'
# postgres://user:pass@localhost/dbname
# mysql://user:pass@localhost/dbname
ENABLED_PROVIDERS = ('airflow',)
AIRFLOW_SERVER_URL = 'https://airflow.internal'
AIRFLOW_USERNAME = "helpdesk"
AIRFLOW_PASSWORD = "changeme"
AIRFLOW_DEFAULT_DAG_TAG = 'helpdesk'
AIRFLOW_JWT_EXPIRATION_SECONDS = 86400 # ref config AIRFLOW__API_AUTH__JWT_EXPIRATION_TIME
OPENID_PRIVIDERS = {
'keycloak': {
'server_metadata_url': 'https://keycloak.example.com/realms/apps/.well-known/openid-configuration',
'client_id': 'helpdesk',
'client_secret': 'CLIENT_SECRET',
'scope': 'openid email profile',
},
'google': {
'server_metadata_url': 'https://accounts.google.com/.well-known/openid-configuration',
'client_id': 'CLIENT_ID',
'client_secret': 'CLIENT_SECRET',
'scope': 'openid email profile',
'client_kwargs': {
'proxies': {'all': 'http://localhost:3128'},
},
}
}
AUTHORIZED_EMAIL_DOMAINS = ['@example.com']
def oauth_username_func(id_token):
return id_token.get('preferred_username') or id_token['email'].split('@')[0]
# base url will be used by notifications to show web links
DEFAULT_BASE_URL = 'https://example.com'
ADMIN_EMAIL_ADDRS = 'admin@example.com,ops@example.com'
FROM_EMAIL_ADDR = 'helpdesk@example.com'
NOTIFICATION_TITLE_PREFIX = '[helpdesk] '
NOTIFICATION_METHODS = [
'helpdesk.libs.notification:MailNotification',
'helpdesk.libs.notification:WebhookNotification',
]
AUTO_APPROVAL_TARGET_OBJECTS = []
TICKETS_PER_PAGE = 50
def avatar_url_func(email):
import hashlib
GRAVATAR_URL = '//www.gravatar.com/avatar/%s'
return GRAVATAR_URL % hashlib.md5(email.encode('utf-8').lower()).hexdigest()
# Action Tree Config
# action name, description/tips, st2 pack/action
example1_subtree = [
'subtree example1 name',
[
['Ticket Pack name', 'Ticket Group description', 'provider_name', 'pack.'],
['Ticket name', 'Ticket description', 'provider_name', 'action_ref'],
]
]
example2_subtree = [
'subtree example2 name',
[
['Ticket Pack name', 'Ticket Group description', 'provider_name', 'pack.'],
['Ticket name', 'Ticket description', 'provider_name', 'action_ref'],
]
]
ACTION_TREE_CONFIG = ['Title of tickets tree', [example1_subtree, example2_subtree]]