|
||
---|---|---|
app | ||
.gitignore | ||
Dockerfile | ||
LICENSE.txt | ||
README.md | ||
devserver.sh |
README.md
WIP
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 repository’s 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.
- The container exposes port 8000, map this to whatever port on your host you like.
- A volume mounted to
/gpx/tracks
is needed. This is where your GPX tracks need to be uploaded to. - The user inside the container is named
gpx
and the user is in a groupgpx
. Make sure the tracks in the volume are accessible by that user. What the permissions look like on your host may vary, use theREADME.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 Cloudflare’s 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 = '© <a href="[URL]">OpenStreetMap</a>'
Technology used
Displaying the map
The map is being displayed through Leaflet.
- https://github.com/Leaflet/Leaflet
- License: BSD-2-Clause license
- © 2010–2023 Volodymyr Agafonkin
- Maps © OpenStreetMap contributors
Displaying the track overlay
The track overlay is displayed through leaflet-gpx
- https://github.com/mpetazzoni/leaflet-gpx
- License: BSD-2-Clause license
- Copyright (C) 2011-2012 Pavel Shramov
- Copyright (C) 2013-2017 Maxime Petazzoni maxime.petazzoni@bulix.org