Compare commits

..

8 Commits

Author SHA1 Message Date
CanbiZ
d59c6ef8af Use STD variable for journalctl commands 2025-10-30 12:29:50 +01:00
CanbiZ
e23d650f42 spaces 2025-10-30 12:20:49 +01:00
CanbiZ
b500ec90eb core: add function cleanup_lxc
Introduces the cleanup_lxc function to perform system and package manager cache cleanup, remove temporary files, truncate logs, and clear caches for various language package managers. This helps ensure containers are left in a clean state after operations.
2025-10-30 12:17:56 +01:00
Bram Suurd
851f0dc37c Fix markdown formatting in JSON notes (#8744) 2025-10-30 11:46:12 +01:00
community-scripts-pr-app[bot]
da6cff182c Update CHANGELOG.md (#8742)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-10-30 08:35:02 +00:00
push-app-to-main[bot]
c8c23ca1cb Livebook (#8739)
* 'Add new script'

* chore refactor

---------

Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com>
Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com>
2025-10-30 01:34:37 -07:00
community-scripts-pr-app[bot]
f7ec037a38 Update CHANGELOG.md (#8740)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-10-30 08:16:54 +00:00
push-app-to-main[bot]
8896e6c964 Reitti (#8736)
* 'Add new script'

* Update reitti.json

* Update documentation URL in reitti.json

* Apply suggestion from @tremor021

---------

Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com>
Co-authored-by: CanbiZ <47820557+MickLesk@users.noreply.github.com>
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
2025-10-30 09:16:30 +01:00
6 changed files with 326 additions and 1 deletions

View File

@@ -14,7 +14,9 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
### 🆕 New Scripts
- BentoPDF ([#8735](https://github.com/community-scripts/ProxmoxVE/pull/8735))
- Livebook ([#8739](https://github.com/community-scripts/ProxmoxVE/pull/8739))
- Reitti ([#8736](https://github.com/community-scripts/ProxmoxVE/pull/8736))
- BentoPDF ([#8735](https://github.com/community-scripts/ProxmoxVE/pull/8735))
## 2025-10-29

6
ct/headers/reitti Normal file
View File

@@ -0,0 +1,6 @@
____ _ __ __ _
/ __ \___ (_) /_/ /_(_)
/ /_/ / _ \/ / __/ __/ /
/ _, _/ __/ / /_/ /_/ /
/_/ |_|\___/_/\__/\__/_/

68
ct/reitti.sh Normal file
View File

@@ -0,0 +1,68 @@
#!/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: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/dedicatedcode/reitti
APP="Reitti"
var_tags="${var_tags:-location-tracker}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-4096}"
var_disk="${var_disk:-15}"
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/reitti/reitti.jar ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "reitti" "dedicatedcode/reitti"; then
msg_info "Stopping Service"
systemctl stop reitti
msg_ok "Stopped Service"
rm -f /opt/reitti/reitti.jar
USE_ORIGINAL_FILENAME="true" fetch_and_deploy_gh_release "reitti" "dedicatedcode/reitti" "singlefile" "latest" "/opt/reitti" "reitti-app.jar"
mv /opt/reitti/reitti-*.jar /opt/reitti/reitti.jar
msg_info "Starting Service"
systemctl start reitti
msg_ok "Started Service"
msg_ok "Updated Successfully!"
fi
if check_for_gh_release "photon" "dedicatedcode/reitti"; then
msg_info "Stopping Service"
systemctl stop photon
msg_ok "Stopped Service"
rm -f /opt/photon/photon.jar
USE_ORIGINAL_FILENAME="true" fetch_and_deploy_gh_release "photon" "komoot/photon" "singlefile" "latest" "/opt/photon" "photon-0*.jar"
mv /opt/photon/photon-*.jar /opt/photon/photon.jar
msg_info "Starting Service"
systemctl start photon
msg_ok "Started Service"
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 "${TAB}${GATEWAY}${BGN}http://${IP}:8080${CL}"

View File

@@ -0,0 +1,40 @@
{
"name": "Reitti",
"slug": "reitti",
"categories": [
21
],
"date_created": "2025-10-30",
"type": "ct",
"updateable": true,
"privileged": false,
"interface_port": 8080,
"documentation": "https://www.dedicatedcode.com/projects/reitti/",
"config_path": "/opt/reitti/.env",
"website": "https://www.dedicatedcode.com/projects/reitti/",
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/reitti.webp",
"description": "Reitti is a self-hosted location tracking and analysis platform that detects significant places, trip patterns, and integrates with OwnTracks, GPSLogger, and Immich. It uses PostgreSQL + PostGIS, RabbitMQ, Redis, and an optional Photon geocoder.",
"install_methods": [
{
"type": "default",
"script": "ct/reitti.sh",
"resources": {
"cpu": 2,
"ram": 4096,
"hdd": 15,
"os": "debian",
"version": "13"
}
}
],
"default_credentials": {
"username": "admin",
"password": "admin"
},
"notes": [
{
"text": "Photon Geocoder running at http://127.0.0.1:2322. Photon is fully setup, but without sample data. (filesize is big) -> checkout our guide: `https://github.com/community-scripts/ProxmoxVE/discussions/8737`.",
"type": "info"
}
]
}

164
install/reitti-install.sh Normal file
View File

@@ -0,0 +1,164 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2025 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/dedicatedcode/reitti
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 \
redis-server \
rabbitmq-server \
libpq-dev \
zstd
msg_ok "Installed Dependencies"
JAVA_VERSION="24" setup_java
PG_VERSION="17" PG_MODULES="postgis" setup_postgresql
msg_info "Setting up PostgreSQL"
DB_NAME="reitti_db"
DB_USER="reitti"
DB_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;"
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';"
$STD sudo -u postgres psql -d "$DB_NAME" -c "CREATE EXTENSION IF NOT EXISTS postgis;"
$STD sudo -u postgres psql -d "$DB_NAME" -c "CREATE EXTENSION IF NOT EXISTS postgis_topology;"
{
echo "Reitti Credentials"
echo "Database Name: $DB_NAME"
echo "Database User: $DB_USER"
echo "Database Password: $DB_PASS"
} >>~/reitti.creds
msg_ok "PostgreSQL Setup Completed"
msg_info "Configuring RabbitMQ"
RABBIT_USER="reitti"
RABBIT_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"
RABBIT_VHOST="/"
$STD rabbitmqctl add_user "$RABBIT_USER" "$RABBIT_PASS"
$STD rabbitmqctl add_vhost "$RABBIT_VHOST"
$STD rabbitmqctl set_permissions -p "$RABBIT_VHOST" "$RABBIT_USER" ".*" ".*" ".*"
$STD rabbitmqctl set_user_tags "$RABBIT_USER" administrator
{
echo ""
echo "Reitti Credentials"
echo "RabbitMQ User: $RABBIT_USER"
echo "RabbitMQ Password: $RABBIT_PASS"
} >>~/reitti.creds
msg_ok "Configured RabbitMQ"
USE_ORIGINAL_FILENAME="true" fetch_and_deploy_gh_release "reitti" "dedicatedcode/reitti" "singlefile" "latest" "/opt/reitti" "reitti-app.jar"
mv /opt/reitti/reitti-*.jar /opt/reitti/reitti.jar
USE_ORIGINAL_FILENAME="true" fetch_and_deploy_gh_release "photon" "komoot/photon" "singlefile" "latest" "/opt/photon" "photon-0*.jar"
mv /opt/photon/photon-*.jar /opt/photon/photon.jar
msg_info "Creating Reitti Configuration-File"
cat <<EOF >/opt/reitti/application.properties
# Reitti Server Base URI
reitti.server.advertise-uri=http://127.0.0.1:8080
# PostgreSQL Database Connection
spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/$DB_NAME
spring.datasource.username=$DB_USER
spring.datasource.password=$DB_PASS
spring.datasource.driver-class-name=org.postgresql.Driver
# Flyway Database Migrations
spring.flyway.enabled=true
spring.flyway.locations=classpath:db/migration
spring.flyway.baseline-on-migrate=true
# RabbitMQ (Message Queue)
spring.rabbitmq.host=127.0.0.1
spring.rabbitmq.port=5672
spring.rabbitmq.username=$RABBIT_USER
spring.rabbitmq.password=$RABBIT_PASS
# Redis (Cache)
spring.data.redis.host=127.0.0.1
spring.data.redis.port=6379
# Server Port
server.port=8080
# Optional: Logging & Performance
logging.level.root=INFO
spring.jpa.hibernate.ddl-auto=none
spring.datasource.hikari.maximum-pool-size=10
# OIDC / Security Settings
reitti.security.oidc.registration.enabled=false
# Photon (Geocoding)
PHOTON_BASE_URL=http://127.0.0.1:2322
PROCESSING_WAIT_TIME=15
PROCESSING_BATCH_SIZE=1000
PROCESSING_WORKERS_PER_QUEUE=4-16
# Disable potentially dangerous features unless needed
DANGEROUS_LIFE=false
EOF
msg_ok "Created Configuration-File for Reitti"
msg_info "Creating Services"
cat <<EOF >/etc/systemd/system/reitti.service
[Unit]
Description=Reitti
After=network.target postgresql.service redis-server.service rabbitmq-server.service photon.service
Wants=postgresql.service redis-server.service rabbitmq-server.service photon.service
[Service]
Type=simple
WorkingDirectory=/opt/reitti/
ExecStart=/usr/bin/java --enable-native-access=ALL-UNNAMED -jar -Xmx2g reitti.jar
TimeoutStopSec=20
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
cat <<'EOF' >/etc/systemd/system/photon.service
[Unit]
Description=Photon Geocoding Service (Germany, OpenSearch)
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/photon
ExecStart=/usr/bin/java -Xmx4g -jar photon.jar \
-data-dir /opt/photon \
-listen-port 2322 \
-listen-ip 0.0.0.0 \
-cors-any
Restart=on-failure
TimeoutStopSec=20
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now photon
systemctl enable -q --now reitti
msg_ok "Created Services"
motd_ssh
customize
msg_info "Cleaning up"
$STD apt -y autoremove
$STD apt -y autoclean
$STD apt -y clean
msg_ok "Cleaned"

View File

@@ -368,6 +368,51 @@ run_container_safe() {
" || __handle_general_error "lxc-attach to CT $ct"
}
cleanup_lxc() {
msg_info "Cleaning up"
if is_alpine; then
$STD apk cache clean || true
rm -rf /var/cache/apk/*
else
$STD apt -y autoremove || true
$STD apt -y autoclean || true
$STD apt -y clean || true
fi
rm -rf /tmp/* /var/tmp/*
# Remove temp files created by mktemp/tempfile
find /tmp /var/tmp -type f -name 'tmp*' -delete 2>/dev/null || true
find /tmp /var/tmp -type f -name 'tempfile*' -delete 2>/dev/null || true
find /var/log -type f -exec truncate -s 0 {} +
# Python pip
if command -v pip &>/dev/null; then pip cache purge || true; fi
# Python uv
if command -v uv &>/dev/null; then uv cache clear || true; fi
# Node.js npm
if command -v npm &>/dev/null; then npm cache clean --force || true; fi
# Node.js yarn
if command -v yarn &>/dev/null; then yarn cache clean || true; fi
# Node.js pnpm
if command -v pnpm &>/dev/null; then pnpm store prune || true; fi
# Go
if command -v go &>/dev/null; then go clean -cache -modcache || true; fi
# Rust cargo
if command -v cargo &>/dev/null; then cargo clean || true; fi
# Ruby gem
if command -v gem &>/dev/null; then gem cleanup || true; fi
# Composer (PHP)
if command -v composer &>/dev/null; then composer clear-cache || true; fi
if command -v journalctl &>/dev/null; then
$STD journalctl --rotate
$STD journalctl --vacuum-time=10m
fi
msg_ok "Cleaned"
}
check_or_create_swap() {
msg_info "Checking for active swap"