triglav/README.md -rw-r--r-- 2.7 KiB
807966dcIvan Habunek Import HPS tracks data set, add basic UI 3 months ago


A web for helping out with editing OSM.

Check it out here: https://triglav.bezdomni.net/


  • Elixir 1.11 with Erlang/OTP 23
  • PostgreSQL 13 with PostGIS 3.1
  • osm2pgsql 1.4.0

May work with other versions, but these are tested.

#Quick start

# Define where the database is located
export DATABASE_URL=ecto://user:pass@localhost:5432/triglav_dev

# Install elixir dependencies
mix deps.get

# Install node dependancies
npm install --prefix assets

# Initialize the database
mix ecto.create
mix ecto.migrate

# Import GTFS data from zet.hr
mix triglav.import_zet

# Import OSM data for Croatia from Geofabrik
mix triglav.osmosis_init

# Start server
mix phx.server

The web is hopefully available at http://localhost:4000/



#Nginx config

upstream triglav {
  server max_fails=5 fail_timeout=60s;

server {
    listen 80;
    server_name triglav.bezdomni.net;
    return 301 https://$host$request_uri;

server {
    listen 443;

    server_name triglav.bezdomni.net;

    access_log /var/log/nginx/triglav.bezdomni.net.access.log;
    error_log /var/log/nginx/triglav.bezdomni.net.error.log;

    ssl_certificate     /etc/letsencrypt/live/bezdomni.net/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/bezdomni.net/privkey.pem;
    include             /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam         /etc/letsencrypt/ssl-dhparams.pem;

    location / {
      allow all;

      # Proxy Headers
      proxy_http_version 1.1;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_set_header X-Cluster-Client-Ip $remote_addr;

      # The Important Websocket Bits!
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";

      proxy_pass http://triglav;

#Systemd config


Description=Triglav daemon

ExecStart=/home/ihabunek/projects/triglav/prod/rel/triglav/bin/triglav start
ExecReload=/home/ihabunek/projects/triglav/prod/rel/triglav/bin/triglav restart
ExecStop=/home/ihabunek/projects/triglav/prod/rel/triglav/bin/triglav stop


Enable service (only required once):

sudo systemctl enable triglav.service

Read logs:

journalctl -u service-name.service