diff --git a/newt/config.yaml b/newt/config.yaml index fd71273..cf853d9 100644 --- a/newt/config.yaml +++ b/newt/config.yaml @@ -1,7 +1,7 @@ name: "Newt Add-on" -version: "1.1.7" +version: "1.1.8" slug: "newt" -description: "Runs the Newt container inside Home Assistant using Supervisor API" +description: "Runs Newt inside Home Assistant OS" arch: - amd64 - armv7 @@ -15,9 +15,9 @@ privileged: - NET_ADMIN - DAC_READ_SEARCH options: - PANGOLIN_ENDPOINT: "https://example.com" - NEWT_ID: "" - NEWT_SECRET: "" + PANGOLIN_ENDPOINT: "https://dash.opland.net" + NEWT_ID: "your_newt_id" + NEWT_SECRET: "your_newt_secret" schema: PANGOLIN_ENDPOINT: "str" NEWT_ID: "str" @@ -25,4 +25,4 @@ schema: hassio_api: true homeassistant_api: true auth_api: true -hassio_role: "admin" +hassio_role: "admin" \ No newline at end of file diff --git a/newt/run.sh b/newt/run.sh index 5325151..2e1a700 100644 --- a/newt/run.sh +++ b/newt/run.sh @@ -1,40 +1,21 @@ #!/usr/bin/env bash set -e # Stop the script on errors -echo "🔹 Starting Newt container using Home Assistant OS..." +echo "🔹 Starting Newt inside Home Assistant OS..." -# Check if Docker is available -if ! command -v docker &> /dev/null; then - echo "❌ ERROR: Docker is NOT available inside Home Assistant OS!" - exit 1 -fi -echo "✅ Docker is available!" - -# Retrieve environment variables +# Load configuration values PANGOLIN_ENDPOINT=${PANGOLIN_ENDPOINT:-"https://dash.opland.net"} -NEWT_ID=${NEWT_ID:-"ru32vsg8ls5lx93"} -NEWT_SECRET=${NEWT_SECRET:-"5rbqgpc292989uk9kz52hmypoyz6u9jf7k670fqja8p4un8o"} +NEWT_ID=${NEWT_ID:-"your_newt_id"} +NEWT_SECRET=${NEWT_SECRET:-"your_newt_secret"} -echo "🔹 Environment Variables:" +echo "✅ Configuration Loaded:" echo " PANGOLIN_ENDPOINT=$PANGOLIN_ENDPOINT" echo " NEWT_ID=$NEWT_ID" echo " NEWT_SECRET=$NEWT_SECRET" -# Remove old Newt container if it exists -if docker ps -a --format '{{.Names}}' | grep -q "newt"; then - echo "🔹 Stopping and removing existing Newt container..." - docker stop newt - docker rm newt -fi +# Run Newt inside the add-on container +echo "🔹 Running Newt..." +/usr/bin/newt --id "$NEWT_ID" --secret "$NEWT_SECRET" --endpoint "$PANGOLIN_ENDPOINT" & -# Run the Newt container -echo "🔹 Starting Newt container..." -docker run -d --restart unless-stopped \ - --name newt \ - -e PANGOLIN_ENDPOINT="$PANGOLIN_ENDPOINT" \ - -e NEWT_ID="$NEWT_ID" \ - -e NEWT_SECRET="$NEWT_SECRET" \ - fosrl/newt || { echo "❌ ERROR: Failed to start Newt container"; exit 22; } - -echo "✅ Newt container started successfully!" +echo "✅ Newt is running!" exec tail -f /dev/null # Keep the add-on running