From 23ccf91aee7b9f05f1a692fcb77fe25f6023d55e Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 04:33:12 -0400 Subject: [PATCH 01/44] update --- mods/scripts/options.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mods/scripts/options.sh b/mods/scripts/options.sh index 29ac6925d..f1df99102 100644 --- a/mods/scripts/options.sh +++ b/mods/scripts/options.sh @@ -1,9 +1,13 @@ #!/bin/bash # ANSI color codes +CYAN="\033[0;36m" RED="\033[0;31m" +ORANGE="\033[0;33m" +WHITE="\033[1;37m" +BOLD="\033[1m" +NC="\033[0m" # No color BLUE="\033[0;34m" -NC="\033[0m" # No color # Clear the screen at the start clear @@ -30,7 +34,7 @@ exit_script() { main_menu() { while true; do clear - echo -e "${BLUE}PlexGuide Options Interface${NC}" + echo -e "${CYAN}${BOLD}PG Options Interface${NC}" echo "" # Blank line for separation # Display the main menu options echo "G) Graphics Cards" From f6b52ca37ed99d2d0a589c21fc30577d9caf11e8 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 04:35:58 -0400 Subject: [PATCH 02/44] update --- mods/scripts/zurg/menu.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mods/scripts/zurg/menu.sh b/mods/scripts/zurg/menu.sh index d343dd1f0..a98782283 100644 --- a/mods/scripts/zurg/menu.sh +++ b/mods/scripts/zurg/menu.sh @@ -55,17 +55,17 @@ main_menu() { check_docker_status echo -e "${CYAN}${BOLD}PG Zurg Interface${NC}" - echo -e "${BLUE}-------------------------------${NC}" - echo -e "[C] Clone repository to /pg/zurg ${repo_status}" + echo "" + echo -e "C) Clone repository to /pg/zurg ${repo_status}" if check_repo_status; then - echo -e "[T] Real Debrid API Token ${token_status}" + echo -e "T) Real Debrid API Token ${token_status}" fi if check_token_status; then - echo -e "[R] Run docker compose up -d ${docker_status}" + echo -e "R) Run docker compose up -d ${docker_status}" fi - echo -e "[D] Destroy & Remove All Data" - echo -e "[Z] Exit" - echo -e "${BLUE}-------------------------------${NC}" + echo -e "D) Destroy & Remove All Data" + echo -e "Z) Exit" + echo "" read -p "Select an Option > " choice case $choice in [Cc]) From 7b7879a9a8605785d342107f4187c758cbc563a9 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 04:39:48 -0400 Subject: [PATCH 03/44] update --- mods/scripts/apps/starter_menu.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mods/scripts/apps/starter_menu.sh b/mods/scripts/apps/starter_menu.sh index a0e864eb1..363afcf89 100644 --- a/mods/scripts/apps/starter_menu.sh +++ b/mods/scripts/apps/starter_menu.sh @@ -147,7 +147,10 @@ main_menu() { # Conditionally hide options Q and R if the repo is set to "None" if [[ "$repo" != "None" ]]; then - printf " Q) Personal: Manage [%d]\n" "$P_COUNT" + # Only display option Q) if there are personal apps deployed (P_COUNT > 0) + if [[ "$P_COUNT" -gt 0 ]]; then + printf " Q) Personal: Manage [%d]\n" "$P_COUNT" + fi printf " R) Personal: Deploy Apps\n" fi @@ -191,8 +194,8 @@ main_menu() { bash /pg/scripts/apps/personal_select.sh ;; Q|q) - if [[ "$repo" == "None" ]]; then - echo -e "${RED}Option Q is not available. Please use P to set a User and Repo first.${NC}" + if [[ "$repo" == "None" || "$P_COUNT" -eq 0 ]]; then + echo -e "${RED}Option Q is not available. Please deploy a personal app first.${NC}" read -p "Press Enter to continue..." else bash /pg/scripts/apps/running.sh "personal" @@ -220,6 +223,5 @@ main_menu() { done } - # Call the main menu function main_menu From 03a4d49bcd486b5d0816ccb7164f5bae11379568 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 04:43:00 -0400 Subject: [PATCH 04/44] update --- mods/scripts/traefik/traefik_menu.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/scripts/traefik/traefik_menu.sh b/mods/scripts/traefik/traefik_menu.sh index 5d980d8bb..9d3ed7e76 100644 --- a/mods/scripts/traefik/traefik_menu.sh +++ b/mods/scripts/traefik/traefik_menu.sh @@ -7,6 +7,7 @@ RED="\033[0;31m" YELLOW="\033[0;33m" BLUE="\033[0;34m" MAGENTA="\033[0;35m" +BOLD="\033[1m" NC="\033[0m" # No color # Configuration file path for storing DNS provider and domain details @@ -74,7 +75,7 @@ setup_dns_provider() { clear check_traefik_status - echo -e "${CYAN}PG: CloudFlare Traefik Interface ${traefik_status}${NC}" + echo -e "${CYAN}${BOLD}PG: CloudFlare Traefik Interface ${traefik_status}${NC}" echo "" echo -e "[${CYAN}${BOLD}C${NC}] CF Information" echo -e "[${MAGENTA}${BOLD}E${NC}] E-Mail for Let's Encrypt" From fe72884c64b11195a14398f609456a219cda70ad Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 04:44:08 -0400 Subject: [PATCH 05/44] update --- mods/scripts/cloud_server.sh | 2 +- mods/scripts/traefik/traefik_menu.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/scripts/cloud_server.sh b/mods/scripts/cloud_server.sh index 486855ce3..3a23493a9 100644 --- a/mods/scripts/cloud_server.sh +++ b/mods/scripts/cloud_server.sh @@ -25,7 +25,7 @@ cloud_server_menu() { echo "" # Space between options and input prompt # Prompt for user input - read -p "Enter your choice: " choice + read -p "Select an Option > " choice # Process user input case ${choice,,} in diff --git a/mods/scripts/traefik/traefik_menu.sh b/mods/scripts/traefik/traefik_menu.sh index 9d3ed7e76..5b837d89d 100644 --- a/mods/scripts/traefik/traefik_menu.sh +++ b/mods/scripts/traefik/traefik_menu.sh @@ -83,7 +83,7 @@ setup_dns_provider() { echo -e "[${RED}${BOLD}Z${NC}] Exit" echo "" - read -p "Enter your choice: " choice + read -p "Select an Option > " choice case $choice in [Cc]) if docker ps --filter "name=traefik" --format '{{.Names}}' | grep -q 'traefik'; then From 015c7cdb9222a01fdff09b2e20a3d5031de24131 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 04:45:50 -0400 Subject: [PATCH 06/44] update --- mods/scripts/traefik/traefik_menu.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/scripts/traefik/traefik_menu.sh b/mods/scripts/traefik/traefik_menu.sh index 5b837d89d..96a5f55d5 100644 --- a/mods/scripts/traefik/traefik_menu.sh +++ b/mods/scripts/traefik/traefik_menu.sh @@ -16,9 +16,9 @@ CONFIG_FILE="/pg/config/dns_provider.cfg" # Function to check if Traefik is deployed check_traefik_status() { if docker ps --filter "name=traefik" --format '{{.Names}}' | grep -q 'traefik'; then - traefik_status="${GREEN}[Deployed]${NC}" + traefik_status="${GREEN}${BOLD}[Deployed]${NC}" else - traefik_status="${RED}[Not Deployed]${NC}" + traefik_status="${RED}${BOLD}[Not Deployed]${NC}" fi } From 56e9f8e24546d273df291ede0f40701c27cf2c5f Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 04:46:28 -0400 Subject: [PATCH 07/44] update --- mods/scripts/menu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/scripts/menu.sh b/mods/scripts/menu.sh index 83a555b7d..c6d949f96 100644 --- a/mods/scripts/menu.sh +++ b/mods/scripts/menu.sh @@ -165,7 +165,7 @@ main_menu() { echo "" # Space between options and input prompt # Prompt for user input - read -p "Choose and Option > " choice + read -p "Select an Option > " choice # Process user input case ${choice,,} in From fa4587bdc5dbe671cea7ff12f6b38dd0f4e8557a Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 04:47:55 -0400 Subject: [PATCH 08/44] update --- mods/scripts/domain_menu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/scripts/domain_menu.sh b/mods/scripts/domain_menu.sh index cb969c3b7..8664f7f84 100644 --- a/mods/scripts/domain_menu.sh +++ b/mods/scripts/domain_menu.sh @@ -33,7 +33,7 @@ get_port_status() { display_menu() { clear get_port_status # Fetch the port status - echo -e "${CYAN}PG Domain Configuration Interface${NC}" + echo -e "${CYAN}${BOLD}PG Domain Configuration Interface${NC}" echo echo -e "[${YELLOW}${BOLD}A${NC}] CloudFlare Tunnel" echo -e "[${CYAN}${BOLD}B${NC}] CloudFlare Traefik" From 80853b3332d34e874ed0285171704a38bec55933 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 04:50:39 -0400 Subject: [PATCH 09/44] update --- mods/scripts/cf_tunnel.sh | 7 ++----- mods/scripts/domain_menu.sh | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/mods/scripts/cf_tunnel.sh b/mods/scripts/cf_tunnel.sh index 75367da24..b0ac4d299 100644 --- a/mods/scripts/cf_tunnel.sh +++ b/mods/scripts/cf_tunnel.sh @@ -39,10 +39,7 @@ container_exists() { # Function to display the main menu show_menu() { clear - echo "PG: CloudFlare Tunnel" - - # Display container deployment status - echo -n "Container Deployed: " + echo "${CYAN}${BOLD}PG: CloudFlare Tunnel${NC} - Container Deployed: " if container_running; then echo -e "${GREEN}Yes${NC}" else @@ -64,7 +61,7 @@ show_menu() { # Function to prompt the user with a choice prompt_choice() { - read -p "Select an option: " choice + read -p "Select an Option > " choice case ${choice,,} in # Convert input to lowercase for v/V, c/C, d/D, s/S, z/Z handling v) clear diff --git a/mods/scripts/domain_menu.sh b/mods/scripts/domain_menu.sh index 8664f7f84..d7ce315c5 100644 --- a/mods/scripts/domain_menu.sh +++ b/mods/scripts/domain_menu.sh @@ -45,7 +45,7 @@ display_menu() { # Main loop while true; do display_menu - read -p "Make a Choice > " choice + read -p "Select an Option > " choice case $choice in [Aa]) From 01a1f5bfd01601a426db1fcd49f48a98d18a5bc2 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 07:50:42 -0400 Subject: [PATCH 10/44] update --- mods/scripts/{cf_tunnel.sh => cloudflare/tunnel.sh} | 2 +- mods/scripts/domain_menu.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename mods/scripts/{cf_tunnel.sh => cloudflare/tunnel.sh} (98%) diff --git a/mods/scripts/cf_tunnel.sh b/mods/scripts/cloudflare/tunnel.sh similarity index 98% rename from mods/scripts/cf_tunnel.sh rename to mods/scripts/cloudflare/tunnel.sh index b0ac4d299..d737f8dad 100644 --- a/mods/scripts/cf_tunnel.sh +++ b/mods/scripts/cloudflare/tunnel.sh @@ -39,7 +39,7 @@ container_exists() { # Function to display the main menu show_menu() { clear - echo "${CYAN}${BOLD}PG: CloudFlare Tunnel${NC} - Container Deployed: " + echo -n -e "${CYAN}${BOLD}PG: CloudFlare Tunnel${NC} - Container Deployed: " if container_running; then echo -e "${GREEN}Yes${NC}" else diff --git a/mods/scripts/domain_menu.sh b/mods/scripts/domain_menu.sh index d7ce315c5..d4ebb6339 100644 --- a/mods/scripts/domain_menu.sh +++ b/mods/scripts/domain_menu.sh @@ -49,7 +49,7 @@ while true; do case $choice in [Aa]) - bash /pg/scripts/cf_tunnel.sh + bash /pg/scripts/cloudflare/tunnel.sh ;; [Bb]) bash /pg/scripts/traefik/traefik_menu.sh From 43bd97da5fd0b5137779e4874a0a2d3e015ac88b Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 07:54:07 -0400 Subject: [PATCH 11/44] update --- mods/scripts/cloudflare/tunnel.sh | 69 ++++++++++++++++--------------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/mods/scripts/cloudflare/tunnel.sh b/mods/scripts/cloudflare/tunnel.sh index d737f8dad..d4835218d 100644 --- a/mods/scripts/cloudflare/tunnel.sh +++ b/mods/scripts/cloudflare/tunnel.sh @@ -69,35 +69,11 @@ prompt_choice() { ;; c) clear - local change_code=$(printf "%04d" $((RANDOM % 10000))) # Generate a 4-digit code - while true; do - read -p "$(echo -e "To change the Cloudflare token, type [${RED}${change_code}${NC}] to proceed or [${GREEN}no${NC}] to cancel: ")" input_code - if [[ "$input_code" == "$change_code" ]]; then - change_token - break - elif [[ "${input_code,,}" == "no" ]]; then - echo "Operation cancelled." - break - else - echo -e "${RED}Invalid response.${NC} Please type [${RED}${change_code}${NC}] or [${GREEN}no${NC}]." - fi - done + change_token ;; d) clear - local deploy_code=$(printf "%04d" $((RANDOM % 10000))) # Generate a 4-digit code - while true; do - read -p "$(echo -e "Deploy CF Tunnel? Type [${RED}${deploy_code}${NC}] to proceed or [${GREEN}no${NC}] to cancel: ")" input_code - if [[ "$input_code" == "$deploy_code" ]]; then - deploy_container - break - elif [[ "${input_code,,}" == "no" ]]; then - echo "Operation cancelled." - break - else - echo -e "${RED}Invalid response.${NC} Please type [${RED}${deploy_code}${NC}] or [${GREEN}no${NC}]." - fi - done + deploy_container ;; s) clear @@ -136,13 +112,40 @@ view_token() { # Function to change the Cloudflare token change_token() { - clear - read -p "Enter new Cloudflare token: " CLOUDFLARE_TOKEN - save_token_to_config - echo "Cloudflare token has been updated and saved to $CONFIG_FILE." - sleep 2 - show_menu - prompt_choice + local change_code deploy_code new_token + change_code=$(printf "%04d" $((RANDOM % 10000))) # Generate first 4-digit pin + deploy_code=$(printf "%04d" $((RANDOM % 10000))) # Generate second 4-digit pin + + # Ensure both pin codes are not the same + while [[ "$deploy_code" == "$change_code" ]]; do + deploy_code=$(printf "%04d" $((RANDOM % 10000))) + done + + echo -e "Enter new Cloudflare token (you'll need a pin to confirm):" + read -p "> " new_token # Get the new token from the user + echo # Echo a blank line for spacing + + while true; do + read -p "$(echo -e "To confirm the new token, type [${RED}${change_code}${NC}] to proceed or [${GREEN}no${NC}] to cancel: ")" input_code + if [[ "$input_code" == "$change_code" ]]; then + # Save the token and confirm + CLOUDFLARE_TOKEN="$new_token" + save_token_to_config + echo -e "${GREEN}Cloudflare token has been updated and saved to $CONFIG_FILE.${NC}" + sleep 2 + show_menu + prompt_choice + break + elif [[ "${input_code,,}" == "no" ]]; then + echo -e "${RED}Operation cancelled.${NC}" + sleep 2 + show_menu + prompt_choice + break + else + echo -e "${RED}Invalid response.${NC} Please type [${RED}${change_code}${NC}] or [${GREEN}no${NC}]." + fi + done } # Function to deploy or redeploy the container From 54f74f86f2b42ae73326b01d03f77fec5393b5d7 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 07:57:29 -0400 Subject: [PATCH 12/44] update --- mods/scripts/cloudflare/tunnel.sh | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/mods/scripts/cloudflare/tunnel.sh b/mods/scripts/cloudflare/tunnel.sh index d4835218d..55c02db31 100644 --- a/mods/scripts/cloudflare/tunnel.sh +++ b/mods/scripts/cloudflare/tunnel.sh @@ -3,8 +3,9 @@ # Configuration file path CONFIG_FILE="/pg/config/cf_tunnel.cfg" -# ANSI color codes for green, red, and blue -GREEN="\033[0;32m" +# ANSI color codes for green, hot pink, and others +GREEN="\033[1;32m" # Bold Green +HOT_PINK="\033[1;35m" # Bold Hot Pink RED="\033[0;31m" BLUE="\033[0;34m" NC="\033[0m" # No color @@ -112,21 +113,17 @@ view_token() { # Function to change the Cloudflare token change_token() { - local change_code deploy_code new_token - change_code=$(printf "%04d" $((RANDOM % 10000))) # Generate first 4-digit pin - deploy_code=$(printf "%04d" $((RANDOM % 10000))) # Generate second 4-digit pin + local change_code + change_code=$(printf "%04d" $((RANDOM % 10000))) # Generate a 4-digit pin - # Ensure both pin codes are not the same - while [[ "$deploy_code" == "$change_code" ]]; do - deploy_code=$(printf "%04d" $((RANDOM % 10000))) - done - - echo -e "Enter new Cloudflare token (you'll need a pin to confirm):" + # Ask the user for the new token + echo -e "Enter new Cloudflare token:" read -p "> " new_token # Get the new token from the user echo # Echo a blank line for spacing + # Confirmation prompt with hot pink pin for proceed and green for cancel while true; do - read -p "$(echo -e "To confirm the new token, type [${RED}${change_code}${NC}] to proceed or [${GREEN}no${NC}] to cancel: ")" input_code + read -p "$(echo -e "To proceed with the new token, type [${HOT_PINK}${change_code}${NC}] to proceed or [${GREEN}exit${NC}] to cancel: ")" input_code if [[ "$input_code" == "$change_code" ]]; then # Save the token and confirm CLOUDFLARE_TOKEN="$new_token" @@ -136,14 +133,14 @@ change_token() { show_menu prompt_choice break - elif [[ "${input_code,,}" == "no" ]]; then - echo -e "${RED}Operation cancelled.${NC}" + elif [[ "${input_code,,}" == "exit" ]]; then + echo -e "${GREEN}Operation cancelled.${NC}" sleep 2 show_menu prompt_choice break else - echo -e "${RED}Invalid response.${NC} Please type [${RED}${change_code}${NC}] or [${GREEN}no${NC}]." + echo -e "${RED}Invalid response.${NC} Please type [${HOT_PINK}${change_code}${NC}] or [${GREEN}exit${NC}]." fi done } From 2f328b5ec4f8157df77bdca21029d1800b97b94c Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 08:02:47 -0400 Subject: [PATCH 13/44] update --- mods/scripts/cloudflare/tunnel.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/mods/scripts/cloudflare/tunnel.sh b/mods/scripts/cloudflare/tunnel.sh index 55c02db31..adf5c6234 100644 --- a/mods/scripts/cloudflare/tunnel.sh +++ b/mods/scripts/cloudflare/tunnel.sh @@ -37,6 +37,20 @@ container_exists() { docker ps -a --filter "name=cf_tunnel" --format "{{.Names}}" | grep -q "cf_tunnel" } +# Function to validate Cloudflare token via API +validate_token() { + local token=$1 + response=$(curl -s -X GET "https://api.cloudflare.com/client/v4/user/tokens/verify" \ + -H "Authorization: Bearer $token" \ + -H "Content-Type: application/json") + + if echo "$response" | grep -q '"success":true'; then + return 0 # Token is valid + else + return 1 # Token is invalid + fi +} + # Function to display the main menu show_menu() { clear @@ -121,6 +135,18 @@ change_token() { read -p "> " new_token # Get the new token from the user echo # Echo a blank line for spacing + # Validate the token using the Cloudflare API + if validate_token "$new_token"; then + echo -e "${GREEN}Validating token...${NC}" + echo -e "${GREEN}Token is valid!${NC}" + else + echo -e "${RED}Invalid Cloudflare token. Please try again.${NC}" + sleep 2 + show_menu + prompt_choice + return + fi + # Confirmation prompt with hot pink pin for proceed and green for cancel while true; do read -p "$(echo -e "To proceed with the new token, type [${HOT_PINK}${change_code}${NC}] to proceed or [${GREEN}exit${NC}] to cancel: ")" input_code From ac68b8565d8757413b880cba7d9e026e9b55a9dd Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 08:17:35 -0400 Subject: [PATCH 14/44] update --- mods/scripts/cloudflare/tunnel.sh | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/mods/scripts/cloudflare/tunnel.sh b/mods/scripts/cloudflare/tunnel.sh index adf5c6234..55c02db31 100644 --- a/mods/scripts/cloudflare/tunnel.sh +++ b/mods/scripts/cloudflare/tunnel.sh @@ -37,20 +37,6 @@ container_exists() { docker ps -a --filter "name=cf_tunnel" --format "{{.Names}}" | grep -q "cf_tunnel" } -# Function to validate Cloudflare token via API -validate_token() { - local token=$1 - response=$(curl -s -X GET "https://api.cloudflare.com/client/v4/user/tokens/verify" \ - -H "Authorization: Bearer $token" \ - -H "Content-Type: application/json") - - if echo "$response" | grep -q '"success":true'; then - return 0 # Token is valid - else - return 1 # Token is invalid - fi -} - # Function to display the main menu show_menu() { clear @@ -135,18 +121,6 @@ change_token() { read -p "> " new_token # Get the new token from the user echo # Echo a blank line for spacing - # Validate the token using the Cloudflare API - if validate_token "$new_token"; then - echo -e "${GREEN}Validating token...${NC}" - echo -e "${GREEN}Token is valid!${NC}" - else - echo -e "${RED}Invalid Cloudflare token. Please try again.${NC}" - sleep 2 - show_menu - prompt_choice - return - fi - # Confirmation prompt with hot pink pin for proceed and green for cancel while true; do read -p "$(echo -e "To proceed with the new token, type [${HOT_PINK}${change_code}${NC}] to proceed or [${GREEN}exit${NC}] to cancel: ")" input_code From c0f185e0d22c0d9ed30b3de5a30475dbad8c67e8 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 08:20:11 -0400 Subject: [PATCH 15/44] update --- mods/scripts/cloudflare/tunnel.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/mods/scripts/cloudflare/tunnel.sh b/mods/scripts/cloudflare/tunnel.sh index 55c02db31..3618f0347 100644 --- a/mods/scripts/cloudflare/tunnel.sh +++ b/mods/scripts/cloudflare/tunnel.sh @@ -113,8 +113,9 @@ view_token() { # Function to change the Cloudflare token change_token() { - local change_code - change_code=$(printf "%04d" $((RANDOM % 10000))) # Generate a 4-digit pin + local proceed_pin cancel_pin + proceed_pin=$(printf "%04d" $((RANDOM % 10000))) # Generate a 4-digit proceed pin + cancel_pin=$(printf "%04d" $((RANDOM % 10000))) # Generate a 4-digit cancel pin # Ask the user for the new token echo -e "Enter new Cloudflare token:" @@ -123,8 +124,11 @@ change_token() { # Confirmation prompt with hot pink pin for proceed and green for cancel while true; do - read -p "$(echo -e "To proceed with the new token, type [${HOT_PINK}${change_code}${NC}] to proceed or [${GREEN}exit${NC}] to cancel: ")" input_code - if [[ "$input_code" == "$change_code" ]]; then + echo -e "To proceed, enter this PIN [${HOT_PINK}${proceed_pin}${NC}]" + echo -e "To cancel, enter this PIN [${GREEN}${cancel_pin}${NC}]" + read -p "Enter PIN > " input_code + + if [[ "$input_code" == "$proceed_pin" ]]; then # Save the token and confirm CLOUDFLARE_TOKEN="$new_token" save_token_to_config @@ -133,14 +137,14 @@ change_token() { show_menu prompt_choice break - elif [[ "${input_code,,}" == "exit" ]]; then + elif [[ "$input_code" == "$cancel_pin" ]]; then echo -e "${GREEN}Operation cancelled.${NC}" sleep 2 show_menu prompt_choice break else - echo -e "${RED}Invalid response.${NC} Please type [${HOT_PINK}${change_code}${NC}] or [${GREEN}exit${NC}]." + echo -e "${RED}Invalid response.${NC} Please enter [${HOT_PINK}${proceed_pin}${NC}] to proceed or [${GREEN}${cancel_pin}${NC}] to cancel." fi done } From 1c14cb5d6469e0ca6f85f8ac81eb6d051faccf75 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 08:23:38 -0400 Subject: [PATCH 16/44] update --- mods/scripts/cloudflare/tunnel.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mods/scripts/cloudflare/tunnel.sh b/mods/scripts/cloudflare/tunnel.sh index 3618f0347..e6616b5bf 100644 --- a/mods/scripts/cloudflare/tunnel.sh +++ b/mods/scripts/cloudflare/tunnel.sh @@ -133,6 +133,18 @@ change_token() { CLOUDFLARE_TOKEN="$new_token" save_token_to_config echo -e "${GREEN}Cloudflare token has been updated and saved to $CONFIG_FILE.${NC}" + + # Check if the container is running, notify the user and stop/remove it + if container_running; then + echo -e "${RED}Note:${NC} The CloudFlare Tunnel container is currently running." + echo "You must redeploy the container for the changes to take effect." + + echo "Stopping and removing the running container..." + docker stop cf_tunnel + docker rm cf_tunnel + echo "Container stopped and removed." + fi + sleep 2 show_menu prompt_choice From 98e738815bb8b55dd618c3193dc17230103189e0 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 08:27:37 -0400 Subject: [PATCH 17/44] update --- mods/scripts/cloudflare/tunnel.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mods/scripts/cloudflare/tunnel.sh b/mods/scripts/cloudflare/tunnel.sh index e6616b5bf..ef16307dd 100644 --- a/mods/scripts/cloudflare/tunnel.sh +++ b/mods/scripts/cloudflare/tunnel.sh @@ -9,6 +9,8 @@ HOT_PINK="\033[1;35m" # Bold Hot Pink RED="\033[0;31m" BLUE="\033[0;34m" NC="\033[0m" # No color +CYAN="\033[0;36m" +BOLD="\033[1m" # Clear the screen when the script starts clear From 4afadbb8f99e39265cd3a31bce442e7860120227 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 08:28:59 -0400 Subject: [PATCH 18/44] update --- mods/scripts/cloudflare/tunnel.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/scripts/cloudflare/tunnel.sh b/mods/scripts/cloudflare/tunnel.sh index ef16307dd..665da1a4f 100644 --- a/mods/scripts/cloudflare/tunnel.sh +++ b/mods/scripts/cloudflare/tunnel.sh @@ -44,9 +44,9 @@ show_menu() { clear echo -n -e "${CYAN}${BOLD}PG: CloudFlare Tunnel${NC} - Container Deployed: " if container_running; then - echo -e "${GREEN}Yes${NC}" + echo -e "${GREEN}${BOLD}Yes${NC}" else - echo -e "${RED}No${NC}" + echo -e "${RED}${BOLD}No${NC}" fi echo From d0f37eb01243ca2f939f39b939f33fb7102e1152 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 08:31:22 -0400 Subject: [PATCH 19/44] update --- mods/scripts/cloudflare/tunnel.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/scripts/cloudflare/tunnel.sh b/mods/scripts/cloudflare/tunnel.sh index 665da1a4f..e51460a4f 100644 --- a/mods/scripts/cloudflare/tunnel.sh +++ b/mods/scripts/cloudflare/tunnel.sh @@ -42,11 +42,11 @@ container_exists() { # Function to display the main menu show_menu() { clear - echo -n -e "${CYAN}${BOLD}PG: CloudFlare Tunnel${NC} - Container Deployed: " + echo -n -e "${CYAN}${BOLD}PG: CloudFlare Tunnel${NC} " if container_running; then - echo -e "${GREEN}${BOLD}Yes${NC}" + echo -e "${GREEN}${BOLD}[Deployed]${NC}" else - echo -e "${RED}${BOLD}No${NC}" + echo -e "${RED}${BOLD}[Not Deployed]${NC}" fi echo From 96208618ca73db36f113358dc5a06230ed4388bf Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 08:40:58 -0400 Subject: [PATCH 20/44] update --- mods/scripts/traefik/traefik_deploy.sh | 2 +- mods/scripts/traefik/traefik_menu.sh | 52 +++++++++++++++++++++++--- 2 files changed, 47 insertions(+), 7 deletions(-) diff --git a/mods/scripts/traefik/traefik_deploy.sh b/mods/scripts/traefik/traefik_deploy.sh index 3b720da8c..a12e1aaf1 100644 --- a/mods/scripts/traefik/traefik_deploy.sh +++ b/mods/scripts/traefik/traefik_deploy.sh @@ -62,7 +62,7 @@ services: - "--entrypoints.web.http.redirections.entrypoint.to=websecure" - "--entrypoints.web.http.redirections.entrypoint.scheme=https" - "--certificatesresolvers.mytlschallenge.acme.dnschallenge=true" - - "--certificatesresolvers.mytlschallenge.acme.email=${letsencrypt_email:-example@example.com}" + - "--certificatesresolvers.mytlschallenge.acme.email=${letsencrypt_email}" - "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json" - "--certificatesresolvers.mytlschallenge.acme.dnschallenge.provider=cloudflare" - "--certificatesresolvers.mytlschallenge.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53" diff --git a/mods/scripts/traefik/traefik_menu.sh b/mods/scripts/traefik/traefik_menu.sh index 96a5f55d5..13ee0c013 100644 --- a/mods/scripts/traefik/traefik_menu.sh +++ b/mods/scripts/traefik/traefik_menu.sh @@ -22,6 +22,19 @@ check_traefik_status() { fi } +# Function to check if the Let's Encrypt email is set +check_email_status() { + if grep -q "^letsencrypt_email=" "$CONFIG_FILE"; then + letsencrypt_email=$(grep "^letsencrypt_email=" "$CONFIG_FILE" | cut -d'=' -f2) + if [[ -z "$letsencrypt_email" || "$letsencrypt_email" == "notset" ]]; then + email_status="${RED}${BOLD}Not Set${NC}" + else + email_status="${GREEN}${BOLD}Set${NC}" + fi + else + email_status="${RED}${BOLD}Not Set${NC}" + fi +} # Function to test Cloudflare credentials test_cloudflare_credentials() { @@ -36,6 +49,16 @@ test_cloudflare_credentials() { fi } +# Function to validate email format +validate_email() { + local email="$1" + if [[ "$email" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ ]]; then + return 0 # Email is valid + else + return 1 # Email is invalid + fi +} + # Function to handle Traefik stop and removal warning with PINs warn_traefik_removal() { echo "" @@ -74,12 +97,18 @@ setup_dns_provider() { while true; do clear check_traefik_status + check_email_status echo -e "${CYAN}${BOLD}PG: CloudFlare Traefik Interface ${traefik_status}${NC}" echo "" echo -e "[${CYAN}${BOLD}C${NC}] CF Information" - echo -e "[${MAGENTA}${BOLD}E${NC}] E-Mail for Let's Encrypt" - echo -e "[${BLUE}${BOLD}D${NC}] Deploy Traefik" + echo -e "[${MAGENTA}${BOLD}E${NC}] Notification E-Mail Address (${email_status})" + + # Show the Deploy Traefik option only if email is set + if [[ "$email_status" == "${GREEN}${BOLD}Set${NC}" ]]; then + echo -e "[${BLUE}${BOLD}D${NC}] Deploy Traefik" + fi + echo -e "[${RED}${BOLD}Z${NC}] Exit" echo "" @@ -98,9 +127,11 @@ setup_dns_provider() { set_email ;; [Dd]) + if [[ "$email_status" == "${GREEN}${BOLD}Set${NC}" ]]; then bash /pg/scripts/traefik/traefik_deploy.sh echo "" read -p "Press Enter to continue..." + fi ;; [Zz]) exit 0 @@ -149,10 +180,19 @@ configure_provider() { # Function to set email for Let's Encrypt set_email() { - read -p "Enter your email for Let's Encrypt notifications: " letsencrypt_email - echo "letsencrypt_email=$letsencrypt_email" >> "$CONFIG_FILE" - echo -e "${GREEN}Email has been configured successfully.${NC}" - read -p "Press Enter to continue..." + while true; do + read -p "Enter your email for Let's Encrypt notifications: " letsencrypt_email + + # Validate email format + if validate_email "$letsencrypt_email"; then + echo "letsencrypt_email=$letsencrypt_email" >> "$CONFIG_FILE" + echo -e "${GREEN}Email has been configured successfully.${NC}" + read -p "Press Enter to continue..." + break + else + echo -e "${RED}Invalid email format. Please enter a valid email (e.g., user@example.com).${NC}" + fi + done } # Execute the setup function From e150e67bb0a2b706f2b95e773f2f0ba084f68f3b Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 09:04:07 -0400 Subject: [PATCH 21/44] update --- mods/scripts/traefik/traefik_menu.sh | 95 +++++++++++++--------------- 1 file changed, 43 insertions(+), 52 deletions(-) diff --git a/mods/scripts/traefik/traefik_menu.sh b/mods/scripts/traefik/traefik_menu.sh index 13ee0c013..6a604ee5a 100644 --- a/mods/scripts/traefik/traefik_menu.sh +++ b/mods/scripts/traefik/traefik_menu.sh @@ -7,7 +7,6 @@ RED="\033[0;31m" YELLOW="\033[0;33m" BLUE="\033[0;34m" MAGENTA="\033[0;35m" -BOLD="\033[1m" NC="\033[0m" # No color # Configuration file path for storing DNS provider and domain details @@ -16,23 +15,23 @@ CONFIG_FILE="/pg/config/dns_provider.cfg" # Function to check if Traefik is deployed check_traefik_status() { if docker ps --filter "name=traefik" --format '{{.Names}}' | grep -q 'traefik'; then - traefik_status="${GREEN}${BOLD}[Deployed]${NC}" + traefik_status="${GREEN}[Deployed]${NC}" else - traefik_status="${RED}${BOLD}[Not Deployed]${NC}" + traefik_status="${RED}[Not Deployed]${NC}" fi } -# Function to check if the Let's Encrypt email is set -check_email_status() { - if grep -q "^letsencrypt_email=" "$CONFIG_FILE"; then - letsencrypt_email=$(grep "^letsencrypt_email=" "$CONFIG_FILE" | cut -d'=' -f2) - if [[ -z "$letsencrypt_email" || "$letsencrypt_email" == "notset" ]]; then - email_status="${RED}${BOLD}Not Set${NC}" +# Function to display the currently configured domain +check_domain_status() { + if grep -q "^domain_name=" "$CONFIG_FILE"; then + domain_name=$(grep "^domain_name=" "$CONFIG_FILE" | cut -d'=' -f2) + if [[ -z "$domain_name" ]]; then + domain_status="${RED}Not Set${NC}" else - email_status="${GREEN}${BOLD}Set${NC}" + domain_status="${GREEN}${domain_name}${NC}" fi else - email_status="${RED}${BOLD}Not Set${NC}" + domain_status="${RED}Not Set${NC}" fi } @@ -49,13 +48,13 @@ test_cloudflare_credentials() { fi } -# Function to validate email format -validate_email() { - local email="$1" - if [[ "$email" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ ]]; then - return 0 # Email is valid +# Function to validate domain name +validate_domain() { + local domain="$1" + if [[ "$domain" =~ ^[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ ]]; then + return 0 # Valid domain else - return 1 # Email is invalid + return 1 # Invalid domain fi } @@ -97,22 +96,18 @@ setup_dns_provider() { while true; do clear check_traefik_status - check_email_status + check_domain_status # Fetch the current domain status - echo -e "${CYAN}${BOLD}PG: CloudFlare Traefik Interface ${traefik_status}${NC}" + echo -e "${CYAN}PG: CloudFlare Traefik Interface ${traefik_status}${NC}" echo "" + echo -e "[${BLUE}${BOLD}Domain${NC}] Current Domain: ${domain_status}" echo -e "[${CYAN}${BOLD}C${NC}] CF Information" - echo -e "[${MAGENTA}${BOLD}E${NC}] Notification E-Mail Address (${email_status})" - - # Show the Deploy Traefik option only if email is set - if [[ "$email_status" == "${GREEN}${BOLD}Set${NC}" ]]; then - echo -e "[${BLUE}${BOLD}D${NC}] Deploy Traefik" - fi - + echo -e "[${MAGENTA}${BOLD}E${NC}] E-Mail for Let's Encrypt" + echo -e "[${BLUE}${BOLD}D${NC}] Deploy Traefik" echo -e "[${RED}${BOLD}Z${NC}] Exit" echo "" - read -p "Select an Option > " choice + read -p "Enter your choice: " choice case $choice in [Cc]) if docker ps --filter "name=traefik" --format '{{.Names}}' | grep -q 'traefik'; then @@ -127,11 +122,9 @@ setup_dns_provider() { set_email ;; [Dd]) - if [[ "$email_status" == "${GREEN}${BOLD}Set${NC}" ]]; then - bash /pg/scripts/traefik/traefik_deploy.sh - echo "" - read -p "Press Enter to continue..." - fi + bash /pg/scripts/traefik_deploy.sh + echo "" + read -p "Press Enter to continue..." ;; [Zz]) exit 0 @@ -160,13 +153,20 @@ configure_provider() { # Test the credentials before saving echo -e "${YELLOW}Testing Cloudflare credentials...${NC}" if test_cloudflare_credentials; then - read -p "Enter the domain name to use (e.g., example.com): " domain_name - echo "provider=cloudflare" > "$CONFIG_FILE" - echo "email=$cf_email" >> "$CONFIG_FILE" - echo "api_key=$api_key" >> "$CONFIG_FILE" - echo "domain_name=$domain_name" >> "$CONFIG_FILE" - echo "" - echo -e "${GREEN}Cloudflare DNS provider and domain have been configured successfully.${NC}" + while true; do + read -p "Enter the domain name to use (e.g., example.com): " domain_name + if validate_domain "$domain_name"; then + echo "provider=cloudflare" > "$CONFIG_FILE" + echo "email=$cf_email" >> "$CONFIG_FILE" + echo "api_key=$api_key" >> "$CONFIG_FILE" + echo "domain_name=$domain_name" >> "$CONFIG_FILE" + echo "" + echo -e "${GREEN}Cloudflare DNS provider and domain have been configured successfully.${NC}" + break + else + echo -e "${RED}Invalid domain name. Please enter a valid domain (e.g., example.com).${NC}" + fi + done else # Blank out all information in the config file if credentials are invalid echo "" > "$CONFIG_FILE" @@ -180,19 +180,10 @@ configure_provider() { # Function to set email for Let's Encrypt set_email() { - while true; do - read -p "Enter your email for Let's Encrypt notifications: " letsencrypt_email - - # Validate email format - if validate_email "$letsencrypt_email"; then - echo "letsencrypt_email=$letsencrypt_email" >> "$CONFIG_FILE" - echo -e "${GREEN}Email has been configured successfully.${NC}" - read -p "Press Enter to continue..." - break - else - echo -e "${RED}Invalid email format. Please enter a valid email (e.g., user@example.com).${NC}" - fi - done + read -p "Enter your email for Let's Encrypt notifications: " letsencrypt_email + echo "letsencrypt_email=$letsencrypt_email" >> "$CONFIG_FILE" + echo -e "${GREEN}Email has been configured successfully.${NC}" + read -p "Press Enter to continue..." } # Execute the setup function From 084e2dcf623c818832e92e4ab701559f086e8c81 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 09:08:28 -0400 Subject: [PATCH 22/44] update --- mods/scripts/traefik/traefik_menu.sh | 95 +++++++++++++++------------- 1 file changed, 52 insertions(+), 43 deletions(-) diff --git a/mods/scripts/traefik/traefik_menu.sh b/mods/scripts/traefik/traefik_menu.sh index 6a604ee5a..13ee0c013 100644 --- a/mods/scripts/traefik/traefik_menu.sh +++ b/mods/scripts/traefik/traefik_menu.sh @@ -7,6 +7,7 @@ RED="\033[0;31m" YELLOW="\033[0;33m" BLUE="\033[0;34m" MAGENTA="\033[0;35m" +BOLD="\033[1m" NC="\033[0m" # No color # Configuration file path for storing DNS provider and domain details @@ -15,23 +16,23 @@ CONFIG_FILE="/pg/config/dns_provider.cfg" # Function to check if Traefik is deployed check_traefik_status() { if docker ps --filter "name=traefik" --format '{{.Names}}' | grep -q 'traefik'; then - traefik_status="${GREEN}[Deployed]${NC}" + traefik_status="${GREEN}${BOLD}[Deployed]${NC}" else - traefik_status="${RED}[Not Deployed]${NC}" + traefik_status="${RED}${BOLD}[Not Deployed]${NC}" fi } -# Function to display the currently configured domain -check_domain_status() { - if grep -q "^domain_name=" "$CONFIG_FILE"; then - domain_name=$(grep "^domain_name=" "$CONFIG_FILE" | cut -d'=' -f2) - if [[ -z "$domain_name" ]]; then - domain_status="${RED}Not Set${NC}" +# Function to check if the Let's Encrypt email is set +check_email_status() { + if grep -q "^letsencrypt_email=" "$CONFIG_FILE"; then + letsencrypt_email=$(grep "^letsencrypt_email=" "$CONFIG_FILE" | cut -d'=' -f2) + if [[ -z "$letsencrypt_email" || "$letsencrypt_email" == "notset" ]]; then + email_status="${RED}${BOLD}Not Set${NC}" else - domain_status="${GREEN}${domain_name}${NC}" + email_status="${GREEN}${BOLD}Set${NC}" fi else - domain_status="${RED}Not Set${NC}" + email_status="${RED}${BOLD}Not Set${NC}" fi } @@ -48,13 +49,13 @@ test_cloudflare_credentials() { fi } -# Function to validate domain name -validate_domain() { - local domain="$1" - if [[ "$domain" =~ ^[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ ]]; then - return 0 # Valid domain +# Function to validate email format +validate_email() { + local email="$1" + if [[ "$email" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ ]]; then + return 0 # Email is valid else - return 1 # Invalid domain + return 1 # Email is invalid fi } @@ -96,18 +97,22 @@ setup_dns_provider() { while true; do clear check_traefik_status - check_domain_status # Fetch the current domain status + check_email_status - echo -e "${CYAN}PG: CloudFlare Traefik Interface ${traefik_status}${NC}" + echo -e "${CYAN}${BOLD}PG: CloudFlare Traefik Interface ${traefik_status}${NC}" echo "" - echo -e "[${BLUE}${BOLD}Domain${NC}] Current Domain: ${domain_status}" echo -e "[${CYAN}${BOLD}C${NC}] CF Information" - echo -e "[${MAGENTA}${BOLD}E${NC}] E-Mail for Let's Encrypt" - echo -e "[${BLUE}${BOLD}D${NC}] Deploy Traefik" + echo -e "[${MAGENTA}${BOLD}E${NC}] Notification E-Mail Address (${email_status})" + + # Show the Deploy Traefik option only if email is set + if [[ "$email_status" == "${GREEN}${BOLD}Set${NC}" ]]; then + echo -e "[${BLUE}${BOLD}D${NC}] Deploy Traefik" + fi + echo -e "[${RED}${BOLD}Z${NC}] Exit" echo "" - read -p "Enter your choice: " choice + read -p "Select an Option > " choice case $choice in [Cc]) if docker ps --filter "name=traefik" --format '{{.Names}}' | grep -q 'traefik'; then @@ -122,9 +127,11 @@ setup_dns_provider() { set_email ;; [Dd]) - bash /pg/scripts/traefik_deploy.sh - echo "" - read -p "Press Enter to continue..." + if [[ "$email_status" == "${GREEN}${BOLD}Set${NC}" ]]; then + bash /pg/scripts/traefik/traefik_deploy.sh + echo "" + read -p "Press Enter to continue..." + fi ;; [Zz]) exit 0 @@ -153,20 +160,13 @@ configure_provider() { # Test the credentials before saving echo -e "${YELLOW}Testing Cloudflare credentials...${NC}" if test_cloudflare_credentials; then - while true; do - read -p "Enter the domain name to use (e.g., example.com): " domain_name - if validate_domain "$domain_name"; then - echo "provider=cloudflare" > "$CONFIG_FILE" - echo "email=$cf_email" >> "$CONFIG_FILE" - echo "api_key=$api_key" >> "$CONFIG_FILE" - echo "domain_name=$domain_name" >> "$CONFIG_FILE" - echo "" - echo -e "${GREEN}Cloudflare DNS provider and domain have been configured successfully.${NC}" - break - else - echo -e "${RED}Invalid domain name. Please enter a valid domain (e.g., example.com).${NC}" - fi - done + read -p "Enter the domain name to use (e.g., example.com): " domain_name + echo "provider=cloudflare" > "$CONFIG_FILE" + echo "email=$cf_email" >> "$CONFIG_FILE" + echo "api_key=$api_key" >> "$CONFIG_FILE" + echo "domain_name=$domain_name" >> "$CONFIG_FILE" + echo "" + echo -e "${GREEN}Cloudflare DNS provider and domain have been configured successfully.${NC}" else # Blank out all information in the config file if credentials are invalid echo "" > "$CONFIG_FILE" @@ -180,10 +180,19 @@ configure_provider() { # Function to set email for Let's Encrypt set_email() { - read -p "Enter your email for Let's Encrypt notifications: " letsencrypt_email - echo "letsencrypt_email=$letsencrypt_email" >> "$CONFIG_FILE" - echo -e "${GREEN}Email has been configured successfully.${NC}" - read -p "Press Enter to continue..." + while true; do + read -p "Enter your email for Let's Encrypt notifications: " letsencrypt_email + + # Validate email format + if validate_email "$letsencrypt_email"; then + echo "letsencrypt_email=$letsencrypt_email" >> "$CONFIG_FILE" + echo -e "${GREEN}Email has been configured successfully.${NC}" + read -p "Press Enter to continue..." + break + else + echo -e "${RED}Invalid email format. Please enter a valid email (e.g., user@example.com).${NC}" + fi + done } # Execute the setup function From 9b2d2c603927b267707568bedb00b47c72aa19ef Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 09:11:24 -0400 Subject: [PATCH 23/44] update --- mods/scripts/traefik/traefik_menu.sh | 50 ++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/mods/scripts/traefik/traefik_menu.sh b/mods/scripts/traefik/traefik_menu.sh index 13ee0c013..fddc29733 100644 --- a/mods/scripts/traefik/traefik_menu.sh +++ b/mods/scripts/traefik/traefik_menu.sh @@ -36,6 +36,20 @@ check_email_status() { fi } +# Function to check if the domain is set +check_domain_status() { + if grep -q "^domain_name=" "$CONFIG_FILE"; then + domain_name=$(grep "^domain_name=" "$CONFIG_FILE" | cut -d'=' -f2) + if [[ -z "$domain_name" ]]; then + domain_status="${RED}${BOLD}Not Set${NC}" + else + domain_status="${GREEN}${BOLD}${domain_name}${NC}" + fi + else + domain_status="${RED}${BOLD}Not Set${NC}" + fi +} + # Function to test Cloudflare credentials test_cloudflare_credentials() { response=$(curl -s -X GET "https://api.cloudflare.com/client/v4/user/tokens/verify" \ @@ -59,6 +73,16 @@ validate_email() { fi } +# Function to validate domain format +validate_domain() { + local domain="$1" + if [[ "$domain" =~ ^[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ ]]; then + return 0 # Domain is valid + else + return 1 # Domain is invalid + fi +} + # Function to handle Traefik stop and removal warning with PINs warn_traefik_removal() { echo "" @@ -98,9 +122,11 @@ setup_dns_provider() { clear check_traefik_status check_email_status + check_domain_status echo -e "${CYAN}${BOLD}PG: CloudFlare Traefik Interface ${traefik_status}${NC}" echo "" + echo -e "[${GREEN}${BOLD}A${NC}] Domain Name (${domain_status})" echo -e "[${CYAN}${BOLD}C${NC}] CF Information" echo -e "[${MAGENTA}${BOLD}E${NC}] Notification E-Mail Address (${email_status})" @@ -114,6 +140,9 @@ setup_dns_provider() { read -p "Select an Option > " choice case $choice in + [Aa]) + set_domain + ;; [Cc]) if docker ps --filter "name=traefik" --format '{{.Names}}' | grep -q 'traefik'; then warn_traefik_removal @@ -160,13 +189,11 @@ configure_provider() { # Test the credentials before saving echo -e "${YELLOW}Testing Cloudflare credentials...${NC}" if test_cloudflare_credentials; then - read -p "Enter the domain name to use (e.g., example.com): " domain_name echo "provider=cloudflare" > "$CONFIG_FILE" echo "email=$cf_email" >> "$CONFIG_FILE" echo "api_key=$api_key" >> "$CONFIG_FILE" - echo "domain_name=$domain_name" >> "$CONFIG_FILE" echo "" - echo -e "${GREEN}Cloudflare DNS provider and domain have been configured successfully.${NC}" + echo -e "${GREEN}Cloudflare credentials have been configured successfully.${NC}" else # Blank out all information in the config file if credentials are invalid echo "" > "$CONFIG_FILE" @@ -178,6 +205,23 @@ configure_provider() { read -p "Press [ENTER] to continue..." } +# Function to set domain name +set_domain() { + while true; do + read -p "Enter the domain name to use (e.g., example.com): " domain_name + + # Validate domain format + if validate_domain "$domain_name"; then + echo "domain_name=$domain_name" >> "$CONFIG_FILE" + echo -e "${GREEN}Domain has been configured successfully.${NC}" + read -p "Press Enter to continue..." + break + else + echo -e "${RED}Invalid domain name. Please enter a valid domain (e.g., example.com).${NC}" + fi + done +} + # Function to set email for Let's Encrypt set_email() { while true; do From d8937353cca6ab260c521c302a3c53ebdba79979 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 09:16:28 -0400 Subject: [PATCH 24/44] update --- mods/scripts/traefik/traefik_menu.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mods/scripts/traefik/traefik_menu.sh b/mods/scripts/traefik/traefik_menu.sh index fddc29733..6a618e740 100644 --- a/mods/scripts/traefik/traefik_menu.sh +++ b/mods/scripts/traefik/traefik_menu.sh @@ -212,6 +212,8 @@ set_domain() { # Validate domain format if validate_domain "$domain_name"; then + # Remove any existing domain_name entry + sed -i '/^domain_name=/d' "$CONFIG_FILE" echo "domain_name=$domain_name" >> "$CONFIG_FILE" echo -e "${GREEN}Domain has been configured successfully.${NC}" read -p "Press Enter to continue..." From df2e733195dc80ecee6d581370ef5071fd9b8687 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 09:21:31 -0400 Subject: [PATCH 25/44] update --- mods/scripts/domain_menu.sh | 2 +- .../traefik/{traefik_deploy.sh => deploy.sh} | 0 .../traefik/{traefik_menu.sh => functions} | 179 ++++++------------ mods/scripts/traefik/menu.sh | 67 +++++++ 4 files changed, 121 insertions(+), 127 deletions(-) rename mods/scripts/traefik/{traefik_deploy.sh => deploy.sh} (100%) rename mods/scripts/traefik/{traefik_menu.sh => functions} (64%) create mode 100644 mods/scripts/traefik/menu.sh diff --git a/mods/scripts/domain_menu.sh b/mods/scripts/domain_menu.sh index d4ebb6339..0774fbbe4 100644 --- a/mods/scripts/domain_menu.sh +++ b/mods/scripts/domain_menu.sh @@ -52,7 +52,7 @@ while true; do bash /pg/scripts/cloudflare/tunnel.sh ;; [Bb]) - bash /pg/scripts/traefik/traefik_menu.sh + bash /pg/scripts/traefik/menu.sh ;; [Pp]) bash /pg/scripts/default_ports.sh diff --git a/mods/scripts/traefik/traefik_deploy.sh b/mods/scripts/traefik/deploy.sh similarity index 100% rename from mods/scripts/traefik/traefik_deploy.sh rename to mods/scripts/traefik/deploy.sh diff --git a/mods/scripts/traefik/traefik_menu.sh b/mods/scripts/traefik/functions similarity index 64% rename from mods/scripts/traefik/traefik_menu.sh rename to mods/scripts/traefik/functions index 6a618e740..008a2cdd4 100644 --- a/mods/scripts/traefik/traefik_menu.sh +++ b/mods/scripts/traefik/functions @@ -10,9 +10,17 @@ MAGENTA="\033[0;35m" BOLD="\033[1m" NC="\033[0m" # No color -# Configuration file path for storing DNS provider and domain details +# Configuration file path CONFIG_FILE="/pg/config/dns_provider.cfg" +# Ensure config file exists +ensure_config_file() { + if [[ ! -f "$CONFIG_FILE" ]]; then + mkdir -p "$(dirname "$CONFIG_FILE")" + touch "$CONFIG_FILE" + fi +} + # Function to check if Traefik is deployed check_traefik_status() { if docker ps --filter "name=traefik" --format '{{.Names}}' | grep -q 'traefik'; then @@ -50,129 +58,6 @@ check_domain_status() { fi } -# Function to test Cloudflare credentials -test_cloudflare_credentials() { - response=$(curl -s -X GET "https://api.cloudflare.com/client/v4/user/tokens/verify" \ - -H "Authorization: Bearer $api_key" \ - -H "Content-Type: application/json") - - if echo "$response" | grep -q "valid and active"; then - return 0 # Valid credentials - else - return 1 # Invalid credentials - fi -} - -# Function to validate email format -validate_email() { - local email="$1" - if [[ "$email" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ ]]; then - return 0 # Email is valid - else - return 1 # Email is invalid - fi -} - -# Function to validate domain format -validate_domain() { - local domain="$1" - if [[ "$domain" =~ ^[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ ]]; then - return 0 # Domain is valid - else - return 1 # Domain is invalid - fi -} - -# Function to handle Traefik stop and removal warning with PINs -warn_traefik_removal() { - echo "" - echo -e "${RED}Warning: Changing the Cloudflare credentials will stop and remove Traefik.${NC}" - echo "" - - # Generate two random 4-digit PINs - proceed_pin=$(shuf -i 1000-9999 -n 1) - cancel_pin=$(shuf -i 1000-9999 -n 1) - - # Display the PINs to the user - echo -e "If you want to proceed and remove Traefik, enter: ${RED}${proceed_pin}${NC}" - echo -e "If you do NOT want to proceed, enter: ${GREEN}${cancel_pin}${NC}" - echo "" - - # Read user input for PIN - read -p "Enter your choice (PIN): " user_pin - - # Check user's choice - if [[ "$user_pin" == "$proceed_pin" ]]; then - echo -e "${RED}Stopping and removing Traefik...${NC}" - docker stop traefik >/dev/null 2>&1 - docker rm traefik >/dev/null 2>&1 - return 0 # Proceed with changing credentials - elif [[ "$user_pin" == "$cancel_pin" ]]; then - echo -e "${GREEN}Operation canceled. Traefik will not be stopped or removed.${NC}" - return 1 # Do not proceed - else - echo -e "${RED}Invalid PIN entered. Operation aborted.${NC}" - return 1 # Invalid entry, cancel operation - fi -} - -# Function to setup DNS provider -setup_dns_provider() { - while true; do - clear - check_traefik_status - check_email_status - check_domain_status - - echo -e "${CYAN}${BOLD}PG: CloudFlare Traefik Interface ${traefik_status}${NC}" - echo "" - echo -e "[${GREEN}${BOLD}A${NC}] Domain Name (${domain_status})" - echo -e "[${CYAN}${BOLD}C${NC}] CF Information" - echo -e "[${MAGENTA}${BOLD}E${NC}] Notification E-Mail Address (${email_status})" - - # Show the Deploy Traefik option only if email is set - if [[ "$email_status" == "${GREEN}${BOLD}Set${NC}" ]]; then - echo -e "[${BLUE}${BOLD}D${NC}] Deploy Traefik" - fi - - echo -e "[${RED}${BOLD}Z${NC}] Exit" - echo "" - - read -p "Select an Option > " choice - case $choice in - [Aa]) - set_domain - ;; - [Cc]) - if docker ps --filter "name=traefik" --format '{{.Names}}' | grep -q 'traefik'; then - warn_traefik_removal - if [[ $? -eq 1 ]]; then - continue # Skip changing credentials if the user canceled - fi - fi - configure_provider - ;; - [Ee]) - set_email - ;; - [Dd]) - if [[ "$email_status" == "${GREEN}${BOLD}Set${NC}" ]]; then - bash /pg/scripts/traefik/traefik_deploy.sh - echo "" - read -p "Press Enter to continue..." - fi - ;; - [Zz]) - exit 0 - ;; - *) - echo -e "${RED}Invalid option. Please try again.${NC}" - read -p "Press Enter to continue..." - ;; - esac - done -} - # Function to configure DNS provider (Cloudflare only) configure_provider() { echo "" @@ -224,6 +109,16 @@ set_domain() { done } +# Function to validate domain format +validate_domain() { + local domain="$1" + if [[ "$domain" =~ ^[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ ]]; then + return 0 # Domain is valid + else + return 1 # Domain is invalid + fi +} + # Function to set email for Let's Encrypt set_email() { while true; do @@ -241,5 +136,37 @@ set_email() { done } -# Execute the setup function -setup_dns_provider +# Function to validate email format +validate_email() { + local email="$1" + if [[ "$email" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ ]]; then + return 0 # Email is valid + else + return 1 # Email is invalid + fi +} + +# Function to test Cloudflare credentials +test_cloudflare_credentials() { + response=$(curl -s -X GET "https://api.cloudflare.com/client/v4/user/tokens/verify" \ + -H "Authorization: Bearer $api_key" \ + -H "Content-Type: application/json") + + if echo "$response" | grep -q "valid and active"; then + return 0 # Valid credentials + else + return 1 # Invalid credentials + fi +} + +# Function to handle Traefik stop and removal warning with PINs +warn_traefik_removal() { + echo "" + echo -e "${RED}Warning: Changing the Cloudflare credentials will stop and remove Traefik.${NC}" + echo "" + + # Generate two random 4-digit PINs + proceed_pin=$(shuf -i 1000-9999 -n 1) + cancel_pin=$(shuf -i 1000-9999 -n 1) + + # Display the PINs to the user diff --git a/mods/scripts/traefik/menu.sh b/mods/scripts/traefik/menu.sh new file mode 100644 index 000000000..b3bf200ac --- /dev/null +++ b/mods/scripts/traefik/menu.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +# Source the functions from the separate script +source /pg/scripts/traefik/functions.sh + +# Ensure the config file exists, create if missing +ensure_config_file + +# Function to display the main menu +setup_dns_provider() { + while true; do + clear + check_traefik_status + check_email_status + check_domain_status + + echo -e "${CYAN}${BOLD}PG: CloudFlare Traefik Interface ${traefik_status}${NC}" + echo "" + echo -e "[${GREEN}${BOLD}A${NC}] Domain Name (${domain_status})" + echo -e "[${CYAN}${BOLD}C${NC}] CF Information" + echo -e "[${MAGENTA}${BOLD}E${NC}] Notification E-Mail Address (${email_status})" + + # Show the Deploy Traefik option only if email is set + if [[ "$email_status" == "${GREEN}${BOLD}Set${NC}" ]]; then + echo -e "[${BLUE}${BOLD}D${NC}] Deploy Traefik" + fi + + echo -e "[${RED}${BOLD}Z${NC}] Exit" + echo "" + + read -p "Select an Option > " choice + case $choice in + [Aa]) + set_domain + ;; + [Cc]) + if docker ps --filter "name=traefik" --format '{{.Names}}' | grep -q 'traefik'; then + warn_traefik_removal + if [[ $? -eq 1 ]]; then + continue # Skip changing credentials if the user canceled + fi + fi + configure_provider + ;; + [Ee]) + set_email + ;; + [Dd]) + if [[ "$email_status" == "${GREEN}${BOLD}Set${NC}" ]]; then + bash /pg/scripts/traefik/deploy.sh + echo "" + read -p "Press Enter to continue..." + fi + ;; + [Zz]) + exit 0 + ;; + *) + echo -e "${RED}Invalid option. Please try again.${NC}" + read -p "Press Enter to continue..." + ;; + esac + done +} + +# Run the menu +setup_dns_provider From e818fa15bb1e6e6fc306403b774c19e237bae16c Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 09:23:16 -0400 Subject: [PATCH 26/44] update --- mods/scripts/traefik/functions | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/mods/scripts/traefik/functions b/mods/scripts/traefik/functions index 008a2cdd4..c5d513912 100644 --- a/mods/scripts/traefik/functions +++ b/mods/scripts/traefik/functions @@ -170,3 +170,24 @@ warn_traefik_removal() { cancel_pin=$(shuf -i 1000-9999 -n 1) # Display the PINs to the user + echo -e "If you want to proceed and remove Traefik, enter: ${RED}${proceed_pin}${NC}" + echo -e "If you do NOT want to proceed, enter: ${GREEN}${cancel_pin}${NC}" + echo "" + + # Read user input for PIN + read -p "Enter your choice (PIN): " user_pin + + # Check user's choice + if [[ "$user_pin" == "$proceed_pin" ]]; then + echo -e "${RED}Stopping and removing Traefik...${NC}" + docker stop traefik >/dev/null 2>&1 + docker rm traefik >/dev/null 2>&1 + return 0 # Proceed with changing credentials + elif [[ "$user_pin" == "$cancel_pin" ]]; then + echo -e "${GREEN}Operation canceled. Traefik will not be stopped or removed.${NC}" + return 1 # Do not proceed + else + echo -e "${RED}Invalid PIN entered. Operation aborted.${NC}" + return 1 # Invalid entry, cancel operation + fi +} From 1d5eb39f8ced018c567ab2d2c626ffa231443633 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 09:24:48 -0400 Subject: [PATCH 27/44] update --- mods/scripts/traefik/{functions => functions.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename mods/scripts/traefik/{functions => functions.sh} (100%) diff --git a/mods/scripts/traefik/functions b/mods/scripts/traefik/functions.sh similarity index 100% rename from mods/scripts/traefik/functions rename to mods/scripts/traefik/functions.sh From 61bff96f2b1e07c30e3311c445aebf5ac74b7373 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 09:33:36 -0400 Subject: [PATCH 28/44] update --- mods/scripts/traefik/menu.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mods/scripts/traefik/menu.sh b/mods/scripts/traefik/menu.sh index b3bf200ac..abe8c73a1 100644 --- a/mods/scripts/traefik/menu.sh +++ b/mods/scripts/traefik/menu.sh @@ -13,15 +13,16 @@ setup_dns_provider() { check_traefik_status check_email_status check_domain_status + check_provider_status # Assuming you have a function to check if Cloudflare is properly configured echo -e "${CYAN}${BOLD}PG: CloudFlare Traefik Interface ${traefik_status}${NC}" echo "" - echo -e "[${GREEN}${BOLD}A${NC}] Domain Name (${domain_status})" - echo -e "[${CYAN}${BOLD}C${NC}] CF Information" + echo -e "[${GREEN}${BOLD}A${NC}] Domain Name (${GREEN}${BOLD}Set${NC})" # Always show "Set" in green for A + echo -e "[${CYAN}${BOLD}C${NC}] CF Information (${provider_status})" # Will be either [Set] or [Not Set] echo -e "[${MAGENTA}${BOLD}E${NC}] Notification E-Mail Address (${email_status})" - # Show the Deploy Traefik option only if email is set - if [[ "$email_status" == "${GREEN}${BOLD}Set${NC}" ]]; then + # Show the Deploy Traefik option only if all conditions are met + if [[ "$domain_status" == "${GREEN}${BOLD}Set${NC}" && "$email_status" == "${GREEN}${BOLD}Set${NC}" && "$provider_status" == "${GREEN}${BOLD}Set${NC}" ]]; then echo -e "[${BLUE}${BOLD}D${NC}] Deploy Traefik" fi @@ -46,7 +47,7 @@ setup_dns_provider() { set_email ;; [Dd]) - if [[ "$email_status" == "${GREEN}${BOLD}Set${NC}" ]]; then + if [[ "$domain_status" == "${GREEN}${BOLD}Set${NC}" && "$email_status" == "${GREEN}${BOLD}Set${NC}" && "$provider_status" == "${GREEN}${BOLD}Set${NC}" ]]; then bash /pg/scripts/traefik/deploy.sh echo "" read -p "Press Enter to continue..." From 58ce3e7a3c5e979885c1c1f074ad261bb244c90c Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 09:37:23 -0400 Subject: [PATCH 29/44] update --- mods/scripts/traefik/functions.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/mods/scripts/traefik/functions.sh b/mods/scripts/traefik/functions.sh index c5d513912..ffe653bd3 100644 --- a/mods/scripts/traefik/functions.sh +++ b/mods/scripts/traefik/functions.sh @@ -51,13 +51,27 @@ check_domain_status() { if [[ -z "$domain_name" ]]; then domain_status="${RED}${BOLD}Not Set${NC}" else - domain_status="${GREEN}${BOLD}${domain_name}${NC}" + domain_status="${GREEN}${BOLD}Set${NC}" # Display Set in green fi else domain_status="${RED}${BOLD}Not Set${NC}" fi } +# Function to check if the Cloudflare credentials are properly set +check_provider_status() { + if grep -q "^api_key=" "$CONFIG_FILE" && grep -q "^email=" "$CONFIG_FILE"; then + api_key=$(grep "^api_key=" "$CONFIG_FILE" | cut -d'=' -f2) + if [[ -z "$api_key" || "$api_key" == "notset" ]]; then + provider_status="${RED}${BOLD}Not Set${NC}" + else + provider_status="${GREEN}${BOLD}Set${NC}" + fi + else + provider_status="${RED}${BOLD}Not Set${NC}" + fi +} + # Function to configure DNS provider (Cloudflare only) configure_provider() { echo "" From 2af74b48ef64ed4ead0caad03678558c0e4bea47 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 09:43:14 -0400 Subject: [PATCH 30/44] update --- mods/scripts/traefik/functions.sh | 9 +++++---- mods/scripts/traefik/menu.sh | 12 ++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/mods/scripts/traefik/functions.sh b/mods/scripts/traefik/functions.sh index ffe653bd3..5860d80a9 100644 --- a/mods/scripts/traefik/functions.sh +++ b/mods/scripts/traefik/functions.sh @@ -48,13 +48,14 @@ check_email_status() { check_domain_status() { if grep -q "^domain_name=" "$CONFIG_FILE"; then domain_name=$(grep "^domain_name=" "$CONFIG_FILE" | cut -d'=' -f2) - if [[ -z "$domain_name" ]]; then - domain_status="${RED}${BOLD}Not Set${NC}" - else + # Check if the domain_name is not empty and matches the domain format + if [[ -n "$domain_name" && "$domain_name" =~ ^[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ ]]; then domain_status="${GREEN}${BOLD}Set${NC}" # Display Set in green + else + domain_status="${RED}${BOLD}Not Set${NC}" # Display Not Set in red if the value is invalid or empty fi else - domain_status="${RED}${BOLD}Not Set${NC}" + domain_status="${RED}${BOLD}Not Set${NC}" # Display Not Set in red if the key doesn't exist fi } diff --git a/mods/scripts/traefik/menu.sh b/mods/scripts/traefik/menu.sh index abe8c73a1..85a9ada29 100644 --- a/mods/scripts/traefik/menu.sh +++ b/mods/scripts/traefik/menu.sh @@ -12,13 +12,13 @@ setup_dns_provider() { clear check_traefik_status check_email_status - check_domain_status - check_provider_status # Assuming you have a function to check if Cloudflare is properly configured + check_domain_status # This will update domain_status + check_provider_status # Update Cloudflare status echo -e "${CYAN}${BOLD}PG: CloudFlare Traefik Interface ${traefik_status}${NC}" echo "" - echo -e "[${GREEN}${BOLD}A${NC}] Domain Name (${GREEN}${BOLD}Set${NC})" # Always show "Set" in green for A - echo -e "[${CYAN}${BOLD}C${NC}] CF Information (${provider_status})" # Will be either [Set] or [Not Set] + echo -e "[${GREEN}${BOLD}A${NC}] Domain Name (${domain_status})" # Domain status (Set or Not Set) + echo -e "[${CYAN}${BOLD}C${NC}] CF Information (${provider_status})" echo -e "[${MAGENTA}${BOLD}E${NC}] Notification E-Mail Address (${email_status})" # Show the Deploy Traefik option only if all conditions are met @@ -32,7 +32,7 @@ setup_dns_provider() { read -p "Select an Option > " choice case $choice in [Aa]) - set_domain + set_domain # This updates domain_name in the config ;; [Cc]) if docker ps --filter "name=traefik" --format '{{.Names}}' | grep -q 'traefik'; then @@ -44,7 +44,7 @@ setup_dns_provider() { configure_provider ;; [Ee]) - set_email + set_email # This updates letsencrypt_email in the config ;; [Dd]) if [[ "$domain_status" == "${GREEN}${BOLD}Set${NC}" && "$email_status" == "${GREEN}${BOLD}Set${NC}" && "$provider_status" == "${GREEN}${BOLD}Set${NC}" ]]; then From 78c9658bf8c67211d62145448692a436e64f129d Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 09:47:41 -0400 Subject: [PATCH 31/44] update --- mods/scripts/traefik/functions.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mods/scripts/traefik/functions.sh b/mods/scripts/traefik/functions.sh index 5860d80a9..5b73b363f 100644 --- a/mods/scripts/traefik/functions.sh +++ b/mods/scripts/traefik/functions.sh @@ -89,14 +89,16 @@ configure_provider() { # Test the credentials before saving echo -e "${YELLOW}Testing Cloudflare credentials...${NC}" if test_cloudflare_credentials; then + # Save credentials only if they are valid + sed -i '/^email=/d' "$CONFIG_FILE" # Remove previous email entry + sed -i '/^api_key=/d' "$CONFIG_FILE" # Remove previous api_key entry echo "provider=cloudflare" > "$CONFIG_FILE" echo "email=$cf_email" >> "$CONFIG_FILE" echo "api_key=$api_key" >> "$CONFIG_FILE" echo "" echo -e "${GREEN}Cloudflare credentials have been configured successfully.${NC}" else - # Blank out all information in the config file if credentials are invalid - echo "" > "$CONFIG_FILE" + # Do not modify the config file if credentials are invalid echo "" echo -e "${RED}CloudFlare Information is Incorrect and/or the API Key may not have the proper permissions.${NC}" echo "" @@ -141,6 +143,9 @@ set_email() { # Validate email format if validate_email "$letsencrypt_email"; then + # Remove any existing letsencrypt_email entry + sed -i '/^letsencrypt_email=/d' "$CONFIG_FILE" + # Add the new email to the config echo "letsencrypt_email=$letsencrypt_email" >> "$CONFIG_FILE" echo -e "${GREEN}Email has been configured successfully.${NC}" read -p "Press Enter to continue..." From 51976e4ff381919f6cdb4692850bc8ef7669e1f6 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 09:49:03 -0400 Subject: [PATCH 32/44] update --- mods/scripts/traefik/functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/scripts/traefik/functions.sh b/mods/scripts/traefik/functions.sh index 5b73b363f..92a68d501 100644 --- a/mods/scripts/traefik/functions.sh +++ b/mods/scripts/traefik/functions.sh @@ -81,7 +81,7 @@ configure_provider() { # Prompt for Cloudflare email and API key read -p "Enter your Cloudflare email: " cf_email - read -p "Enter your Cloudflare API key: " api_key + read -p "Enter your Cloudflare Zone API key: " api_key # Trim any leading/trailing whitespace from the API key api_key=$(echo "$api_key" | xargs) From 3e12187fb360ccaa9954620005cb95e785bafa2b Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 09:53:14 -0400 Subject: [PATCH 33/44] update --- mods/scripts/traefik/functions.sh | 50 +++++++++++++------------------ 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/mods/scripts/traefik/functions.sh b/mods/scripts/traefik/functions.sh index 92a68d501..6c0d800bb 100644 --- a/mods/scripts/traefik/functions.sh +++ b/mods/scripts/traefik/functions.sh @@ -81,7 +81,7 @@ configure_provider() { # Prompt for Cloudflare email and API key read -p "Enter your Cloudflare email: " cf_email - read -p "Enter your Cloudflare Zone API key: " api_key + read -p "Enter your Cloudflare API key: " api_key # Trim any leading/trailing whitespace from the API key api_key=$(echo "$api_key" | xargs) @@ -89,12 +89,19 @@ configure_provider() { # Test the credentials before saving echo -e "${YELLOW}Testing Cloudflare credentials...${NC}" if test_cloudflare_credentials; then - # Save credentials only if they are valid - sed -i '/^email=/d' "$CONFIG_FILE" # Remove previous email entry - sed -i '/^api_key=/d' "$CONFIG_FILE" # Remove previous api_key entry - echo "provider=cloudflare" > "$CONFIG_FILE" - echo "email=$cf_email" >> "$CONFIG_FILE" - echo "api_key=$api_key" >> "$CONFIG_FILE" + # Overwrite existing email and api_key entries in the config file + if grep -q "^email=" "$CONFIG_FILE"; then + sed -i "s/^email=.*/email=$cf_email/" "$CONFIG_FILE" + else + echo "email=$cf_email" >> "$CONFIG_FILE" + fi + + if grep -q "^api_key=" "$CONFIG_FILE"; then + sed -i "s/^api_key=.*/api_key=$api_key/" "$CONFIG_FILE" + else + echo "api_key=$api_key" >> "$CONFIG_FILE" + fi + echo "" echo -e "${GREEN}Cloudflare credentials have been configured successfully.${NC}" else @@ -107,25 +114,6 @@ configure_provider() { read -p "Press [ENTER] to continue..." } -# Function to set domain name -set_domain() { - while true; do - read -p "Enter the domain name to use (e.g., example.com): " domain_name - - # Validate domain format - if validate_domain "$domain_name"; then - # Remove any existing domain_name entry - sed -i '/^domain_name=/d' "$CONFIG_FILE" - echo "domain_name=$domain_name" >> "$CONFIG_FILE" - echo -e "${GREEN}Domain has been configured successfully.${NC}" - read -p "Press Enter to continue..." - break - else - echo -e "${RED}Invalid domain name. Please enter a valid domain (e.g., example.com).${NC}" - fi - done -} - # Function to validate domain format validate_domain() { local domain="$1" @@ -143,10 +131,12 @@ set_email() { # Validate email format if validate_email "$letsencrypt_email"; then - # Remove any existing letsencrypt_email entry - sed -i '/^letsencrypt_email=/d' "$CONFIG_FILE" - # Add the new email to the config - echo "letsencrypt_email=$letsencrypt_email" >> "$CONFIG_FILE" + # Overwrite the existing letsencrypt_email entry in the config + if grep -q "^letsencrypt_email=" "$CONFIG_FILE"; then + sed -i "s/^letsencrypt_email=.*/letsencrypt_email=$letsencrypt_email/" "$CONFIG_FILE" + else + echo "letsencrypt_email=$letsencrypt_email" >> "$CONFIG_FILE" + fi echo -e "${GREEN}Email has been configured successfully.${NC}" read -p "Press Enter to continue..." break From 7c6ddcd8fa5e4f42bcf8d4acf61add7a771a0911 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 09:55:08 -0400 Subject: [PATCH 34/44] update --- mods/scripts/traefik/functions.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/mods/scripts/traefik/functions.sh b/mods/scripts/traefik/functions.sh index 6c0d800bb..ecdfd7ffe 100644 --- a/mods/scripts/traefik/functions.sh +++ b/mods/scripts/traefik/functions.sh @@ -124,6 +124,29 @@ validate_domain() { fi } +# Function to set domain name +set_domain() { + while true; do + read -p "Enter the domain name to use (e.g., example.com): " domain_name + + # Validate domain format + if validate_domain "$domain_name"; then + # Overwrite the existing domain_name entry in the config + if grep -q "^domain_name=" "$CONFIG_FILE"; then + sed -i "s/^domain_name=.*/domain_name=$domain_name/" "$CONFIG_FILE" + else + echo "domain_name=$domain_name" >> "$CONFIG_FILE" + fi + echo -e "${GREEN}Domain has been configured successfully.${NC}" + read -p "Press Enter to continue..." + break + else + echo -e "${RED}Invalid domain name. Please enter a valid domain (e.g., example.com).${NC}" + fi + done +} + + # Function to set email for Let's Encrypt set_email() { while true; do From 542736acae6d56b3fe2228091a0e8c6cd0726542 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 10:18:55 -0400 Subject: [PATCH 35/44] update --- mods/scripts/apps/deploy.sh | 54 +++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/mods/scripts/apps/deploy.sh b/mods/scripts/apps/deploy.sh index 0a431b88f..8843286ab 100644 --- a/mods/scripts/apps/deploy.sh +++ b/mods/scripts/apps/deploy.sh @@ -11,6 +11,11 @@ NC="\033[0m" # No color app_name=$1 script_type=$2 # personal or official +# Configuration file paths +dns_provider_config="/pg/config/dns_provider.cfg" +app_config_official="/pg/config/${app_name}.cfg" +app_config_personal="/pg/personal_configs/${app_name}.cfg" + # Name of the Docker network to check or create network_name="plexguide" @@ -35,14 +40,56 @@ check_and_create_network() { # Function to source configuration and functions for the app appsourcing() { if [[ "$script_type" == "personal" ]]; then - source "/pg/personal_configs/${app_name}.cfg" + source "$app_config_personal" source "/pg/p_apps/${app_name}/${app_name}.functions" 2>/dev/null else - source "/pg/config/${app_name}.cfg" + source "$app_config_official" source "/pg/apps/${app_name}/${app_name}.functions" 2>/dev/null fi } +# Function to update traefik_domain in the app's config +update_traefik_domain() { + # Ensure dns_provider.cfg exists + if [[ ! -f "$dns_provider_config" ]]; then + mkdir -p "$(dirname "$dns_provider_config")" + touch "$dns_provider_config" + fi + + # Read domain_name from dns_provider.cfg + if grep -q "^domain_name=" "$dns_provider_config"; then + domain_name=$(grep "^domain_name=" "$dns_provider_config" | cut -d'=' -f2) + else + domain_name="" + fi + + # Set traefik_domain value based on domain_name + if [[ -z "$domain_name" ]]; then + # No domain set, use empty value + traefik_domain="traefik_domain=\"\"" + else + # Domain exists, use it in the traefik_domain + traefik_domain="traefik_domain=\"$domain_name\"" + fi + + # Update the app's configuration file + if [[ "$script_type" == "personal" ]]; then + # Overwrite traefik_domain in the personal config file + if grep -q "^traefik_domain=" "$app_config_personal"; then + sed -i "s/^traefik_domain=.*/$traefik_domain/" "$app_config_personal" + else + echo "$traefik_domain" >> "$app_config_personal" + fi + else + # Overwrite traefik_domain in the official config file + if grep -q "^traefik_domain=" "$app_config_official"; then + sed -i "s/^traefik_domain=.*/$traefik_domain/" "$app_config_official" + else + echo "$traefik_domain" >> "$app_config_official" + fi + fi +} + # Function: Deploys / Redploys App redeploy_app() { # Check if lspci is installed; detect NVIDIA graphics cards @@ -56,6 +103,9 @@ redeploy_app() { check_and_create_network echo "Deploying $app_name" + + # Update traefik_domain based on the domain_name in dns_provider.cfg + update_traefik_domain # Determine which support script to source if [[ "$script_type" == "personal" ]]; then From 45b6a2e6df25bc534442a901ad8ff48ff3f70ce6 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 10:36:12 -0400 Subject: [PATCH 36/44] update --- mods/scripts/traefik/deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/scripts/traefik/deploy.sh b/mods/scripts/traefik/deploy.sh index a12e1aaf1..9caee54e1 100644 --- a/mods/scripts/traefik/deploy.sh +++ b/mods/scripts/traefik/deploy.sh @@ -82,7 +82,7 @@ EOF - /pg/traefik/letsencrypt:/letsencrypt labels: - "traefik.enable=true" - - "traefik.http.routers.traefik.rule=Host(\`traefik.${domain_name}\`)" + - "traefik.http.routers.traefik.rule=Host(\'traefik.${domain_name}\')" - "traefik.http.routers.traefik.entrypoints=websecure" - "traefik.http.routers.traefik.tls.certresolver=mytlschallenge" - "traefik.http.routers.traefik.service=api@internal" From 65166101f44dfbf0a375a57915aefc586a585e14 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 10:48:17 -0400 Subject: [PATCH 37/44] update --- mods/scripts/.DS_Store | Bin 8196 -> 6148 bytes mods/scripts/traefik/deploy.sh | 4 +++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/scripts/.DS_Store b/mods/scripts/.DS_Store index d400eb87b27ab22baf7f222d6b642f65663ac344..4b73e5514da06df3efc7c82f9a88591b0fb0278d 100644 GIT binary patch delta 107 zcmZp1XfcprU|?W$DortDU=RQ@Ie-{Mvv5r;6q~50$jHAjU^g=(|70G4-<$0PUocH< tkXX#l!6C>DR0IS9+(5z=q<&-Jcjn3bGM*sa3``J{K!!7Hj^~-f3;_FP5%~ZB delta 145 zcmZoMXmOBWU|?W$DortDU;r^WfEYvza8E20o2aMAD6lbLH}hr%jz7$c**Q2SHn1=X zOy*(vEzHA^%#g+q&rrfp%8&T44YY4Uo&l1=XuV|CBY4p ga0MB>S&-v9^JIPz&&mEg92|@gI~g{|^UPre07)Ss-v9sr diff --git a/mods/scripts/traefik/deploy.sh b/mods/scripts/traefik/deploy.sh index 9caee54e1..7526a7855 100644 --- a/mods/scripts/traefik/deploy.sh +++ b/mods/scripts/traefik/deploy.sh @@ -88,9 +88,11 @@ EOF - "traefik.http.routers.traefik.service=api@internal" - "traefik.http.middlewares.traefik-auth.basicauth.users=${TRAEFIK_AUTH}" restart: unless-stopped + networks: + - plexguide networks: - host: + plexguide: external: true EOF From 60f347eb76f09a7bc4e696cce72b92842ca18914 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 10:49:06 -0400 Subject: [PATCH 38/44] update --- mods/scripts/traefik/deploy.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/mods/scripts/traefik/deploy.sh b/mods/scripts/traefik/deploy.sh index 7526a7855..8c740943e 100644 --- a/mods/scripts/traefik/deploy.sh +++ b/mods/scripts/traefik/deploy.sh @@ -53,7 +53,6 @@ services: image: traefik:latest container_name: traefik hostname: traefik - network_mode: host command: - "--api.insecure=true" - "--providers.docker=true" From fa5665425d0d00868c3374e8dda6e1e710dc18b0 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 10:59:28 -0400 Subject: [PATCH 39/44] update --- mods/scripts/traefik/deploy.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/mods/scripts/traefik/deploy.sh b/mods/scripts/traefik/deploy.sh index 8c740943e..09c87e3b1 100644 --- a/mods/scripts/traefik/deploy.sh +++ b/mods/scripts/traefik/deploy.sh @@ -53,6 +53,9 @@ services: image: traefik:latest container_name: traefik hostname: traefik + ports: + - "80:80" + - "443:443" command: - "--api.insecure=true" - "--providers.docker=true" @@ -66,22 +69,14 @@ services: - "--certificatesresolvers.mytlschallenge.acme.dnschallenge.provider=cloudflare" - "--certificatesresolvers.mytlschallenge.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53" - "--certificatesresolvers.mytlschallenge.acme.dnschallenge.delaybeforecheck=60" -EOF - - # Add Cloudflare-specific environment variable - cat <> $DOCKER_COMPOSE_FILE environment: - - CLOUDFLARE_DNS_API_TOKEN=$api_key -EOF - - # Finalize Docker Compose file - cat <> $DOCKER_COMPOSE_FILE + - CLOUDFLARE_DNS_API_TOKEN=${api_key} volumes: - /var/run/docker.sock:/var/run/docker.sock - /pg/traefik/letsencrypt:/letsencrypt labels: - "traefik.enable=true" - - "traefik.http.routers.traefik.rule=Host(\'traefik.${domain_name}\')" + - "traefik.http.routers.traefik.rule=Host(traefik.${domain_name}`)" - "traefik.http.routers.traefik.entrypoints=websecure" - "traefik.http.routers.traefik.tls.certresolver=mytlschallenge" - "traefik.http.routers.traefik.service=api@internal" From 7a815d51cf3eed44c416d6ef7baa33d010210e0a Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 11:05:20 -0400 Subject: [PATCH 40/44] update --- mods/scripts/traefik/deploy.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/mods/scripts/traefik/deploy.sh b/mods/scripts/traefik/deploy.sh index 09c87e3b1..ad753dc52 100644 --- a/mods/scripts/traefik/deploy.sh +++ b/mods/scripts/traefik/deploy.sh @@ -63,7 +63,6 @@ services: - "--entrypoints.websecure.address=:443" - "--entrypoints.web.http.redirections.entrypoint.to=websecure" - "--entrypoints.web.http.redirections.entrypoint.scheme=https" - - "--certificatesresolvers.mytlschallenge.acme.dnschallenge=true" - "--certificatesresolvers.mytlschallenge.acme.email=${letsencrypt_email}" - "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json" - "--certificatesresolvers.mytlschallenge.acme.dnschallenge.provider=cloudflare" From b61bbc0f148bb4437d425c302179c9cc04a6f72a Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 11:15:44 -0400 Subject: [PATCH 41/44] update --- mods/scripts/traefik/deploy.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mods/scripts/traefik/deploy.sh b/mods/scripts/traefik/deploy.sh index ad753dc52..d2f4dc578 100644 --- a/mods/scripts/traefik/deploy.sh +++ b/mods/scripts/traefik/deploy.sh @@ -53,9 +53,7 @@ services: image: traefik:latest container_name: traefik hostname: traefik - ports: - - "80:80" - - "443:443" + network_mode: host command: - "--api.insecure=true" - "--providers.docker=true" @@ -63,30 +61,32 @@ services: - "--entrypoints.websecure.address=:443" - "--entrypoints.web.http.redirections.entrypoint.to=websecure" - "--entrypoints.web.http.redirections.entrypoint.scheme=https" + - "--certificatesresolvers.mytlschallenge.acme.dnschallenge=true" - "--certificatesresolvers.mytlschallenge.acme.email=${letsencrypt_email}" - "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json" - "--certificatesresolvers.mytlschallenge.acme.dnschallenge.provider=cloudflare" - "--certificatesresolvers.mytlschallenge.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53" - "--certificatesresolvers.mytlschallenge.acme.dnschallenge.delaybeforecheck=60" +EOF + + # Add Cloudflare-specific environment variable + cat <> $DOCKER_COMPOSE_FILE environment: - - CLOUDFLARE_DNS_API_TOKEN=${api_key} + - CLOUDFLARE_DNS_API_TOKEN=$api_key +EOF + + # Finalize Docker Compose file + cat <> $DOCKER_COMPOSE_FILE volumes: - /var/run/docker.sock:/var/run/docker.sock - /pg/traefik/letsencrypt:/letsencrypt labels: - "traefik.enable=true" - - "traefik.http.routers.traefik.rule=Host(traefik.${domain_name}`)" - "traefik.http.routers.traefik.entrypoints=websecure" - "traefik.http.routers.traefik.tls.certresolver=mytlschallenge" - "traefik.http.routers.traefik.service=api@internal" - "traefik.http.middlewares.traefik-auth.basicauth.users=${TRAEFIK_AUTH}" restart: unless-stopped - networks: - - plexguide - -networks: - plexguide: - external: true EOF echo -e "${GREEN}Docker Compose file for Traefik has been created at $DOCKER_COMPOSE_FILE.${NC}" From e6281752b4631a17c7badb9aac861cf35960b38e Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 11:18:47 -0400 Subject: [PATCH 42/44] update --- mods/scripts/traefik/deploy.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/mods/scripts/traefik/deploy.sh b/mods/scripts/traefik/deploy.sh index d2f4dc578..4cee61ed5 100644 --- a/mods/scripts/traefik/deploy.sh +++ b/mods/scripts/traefik/deploy.sh @@ -67,16 +67,8 @@ services: - "--certificatesresolvers.mytlschallenge.acme.dnschallenge.provider=cloudflare" - "--certificatesresolvers.mytlschallenge.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53" - "--certificatesresolvers.mytlschallenge.acme.dnschallenge.delaybeforecheck=60" -EOF - - # Add Cloudflare-specific environment variable - cat <> $DOCKER_COMPOSE_FILE environment: - CLOUDFLARE_DNS_API_TOKEN=$api_key -EOF - - # Finalize Docker Compose file - cat <> $DOCKER_COMPOSE_FILE volumes: - /var/run/docker.sock:/var/run/docker.sock - /pg/traefik/letsencrypt:/letsencrypt @@ -95,5 +87,7 @@ EOF echo -e "${GREEN}Traefik has been deployed successfully.${NC}" } +chmod 600 /pg/traefik/acme.json + # Deploy Traefik with Cloudflare deploy_traefik \ No newline at end of file From 6a21b5ba76a2248856127c1225a4d539290e0e94 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 11:36:31 -0400 Subject: [PATCH 43/44] update --- mods/scripts/traefik/deploy.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mods/scripts/traefik/deploy.sh b/mods/scripts/traefik/deploy.sh index 4cee61ed5..8f4c68e40 100644 --- a/mods/scripts/traefik/deploy.sh +++ b/mods/scripts/traefik/deploy.sh @@ -42,7 +42,7 @@ deploy_traefik() { # Create the Docker Compose directory if it doesn't exist mkdir -p /pg/traefik - DOCKER_COMPOSE_FILE="/pg/traefik/docker-compose.yml" + DOCKER_COMPOSE_FILE="/pg_traefik/docker-compose.yml" # Write the base configuration cat < $DOCKER_COMPOSE_FILE @@ -87,7 +87,5 @@ EOF echo -e "${GREEN}Traefik has been deployed successfully.${NC}" } -chmod 600 /pg/traefik/acme.json - # Deploy Traefik with Cloudflare deploy_traefik \ No newline at end of file From c6d6b819742350d1d09470818a041d629d1b62c4 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Thu, 26 Sep 2024 11:46:46 -0400 Subject: [PATCH 44/44] update --- mods/scripts/traefik/deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/scripts/traefik/deploy.sh b/mods/scripts/traefik/deploy.sh index 8f4c68e40..b0387ec15 100644 --- a/mods/scripts/traefik/deploy.sh +++ b/mods/scripts/traefik/deploy.sh @@ -42,7 +42,7 @@ deploy_traefik() { # Create the Docker Compose directory if it doesn't exist mkdir -p /pg/traefik - DOCKER_COMPOSE_FILE="/pg_traefik/docker-compose.yml" + DOCKER_COMPOSE_FILE="/pg/traefik/docker-compose.yml" # Write the base configuration cat < $DOCKER_COMPOSE_FILE