Przeglądaj źródła

Yourls Update to fix install issues (#42)

Robert Middleswarth 3 lat temu
rodzic
commit
cd331e234a
3 zmienionych plików z 27 dodań i 3 usunięć
  1. 2 2
      stack/yourls.yml
  2. 2 1
      template/apps/yourls.json
  3. 23 0
      tools/install_yourls.sh

+ 2 - 2
stack/yourls.yml

@@ -8,8 +8,8 @@ services:
       MYSQL_DATABASE: ${DATABASE_NAME}
       MYSQL_USER: ${DATABASE_USER}
       MYSQL_PASSWORD: ${DATABASE_PASSWORD}
-      PUID: ${USER_UID}
-      PGID: ${USER_GID}
+      PUID: ${PUID}
+      PGID: ${PGID}
       TZ: ${TZ}
     networks:
       - yourls

+ 2 - 1
template/apps/yourls.json

@@ -62,7 +62,8 @@
 	"name": "yourls",
 	"officialDoc": "https://yourls.org/#Install",
 	"platform": "linux",
-	"repository": {
+        "preInstallScript": "install_yourls.sh",
+ 	"repository": {
 		"stackfile32": "stack/yourls.yml",
 		"stackfile64": "stack/yourls.yml",
 		"url": "https://github.com/pi-hosted/pi-hosted/"

+ 23 - 0
tools/install_yourls.sh

@@ -0,0 +1,23 @@
+#!/bin/bash
+
+function error {
+  echo -e "\\e[91m$1\\e[39m"
+  exit 1
+}
+
+function check_internet() {
+  printf "Checking if you are online..."
+  wget -q --spider http://github.com
+  if [ $? -eq 0 ]; then
+    echo "Online. Continuing."
+  else
+    error "Offline. Go connect to the internet then run the script again."
+  fi
+}
+
+check_internet
+
+echo "Creating directories..."
+sudo mkdir -p /portainer/Files/AppData/Config/yourls/database || error "Failed to create database directory!"
+sudo chown -R 1000:1000 /portainer/Files/AppData/Config/yourls/database || error "Failed to set permissions for database data!"
+echo "Done You are ready to install the Yourls Template"