Project NOMAD is an offline-first knowledge and education server. Wikipedia, thousands of books, courses, maps, and optional local AI, all running on hardware you own with no internet required.
TypeScript
feat(install): replace secrets with rand pwds and host
Jake Turnera8bfc083d4ff
diff --git a/install/install_nomad.sh b/install/install_nomad.shindex d4ef42ff..927c6825 100644--- a/install/install_nomad.sh+++ b/install/install_nomad.sh@@ -39,7 +39,7 @@ WAIT_FOR_IT_SCRIPT_URL="https://raw.githubusercontent.com/vishnubob/wait-for-it/script_option_debug='true'accepted_terms='false'-local_ip=''+local_ip_address=''#################################################################################################################################################################################################### #@@ -98,6 +98,16 @@ check_is_debug_mode(){fi}+generateRandomPass() {+ local length="${1:-32}" # Default to 32+ local password++ # Generate random password using /dev/urandom+ password=$(tr -dc 'A-Za-z0-9!@#$%^&*()_+=-' < /dev/urandom | head -c "$length")++ echo "$password"+}+ensure_docker_installed() {if ! command -v docker &> /dev/null; thenecho -e "${YELLOW}#${RESET} Docker not found. Installing Docker...\\n"@@ -235,6 +245,22 @@ download_management_compose_file() {exit 1fiecho -e "${GREEN}#${RESET} Docker compose file downloaded successfully to $compose_file_path.\\n"++ local app_key=$(generateRandomPass 32)+ local db_root_password=$(generateRandomPass 16)+ local db_user_password=$(generateRandomPass 16)++ # Inject dynamic env values into the compose file+ echo -e "${YELLOW}#${RESET} Configuring docker-compose file env variables...\\n"+ sed -i "s|HOST=replaceme|HOST=${local_ip_address}|g" "$compose_file_path"+ sed -i "s|URL=replaceme|URL=http://${local_ip_address}:8080|g" "$compose_file_path"+ sed -i "s|APP_KEY=replaceme|APP_KEY=${app_key}|g" "$compose_file_path"++ sed -i "s|DB_PASSWORD=replaceme|DB_PASSWORD=${db_user_password}|g" "$compose_file_path"+ sed -i "s|MYSQL_ROOT_PASSWORD=replaceme|MYSQL_ROOT_PASSWORD=${db_root_password}|g" "$compose_file_path"+ sed -i "s|MYSQL_PASSWORD=replaceme|MYSQL_PASSWORD=${db_user_password}|g" "$compose_file_path"++ echo -e "${GREEN}#${RESET} Docker compose file configured successfully.\\n"}download_wait_for_it_script() {@@ -300,7 +326,7 @@ get_local_ip() {local_ip_address=$(hostname -I | awk '{print $1}')if [[ -z "$local_ip_address" ]]; thenecho -e "${RED}#${RESET} Unable to determine local IP address. Please check your network configuration."- # Don't exit if we can't determine the local IP address, it's not critical for the installation+ exit 1fi}@@ -328,13 +354,13 @@ check_is_debug_modeget_install_confirmationaccept_termsensure_docker_installed+get_local_ipcreate_nomad_directorydownload_wait_for_it_scriptdownload_entrypoint_scriptdownload_helper_scriptsdownload_management_compose_filestart_management_containers-get_local_ipsuccess_message# free_space_check() {diff --git a/install/management_compose.yaml b/install/management_compose.yamlindex e3573faa..8bb07119 100644--- a/install/management_compose.yaml+++ b/install/management_compose.yaml@@ -16,14 +16,14 @@ services:- PORT=8080- LOG_LEVEL=debug- DRIVE_DISK=fs- - APP_KEY=secretlongpasswordsecret- - HOST=0.0.0.0- - URL=http://localhost:8080+ - APP_KEY=replaceme+ - HOST=replaceme+ - URL=replaceme- DB_HOST=mysql- DB_PORT=3306- DB_DATABASE=nomad- DB_USER=nomad_user- - DB_PASSWORD=nomad_password+ - DB_PASSWORD=replaceme- DB_NAME=nomad- DB_SSL=falsedepends_on:@@ -53,10 +53,10 @@ services:ports:- "3306:3306"environment:- - MYSQL_ROOT_PASSWORD=secretpassword+ - MYSQL_ROOT_PASSWORD=replaceme- MYSQL_DATABASE=nomad- MYSQL_USER=nomad_user- - MYSQL_PASSWORD=nomad_password+ - MYSQL_PASSWORD=replacemevolumes:- /opt/project-nomad/mysql:/var/lib/mysqlhealthcheck: