Add owntracks-recorder (ct) (#16967)

This commit is contained in:
push-app-to-main[bot]
2026-09-02 16:33:10 +02:00
committed by GitHub
parent 112035cb12
commit 37884d8b47
3 changed files with 108 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
____ ______ __ ____ __
/ __ \_ ______/_ __/________ ______/ /_______ / __ \___ _________ _________/ /__ _____
/ / / / | /| / / __ \/ / / ___/ __ `/ ___/ //_/ ___/_____/ /_/ / _ \/ ___/ __ \/ ___/ __ / _ \/ ___/
/ /_/ /| |/ |/ / / / / / / / / /_/ / /__/ ,< (__ )_____/ _, _/ __/ /__/ /_/ / / / /_/ / __/ /
\____/ |__/|__/_/ /_/_/ /_/ \__,_/\___/_/|_/____/ /_/ |_|\___/\___/\____/_/ \__,_/\___/_/

55
ct/owntracks-recorder.sh Normal file
View File

@@ -0,0 +1,55 @@
#!/usr/bin/env bash
_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main"
_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/owntracks/recorder
APP="OwnTracks-Recorder"
var_tags="${var_tags:-smarthome;tracking}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-1024}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
#var_arm64="${var_arm64:-no}" # unset = ask the user; set yes/no only when verified
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 /etc/default/ot-recorder ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Updating ${APP}"
$STD apt update
$STD apt install -y ot-recorder
msg_ok "Updated ${APP}"
msg_info "Restarting Service"
systemctl restart ot-recorder
msg_ok "Restarted Service"
msg_ok "Updated successfully!"
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}:8083${CL}"
echo -e "${INFO}${YW}Point your OwnTracks apps at MQTT on ${IP}:1883${CL}"

View File

@@ -0,0 +1,47 @@
#!/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/owntracks/recorder
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt install -y mosquitto
systemctl enable -q --now mosquitto
msg_ok "Installed Dependencies"
setup_deb822_repo \
"owntracks" \
"https://raw.githubusercontent.com/owntracks/recorder/master/etc/repo-v2.owntracks.org.gpg.key" \
"http://repo.owntracks.org/debian" \
"$(get_os_info codename)" \
"main"
msg_info "Installing OwnTracks Recorder"
$STD apt install -y ot-recorder
msg_ok "Installed OwnTracks Recorder"
msg_info "Configuring OwnTracks Recorder"
cat <<EOF >/etc/default/ot-recorder
OTR_HOST=127.0.0.1
OTR_PORT=1883
OTR_STORAGEDIR=/opt/owntracks_data
OTR_HTTPHOST=0.0.0.0
OTR_HTTPPORT=8083
EOF
mkdir -p /opt/owntracks_data
chown -R owntracks:owntracks /opt/owntracks_data 2>/dev/null || true
systemctl enable -q --now ot-recorder
msg_ok "Configured OwnTracks Recorder"
motd_ssh
customize
cleanup_lxc