{"id":23106996,"url":"https://github.com/ustclug/Yuki","last_synced_at":"2025-08-16T17:31:16.333Z","repository":{"id":51312108,"uuid":"69163668","full_name":"ustclug/Yuki","owner":"ustclug","description":"Mirror management tool, developed and used in-house in USTC","archived":false,"fork":false,"pushed_at":"2025-07-29T02:24:46.000Z","size":2380,"stargazers_count":53,"open_issues_count":3,"forks_count":13,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-09T19:41:42.504Z","etag":null,"topics":["docker-container","mirror","restful-api"],"latest_commit_sha":null,"homepage":"","language":"Go","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/ustclug.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":"2016-09-25T12:43:09.000Z","updated_at":"2025-07-29T02:24:49.000Z","dependencies_parsed_at":"2023-12-20T15:02:14.145Z","dependency_job_id":"f8893520-3cb3-4209-87b1-4718e4d3fa68","html_url":"https://github.com/ustclug/Yuki","commit_stats":{"total_commits":204,"total_committers":9,"mean_commits":"22.666666666666668","dds":"0.37254901960784315","last_synced_commit":"29e42d34b054814270ff391b49ce79ad3b4d0a26"},"previous_names":["knight42/yuki"],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/ustclug/Yuki","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ustclug%2FYuki","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ustclug%2FYuki/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ustclug%2FYuki/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ustclug%2FYuki/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ustclug","download_url":"https://codeload.github.com/ustclug/Yuki/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ustclug%2FYuki/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270746118,"owners_count":24638283,"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-08-16T02:00:11.002Z","response_time":91,"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":["docker-container","mirror","restful-api"],"created_at":"2024-12-17T01:12:04.158Z","updated_at":"2025-08-16T17:31:16.056Z","avatar_url":"https://github.com/ustclug.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"README\n=======\n\n[![Presubmit Checks](https://github.com/ustclug/Yuki/actions/workflows/pr-presubmit-checks.yml/badge.svg)](https://github.com/ustclug/Yuki/actions/workflows/pr-presubmit-checks.yml)\n[![Go Report](https://goreportcard.com/badge/github.com/ustclug/Yuki)](https://goreportcard.com/report/github.com/ustclug/Yuki)\n\n- [Requirements](#requirements)\n- [Quickstart](#quickstart)\n- [Handbook](#handbook)\n- [Development](#development)\n\nSync local repositories with remote.\n\n## Requirements\n\n* Docker\n* SQLite\n\n## Quickstart\n\n### Setup\n\n#### Debian and Ubuntu\n\nDownload `yuki_*_amd64.deb` from the [latest release][latest-release] and install it:\n\n  [latest-release]: https://github.com/ustclug/Yuki/releases/latest\n\n```shell\n# Using v0.6.1 for example\nwget https://github.com/ustclug/Yuki/releases/download/v0.6.1/yuki_0.6.1_amd64.deb\nsudo dpkg -i yuki_0.6.1_amd64.deb\n```\n\nCopy `/etc/yuki/daemon.example.toml` to `/etc/yuki/daemon.toml` and edit accordingly.\n\nCreate the `mirror` user and start the system service:\n\n```shell\nsudo useradd -m mirror\nsudo systemctl enable --now yukid.service\n```\n\n#### Other distros\n\nDownload the binaries from the [latest release][latest-release]. For example:\n\n```bash\nwget https://github.com/ustclug/Yuki/releases/latest/download/yukictl_linux_amd64\nwget https://github.com/ustclug/Yuki/releases/latest/download/yukid_linux_amd64\n\nsudo cp yukictl_linux_amd64 /usr/local/bin/yukictl\nsudo cp yukid_linux_amd64 /usr/local/bin/yukid\nsudo chmod +x /usr/local/bin/{yukid,yukictl}\n```\n\nConfigure yukid:\n\n```bash\nsudo mkdir /etc/yuki/\nsudo useradd -m mirror\nmkdir /tmp/repo-logs/ /tmp/repo-configs/\n\ncat \u003c\u003cEOF | sudo tee /etc/yuki/daemon.toml\ndb_url = \"/tmp/yukid.db\"\n# uid:gid\nowner = \"$(id -u mirror):$(id -g mirror)\"\nrepo_logs_dir = \"/tmp/repo-logs/\"\nrepo_config_dir = \"/tmp/repo-configs/\"\nEOF\n```\n\nConfigure systemd service:\n\n```bash\ncurl 'https://raw.githubusercontent.com/ustclug/Yuki/main/deploy/yukid.service' | sudo tee /etc/systemd/system/yukid.service\nsystemctl enable yukid\nsystemctl start yukid\nsystemctl status yukid\n```\n\n### Configure repositories\n\nSetup repository:\n\n```bash\n# The repository directory must be created in advance\nmkdir /tmp/repo-data/docker-ce\n\n# Sync docker-ce repository from rsync.mirrors.ustc.edu.cn\ncat \u003c\u003cEOF \u003e /tmp/repo-configs/docker-ce.yaml\nname: docker-ce\n# every 1 hour\ncron: \"0 * * * *\"\nstorageDir: /tmp/repo-data/docker-ce\nimage: ustcmirror/rsync:latest\nlogRotCycle: 2\nenvs:\n  RSYNC_HOST: rsync.mirrors.ustc.edu.cn\n  RSYNC_PATH: docker-ce/\n  RSYNC_EXCLUDE: --exclude=.~tmp~/\n  RSYNC_EXTRA: --size-only\n  RSYNC_MAXDELETE: \"50000\"\nEOF\n\nyukictl reload\n# Verify\nyukictl repo ls\n\n# Trigger synchronization immediately\nyukictl sync docker-ce\n```\n\nFor more details of the configuration file, please refer to the [yukid handbook](./cmd/yukid/README.md).\n\n## Handbook\n\n* [yukid](./cmd/yukid/README.md): Yuki daemon\n* [yukictl](./cmd/yukictl/README.md): Yuki cli\n\n## Migration Guide\n\n### v0.3.x -\u003e v0.4.x\n\nFor configuration:\n\n```bash\nsed -i.bak 's/log_dir/repo_logs_dir/' /etc/yuki/daemon.toml\n# Also remember to update the `images_upgrade_interval` field in /etc/yuki/daemon.toml if it is set.\n\nsed -i.bak 's/interval/cron/' /path/to/repo/configs/*.yaml\n```\n\nFor post sync hook, the environment variables that are passed to the hook script are changed:\n\n* `Dir` -\u003e `DIR`: the directory of the repository\n* `Name` -\u003e `NAME`: the name of the repository\n\n## Development\n\n* Build `yukid`:\n\n    ```shell\n    make yukid\n    ```\n\n* Build `yukictl`:\n\n    ```shell\n    make yukictl\n    ```\n\n* Build Debian package:\n\n    ```shell\n    make deb\n    ```\n\n* Lint the whole project:\n\n    ```shell\n    make lint\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fustclug%2FYuki","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fustclug%2FYuki","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fustclug%2FYuki/lists"}