refactor: rename backup dir to /opt/backup/certificates/
This commit is contained in:
parent
6d87718b43
commit
5f46d3c2b8
3 changed files with 7 additions and 7 deletions
|
|
@ -88,12 +88,12 @@ if [ "$GREENFIELD" = true ]; then
|
||||||
|
|
||||||
# Step 4: Run helper tool — port 80 is free, can obtain LE certs via HTTP-01
|
# Step 4: Run helper tool — port 80 is free, can obtain LE certs via HTTP-01
|
||||||
echo "[4/6] Checking certificates..."
|
echo "[4/6] Checking certificates..."
|
||||||
mkdir -p "$BACKUP_DIR/certs"
|
mkdir -p "$BACKUP_DIR/certificates"
|
||||||
if [ -f "$TOOL_BIN" ]; then
|
if [ -f "$TOOL_BIN" ]; then
|
||||||
"$TOOL_BIN" cert \
|
"$TOOL_BIN" cert \
|
||||||
--domains "app.${DOMAIN},dns.${DOMAIN},www.${DOMAIN}" \
|
--domains "app.${DOMAIN},dns.${DOMAIN},www.${DOMAIN}" \
|
||||||
--email "${TLS_EMAIL:-admin@${DOMAIN}}" \
|
--email "${TLS_EMAIL:-admin@${DOMAIN}}" \
|
||||||
--backup-dir "$BACKUP_DIR/certs" 2>&1 || true
|
--backup-dir "$BACKUP_DIR/certificates" 2>&1 || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Step 5: Build production directory structure
|
# Step 5: Build production directory structure
|
||||||
|
|
@ -116,8 +116,8 @@ if [ "$GREENFIELD" = true ]; then
|
||||||
# Copy certificates from backup vault to Zoraxy cert dir
|
# Copy certificates from backup vault to Zoraxy cert dir
|
||||||
for DOMAIN_SUB in app dns www; do
|
for DOMAIN_SUB in app dns www; do
|
||||||
FQDN="${DOMAIN_SUB}.${DOMAIN}"
|
FQDN="${DOMAIN_SUB}.${DOMAIN}"
|
||||||
CERT_SRC="$BACKUP_DIR/certs/${FQDN}/fullchain.pem"
|
CERT_SRC="$BACKUP_DIR/certificates/${FQDN}/fullchain.pem"
|
||||||
KEY_SRC="$BACKUP_DIR/certs/${FQDN}/privkey.pem"
|
KEY_SRC="$BACKUP_DIR/certificates/${FQDN}/privkey.pem"
|
||||||
if [ -f "$CERT_SRC" ] && [ -f "$KEY_SRC" ]; then
|
if [ -f "$CERT_SRC" ] && [ -f "$KEY_SRC" ]; then
|
||||||
cp "$CERT_SRC" "$TARGET_DIR/config/zoraxy/conf/certs/${FQDN}.crt"
|
cp "$CERT_SRC" "$TARGET_DIR/config/zoraxy/conf/certs/${FQDN}.crt"
|
||||||
cp "$KEY_SRC" "$TARGET_DIR/config/zoraxy/conf/certs/${FQDN}.key"
|
cp "$KEY_SRC" "$TARGET_DIR/config/zoraxy/conf/certs/${FQDN}.key"
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ BACKUP_DIR="/opt/backup"
|
||||||
|
|
||||||
# --- Create backup vault and runtime directories ---
|
# --- Create backup vault and runtime directories ---
|
||||||
echo "=== NextWorkspace Setup ==="
|
echo "=== NextWorkspace Setup ==="
|
||||||
mkdir -p "$BACKUP_DIR/certs"
|
mkdir -p "$BACKUP_DIR/certificates"
|
||||||
mkdir -p "$TARGET_DIR/config/nextworkspace"
|
mkdir -p "$TARGET_DIR/config/nextworkspace"
|
||||||
mkdir -p "$TARGET_DIR/config/zoraxy/conf/proxy"
|
mkdir -p "$TARGET_DIR/config/zoraxy/conf/proxy"
|
||||||
mkdir -p "$TARGET_DIR/config/zoraxy/www/html"
|
mkdir -p "$TARGET_DIR/config/zoraxy/www/html"
|
||||||
|
|
|
||||||
|
|
@ -96,8 +96,8 @@ func runCert(args []string) {
|
||||||
fs := flag.NewFlagSet("cert", flag.ExitOnError)
|
fs := flag.NewFlagSet("cert", flag.ExitOnError)
|
||||||
domainsStr := fs.String("domains", "", "Comma-separated domain list")
|
domainsStr := fs.String("domains", "", "Comma-separated domain list")
|
||||||
email := fs.String("email", "", "ACME email")
|
email := fs.String("email", "", "ACME email")
|
||||||
backupDir := fs.String("backup-dir", "/opt/backup/certs", "Backup directory for certs")
|
backupDir := fs.String("backup-dir", "/opt/backup/certificates", "Backup directory for certs")
|
||||||
legoDir := fs.String("lego-dir", "/opt/backup/certs", "Lego working directory")
|
legoDir := fs.String("lego-dir", "/opt/backup/certificates", "Lego working directory")
|
||||||
fs.Parse(args)
|
fs.Parse(args)
|
||||||
|
|
||||||
if *domainsStr == "" || *email == "" {
|
if *domainsStr == "" || *email == "" {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue