Skip to content
dylanpylePublic

About

where i am

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

246 Commits

Folders and files

Repository files navigation

location

My current whereabouts.

A web interface to display a map of locations generated by the somewhere command-line tool.

Available at https://location.dylanpyle.com

The update-location script is run hourly via a cron job on my primary machine.

Map setup

The map is rendered with MapKit JS and needs a token (requires an Apple Developer Program membership):

  1. In the developer portal, create a Maps ID (Certificates, Identifiers & Profiles → Identifiers) and a private key with MapKit JS enabled (→ Keys).
  2. Generate a token at maps.developer.apple.com using that key, with the origin restricted to location.dylanpyle.com.
  3. Paste it into MAPKIT_TOKENS in location.js.

Tokens restricted to a domain never expire, and don't work from any other site, so they're fine to commit. (Tokens without a restriction expire after 7 days.)

Local development

Apple's token generator won't accept localhost, so local development uses a made-up domain instead:

  1. Generate a second token restricted to location.test and paste it into MAPKIT_TOKENS alongside the production one.

  2. Point the domain at your machine:

    echo "127.0.0.1 location.test" | sudo tee -a /etc/hosts
    
  3. Serve the directory with any static server, e.g. python3 -m http.server, and open http://location.test:8000

Inspired by Hundred Rabbits

License

MIT

About

where i am

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages