{"id":28731987,"url":"https://github.com/armbian/armbian-router","last_synced_at":"2025-06-15T19:40:39.889Z","repository":{"id":71715307,"uuid":"537829610","full_name":"armbian/armbian-router","owner":"armbian","description":"Geolocation content delivery system to leverage the user's location information to improve download performance","archived":false,"fork":false,"pushed_at":"2025-03-28T08:02:05.000Z","size":155,"stargazers_count":9,"open_issues_count":4,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T09:22:11.075Z","etag":null,"topics":["caching","cdn","geo-targeting","global-distribution","latency-reduction","load-balancing","redundancy","router","serverless-cdn","smart-routing"],"latest_commit_sha":null,"homepage":"http://dl.armbian.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/armbian.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},"funding":{"liberapay":"armbian","github":"armbian","custom":["armbian.com/donate"]}},"created_at":"2022-09-17T14:15:22.000Z","updated_at":"2025-02-22T12:54:51.000Z","dependencies_parsed_at":"2024-01-31T23:37:12.119Z","dependency_job_id":"c993b810-4de2-4a85-a3da-47fb1a101fa5","html_url":"https://github.com/armbian/armbian-router","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/armbian/armbian-router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armbian%2Farmbian-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armbian%2Farmbian-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armbian%2Farmbian-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armbian%2Farmbian-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/armbian","download_url":"https://codeload.github.com/armbian/armbian-router/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armbian%2Farmbian-router/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260040537,"owners_count":22949851,"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":["caching","cdn","geo-targeting","global-distribution","latency-reduction","load-balancing","redundancy","router","serverless-cdn","smart-routing"],"created_at":"2025-06-15T19:40:33.456Z","updated_at":"2025-06-15T19:40:39.873Z","avatar_url":"https://github.com/armbian.png","language":"Go","funding_links":["https://liberapay.com/armbian","https://github.com/sponsors/armbian","armbian.com/donate"],"categories":[],"sub_categories":[],"readme":"Armbian Redirector\n==================\n\nThis repository contains a redirect service for Armbian downloads, apt, etc.\n\nIt uses multiple current technologies and best practices, including:\n\n- Go 1.19\n- Ginkgo v2 and Gomega testing framework\n- GeoIP + Distance routing\n- Server weighting, pooling (top x servers are served instead of a single one)\n- Health checks (HTTP, TLS)\n\nCode Quality\n------------\n\nThe code quality isn't the greatest/top tier. Work is being done towards cleaning it up and standardizing it, writing tests, etc.\n\nAll contributions are welcome, see the `check_test.go` file for example tests.\n\nChecks\n------\n\nThe supported checks are HTTP and TLS.\n\n### HTTP\n\nVerifies server accessibility via HTTP. If the server returns a forced redirect to an `https://` url, it is considered to be https-only.\n\nIf the server responds on the `https` url with a forced `http` redirect, it will be marked down due to misconfiguration. Requests should never downgrade.\n\n### TLS\n\nCertificate checking to ensure no servers are used which have invalid/expired certificates. This check is written to use the Mozilla ca certificate list, loaded on start/config load, to verify roots.\n\nOS certificate trusts WERE being used to do this, however some issues with the date validation (which could be user error) caused the move to the ca bundle, which could be considered more usable.\n\nNote: This downloads from github every startup/reload. This should be a reliable process, as long as Mozilla doesn't deprecate their repo. Their HG URL is super slow.\n\nConfiguration\n-------------\n\n### Modes\n\n#### Redirect\n\nStandard redirect functionality\n\n#### Download Mapping\n\nUses the `dl_map` configuration variable to enable mapping of paths to new paths.\n\nThink symlinks, but in a generated file.\n\n### Mirrors\nMirror targets with trailing slash are placed in the yaml configuration file.\n\n### Example YAML\n```yaml\n# GeoIP Database Path\ngeodb: GeoLite2-City.mmdb\n\n# Comment out to disable\ndl_map: userdata.csv\n\n# LRU Cache Size (in items)\ncacheSize: 1024\n\n# Server definition\n# Weights are just like nginx, where if it's \u003e 1 it'll be chosen x out of x + total times\n# By default, the top 3 servers are used for choosing the best.\n# server = full url or host+path\n# weight = int\n# optional: latitude, longitude (float)\n# optional: protocols (list/array)\nservers:\n  - server: armbian.12z.eu/apt/\n  - server: armbian.chi.auroradev.org/apt/\n    weight: 15\n    latitude: 41.8879\n    longitude: -88.1995\n  # Example of a server with additional protocols (rsync)\n  # Useful for defining servers which could be used for rsync sources\n  # This lets us potentially add an endpoint to say \"give me a server with rsync\"\n  - server: mirrors.dotsrc.org/armbian-apt/\n    weight: 15\n    protocols:\n      - http\n      - https\n      - rsync\n  # Example of a server with rules\n  - server: armbian.lv.auroradev.org/apt/\n    rules:\n      # Required: field\n      # Value matchers: is, is_not, in, not_in\n      # See the RuleInput struct, as well as the ASN and \n      # This example excludes Google's ASN from this mirror\n      - field: asn.autonomous_system_number\n        is_not: 15169\n      # An example of a country blocking access to another\n      # For instance, Ukraine not allowing Russian ISPs in.\n      - field: location.country.iso_code\n        not_in:\n          - RU\n````\n\n## API\n\n`/status`\n\nMeant for a simple health check (nginx/etc can 502 or similar if down)\n\n`/reload`\n\nFlushes cache and reloads configuration and mapping. Requires reloadToken to be set in the configuration, and a matching token provided in `Authorization: Bearer TOKEN`\n\n`/mirrors`\n\nShows all mirrors in the legacy (by region) format\n\n`/mirrors.json`\n\nShows all mirrors in the new JSON format. Example:\n\n```json\n[\n  {\n    \"available\":true,\n    \"host\":\"imola.armbian.com\",\n    \"path\":\"/apt/\",\n    \"latitude\":46.0503,\n    \"longitude\":14.5046,\n    \"weight\":10,\n    \"continent\":\"EU\",\n    \"lastChange\":\"2022-08-12T06:52:35.029565986Z\"\n  }\n]\n```\n\n`/mirrors/{server}.svg`\n\nMagic SVG path to show badges based on server status, for use in dynamic mirror lists.\n\n`/dl_map`\n\nShows json-encoded download mappings\n\n`/geoip`\n\nShows GeoIP information for the requester\n\n`/region/REGIONCODE/PATH`\n\nUsing this magic path will redirect to the desired region:\n\n* NA - North America\n* EU - Europe\n* AS - Asia\n\n`/metrics`\n\nPrometheus metrics endpoint. Metrics aren't considered private, thus are exposed to the public.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmbian%2Farmbian-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farmbian%2Farmbian-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmbian%2Farmbian-router/lists"}