chore: certbot script to bun

This commit is contained in:
Akshay Nair
2024-01-07 15:39:24 +05:30
parent c74f9195ac
commit 07015bb1eb
3 changed files with 10 additions and 9 deletions
+4 -4
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
export ENV=production
export NODE_ENV=production
DRY_RUN=0
if_dry_run() { [[ $DRY_RUN == 1 ]] && echo "$1" || echo "$2"; }
@@ -32,7 +32,7 @@ update_record() {
local name="$3";
local address="$4";
local ttl=${5:-"1"};
echo "
bun -e "
const { domainService } = require('./utils/domain-service');
const { ENV, DOMAIN_DOMAIN } = require('./utils/constants');
const method = '$method';
@@ -57,7 +57,7 @@ update_record() {
}
main().catch(console.error);
" | node -
"
}
update_acme_txt_record() {
@@ -68,6 +68,7 @@ reset_acme() {
sleep 1;
update_record remove TXT '_acme-challenge' '';
update_record remove TXT '_acme-challenge' '';
# update_record add CNAME 'www' "is-a-dev.github.io";
}
get_acme() { dig +noall +answer _acme-challenge.is-a.dev TXT | awk '{print $5}'; }
@@ -84,7 +85,6 @@ esac
### STEPS ###
# Run ./scripts/certbot.sh cert
# Run ./scripts/certbot.sh acme_txt "<key>"
# cp -r /tmp/is-a-dev-whatever /opt/app/code/is-a-dev-cert
# Upload cert.pem and privkey.pem (from config/live/is-a.dev/) contents to SSL > Manage SSL Sites
# Run ./scripts/certbot.sh reset