Working devops

This commit is contained in:
2021-12-18 17:58:48 -05:00
parent 3e7e0e7ae8
commit a9171c5f21
18 changed files with 394 additions and 2 deletions

12
devops/templates/bindctl Normal file
View File

@ -0,0 +1,12 @@
#
# Allow peach-dyndns to reload bind as sudo
#
# User alias for bind-ctl which can reload bind
User_Alias BIND_CTRL = peach-dyndns
# Command alias for reboot and shutdown
Cmnd_Alias RELOADBIND = /usr/bin/reloadbind
# Allow BIND_CTRL users to execute RELOADBIND command without password
BIND_CTRL ALL=(ALL) NOPASSWD: RELOADBIND

View File

@ -0,0 +1,14 @@
server {
listen 80;
listen [::]:80;
server_name {{dynserver_domain}};
location / {
proxy_pass http://127.0.0.1:{{dynserver_port}};
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
}

View File

@ -0,0 +1,10 @@
description "uWSGI server instance configured to serve hello_webapp"
start on runlevel [2345]
stop on runlevel [!2345]
setuid wsgi-user
setgid webgroup
chdir {{src_dir}}
exec uwsgi --ini hello_webapp.ini

View File

@ -0,0 +1,11 @@
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";

View File

@ -0,0 +1,86 @@
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}

View File

@ -0,0 +1,10 @@
server {
listen 80;
server_name ec2-52-90-110-188.compute-1.amazonaws.com;
location / {
include uwsgi_params;
uwsgi_pass unix:{{src_dir}}/{{app_name}}.sock;
}
}

View File

@ -0,0 +1,15 @@
[Unit]
Description=An http API to create dynamic-dns configurations for bind9.
[Service]
Type=simple
User=peach-dyndns
Group=bind
Environment="RUST_LOG=info"
Environment="PEACH_DYNDNS_SERVER=127.0.0.1:{{dynserver_port}}"
WorkingDirectory=/srv/peach-dynddns-server
ExecStart=/usr/bin/peach-dyndns-server
Restart=always
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
/bin/systemctl reload bind9