{"id":21277922,"url":"https://github.com/b13/magnets","last_synced_at":"2026-02-28T10:34:39.340Z","repository":{"id":47309575,"uuid":"179005881","full_name":"b13/magnets","owner":"b13","description":"TYPO3 Extension as API dealing with GeoIP locations","archived":false,"fork":false,"pushed_at":"2025-11-28T10:11:38.000Z","size":46,"stargazers_count":4,"open_issues_count":2,"forks_count":3,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-11-30T18:22:02.789Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/b13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2019-04-02T05:34:39.000Z","updated_at":"2025-11-28T10:11:17.000Z","dependencies_parsed_at":"2025-07-11T08:36:40.447Z","dependency_job_id":"5e8ea2d6-98da-47c1-9185-e7755dab8514","html_url":"https://github.com/b13/magnets","commit_stats":{"total_commits":15,"total_committers":7,"mean_commits":2.142857142857143,"dds":0.6,"last_synced_commit":"b4d47e39126ceea228e5e587b7de15194c6c3b97"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/b13/magnets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fmagnets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fmagnets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fmagnets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fmagnets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b13","download_url":"https://codeload.github.com/b13/magnets/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fmagnets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29930344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T09:58:13.507Z","status":"ssl_error","status_checked_at":"2026-02-28T09:57:57.047Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":"2024-11-21T10:08:16.137Z","updated_at":"2026-02-28T10:34:39.322Z","avatar_url":"https://github.com/b13.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TYPO3 Extension \"magnets\"\n\nThis extension acts as a thin wrapper for TYPO3 to access GeoIP relevant information.\n\nA symfony CLI Command can be added to download the latest GeoIP2 data.\n\nFor download the latest GeoIP2 data you have to provide an licence-key from [maxmind](https://www.maxmind.com/en/geolite2/signup)\n(as .env-Variable or `$GLOBALS['TYPO3_CONF_VARS']['SYS']['GeoIPLicenceKey']`)\n\nMaxmind API requests are limited (1000 requests/day). As an alternative the databases\n(GeoLite2-City, GeoLite2-Country) can be stored as a \"Generic Package\" in GitLab.\n\nFor Download during the CI run the `CI_JOB_TOKEN` can be used as follows:\n```php\nif (!empty(getenv('CI_JOB_TOKEN'))) {\n    $GLOBALS['TYPO3_CONF_VARS']['SYS']['GeoIPSource']['url'] = 'https://\u003cGITLAB_HOST\u003e/api/v4/projects/\u003cPROJECT_ID\u003e/packages/generic/GeoLite2/1.0.0/###REMOTE_EDITION###.tar.gz';\n    $GLOBALS['TYPO3_CONF_VARS']['SYS']['GeoIPSource']['headers'] = [\n        'JOB-TOKEN' =\u003e getenv('CI_JOB_TOKEN'),\n    ];\n}\n```\n\n## Installation\n\nRun `composer req b13/magnets` and install the extension via Extension Manager.\n\n## Usage\n\nEnsure your cronjob / scheduler task is running and use the IpLocation PHP class to have\na nice and quick API.\n\nIn addition, you have \"countryCode\" as TypoScript condition available.\n\n    [countryCode == 'FR']\n      page.10 = TEXT\n      page.10.value = You are from france\n    [global]\n\nThe condition is also available in site configurations.\n\n## Settings\n\nHeaders to send while running the request to download the database.\nEither use `JOB-TOKEN` or `PRIVATE-TOKEN` to [authenticate on GitLab](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html).\n\n```php\n$GLOBALS['TYPO3_CONF_VARS']['SYS']['GeoIPSource']['headers'] = [];\n```\n\nChange the URL to retrieve the databases from.\nThe URL needs to include `###REMOTE_EDITION###` which will be replaced by\nthe \"remote edition\" (GeoLite2-Country and GeoLite2-City).\n\n```php\n$GLOBALS['TYPO3_CONF_VARS']['SYS']['GeoIPSource']['url'] = 'https://download.maxmind.com/app/geoip_download?suffix=tar.gz\u0026edition_id=###REMOTE_EDITION###';\n```\n\n## Store and Update databases using GitLab\n\nCreate a project and add a `.gitlab-ci.yml` \n\n```yaml\nstages:\n  - package-update\n\ngeo-ip:\n  stage: package-update\n  image: alpine/curl:8.9.1\n  variables:\n    GIT_STRATEGY: none\n    GITLAB_RELEASE_VERSION: \"1.0.0\"\n    PACKAGE_REGISTRY_URL: \"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/GeoLite2\"\n  script:\n    # Download Maxmind GeoIP database\n    - mkdir -p downloads\n    - curl -sSL \"https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country\u0026license_key=${GEOIP_LICENCE_KEY}\u0026suffix=tar.gz\" \u003e downloads/GeoLite2-Country.tar.gz\n    - curl -sSL \"https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City\u0026license_key=${GEOIP_LICENCE_KEY}\u0026suffix=tar.gz\" \u003e downloads/GeoLite2-City.tar.gz\n    # Upload files to package\n    - 'curl --fail-with-body --header \"JOB-TOKEN: ${CI_JOB_TOKEN}\" --upload-file ./downloads/GeoLite2-Country.tar.gz ${PACKAGE_REGISTRY_URL}/${GITLAB_RELEASE_VERSION}/GeoLite2-Country.tar.gz'\n    - 'curl --fail-with-body --header \"JOB-TOKEN: ${CI_JOB_TOKEN}\" --upload-file ./downloads/GeoLite2-City.tar.gz ${PACKAGE_REGISTRY_URL}/${GITLAB_RELEASE_VERSION}/GeoLite2-City.tar.gz'\n```\n\nUnder Settings -\u003e CI/CD -\u003e Variables add a variable named \"GEOIP_LICENCE_KEY\" containing\nthe licence-key.\n\nFor regular updates add a \"New schedule\" und Build -\u003e Pipeline schedules.\ne.g. `8 00 * * 1,3`\n\n## License\n\nJust as TYPO3 Core, this is an extension for TYPO3 and also licensed under GPL2+.\n\n---\n\n\n_Made by [b13](https://b13.com) with ♥_\n\n[Find more TYPO3 extensions we have developed](https://b13.com/useful-typo3-extensions-from-b13-to-you) that help us deliver value in client projects. As part of the way we work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb13%2Fmagnets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb13%2Fmagnets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb13%2Fmagnets/lists"}