Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Software title: Homepage #293

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added tools/include/images/MAN009.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions tools/include/markdown/MAN009-footer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
=== "Access to the web interface"

The web interface is accessible via port **3000**:

- URL: `https://<your.IP>:3000`
- Username/Password: none

Configuration: Please reffer to official manual <https://gethomepage.dev/configs/>

=== "Directories"

- Install directory: `/armbian/homepage`
- Site configuration directory: `/armbian/homepage/config`

=== "View logs"

```sh
docker logs -f homepage
```
1 change: 1 addition & 0 deletions tools/include/markdown/MAN009-header.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A modern, fully static, fast, secure fully proxied, highly customizable application dashboard with integrations for over 100 services and translations into multiple languages. Easily configured via YAML files or through docker label discovery.
20 changes: 20 additions & 0 deletions tools/json/config.software.json
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,26 @@
"status": "Stable",
"author": "@Tearran",
"condition": ""
},
{
"id": "MAN009",
"description": "Install Homepage",
"command": [
"module_homepage install"
],
"status": "Stable",
"author": "@igorpecovnik",
"condition": "! module_homepage status"
},
{
"id": "MAN010",
"description": "Remove Homepage",
"command": [
"module_homepage remove"
],
"status": "Stable",
"author": "@igorpecovnik",
"condition": "module_homepage status"
}
]
},
Expand Down
77 changes: 77 additions & 0 deletions tools/modules/software/install_homepage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
module_options+=(
["module_homepage,author"]="@armbian"
["module_homepage,feature"]="module_homepage"
["module_homepage,desc"]="Install homepage container"
["module_homepage,example"]="install remove status help"
["module_homepage,port"]="3000"
["module_homepage,status"]="Active"
["module_homepage,arch"]=""
)
#
# Module homepage
#
function module_homepage () {
local title="homepage"
local condition=$(which "$title" 2>/dev/null)

if pkg_installed docker-ce; then
local container=$(docker container ls -a | mawk '/homepage?( |$)/{print $1}')
local image=$(docker image ls -a | mawk '/homepage?( |$)/{print $3}')
fi

local commands
IFS=' ' read -r -a commands <<< "${module_options["module_homepage,example"]}"

HOMEPAGE_BASE="${SOFTWARE_FOLDER}/homepage"

case "$1" in
"${commands[0]}")
pkg_installed docker-ce || install_docker
[[ -d "$HOMEPAGE_BASE" ]] || mkdir -p "$HOMEPAGE_BASE" || { echo "Couldn't create storage directory: $HOMEPAGE_BASE"; exit 1; }
docker run -d \
--name homepage \
-e PUID=1000 \
-e PGID=1000 \
-p 3000:3000 \
-v "${HOMEPAGE_BASE}/config:/app/config" \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
--restart unless-stopped \
ghcr.io/gethomepage/homepage:latest
for i in $(seq 1 20); do
if docker inspect -f '{{ index .Config.Labels "build_version" }}' homepage >/dev/null 2>&1 ; then
break
else
sleep 3
fi
if [ $i -eq 20 ] ; then
echo -e "\nTimed out waiting for ${title} to start, consult your container logs for more info (\`docker logs homepage\`)"
exit 1
fi
done
;;
"${commands[1]}")
[[ "${container}" ]] && docker container rm -f "$container" >/dev/null
[[ "${image}" ]] && docker image rm "$image" >/dev/null
[[ -n "${HOMEPAGE_BASE}" && "${HOMEPAGE_BASE}" != "/" ]] && rm -rf "${HOMEPAGE_BASE}"
;;
"${commands[2]}")
if [[ "${container}" && "${image}" ]]; then
return 0
else
return 1
fi
;;
"${commands[3]}")
echo -e "\nUsage: ${module_options["module_homepage,feature"]} <command>"
echo -e "Commands: ${module_options["module_homepage,example"]}"
echo "Available commands:"
echo -e "\tinstall\t- Install $title."
echo -e "\tstatus\t- Installation status $title."
echo -e "\tremove\t- Remove $title."
echo
;;
*)
${module_options["module_homepage,feature"]} ${commands[3]}
;;
esac
}
Loading