-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathenv.py
57 lines (54 loc) · 1.54 KB
/
env.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
import logging.config
# client id and password for oauth2 resource password
clientId = "xmpp"
clientPass = "xmpp-client"
# tokenUrl =
# "https://ttsoon.com/org/oauth2/token/" for Resource
# or "https://ttsoon.com/org/api/users/me/" for Bearer
tokenUrl = {
'resource': "https://ttsoon.com/org/oauth2/token/",
'bearer': "https://ttsoon.com/org/api/users/me/"
}
userUrl = "https://ttsoon.com/org/api/users/{0}/exists/"
# False or cabundle file
verify = '/etc/ssl/certs/ca-certificates.crt'
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
},
'simple': {
'format': '%(levelname)s %(asctime)s %(message)s'
},
},
'handlers': {
'console':{
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'simple'
},
'logfile': {
'level':'DEBUG',
'class':'logging.handlers.RotatingFileHandler',
'filename': "prosody-external-oauth.log",
'maxBytes': 50000,
'backupCount': 2,
'formatter': 'simple',
},
},
'loggers': {
'requests': {
'handlers': ['logfile'],
'level': 'DEBUG',
'propagate': True,
},
'oauth2': {
'handlers': ['logfile'],
'level': 'DEBUG',
'propagate': True,
},
}
}
logging.config.dictConfig(LOGGING)