-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfig.py.example
80 lines (67 loc) · 2.17 KB
/
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
#
# USE THIS FILE AS REFERENCE TO CONFIGURE THE GOTEO-API
# Create or rename this file to config.py
# Override vars for custom needs
# (check the full config specs in api/config.py)
#
# Mysql Goteo Database (mandatory)
# ================================
dbhost = 'goteo.test'
dbuser = 'goteo'
dbpass = 'goteo1234'
dbname = 'goteo'
DB_URI = 'mysql://' + dbuser + ':' + dbpass + '@' + dbhost + '/' + dbname
# A unique secret key for this application
SECRET_KEY = 'a-super-secret-and-random-key'
GOTEO_URL='https://goteo.org'
# For CDN configuration, mostly routes prefixed by /img/
GOTEO_DATA_URL='https://goteo.org'
# routes prefixed by /assets/
GOTEO_ASSET_URL='https://goteo.org'
# Optional config:
# ================
# Number of seconds to auto-expire access tokens
ACCESS_TOKEN_DURATION = 600
# api requests rate limit
# Users are allowed 300 requests in 15 minutes
REQUESTS_LIMIT = 300
REQUESTS_TIME = 60 * 15
# redis (mandatory if requests_limit activated)
REDIS_URL = "redis://localhost:6379/0"
# Use Http Authentication for public scopes
AUTH_ENABLED = True
# Extend the API functionality by enabling additional modules/plugins
MODULES = {
# reports endpoints
#'goteoapi_reports.controllers',
# digests endpoints
#'goteoapi_digests.controllers'
}
# debug (False by default)
DEBUG = True
# Use cache type (null by default)
# View http://pythonhosted.org/Flask-Cache/#configuring-flask-cache
# for types and configuration options
CACHE_TYPE = 'null'
# Minimun timeout for function caching
CACHE_MIN_TIMEOUT = 30
# Opcional description for general messages
DESCRIPTION = 'Goteo.org API'
# Usefull links for general messages
LINKS = {
'Developers Documentation': 'http://developers.goteo.org',
'Swagger Interface': '/spec',
'Swagger Documentation': '/apidocs/index.html'
}
# Built-in Users Authentication
# Users can be bind to a ip or a ip range using a mask (eg: ip/mask)
# cors referes to the "Access-Control-Allow-Origin" header directive
USERS = {
# username (optional)
'goteo': {
'password':'goteo',
# Optional fields:
# 'remotes': ['127.0.0.0/16', '192.168.0.0/24'],
# 'cors': ['http://stats.goteo.org', 'https://stats.goteo.org']
}
}