Update reitti-install.sh
This commit is contained in:
parent
b3803fd525
commit
7daa031001
@ -64,38 +64,47 @@ 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"
|
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
|
mv /opt/photon/photon-*.jar /opt/photon/photon.jar
|
||||||
|
|
||||||
msg_info "Creating Reitti Environment (.env)"
|
msg_info "Creating Reitti Configuration-File"
|
||||||
cat <<EOF >/opt/reitti/.env
|
cat <<'EOF' >/opt/reitti/application.properties
|
||||||
# PostgreSQL (PostGIS)
|
# ─── Database (PostgreSQL/PostGIS) ──────────────────────────────────
|
||||||
POSTGIS_HOST=127.0.0.1
|
spring.datasource.url=jdbc:postgresql://${POSTGIS_HOST}:${POSTGIS_PORT}/${POSTGIS_DB}
|
||||||
POSTGIS_PORT=5432
|
spring.datasource.username=${POSTGIS_USER}
|
||||||
POSTGIS_DB=$DB_NAME
|
spring.datasource.password=${POSTGIS_PASSWORD}
|
||||||
POSTGIS_USER=$DB_USER
|
spring.datasource.driver-class-name=org.postgresql.Driver
|
||||||
POSTGIS_PASSWORD=$DB_PASS
|
|
||||||
|
|
||||||
# RabbitMQ
|
# ─── Flyway Migration ───────────────────────────────────────────────
|
||||||
RABBITMQ_HOST=127.0.0.1
|
spring.flyway.enabled=true
|
||||||
RABBITMQ_PORT=5672
|
spring.flyway.locations=classpath:db/migration
|
||||||
RABBITMQ_USER=$RABBIT_USER
|
spring.flyway.baseline-on-migrate=true
|
||||||
RABBITMQ_PASSWORD=$RABBIT_PASS
|
|
||||||
RABBITMQ_VHOST=/
|
|
||||||
|
|
||||||
# Redis
|
# ─── RabbitMQ ───────────────────────────────────────────────────────
|
||||||
REDIS_HOST=127.0.0.1
|
spring.rabbitmq.host=${RABBITMQ_HOST}
|
||||||
REDIS_PORT=6379
|
spring.rabbitmq.port=${RABBITMQ_PORT}
|
||||||
|
spring.rabbitmq.username=${RABBITMQ_USER}
|
||||||
|
spring.rabbitmq.password=${RABBITMQ_PASSWORD}
|
||||||
|
spring.rabbitmq.virtual-host=${RABBITMQ_VHOST}
|
||||||
|
|
||||||
# Photon (Geocoding)
|
# ─── Redis ─────────────────────────────────────────────────────────
|
||||||
PHOTON_BASE_URL=http://127.0.0.1:2322
|
spring.redis.host=${REDIS_HOST}
|
||||||
PROCESSING_WAIT_TIME=15
|
spring.redis.port=${REDIS_PORT}
|
||||||
PROCESSING_BATCH_SIZE=1000
|
# spring.redis.username=${REDIS_USERNAME}
|
||||||
PROCESSING_WORKERS_PER_QUEUE=4-16
|
# spring.redis.password=${REDIS_PASSWORD}
|
||||||
|
|
||||||
# General
|
# ─── Photon / Processing ────────────────────────────────────────────
|
||||||
SERVER_PORT=8080
|
reitti.photon.base-url=${PHOTON_BASE_URL}
|
||||||
LOGGING_LEVEL=INFO
|
reitti.processing.wait-time=${PROCESSING_WAIT_TIME}
|
||||||
DANGEROUS_LIFE=false
|
reitti.processing.batch-size=${PROCESSING_BATCH_SIZE}
|
||||||
|
reitti.processing.workers-per-queue=${PROCESSING_WORKERS_PER_QUEUE}
|
||||||
|
|
||||||
|
# ─── Application Server / Logging ───────────────────────────────────
|
||||||
|
server.port=${SERVER_PORT}
|
||||||
|
logging.level.root=${LOGGING_LEVEL}
|
||||||
|
|
||||||
|
# ─── Misc / Safety ─────────────────────────────────────────────────
|
||||||
|
reitti.dangerous-life=${DANGEROUS_LIFE}
|
||||||
|
spring.jpa.hibernate.ddl-auto=none
|
||||||
EOF
|
EOF
|
||||||
msg_ok "Created .env for Reitti"
|
msg_ok "Created Configuration-File for Reitti"
|
||||||
|
|
||||||
msg_info "Creating Services"
|
msg_info "Creating Services"
|
||||||
cat <<EOF >/etc/systemd/system/reitti.service
|
cat <<EOF >/etc/systemd/system/reitti.service
|
||||||
@ -107,8 +116,8 @@ Wants=postgresql.service redis-server.service rabbitmq-server.service photon.ser
|
|||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
WorkingDirectory=/opt/reitti/
|
WorkingDirectory=/opt/reitti/
|
||||||
EnvironmentFile=/opt/reitti/.env
|
ExecStart=/usr/bin/java -jar /opt/reitti/reitti.jar \
|
||||||
ExecStart=/usr/bin/java --enable-native-access=ALL-UNNAMED -jar -Xmx2g reitti.jar
|
--spring.config.location=file:/opt/reitti/application.properties
|
||||||
TimeoutStopSec=20
|
TimeoutStopSec=20
|
||||||
KillMode=process
|
KillMode=process
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user