Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.12 KB | None | 0 0
  1. # cat /usr/share/nginx/html/alerta/config.json
  2. {"endpoint": "/api"}
  3.  
  4. # cat /etc/nginx/sites-available/alerta.conf
  5. server {
  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
  49. export ALERTA_API_KEY=mysecretkey
  50. export ALERTA_ENDPOINT=http://alerta.my.domain/api
  51. export LC_ALL=C.UTF-8
  52. export LANG=C.UTF-8
  53. export ALERTA_CONF_FILE=~/.alerta.conf
  54. export ALERTA_DEFAULT_PROFILE=production
  55.  
  56. # cat .alerta.conf
  57. [DEFAULT]
  58. timezone = Europe/Stockholm
  59. output = json
  60.  
  61. [profile production]
  62. endpoint = http://alerta.my.domain/api
  63. key = mysecretkey
  64. sslverify = off
  65. timeout = 10.0
  66.  
  67. # cat /etc/alertad.conf | grep -v "^#"
  68.  
  69. DEBUG = True
  70. BASE_URL = '/api'
  71.  
  72. LOGGER_NAME = 'alerta'
  73. LOG_FILE = '/var/log/alertad.log'
  74. LOG_HANDLERS = ['console','file']
  75. LOG_FORMAT = 'verbose'
  76.  
  77. MONGO_URI = 'mongodb://127.0.0.1:27017/monitoring'
  78. MONGO_DATABASE = 'monitoring'
  79.  
  80. CORS_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.  
  89. AUTH_REQUIRED = True
  90.  
  91. SECRET_KEY = 'mysecretkeyhere'
  92. ADMIN_USERS = ['somethingmagic@gmail.com']
  93.  
  94. CUSTOMER_VIEWS = True
  95. SIGNUP_ENABLED = False
  96.  
  97. TOKEN_EXPIRE_DAYS = 7
  98.  
  99. QUERY_LIMIT = 10000
  100. HISTORY_LIMIT = 100
  101. API_KEY_EXPIRE_DAYS = 365
  102. AUTO_REFRESH_ALLOW = 'ON'
  103. SENDER_API_ALLOW = 'ON'
  104.  
  105. EMAIL_VERIFICATION = False
  106. SMTP_HOST = 'localhost'
  107. SMTP_PORT = 25
  108. MAIL_FROM = 'alerta@my.domain'
  109. SMTP_PASSWORD = ''
  110.  
  111. BLACKOUT_DURATION = 86400
  112.  
  113. SEVERITY_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. }
  129. DEFAULT_SEVERITY = 'indeterminate'
  130.  
  131. PLUGINS = ['reject', 'blackout']
  132. PLUGINS_RAISE_ON_ERROR = False  # keep processing other plugins if exception
  133.  
  134. ALLOWED_ENVIRONMENTS=['Production', 'Development', 'Testing', 'Code']
  135.  
  136. USE_PROXYFIX = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement