mirror of
https://github.com/dragonlock2/matthewtran.com.git
synced 2025-10-11 12:07:56 +00:00
website and p2pool graceful stop
This commit is contained in:
parent
c888f10a52
commit
c3ef9eb514
@ -18,6 +18,8 @@ Stuff that's deployed on [matthewtran.com](https://matthewtran.com). Currently r
|
||||
- Expand the root partition if needed.
|
||||
- `lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv`
|
||||
- `resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv`
|
||||
- Enable huge pages.
|
||||
- `echo "vm.nr_hugepages=3072" | sudo tee -a /etc/sysctl.conf`
|
||||
- Give yourself Docker access if needed.
|
||||
- `groupadd docker`
|
||||
- `usermod -aG docker $USER`
|
||||
@ -25,6 +27,7 @@ Stuff that's deployed on [matthewtran.com](https://matthewtran.com). Currently r
|
||||
- `ufw enable`
|
||||
- `ufw allow OpenSSH`
|
||||
- `ufw allow 51820/udp`
|
||||
- Reboot.
|
||||
2. Forward the following ports. Set a static IP if needed.
|
||||
- website - `80`, `443`
|
||||
- gitea - `2222`
|
||||
|
@ -1,5 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# check bitmonero.log for log
|
||||
monero/monerod \
|
||||
--prune-blockchain \
|
||||
--rpc-bind-ip 0.0.0.0 \
|
||||
@ -10,4 +11,12 @@ monero/monerod \
|
||||
--add-priority-node=p2pmd.xmrvsbeast.com:18080 \
|
||||
--add-priority-node=nodes.hashvault.pro:18080 \
|
||||
--disable-dns-checkpoints \
|
||||
--enable-dns-blocklist
|
||||
--enable-dns-blocklist \
|
||||
--detach
|
||||
|
||||
cleanup() {
|
||||
monero/monerod exit
|
||||
}
|
||||
trap 'cleanup' TERM
|
||||
tail -f /dev/null &
|
||||
wait $!
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd cache
|
||||
~/p2pool \
|
||||
exec ~/p2pool \
|
||||
--mini \
|
||||
--host monerod \
|
||||
--wallet 42j7pyNRf8WE96D1xb6pjPWCwaDaYYevwZSPpELbTJjnXiKp7Lhtahbhb5Gc3p2BVxgMB3FEGNPUcbST1oZds6nBERA4jrQ
|
||||
|
@ -18,4 +18,5 @@ COPY html /var/www/matthewtran.com/html
|
||||
# start script
|
||||
WORKDIR /root
|
||||
COPY sendgrid.ke[y] ip_update.py ./
|
||||
COPY cert_update.py ./
|
||||
COPY entry.sh ./
|
||||
|
10
website/cert_update.py
Normal file
10
website/cert_update.py
Normal file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
if __name__ == '__main__':
|
||||
while True:
|
||||
# try renew once a day
|
||||
subprocess.run(['certbot', 'renew', '--quiet'])
|
||||
time.sleep(86400)
|
@ -16,10 +16,11 @@ certbot --nginx \
|
||||
|
||||
nginx -s reload
|
||||
python3 ip_update.py &
|
||||
python3 cert_update.py &
|
||||
|
||||
# try renew once a day
|
||||
while true
|
||||
do
|
||||
certbot renew --quiet
|
||||
sleep 86400
|
||||
done
|
||||
cleanup() {
|
||||
echo "stopping..."
|
||||
}
|
||||
trap 'cleanup' TERM
|
||||
|
||||
wait $! # wait SIGTERM, other processes can just be killed
|
||||
|
Loading…
x
Reference in New Issue
Block a user