Skip to content

Commit 8896e6c

Browse files
push-app-to-main[bot]MickLesktremor021
authored
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 <[email protected]> Co-authored-by: Slaviša Arežina <[email protected]>
1 parent 7c583c7 commit 8896e6c

File tree

4 files changed

+278
-0
lines changed

4 files changed

+278
-0
lines changed

ct/headers/reitti

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
____ _ __ __ _
2+
/ __ \___ (_) /_/ /_(_)
3+
/ /_/ / _ \/ / __/ __/ /
4+
/ _, _/ __/ / /_/ /_/ /
5+
/_/ |_|\___/_/\__/\__/_/
6+

ct/reitti.sh

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/dedicatedcode/reitti
7+
8+
APP="Reitti"
9+
var_tags="${var_tags:-location-tracker}"
10+
var_cpu="${var_cpu:-2}"
11+
var_ram="${var_ram:-4096}"
12+
var_disk="${var_disk:-15}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-13}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
if [[ ! -f /opt/reitti/reitti.jar ]]; then
27+
msg_error "No ${APP} Installation Found!"
28+
exit
29+
fi
30+
if check_for_gh_release "reitti" "dedicatedcode/reitti"; then
31+
msg_info "Stopping Service"
32+
systemctl stop reitti
33+
msg_ok "Stopped Service"
34+
35+
rm -f /opt/reitti/reitti.jar
36+
USE_ORIGINAL_FILENAME="true" fetch_and_deploy_gh_release "reitti" "dedicatedcode/reitti" "singlefile" "latest" "/opt/reitti" "reitti-app.jar"
37+
mv /opt/reitti/reitti-*.jar /opt/reitti/reitti.jar
38+
39+
msg_info "Starting Service"
40+
systemctl start reitti
41+
msg_ok "Started Service"
42+
msg_ok "Updated Successfully!"
43+
fi
44+
if check_for_gh_release "photon" "dedicatedcode/reitti"; then
45+
msg_info "Stopping Service"
46+
systemctl stop photon
47+
msg_ok "Stopped Service"
48+
49+
rm -f /opt/photon/photon.jar
50+
USE_ORIGINAL_FILENAME="true" fetch_and_deploy_gh_release "photon" "komoot/photon" "singlefile" "latest" "/opt/photon" "photon-0*.jar"
51+
mv /opt/photon/photon-*.jar /opt/photon/photon.jar
52+
53+
msg_info "Starting Service"
54+
systemctl start photon
55+
msg_ok "Started Service"
56+
msg_ok "Updated Successfully!"
57+
fi
58+
exit
59+
}
60+
61+
start
62+
build_container
63+
description
64+
65+
msg_ok "Completed Successfully!\n"
66+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
67+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
68+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8080${CL}"

frontend/public/json/reitti.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "Reitti",
3+
"slug": "reitti",
4+
"categories": [
5+
21
6+
],
7+
"date_created": "2025-10-30",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 8080,
12+
"documentation": "https://www.dedicatedcode.com/projects/reitti/",
13+
"config_path": "/opt/reitti/.env",
14+
"website": "https://www.dedicatedcode.com/projects/reitti/",
15+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/reitti.webp",
16+
"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.",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/reitti.sh",
21+
"resources": {
22+
"cpu": 2,
23+
"ram": 4096,
24+
"hdd": 15,
25+
"os": "debian",
26+
"version": "13"
27+
}
28+
}
29+
],
30+
"default_credentials": {
31+
"username": "admin",
32+
"password": "admin"
33+
},
34+
"notes": [
35+
{
36+
"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´.",
37+
"type": "info"
38+
}
39+
]
40+
}

