A Docker-first GPX sharing platform
Go to file
𝘋𝘪𝘳𝘬 9d9736bd0b
document distance helper function
2023-09-22 23:53:59 +02:00
app document distance helper function 2023-09-22 23:53:59 +02:00
.gitignore update to reflect changes in directory structure 2023-09-11 20:18:38 +02:00
Dockerfile combine commands to save one container layer 2023-09-12 21:34:11 +02:00
LICENSE.txt first commit 2023-08-27 02:25:08 +02:00
README.md update readme regarding Docker 2023-09-09 00:50:56 +02:00
devserver.sh update devserver starter for new application location 2023-09-08 21:49:43 +02:00



Deploy with Docker

You have two options: You can either use this package to deploy the container or build the image by yourself using the Dockerfile as source and the cloned repositorys base directory as context. Use your favorite system to obtain or build the image. I intentionally do not give exhaustive instructions on that because everyone prefers something else.

Whatever system you use, make sure that the following things are in order and noticed.

  1. The container exposes port 8000, map this to whatever port on your host you like.
  2. A volume mounted to /gpx/tracks is needed. This is where your GPX tracks need to be uploaded to.
  3. The user inside the container is named gpx and the user is in a group gpx. Make sure the tracks in the volume are accessible by that user. What the permissions look like on your host may vary, use the README.md in the volume as reference.

Things that are not handled by the container

  • Uploading GPX tracks is entirely up to you. Set up a network share from the Docker machine that offers the volume/directory assigned to tracks and copy and paste the files there. Or set up an FTP server pointing to that location. Keep user permissions in mind.
  • HTTPS access is completely ignored. You need to configure your (highly likely already set up) reverse proxy to access whatever port you set up.
  • User management does not exist. This project is a single-user site for sharing GPX tracks in an easy and accessible way.
  • Templating/Integration is not the focus of this. There is a lot of customizability possible using environment variables but there is no API and no template engine planned.

Environment Variables

GPX is fully configurable using environment variables. The example below shows all available environment variables and their default values.

# Basic configuration
GPX_SITE_TITLE   = 'GPX'             # Set the title of the web front-end
GPX_SITE_SUFFIX  = ' - GPX'          # Document title suffix
GPX_SITE_PREFIX  = 'GPX: '           # Site title prefix
GPX_SITE_INDEX   = '<p>Welcome!</p>' # HTML shown on the index page
GPX_SITE_FAVICON = '/favicon.svg'    # Path to a valid favicon file

# Color Values for the web frontend
GPX_STYLE_BG     = '#555753'
GPX_STYLE_TEXT   = '#eeeeec'
GPX_STYLE_ACCENT = '#729fcf'
GPX_STYLE_HOVER  = '#f57900'

# Track configuration
# All default icons for the tracks are loaded from /icons/leaflet-gpx/...
GPX_TRACK_START    = '.../start.png'    # Start point icon
GPX_TRACK_WAYPOINT = '.../waypoint.png' # Waypoint icon
GPX_TRACK_END      = '.../end.png'      # End point icon
GPX_TRACK_SHADOW   = '.../shadow.png'   # Icon shadow effect
GPX_TRACK_COLOR    = '#f57900'          # Default track color

# Leaflet versions/providers (do not change unless 100% sure!)
# All files are delivered by Cloudflares cdnjs
# https://cdnjs.cloudflare.com/ajax/libs/...
GPX_LEAFLET_CSS = '.../leaflet/1.9.4/leaflet.min.css'
GPX_LEAFLET_JS  = '.../leaflet/1.9.4/leaflet.min.js'
GPX_LEAFLET_GPX = '.../leaflet-gpx/1.7.0/gpx.min.js'

# Leaflet tileLayer configuration (do not change unless 100% sure!)
# When replacing the tileLayer make sure to properly set the info text. The
# default uses OSM. You need to set the full text will all needed code and
# text. Here in the example the URL is separated it is split due to display
# reasons: [URL] = http://www.openstreetmap.org/copyright
GPX_TILES_URL  = 'https://tile.openstreetmap.org/{z}/{x}/{y}.png'
GPX_TILES_INFO = '&copy; <a href="[URL]">OpenStreetMap</a>'

Technology used

Displaying the map

The map is being displayed through Leaflet.

Displaying the track overlay

The track overlay is displayed through leaflet-gpx