瀏覽代碼

Add install script for homer

Robert Middleswarth 2 年之前
父節點
當前提交
2360aa8d2e
共有 2 個文件被更改,包括 13 次插入0 次删除
  1. 1 0
      template/apps/homer.json
  2. 12 0
      tools/install_homer.sh

+ 1 - 0
template/apps/homer.json

@@ -24,6 +24,7 @@
 	"note": "This container requires a yml file within the config volume. See the documentation here https://github.com/bastienwirtz/homer",
 	"officialDoc": "https://github.com/bastienwirtz/homer/blob/main/docs/configuration.md",
 	"platform": "linux",
+	"preInstallScript": "install_homer.sh",
 	"ports": [
 		"8902:8080/tcp"
 	],

+ 12 - 0
tools/install_homer.sh

@@ -0,0 +1,12 @@
+#!/bin/bash
+
+function error {
+  echo -e "\\e[91m$1\\e[39m"
+  exit 1
+}
+
+echo "Creating directory..."
+sudo mkdir -p /portainer/Files/AppData/Config/Homer || error "Failed to create Homer folder!"
+sudo mkdir -p /portainer/Files/AppData/Config/Homer/assets || error "Failed to create Homer folder!"
+sudo chown -R 1000.1000 /portainer/Files/AppData/Config/Homer || error "Failed to create Homer folder!"
+echo "Setup complete. You can now install the Homer using the App Template."