install/reitti-install.sh

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/dedicatedcode/reitti
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt install -y \
18+
redis-server \
19+
rabbitmq-server \
20+
libpq-dev \
21+
zstd
22+
msg_ok "Installed Dependencies"
23+
24+
JAVA_VERSION="24" setup_java
25+
PG_VERSION="17" PG_MODULES="postgis" setup_postgresql
26+
27+
msg_info "Setting up PostgreSQL"
28+
DB_NAME="reitti_db"
29+
DB_USER="reitti"
30+
DB_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"
31+
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
32+
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;"
33+
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
34+
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
35+
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';"
36+
$STD sudo -u postgres psql -d "$DB_NAME" -c "CREATE EXTENSION IF NOT EXISTS postgis;"
37+
$STD sudo -u postgres psql -d "$DB_NAME" -c "CREATE EXTENSION IF NOT EXISTS postgis_topology;"
38+
{
39+
echo "Reitti Credentials"
40+
echo "Database Name: $DB_NAME"
41+
echo "Database User: $DB_USER"
42+
echo "Database Password: $DB_PASS"
43+
} >>~/reitti.creds
44+
msg_ok "PostgreSQL Setup Completed"
45+
46+
msg_info "Configuring RabbitMQ"
47+
RABBIT_USER="reitti"
48+
RABBIT_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"
49+
RABBIT_VHOST="/"
50+
$STD rabbitmqctl add_user "$RABBIT_USER" "$RABBIT_PASS"
51+
$STD rabbitmqctl add_vhost "$RABBIT_VHOST"
52+
$STD rabbitmqctl set_permissions -p "$RABBIT_VHOST" "$RABBIT_USER" ".*" ".*" ".*"
53+
$STD rabbitmqctl set_user_tags "$RABBIT_USER" administrator
54+
{
55+
echo ""
56+
echo "Reitti Credentials"
57+
echo "RabbitMQ User: $RABBIT_USER"
58+
echo "RabbitMQ Password: $RABBIT_PASS"
59+
} >>~/reitti.creds
60+
msg_ok "Configured RabbitMQ"
61+
62+
USE_ORIGINAL_FILENAME="true" fetch_and_deploy_gh_release "reitti" "dedicatedcode/reitti" "singlefile" "latest" "/opt/reitti" "reitti-app.jar"
63+
mv /opt/reitti/reitti-*.jar /opt/reitti/reitti.jar
64+
USE_ORIGINAL_FILENAME="true" fetch_and_deploy_gh_release "photon" "komoot/photon" "singlefile" "latest" "/opt/photon" "photon-0*.jar"
65+
mv /opt/photon/photon-*.jar /opt/photon/photon.jar
66+
67+
msg_info "Creating Reitti Configuration-File"
68+
cat <<EOF >/opt/reitti/application.properties
69+
# Reitti Server Base URI
70+
reitti.server.advertise-uri=http://127.0.0.1:8080
71+
72+
# PostgreSQL Database Connection
73+
spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/$DB_NAME
74+
spring.datasource.username=$DB_USER
75+
spring.datasource.password=$DB_PASS
76+
spring.datasource.driver-class-name=org.postgresql.Driver
77+
78+
# Flyway Database Migrations
79+
spring.flyway.enabled=true
80+
spring.flyway.locations=classpath:db/migration
81+
spring.flyway.baseline-on-migrate=true
82+
83+
# RabbitMQ (Message Queue)
84+
spring.rabbitmq.host=127.0.0.1
85+
spring.rabbitmq.port=5672
86+
spring.rabbitmq.username=$RABBIT_USER
87+
spring.rabbitmq.password=$RABBIT_PASS
88+
89+
# Redis (Cache)
90+
spring.data.redis.host=127.0.0.1
91+
spring.data.redis.port=6379
92+
93+
# Server Port
94+
server.port=8080
95+
96+
# Optional: Logging & Performance
97+
logging.level.root=INFO
98+
spring.jpa.hibernate.ddl-auto=none
99+
spring.datasource.hikari.maximum-pool-size=10
100+
101+
# OIDC / Security Settings
102+
reitti.security.oidc.registration.enabled=false
103+
104+
# Photon (Geocoding)
105+
PHOTON_BASE_URL=http://127.0.0.1:2322
106+
PROCESSING_WAIT_TIME=15
107+
PROCESSING_BATCH_SIZE=1000
108+
PROCESSING_WORKERS_PER_QUEUE=4-16
109+
110+
# Disable potentially dangerous features unless needed
111+
DANGEROUS_LIFE=false
112+
EOF
113+
msg_ok "Created Configuration-File for Reitti"
114+
115+
msg_info "Creating Services"
116+
cat <<EOF >/etc/systemd/system/reitti.service
117+
[Unit]
118+
Description=Reitti
119+
After=network.target postgresql.service redis-server.service rabbitmq-server.service photon.service
120+
Wants=postgresql.service redis-server.service rabbitmq-server.service photon.service
121+
122+
[Service]
123+
Type=simple
124+
WorkingDirectory=/opt/reitti/
125+
ExecStart=/usr/bin/java --enable-native-access=ALL-UNNAMED -jar -Xmx2g reitti.jar
126+
TimeoutStopSec=20
127+
KillMode=process
128+
Restart=on-failure
129+
130+
[Install]
131+
WantedBy=multi-user.target
132+
EOF
133+
134+
cat <<'EOF' >/etc/systemd/system/photon.service
135+
[Unit]
136+
Description=Photon Geocoding Service (Germany, OpenSearch)
137+
After=network.target
138+
139+
[Service]
140+
Type=simple
141+
WorkingDirectory=/opt/photon
142+
ExecStart=/usr/bin/java -Xmx4g -jar photon.jar \
143+
-data-dir /opt/photon \
144+
-listen-port 2322 \
145+
-listen-ip 0.0.0.0 \
146+
-cors-any
147+
Restart=on-failure
148+
TimeoutStopSec=20
149+
150+
[Install]
151+
WantedBy=multi-user.target
152+
EOF
153+
systemctl enable -q --now photon
154+
systemctl enable -q --now reitti
155+
msg_ok "Created Services"
156+
157+
motd_ssh
158+
customize
159+
160+
msg_info "Cleaning up"
161+
$STD apt -y autoremove
162+
$STD apt -y autoclean
163+
$STD apt -y clean
164+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)