{"id":21894401,"url":"https://github.com/pocket/proxy-server","last_synced_at":"2025-04-15T15:44:00.214Z","repository":{"id":37820302,"uuid":"217398497","full_name":"Pocket/proxy-server","owner":"Pocket","description":"Service to deliver sponsored content while preserving privacy","archived":false,"fork":false,"pushed_at":"2024-05-21T06:56:40.000Z","size":799,"stargazers_count":18,"open_issues_count":4,"forks_count":5,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-03-28T22:07:17.632Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Pocket.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-24T21:29:02.000Z","updated_at":"2025-01-16T01:31:10.000Z","dependencies_parsed_at":"2023-02-02T14:47:19.467Z","dependency_job_id":"2f0de8e5-07cf-4e09-be1e-a7d8c6a2e744","html_url":"https://github.com/Pocket/proxy-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pocket%2Fproxy-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pocket%2Fproxy-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pocket%2Fproxy-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pocket%2Fproxy-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pocket","download_url":"https://codeload.github.com/Pocket/proxy-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249102140,"owners_count":21213153,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-28T13:22:27.646Z","updated_at":"2025-04-15T15:44:00.190Z","avatar_url":"https://github.com/Pocket.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spocs Proxy Server\nThis service sits between Firefox and [AdZerk](https://adzerk.com/).\nIts purpose is to preserve the privacy of Firefox clients when they request sponsored content (spocs) for the Firefox New Tab.\nSee [Sponsored Stories FAQ](https://help.getpocket.com/article/1142-firefox-new-tab-recommendations#sponsoredstories)\nfor more information.\n\n## API\n\nSee [OpenAPI documentation](https://app.swaggerhub.com/apis-docs/PocketNewTab/PocketProxyServer).\n\n## Development environment\nThe following steps create a Docker development environment to run this service locally.\n\n1. Install [Docker](https://docs.docker.com/install/) and [Docker Compose](https://docs.docker.com/compose/install/).\n2. In the project root run: `docker compose build`.\n3. Start a mock s3 service: `docker compose up s3`.\n4. Sign up for an account on the [MaxMind](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data?lang=en#accessing-geolite2-free-geolocation-data) website.\n5. Navigate to the \"Download Files\" page in your account, download the GeoLite2 City database and copy it to `pocket-geoip/GeoLite2-City.mmdb` on the mock s3 container.\n    1. If the database is stored on s3:\n        ```\n        images/s3/download.sh -b \u003cs3 bucket\u003e\n        ```\n    2. If it's stored on disk in a file called `GeoLite2-City.mmdb`:\n        ```\n        aws --endpoint-url http://localhost:4569 s3 cp GeoLite2-City.mmdb s3://pocket-geoip/GeoLite2-City.mmdb\n        ```\n5. Verify that GeoIP2 is available at [localhost:4569/pocket-geoip/GeoLite2-City.mmdb](http://localhost:4569/pocket-geoip/GeoLite2-City.mmdb).\n6. Create a `.env` file in the project root directory with the following content, replacing `\u003csecret\u003e` with the respective secret values:\n    ```\n    ADZERK_API_KEY=\u003csecret\u003e\n    ```\n7. Start the application containers: `docker compose up`.\n8. Test that the application is running: http://localhost/pulse. It should return `{\"pulse\":\"ok\"}`.\n\n## Tests\nSee the [Test README](tests/README.md).\n\n## Deployment\n\nThe first time the service is deployed, follow the steps in the [CloudFormation README](cloudformation/README.md).\n\nFor subsequent deployments:\n1. Merge a PR into the main branch.\n2. Wait for the new Docker image to be built and uploaded to ECR.\n3. Open Fargate in the AWS console and update the service, forcing a new deployment\n   Or, you can increase the number of tasks. Since the task is using the `latest` tag\n   they should pull in your changes without forcing an update to the task.\n\n# Telemetry Function\nThe [Telemetry Handler](app/telemetry/handler.py) is triggered by telemetry from the Firefox discovery stream. It anonymously pings AdZerk to keep track of events related to sponsored content, such as clicks and impressions, in a privacy-preserving way. The event code (or \"shim\") does not contain any personally identifiable data; we never share personal data with AdZerk.\n\n## Deployment\n \n1. Open telemetry-proxy in the [Google Cloud Console](https://console.cloud.google.com) \n2. Click Edit and paste the new code into the `main.py` file (*do not* be confused by the fact the contents of the function are stored in a file named `handler.py` in this repository and *do not* rename the file name on Google Cloud).\n3. Click Deploy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocket%2Fproxy-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpocket%2Fproxy-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocket%2Fproxy-server/lists"}