{"id":16804812,"url":"https://github.com/ibug/uniapi","last_synced_at":"2025-03-17T07:21:29.956Z","repository":{"id":154098736,"uuid":"515225124","full_name":"iBug/uniAPI","owner":"iBug","description":"API server running on USTC private server","archived":false,"fork":false,"pushed_at":"2024-11-18T13:06:02.000Z","size":111,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-23T16:39:52.402Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/iBug.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}},"created_at":"2022-07-18T14:46:13.000Z","updated_at":"2024-11-18T13:06:05.000Z","dependencies_parsed_at":"2023-10-16T10:59:41.884Z","dependency_job_id":"a2c2a392-4b0b-4ac4-873d-067c8d76b3b9","html_url":"https://github.com/iBug/uniAPI","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iBug%2FuniAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iBug%2FuniAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iBug%2FuniAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iBug%2FuniAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iBug","download_url":"https://codeload.github.com/iBug/uniAPI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243989711,"owners_count":20379648,"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-10-13T09:46:11.495Z","updated_at":"2025-03-17T07:21:29.928Z","avatar_url":"https://github.com/iBug.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# uniAPI\n\nA custom server that converts many data sources into a versatile API. See the [`plugins/` directory](plugins/) for supported plugins and their configurations.\n\n## Configuration\n\nThe configuration file uses the YAML format.\n\nCurrently the configuration has one single key `services` at the root level. It is a \"key-service\" map. The key will be used in URL routing and the request will be served by the defined service.\n\nFor example, with the following short configuration:\n\n```yaml\nservices:\n  robots.txt:\n    type: robotstxt\n  minecraft:\n    type: minecraft\n    commander:\n      type: rcon\n      server: 192.0.2.0\n      port: 25575\n      password: rcon_password\n      timeout: 100ms\n```\n\nA request to `/robots.txt` will be served by the [`robotstxt` service](plugins/robotstxt/), and a request to `/minecraft` will be served by the [`minecraft` service](plugins/minecraft/). The `minecraft` service will use the [`rcon` Commander](plugins/rcon/) to connect to the actual Minecraft server to retrieve information.\n\nAn longer example of configuration:\n\n```yaml\nservices:\n  robots.txt:\n    type: robotstxt\n  csgo:\n    type: csgo\n    commander:\n      type: rcon\n      server: 192.0.2.0\n      port: 27015\n      password: rcon_password\n      timeout: 100ms\n    streamer:\n      type: docker.streamer\n      host: \"unix:///var/run/docker.sock\"\n      container: cs2\n  factorio:\n    type: factorio\n    commander:\n      type: rcon\n      server: 192.0.2.0\n      port: 34197\n      password: rcon_password\n      timeout: 100ms\n  minecraft:\n    type: minecraft\n    commander:\n      type: rcon\n      server: 192.0.2.0\n      port: 25575\n      password: rcon_password\n      timeout: 100ms\n  palworld:\n    type: palworld\n    commander:\n      type: rcon\n      server: 192.0.2.0\n      port: 8211\n      password: rcon_password\n      timeout: 100ms\n  teamspeak:\n    type: token-protected\n    tokens:\n      - some_stupid_token\n    service:\n      type: teamspeak\n      key: serverquery_api_key\n      instance: \"1\"\n      endpoint: ts.example.com\n      timeout: 100ms\n  terraria:\n    type: terraria\n    streamer:\n      type: docker.stream\n      host: \"unix:///var/run/docker.sock\"\n      container: terraria\n  206ip:\n    type: wireguard.endpoint\n    interface: wg0\n    public-key: AAAA==\n    use-sudo: true\n```\n\n## Classes\n\nThese are defined in [`common/interfaces.go`](common/interfaces.go). Some of the classes are:\n\n- **Service**: Provides an HTTP handler for something.\n\n  Additionally, the root server is also a Service (going by the name `server`).\n  You can achieve sub-path routing by defining a `server` Service.\n  For example:\n\n  ```yaml\n  services:\n    some_path:\n      type: server\n      services:\n        sub_path:\n          type: some_service\n  ```\n\n  Then `some_service` will be available at `/some_path/sub_path`.\n\n- **Commander**: Provides a way to execute commands and retrieve the output. For example, many game servers uses the [RCON protocol](https://developer.valvesoftware.com/wiki/Source_RCON_Protocol) as a command interface.\n- **Streamer**: Provides a way to interact with a stream of data. For example, sending input to and reading output from a game server console. The [`docker` plugin](plugins/docker/) provides a few Streamers to interact with Docker containers.\n\nA plugin may require another plugin to work. For example, the `minecraft` plugin requires a Commander, but you can use either `rcon` or `docker.attachexec` to interact with a Minecraft server, depending on your setup. The `type` key specifies which plugin to use, and the rest of the config is passed to the plugin.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibug%2Funiapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibug%2Funiapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibug%2Funiapi/lists"}