115 lines
2.9 KiB
Python
115 lines
2.9 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
NGINX = '''server {{
|
|
listen [::]:{port} ssl http2;
|
|
server_name {host}.{domain};
|
|
|
|
access_log /var/log/nginx/{app}.access.log;
|
|
error_log /var/log/nginx/{app}.error.log;
|
|
|
|
location / {{
|
|
proxy_pass http://{app}:8080;
|
|
}}
|
|
|
|
error_page 502 /502.html;
|
|
location = /502.html {{
|
|
root /usr/share/vmmgr/templates;
|
|
}}
|
|
|
|
location = /vm-ping {{
|
|
add_header Content-Type text/plain;
|
|
return 200 "vm-pong";
|
|
}}
|
|
}}
|
|
'''
|
|
|
|
NGINX_DEFAULT = '''server {{
|
|
listen [::]:80 default_server ipv6only=off;
|
|
|
|
location / {{
|
|
return 301 https://$host:{port}$request_uri;
|
|
}}
|
|
|
|
location /.well-known/acme-challenge/ {{
|
|
root /etc/acme.sh.d;
|
|
}}
|
|
|
|
location = /vm-ping {{
|
|
add_header Content-Type text/plain;
|
|
return 200 "vm-pong";
|
|
}}
|
|
}}
|
|
|
|
server {{
|
|
listen [::]:{port} ssl http2 default_server ipv6only=off;
|
|
|
|
location / {{
|
|
proxy_pass http://127.0.0.1:8080;
|
|
}}
|
|
|
|
location /static {{
|
|
root /usr/share/vmmgr;
|
|
}}
|
|
|
|
error_page 502 /502.html;
|
|
location = /502.html {{
|
|
root /usr/share/vmmgr/templates;
|
|
}}
|
|
|
|
location = /vm-ping {{
|
|
add_header Content-Type text/plain;
|
|
return 200 "vm-pong";
|
|
}}
|
|
}}
|
|
|
|
server {{
|
|
listen [::]:{port} ssl http2;
|
|
server_name ~^(.*)\\.{domain_esc}$;
|
|
|
|
location / {{
|
|
return 503;
|
|
}}
|
|
|
|
location /static {{
|
|
root /usr/share/vmmgr;
|
|
}}
|
|
|
|
error_page 503 /503.html;
|
|
location = /503.html {{
|
|
root /usr/share/vmmgr/templates;
|
|
}}
|
|
|
|
location = /vm-ping {{
|
|
add_header Content-Type text/plain;
|
|
return 200 "vm-pong";
|
|
}}
|
|
}}
|
|
'''
|
|
|
|
ISSUE = '''
|
|
\x1b[1;32m _____ _ _ __ ____ __
|
|
/ ____| | | | | \\ \\ / / \\/ |
|
|
| (___ _ __ ___ | |_| |_ ___ _ _\\ \\ / /| \\ / |
|
|
\\___ \\| '_ \\ / _ \\| __| __/ _ \\ '__\\ \\/ / | |\\/| |
|
|
____) | |_) | (_) | |_| || __/ | \\ / | | | |
|
|
|_____/| .__/ \\___/ \\__|\\__\\___|_| \\/ |_| |_|
|
|
| |
|
|
|_|\x1b[0m
|
|
|
|
\x1b[1;33mUPOZORNĚNÍ:\x1b[0m Neoprávněný přístup k tomuto zařízení je zakázán.
|
|
Musíte mít výslovné oprávnění k přístupu nebo konfiguraci tohoto zařízení.
|
|
Neoprávněné pokusy a kroky k přístupu nebo používání tohoto systému mohou mít
|
|
za následek občanské nebo trestní sankce.
|
|
|
|
\x1b[1;33mCAUTION:\x1b[0m Unauthozired access to this device is prohibited.
|
|
You must have explicit, authorized permission to access or configure this
|
|
device. Unauthorized attempts and actions to access or use this system may
|
|
result in civil or criminal penalties.
|
|
|
|
Pro přístup k aplikacím otevřete jednu z těcho URL v internetovém prohlížeči.
|
|
Open one the following URLs in web browser to access the applications.
|
|
|
|
- \x1b[1m{url}\x1b[0m
|
|
- \x1b[1m{ip}\x1b[0m\x1b[?1c
|
|
'''
|