Repository navigation
Add admin page, browser location, privacy explainer - #3
Merged
Merged
Conversation
- /admin/ behind HTTP basic auth (ADMIN_PASSWORD): list and filter pins, edit location and nickname, delete, export JSON. Replaces /export/json and EXPORT_PASSWORD. Forms carry a session CSRF token since browsers resend basic auth automatically. - "Use my current location" button: coordinates are rounded to one decimal (about 11 km) in the browser and again on the server, and the label comes from a Nominatim reverse lookup at town level. - Every pin is now stored at about 11 km precision, including typed locations. The release phase rounds existing pins too (idempotent). - Privacy explainer dialog on the map page, honeypot spam field, member count in the header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WLRZ1bCeX4qyg1QpD6AQFG
Typed places must geocode to something with a country, which rules out "Atlantic Ocean" and the like. Browser locations must reverse-geocode to a country too, so a pin out at sea is rejected instead of being labeled with bare coordinates. The browser now rounds to about 1 km before sending. The server names the place from that, then stores the pin at about 10 km as before, so a coastal town that rounds into the water is still accepted. The privacy explainer says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WLRZ1bCeX4qyg1QpD6AQFG
- Pins store their country (new column, added by init-db). New pins get it from the geocoder; `flask check-pins` fills it in for older pins at Nominatim's one request per second, from the typed text first and the coordinates second, and can be stopped and rerun. - The admin flags pins that aren't in any country, duplicates of an older pin, and links in the location or nickname, with a filter per flag and checkboxes to delete the selection in one go. - geo returns a Place (name, country, coordinates) for both lookups. - CLI commands push an app context themselves, so they also work from app.cli in tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WLRZ1bCeX4qyg1QpD6AQFG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Dan · project thread
What
Admin page (
/admin/)ADMIN_PASSWORDconfig var (any username). It returns 404 when the var is unset./export/jsonandEXPORT_PASSWORD.Flagging bad pins
countrycolumn, whichinit-dbadds. New pins get the country from the geocoder.flask --app members_map check-pinsfills in the country for older pins at Nominatim's rate of one request per second. It tries the typed text first and falls back to the coordinates. It can be stopped and rerun.Use my current location
Privacy
init-db) also rounds existing pins. It's idempotent and touches only rows that aren't rounded yet.Only real places
Small extras
Testing
uv run pytest: 58 passed. Ruff is clean.Deploy notes
ADMIN_PASSWORDin Heroku config vars.EXPORT_PASSWORDis no longer used.heroku run -a members-map flask --app members_map check-pinsonce. It takes about 20 to 40 minutes for roughly 1,000 pins.pg:backups:capturefirst if you want the original coordinates.https://claude.ai/code/session_01WLRZ1bCeX4qyg1QpD6AQFG
Generated by Claude Code