Add wanderer script

This commit is contained in:
Roger Sole 2025-11-23 20:11:38 +01:00
parent e64957656b
commit d4580d85b0
3 changed files with 240 additions and 0 deletions

90
ct/wanderer.sh Normal file
View File

@ -0,0 +1,90 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/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="traveling; sport"
var_cpu="2"
var_ram="4096"
var_disk="8"
var_os="debian"
var_version="13"
var_unprivileged="1"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -f /opt/${APP}/start.sh ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
INSTALL_DIR="/opt/$APP"
SRC_DIR="${INSTALL_DIR}/source"
DB_DIR="${SRC_DIR}/db"
SEARCH_DIR="${SRC_DIR}/search"
WEB_DIR="${SRC_DIR}/web"
DATA_DIR="${INSTALL_DIR}/data"
PB_DB_LOCATION="${DATA_DIR}/pb_data"
MEILI_DB_LOCATION="${DATA_DIR}/meili_data"
if check_for_gh_release "$APP" "Flomp/wanderer"; then
msg_info "Stopping $APP"
systemctl stop wanderer-web.service
msg_ok "Stopped $APP"
msg_info "Updating $APP"
$STD fetch_and_deploy_gh_release "$APP" "Flomp/wanderer" "tarball" "latest" "$SRC_DIR"
cd $DB_DIR
$STD go mod tidy && $STD go build
cd $WEB_DIR
$STD npm ci --omit=dev
$STD npm run build
msg_ok "Updated $APP"
msg_info "Starting $APP"
systemctl start "${APP}"-web.service
msg_ok "Started $APP"
msg_ok "Update Successful"
fi
if check_for_gh_release "meilisearch" "meilisearch/meilisearch"; then
msg_info "Stopping $APP"
systemctl stop wanderer-web.service
msg_ok "Stopped $APP"
msg_info "Updating Meilisearch"
cd $SEARCH_DIR
$STD fetch_and_deploy_gh_release "meilisearch" "meilisearch/meilisearch" "binary" "latest" "$SEARCH_DIR"
msg_ok "Updated Meilisearch"
msg_info "Starting $APP"
systemctl start "${APP}"-web.service
msg_ok "Started $APP"
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": "DATE CREATED",
"type": "ct",
"updateable": true,
"privileged": false,
"interface_port": 3000,
"documentation": "https://wanderer.to/welcome",
"website": "https://wanderer.to",
"logo": "https://github.com/Flomp/wanderer/blob/main/docs/src/assets/logo_dark.svg",
"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": []
}

116
install/wanderer-install.sh Normal file
View File

@ -0,0 +1,116 @@
#!/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
msg_info "Installing dependencies"
$STD apt-get update
$STD apt-get upgrade
$STD apt-get install --no-install-recommends -y \
git \
golang-go \
npm \
nodejs
msg_ok "Installded Dependencies"
INSTALL_DIR="/opt/${APPLICATION}"
SRC_DIR="${INSTALL_DIR}/source"
DB_DIR="${SRC_DIR}/db"
SEARCH_DIR="${SRC_DIR}/search"
WEB_DIR="${SRC_DIR}/web"
DATA_DIR="${INSTALL_DIR}/data"
PB_DB_LOCATION="${DATA_DIR}/pb_data"
MEILI_DB_LOCATION="${DATA_DIR}/meili_data"
mkdir -p "$INSTALL_DIR"
mkdir -p "$SRC_DIR"
mkdir -p "$DATA_DIR"
mkdir -p "$PB_DB_LOCATION"
mkdir -p "$MEILI_DB_LOCATION"
$STD fetch_and_deploy_gh_release "wanderer" "Flomp/wanderer" "tarball" "latest" "$SRC_DIR"
msg_info "Installing ${APPLICATION} (patience)"
cd $SEARCH_DIR
$STD fetch_and_deploy_gh_release "meilisearch" "meilisearch/meilisearch" "binary" "latest" "$SEARCH_DIR"
$STD meilisearch &
$STD sleep 1
$STD kill %%
cd $DB_DIR
$STD go mod tidy && $STD go build
cd $WEB_DIR
$STD npm i -s vitest
$STD npm ci --omit=dev
$STD npm run build
msg_ok "Installed ${APPLICATION}"
msg_info "Modifying user, creating env file, scripts & services"
MEILI_KEY=$(openssl rand -hex 32)
POCKETBASE_KEY=$(openssl rand -hex 16)
LOCAL_IP="$(hostname -I | awk '{print $1}')"
cat <<EOF >"${INSTALL_DIR}"/.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=${PB_DB_LOCATION}
MEILI_DB_PATH=${MEILI_DB_LOCATION}
EOF
cat <<EOF >"${INSTALL_DIR}"/start.sh
#!/usr/bin/env bash
trap "kill 0" EXIT
cd ${SEARCH_DIR} && meilisearch --master-key \$MEILI_MASTER_KEY &
cd ${DB_DIR} && ./pocketbase serve --http=\$PB_URL --dir=\$PB_DB_LOCATION &
cd ${WEB_DIR} && node build &
wait -n
EOF
chmod +x "${INSTALL_DIR}"/start.sh
cat <<EOF >/etc/systemd/system/"${APPLICATION}"-web.service
[Unit]
Description=${APPLICATION}
After=network.target
StartLimitIntervalSec=10
StartLimitBurst=5
[Service]
Type=simple
EnvironmentFile=${INSTALL_DIR}/.env
ExecStart=/usr/bin/bash ${INSTALL_DIR}/start.sh
Restart=always
RestartSec=1
[Install]
WantedBy=multi-user.target
EOF
sleep 1
systemctl enable -q --now "$APPLICATION"-web.service
msg_ok "Modified user, created env file, scripts and services"
motd_ssh
customize
msg_info "Cleaning up"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
$STD apt clean -y
msg_ok "Cleaned"