Update GeoIntel project files
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0"?>
|
||||
<Container version="2">
|
||||
<Name>DockDeck</Name>
|
||||
<Repository>dockdeck:local</Repository>
|
||||
<Network>bridge</Network>
|
||||
<Shell>sh</Shell>
|
||||
<Privileged>false</Privileged>
|
||||
<Support>http://192.168.10.150:3000/NuklearRabbit/DockDeck</Support>
|
||||
<Project>http://192.168.10.150:3000/NuklearRabbit/DockDeck</Project>
|
||||
<Overview>DockDeck is a premium, read-only personal start dashboard for Unraid. This single-container profile uses the existing AppOps inventory API and never mounts the Docker socket.</Overview>
|
||||
<Category>Tools:Status:</Category>
|
||||
<WebUI>http://[IP]:[PORT:1218]</WebUI>
|
||||
<Icon>http://192.168.10.150:1218/dockdeck-icon.png</Icon>
|
||||
<ExtraParams>--read-only --security-opt=no-new-privileges:true</ExtraParams>
|
||||
<PostArgs/>
|
||||
<CPUset/>
|
||||
<DateInstalled>1784060000</DateInstalled>
|
||||
<DonateText/>
|
||||
<DonateLink/>
|
||||
<Requires>Unraid AppOps Gateway on port 1216</Requires>
|
||||
<Config Name="WebUI" Target="3000" Default="1218" Mode="tcp" Description="DockDeck WebUI" Type="Port" Display="always" Required="true" Mask="false">1218</Config>
|
||||
<Config Name="App data" Target="/data" Default="/mnt/user/appdata/dockdeck/data" Mode="rw" Description="Persistent database and integration settings" Type="Path" Display="always" Required="true" Mask="false">/mnt/user/appdata/dockdeck/data</Config>
|
||||
<Config Name="Template metadata" Target="/unraid-templates" Default="/mnt/user/appdata/dockdeck/unraid-templates" Mode="ro" Description="Sanitized Unraid template metadata" Type="Path" Display="advanced" Required="true" Mask="false">/mnt/user/appdata/dockdeck/unraid-templates</Config>
|
||||
<Config Name="Unraid runtime" Target="/unraid-runtime" Default="/var/local/emhttp" Mode="ro" Description="Read-only array and parity status" Type="Path" Display="advanced" Required="true" Mask="false">/var/local/emhttp</Config>
|
||||
<Config Name="Hardware sensors" Target="/host-hwmon" Default="/sys/class/hwmon" Mode="ro" Description="Read-only host temperature sensors" Type="Path" Display="advanced" Required="true" Mask="false">/sys/class/hwmon</Config>
|
||||
<Config Name="CPU information" Target="/host-proc/cpuinfo" Default="/proc/cpuinfo" Mode="ro" Description="Read-only host CPU capacity" Type="Path" Display="advanced" Required="true" Mask="false">/proc/cpuinfo</Config>
|
||||
<Config Name="Memory information" Target="/host-proc/meminfo" Default="/proc/meminfo" Mode="ro" Description="Read-only host memory capacity" Type="Path" Display="advanced" Required="true" Mask="false">/proc/meminfo</Config>
|
||||
<Config Name="AppOps URL" Target="APPOPS_URL" Default="http://192.168.10.150:1216" Mode="" Description="Existing read-only inventory API" Type="Variable" Display="always" Required="true" Mask="false">http://192.168.10.150:1216</Config>
|
||||
<Config Name="Unraid host" Target="UNRAID_HOST" Default="192.168.10.150" Mode="" Description="Tower LAN address" Type="Variable" Display="always" Required="true" Mask="false">192.168.10.150</Config>
|
||||
<Config Name="Unraid URL" Target="UNRAID_URL" Default="http://192.168.10.150:5000" Mode="" Description="Tower WebUI address" Type="Variable" Display="always" Required="true" Mask="false">http://192.168.10.150:5000</Config>
|
||||
</Container>
|
||||
Executable
+48
@@ -0,0 +1,48 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
container_name="${1:-DockDeck}"
|
||||
icon_url="${2:-}"
|
||||
template_path="/boot/config/plugins/dockerMan/templates-user/my-${container_name}.xml"
|
||||
persistent_dir="/var/lib/docker/unraid/images"
|
||||
runtime_dir="/usr/local/emhttp/state/plugins/dynamix.docker.manager/images"
|
||||
|
||||
fail() {
|
||||
printf 'DockDeck icon refresh failed: %s\n' "$1" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
[ "$(id -u)" -eq 0 ] || fail "run this helper as root on the Unraid host"
|
||||
|
||||
case "$container_name" in
|
||||
"" | *[!A-Za-z0-9_.-]*) fail "invalid container name" ;;
|
||||
esac
|
||||
|
||||
if [ -z "$icon_url" ] && [ -f "$template_path" ]; then
|
||||
icon_url="$(sed -n 's#.*<Icon>\(.*\)</Icon>.*#\1#p' "$template_path" | head -n 1)"
|
||||
fi
|
||||
|
||||
case "$icon_url" in
|
||||
http://* | https://*) ;;
|
||||
*) fail "provide an HTTP(S) icon URL or a user template containing <Icon>" ;;
|
||||
esac
|
||||
|
||||
temporary_icon="$(mktemp /tmp/dockdeck-icon.XXXXXX)"
|
||||
trap 'rm -f "$temporary_icon"' EXIT HUP INT TERM
|
||||
|
||||
curl --fail --silent --show-error --location \
|
||||
--connect-timeout 5 --max-time 20 \
|
||||
"$icon_url" --output "$temporary_icon"
|
||||
|
||||
[ "$(file -b --mime-type "$temporary_icon")" = "image/png" ] || \
|
||||
fail "the downloaded asset is not a real PNG"
|
||||
|
||||
mkdir -p "$persistent_dir" "$runtime_dir"
|
||||
install -m 0644 -o root -g root \
|
||||
"$temporary_icon" "$persistent_dir/${container_name}-icon.png"
|
||||
install -m 0644 -o root -g root \
|
||||
"$temporary_icon" "$runtime_dir/${container_name}-icon.png"
|
||||
|
||||
printf 'Refreshed both Unraid icon caches for %s from %s\n' \
|
||||
"$container_name" "$icon_url"
|
||||
@@ -0,0 +1,61 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Copy only non-sensitive DockDeck metadata from Unraid templates."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
|
||||
ALLOWED_FIELDS = ("Name", "WebUI", "Icon")
|
||||
|
||||
|
||||
def sanitize(source_dir: Path, destination_dir: Path) -> int:
|
||||
destination_dir.mkdir(parents=True, exist_ok=True)
|
||||
written = 0
|
||||
|
||||
for source in sorted(source_dir.glob("*.xml")):
|
||||
try:
|
||||
root = ET.parse(source).getroot()
|
||||
except (ET.ParseError, OSError):
|
||||
continue
|
||||
|
||||
output = ET.Element("Container")
|
||||
for field in ALLOWED_FIELDS:
|
||||
value = root.findtext(field)
|
||||
if value:
|
||||
ET.SubElement(output, field).text = value.strip()
|
||||
|
||||
if output.findtext("Name"):
|
||||
destination = destination_dir / source.name
|
||||
ET.ElementTree(output).write(
|
||||
destination,
|
||||
encoding="utf-8",
|
||||
xml_declaration=True,
|
||||
)
|
||||
destination.chmod(0o644)
|
||||
written_tags = {
|
||||
child.tag for child in ET.parse(destination).getroot()
|
||||
}
|
||||
if not written_tags.issubset(ALLOWED_FIELDS):
|
||||
destination.unlink(missing_ok=True)
|
||||
raise RuntimeError(
|
||||
f"Unexpected field in sanitized template: {source.name}"
|
||||
)
|
||||
written += 1
|
||||
|
||||
return written
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("source", type=Path)
|
||||
parser.add_argument("destination", type=Path)
|
||||
args = parser.parse_args()
|
||||
count = sanitize(args.source, args.destination)
|
||||
print(f"Sanitized and verified {count} Unraid templates")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,9 @@
|
||||
DOCKDECK_BIND_ADDRESS=192.168.10.150
|
||||
DOCKDECK_PORT=1218
|
||||
DOCKDECK_EGRESS_SUBNET=172.31.240.16/28
|
||||
UNRAID_TEMPLATES_DIR=/mnt/user/appdata/dockdeck/unraid-templates
|
||||
UNRAID_HOST=192.168.10.150
|
||||
UNRAID_URL=http://192.168.10.150:5000
|
||||
UNRAID_RUNTIME_DIR=/var/local/emhttp
|
||||
UNRAID_HWMON_DIR=/sys/class/hwmon
|
||||
APPOPS_URL=http://192.168.10.150:1216
|
||||
Reference in New Issue
Block a user