- Introduced .editorconfig for consistent coding styles across the project. - Added .golangci.yml for Go linting configuration. - Updated AGENTS.md to clarify project structure and components. - Enhanced CONTRIBUTING.md with Makefile usage for common tasks. - Updated Dockerfiles to use Go 1.24 and improved build instructions. - Refined README.md and deployment documentation for clarity. - Added testing documentation in testing.md for backend and frontend tests. - Introduced Makefile for streamlined development commands and tasks.
1.9 KiB
1.9 KiB
Deployment
Docker
The image is built from the repository. Inside the container the application listens on port 8080 and expects the data directory to be mounted at /map (database and grid images).
Example run:
docker run -v /srv/hnh-map:/map -p 80:8080 hnh-map
Or with environment variables:
docker run -v /srv/hnh-map:/map -p 8080:8080 \
-e HNHMAP_PORT=8080 \
-e HNHMAP_BOOTSTRAP_PASSWORD=your-secure-password \
hnh-map
It is recommended to remove or stop passing HNHMAP_BOOTSTRAP_PASSWORD after initial setup.
To build the image locally:
docker build -t hnh-map .
OAuth (Google)
To enable login via Google OAuth:
- Create a project in Google Cloud Console.
- Enable "Google+ API" / "Google Identity" and create an OAuth 2.0 Client ID (type "Web application").
- In the client settings, add the Authorized redirect URI:
https://your-domain.com/map/api/oauth/google/callback(replace with your domain). - Set the following environment variables:
HNHMAP_OAUTH_GOOGLE_CLIENT_ID— Client IDHNHMAP_OAUTH_GOOGLE_CLIENT_SECRET— Client SecretHNHMAP_BASE_URL— full application URL (e.g.https://map.example.com) for forming the redirect_uri. If not set, it is derived from theHostandX-Forwarded-*headers.
Reverse proxy
Place the service behind nginx, Traefik, Caddy, etc. on the desired domain. Proxy all traffic to port 8080 of the container (or whichever port the application is listening on). The application serves the SPA at root / (/, /login, /profile, /admin, etc.), the API at /map/api/, SSE at /map/updates, and tiles at /map/grids/.
Updates and backups
- When updating the image, preserve the volume at
/map: it containsgrids.dband tile image directories. - Regularly back up the data directory (and use the admin panel "Export" feature if needed).