Giter VIP home page Giter VIP logo

ustcmirror-images's Introduction

ustcmirror-images

Build Status

Table Of Content

Introduction

These images are designed for mirroring remote directories/repositories in a consistent and portable way. They are used by ustcmirror (yuki).

Quick Start

docker run --rm \
    -e LOG_ROTATE_CYCLE='5' \
    -e RSYNC_HOST='rsync.alpinelinux.org' \
    -e RSYNC_PATH='alpine/' \
    -e RSYNC_MAXDELETE='10000' \
    -v /var/repos/alpine:/data \
    -v /var/sync-logs/alpine:/log \
    ustcmirror/rsync:latest

Configuration

Volumes

  • /data: The mount point of the repository on the host. You can refer to it as environment variable TO in your program.
  • /log: The mount point of the host directory that save logs. You can refer to it as environment variable LOG in your program.

Common Configuration Parameters(AKA environment variables)

Parameter Description
DEBUG Set this to true to enable debugging.
BIND_ADDRESS Set the local ip to be bound. Require --network=host. (Some programs don't support this parameter)
OWNER Set the uid and gid of the process so that the downloaded files wont get messed up. Defaults to 0:0 (aka root:root).
LOG_ROTATE_CYCLE Specify how many cycle versions of the logfile to be saved. Set this to 0 will disable rotation. Defaults to 0.
REPO Name of the repository. Required in archvsync.
RETRY Times to re-sync if the process exits abnormally. Defaults to 0.

aptsync

aptsync aptsync

Parameter Description
APTSYNC_URL Sets the url of upstream.
APTSYNC_NTHREADS Defaults to 20.
APTSYNC_UNLINK Set this to 1 to remove unneeded files automatically. Defaults to 0.
APTSYNC_CREATE_DIR Set this to true to create same directory tree as upstream URL. Defaults to true.
APTSYNC_DISTS Various distros can be specified in the format <release> [...]|<componenet> [...]|<arch> [...][:...].

Notes: The following mirror.list:

deb-i386 https://apt.dockerproject.org/repo debian-jessie main
deb-amd64 https://apt.dockerproject.org/repo debian-jessie main
deb-armhf https://apt.dockerproject.org/repo raspbian-jessie main testing

is equivalent to the following parameters:

APTSYNC_URL='https://apt.dockerproject.org/repo'
APTSYNC_DISTS='debian-jessie|main|i386 amd64:raspbian-jessie|main testing|armhf'

apt-sync

apt-sync apt-sync

Parameter Description
APTSYNC_URL Sets the url of upstream.
APTSYNC_UNLINK Set this to 1 to remove unneeded files automatically. Defaults to 0.
APTSYNC_DISTS Various distros can be specified in the format <release> [...]|<componenet> [...]|<arch> [...]|<download_dir> [...][:...].

It is almost the same as aptsync. Except that APTSYNC_DISTS accepts 4 parameters (rather than 3) for every item.

Consider use apt-sync when the upstream replaces packages in-place, as aptsync will simply ignore if there're any changes in existed packages.

archvsync

archvsync archvsync

A.K.A. ftpsync

archvsync respects the env vars used in ftpsync

Parameter Description
IGNORE_LOCK Purge lockfiles at first. Defaults to false.

crates-io-index

crates-io-index crates-io-index

A dedicated script to sync https://github.com/rust-lang/crates.io-index.

Parameter Description
CRATES_PROXY The URL that crates will be redirected to. Defaults to https://crates-io.proxy.ustclug.org/api/v1/crates
CRATES_GITMSG The commit message of config.json. Defaults to Redirect to USTC Mirrors
CRATES_GITMAIL user.email when committing config.json. Defaults to lug AT ustc.edu.cn
CRATES_GITNAME user.name when committing config.json. Defaults to mirror

debian-cd

debian-cd debian-cd

debian-cd accepts the same parameters specified in debian-cd-mirror.conf

Parameter Description
IGNORE_LOCK Purge lockfiles at first. Defaults to false.

docker-ce

docker-ce docker-ce

docker-ce accepts following parameters:

Parameter Description
SYNC_WORKERS Download workers. Defaults to 1.
SYNC_USER_AGENT The user agent of docker-ce syncing program. Defaults to Docker-ce Syncing Tool/1.0.
SYNC_EXTRA Extra parameters. --fast-skip can be set to skip size & timestamp check.

fedora

fedora fedora

fedora-quick-mirror

See dist conf for parameters meaning.

Parameter Description
MODULE fedora module to be mirrored, e.g. fedora-enchilada,fedora-epel
FILTEREXP A regular expression used to filter the file lists. It must be quoted (or very carefully escaped)
VERBOSE log level(0-8), default is 7
CHECKIN_SITE see in mirrormanager
CHECKIN_PASSWORD see in mirrormanager
CHECKIN_HOST see in mirrormanager

Note: This image is not in use now, as quick-fedora-mirror has some mysterious bugs when being used.

freebsd-pkg

freebsd-pkg freebsd-pkg

Parameter Description
FBSD_PKG_UPSTREAM Set the URL of upstream. Defaults to http://pkg.freebsd.org.
FBSD_PKG_JOBS Defaults to 1.
FBSD_PKG_EXCLUDE Exclude ABI by regular expression. Defaults to ^FreeBSD:[89]:.

freebsd-ports

freebsd-ports freebsd-ports

Notice: BIND_ADDRESS is only added for curl in freebsd-ports. Make sure that github.com is accessible under default network settings.

Parameter Description
FBSD_PORTS_INDEX_UPSTREAM Set the URL of upstream git index. Defaults to https://github.com/freebsd/freebsd-ports.git.
FBSD_PORTS_DISTFILES_UPSTREAM Set the URL of upstream distfiles. Defaults to http://distcache.freebsd.org/ports-distfiles.
FBSD_PORTS_JOBS Defaults to 1.

ghcup

ghcup ghcup

ghcup does not have outstanding configuration options.

github-release

github-release github-release

Parameter Description
UPSTREAM_URL GitHub API base URL. Defaults to https://api.github.com/repos/.
WORKERS Number of concurrent downloading jobs. Defaults to 8.
FAST_SKIP Not verify size and timestamp of existing files. Set it to any true string to enable the skipping.
REPOS YAML-format repo list config. See below for details.

To specified the repo list to sync, you can:

  • Read-only bind mount a YAML file into the container at /repos.yaml. See the example.
  • Pass the YAML-format repo list string as REPOS env.

gitsync

gitsync gitsync

Parameter Description
GITSYNC_URL Sets the url of upstream.
GITSYNC_BRANCH Defaults to master:master.
GITSYNC_REMOTE Defaults to origin.
GITSYNC_BITMAP Enable bitmap index. Defaults to false.
GITSYNC_MIRROR A shortcut to sync all branches and tags as if GITSYNC_BRANCH='+refs/heads/*:refs/heads/*'. GITSYNC_BRANCH is ignored when it is set.
GITSYNC_CHECKOUT Checkout instead of bare cloning. Defaults to false.
GITSYNC_TREELESS Use treeless clone to save disk space. Defaults to false.
GITSYNC_GEOMETRIC Use geometric repacking to speed up repacking. Requires GITSYNC_BITMAP. Defaults to false.

google-repo

google-repo google-repo

A script for syncing projects (especially AOSP) using Google's repo tool.

Parameter Description
UPSTREAM Upstream URL. Defaults to https://android.googlesource.com/mirror/manifest
GEOMETRIC_REPACK Use geometric repacking to speed up repacking (requires git >= 2.34 on server). See GitHub Blog: Scaling monorepo maintenance. Defaults to false.

gsutil-rsync

gsutil-rsync gsutil-rsync

Parameter Description
GS_URL Sets the url of upstream. e.g. gs://golang/.
GS_EXCLUDE Files to be excluded. Defaults to empty.

hackage

hackage hackage

Parameter Description
HACKAGE_BASE_URL Set the URL of upstream. Defaults to https://hackage.haskell.org

homebrew-bottles

homebrew-bottles homebrew-bottles

Parameter Description
HOMEBREW_BOTTLES_JOBS Parallel jobs. Defaults to 1

julia-storage

julia-storage julia-storage

A new solution to sync Julia general registry (using StorageMirrorServer.jl). No parameters needed.

lftpsync

lftpsync lftpsync

Parameter Description
LFTPSYNC_HOST The hostname of the remote server.
LFTPSYNC_PATH The destination path on the remote server.
LFTPSYNC_EXCLUDE Files to be excluded. Defaults to -X .~tmp~/.
LFTPSYNC_JOBS Defaults to $(getconf _NPROCESSORS_ONLN).
LFTPSYNC_MIRROR_ARGS Parameters for mirror command. Defaults to --verbose --use-cache -aec
LFTPSYNC_EXTRA_COMMANDS Extra commands for lftp (ie. set sftp:connect-program "ssh -axi <keyfile>";). Will be executed before opening connection

misc

misc misc

Parameter Description
DOWNLOAD_LINKS Files to be downloaded by wget. Format is filename.sh http://example.com/filename.sh seperates by newlines

Download seperate, small files inconvenient for other sync containers.

Example of DOWNLOAD_LINKS:

brew-install.sh https://github.com/Homebrew/install/raw/HEAD/install.sh
rustup-install.sh https://sh.rustup.rs/

nix-channels

nix-channels nix-channels

Parameter Description
NIX_MIRROR_UPSTREAM Main page of Nix channels. No trailing slash. Defaults to https://nixos.org/channels
NIX_MIRROR_BASE_URL The root URL this mirror will be served at. No trailing slash. Defaults to https://mirrors.ustc.edu.cn/nix-channels
NIX_MIRROR_PATH_BATCH Number of paths to pass to nix each time, to avoid E2BIG. Defaults to 8192, which is about 1/4 of the 2M ARG_MAX.
NIX_MIRROR_THREADS Number of threads to use to download in parallel. Defaults to 10
NIX_MIRROR_RETAIN_DAYS Days to consider old versions as reachable. Defaults to 30. (The newest version of a release is always reachable)
NIX_MIRROR_DELETE_OLD Whether to actually delete files in garbage collection. Set to 1 to delete and 0 to not delete. Defaults to 1
NIX_MIRROR_RELEASES_ONLY Don't download binary blobs. Defaults to 0 (false)

pypi

pypi pypi

Sync PyPI with official mirror client bandersnatch. Note that this image is not actively maintained. It's suggested to use shadowmire instead.

Parameter Description
BANDERSNATCH_WORKERS Defaults to 3.
BANDERSNATCH_STOP_ON_ERROR Defaults to true.
BANDERSNATCH_TIMEOUT Defaults to 20.

rclone

rclone rclone

Parameter Description
RCLONE_PATH The destination path. Note that the rclone remote has been hard-coded as remote.
RCLONE_EXTRA Extra options passed to rclone sync. Defaults to empty.
RCLONE_CHECKERS Set the number of checkers. Defaults to $(getconf _NPROCESSORS_ONLN).
RCLONE_TRANSFERS Set the number of file transfers. Defaults to $(getconf _NPROCESSORS_ONLN).
RCLONE_CONFIG_REMOTE_* Set config file options.

ref:

rsync

rsync rsync

Parameter Description
RSYNC_HOST The hostname of the remote server.
RSYNC_USER (Optional) No defaults.
RSYNC_PASSWORD (Optional) No defaults.
RSYNC_PATH The destination path on the remote server.
RSYNC_BW Bandwidth limit. Defaults to 0.
RSYNC_EXTRA Extra options. Defaults to empty.
RSYNC_EXCLUDE Files to be excluded. Defaults to --exclude .~tmp~/.
RSYNC_FILTER Filter rules. More convenient for larger lists.
RSYNC_BLKSIZE Defaults to 8192.
RSYNC_TIMEOUT Defaults to 14400.
RSYNC_SPARSE Defaults to true.
RSYNC_DELAY_UPDATES Defaults to true.
RSYNC_DELETE_DELAY Defaults to true. Use --delete-delay rather than --delete
RSYNC_MAXDELETE Maximum number of files that can be removed. Defaults to 4000.
RSYNC_RSH Specify the remote shell, e.g. ssh -i /path/to/key.

rubygems

rubygems rubygems

Parameter Description
UPSTREAM Defaults to http://rubygems.org.

shadowmire

shadowmire shadowmire

Shadowmire syncs PyPI (or plain HTTP(S) PyPI mirrors using Shadowmire) with a lightweight and easy approach.

Parameter Description
UPSTREAM Defaults to https://pypi.org.
INDEX_ONLY Don't download package blobs. Defaults to false.
EXCLUDE A list of --exclude and --prerelease-exclude.
USE_PYPI_INDEX Still use PyPI package listing when UPSTREAM is not https://pypi.org. Defaults to false.

stackage

stackage stackage

Stackage doesn't need to specify upstream.

tsumugu

tsumugu tsumugu

An alternative HTTP(S) syncing tool, replacing rclone and lftp in some cases. See usage.

Parameter Description
UPSTREAM Sets the url of upstream.
TSUMUGU_MAXDELETE Maximum number of files that can be removed. Defaults to 1000.
TSUMUGU_TIMEZONEFILE The file URL for guessing remote server timezone.
TSUMUGU_EXCLUDE Files to be excluded. Value example: "--exclude '^temp'"
TSUMUGU_USERAGENT The user agent of tsumugu syncing program. Defaults to Tsumugu Syncing Tool/$(tsumugu_version).
TSUMUGU_PARSER HTML parser used to parse index page. Defaults to nginx.
TSUMUGU_THREADS Number of threads to use to download in parallel. Defaults to 2.
TSUMUGU_EXTRA Extra options. Defaults to empty.

winget-source

winget-source winget-source

A handy tool to sync pre-indexed Windows Package Manager (aka. WinGet) sources.

Parameter Description
WINGET_FORCE_SYNC Force syncs everything against the upstream. Defaults to false.
WINGET_REPO_URL Sets the URL of upstream. Defaults to https://cdn.winget.microsoft.com/cache
WINGET_REPO_JOBS Parallel jobs. Defaults to 8.

yukina

yukina yukina

yukina analyses given nginx log, and maintains binary blobs (which does not modify once exist) state under given size limit. Usually this shall be used with another sync container that only downloads index files.

Note that you shall bind necessary nginx log to /nginx-log/ when syncing.

Parameter Description
UPSTREAM Sets the url of upstream.
YUKINA_SIZE_LIMIT The size limit of binary blobs. Defaults to 512g.
YUKINA_FILTER Accepts regex to filter out binary blobs. Defaults to empty.
YUKINA_EXTRA Extra options. Defaults to empty.

yum-sync

yum-sync yum-sync

Parameter Description
YUMSYNC_URL Sets the url of upstream.
YUMSYNC_DISTS Various distros can be specified in the format <release> [...]|<component> [...]|<arch> [...]|<reponame>|<download_dir> [:...].
YUMSYNC_DOWNLOAD_REPODATA Whether to download repodata files instead of generating them by createrepo

yum-sync tries to imitate the parameters of aptsync, and it supports the following substitution rule for YUMSYNC_URL and <reponame> & <download_dir> in YUMSYNC_DISTS:

  • @{arch}: Architecture (x86_64, armhf, ...)
  • @{os_ver}: OS version (6-8, ...)
  • @{comp}: The <component> in YUMSYNC_DISTS

yum-sync.py is modified to get the same directory structure as upstream when syncing. And <reponame> should be named the same as the directory containing repodata dir.

Notes:

The following repo configuration:

baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el$releasever-$basearch

translates to:

YUMSYNC_URL='https://packages.cloud.google.com/yum/repos/kubernetes-el@{os_ver}-@{arch}'
YUMSYNC_DISTS='6-7|kubernetes|x86_64,aarch64,armhfp,ppc64le,s390x|kubernetes-el@{os_ver}-@{arch}|/yum/repos/kubernetes-el@{os_ver}-@{arch}'

And the following:

[mysql80-community]
name=MySQL 8.0 Community Server
baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

translates to:

YUMSYNC_URL='https://repo.mysql.com/yum/@{comp}/el/@{os_ver}/@{arch}/'
YUMSYNC_DISTS='6-8|mysql-8.0-community,mysql-5.7-community|aarch64,i386,x86_64|@{arch}|/yum/@{comp}/el/@{os_ver}/@{arch}/'

License

Specially, contents of folder apt-sync, yum-sync, github-release, docker-ce and the generated container image from them are under GPLv3 license, as it uses code from https://github.com/tuna/tunasync-scripts.

Other contents are under MIT license.

Contributing

See CONTRIBUTING.md.

ustcmirror-images's People

Contributors

bao-qian avatar dependabot[bot] avatar dramforever avatar gaoyifan avatar gloit042 avatar ibug avatar knight42 avatar kowy avatar ksqsf avatar medicalwei avatar ritaanthem avatar rtxux avatar staticfloat avatar stevapple avatar taoky avatar yuanyiwei avatar zhsj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ustcmirror-images's Issues

archvsync新版本

archvsync (20170912) unstable; urgency=medium

  [ Peter Palfrader ]
  * Fix Typo in Maintainer field (re: #856695, closes: #856912).

  [ Bastian Blank ]
  * Drop unused sync tools and configs.
  * Fix i18n/by-hash include for stage 1.
  * Always generate full trace.
  * Add ftpsync-cron script.
  * Add several mirror information to trace file.
  * Add informations about the used trigger to trace file.
  * Support URL as a mirror specification.
  * Only build extra tar on Debian, (closes: #875455)
  * Don't duplicate code during expansion. (closes: #857702)

 -- Bastian Blank <[email protected]>  Tue, 12 Sep 2017 22:02:08 +0200

从更新日志来看,主要是trace文件的格式比较重要(上游检测我们用的)。

大概更新下submodule,重新build下镜像就可以了。

ghcup bootstrap 脚本需要使用元数据未引用的 ghcup 版本

有邮件反馈,目前,官方 bootstrap 脚本仍然需要 0.1.18.0 的 ghcup:

> curl https://www.haskell.org/ghcup/sh/bootstrap-haskell | head -n 50                           
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 25365    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0#!/bin/sh

# This script downloads the 'ghcup' binary into '~/.ghcup/bin/' and then runs an interactive
# installation that lets you choose various options. Below is a list of environment variables
# that affect the installation procedure.

# Main settings:
#   * BOOTSTRAP_HASKELL_NONINTERACTIVE - any nonzero value for noninteractive installation
#   * BOOTSTRAP_HASKELL_NO_UPGRADE - any nonzero value to not trigger the upgrade
#   * BOOTSTRAP_HASKELL_MINIMAL - any nonzero value to only install ghcup
#   * GHCUP_USE_XDG_DIRS - any nonzero value to respect The XDG Base Directory Specification
#   * BOOTSTRAP_HASKELL_VERBOSE - any nonzero value for more verbose installation
#   * BOOTSTRAP_HASKELL_GHC_VERSION - the ghc version to install
#   * BOOTSTRAP_HASKELL_CABAL_VERSION - the cabal version to install
#   * BOOTSTRAP_HASKELL_INSTALL_NO_STACK - disable installation of stack
#   * BOOTSTRAP_HASKELL_INSTALL_NO_STACK_HOOK - disable installation stack ghcup hook
#   * BOOTSTRAP_HASKELL_INSTALL_HLS - whether to install latest hls
#   * BOOTSTRAP_HASKELL_ADJUST_BASHRC - whether to adjust PATH in bashrc (prepend)
#   * BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG - whether to adjust mingw paths in cabal.config on windows
#   * BOOTSTRAP_HASKELL_DOWNLOADER - which downloader to use (default: curl)
#   * GHCUP_BASE_URL - the base url for ghcup binary download (use this to overwrite https://downloads.haskell.org/~ghcup with a mirror)

# License: LGPL-3.0


# safety subshell to avoid executing anything in case this script is not downloaded properly
(

plat="$(uname -s)"
arch=$(uname -m)
ghver="0.1.18.0"
: "${GHCUP_BASE_URL:=https://downloads.haskell.org/~ghcup}"

然而 https://mirrors.ustc.edu.cn/ghcup/ghcup-metadata/ 下已经没有 metadata 引用 0.1.18.0,这似乎会导致 bootstrap 需要的对应文件被删除,从而无法完成安装。

stackage: 使用 stack 管理依赖

https://notes.0x01.me/Haskell-1a491b17d4dd4e49a76b6be96d496600#64ef2657cee64947893d07f11c6990f1

Stack 永远有一个“当前项目”的概念,它决定了执行 Stack 命令时用的编译器版本、各种外部 package 版本,和所有本地 package。这里我们没有本地 package 需要编译,因为只有一个单一文件(可以把它包成一个 package,但不太有必要)。我们需要知道编译器版本和外部 package 版本。

在这个目录中找不到相关信息,显然开发者并没有锁定各种东西的版本,这样的项目只能随缘编译,没法保证编译过程和开发者当时是一致的。结合 Dockerfile 和 prepare.sh 文件看来,编译器应该用的是 Debian 官方源的 GHC 版本,也没说是 Debian 哪个版本,就按最新版(bullseye)猜吧,那么应该是 GHC 8.8.4。

以及 stack 看起来也支持单文件格式,刚好这个月写了不少 Haskell,元旦前可以试试改改……

aptsync: can't open index .../Packages

日志

deb-aarch64 http://termux.net stable main
deb-all http://termux.net stable main
deb-arm http://termux.net stable main
deb-i686 http://termux.net stable main
deb-x86_64 http://termux.net stable main
============ SYNC STARTED AT 2018-05-05 05:00:11 ============
*********** 8< ***********
Downloading 54 index files using 2 threads...
Begin time: Sat May  5 05:00:11 2018
[2]... [1]... [0]...
End time: Sat May  5 05:00:18 2018

Processing translation indexes: [TTTTT]

Downloading 0 translation files using 0 threads...
Begin time: Sat May  5 05:00:18 2018
[0]...
End time: Sat May  5 05:00:18 2018

Processing DEP-11 indexes: [DDDDD]

Downloading 0 dep11 files using 0 threads...
Begin time: Sat May  5 05:00:18 2018
[0]...
End time: Sat May  5 05:00:18 2018

apt-mirror: can't open index termux.net/dists/stable/main/binary-aarch64/Packages in process_index at /usr/local/bin/apt-mirror line 801.
apt-mirror: can't open index termux.net/dists/stable/main/binary-all/Packages in process_index at /usr/local/bin/apt-mirror line 801.
apt-mirror: can't open index termux.net/dists/stable/main/binary-arm/Packages in process_index at /usr/local/bin/apt-mirror line 801.
apt-mirror: can't open index termux.net/dists/stable/main/binary-i686/Packages in process_index at /usr/local/bin/apt-mirror line 801.
apt-mirror: can't open index termux.net/dists/stable/main/binary-x86_64/Packages in process_index at /usr/local/bin/apt-mirror line 801.
Processing indexes: [PPPPP]

0 bytes will be downloaded into archive.
Downloading 0 archive files using 0 threads...
Begin time: Sat May  5 05:00:18 2018
[0]...
End time: Sat May  5 05:00:18 2018

0 bytes in 0 files and 0 directories can be freed.
Run /log//clean.sh for this purpose.

============ SYNC FINISHED AT 2018-05-05 05:00:18 ============

预期行为

正常解压Packages.xz,并读取Packages

实际行为

报错

apt-mirror: can't open index termux.net/dists/stable/main/binary-aarch64/Packages in process_index at /usr/local/bin/apt-mirror line 801.
apt-mirror: can't open index termux.net/dists/stable/main/binary-all/Packages in process_index at /usr/local/bin/apt-mirror line 801.
apt-mirror: can't open index termux.net/dists/stable/main/binary-arm/Packages in process_index at /usr/local/bin/apt-mirror line 801.
apt-mirror: can't open index termux.net/dists/stable/main/binary-i686/Packages in process_index at /usr/local/bin/apt-mirror line 801.
apt-mirror: can't open index termux.net/dists/stable/main/binary-x86_64/Packages in process_index at /usr/local/bin/apt-mirror line 801.

什么包也没同步下来。

复现步骤

  • Step 1
    yuki login (USTC Mirrors)
  • Step 2
    yuki sync termux

附注1

aptsync 中不包含 xz 命令, 理论上 apt-mirror 解压 Packages.xz 会报错,实际上日志中并没有类似错误信息。 得出两个结论:

  1. aptsync需要增加xz包
  2. 实际没有执行到解压逻辑

目前,临时增加了一个镜像 ustcmirror/aptsync:xz 作测试。

附注2

据我尝试,在 debian stretch 中安装 apt-mirror 和 xz-utils,并使用日志最开头的内容作为 mirror.list, 可以正常同步 termux。
猜测是移植到 alpine 过程中带来的问题。

附注3

由于未知原因,yuki 并不会保存 termux 仓库在同步时 stdout 产生的内容到 result.log 。

相比之下,使用同一个镜像的 k8s.apt 则可以保存来自 stdout 的日志。

附注4

实在是调试不动了..... 加之也没看懂迷之补丁 update.patch ....
请求维护者支援😂 @knight42

Rsync 在 Alpine (musl) 中处理软链接权限的问题

预期行为

Rsync 从使用 BSD 的上游同步完成包含软链接的文件后返回 0.

实际行为

出现 rsync: failed to set permissions on "<full file path>": Not supported (95) 的错误。目前导致 FreeBSD 的同步在状态页面显示失败(尽管实际上同步没有问题)。

复现步骤

  • Step 1

启动 Alpine 环境,安装 rsync。

$ sudo docker run --rm -it alpine:3.11
/ # apk add rsync
  • Step 2

同步时出现权限设置错误:

/ # rsync -avP rsync://ftp.kr.freebsd.org/FreeBSD/doc/ .
...
receiving incremental file list
rsync: failed to set permissions on "/README.txt": Not supported (95)
rsync: failed to set permissions on "/bn": Not supported (95)
rsync: failed to set permissions on "/da": Not supported (95)
rsync: failed to set permissions on "/de": Not supported (95)
rsync: failed to set permissions on "/el": Not supported (95)
...

问题解释与解决方法

Linux 下是不支持给软链接本身设置权限位的,但是 BSD 系的系统支持。Rsync 目前的稳定版本在处理软链接权限时的逻辑 (do_chmod()) 是:

  1. 编译时是否打开了 HAVE_LCHMOD 宏?如果是,那么就用 lchmod() 处理。
  2. 否则,如果是软链接且打开了 HAVE_SETATTRLIST 宏,那么就用 setattrlist() 处理,否则 do_chmod() 返回 1,代表软链接设置权限失败。外层调用可以恰当处理这个错误。

Linux 不支持 lchmod()setattrlist(),在正常编译的情况下以上两个宏都不会被打开(glibc 的 lchmod() 实现会直接返回 ENOSYS),所以软链接在正常情况下可以被恰当处理(忽略)。然而,musl 实现了 lchmod(),调用它时会去调用 fchmodat(),但是这个实现在遇到软链接时仍然会返回 ENOTSUP

目前在 rsync master 分支中的版本修改了逻辑如下:

  1. 编译时是否打开了 HAVE_LCHMOD 宏?如果是,那么就用 lchmod() 处理。
  2. 如果 lchmod() 返回了 ENOTSUP,且如果是软链接:
    • 如果打开了 HAVE_SETATTRLIST 宏,那么就用 setattrlist() 处理。
    • 否则 do_chmod() 返回 1。

但是包含以上修改的版本未发布稳定版。

如果要解决这个问题:

  • 等 rsync 发布新版,更新 rsync 同步镜像。
  • 或者把 base 换成 debian-slim,不要用 musl 了。

相关 issue:

golang get stucked for 3 days

============ SYNC STARTED AT 2017-11-25 20:20:55 ============
Building synchronization state...
Starting synchronization
ServiceException: 401 Anonymous users does not have storage.objects.get access to golang/go1.4-bootstrap-20990531.tar.gz.
CommandException: 1 files/objects could not be copied/removed.

升级 archvsync

From a Kali maintainer:

I can see that you use ftpsync from commit 616e661 (in 2017). Is there a chance that you update it to something more recent? There are some very nice-to-have bug fixes in the git tree, ...

部分同步容器无法正确处理包含空格的 EXCLUDE/EXTRA

预期行为

当环境变量为:

EXTRA=--some-arg "Test String"

的时候,被 exec 的最终的程序能够知道 --some-arg 的参数是 "Test String"

实际行为

当写成:

exec some-program $EXTRA

的时候,shell 实际会(非预期地)拆成 --some-arg '"Test' 'String"',那么 --some-arg 的参数就是 "Test 了。

并且在有 * 的情况下,shell 可能会尝试进行文件名匹配(虽然几乎所有情况下都会失败)

复现步骤

  • Step 1
    EXTRA: --user-agent "Example Tool"
  • Step 2
    exec ... $EXTRA => error: unexpected argument 'Tool"' found

目前的同步程序中可能受影响(用 rg -F -- "--" 搜索)的有 (fixed or not):

  • rsync
  • rclone
  • tsumugu
  • yukina

lftpsync 的命令设计看起来不受此影响。

补充信息

https://superuser.com/a/1529316

lftpsync不同步

用户邮件:

我发现没有 debian 17.10.请看这两个页面的对比

https://download.docker.com/linux/debian/dists/stretch/pool/test/amd64/

http://mirrors.ustc.edu.cn/docker-ce/linux/debian/dists/stretch/pool/test/amd64/

例如: docker run -it --rm -e LFTPSYNC_HOST=https://download.docker.com/ -e LFTPSYNC_PATH=/ -e DEBUG=true ustcmirror/lftpsync

大约运行数秒后结束:

+ set -u
+ export OWNER=0:0
+ OWNER=0:0
+ export LOG_ROTATE_CYCLE=0
+ LOG_ROTATE_CYCLE=0
+ export TO=/data/ LOGDIR=/log/
+ TO=/data/
+ LOGDIR=/log/
+ export LOGFILE=/log//result.log
+ LOGFILE=/log//result.log
+ chown 0:0 /data/
+ [[ -f /pre-sync.sh ]]
+ [[ 0 -ne 0 ]]
+ LOGFILE=/dev/null
+ date '+============ SYNC STARTED AT %F %T ============'
============ SYNC STARTED AT 2017-11-01 11:54:27 ============
+ pid=9
+ su-exec 0:0 /sync.sh
+ trap 'killer $pid' INT HUP TERM
+ wait 9
++ getconf _NPROCESSORS_ONLN
+ LFTPSYNC_JOBS=32
+ LFTPSYNC_EXCLUDE=' -X .~tmp~/'
+ BIND_ADDRESS=
+ commands='set cmd:fail-exit true;'
+ [[ -n '' ]]
+ commands+='open https://download.docker.com/;'
+ commands+='mirror --verbose --use-cache --skip-noaccess -aec --parallel=32  -X .~tmp~/ / /data/'
+ exec lftp -c 'set cmd:fail-exit true;open https://download.docker.com/;mirror --verbose --use-cache --skip-noaccess -aec --parallel=32  -X .~tmp~/ / /data/'
+ RETCODE=0
+ date '+============ SYNC FINISHED AT %F %T ============'
+ tee -a /dev/null
============ SYNC FINISHED AT 2017-11-01 11:54:33 ============
+ [[ -f /post-sync.sh ]]
+ exit 0

Add rclone to sync from s3

like rust-static, which is hosted on AWS S3, can be synced with tools like rclone.

$ rclone size s3:static-rust-lang-org
Total objects: 1253811
Total size: 5384.555 GBytes (5781622033822 Bytes)
cat ~/.config/rclone/rclone.conf 
[s3]
type = s3
env_auth = false
access_key_id = 
secret_access_key = 
region = us-west-1
endpoint = 
location_constraint = 
acl = private
server_side_encryption = 
storage_class = 

aptsync - Download i18n translations fails in bullseye-security

Hi

I found, that the translations in folder i18n won't download. Double slash in commandline??

The error message:
**
Processing indexes: [Papt-mirror: can't open index security.debian.org/debian-security//dists/bullseye-security/i18n/binary-amd64/Packages in process_index at /usr/local/bin/apt-mirror line 800.
]

Maybe an idea to fix???
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=932112

My run script:

[root@debmirror aptsync]# cat debian-security.sh
docker run --rm
-e LOG_ROTATE_CYCLE='5'
-e APTSYNC_URL='http://security.debian.org/debian-security'
-e APTSYNC_DISTS='bullseye-security|main contrib i18n|amd64'
-v /var/www/html/:/data --security-opt label=disable
docker.io/ustcmirror/aptsync:latest
[root@debmirror aptsync]#

--
Tnx in advance

Question. Should aptsync run on RHEL with podman? [SOLVED]

Tried to get Debian Repos (Bullseye) and write to local /var/www/html/debian. But get "Error: statfs /var/spool/apt-mirror: no such file or directory"

The /var/spool path is inside the container??

docker run --rm
-e LOG_ROTATE_CYCLE='5'
-e APTSYNC_URL='ftp.de.debian.org/debian'
-e APTSYNC_DISTS='bullseye|main contrib|amd64'
-v /var/spool/apt-mirror:/var/www/html/debian
docker.io/ustcmirror/aptsync:latest

Thanks in advance

apt-mirror uninitialized value $config{"options"}

用户邮件:

您好,

http://mirrors.ustc.edu.cn/kubernetes/apt/dists/kubernetes-xenial/main/binary-amd64/
https://packages.cloud.google.com/apt/dists/kubernetes-xenial/main/binary-amd64

这个目录下镜像的文件不一致,导致 apt update 时报告 Hash sum mismatch,请修正一下,非常感谢!

http://mirrors.ustc.edu.cn/kubernetes/apt/dists/kubernetes-xenial/
https://packages.cloud.google.com/apt/dists/kubernetes-xenial

这两个目录下的 Release, InRelease 文件大体一样(InRelease 文件里的 GPG 签名不一致),从文件 hash 记录看,Google 官方的 binary-amd64/Packages* 是正确的, USTC mirror 里对不上。

谢谢!

同步日志:

============ SYNC STARTED AT 2017-10-21 03:25:00 ============
Use of uninitialized value $config{"options"} in pattern match (m//) at /usr/local/bin/apt-mirror line 300, <CONFIG> line 8.
Use of uninitialized value $config{"options"} in pattern match (m//) at /usr/local/bin/apt-mirror line 300, <CONFIG> line 9.
Use of uninitialized value $config{"options"} in pattern match (m//) at /usr/local/bin/apt-mirror line 300, <CONFIG> line 10.
Use of uninitialized value $config{"options"} in pattern match (m//) at /usr/local/bin/apt-mirror line 300, <CONFIG> line 11.
Use of uninitialized value $config{"options"} in pattern match (m//) at /usr/local/bin/apt-mirror line 300, <CONFIG> line 12.
Use of uninitialized value $config{"options"} in pattern match (m//) at /usr/local/bin/apt-mirror line 300, <CONFIG> line 13.
Use of uninitialized value $config{"options"} in pattern match (m//) at /usr/local/bin/apt-mirror line 300, <CONFIG> line 14.
Use of uninitialized value $config{"options"} in pattern match (m//) at /usr/local/bin/apt-mirror line 300, <CONFIG> line 15.
Downloading 96 index files using 20 threads...
Begin time: Sat Oct 21 03:25:00 2017
[20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]... 
End time: Sat Oct 21 03:25:04 2017

Processing translation indexes: [TTTTTTTT]

Downloading 0 translation files using 0 threads...
Begin time: Sat Oct 21 03:25:04 2017
[0]... 
End time: Sat Oct 21 03:25:04 2017

Processing DEP-11 indexes: [DDDDDDDD]

Downloading 0 dep11 files using 0 threads...
Begin time: Sat Oct 21 03:25:04 2017
[0]... 
End time: Sat Oct 21 03:25:04 2017

Processing indexes: [PUse of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 1.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 2.
PPUse of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 1.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 2.
PPUse of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 1.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 2.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 3.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 4.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 5.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 6.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 7.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 8.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 9.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 10.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 11.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 12.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 13.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 14.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 15.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 16.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 17.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 18.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 19.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 20.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 21.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 22.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 23.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 24.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 25.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 26.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 27.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 28.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 29.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 30.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 31.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 32.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 33.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 34.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 35.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 36.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 37.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 38.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 39.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 40.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 41.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 42.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 43.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 44.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 45.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 46.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 47.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 48.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 49.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 50.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 51.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 52.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 53.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 54.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 55.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 56.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 57.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 58.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 59.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 60.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 61.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 62.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 63.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 64.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 65.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 66.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 67.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 68.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 69.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 70.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 71.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 72.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 73.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 74.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 75.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 76.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 77.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 78.
Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or string at /usr/local/bin/apt-mirror line 817, <STREAM> line 79.
PPP]

137.6 MiB will be downloaded into archive.
Downloading 4 archive files using 4 threads...
Begin time: Sat Oct 21 03:25:04 2017
[4]... [3]... [2]... [1]... [0]... 
End time: Sat Oct 21 03:25:30 2017

0 bytes in 0 files and 0 directories can be freed.
Run /log//clean.sh for this purpose.

============ SYNC FINISHED AT 2017-10-21 03:25:30 ============

Failed to build homebrew-bottles

Logs:
https://travis-ci.org/ustclug/ustcmirror-images/builds/357671366#L892

error: patch failed: Library/Homebrew/os/mac.rb:18
error: Library/Homebrew/os/mac.rb: patch does not apply
The command '/bin/sh -c apk add --no-cache ruby git curl ncurses ruby-json &&     git clone --depth 1 https://github.com/Linuxbrew/brew.git ~/.linuxbrew &&     cd ~/.linuxbrew &&     git apply /linuxbrew-*.patch &&     git clone --depth=1 --branch=threaded https://github.com/gaoyifan/homebrew-bottle-mirror.git /root/.linuxbrew/Library/Taps/gaoyifan/homebrew-bottle-mirror &&     mkdir -p ~/.linuxbrew/Library/Taps/homebrew/homebrew-core $HOMEBREW_CACHE' returned a non-zero code: 1
make: *** [homebrew-bottles.latest] Error 1
make: *** Waiting for unfinished jobs....

ping @gaoyifan

WinGet V2 版本索引格式

预期行为

目前 V2 索引在主线和 v1.8 分支上已经默认开启,但暂未发布新版本,最好在版本发布前实现 V2 索引兼容。

实际行为

当前同步脚本参考 V1 索引编写,预计需要调整。

复现步骤

  • Step 1: 在足够新的 WinGet 客户端上开启 indexV2 实验性功能。
  • Step 2: 通过分析源码以及抓包等方式探查索引库结构,实现兼容。

archvsync找不到/opt/ustcsync/bin/runmirrors

比如前几次的debian日志:

Mar 03 07:00:07 mirrors2 ftpsync-debian[8]: Mirrorsync start
Mar 03 07:00:07 mirrors2 ftpsync-debian[8]: Running mirrorsync, update is required, /srv/repo/debian//Archive-Update-Required-mirrors.ustc.edu.cn exists
Mar 03 07:00:07 mirrors2 ftpsync-debian[8]: Running stage1: rsync  --address=202.38.95.110 --ipv4 --bwlimit=0 -prltvHSB8192 --timeout 3600 --stats --filter=protect_Archive-Update-in-Progress-mirrors.ustc.edu.cn --filter=protect_project/trace/mirrors.ustc.edu.cn --filter=protect_project/trace/mirrors.ustc.edu.cn-stage1 --exclude=project/trace/_hierarchy --filter=protect_project/trace/_hierarchy --exclude=project/trace/_traces --filter=protect_project/trace/_traces --filter=protect_Archive-Update-Required-mirrors.ustc.edu.cn --exclude=Packages* --exclude=Sources* --exclude=Release* --exclude=InRelease --exclude=ls-lR* --include=by-hash/** --exclude=Contents* --exclude=dep11/* --exclude=i18n/*  --exclude=.~tmp~/   [email protected]::debian/ /srv/repo/debian/
Mar 03 07:12:17 mirrors2 ftpsync-debian[8]: Back from rsync with returncode 0
Mar 03 07:12:17 mirrors2 ftpsync-debian[8]: Latest recorded rsync transfer speed: 62 KB/s
Mar 03 07:12:17 mirrors2 ftpsync-debian[8]: Running stage2: rsync  --address=202.38.95.110 --ipv4 --bwlimit=0 -prltvHSB8192 --timeout 3600 --stats --filter=protect_Archive-Update-in-Progress-mirrors.ustc.edu.cn --filter=protect_project/trace/mirrors.ustc.edu.cn --filter=protect_project/trace/mirrors.ustc.edu.cn-stage1 --exclude=project/trace/_hierarchy --filter=protect_project/trace/_hierarchy --exclude=project/trace/_traces --filter=protect_project/trace/_traces --filter=protect_Archive-Update-Required-mirrors.ustc.edu.cn --max-delete=40000 --delay-updates --delete --delete-excluded --delete-delay  --exclude=.~tmp~/  [email protected]::debian/ /srv/repo/debian/
Mar 03 07:22:09 mirrors2 ftpsync-debian[8]: Back from rsync with returncode 0
Mar 03 07:22:09 mirrors2 ftpsync-debian[8]: Latest recorded rsync transfer speed: 1157 KB/s
Mar 03 07:22:09 mirrors2 ftpsync-debian[8]: Creating a full trace file
Mar 03 07:22:11 mirrors2 ftpsync-debian[8]: Trigger slave mirrors using -a debian -f -k all
/usr/local/bin/ftpsync: line 856: /opt/ustcsync/bin/runmirrors: No such file or directory
Got signal
Mar 03 07:22:11 mirrors2 ftpsync-debian[8]: Mirrorsync done

导致返回值不为0

错误发生的起始时间大约是4天前,猜测与 97aeb30 有关

Git checkout image

我们是否需要一个专门的用于同步需要 checkout 的 git 的同步镜像?

目前 crates-io-index 是 checkout 的 git 同步,后续如果需要添加新的需要使用类似方法同步的镜像(例如 rosdistro),为每个镜像都写一个专门的同步容器会比较麻烦。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.