Skip to content

Commit ccfede9

Browse files
authored
Add WinGet source repo support (#87)
* winget-source: init * winget-source: cleans up temp directory before exit * winget-source: update package.json * winget-source: improves Dockerized performance * winget-source: use modified time instead of MD5 * winget-source: better naming * winget-source: more robust `getRemoteURL()` * winget-source: JSDoc-styled documentation * winget-source: support debug mode * winget-source: skip update if bundle is unchanged * winget-source: add description in README * winget-source: add default upstream URL * winget-source: fix file permission * winget-source: style fix * winget-source: support logging to file * winget-source: sync newer manifests first * winget-source: update NPM package name * winget-source: remove skipped messages from log * winget-source: simplify setup * winget-source: support `BIND_ADDRESS` * winget-source: clarify actually used options * winget-source: simplify `Dockerfile` * winget-source: improves Docker image layer cache * winget-source: style update
1 parent e4a014d commit ccfede9

File tree

7 files changed

+1815
-0
lines changed

7 files changed

+1815
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
- [rsync](#rsync)
3939
- [rubygems](#rubygems)
4040
- [stackage](#stackage)
41+
- [winget-source](#winget-source)
4142
- [yum-sync](#yum-sync)
4243
- [License](#license)
4344
- [Contributing](#contributing)
@@ -413,6 +414,18 @@ Stackage doesn't need to specify upstream, but this mirror use cabal to install
413414

414415
Read the [user guide](https://www.haskell.org/cabal/users-guide/installing-packages.html#repository-specification) before writing preferred mirror to `config`
415416

417+
### winget-source
418+
419+
[![winget-source](https://img.shields.io/docker/image-size/ustcmirror/winget-source/latest)](https://hub.docker.com/r/ustcmirror/winget-source "winget-source")
420+
[![winget-source](https://img.shields.io/docker/pulls/ustcmirror/winget-source)](https://hub.docker.com/r/ustcmirror/winget-source "winget-source")
421+
422+
A handy tool to sync pre-indexed [Windows Package Manager](https://github.com/microsoft/winget-cli) (aka. WinGet) sources.
423+
424+
| Parameter | Description |
425+
| --------------------- | ---------------------------------------------------------------- |
426+
| `WINGET_REPO_URL` | Sets the URL of upstream. Defaults to [`https://cdn.winget.microsoft.com/cache`](https://cdn.winget.microsoft.com/cache) |
427+
| `WINGET_REPO_JOBS` | Parallel jobs. Defaults to 8. |
428+
416429
### yum-sync
417430

418431
[![yum-sync](https://img.shields.io/docker/image-size/ustcmirror/yum-sync/latest)](https://hub.docker.com/r/ustcmirror/yum-sync "yum-sync")

winget-source/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM ustcmirror/base:alpine
2+
LABEL maintainer "YR Chen <[email protected]>"
3+
4+
RUN apk add --no-cache nodejs
5+
6+
ADD ["package.json", "package-lock.json", "/"]
7+
RUN apk add --no-cache npm python3 && \
8+
npm ci --prefix / --only=production && \
9+
npm cache clean --force && \
10+
apk del --purge --no-cache npm python3
11+
12+
ADD ["sync.sh", "sync-repo.js", "utilities.js", "/"]

0 commit comments

Comments
 (0)