Commit graph

88 commits

Author SHA1 Message Date
Vinayak Kulkarni
9b64093c42
style: fix lint issues in code 🕺 (#626)
* style: fix lint issues in code 🕺

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* style: lint fix all files

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* chore: add `keywords` for better reach

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* feat: add `husky` & `commitlint`

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* chore: ignore `public` directory

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* revert: do not lint `public` directory

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* style: fix issues with lint

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* feat: add eslint config

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* feat: add lint-staged

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* style: lint fix all file(s)

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* fix: ignore rules for light version

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* fix: remove unnecessary space

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* chore(deps): update lockfile

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* style: autofix linting issue(s)

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
2022-11-08 22:56:07 -05:00
Andrew Calcutt
b6e2d101eb
Fix HUP kill not reloading config (#630)
* try to fix HUP config reset
* remove..outdated?.. require.cache
2022-10-28 11:53:21 -04:00
benedikt-brandtner-bikemap
f3f63498a8
Extended Static-Images Endpoint (#619)
* extended staticmap capabilities

* added allowRemoteMarkerIcons configuration option and restricted fetching of remote marker icons only when option is set to true;
asynchronously load all available icons in a settings object on server startup;
replaced fs.existsSync() call in serve_rendered when drawing marker icons with a check against available icons settings object;

* updated documentation for linecap parameter in staticmaps endpoint;
added linejoin parameter to staticmaps endpoint;

* added capability of staticmap endpoint to draw multiple paths
2022-10-27 22:55:46 -04:00
Monstrofil
38604c0a45
Bugfix: publicUrl is not used in some urls (#605)
In WMTS the publicUrl path was missed and it was not working properly.
Similar story about wmts.tmpl: the baseUrl is not working properly when
tileserver is hidden behind the proxy with different root path.

* Minor bugfix: make baseUrl always use '/' in the end

Co-authored-by: Oleksandr Shyshatskyi <oshyshatskyi@cloudlinux.com>
Co-authored-by: acalcutt <acalcutt@techidiots.net>
2022-09-30 09:18:13 -04:00
Andrew Calcutt
b2bd5eaa96
Convert to esm module syntax (#606)
* switch to esm module

* Update package.json

* change to maplibre package

* fix tests

* eslint

* remove extra package updates

* Delete package-lock.json

* change 'fs' to 'node:fs'

* put back node 10.

without the package updates this still works

* remove trailing commas

* remove unassociated fix / formatting

* remove unassociated fix

* remove eslint from this PR

* remove unassociated fix

* lint

* Merge remote-tracking branch 'upstream/master' into esm_update

* fix mlgl

* update maplibre-native to new version with arm64

* update minor version
2022-09-28 14:41:55 -04:00
David Weber | geOps
309d481117 fix crash in serveAllFonts
variable file does not exist. Backtrace

ReferenceError: file is not defined
  at serve_style.add (/usr/src/app/src/server.js:139:44)
  at Proxy.add (/usr/src/app/src/serve_style.js:115:28)
  at addStyle (/usr/src/app/src/server.js:121:31)
  at fs.readdir (/usr/src/app/src/server.js:215:11)
  at args (fs.js:140:20)
  at internal/util.js:370:14
  at getDirents (internal/fs/utils.js:149:7)
  at FSReqWrap.req.oncomplete (fs.js:775:7)
2020-10-16 09:15:10 +02:00
Daniel Korp
10431d70d0
Fix reflected XSS in 'key' parameter. Fixes #461 2020-07-02 09:30:33 +02:00
Hermann Schwarting
79bd70942b Fix preview thumbnail for raster data sources
The data sources structure was changed in the 'dynamic_styles' branch
introducing a tileJSON object. Adapt the code filling the preview
template to the change to get the correct file format instead of
"undefined".

See also f2dc13e.

Fix #440 Preview thumbnail missing for raster data source -- file suffix
"undefined"
2020-04-22 21:08:55 +02:00
Petr Sloup
13415fd29f Minor tileserver-gl-light fix 2020-03-11 09:24:10 +01:00
Petr Sloup
f2dc13e298 Minor tilejson-reading fix when decorating templates 2020-02-10 14:14:07 +01:00
Petr Sloup
ea89d11021 Use chokidar instead of node-watch to poll the files (required for docker) 2020-01-15 09:26:59 +01:00
Petr Sloup
d7a34f3a74 Add "serveAllStyles" option + watch the directory 2020-01-07 15:59:38 +01:00
Petr Sloup
cb700181d3 Refactor style/rendered/data serving to allow for dynamic adding/removing of items 2020-01-07 14:32:30 +01:00
Yuri Astrakhan
7f8be27844 Update code to ES6
* var  ->  let / const
* [].forEach  ->  for (... of ...)
* '...' + var  ->  template strings  `...${var}`
* function  ->  arrow functions `=>`
* use === and !==  instead of == and !=
2019-12-21 14:09:20 -05:00
Petr Sloup
e506014763 Minor /styles.json fix (close #361) 2019-04-29 06:48:23 +02:00
adrian
9dda95ee8e let the user define a log file or a log format
log file defaults to standard out.

log format defaults to current behavior ('tiny' for production, 'dev' for dev, and not enabled in test)
2019-04-13 11:55:37 -04:00
Alban Mouton
c99a1a5425 Merge remote-tracking branch 'klokantech/master' into public_url
# Conflicts:
#	src/main.js
#	src/server.js
2018-12-19 09:53:40 +01:00
Måns Beckman
76a0064f0c Remove unused variables 2018-09-13 17:57:06 +02:00
Måns Beckman
e8b3c02546 Fix formating 2018-09-11 17:51:38 +02:00
Måns Beckman
56089c0a62 Remove base64url 2018-09-11 17:47:44 +02:00
Måns Beckman
71fab2a2a1 Add support for WMTS capabilites
https://github.com/klokantech/tileserver-gl/issues/274

Clean up wmts template with correct syntax

Update endpoint URL and change content type

After a good nights sleep I considered the structure of the endpoint link for WMTS, at the same time I cleaned up the code and added the correct content type for the response.
2018-08-21 19:33:37 +02:00
Michal Illovsky
c333197a7c Skipping also 304 status codes when in silent mode 2018-03-22 09:02:09 +01:00
Michal Illovsky
45df72df51 Enable silent mode with -s option to not log successful request (status=200) 2018-03-19 13:47:17 +01:00
Tim Schaub
cd1f5fd04a Return after rejecting, catch and log 2017-10-23 09:46:04 -06:00
Alban Mouton
dc6be5047c missing public_url in tiles urls 2017-10-18 14:49:10 +02:00
Alban Mouton
875521c5a8 add public_url option 2017-10-18 13:51:37 +02:00
Petr Sloup
42f24c2c99 Add concept of data decorator function 2017-07-28 09:53:32 +02:00
Petr Sloup
698c527e94 Change endpoint URLs (close #154)
- styles at /style/{id}/style.json
- rendered tiles at /style/{id}/{z}/{x}/{y}.{format}
- TileJSONs at /style/{id}.json
2017-06-22 16:37:32 +02:00
Petr Sloup
5d93b1d4f9 Add healthcheck endpoint (close #140) 2017-05-10 08:57:51 +02:00
Petr Sloup
d30027e992 Modify all serve_* modules to return a Promise (preparation for #140) 2017-05-10 08:56:43 +02:00
Petr Sloup
d67a57861d Merge pull request #155 from tschaub/reconfigure-on-sighup
Reload configuration on SIGHUP
2017-05-04 11:02:48 +02:00
Tim Schaub
a199008fa3 Enclose literal IPv6 addresses in brackets 2017-04-28 07:28:49 -07:00
Tim Schaub
e88b786073 Reload configuration on SIGHUP 2017-04-28 07:13:34 -07:00
Tim Schaub
a234041cd1 Remove unused callback 2017-04-26 08:02:18 -07:00
Damian Krzeminski
6c23d95feb add --cors option to allow for optional CORS handling
we are using `cors` middleware with default options which works for most
applications, but does not allow for fine tuning (whitelisting origins
etc.)

this change keeps CORS handling as default to preserve compatibility but
also allows for specying `--no-cors` option which makes it possible to
handle CORS in an independent proxy (NGINX, another node app etc.)
2017-04-12 09:43:43 -07:00
Petr Sloup
f6580c0342 Improved request logging 2017-04-04 18:46:18 +02:00
Petr Sloup
1e402ed207 Add possibility to change the front page (close #128) 2017-03-15 15:50:58 +01:00
Petr Sloup
37386bfb29 Hide empty headers on index (close #125) 2017-03-14 16:02:54 +01:00
Petr Sloup
6231f9f7a7 Configurable optional alias for .pbf tiles (#109) 2017-01-25 15:30:58 +01:00
Petr Sloup
01fbaad962 Check configured paths exist on startup 2017-01-19 14:20:41 +01:00
Petr Sloup
b48f7edc1d Serve fontstacks.json and possibly fonts even without any style 2017-01-12 15:23:02 +01:00
Petr Sloup
6d68c93871 Fix broken requires 2017-01-12 14:05:02 +01:00
Petr Sloup
d05606de4d Improved font serving 2017-01-10 16:17:51 +01:00
Petr Sloup
0ec992eb21 Explicitly handle SIGINT to terminate on Ctrl+C from docker
See https://github.com/nodejs/node/issues/4182
2016-12-21 06:49:16 +01:00
Petr Sloup
557f83121c Fix URLs in /index.json and /rendered.json 2016-12-20 13:56:23 +01:00
Petr Sloup
1aaabd2dff Experimental integration of first plugin 2016-12-06 20:11:18 +01:00
Petr Sloup
15ed6d74bf Fix incorrect XYZ URLs (close #58) 2016-10-07 15:21:12 +02:00
Petr Sloup
f9f26f0d65 Indicate clearly when running light version on index.html 2016-08-25 10:44:29 +02:00
Petr Sloup
e9cad399c9 New "mbtiles://{name}" reference syntax (#27) 2016-08-21 10:08:17 +02:00
Petr Sloup
f524f1465e Fix race condition 2016-08-20 14:29:10 +02:00