-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
5 changed files
with
117 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
logbook/aguia-pescadora-bravo/etc/nginx/sites-available/monit.apb.etica.ai.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# FILE: /etc/nginx/sites-available/monit.apb.etica.ai.conf | ||
|
||
server { | ||
|
||
server_name monit.apb.etica.ai; | ||
|
||
include /home2/_compartilhado/ips-aceitavelmente-confiaveis.conf; | ||
|
||
location / { | ||
proxy_ignore_client_abort on; | ||
proxy_pass http://127.0.0.1:2812; | ||
} | ||
|
||
listen [::]:443 ssl; # managed by Certbot | ||
listen 443 ssl; # managed by Certbot | ||
ssl_certificate /etc/letsencrypt/live/monit.apb.etica.ai/fullchain.pem; # managed by Certbot | ||
ssl_certificate_key /etc/letsencrypt/live/monit.apb.etica.ai/privkey.pem; # managed by Certbot | ||
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot | ||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot | ||
|
||
} | ||
|
||
server { | ||
if ($host = monit.apb.etica.ai) { | ||
return 301 https://$host$request_uri; | ||
} # managed by Certbot | ||
|
||
include /home2/_compartilhado/ips-aceitavelmente-confiaveis.conf; | ||
|
||
listen 80; | ||
listen [::]:80; | ||
|
||
server_name monit.apb.etica.ai; | ||
return 404; # managed by Certbot | ||
|
||
|
||
} |
33 changes: 33 additions & 0 deletions
33
logbook/aguia-pescadora-bravo/home2/_compartilhado/ips-aceitavelmente-confiaveis.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# FILE: /home2/_compartilhado/ips-aceitavelmente-confiaveis.conf | ||
# | ||
# AVISO: NÃO É UMA PRÁTICA IDEAL CONFIGURAR ACESSO POR IPS. | ||
# ESTE AQUIVO AQUI É UMA FORMA PREGUIÇOSA DE SEGURANÇA. | ||
# Note que se um app seu der acesso de localhost para | ||
# uma pessoa estranha, ele pode trollar o servidor inteiro. | ||
# (fititnt, 2019-05-25 09:43 BRT) | ||
# | ||
# Esta lista contém IPs, além de localhost, usados para permitir acesso remoto a paineis | ||
# administrativos sem necessidade de senha. Por exemplo: | ||
# | ||
# https://monit.apb.etica.ai/ | ||
# | ||
# Ou seja, sim, você que tem Acesso SSH ao servidor, mesmo sem ter root | ||
# poderia configurar uma VPN e iniciar/reiniciar sistemas mesmo não sendo | ||
# root. | ||
# | ||
# Administradores: nao é preciso enviar para o Git esse arquivo atualizado com | ||
# seu IP real. Mas se enviar sem querer, não seria o fim do mundo | ||
# | ||
|
||
# Admin: edite /etc/nginx/conf.d/admin-ips.conf, de 'sudo systemctl reload nginx' e acesse | ||
# https://monit.apb.etica.ai/. | ||
allow 123.456.789.101; | ||
allow 123.456.789.102; | ||
allow 123.456.789.103; | ||
|
||
|
||
# Permite acesso de localhost | ||
allow 127.0.0.1; | ||
|
||
# Ignore todo resto | ||
deny all; |
6 changes: 6 additions & 0 deletions
6
logbook/aguia-pescadora-bravo/home2/_compartilhado/monit/conf-enabled/system
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
check system $HOST | ||
if loadavg (1min) > 4 then alert | ||
if loadavg (5min) > 2 then alert | ||
if cpu usage > 95% for 10 cycles then alert | ||
if memory usage > 75% then alert | ||
if swap usage > 25% then alert |