This commit is contained in:
JTruj1ll0923 2022-05-29 06:01:28 +00:00 committed by GitHub
commit 57cbe475ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 38 additions and 11 deletions

View file

@ -1 +1 @@
0.2.0
0.2.1

View file

@ -53,4 +53,6 @@ services:
MARIADB_DATABASE: "photoprism"
MARIADB_USER: "photoprism"
MARIADB_PASSWORD: "photoprism"
MARIADB_ROOT_PASSWORD: "photoprism"
MARIADB_ROOT_PASSWORD: "photoprism"
networks:
- tipi_main_network

View file

@ -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

View file

@ -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

View file

@ -1,6 +1,6 @@
{
"name": "runtipi",
"version": "0.2.0",
"version": "0.2.1",
"description": "A homeserver for everyone",
"scripts": {
"test": "jest",

View file

@ -1,6 +1,6 @@
{
"name": "dashboard",
"version": "0.2.0",
"version": "0.2.1",
"private": true,
"scripts": {
"dev": "next dev",

View file

@ -1,6 +1,6 @@
{
"name": "system-api",
"version": "0.2.0",
"version": "0.2.1",
"description": "",
"exports": "./dist/server.js",
"type": "module",

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e # Exit immediately if a command exits with a non-zero status.
ROOT_FOLDER="$(readlink -f $(dirname "${BASH_SOURCE[0]}")/..)"
ROOT_FOLDER="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")"/..)"
echo
echo "======================================"
@ -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-ce docker-compose containerd.io jq coreutils curl -y
yes | sudo "${ROOT_FOLDER}"/scripts/pacapt -S docker docker-compose jq coreutils curl lsb-release
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"

View file

@ -52,10 +52,21 @@ if [[ "$(uname)" != "Linux" ]]; then
exit 1
fi
function host_check {
INTERNAL_IP="$(hostname -I 2>&1| awk '{print $1}')"
if [ '$(grep -q "hostname: invalid option" $INTERNAL_IP' ]; then
INTERNAL_IP="$(ip route show | grep -i default | awk -F' ' '{print $9}')"
fi
}
host_check
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)"
@ -112,7 +123,7 @@ fi
# Get current dns from host
if [[ -f "/etc/resolv.conf" ]]; then
TEMP=$(cat /etc/resolv.conf | grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -n 1)
TEMP=$(grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' /etc/resolv.conf | head -n 1)
fi
# Get dns ip if pihole is installed
@ -140,7 +151,7 @@ ENV_FILE=$(mktemp)
JWT_SECRET=$(derive_entropy "jwt")
for template in "${ENV_FILE}"; do
for template in ${ENV_FILE}; do
sed -i "s/<dns_ip>/${DNS_IP}/g" "${template}"
sed -i "s/<internal_ip>/${INTERNAL_IP}/g" "${template}"
sed -i "s/<tz>/${TZ}/g" "${template}"
@ -159,7 +170,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