Add Reitti installation script

This commit is contained in:
CanbiZ 2025-10-29 13:12:39 +01:00
parent b6812877e5
commit 6cb374c542

View File

@ -15,10 +15,10 @@ update_os
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt install -y \ $STD apt install -y \
redis-server \ redis-server \
rabbitmq-server \ rabbitmq-server \
libpq-dev \ libpq-dev \
zstd zstd
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
JAVA_VERSION="24" setup_java JAVA_VERSION="24" setup_java
@ -36,10 +36,10 @@ $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;"
$STD sudo -u postgres psql -d "$DB_NAME" -c "CREATE EXTENSION IF NOT EXISTS postgis_topology;" $STD sudo -u postgres psql -d "$DB_NAME" -c "CREATE EXTENSION IF NOT EXISTS postgis_topology;"
{ {
echo "Reitti Credentials" echo "Reitti Credentials"
echo "Database Name: $DB_NAME" echo "Database Name: $DB_NAME"
echo "Database User: $DB_USER" echo "Database User: $DB_USER"
echo "Database Password: $DB_PASS" echo "Database Password: $DB_PASS"
} >>~/reitti.creds } >>~/reitti.creds
msg_ok "PostgreSQL Setup Completed" msg_ok "PostgreSQL Setup Completed"
@ -52,10 +52,10 @@ $STD rabbitmqctl add_vhost "$RABBIT_VHOST"
$STD rabbitmqctl set_permissions -p "$RABBIT_VHOST" "$RABBIT_USER" ".*" ".*" ".*" $STD rabbitmqctl set_permissions -p "$RABBIT_VHOST" "$RABBIT_USER" ".*" ".*" ".*"
$STD rabbitmqctl set_user_tags "$RABBIT_USER" administrator $STD rabbitmqctl set_user_tags "$RABBIT_USER" administrator
{ {
echo "" echo ""
echo "Reitti Credentials" echo "Reitti Credentials"
echo "RabbitMQ User: $RABBIT_USER" echo "RabbitMQ User: $RABBIT_USER"
echo "RabbitMQ Password: $RABBIT_PASS" echo "RabbitMQ Password: $RABBIT_PASS"
} >>~/reitti.creds } >>~/reitti.creds
msg_ok "Configured RabbitMQ" msg_ok "Configured RabbitMQ"
@ -66,6 +66,9 @@ mv /opt/photon/photon-*.jar /opt/photon/photon.jar
msg_info "Creating Reitti Configuration-File" msg_info "Creating Reitti Configuration-File"
cat <<EOF >/opt/reitti/application.properties cat <<EOF >/opt/reitti/application.properties
# Reitti Server Base URI
reitti.server.advertise-uri=http://127.0.0.1:8080
# PostgreSQL Database Connection # PostgreSQL Database Connection
spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/$DB_NAME spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/$DB_NAME
spring.datasource.username=$DB_USER spring.datasource.username=$DB_USER
@ -95,6 +98,9 @@ logging.level.root=INFO
spring.jpa.hibernate.ddl-auto=none spring.jpa.hibernate.ddl-auto=none
spring.datasource.hikari.maximum-pool-size=10 spring.datasource.hikari.maximum-pool-size=10
# OIDC / Security Settings
reitti.security.oidc.registration.enabled=false
# Photon (Geocoding) # Photon (Geocoding)
PHOTON_BASE_URL=http://127.0.0.1:2322 PHOTON_BASE_URL=http://127.0.0.1:2322
PROCESSING_WAIT_TIME=15 PROCESSING_WAIT_TIME=15