-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathlocal_config.py.example
116 lines (85 loc) · 3.65 KB
/
local_config.py.example
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
104
105
106
107
108
109
110
111
112
113
114
115
116
# 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 = ('st2')
ST2_BASE_URL = 'https://st2.example.com'
ST2_API_KEY = None
ST2_CACERT = None
ST2_DEFAULT_PACK = ''
ST2_WORKFLOW_RUNNER_TYPES = ['action-chain', 'mistral-v2', 'orquesta']
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 = '[email protected],[email protected]'
FROM_EMAIL_ADDR = '[email protected]'
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
ACCOUNT_SUBTREE = [
'账号相关',
[
# ['', '', ''],
['申请服务器账号/重置密码', '申请 ssh 登录服务器的账号,或者重置密码', ''],
['申请创建分布式文件系统用户目录', '跑分布式计算脚本常用的前置条件', ''],
['申请加入用户组', '', ''],
]
]
PACKAGE_SUBTREE = [
'包管理相关',
[
# ['', '', ''],
['查询服务器上包版本', '可查询的信息有 ebuild 版本号、编译/部署时间,VCS 版本', ''],
['在部分机器上用 nobinpkg 测试包', '常用于在部分服务器上测试新版本,观察可用性与稳定性时', ''],
['build binpkg 并全量更新', '常用于使用 nobinpkg 测试完毕,可以上线到生产环境时', ''],
['将已有的 binpkg 装到指定机器', '常用于将当前稳定版本安装到之前并未部署此包的机器上时', ''],
['仅 build binpkg 而不安装', '此功能并不常用,请慎用,仅用于为即将被部署的包打 binpkg 时', ''],
['使用现有的 binpkg 全量更新', '常用于已在 binhost 上生成 binpkg 的大型软件包', ''],
['回滚包到指定 VCS 版本', '常用于将 9999 包回滚到某个 VCS 版本', ''],
]
]
ACTION_TREE_CONFIG = ['功能导航', [ACCOUNT_SUBTREE, PACKAGE_SUBTREE]]