Jelajahi Sumber

Merge pull request #92 from meienberger/install-arch

Install arch
Nicolas Meienberger 3 tahun lalu
induk
melakukan
2faa38dd43
4 mengubah file dengan 20 tambahan dan 3 penghapusan
  1. 1 0
      docker-compose.dev.yml
  2. 1 0
      docker-compose.rc.yml
  3. 10 1
      scripts/configure.sh
  4. 8 2
      scripts/start.sh

+ 1 - 0
docker-compose.dev.yml

@@ -19,6 +19,7 @@ services:
       - TIPI_VERSION=${TIPI_VERSION}
       - JWT_SECRET=${JWT_SECRET}
       - ROOT_FOLDER_HOST=${ROOT_FOLDER_HOST}
+      - NGINX_PORT=${NGINX_PORT}
     networks:
       - tipi_main_network
 

+ 1 - 0
docker-compose.rc.yml

@@ -29,6 +29,7 @@ services:
       - TIPI_VERSION=${TIPI_VERSION}
       - JWT_SECRET=${JWT_SECRET}
       - ROOT_FOLDER_HOST=${ROOT_FOLDER_HOST}
+      - NGINX_PORT=${NGINX_PORT}
     networks:
       - tipi_main_network
 

+ 10 - 1
scripts/configure.sh

@@ -17,7 +17,16 @@ echo
 sudo wget -O "${ROOT_FOLDER}"/scripts/pacapt https://github.com/icy/pacapt/raw/ng/pacapt
 sudo chmod 755 "${ROOT_FOLDER}"/scripts/pacapt
 sudo "${ROOT_FOLDER}"/scripts/pacapt -Sy
-sudo "${ROOT_FOLDER}"/scripts/pacapt -S docker docker-compose jq coreutils curl -y
+sudo "${ROOT_FOLDER}"/scripts/pacapt -S docker docker-compose jq coreutils curl lsb-release -y
+
+LSB="$(lsb_release -is)"
+
+systemctl start docker.service
+systemctl enable docker.service
+
+# if [[ "${LSB}" == "Arch" ]]; then
+#   sudo "${ROOT_FOLDER}"/scripts/pacapt -S hostname -y
+# fi
 
 # Create configured status
 touch "${ROOT_FOLDER}/state/configured"

+ 8 - 2
scripts/start.sh

@@ -55,7 +55,10 @@ fi
 ROOT_FOLDER="$($readlink -f $(dirname "${BASH_SOURCE[0]}")/..)"
 STATE_FOLDER="${ROOT_FOLDER}/state"
 SED_ROOT_FOLDER="$(echo $ROOT_FOLDER | sed 's/\//\\\//g')"
-INTERNAL_IP="$(hostname -I | awk '{print $1}')"
+
+NETWORK_INTERFACE="$(ip route | grep default | awk '{print $5}')"
+INTERNAL_IP="$(ip addr show "${NETWORK_INTERFACE}" | grep "inet " | awk '{print $2}' | cut -d/ -f1)"
+# INTERNAL_IP="$(hostname -I | awk '{print $1}')"
 DNS_IP=9.9.9.9 # Default to Quad9 DNS
 ARCHITECTURE="$(uname -m)"
 
@@ -159,7 +162,10 @@ echo "Running system-info.sh..."
 bash "${ROOT_FOLDER}/scripts/system-info.sh"
 
 # Add crontab to run system-info.sh every minute
-! (crontab -l | grep -q "${ROOT_FOLDER}/scripts/system-info.sh") && (crontab -l; echo "* * * * * ${ROOT_FOLDER}/scripts/system-info.sh") | crontab -
+! (crontab -l | grep -q "${ROOT_FOLDER}/scripts/system-info.sh") && (
+  crontab -l
+  echo "* * * * * ${ROOT_FOLDER}/scripts/system-info.sh"
+) | crontab -
 
 ## Don't run if config-only
 if [[ ! $ci == "true" ]]; then