{"id":42453957,"url":"https://github.com/mapswipe/mapswipe-firebase","last_synced_at":"2026-01-28T08:53:11.089Z","repository":{"id":275926290,"uuid":"927612489","full_name":"mapswipe/mapswipe-firebase","owner":"mapswipe","description":"Firebase configuration for Mapswipe","archived":false,"fork":false,"pushed_at":"2025-11-20T14:29:39.000Z","size":501,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-12-24T19:47:07.936Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mapswipe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-05T08:48:34.000Z","updated_at":"2025-10-30T04:00:00.000Z","dependencies_parsed_at":"2025-02-05T10:36:14.216Z","dependency_job_id":"59a893d3-d49f-4a47-80e2-a757c05bddc9","html_url":"https://github.com/mapswipe/mapswipe-firebase","commit_stats":null,"previous_names":["mapswipe/mapswipe-firebase"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mapswipe/mapswipe-firebase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapswipe%2Fmapswipe-firebase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapswipe%2Fmapswipe-firebase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapswipe%2Fmapswipe-firebase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapswipe%2Fmapswipe-firebase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mapswipe","download_url":"https://codeload.github.com/mapswipe/mapswipe-firebase/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapswipe%2Fmapswipe-firebase/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28842944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T07:39:25.367Z","status":"ssl_error","status_checked_at":"2026-01-28T07:39:24.487Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-28T08:53:10.378Z","updated_at":"2026-01-28T08:53:11.075Z","avatar_url":"https://github.com/mapswipe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Firebase\n\n## Deploy Changes to Firebase\nMake sure that you have access to a firebase account.\n\nCreate a docker image from the latest data.\n* `docker-compose build firebase_image`\n\nAlternatively you could do\n* `sudo docker build -t firebase_image .`\n\nThen run the container interactively and open a bash shell.\n* `sudo docker run -it firebase_image /bin/bash`\n\nNow you are inside the docker container and can login to firebase. You need to insert an authorization code into the terminal during that process.\n* `firebase login --no-localhost`\n\nFinally you can deploy your changes for cloud functions and database rules individually. Hosting must be done as well to\nexpose the authentication functions publicly.\n* `firebase deploy --only functions,hosting`\n* `firebase deploy --only database:rules`\n\n## Notes on OAuth (OSM login)\n\nRefer to [the notes in the app repository](https://github.com/mapswipe/mapswipe/blob/master/docs/osm_login.md).\n\nSome specifics about the related functions:\n - get a service-account.json file from firebase which allows the OAuth functions to access the database and call\n   external URLs (this last point only works on a firebase Blaze plan)\n- Before deploying, set the required firebase config values in environment:\nFIXME: replace env vars with config value names\n  - OSM_OAUTH_REDIRECT_URI `osm.redirect_uri`: `https://dev-auth.mapswipe.org/token` or `https://auth.mapswipe.org/token`\n  - OSM_OAUTH_APP_LOGIN_LINK `osm.app_login_link`: 'devmapswipe://login/osm' or 'mapswipe://login/osm'\n  - OSM_OAUTH_API_URL `osm.api_url`: 'https://master.apis.dev.openstreetmap.org/' or 'https://www.openstreetmap.org/' (include the\n    trailing slash)\n  - OSM_OAUTH_CLIENT_ID `osm.client_id`: find it on the OSM application page\n  - OSM_OAUTH_CLIENT_SECRET `osm.client_secret`: same as above. Note that this can only be seen once when the application is created. Do not\n    lose it!\n- Deploy the functions as explained above\n- Expose the functions publicly through firebase hosting, this is done in `/firebase/firebase.json` under the `hosting`\n  key.\n\nThe functions must be publicly exposed to allow anyone to run them without authentication, after they have first been\ndeployed:\n- in firebase console, open the [list of cloud\n  functions](https://console.cloud.google.com/functions/list?project=dev-mapswipe\u0026authuser=0\u0026hl=en\u0026tab=permissions)\n- \"allow unauthenticated\" is not visible in the \"authentication\" column, then\n    - select the auth functions by checking the box to the left side of them in the list\n    - click \"permissions\" near the top, then \"Add principal\"\n    - under \"new principal\" pick \"allUsers\"\n    - under \"select a role, choose \"Cloud Function Invoker\" and save.\n    - Confirm all the warnings\n\nSee https://firebase.google.com/docs/functions/http-events#invoke_an_http_function for the full story (and\nhttps://cloud.google.com/functions/docs/securing/managing-access-iam#allowing_unauthenticated_http_function_invocation).\nIf you don't do this, you will get an HTTP 403 error saying you don't have permission to access the function.\n\nYou also need to enable the \"IAM service account credentials API\" by going to\nhttps://console.cloud.google.com/apis/api/iamcredentials.googleapis.com/credentials?project=dev-mapswipe.\n\nFinally, you need to figure out the service account used by the cloud functions (it apparently is `PROJECT_NAME@appspot.gserviceaccount.com` by default) and grant it the right to sign blobs, see https://firebase.google.com/docs/auth/admin/create-custom-tokens#service_account_does_not_have_required_permissions.\n\nWe store the user's OSM access token in the database, which right now does not do anything, but would be needed if we\nwant our backend to do something in OSM on behalf of the user. The database access rules are set to only allow the owner\nof a token to access them.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapswipe%2Fmapswipe-firebase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmapswipe%2Fmapswipe-firebase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapswipe%2Fmapswipe-firebase/lists"}