{"id":19204643,"url":"https://github.com/openttd/master-server","last_synced_at":"2025-09-26T12:52:59.380Z","repository":{"id":37093789,"uuid":"293088257","full_name":"OpenTTD/master-server","owner":"OpenTTD","description":"In-game and web-based listing of online OpenTTD servers","archived":false,"fork":false,"pushed_at":"2025-06-17T18:33:04.000Z","size":158,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-06-17T19:40:55.972Z","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":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenTTD.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}},"created_at":"2020-09-05T14:08:45.000Z","updated_at":"2025-06-17T18:33:07.000Z","dependencies_parsed_at":"2024-01-04T10:37:07.466Z","dependency_job_id":"4b661522-04b1-44ac-93a0-7e2f73ce8cff","html_url":"https://github.com/OpenTTD/master-server","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/OpenTTD/master-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenTTD%2Fmaster-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenTTD%2Fmaster-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenTTD%2Fmaster-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenTTD%2Fmaster-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenTTD","download_url":"https://codeload.github.com/OpenTTD/master-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenTTD%2Fmaster-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277081049,"owners_count":25757340,"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","status":"online","status_checked_at":"2025-09-26T02:00:09.010Z","response_time":78,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-09T13:09:04.623Z","updated_at":"2025-09-26T12:52:59.361Z","avatar_url":"https://github.com/OpenTTD.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Master Server\n\n[![GitHub License](https://img.shields.io/github/license/OpenTTD/master-server)](https://github.com/OpenTTD/master-server/blob/main/LICENSE)\n\nThis repository contains two components to have a functional Master Server for the OpenTTD clients.\n\n1. a `master_server` component, which runs the actual Master Server and communicates with the OpenTTD clients.\n2. a `web_api` component, which allows HTTP access to the current online servers known by the Master Server.\n\nThese are in a single repository, as they share the same database access.\n\n## Development\n\nThe `master_server` and `web_api` are written in Python 3.11, and makes strong use of asyncio and aiohttp.\n\nBoth make use of the AWS DynamoDB database to store the known servers.\n\n### Running a local server\n\n#### Dependencies\n\n- Python3.11 or higher.\n- Docker\n\n#### Preparing your venv\n\nTo start it, you are advised to first create a virtualenv:\n\n```bash\npython3 -m venv .env\n.env/bin/pip install -r requirements.txt\n```\n\n#### Preparing docker\n\nYou need to run a local AWS DynamoDB to experiment with.\nAWS supplies a version via Docker (you can also run it via Java; this is left as an exercise to the reader):\n\n```bash\ndocker run --rm -p 8000:8000 amazon/dynamodb-local\n```\n\nThis will start an empty AWS DynamoDB server on port 8000.\n\n#### Starting master_server\n\nYou can start the `master_server` by running:\n\n```bash\nAWS_ACCESS_KEY_ID=1 AWS_SECRET_ACCESS_KEY=1 .env/bin/python -m master_server --app master_server --web-port 8081 --db dynamodb --dynamodb-host http://127.0.0.1:8000\n```\n\nThis will start the server on port 3978 (default) for you to work with locally.\nThe webserver on port 8081 is just to monitor the health of the server.\nYou can change your `/etc/hosts` or `C:\\Windows\\System32\\drivers\\etc` to map `master.openttd.org` to `127.0.0.1` and `::1` for local testing.\n\n#### Starting web_api\n\nYou can start the `web_api` by running:\n\n```bash\nAWS_ACCESS_KEY_ID=1 AWS_SECRET_ACCESS_KEY=1 .env/bin/python -m master_server --app web_api --web-port 8080 --db dynamodb --dynamodb-host http://127.0.0.1:8000\n```\n\nThis will start the HTTP server on port 8080 for you to work with locally.\nIt does require some servers to be in the database to be useful, so make sure to start a master_server locally and run a (dedicated) server to add an entry.\n\n### Running via docker\n\n```bash\ndocker build -t openttd/master-server:local .\ndocker run --rm --name ms-dynamodb -p 8000:8000 amazon/dynamodb-local\ndocker run --rm --link ms-dynamodb -p 127.0.0.1:3978:3978/udp -p 127.0.0.1:8081:80 -e AWS_ACCESS_KEY_ID=1 -e AWS_SECRET_ACCESS_KEY=1 openttd/master-server:local --app master_server --bind 0.0.0.0 --db dynamodb --dynamodb-host http://ms-dynamodb:8000\ndocker run --rm --link ms-dynamodb -p 127.0.0.1:8080:80 -e AWS_ACCESS_KEY_ID=1 -e AWS_SECRET_ACCESS_KEY=1 openttd/master-server:local --app web_api --bind 0.0.0.0 --db dynamodb --dynamodb-host http://ms-dynamodb:8000\n```\n\nThis will start an empty AWS DynamoDB, the Master Server listing on UDP 3978 and the Web API on HTTP port 8080.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenttd%2Fmaster-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenttd%2Fmaster-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenttd%2Fmaster-server/lists"}