· 6 years ago · Jul 17, 2019, 11:54 AM
1# cat /usr/share/nginx/html/alerta/config.json
2{"endpoint": "/api"}
3
4# cat /etc/nginx/sites-available/alerta.conf
5server {
6
7 listen 127.0.0.1:80;
8 listen 443 ssl;
9
10 # SSL settings
11 include snippets/certbot.conf;
12
13 ssl_certificate /etc/ssl/certs/nginx-ss.crt;
14 ssl_certificate_key /etc/ssl/private/nginx-ss.key;
15
16 client_max_body_size 25m;
17 client_body_timeout 30;
18
19 add_header Content-Security-Policy upgrade-insecure-requests;
20
21 index index.html index.htm index.php index.cgi index.pl index.xhtml index.view;
22 default_type application/octet-stream;
23
24 server_name alerta.my.domain;
25 root /usr/share/nginx/html/alerta;
26
27 # Deny .htaccess files
28 location ~ /\.ht {
29 deny all;
30 }
31
32 location /api { try_files $uri @api; }
33
34 location @api {
35 include uwsgi_params;
36 uwsgi_pass unix:/tmp/uwsgi.sock;
37 proxy_set_header Host $host:$server_port;
38 proxy_set_header X-Real-IP $remote_addr;
39 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
40 }
41
42 location / {
43 root /usr/share/nginx/html/alerta;
44 }
45
46}
47
48# cat .bashrc | grep export
49export ALERTA_API_KEY=mysecretkey
50export ALERTA_ENDPOINT=http://alerta.my.domain/api
51export LC_ALL=C.UTF-8
52export LANG=C.UTF-8
53export ALERTA_CONF_FILE=~/.alerta.conf
54export ALERTA_DEFAULT_PROFILE=production
55
56# cat .alerta.conf
57[DEFAULT]
58timezone = Europe/Stockholm
59output = json
60
61[profile production]
62endpoint = http://alerta.my.domain/api
63key = mysecretkey
64sslverify = off
65timeout = 10.0
66
67# cat /etc/alertad.conf | grep -v "^#"
68
69DEBUG = True
70BASE_URL = '/api'
71
72LOGGER_NAME = 'alerta'
73LOG_FILE = '/var/log/alertad.log'
74LOG_HANDLERS = ['console','file']
75LOG_FORMAT = 'verbose'
76
77MONGO_URI = 'mongodb://127.0.0.1:27017/monitoring'
78MONGO_DATABASE = 'monitoring'
79
80CORS_ORIGINS = [
81 'http://127.0.0.1',
82 'http://localhost',
83 'http://alerta.my.domain',
84 'https://127.0.0.1',
85 'https://localhost',
86 'httpp://alerta.my.domain'
87]
88
89AUTH_REQUIRED = True
90
91SECRET_KEY = 'mysecretkeyhere'
92ADMIN_USERS = ['somethingmagic@gmail.com']
93
94CUSTOMER_VIEWS = True
95SIGNUP_ENABLED = False
96
97TOKEN_EXPIRE_DAYS = 7
98
99QUERY_LIMIT = 10000
100HISTORY_LIMIT = 100
101API_KEY_EXPIRE_DAYS = 365
102AUTO_REFRESH_ALLOW = 'ON'
103SENDER_API_ALLOW = 'ON'
104
105EMAIL_VERIFICATION = False
106SMTP_HOST = 'localhost'
107SMTP_PORT = 25
108MAIL_FROM = 'alerta@my.domain'
109SMTP_PASSWORD = ''
110
111BLACKOUT_DURATION = 86400
112
113SEVERITY_MAP = {
114 'security': 0,
115 'fatal': 0,
116 'critical': 1,
117 'major': 2,
118 'minor': 3,
119 'warning': 4,
120 'indeterminate': 5,
121 'cleared': 5,
122 'normal': 5,
123 'ok': 5,
124 'informational': 6,
125 'debug': 7,
126 'trace': 8,
127 'unknown': 9
128}
129DEFAULT_SEVERITY = 'indeterminate'
130
131PLUGINS = ['reject', 'blackout']
132PLUGINS_RAISE_ON_ERROR = False # keep processing other plugins if exception
133
134ALLOWED_ENVIRONMENTS=['Production', 'Development', 'Testing', 'Code']
135
136USE_PROXYFIX = True