Delete `statup` cookbook.
This commit is contained in:
parent
9ec48c8d76
commit
70fcbe3086
|
@ -1,10 +0,0 @@
|
|||
# -------------------------------------------
|
||||
# Specifying the default settings:
|
||||
# -------------------------------------------
|
||||
node.reverse_merge!({
|
||||
'statup' => {
|
||||
'FQDN' => 'status.kazu634.com',
|
||||
'db' => '/home/webadm/statup/statup.db',
|
||||
'config' => '/home/webadm/statup/config.yml'
|
||||
}
|
||||
})
|
|
@ -1,11 +0,0 @@
|
|||
# Retrieve the default values:
|
||||
include_recipe './attributes.rb'
|
||||
|
||||
# Install statup
|
||||
include_recipe './install.rb'
|
||||
|
||||
# Setup statup
|
||||
include_recipe './setup.rb'
|
||||
|
||||
# Setup statup
|
||||
include_recipe './ssl.rb'
|
|
@ -1 +0,0 @@
|
|||
12 3 * * * root openssl rand 48 > /etc/letsencrypt/live/status.kazu634.com/ticket.key
|
|
@ -1,13 +0,0 @@
|
|||
-----BEGIN DH PARAMETERS-----
|
||||
MIICCAKCAgEA+gznnDB0OxkNsoQeMfWwyNvosTqhjM0uDVb4uyQJ9q6HHDtE2kic
|
||||
OA84Z1AIrMut9IKQz0MOZ7aBiTQW6rV/XozTcfhEQbej61oqM+lHvd1iQfq9EJox
|
||||
mDvSI4aqVsmICFBnEBp82NNJVAHnDzZj4FOOwhKMYk8d4tJpd+wBMcChOK3dGLTR
|
||||
FDhN4cmcCptYfdPdLDr4+GWYI1BTn7JC5pTqhQRjOM3vLcLgYUJDDwW+xrAa+DIi
|
||||
S06+1eBWnj9HrpxJLuauMzBuQ5B+1Y16tViavo35zBpakwMj0fKyMgx1L+mHW/0b
|
||||
1wuIUIFudjsUY/NANDnTMT6qYhDtiQTDZ+pjJ9pVyrGd+15cNBhzkumzUwSWiiBM
|
||||
VEkOSypSJl3JIVOvdo7oxP1RjJmSiaQjHg90ZC8xcqlQdlBm1m9RW8FAiNzchOrf
|
||||
wEwM6XmTI31tzT2CF7xkz+KdLUjy/9It+DrA5JSxo0/5Izx9C4vttNckcecVjq1A
|
||||
X5g9Beu74L+EJpP3qZym9+uZmQLKMlRXYLP+PDUK3eehUHrHOVSAx89UQ9LnEavB
|
||||
m0MMUNLNTRt6iK0bBwNgUNTaENYRD9eEGs8w/6zmkCqgpKDCVBtdIo3P5mGYJ6eu
|
||||
UbMmc4UaTUmNScPdiMOorxzDm6m6/lhD4Aeha8ofvy16BlsXG1YdNUMCAQI=
|
||||
-----END DH PARAMETERS-----
|
|
@ -1,10 +0,0 @@
|
|||
[program:statup]
|
||||
command=/usr/local/bin/statup -ip 127.0.0.1
|
||||
stdout_logfile=/var/log/supervisor/statup.log
|
||||
redirect_stderr=true
|
||||
stdout_logfile_maxbytes=1MB
|
||||
stdout_logfile_backups=5
|
||||
autorestart=true
|
||||
stopsignal=TERM
|
||||
user=webadm
|
||||
directory=/home/webadm/statup/
|
|
@ -1,22 +0,0 @@
|
|||
URL = 'https://assets.statup.io/install.sh'
|
||||
TMP = '/tmp/install.sh'
|
||||
|
||||
# Download install script
|
||||
execute "wget #{URL} -O #{TMP}" do
|
||||
user 'root'
|
||||
|
||||
not_if 'test -e /usr/local/bin/statup'
|
||||
end
|
||||
|
||||
file TMP do
|
||||
mode '755'
|
||||
|
||||
not_if 'test -e /usr/local/bin/statup'
|
||||
end
|
||||
|
||||
# Execute install script:
|
||||
execute TMP do
|
||||
user 'root'
|
||||
|
||||
not_if 'test -e /usr/local/bin/statup'
|
||||
end
|
|
@ -1,80 +0,0 @@
|
|||
# Make directory:
|
||||
directory '/home/webadm/statup' do
|
||||
owner 'webadm'
|
||||
group 'webadm'
|
||||
mode '755'
|
||||
end
|
||||
|
||||
# Deploy the configuration:
|
||||
execute 'mc cp minio/backup/statup/config.yml /tmp/config.yml' do
|
||||
user 'kazu634'
|
||||
|
||||
not_if "test -e #{node['statup']['config']}"
|
||||
end
|
||||
|
||||
file '/tmp/config.yml' do
|
||||
owner 'webadm'
|
||||
group 'webadm'
|
||||
mode '664'
|
||||
|
||||
not_if "test -e #{node['statup']['config']}"
|
||||
end
|
||||
|
||||
execute "mv /tmp/config.yml #{node['statup']['config']}" do
|
||||
user 'webadm'
|
||||
|
||||
not_if "test -e #{node['statup']['config']}"
|
||||
end
|
||||
|
||||
# Deploy the configuration DB:
|
||||
execute 'mc cp minio/backup/statup/statup.db /tmp/statup.db' do
|
||||
user 'kazu634'
|
||||
|
||||
not_if "test -e #{node['statup']['db']}"
|
||||
end
|
||||
|
||||
file '/tmp/statup.db' do
|
||||
owner 'webadm'
|
||||
group 'webadm'
|
||||
mode '664'
|
||||
|
||||
not_if "test -e #{node['statup']['db']}"
|
||||
end
|
||||
|
||||
execute "mv /tmp/statup.db #{node['statup']['db']}" do
|
||||
user 'webadm'
|
||||
|
||||
not_if "test -e #{node['statup']['db']}"
|
||||
end
|
||||
|
||||
# Deploy the supervisord configuration file:
|
||||
remote_file '/etc/supervisor/conf.d/statup.conf' do
|
||||
user 'root'
|
||||
group 'root'
|
||||
mode '644'
|
||||
end
|
||||
|
||||
# Apply the changes
|
||||
execute 'Reload supervisor' do
|
||||
user 'root'
|
||||
|
||||
command '/usr/bin/supervisorctl update'
|
||||
end
|
||||
|
||||
# Firewall Setting:
|
||||
%w( 8080/tcp ).each do |port|
|
||||
execute "ufw allow #{port}" do
|
||||
user 'root'
|
||||
|
||||
not_if "LANG=c ufw status | grep #{port}"
|
||||
|
||||
notifies :run, 'execute[ufw reload-or-enable]'
|
||||
end
|
||||
end
|
||||
|
||||
execute 'ufw reload-or-enable' do
|
||||
user 'root'
|
||||
command 'LANG=C ufw reload | grep skipping && ufw --force enable || exit 0'
|
||||
|
||||
action :nothing
|
||||
end
|
|
@ -1,23 +0,0 @@
|
|||
[
|
||||
'rm -f /etc/nginx/sites-enabled/*',
|
||||
'ln -f -s /etc/nginx/sites-available/maintenance /etc/nginx/sites-enabled/maintenance',
|
||||
'systemctl reload nginx',
|
||||
"test -e /etc/letsencrypt/live/#{node['statup']['FQDN']}/cert.pem || certbot certonly --webroot -d #{node['statup']['FQDN']} --webroot-path /usr/share/nginx/html/ --email simoom634@yahoo.co.jp --agree-tos -n",
|
||||
'/home/webadm/bin/nginx-config.sh',
|
||||
].each do |cmd|
|
||||
execute cmd
|
||||
end
|
||||
|
||||
remote_file "/etc/letsencrypt/live/#{node['statup']['FQDN']}/dhparams_4096.pem" do
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '644'
|
||||
end
|
||||
|
||||
execute "openssl rand 48 > /etc/letsencrypt/live/#{node['statup']['FQDN']}/ticket.key"
|
||||
|
||||
remote_file '/etc/cron.d/statup' do
|
||||
user 'root'
|
||||
group 'root'
|
||||
mode '644'
|
||||
end
|
Loading…
Reference in New Issue