Browse Source

Caddy2 add install script for the config file (#204)

Robert Middleswarth 3 years ago
parent
commit
7063d482d9
3 changed files with 15 additions and 2 deletions
  1. 1 1
      template/portainer-v2-arm32.json
  2. 1 1
      template/portainer-v2-arm64.json
  3. 13 0
      tools/install_caddy.sh

+ 1 - 1
template/portainer-v2-arm32.json

@@ -337,7 +337,7 @@
 				"Web",
 				"Webserver"
 			],
-			"description": "Caddy - The Ultimate Server with Automatic HTTPS",
+			"description": "Caddy - The Ultimate Server with Automatic HTTPS.  Need to run tools/install_caddy.sh before installing the template.",
 			"image": "caddy:latest",
 			"logo": "https://raw.githubusercontent.com/novaspirit/pi-hosted/master/images/caddy.png",
 			"name": "caddy",

+ 1 - 1
template/portainer-v2-arm64.json

@@ -337,7 +337,7 @@
 				"Web",
 				"Webserver"
 			],
-			"description": "Caddy - The Ultimate Server with Automatic HTTPS",
+			"description": "Caddy - The Ultimate Server with Automatic HTTPS.  Need to run tools/install_caddy.sh before installing the template.",
 			"image": "caddy:latest",
 			"logo": "https://raw.githubusercontent.com/novaspirit/pi-hosted/master/images/caddy.png",
 			"name": "caddy",

+ 13 - 0
tools/install_caddy.sh

@@ -0,0 +1,13 @@
+#!/bin/bash
+
+function error {
+  echo -e "\\e[91m$1\\e[39m"
+  exit 1
+}
+
+echo "Creating directories..."
+sudo mkdir -p /portainer/Files/AppData/Config/Caddy || error "Failed to create Caddy folder!"
+echo "Creating a blank caddy config files"
+sudo touch /portainer/Files/AppData/Config/Caddy/caddyfile || error "Failed to touch caddyfile file!"
+echo "Setup complete. You can now install Caddy using the App Template."
+