Merge pull request #1143 from rrole/wanderer

This commit is contained in:
Michel Roegl-Brunner 2025-11-25 16:22:24 +01:00 committed by GitHub
commit c20b27f072
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 196 additions and 0 deletions

75
ct/wanderer.sh Normal file
View File

@ -0,0 +1,75 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
# Copyright (c) 2021-2025 community-scripts ORG
# Author: rrole
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
# Source: https://wanderer.to
APP="Wanderer"
var_tags="${var_tags:-traveling;sport}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-4096}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -f /opt/wanderer/start.sh ]]; then
msg_error "No wanderer Installation Found!"
exit
fi
if check_for_gh_release "wanderer" "Flomp/wanderer"; then
msg_info "Stopping wanderer service"
systemctl stop wanderer-web
msg_ok "Stopped wanderer service"
fetch_and_deploy_gh_release "wanderer" "Flomp/wanderer" "tarball" "latest" "/opt/wanderer/source"
msg_info "Updating wanderer"
cd /opt/wanderer/source/db
$STD go mod tidy
$STD go build
cd /opt/wanderer/source/web
$STD npm ci --omit=dev
$STD npm run build
msg_ok "Updated wanderer"
msg_info "Starting wanderer service"
systemctl start wanderer-web
msg_ok "Started wanderer service"
msg_ok "Update Successful"
fi
if check_for_gh_release "meilisearch" "meilisearch/meilisearch"; then
msg_info "Stopping wanderer service"
systemctl stop wanderer-web
msg_ok "Stopped wanderer service"
fetch_and_deploy_gh_release "meilisearch" "meilisearch/meilisearch" "binary" "latest" "/opt/wanderer/source/search"
msg_info "Starting wanderer service"
systemctl start wanderer-web
msg_ok "Started wanderer service"
msg_ok "Update Successful"
fi
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"

View File

@ -0,0 +1,34 @@
{
"name": "Wanderer",
"slug": "wanderer",
"categories": [
0
],
"date_created": "2025-11-23",
"type": "ct",
"updateable": true,
"privileged": false,
"interface_port": 3000,
"documentation": "https://wanderer.to/welcome",
"website": "https://wanderer.to",
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@master/webp/wanderer-light.webp",
"description": "Wanderer is a decentralized, self-hosted trail database. You can upload your recorded GPS tracks or create new ones and add various metadata to build an easily searchable catalogue.",
"install_methods": [
{
"type": "default",
"script": "ct/AppName.sh",
"resources": {
"cpu": 2,
"ram": 4096,
"hdd": 8,
"os": "debian",
"version": "13"
}
}
],
"default_credentials": {
"username": null,
"password": null
},
"notes": []
}

View File

@ -0,0 +1,87 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2025 community-scripts ORG
# Author: rrole
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://wanderer.to
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
setup_go
setup_nodejs
fetch_and_deploy_gh_release "meilisearch" "meilisearch/meilisearch" "binary" "latest" "/opt/wanderer/source/search"
mkdir -p /opt/wanderer/{source,data/pb_data,data/meili_data}
fetch_and_deploy_gh_release "wanderer" "Flomp/wanderer" "tarball" "latest" "/opt/wanderer/source"
msg_info "Installing wanderer (patience)"
cd /opt/wanderer/source/db
$STD go mod tidy
$STD go build
cd /opt/wanderer/source/web
$STD npm ci -s vitest
$STD npm ci --omit=dev
$STD npm run build
msg_ok "Installed wanderer"
msg_info "Creating Service"
MEILI_KEY=$(openssl rand -hex 32)
POCKETBASE_KEY=$(openssl rand -hex 16)
LOCAL_IP="$(hostname -I | awk '{print $1}')"
cat <<EOF >/opt/wanderer/.env
ORIGIN=http://${LOCAL_IP}:3000
MEILI_HTTP_ADDR=${LOCAL_IP}:7700
MEILI_URL=http://${LOCAL_IP}:7700
MEILI_MASTER_KEY=${MEILI_KEY}
PB_URL=${LOCAL_IP}:8090
PUBLIC_POCKETBASE_URL=http://${LOCAL_IP}:8090
PUBLIC_VALHALLA_URL=https://valhalla1.openstreetmap.de
POCKETBASE_ENCRYPTION_KEY=${POCKETBASE_KEY}
PB_DB_LOCATION=/opt/wanderer/data/pb_data
MEILI_DB_PATH=/opt/wanderer/data/meili_data
EOF
cat <<EOF >/opt/wanderer/start.sh
#!/usr/bin/env bash
trap "kill 0" EXIT
cd /opt/wanderer/source/search && meilisearch --master-key \$MEILI_MASTER_KEY &
sleep 1
cd /opt/wanderer/source/db && ./pocketbase serve --http=\$PB_URL --dir=\$PB_DB_LOCATION &
cd /opt/wanderer/source/web && node build &
wait -n
EOF
chmod +x /opt/wanderer/start.sh
cat <<EOF >/etc/systemd/system/wanderer-web.service
[Unit]
Description=wanderer
After=network.target
StartLimitIntervalSec=10
StartLimitBurst=5
[Service]
Type=simple
EnvironmentFile=/opt/wanderer/.env
ExecStart=/usr/bin/bash /opt/wanderer/start.sh
Restart=always
RestartSec=1
[Install]
WantedBy=multi-user.target
EOF
sleep 1
systemctl enable -q --now wanderer-web
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc