From 996a4a045203842eb958e6f60e9d9ae387834daf Mon Sep 17 00:00:00 2001 From: "push-app-to-main[bot]" <203845782+push-app-to-main[bot]@users.noreply.github.com> Date: Fri, 13 Nov 2026 07:41:46 +0000 Subject: [PATCH] Add martin (ct) --- ct/martin.sh | 56 +++++++++++++++++++++++++++++++++++++ install/martin-install.sh | 58 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 ct/martin.sh create mode 100644 install/martin-install.sh diff --git a/ct/martin.sh b/ct/martin.sh new file mode 100644 index 000000000..d1fdc09ff --- /dev/null +++ b/ct/martin.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" +source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") +# Copyright (c) 2021-2026 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/maplibre/martin + +APP="Martin" +var_tags="${var_tags:-maps;gis;tiles}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-1024}" +var_disk="${var_disk:-4}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_arm64="${var_arm64:-yes}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -x /opt/martin/martin ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + if check_for_gh_release "martin" "maplibre/martin"; then + msg_info "Stopping Martin" + systemctl stop martin + msg_ok "Stopped Martin" + + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "martin" "maplibre/martin" "prebuild" "latest" "/opt/martin" "martin-$(arch_resolve "x86_64" "aarch64")-unknown-linux-musl.tar.gz" + + msg_info "Starting Martin" + systemctl start martin + msg_ok "Started Martin" + msg_ok "Updated successfully!" + 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 "${GATEWAY}${BGN}http://${IP}:3000${CL}" diff --git a/install/martin-install.sh b/install/martin-install.sh new file mode 100644 index 000000000..2bd3940fe --- /dev/null +++ b/install/martin-install.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/maplibre/martin + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +fetch_and_deploy_gh_release "martin" "maplibre/martin" "prebuild" "latest" "/opt/martin" "martin-$(arch_resolve "x86_64" "aarch64")-unknown-linux-musl.tar.gz" + +msg_info "Configuring Martin" +mkdir -p /opt/martin_data/tiles +cat </opt/martin_data/config.yaml +listen_addresses: 0.0.0.0:3000 +web_ui: enable-for-all + +mbtiles: + paths: + - /opt/martin_data/tiles + +pmtiles: + paths: + - /opt/martin_data/tiles + +# postgres: +# connection_string: postgres://user:password@host:5432/database +EOF +msg_ok "Configured Martin" + +msg_info "Creating Service" +cat </etc/systemd/system/martin.service +[Unit] +Description=Martin Tile Server +After=network.target + +[Service] +Type=simple +WorkingDirectory=/opt/martin_data +ExecStart=/opt/martin/martin --config /opt/martin_data/config.yaml +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now martin +msg_ok "Created Service" + +motd_ssh +customize +cleanup_lxc