diff --git a/.gitignore b/.gitignore index 4f9ffec..428e8f4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,11 @@ /Gemfile.lock /.jekyll-metadata /static/tunasync.json +/static/isoinfo.json /static/tunet.json +/static/js/vue.js /_site /deploy.sh +/.sass-cache/ +.bundle +vendor diff --git a/Dockerfile.build b/Dockerfile.build new file mode 100644 index 0000000..326cb1e --- /dev/null +++ b/Dockerfile.build @@ -0,0 +1,18 @@ +FROM ruby:2.3 + +RUN mkdir /data +WORKDIR /data + +RUN apt-get update && apt-get -y install nodejs + +COPY Gemfile /data/ + +RUN gem install bundler +RUN bundle install + +# Fix https://github.com/babel/ruby-babel-transpiler/issues/294 +RUN sed -i 's/@context ||= ExecJS.compile("var self = this; " + File.read(script_path))/@context ||= ExecJS.compile("var self = this; " + File.read(script_path, :encoding => "UTF-8"))/' /usr/local/bundle/gems/babel-transpiler-0.7.0/lib/babel/transpiler.rb + +ENV LANG en_US.UTF-8 + +CMD ["jekyll", "build"] diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000..16109a5 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,14 @@ +FROM alpine:3.3 +MAINTAINER Xuanwo +RUN apk add --update \ + nodejs ruby ruby-dev ruby-rdoc ruby-irb ruby-io-console ruby-nokogiri \ + gcc libc-dev libffi-dev zlib-dev libxml2-dev libxslt-dev build-base \ + && rm -rf /var/cache/apk/* +RUN gem sources --add http://gems.ruby-china.org/ --remove https://rubygems.org/ +RUN gem install bundler +RUN bundle config build.nokogiri --use-system-libraries +VOLUME /src +WORKDIR /src +EXPOSE 4000 +CMD bundle install && jekyll server -H 0.0.0.0 + diff --git a/Gemfile b/Gemfile index 50dfb08..b0db21e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,3 @@ -source 'https://ruby.taobao.org' +source 'https://mirrors.tuna.tsinghua.edu.cn/rubygems/' gem 'github-pages' gem 'jekyll-babel' diff --git a/README.md b/README.md index df433e6..cef3814 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,58 @@ # TUNA mirrors 主页 -## 运行 Demo +## 运行 Demo + +### 直接编译 本站使用 Jekyll 编写,并使用 babel 编译 ECMAScript6,因此必须安装 ruby >= 2.0 和 nodejs. +### For Centos +1.安装 nodejs +``` +yum install nodejs +``` +2.安装 ruby 2.2.4 and rubygems + +Step 1: Install Required Packages +``` +yum install gcc-c++ patch readline readline-devel zlib zlib-devel +yum install libyaml-devel libffi-devel openssl-devel make +yum install bzip2 autoconf automake libtool bison iconv-devel sqlite-devel +``` +Step 2: Compile ruby 2.2.4 source code +``` +weget -c https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.4.tar.gz +``` +Step 3: Install rubygems +``` +wget -c https://rubygems.org/rubygems/rubygems-2.4.8.tgz +ruby setup.rb +``` +3. 安装 bundle 和 build +``` +gem install bundle +gem install build +``` +4. Fork mirrors source code + ``` bundle install jekyll build ``` +### Build In Docker +``` +cd mirror-web +docker build -t builden -f Dockerfile.build . +docker run -it -v /path/to/mirror-web/:/data builden +``` + 为正常运行,一些动态数据文件需要下载 ``` wget https://mirrors.tuna.tsinghua.edu.cn/static/tunasync.json -O static/tunasync.json wget https://mirrors.tuna.tsinghua.edu.cn/static/tunet.json -O static/tunet.json +wget https://mirrors.tuna.tsinghua.edu.cn/static/isoinfo.json -O static/isoinfo.json ``` 之后 `jekyll serve` 即可运行 demo. @@ -38,39 +77,8 @@ wget https://mirrors.tuna.tsinghua.edu.cn/static/tunet.json -O static/tunet.json ### 特殊用法 #### 表单选择 -例如 中,通过表单选择操作系统和版本号,生成对应配置文件的代码为: - -```html -
-
- - -
-
- -

-
-
-
-
- -{% raw %} - -{% endraw %} -``` - -`
`包含的内容即为表单, `select`标签的`data-template`和`data-target`属性分别指定配置文件模板和 placeholder 的 id, -`option`标签为选项,`data-os` 和 `data-release` 分别指定操作系统名称和版本号。 - -`code#apt-content`部分是占位符,`{% raw %}{% endraw %}`包含的部分是配置文件模板,通过 `{% raw %}` 标记防止被 jekyll 转义。 -模板使用 [Markup.js](https://github.com/adammark/Markup.js/) 语法,可使用 `{{os_name}}` 和 `{{release_name}}` 两个变量, -对应于`option`中的操作系统和版本号设定。 +例如 中,通过表单选择操作系统和版本号,建议直接使用 Vue.js + diff --git a/_config.yml b/_config.yml index ff002c9..806613f 100644 --- a/_config.yml +++ b/_config.yml @@ -6,10 +6,11 @@ # 'jekyll serve'. If you change this file, please restart the server process. # Site settings -title: 清华大学 TUNA 镜像源 -brand: TUNA mirrors +title: 清华大学开源软件镜像站 +brand: Tsinghua Open Source Mirrors baseurl: "" # the subpath of your site, e.g. /blog permalink: "/:categories/:title/" +url: "https://mirrors.tuna.tsinghua.edu.cn" # Build settings highlighter: rouge @@ -24,11 +25,24 @@ sass: gems: - jekyll-babel + - jekyll-sitemap -exclude: [Gemfile, Gemfile.lock, README.md, gen_robot.sh] +babel_js_extensions: 'es6' + +exclude: [Gemfile, Gemfile.lock, README.md, gen_robot.sh, vendor, geninfo/, gen_robot.sh, gen_desc.py, Dockerfile*] # Content Related -new_mirrors: [openwrt, mongodb, anaconda, packman, gnu, osmc] issue: 由于同步脚本出错,执行了类似 rm -rf / 的操作…… backtime: 2016-04-03 20:00 +new_mirrors: + - adobe-fonts + - tinycorelinux + - zabbix + - lineage-rom + - lineageOS + - llvm + - clojars + + +# vim: ts=2 sts=2 sw=2 expandtab diff --git a/_data/mirror_desc.json b/_data/mirror_desc.json new file mode 100644 index 0000000..1f3d09f --- /dev/null +++ b/_data/mirror_desc.json @@ -0,0 +1,498 @@ +[ + { + "name": "AOSP", + "desc": "Android 操作系统源代码" + }, + { + "name": "AUR", + "desc": "Arch Linux 用户软件库" + }, + { + "name": "Bananian", + "desc": "为 Banana Pi 制作的,基于官方 Debian 仓库的发行版镜像和软件包仓库" + }, + { + "name": "CRAN", + "desc": "R 语言的可执行文件、源代码和说明文件,也收录了各种用户撰写的软件包" + }, + { + "name": "CTAN", + "desc": "TeX 的各种发行版、软件包和文档" + }, + { + "name": "CocoaPods", + "desc": "Objective-C 和 Swift 的依赖管理器" + }, + { + "name": "ELK", + "desc": "现已更名为 Elastic Stack,仅保留用作向后兼容" + }, + { + "name": "HHVM", + "desc": "Facebook 开发的高性能 PHP 语言虚拟机" + }, + { + "name": "Homebrew", + "desc": " Homebrew 的 formula 索引的镜像,二进制预编译包的镜像请见 homebrew-bottles" + }, + { + "name": "NetBSD", + "desc": "NetBSD 的安装镜像和部分系统源码" + }, + { + "name": "OpenBSD", + "desc": "OpenBSD 的安装镜像和官方软件包仓库" + }, + { + "name": "adobe-fonts", + "desc": "Adobe 公司的开源字体" + }, + { + "name": "alpine", + "desc": "Alpine Linux 的安装镜像和官方软件包仓库" + }, + { + "name": "anaconda", + "desc": "用于科学计算的 Python 发行版" + }, + { + "name": "antergos", + "desc": "基于 Arch Linux 的使用 GNOME 3 的发行版,曾用名 Cinnarch" + }, + { + "name": "anthon", + "desc": "Anthon Linux (安同 Linux)的安装镜像和官方软件包仓库" + }, + { + "name": "aosp-monthly", + "desc": "AOSP 镜像每月打包" + }, + { + "name": "apache", + "desc": "Apache 基金会赞助的各个项目" + }, + { + "name": "arch4edu", + "desc": "用于 Arch Linux 的一系列科研、教学所需工具" + }, + { + "name": "archlinux", + "desc": "Arch Linux 的安装镜像和官方软件包仓库" + }, + { + "name": "archlinuxarm", + "desc": "用于 arm 平台的 Arch Linux 镜像和软件包仓库" + }, + { + "name": "archlinuxcn", + "desc": "由 Arch Linux 中文社区驱动的非官方用户仓库,包含中文用户常用软件、工具、字体/美化包等" + }, + { + "name": "bananian", + "desc": "用于 Banana Pi 的 Debian 操作系统" + }, + { + "name": "bioconductor", + "desc": "" + }, + { + "name": "bjlx", + "desc": "北京龙芯 & Debian 俱乐部 的公开软件源" + }, + { + "name": "blackarch", + "desc": "用于安全评估的基于 Arch Linux 的轻量级发行版" + }, + { + "name": "centos", + "desc": "CentOS 的安装镜像和官方软件包仓库" + }, + { + "name": "ceph", + "desc": "高性能对象存储和文件系统" + }, + { + "name": "chakra", + "desc": "专注于 Qt 与 KDE 软件的 Linux 发行版" + }, + { + "name": "chromiumos", + "desc": "Google Chrome OS的开放源代码开发版本" + }, + { + "name": "ctex", + "desc": "旧版 CTEX 安装镜像存档" + }, + { + "name": "cygwin", + "desc": "Cygwin 官方软件包仓库" + }, + { + "name": "debian", + "desc": "Debian Linux 的官方软件包仓库" + }, + { + "name": "debian-cd", + "desc": "Debian Linux 的安装镜像" + }, + { + "name": "debian-multimedia", + "desc": "" + }, + { + "name": "debian-nonfree", + "desc": "" + }, + { + "name": "debian-security", + "desc": "Debian Linux 的安全更新" + }, + { + "name": "deepin", + "desc": "Deepin Linux 的官方软件包仓库" + }, + { + "name": "deepin-cd", + "desc": "Deeping Linux 的安装镜像" + }, + { + "name": "dell", + "desc": "Dell 服务器管理工具" + }, + { + "name": "docker", + "desc": "Debian/Ubuntu/Fedora/CentOS/RHEL 的 docker 软件包" + }, + { + "name": "dotdeb", + "desc": "用于 Debian 服务器的额外镜像源" + }, + { + "name": "elasticstack", + "desc": "ELK 系列数据分析工具,5.x 之后改名为 Elastic Stack" + }, + { + "name": "elpa", + "desc": "Emacs 内建包管理器 package.el 的软件源" + }, + { + "name": "elrepo", + "desc": "RHEL 及其变体的 RPM 软件包仓库" + }, + { + "name": "elvish", + "desc": "TUNA 前会长 xiaq 开发的革命性 Shell" + }, + { + "name": "epel", + "desc": "企业版 Linux 附加软件包" + }, + { + "name": "erlang-solutions", + "desc": "" + }, + { + "name": "fedora", + "desc": "Fedora Linux 的安装镜像和官方软件包仓库" + }, + { + "name": "gentoo", + "desc": "Gentoo Linux 的 Stage 3 镜像" + }, + { + "name": "gentoo-portage", + "desc": "Gentoo Linux 的 Portage 包管理器镜像源" + }, + { + "name": "git-repo", + "desc": "Google 开发的项目依赖下载工具 repo 的镜像" + }, + { + "name": "gitlab-ce", + "desc": "Gitlab 社区版" + }, + { + "name": "gitlab-ci-multi-runner", + "desc": "GitLab 持续集成框架" + }, + { + "name": "gnu", + "desc": "GNU项目的软件包(源代码、文档和部分平台的二进制文件)" + }, + { + "name": "grafana", + "desc": "开源的数据可视化工具" + }, + { + "name": "hackage", + "desc": "Haskell 社区的中心软件包仓库" + }, + { + "name": "homebrew", + "desc": "Homebrew 的软件包描述文件" + }, + { + "name": "homebrew-bottles", + "desc": "预编译的 Homebrew 软件包" + }, + { + "name": "infinality-bundle", + "desc": "Arch Linux 的字体渲染软件包" + }, + { + "name": "influxdata", + "desc": "时间序列数据平台" + }, + { + "name": "ius", + "desc": "为企业版 LInux 提供最新软件包的镜像源" + }, + { + "name": "jenkins", + "desc": "用 Java 编写的持续集成框架" + }, + { + "name": "kali", + "desc": "Kali Linux 的官方软件包仓库" + }, + { + "name": "kali-images", + "desc": "Kali Linux 的安装镜像" + }, + { + "name": "kali-security", + "desc": "Kali Linux 的安全更新" + }, + { + "name": "kernel", + "desc": "各个版本的Linux 内核源代码" + }, + { + "name": "kodi", + "desc": "开源的多媒体播放器,原名 XBMC" + }, + { + "name": "lineage-rom", + "desc": "最大的社区Android发行版之一Lineage的ROM" + }, + { + "name": "lineageOS", + "desc": "最大的社区Android发行版之一Lineage的源代码" + }, + { + "name": "linux-stable.git", + "desc": "Linux 内核源代码的 Git 仓库, 稳定版分支" + }, + { + "name": "linux.git", + "desc": "Linux 内核源代码的 Git 仓库" + }, + { + "name": "linuxmint", + "desc": "Linux Mint 的官方软件源" + }, + { + "name": "linuxmint-cd", + "desc": "Linux Mint 的安装镜像" + }, + { + "name": "loongson", + "desc": "用于龙芯电脑的软件包" + }, + { + "name": "lxc-images", + "desc": "Linux 容器的镜像" + }, + { + "name": "macports", + "desc": "macOS 的一个开源软件包管理系统" + }, + { + "name": "mageia", + "desc": "Mageia Linux (衍生于Mandriva Linux)的安装镜像和官方软件包仓库" + }, + { + "name": "manjaro", + "desc": "Manjaro Linux 的官方软件源" + }, + { + "name": "manjaro-cd", + "desc": "Manjanro Linux 的安装镜像" + }, + { + "name": "mariadb", + "desc": "衍生于 MySQL 的开源关系数据库" + }, + { + "name": "mongodb", + "desc": "开源的跨平台 NoSQL 文档型数据库" + }, + { + "name": "msys2", + "desc": "用于编译原生 Windows 程序的类 Linux 开发环境" + }, + { + "name": "mysql", + "desc": "MySQL 安装包及各种工具下载" + }, + { + "name": "neurodebian", + "desc": "用于神经科学研究的 Debian 软件包源" + }, + { + "name": "nodesource", + "desc": "为 Debian, Ubuntu, Fedora, RHEL 等发行版提供预编译的 nodejs 和 npm 等软件包" + }, + { + "name": "opensuse", + "desc": "openSUSE 的安装镜像和官方软件包仓库" + }, + { + "name": "openwrt", + "desc": "OpenWrt 软件包镜像源(仅包含Chaos Calmer版本)" + }, + { + "name": "osmc", + "desc": "免费、开源的媒体中心解决方案" + }, + { + "name": "packman", + "desc": "为 Debian、Fedora、openSUSE、Ubuntu 提供额外和过期软件包的仓库" + }, + { + "name": "parrot", + "desc": "Parrot Linux(专注于安全审计的 Linux 发行版)的安装奖项和官方软件源" + }, + { + "name": "percona", + "desc": "开源的数据库解决方案,详见 http://www.percona.com" + }, + { + "name": "postgresql", + "desc": "著名的开源关系型数据库 PostgreSQL 的镜像" + }, + { + "name": "puppy", + "desc": "为家用电脑设计的轻量级 Linux 发行版" + }, + { + "name": "pybombs", + "desc": "为 GNU Radio 设计的编译管理系统" + }, + { + "name": "pypi", + "desc": "Python 软件包索引源" + }, + { + "name": "qt", + "desc": "跨平台软件开发库 Qt 的源码、开发工具、文档等" + }, + { + "name": "raspbian", + "desc": "为 Raspberry Pi 编译的 Debian" + }, + { + "name": "redhat", + "desc": "Red Hat Enterprise Linux 官方软件源" + }, + { + "name": "remi", + "desc": "包含最新版本 PHP 和 MySQL 的第三方 yum 源" + }, + { + "name": "repo-ck", + "desc": "repo-ck 是 Arch 的非官方仓库,内有包含 ck 补丁、BFS 调度器等" + }, + { + "name": "repoforge", + "desc": "Repoforge 是 RHEL 系统下的软件仓库,拥有 10000 多个软件包,被认为是最安全、最稳定的一个软件仓库" + }, + { + "name": "ros", + "desc": "ROS (Robot Operating System) 提供一系列程序库和工具以帮助软件开发者创建机器人应用软件" + }, + { + "name": "rpmfusion", + "desc": "RPM Fusion 提供了一些 Fedora Project 和 Red Hat 不包含的软件" + }, + { + "name": "rubygems", + "desc": "Ruby 的一个包管理器" + }, + { + "name": "sagemath", + "desc": "构建在 NumPy, SciPy 等工具之上的开源数学软件系统" + }, + { + "name": "saltstack", + "desc": "基于 python 的配置管理与运维自动化工具" + }, + { + "name": "slackware", + "desc": "Linux 发行版 Slackware 的源代码和官方软件包仓库" + }, + { + "name": "slackwarearm", + "desc": "用于 ARM 设备的 Slackware 发行版源代码和官方软件包仓库" + }, + { + "name": "stackage", + "desc": "Haskell 项目管理器 stack 所需的元数据与 ghc 安装包的镜像" + }, + { + "name": "steamos", + "desc": "Valve 开发的基于 Debian 的操作系统,包含安装镜像和官方软件包仓库" + }, + { + "name": "tensorflow", + "desc": "采用数据流图、用于数值计算的开源深度学习框架 TensorFlow" + }, + { + "name": "termux", + "desc": " 运行在 Android 上的终端模拟器 Termux 的官方软件包仓库" + }, + { + "name": "tinycorelinux", + "desc": "" + }, + { + "name": "ubuntu", + "desc": "流行的 Linux 发行版 Ubuntu 的安装镜像和官方软件包仓库" + }, + { + "name": "ubuntu-cdimage", + "desc": "Ubuntu 及 Ubuntu 衍生版各版本安装镜像" + }, + { + "name": "ubuntu-cloud-images", + "desc": "适用于公有云的 Ubuntu 安装镜像" + }, + { + "name": "ubuntu-ports", + "desc": "armhf, arm64 以及 powerpc 等平台的 Ubuntu 软件仓库" + }, + { + "name": "ubuntu-releases", + "desc": "包含近几年发行的 Ubuntu 的镜像" + }, + { + "name": "videolan-ftp", + "desc": "简称VLC,是一款自由、开源的跨平台多媒体播放器及框架,可播放大多数多媒体文件" + }, + { + "name": "virtualbox", + "desc": "Oracle 的开源的 x86 架构虚拟机" + }, + { + "name": "weave", + "desc": "Google 开发的物联网(IoT)设备通信平台" + }, + { + "name": "zabbix", + "desc": "" + }, + { + "name": "llvm", + "desc": "LLVM 编译器套件的多个 git repo 的镜像" + } +] diff --git a/_includes/footer.html b/_includes/footer.html index 2d740fc..2f723d9 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -1,7 +1,35 @@
-

- 2011-2016 Tsinghua University TUNA Association -

+
+
+

本站由清华大学信息化技术中心支持创办,由清华大学 TUNA 协会运行维护。

+

清华大学 TUNA 协会,全名清华大学学生网络与开源软件协会,是由清华大学热爱网络技术和开源软件极客组成的学生技术社团。

+

本站相关源码可在 这里(镜像管理器)这里(镜像站网页) 获取。

+
+ +
+

Contact Us

+
+ +
+
+ +
+ +
+
diff --git a/_includes/head.html b/_includes/head.html index 5603233..ae8f483 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -2,16 +2,20 @@ - + -清华大学 TUNA 镜像源 +清华大学开源软件镜像站 | Tsinghua Open Source Mirror + + + + diff --git a/_includes/nav.html b/_includes/nav.html index eb38930..c33067a 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -7,7 +7,7 @@ - 清华大学 TUNA 镜像源 + 清华大学开源软件镜像站 diff --git a/_posts/help/1970-01-01-CocoaPods.md b/_posts/help/1970-01-01-CocoaPods.md new file mode 100644 index 0000000..33ed40e --- /dev/null +++ b/_posts/help/1970-01-01-CocoaPods.md @@ -0,0 +1,31 @@ +--- +layout: help +category: help +mirrorid: CocoaPods +--- + +## CocoaPods 镜像使用帮助 + +CocoaPods 是一个 Cocoa 和 Cocoa Touch 框架的依赖管理器,具体原理和 Homebrew 有点类似,都是从 GitHub 下载索引,然后根据索引下载依赖的源代码。 + +对于旧版的 CocoaPods 可以使用如下方法使用 tuna 的镜像: + +``` +$ pod repo remove master +$ pod repo add master https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git +$ pod repo update +``` + +新版的 CocoaPods 不允许用`pod repo add`直接添加master库了,但是依然可以: + +``` +$ cd ~/.cocoapods/repos +$ pod repo remove master +$ git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master +``` + +最后进入自己的工程,在自己工程的`podFile`第一行加上: + +``` +source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git' +``` diff --git a/_posts/help/1970-01-01-anaconda.md b/_posts/help/1970-01-01-anaconda.md new file mode 100644 index 0000000..929e2e3 --- /dev/null +++ b/_posts/help/1970-01-01-anaconda.md @@ -0,0 +1,48 @@ +--- +layout: help +category: help +mirrorid: anaconda +--- + +## Anaconda 镜像使用帮助 + +Anaconda 是一个用于科学计算的 Python 发行版,支持 Linux, Mac, Windows, 包含了众多流行的科学计算、数据分析的 Python 包。 + +Anaconda 安装包可以到 下载。 + +TUNA 还提供了 Anaconda 仓库的镜像,运行以下命令: + +``` +conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ +conda config --set show_channel_urls yes +``` + +即可添加 Anaconda Python 免费仓库。 + +运行 `conda install numpy` 测试一下吧。 + +## Miniconda 镜像使用帮助 + +Miniconda 是一个 Anaconda 的轻量级替代,默认只包含了 python 和 conda,但是可以通过 pip 和 conda 来安装所需要的包。 + +Miniconda 安装包可以到 下载。 + +## Conda 三方源 + +当前tuna还维护了一些anaconda三方源。 + +### Conda Forge + +``` +conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/ +``` + +### msys2 + +``` +conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/ +``` + +### 其他三方源 + +对于conda的其他三方源,如有需要请在[这个issue](https://github.com/tuna/issues/issues/112)中提出请求,我们会综合考虑多方因素来酌情增减。 diff --git a/_posts/help/1970-01-01-aosp.md b/_posts/help/1970-01-01-aosp.md index 8e4178f..60bb82d 100644 --- a/_posts/help/1970-01-01-aosp.md +++ b/_posts/help/1970-01-01-aosp.md @@ -10,9 +10,16 @@ permalink: /help/AOSP/ **注意: 本镜像是 AOSP 镜像,Android SDK因版权原因,我们不能提供镜像服务。** 参考 Google 教程 , -将 `https://android.googlesource.com/` 全部使用 `https://aosp.tuna.tsinghua.edu.cn/` -或 `git://aosp.tuna.tsinghua.edu.cn/aosp/` 代替即可。 +将 `https://android.googlesource.com/` 全部使用 `https://aosp.tuna.tsinghua.edu.cn/` 代替即可。 +由于使用 HTTPS 协议更安全,并且更便于我们灵活处理,所以强烈推荐使用 HTTPS 协议同步 AOSP 镜像。 + +**由于 AOSP 镜像造成CPU/内存负载过重,我们限制了并发数量,因此建议:** +1. sync的时候并发数不宜太高,否则会出现 503 错误,即`-j`后面的数字不能太大,建议选择4。 +2. 请尽量选择流量较小时错峰同步。 + +- **2016-06-24 : 关闭 git:// 协议,仅支持 HTTPS** +- **2016-04-03 : 删除每月初始化包中的冗余内容,使用方法更新** - **2015-12-21 : 增加每月初始化包,少量修正文档错误** - **2015-10-13 : 修复上游替换文档错误** - **2015-10-13 : 修复次级镜像文档错误** @@ -32,6 +39,34 @@ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo chmod a+x ~/bin/repo ``` +或者使用tuna的[git-repo镜像](https://mirrors.tuna.tsinghua.edu.cn/help/git-repo/) + +#### 使用每月更新的初始化包 + +由于首次同步需要下载 24GB 数据,过程中任何网络故障都可能造成同步失败,我们强烈建议您使用初始化包进行初始化。 + +下载 ,下载完成后记得根据 checksum.txt 的内容校验一下。 + +由于所有代码都是从隐藏的 `.repo` 目录中 checkout 出来的,所以我们只保留了 `.repo` 目录,下载后解压 +再 `repo sync` 一遍即可得到完整的目录。 + +使用方法如下: + +```bash +wget https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar # 下载初始化包 +tar xf aosp-latest.tar +cd AOSP # 解压得到的 AOSP 工程目录 +# 这时 ls 的话什么也看不到,因为只有一个隐藏的 .repo 目录 +repo sync # 正常同步一遍即可得到完整目录 +# 或 repo sync -l 仅checkout代码 +``` + +此后,每次只需运行 `repo sync` 即可保持同步。 +**我们强烈建议您保持每天同步,并尽量选择凌晨等低峰时间** + + +#### 传统初始化方法 + 建立工作目录: ``` @@ -43,12 +78,10 @@ cd WORKING_DIRECTORY ``` repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -# 或 repo init -u git://aosp.tuna.tsinghua.edu.cn/aosp/platform/manifest - -## 如果提示无法连接到 gerrit.googlesource.com,可以编辑 ~/bin/repo,把 REPO_URL 一行替换成下面的: -REPO_URL = 'https://gerrit-google.tuna.tsinghua.edu.cn/git-repo' ``` +**如果提示无法连接到 gerrit.googlesource.com,请参照[git-repo的帮助页面](/help/git-repo)的更新一节。** + 如果需要某个特定的 Android 版本([列表](https://source.android.com/source/build-numbers.html#source-code-tags-and-builds)): ``` @@ -62,21 +95,6 @@ repo sync ``` -### 使用每月更新的初始化包 - -由于首次同步需要下载 37GB 数据,过程中任何网络故障都可能造成同步失败,因此你可以选择使用每月更新的初始化包。 - -首先到 http://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/ 选择合适自己的构建包,aosp-latest.tar.xz 经过了 xz 压缩, -相对 aosp-latest.tar 小一些,但是解压的时间也要考虑进来,27G的压缩包呢!(如果CPU核多可以使用pxz解压) - -使用方法如下: - -``` -wget http://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar # 下载初始化包 -tar xf aosp-latest.tar -cd AOSP # 解压得到的 AOSP 工程目录 -repo sync # 正常同步 -``` ### 建立次级镜像 @@ -94,13 +112,13 @@ repo sync # 正常同步 repo init -u https://aosp.tuna.tsinghua.edu.cn/mirror/manifest --mirror ``` -同步源码树: +最后同步源码树: ``` repo sync ``` -同步完成后,运行 `git daemon --verbose --export-all --base-path=WORKING_DIR WORKING_DIR` (WORKING_DIR为代码树所在目录) 。 +同步完成后,运行 `git daemon --verbose --export-all --base-path=WORKING_DIR WORKING_DIR` (`WORKING_DIR`为代码树所在目录) 。 此后,其他用户使用 `git://ip.to.mirror/` 作为镜像即可。 @@ -109,15 +127,14 @@ repo sync 如果你之前已经通过某种途径获得了 AOSP 的源码(或者你只是 init 这一步完成后), 你希望以后通过 TUNA 同步 AOSP 部分的代码,只需要将 `.repo/manifest.xml` 把其中的 aosp 这个 remote 的 fetch 从 -`https://android.googlesource.com` 改为 `https://aosp.tuna.tsinghua.edu.cn/` -或 `git://aosp.tuna.tsinghua.edu.cn/aosp`。 +`https://android.googlesource.com` 改为 `https://aosp.tuna.tsinghua.edu.cn/`。 ```diff -*  镜像地址:  +*  镜像地址:  使用方法:在 `/etc/pacman.conf` 文件末尾添加以下两行: ``` [archlinuxcn] -SigLevel = Optional TrustedOnly -Server = http://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch +Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch ``` 之后安装 `archlinuxcn-keyring` 包导入 GPG key。 diff --git a/_posts/help/1970-01-01-bananian.md b/_posts/help/1970-01-01-bananian.md new file mode 100644 index 0000000..0f8ad1f --- /dev/null +++ b/_posts/help/1970-01-01-bananian.md @@ -0,0 +1,68 @@ +--- +category: help +layout: help +mirrorid: bananian +--- + +## Bananian 镜像使用帮助 + +[Bananian](https://www.bananian.org/) 是为 [Banana Pi](http://www.banana-pi.org/) 制作的,基于官方 Debian 仓库的发行版, +其内核和 bootloader 为 Banana Pi 做了定制化。 + +安装镜像可以到 获取。 + +### 使用 TUNA 镜像作为软件仓库 + +首先需要信任 Bananian 的 GPG 公钥 + +``` +gpg --recv-keys 24BFF712 +gpg --armor --export 24BFF712 | sudo apt-key add - +``` + +之后添加 Bananian 仓库,运行以下命令即可 + + +
+ + +
+ + +{% raw %} + +{% endraw %} + +

+ +
+
+
+
+ +更新软件包缓存 + +``` +sudo apt-get update +``` diff --git a/_posts/help/1970-01-01-centos.md b/_posts/help/1970-01-01-centos.md new file mode 100644 index 0000000..4ca3c2b --- /dev/null +++ b/_posts/help/1970-01-01-centos.md @@ -0,0 +1,102 @@ +--- +category: help +layout: help +mirrorid: centos +--- + +## CentOS 镜像使用帮助 + +首先备份 CentOS-Base.repo +``` +sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak +``` + +之后启用 TUNA 软件仓库, 将以下内容写入 /etc/yum.repos.d/CentOS-Base.repo + +
+
+ + +
+
+ +{% raw %} + +{% endraw %} + +

+ +
+
+
+
+ +更新软件包缓存 +``` +sudo yum makecache +``` diff --git a/_posts/help/1970-01-01-chromiumos.md b/_posts/help/1970-01-01-chromiumos.md new file mode 100644 index 0000000..7e8e004 --- /dev/null +++ b/_posts/help/1970-01-01-chromiumos.md @@ -0,0 +1,86 @@ +--- +layout: help +category: help +mirrorid: chromiumos +permalink: /help/chromiumos/ +--- + +## Chromium OS 镜像使用帮助 + +> Chromium OS is an open-source project that aims to build an operating system that provides a fast, simple, and more secure computing experience for people who spend most of their time on the web. + +#### 准备工作 + +下载 repo 工具: + +```bash +mkdir ~/bin +PATH=~/bin:$PATH +curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo +chmod a+x ~/bin/repo +``` + +或者使用tuna的[git-repo镜像](https://mirrors.tuna.tsinghua.edu.cn/help/git-repo/) + +#### 下载代码 + +建立工作目录: + +``` +mkdir WORKING_DIRECTORY +cd WORKING_DIRECTORY +``` + +初始化仓库: + +``` +repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/chromiumos/chromiumos/manifest +``` + +**注意: 本镜像是 Chromium OS 的 master 分支的镜像,如果使用本镜像下载 Chromium OS 的其他版本很大概率会失败** + +**如果提示无法连接到 gerrit.googlesource.com,请参照[git-repo的帮助页面](/help/git-repo)的更新一节。** + +接着使用编辑器打开`.repo/manifests/_remotes.xml`这个文件,将 + +``` +"https://chromium.googlesource.com" +``` + +替换为 + +``` +"https://mirrors.tuna.tsinghua.edu.cn/git/chromiumos/" +``` + +将 + +``` +"https://android.googlesource.com" +``` + +替换为 + +``` +"https://aosp.tuna.tsinghua.edu.cn/" +``` + +将 + +``` +"https://weave.googlesource.com" +``` + +替换为 + +``` +"https://mirrors.tuna.tsinghua.edu.cn/git/weave/" +``` + +即可。 + +最后同步源码树(以后只需执行这条命令来同步): + +``` +repo sync +``` diff --git a/_posts/help/1970-01-01-cygwin.md b/_posts/help/1970-01-01-cygwin.md new file mode 100644 index 0000000..e473cba --- /dev/null +++ b/_posts/help/1970-01-01-cygwin.md @@ -0,0 +1,21 @@ +--- +category: help +layout: help +mirrorid: cygwin +--- + +Cygwin 镜像使用帮助 +================== + +从 上下载 [setup-x86.exe](https://cygwin.com/setup-x86.exe) 或 [setup-x86_64.exe](https://cygwin.com/setup-x86_64.exe)。 + +选择`Install from Internet`, 在"User URL"处输入以下地址,注意,Cygwin貌似**不支持使用https**。(但由于setup.exe是以https链接分发,而镜像文件中又有.sig签名文件,所以可以认为http的镜像是安全的) + +``` +http://mirrors.tuna.tsinghua.edu.cn/cygwin/ +``` + +点击"Add"按钮, 然后选中"http://mirrors.tuna.tsinghua.edu.cn", 点击"下一步"进行安装。 + +注意,该列表为可多选列表,注意把上面不需要的镜像点掉。 + diff --git a/_posts/help/1970-01-01-docker.md b/_posts/help/1970-01-01-docker.md index acc2880..abeec8c 100644 --- a/_posts/help/1970-01-01-docker.md +++ b/_posts/help/1970-01-01-docker.md @@ -25,14 +25,11 @@ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58
@@ -58,7 +55,7 @@ sudo apt-get install docker-engine {% raw %} {% endraw %} @@ -70,13 +67,10 @@ echo "deb https://mirrors.tuna.tsinghua.edu.cn/docker/apt/repo {{release_name}}
@@ -99,7 +93,7 @@ sudo yum install docker-engine {%endraw%} -### CentOS/RHEL + +### RHEL/CentOS 用户 + 新建 `/etc/yum.repos.d/gitlab-ce.repo`,内容为 -
-
- - -
-
+``` +[gitlab-ce] +name=Gitlab CE Repository +baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/ +gpgcheck=0 +enabled=1 +``` -

-
-
-
-
- - -再执行 +再执行 ``` sudo yum makecache -sudo yum install gitlab-ce +sudo yum install gitlab-ce ``` - -{% raw %} - -{% endraw %} diff --git a/_posts/help/1970-01-01-gitlab-ci-multi-runner.md b/_posts/help/1970-01-01-gitlab-ci-multi-runner.md new file mode 100644 index 0000000..5e1a3c7 --- /dev/null +++ b/_posts/help/1970-01-01-gitlab-ci-multi-runner.md @@ -0,0 +1,93 @@ +--- +category: help +layout: help +mirrorid: gitlab-ci-multi-runner +--- + +## Gitlab CI Multi Runner 镜像使用帮助 + +**注意: gitlab-ci-multi-runner 镜像仅支持 x86-64 架构** + +### Debian/Ubuntu 用户 + +首先信任 GitLab 的 GPG 公钥: + +``` +curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null +``` + +再选择你的 Debian/Ubuntu 版本,文本框中内容写进 `/etc/apt/sources.list.d/gitlab-ci-multi-runner.list` + +
+
+ + +
+
+ +

+
+
+
+
+ + +安装 gitlab-ci-multi-runner: + +``` +sudo apt-get update +sudo apt-get install gitlab-ci-multi-runner +``` + +{% raw %} + +{%endraw%} + +### CentOS/RHEL + +新建 `/etc/yum.repos.d/gitlab-ci-multi-runner.repo`,内容为 + +
+
+ + +
+
+ +

+
+
+
+
+ + +再执行 + +``` +sudo yum makecache +sudo yum install gitlab-ci-multi-runner +``` + +{% raw %} + +{% endraw %} diff --git a/_posts/help/1970-01-01-hackage.md b/_posts/help/1970-01-01-hackage.md index afacc17..805cea1 100644 --- a/_posts/help/1970-01-01-hackage.md +++ b/_posts/help/1970-01-01-hackage.md @@ -16,7 +16,26 @@ cabal update 待生成`~/.cabal/config`之后`Ctrl+C`, 然后进行下一步。 -### 已经存在`config` +### Cabal ≥ 1.2.4 (GHC 8.0) + +修改 `~/.cabal/config`,加入 + +``` +repository mirrors.tuna.tsinghua.edu.cn + url: http://mirrors.tuna.tsinghua.edu.cn/hackage +``` + +为了访问速度,可以选择把官方仓库注释掉: + +``` +repository hackage.haskell.org + url: http://hackage.haskell.org/ + -- secure: False + -- root-keys: + -- key-threshold: +``` + +### Cabal < 1.2.4 修改`~/.cabal/config`, 将此行 @@ -40,7 +59,7 @@ remote-repo: mirrors.tuna.tsinghua.edu.cn:http://mirrors.tuna.tsinghua.edu.cn/ha ```yaml package-indices: -- name: Tsinghua - download-prefix: http://mirrors.tuna.tsinghua.edu.cn/hackage/package/ - http: http://mirrors.tuna.tsinghua.edu.cn/hackage/00-index.tar.gz + - name: Tsinghua + download-prefix: http://mirrors.tuna.tsinghua.edu.cn/hackage/package/ + http: http://mirrors.tuna.tsinghua.edu.cn/hackage/00-index.tar.gz ``` diff --git a/_posts/help/1970-01-01-homebrew-bottles.md b/_posts/help/1970-01-01-homebrew-bottles.md new file mode 100644 index 0000000..0eafa0d --- /dev/null +++ b/_posts/help/1970-01-01-homebrew-bottles.md @@ -0,0 +1,20 @@ +--- +category: help +layout: help +mirrorid: homebrew-bottles +--- + +## Homebrew-bottles 镜像使用帮助 + +**注:该镜像是 Homebrew 二进制预编译包的镜像。本镜像站同时提供 Homebrew 的 formula 索引的镜像(即 `brew update` 时所更新内容),请参考 [Homebrew 镜像使用帮助](https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/)。** + +### 临时替换 +```bash +export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles +``` + +### 长期替换 +```bash +echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile +source ~/.bash_profile +``` diff --git a/_posts/help/1970-01-01-homebrew.md b/_posts/help/1970-01-01-homebrew.md index 3d31e09..71d1184 100644 --- a/_posts/help/1970-01-01-homebrew.md +++ b/_posts/help/1970-01-01-homebrew.md @@ -6,33 +6,28 @@ mirrorid: homebrew ## Homebrew 镜像使用帮助 +**注:该镜像是 Homebrew 的 formula 索引的镜像(即 `brew update` 时所更新内容)。本镜像站同时提供 Homebrew 二进制预编译包的镜像,请参考 [Homebrew bottles 镜像使用帮助](https://mirrors.tuna.tsinghua.edu.cn/help/homebrew-bottles/)。** + ### 替换现有上游 ``` -cd /usr/local -git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew.git +cd "$(brew --repo)" +git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git + +cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" +git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git + brew update -``` - - 如果速度还是很慢,可以尝试以下操作: 然后重试update。 - -``` -cd ~/tmp -git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew.git -rm -rf /usr/local/.git -rm -rf /usr/local/Library -cp -R homebrew/.git /usr/local/ -cp -R homebrew/Library /usr/local/ ``` ### 使用homebrew-science或者homebrew-python ``` -cd /usr/local/Library/Taps/homebrew/homebrew-science -git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew-science.git +cd "$(brew --repo)/Library/Taps/homebrew/homebrew-science" +git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-science.git -cd /usr/local/Library/Taps/homebrew/homebrew-python -git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew-python.git +cd "$(brew --repo)/Library/Taps/homebrew/homebrew-python" +git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-python.git brew update ``` diff --git a/_posts/help/1970-01-01-lineage-rom.md b/_posts/help/1970-01-01-lineage-rom.md new file mode 100644 index 0000000..dcbb9de --- /dev/null +++ b/_posts/help/1970-01-01-lineage-rom.md @@ -0,0 +1,18 @@ +--- +layout: help +category: help +mirrorid: lineage-rom +permalink: /help/lineage-rom/ +--- + +## Lineage 介绍 + +Lineage OS 是全球最大的 Android 发行版之一,前身是 Cyanogenmod。 + +## Lineage rom 镜像使用帮助 + +正常情况下,Lineage会根据你的地址来定向请求到最近的镜像站,因此通常情况下不需要手动选择镜像站进行下载,直接前往官方的下载网站下载即可。 + +但是如果你是校内的同学,或者因为其他原因希望一定从tuna下载Lineage的rom,可以直接访问 选择设备代码及时间进行下载,或者在镜像站的主页右边或下方找到"获取下载链接",在 操作系统 -> LineageOS 下找到最新的 rom 进行下载。 + +zip文件的使用方式请参考lineage的官方文档或自行Google。 diff --git a/_posts/help/1970-01-01-lineageos.md b/_posts/help/1970-01-01-lineageos.md new file mode 100644 index 0000000..5465809 --- /dev/null +++ b/_posts/help/1970-01-01-lineageos.md @@ -0,0 +1,82 @@ +--- +layout: help +category: help +mirrorid: lineageOS +permalink: /help/lineageOS/ +--- + +## lineageOS 源代码镜像使用帮助 + +**注意: 本镜像是 lineageOS 源代码的镜像,如果是希望下载lineage的rom,请访问 。** + +### 过程摘录 + +下载 repo 工具: + +```bash +mkdir ~/bin +PATH=~/bin:$PATH +curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo +chmod a+x ~/bin/repo +``` + +或者使用tuna的[git-repo镜像](https://mirrors.tuna.tsinghua.edu.cn/help/git-repo/) + +建立工作目录: + +``` +mkdir WORKING_DIRECTORY +cd WORKING_DIRECTORY +``` + +初始化仓库: + +``` +repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/lineageOS/LineageOS/android.git -b cm-14.1 +``` + +(如果已经有从github同步的lineageOS源代码,可以从这里直接开始) + +打开`.repo/manifest.xml`,将 + +```xml + @@ -39,7 +38,7 @@ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 {% raw %} {%endraw%} @@ -58,7 +57,7 @@ sudo apt-get install -y mongodb-org ``` [mongodb-org] name=MongoDB Repository -baseurl=http://mirrors.tuna.tsinghua.edu.cn/mongodb/yum/$releasever/ +baseurl=https://mirrors.tuna.tsinghua.edu.cn/mongodb/yum/el$releasever/ gpgcheck=0 enabled=1 ``` diff --git a/_posts/help/1970-01-01-msys2.md b/_posts/help/1970-01-01-msys2.md new file mode 100644 index 0000000..c101af1 --- /dev/null +++ b/_posts/help/1970-01-01-msys2.md @@ -0,0 +1,45 @@ +--- +category: help +layout: help +mirrorid: msys2 +--- + +MSYS2 镜像使用帮助 +================== + +收录架构 +-------- + +* MINGW: i686, x86_64 +* MSYS: i686, x86_64 + +安装 +-------------- + +请访问该镜像目录下的 `distrib/` 目录([x86_64](https://mirrors.tuna.tsinghua.edu.cn/msys2/distrib/x86_64) 、[i686](https://mirrors.tuna.tsinghua.edu.cn/msys2/distrib/i686/)),找到名为 `msys2-<架构>-<日期>.exe` 的文件(如 `msys2-x86_64-20141113.exe`),下载安装即可。 + +pacman 的配置 +------------- + +编辑 `/etc/pacman.d/mirrorlist.mingw32` ,在文件开头添加: + +```bash +Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/i686 +``` + +编辑 `/etc/pacman.d/mirrorlist.mingw64` ,在文件开头添加: + +```bash +Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/x86_64 +``` + +编辑 `/etc/pacman.d/mirrorlist.msys` ,在文件开头添加: + +```bash +Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/$arch +``` + +然后执行 `pacman -Sy` 刷新软件包数据即可。 + + +注: 本Help参考自[USTC镜像](https://lug.ustc.edu.cn/wiki/mirrors/help/msys2) diff --git a/_posts/help/1970-01-01-nodesource.md b/_posts/help/1970-01-01-nodesource.md index 53573ea..8c383c8 100644 --- a/_posts/help/1970-01-01-nodesource.md +++ b/_posts/help/1970-01-01-nodesource.md @@ -19,4 +19,4 @@ curl -sL https://deb.nodesource.com/setup | sudo bash - 编辑 `/etc/apt/sources.list.d/nodesource.list`,把 `https://deb.nodesource.com/node/` 替换为 -`http://mirrors.tuna.tsinghua.edu.cn/nodesource/deb/` 即可。 +`https://mirrors.tuna.tsinghua.edu.cn/nodesource/deb/` 即可。 diff --git a/_posts/help/1970-01-01-npm.md b/_posts/help/1970-01-01-npm.md deleted file mode 100644 index 157461f..0000000 --- a/_posts/help/1970-01-01-npm.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -category: help -layout: help -mirrorid: npm ---- - -NPM 镜像使用帮助 -==================== - -注: TUNA 使用 [sinopia](https://github.com/rlidwka/sinopia/) 提供 npm 访问加速。 - -临时使用 --------- - -``` -npm install --registry https://npm.tuna.tsinghua.edu.cn/ -``` - -默认使用 -------- - -``` -npm set registry https://npm.tuna.tsinghua.edu.cn/ -``` - -或编辑 `~/.npmrc` 添加 - -``` -registry=https://npm.tuna.tsinghua.edu.cn -``` diff --git a/_posts/help/1970-01-01-pybombs.md b/_posts/help/1970-01-01-pybombs.md new file mode 100644 index 0000000..4c09c8e --- /dev/null +++ b/_posts/help/1970-01-01-pybombs.md @@ -0,0 +1,48 @@ +--- +category: help +layout: help +mirrorid: pybombs +--- + +PyBOMBS 镜像使用帮助 +=================== + + +[PyBOMBS](http://gnuradio.org/redmine/projects/pybombs/wiki) (Python Build Overlay Managed Bundle System) 是 [GNU Radio](http://gnuradio.org/) 的包管理系统。 + +从头开始一键安装GNU Radio在Thinkpad X230上实测大约只需要40分钟,下载非常快,主要的时间就剩编译了。 而且安装的都是最新的版本。 + +另外,PyBOMBS会帮你解决依赖的问题,省得每次敲一堆make cmake命令了。 + +以前自己拖代码回来经常会被重置,而且耗时要几个小时。 + + +**使用示例** + +```bash +sudo pip install pybombs +rm -rf ~/.pybombs +pybombs recipes add gr-recipes git+https://mirrors.tuna.tsinghua.edu.cn/pybombs/recipes/gr-recipes.git +pybombs recipes add gr-etcetera git+https://mirrors.tuna.tsinghua.edu.cn/pybombs/recipes/gr-etcetera.git +mkdir gnuradio-prefix +cd gnuradio-prefix +pybombs prefix init +pybombs install gnuradio +. ./setup_env.sh +gnuradio-companion + +pybombs install rtl-sdr hackrf bladeRF gr-osmosdr gr-bluetooth gr-ieee-80211 +``` + +**更新** + +由于 PyBOMBS 的 recipes 只能通过 git 仓库进行发布。而我们暂时不想维护一个复杂的 git 分支合并历史。所以更新时,需要将 recipe 仓库删除,然后再重新添加回来。(见[讨论](http://lists.gnu.org/archive/html/discuss-gnuradio/2016-06/msg00170.html)) + +```bash +pybombs recipes remove gr-recipes +pybombs recipes remove gr-etcetera +pybombs recipes add gr-recipes git+https://mirrors.tuna.tsinghua.edu.cn/pybombs/recipes/gr-recipes.git +pybombs recipes add gr-etcetera git+https://mirrors.tuna.tsinghua.edu.cn/pybombs/recipes/gr-etcetera.git +``` + + - 本镜像使用 脚本进行构建。 diff --git a/_posts/help/1970-01-01-pypi.md b/_posts/help/1970-01-01-pypi.md index f538c9f..007fe14 100644 --- a/_posts/help/1970-01-01-pypi.md +++ b/_posts/help/1970-01-01-pypi.md @@ -18,10 +18,12 @@ pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package ### 设为默认 -修改 `~/.pip/pip.conf` (没有就创建一个), 修改 +修改 `~/.config/pip/pip.conf` (Linux), `%APPDATA%\pip\pip.ini` (Windows 10) 或 `$HOME/Library/Application Support/pip/pip.conf` (macOS) (没有就创建一个), 修改 `index-url`至tuna,例如 ``` [global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple ``` + +pip 和 pip3 并存时,只需修改 `~/.pip/pip.conf`。 diff --git a/_posts/help/1970-01-01-repo-ck.md b/_posts/help/1970-01-01-repo-ck.md index 3ac6fb2..7d97d0f 100644 --- a/_posts/help/1970-01-01-repo-ck.md +++ b/_posts/help/1970-01-01-repo-ck.md @@ -18,7 +18,7 @@ mirrorid: repo-ck ``` [repo-ck] -Server = http://mirrors.tuna.tsinghua.edu.cn/repo-ck/$arch +Server = https://mirrors.tuna.tsinghua.edu.cn/repo-ck/$arch ``` 再增加 GPG 信任: diff --git a/_posts/help/1970-01-01-rpmfusion.md b/_posts/help/1970-01-01-rpmfusion.md index ef80766..eb7b187 100644 --- a/_posts/help/1970-01-01-rpmfusion.md +++ b/_posts/help/1970-01-01-rpmfusion.md @@ -17,19 +17,19 @@ sudo yum install --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusi 或者如下直接用 TUNA 镜像中的 rpm 包: ``` -sudo yum install --nogpgcheck http://mirrors.tuna.tsinghua.edu.cn/rpmfusion/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://mirrors.tuna.tsinghua.edu.cn/rpmfusion/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm +sudo yum install --nogpgcheck https://mirrors.tuna.tsinghua.edu.cn/rpmfusion/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.tuna.tsinghua.edu.cn/rpmfusion/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm ``` 注意:没有将当前用户设为管理员的用户,需要将 `sudo CMD` 替换为 `su -c 'CMD'`,并输入 root 密码。 ### 修改链接指向 TUNA 镜像 -安装成功后,修改 `/etc/yum.repos.d/` 目录下以 `rpmfusion` 开头,以 `.repo` 结尾的文件。具体而言,需要将文件中的 `baseurl=` 开头的行等号后面链接中的 `http://download1.rpmfusion.org/` 替换为 `http://mirrors.tuna.tsinghua.edu.cn/rpmfusion/`,替换后的文件类似如下: +安装成功后,修改 `/etc/yum.repos.d/` 目录下以 `rpmfusion` 开头,以 `.repo` 结尾的文件。具体而言,需要将文件中的 `baseurl=` 开头的行等号后面链接中的 `http://download1.rpmfusion.org/` 替换为 `https://mirrors.tuna.tsinghua.edu.cn/rpmfusion/`,替换后的文件类似如下: ``` [rpmfusion-free] name=RPM Fusion for Fedora $releasever - Free -baseurl=http://mirrors.tuna.tsinghua.edu.cn/rpmfusion/free/fedora/releases/$releasever/Everything/$basearch/os/ +baseurl=https://mirrors.tuna.tsinghua.edu.cn/rpmfusion/free/fedora/releases/$releasever/Everything/$basearch/os/ mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-$releasever&arch=$basearch enabled=1 metadata_expire=7d @@ -46,7 +46,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-$releasever-$ba [rpmfusion-free-source] name=RPM Fusion for Fedora $releasever - Free - Source -baseurl=http://mirrors.tuna.tsinghua.edu.cn/rpmfusion/free/fedora/releases/$releasever/Everything/source/SRPMS/ +baseurl=https://mirrors.tuna.tsinghua.edu.cn/rpmfusion/free/fedora/releases/$releasever/Everything/source/SRPMS/ mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-source-$releasever&arch=$basearch enabled=0 metadata_expire=7d diff --git a/_posts/help/1970-01-01-stackage.md b/_posts/help/1970-01-01-stackage.md new file mode 100644 index 0000000..98586d4 --- /dev/null +++ b/_posts/help/1970-01-01-stackage.md @@ -0,0 +1,19 @@ +--- +category: help +layout: help +mirrorid: stackage +--- + +## stackage 镜像使用帮助 + +修改`~/.stack/config.yaml`(在 Windows 下是 `%APPDATA%\stack\config.yaml`), 加上: + +```yaml +setup-info: "http://mirrors.tuna.tsinghua.edu.cn/stackage/stack-setup.yaml" +urls: + latest-snapshot: http://mirrors.tuna.tsinghua.edu.cn/stackage/snapshots.json + lts-build-plans: http://mirrors.tuna.tsinghua.edu.cn/stackage/lts-haskell/ + nightly-build-plans: http://mirrors.tuna.tsinghua.edu.cn/stackage/stackage-nightly/ +``` + +推荐与 TUNA 的 [Hackage 镜像](https://mirrors.tuna.tsinghua.edu.cn/help/hackage/)配合使用。 diff --git a/_posts/help/1970-01-01-tensorflow.md b/_posts/help/1970-01-01-tensorflow.md new file mode 100644 index 0000000..39bce7d --- /dev/null +++ b/_posts/help/1970-01-01-tensorflow.md @@ -0,0 +1,108 @@ +--- +category: help +layout: help +mirrorid: tensorflow +--- + +# TensorFlow 镜像使用帮助 + +请先安装 python 环境,科学计算用途建议安装 [anaconda](/help/anaconda/)。 +TensorFlow 安装方法请参考 ,把 `https://storage.googleapis.com/` 替换为 `https://mirrors.tuna.tsinghua.edu.cn/` +即可。 + +或直接运行下列命令,一步完成整个安装过程。 + + +{% raw %} +
+
+
+ + + + + + + + + + + + +
+
+

+
+pip install \
+  -i https://pypi.tuna.tsinghua.edu.cn/simple/ \
+  https://mirrors.tuna.tsinghua.edu.cn/tensorflow/{{form.os}}/{{form.xpu}}/{{tensorflow}}
+
+
+ + +{% endraw %} diff --git a/_posts/help/1970-01-01-termux.md b/_posts/help/1970-01-01-termux.md index 6123123..48f7b11 100644 --- a/_posts/help/1970-01-01-termux.md +++ b/_posts/help/1970-01-01-termux.md @@ -12,7 +12,7 @@ Termux 是什么 > Termux is a terminal emulator and Linux environment bringing powerful terminal access to Android. -Termux 是运行了 Android 上的 terminal。不需要root,运行于内部存储(不在SD卡上)。 +Termux 是运行在 Android 上的 terminal。不需要root,运行于内部存储(不在SD卡上)。 自带了一个包管理器,可以安装许多现代化的开发和系统维护工具。比如: @@ -51,7 +51,7 @@ apt edit-sources ``` # The termux repository mirror from TUNA: -deb [arch=all, arm] http://mirrors.tuna.tsinghua.edu.cn/termux stable main +deb [arch=all,arm] http://mirrors.tuna.tsinghua.edu.cn/termux stable main ``` **如果你的android不是arm的CPU,上面的[]里的内容会有所区别,参照原来的配置修改一下** @@ -65,4 +65,4 @@ deb [arch=all, arm] http://mirrors.tuna.tsinghua.edu.cn/termux stable main apt install apt-transport-https ``` -之后类似上面的方式配置,把url改成`https://mirrors.tuna.tsinghua.edu.cn/termux`。 +之后类似上面的配置,但是把url改成`https://mirrors.tuna.tsinghua.edu.cn/termux`。 diff --git a/_posts/help/1970-01-01-ubuntu.md b/_posts/help/1970-01-01-ubuntu.md index 72f6eba..94d29c8 100644 --- a/_posts/help/1970-01-01-ubuntu.md +++ b/_posts/help/1970-01-01-ubuntu.md @@ -16,28 +16,32 @@ TUNA 的软件源镜像。
{% raw %} {% endraw %} diff --git a/_posts/help/1970-01-01-weave.md b/_posts/help/1970-01-01-weave.md new file mode 100644 index 0000000..d3f6b63 --- /dev/null +++ b/_posts/help/1970-01-01-weave.md @@ -0,0 +1,84 @@ +--- +layout: help +category: help +mirrorid: weave +permalink: /help/weave/ +--- + +## Weave 镜像使用帮助 + +> Weave is a communications platform that includes the Weave Device SDK and the Weave Server to enable OEM manufactures to connect their devices to Google cloud services. + +简单说 Weave 是 Google 开发的物联网通讯平台。TUNA 同步该镜像代码的主要意义在于用于 [chromiumos](/help/chromiumos)的同步,继续看之前请确认你真的需要使用 [weave](https://developers.google.com/weave/) 的源代码。 + +#### 准备工作 + +下载 repo 工具: + +```bash +mkdir ~/bin +PATH=~/bin:$PATH +curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo +chmod a+x ~/bin/repo +``` + +或者使用tuna的[git-repo镜像](https://mirrors.tuna.tsinghua.edu.cn/help/git-repo/) + +#### 下载代码 + +建立工作目录: + +``` +mkdir WORKING_DIRECTORY +cd WORKING_DIRECTORY +``` + +初始化仓库: + +``` +repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/weave/weave/manifest +``` + +**注意: 本镜像是 Weave 的 master 分支的镜像,如果使用本镜像下载 Weave 的其他版本很大概率会失败** + +**如果提示无法连接到 gerrit.googlesource.com,请参照[git-repo的帮助页面](/help/git-repo)的更新一节。** + +接着使用编辑器打开`.repo/manifests/default.xml`这个文件,将 + +``` +"https://android.googlesource.come" +``` + +替换为 + +``` +"https://aosp.tuna.tsinghua.edu.cn/" +``` + +将 + +``` +"https://weave.googlesource.come" +``` + +替换为 + +``` +"https://mirrors.tuna.tsinghua.edu.cn/git/weave/" +``` + +并删除如下几行(这几行是非公开的repo,因此tuna并没有镜像): + +``` + + + +``` + +即可。 + +最后同步源码树(以后只需执行这条命令来同步): + +``` +repo sync +``` diff --git a/_posts/help/2016-06-19-virtualbox.md b/_posts/help/2016-06-19-virtualbox.md new file mode 100644 index 0000000..27fb3a7 --- /dev/null +++ b/_posts/help/2016-06-19-virtualbox.md @@ -0,0 +1,107 @@ +--- +category: help +layout: help +mirrorid: virtualbox +--- + +# VirtualBox 镜像使用帮助 + +[Oracle Virtualbox](https://www.virtualbox.org/) VirtualBox 是一款开源虚拟机软件。由德国 Innotek 公司开发,Sun Microsystems 公司出品。使用Qt编写,在 Sun 被 Oracle 收购后正式更名成 Oracle VM VirtualBox。采用 GPL 协议开源。 + +## Microsoft Windows + +[点击下载 Windows 最新版](https://mirrors.tuna.tsinghua.edu.cn/virtualbox/virtualbox-Win-latest.exe) + + +## Macintosh OS X + +[点击下载 OS X 最新版](https://mirrors.tuna.tsinghua.edu.cn/virtualbox/virtualbox-osx-latest.dmg) + +# Linux + +## 通过编译好的二进制包安装 + +访问该镜像下最新的目录(例如`5.0.24`),找到名为<发行版名称>~<发行代号>~<架构> 的文件。 +如 `virtualbox-5.0_5.0.24-108355~Ubuntu~xenial_i386.deb` 下载安装即可。 + +目前支持的系统有: + +* Ubuntu +* Debian +* Fedora +* openSUSE +* SUSE Linux Enterprise Server +* Oracle Linux / Red Hat Enterprise Linux / CentOS + +如果您所使用的发行版不在上述列表之内,请下载通用的`run`文件(例如`VirtualBox-5.0.24-108355-Linux_x86.run`),然后使用 `chmod +x` 给予执行权限后,直接安装即可。 + +### 通过包管理器安装 + +#### Debian / Ubuntu 用户 + +首先信任 Virtualbox 的 GPG 公钥: + +对于 Debian 8 和 Ubuntu 16.04 及以上: + +```shell +wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - +``` + +其他版本 + +```shell +wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - +``` + +再选择你的 Debian/Ubuntu 版本,将文本框中内容写进`/etc/apt/sources.list.d/virtualbox.list` + +
+
+ + +
+
+ +

+
+
+
+
+ +{% raw %} + +{% endraw %} + +安装 VirtualBox: + +``` +sudo apt-get update +sudo apt-get install virtualbox-5.0 +``` + +### RHEL/CentOS 用户 + + +新建 `/etc/yum.repos.d/virtualbox.repo`,内容为 + +``` +[virtualbox] +name=Virtualbox Repository +baseurl=https://mirrors.tuna.tsinghua.edu.cn/virtualbox/rpm/el$releasever/ +gpgcheck=0 +enabled=1 +``` + +刷新缓存并安装 `virtualbox` 即可。 + +``` +sudo yum makecache +sudo yum install VirtualBox-5.1 +``` diff --git a/_posts/help/2016-06-21-repoforge.md b/_posts/help/2016-06-21-repoforge.md new file mode 100644 index 0000000..1eb3b59 --- /dev/null +++ b/_posts/help/2016-06-21-repoforge.md @@ -0,0 +1,77 @@ +--- +category: help +layout: help +mirrorid: repoforge +--- + +# Repoforge (原Rpmforge) 镜像使用帮助 + +[Repoforge](http://repoforge.org/) 是 RHEL 系统下的软件仓库,拥有 10000 多个软件包,被认为是最安全、最稳定的一个软件仓库。 + +## 添加 Repoforge 仓库 + +1. 运行 `cat /etc/redhat-release` 获取 EL 版本号(如 EL6, EL7 等) +2. 向系统中添加 Repoforge 的 GPG 公钥: +``` +rpm --import https://mirrors.tuna.tsinghua.edu.cn/repoforge/RPM-GPG-KEY.dag.txt +``` +3. 运行下列命令: + +
+
+ + +
+
+ +{% raw %} + +{% endraw %} + +

+ +
+
+
+
+ +## 更新软件包缓存 + +``` +sudo yum makecache +``` diff --git a/_posts/help/2016-08-18-rubygems.md b/_posts/help/2016-08-18-rubygems.md new file mode 100644 index 0000000..c2887a8 --- /dev/null +++ b/_posts/help/2016-08-18-rubygems.md @@ -0,0 +1,19 @@ +--- +category: help +layout: help +mirrorid: rubygems +--- + +# Ruby Gems 镜像使用帮助 + +使用以下命令替换 gems 默认源 + +```bash +# 添加 TUNA 源并移除默认源 +gem sources --add https://mirrors.tuna.tsinghua.edu.cn/rubygems/ --remove https://rubygems.org/ +# 列出已有源 +gem sources -l +# 应该只有 TUNA 一个 +``` + +或者,编辑 `~/.gemrc`,将 `https://mirrors.tuna.tsinghua.edu.cn/rubygems/` 加到 `sources` 字段。 diff --git a/_posts/help/2017-01-12-bioconductor.md b/_posts/help/2017-01-12-bioconductor.md new file mode 100644 index 0000000..5c39117 --- /dev/null +++ b/_posts/help/2017-01-12-bioconductor.md @@ -0,0 +1,19 @@ +--- +category: help +layout: help +mirrorid: bioconductor +--- + +[Bioconductor](https://www.bioconductor.org) 镜像使用帮助 +=================== + +Bioconductor 镜像源配置文件之一是 `.Rprofile` (linux 下位于 `~/.Rprofile` )。 + + +在文末添加如下语句: + +``` +options(BioC_mirror="https://mirrors.tuna.tsinghua.edu.cn/bioconductor") +``` + +打开R即可使用该 Bioconductor 镜像源安装 Bioconductor 软件包。 diff --git a/_posts/help/2017-01-17-CRAN.md b/_posts/help/2017-01-17-CRAN.md new file mode 100644 index 0000000..d75284e --- /dev/null +++ b/_posts/help/2017-01-17-CRAN.md @@ -0,0 +1,19 @@ +--- +category: help +layout: help +mirrorid: CRAN +--- + +[CRAN](https://cran.r-project.org/) 镜像使用帮助 +=================== + +CRAN (The Comprehensive R Archive Network) 镜像源配置文件之一是 `.Rprofile` (linux 下位于 `~/.Rprofile` )。 + + +在文末添加如下语句: + +``` +options("repos" = c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN/")) +``` + +打开R即可使用该 CRAN镜像源安装 R 软件包。 diff --git a/_posts/help/2017-05-28-llvm.md b/_posts/help/2017-05-28-llvm.md new file mode 100644 index 0000000..a58a4c3 --- /dev/null +++ b/_posts/help/2017-05-28-llvm.md @@ -0,0 +1,36 @@ +--- +category: help +layout: help +mirrorid: llvm +--- + +## LLVM Git Repos 镜像使用帮助 + +本镜像镜像了官方的以下仓库: + +``` +http://llvm.org/git/{llvm,clang,libcxx,lldb,clang-tools-extra,polly,zorg,compiler-rt,libcxxabi,lld,lnt} +``` +若需要其他的仓库,可从 [LLVM 官方](http://llvm.org) 或者 [GitHub 镜像](https://github.com/llvm-mirror) 获取。 +使用方法: + +``` +git clone https://mirrors.tuna.tsinghua.edu.cn/git/llvm/{reponame}.git +``` + +其中`{reponame}`为上述的仓库名称之一。请注意:由于仓库体积均较大,执行`git clone`可能需要较长时间,并且没有进度提示,请耐心等候。 + +若要将 TUNA mirror 加入已有代码库,可在已有仓库中运行 + +``` +git remote add tuna https://mirrors.tuna.tsinghua.edu.cn/git/llvm/{reponame}.git +``` + +或运行 + +``` +git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/llvm/{reponame}.git +``` + +将默认上游设置为 TUNA 镜像 + diff --git a/_posts/news/2016-04-01-openwrt-trunk.md b/_posts/news/2016-04-01-openwrt-trunk.md new file mode 100644 index 0000000..8ff53d9 --- /dev/null +++ b/_posts/news/2016-04-01-openwrt-trunk.md @@ -0,0 +1,13 @@ +--- +category: news +layout: news +title: "暂停 OpenWRT Trunk 镜像" +author: Justin Wong +--- + +由于 OpenWRT Trunk 部分几乎每天都会完全重建,给镜像站带来较大流量压力,经调研后,发现用户很少直接使用未经测试的 Trunk 内容, +因此我们决定暂停 OpenWRT Trunk 镜像。 + +OpenWRT Release 镜像不受影响。 + +如有疑问,请到 https://github.com/tuna/issues 提交意见反馈。 diff --git a/_posts/news/2016-04-03-bananian.md b/_posts/news/2016-04-03-bananian.md new file mode 100644 index 0000000..ac4a3f2 --- /dev/null +++ b/_posts/news/2016-04-03-bananian.md @@ -0,0 +1,11 @@ +--- +category: news +layout: news +title: "新增 Bananian 镜像" +author: Justin Wong +--- + +[Bananian](https://www.bananian.org/) 是为 [Banana Pi](http://www.bananapi.org/) 制作的,基于官方 Debian 仓库的发行版, +其内核和 bootloader 为 Banana Pi 做了定制化。 + +使用方法请见[Bananian镜像帮助](/help/bananian/)。 diff --git a/_posts/news/2016-04-07-alpine-anaconda.md b/_posts/news/2016-04-07-alpine-anaconda.md new file mode 100644 index 0000000..9e59c13 --- /dev/null +++ b/_posts/news/2016-04-07-alpine-anaconda.md @@ -0,0 +1,11 @@ +--- +category: news +layout: news +title: "新增 Alpine, Anaconda 镜像" +author: Justin Wong +--- + +[Alpine Linux](http://www.alpinelinux.org/) 是一个轻量级 Linux 发行版,具有安全性高、系统体积小等特点,非常适合 docker 等容器使用。 + +[Anaconda](https://www.continuum.io/why-anaconda) 是一个面向科学计算的 Python 发行版,支持全平台,提供了大量的科学计算、数据分析包, +我们提供了 Anaconda 安装包和仓库镜像。使用方法请见[Anaconda镜像帮助](/help/anaconda/)。 diff --git a/_posts/news/2016-05-06-homebrew.md b/_posts/news/2016-05-06-homebrew.md new file mode 100644 index 0000000..08869b8 --- /dev/null +++ b/_posts/news/2016-05-06-homebrew.md @@ -0,0 +1,9 @@ +--- +category: news +layout: news +title: "Homebrew 镜像结构调整" +author: Justin Wong +--- + +由于 Homebrew 官方将原 homebrew 拆成了 brew.git 和 homebrew-core.git 两个仓库,我们随官方也做出了结构调整。 +配置方法请见[Homebrew镜像使用帮助](/help/homebrew/)。 diff --git a/_posts/news/2016-05-07-homebrew-bottles.md b/_posts/news/2016-05-07-homebrew-bottles.md new file mode 100644 index 0000000..343244c --- /dev/null +++ b/_posts/news/2016-05-07-homebrew-bottles.md @@ -0,0 +1,12 @@ +--- +category: news +layout: news +title: "新增 Homebrew-bottles 镜像" +author: Xavier Yao +--- + +TUNA mirrors 新增 Homebrew-bottles 镜像。 + +[Homebrew](http://brew.sh) 是 OS X 操作系统最常用的包管理器之一。[Homebrew-bottles](http://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles) 镜像提供了供 Homebrew 使用的预编译二进制软件包。配置方法见 [Homebrew bottles 镜像使用帮助](https://mirrors.tuna.tsinghua.edu.cn/help/homebrew-bottles/)。 + +本镜像站同时提供 Homebrew 的 formula 索引的镜像(即 `brew update` 时所更新内容),配置方法请参考 [Homebrew 镜像使用帮助](https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/)。 diff --git a/_posts/news/2016-08-18-bunch-of-news.md b/_posts/news/2016-08-18-bunch-of-news.md new file mode 100644 index 0000000..384155e --- /dev/null +++ b/_posts/news/2016-08-18-bunch-of-news.md @@ -0,0 +1,19 @@ +--- +category: news +layout: news +title: "新增一系列镜像" +author: Justin Wong +--- + +新学期开始啦,暑假我们没闲着,新增了以下一大票镜像~ + +- VirtualBox: 著名开源虚拟机软件 [使用帮助](/help/virtualbox/) +- Dell 服务器管理工具 +- grafana: 数据可视化工具 +- jenkins: 持续集成工具 +- influxdata: 由 Telegraf, InfluxDB, Chronograf, Kapacitor 组成的 TICK 开源时间序列工具栈 +- mysql: 常用开源数据库 +- parrot: 基于 Debian 的安全操作系统 +- rubygems: Ruby 包仓库 + +祝大家新学期取得新成绩 diff --git a/_posts/news/2016-11-06-tensorflow-and-others.md b/_posts/news/2016-11-06-tensorflow-and-others.md new file mode 100644 index 0000000..e92f50b --- /dev/null +++ b/_posts/news/2016-11-06-tensorflow-and-others.md @@ -0,0 +1,18 @@ +--- +category: news +layout: news +title: "新增 Tensorflow 等一系列镜像" +author: Xavier Yao & Harry Chen +--- + +TUNA 镜像站新增一系列镜像。 + +- tensorflow: Google 开发的、采用数据流图(data flow graphs)、用于数值计算的开源软件库,被广泛应用于深度学习等领域。使用方法见 [TensorFlow 镜像使用帮助](/help/tensorflow/)。 +- arch4edu: 用于 ArchLinux 的一系列科研、教学所需工具 +- ros: 用于开发机器人的工具包 +- elvish: TUNA 前会长 [xiaq](https://github.com/xiaq) 开发的革命性 Shell ,详见 [这里](https://elvish.io/) +- HHVM: 由 Facebook 开发的高性能 PHP 虚拟机 +- steamos: 不解释,剁手专用 +- bjlx: [北京龙芯 & Debian 俱乐部](http://www.bjlx.org.cn/) 的公开源 +- loongson: 用于龙芯电脑的软件包 +- elasticstack: ELK 系列数据分析工具,5.x 之后改名为 elastic stack diff --git a/_posts/news/2016-11-17-rsync-restriction.md b/_posts/news/2016-11-17-rsync-restriction.md new file mode 100644 index 0000000..1d5f404 --- /dev/null +++ b/_posts/news/2016-11-17-rsync-restriction.md @@ -0,0 +1,8 @@ +--- +category: news +layout: news +title: "暂时对 rsync 服务磁盘 I/O 进行限制" +author: Yichuan Gao +--- + +受近期 [中科大开源软件镜像站故障](https://servers.ustclug.org/2016/11/mirrors-services-outage/) 的影响,TUNA Mirrors 流量大幅上升,目前已接近带宽极限,对磁盘阵列的 I/O 产生了较大压力。为了保证阵列正常工作,我们将优先保证 HTTP/HTTPS 服务质量,而在高峰期对 rsync 服务的磁盘 I/O 进行限制。届时以 TUNA 为上游进行 rsync 同步速度将会下降,敬请谅解。如果方便,请尽量选择凌晨错峰同步。恢复时间将会另行通知。 diff --git a/_posts/news/2016-11-30-rsync-unrestricted.md b/_posts/news/2016-11-30-rsync-unrestricted.md new file mode 100644 index 0000000..c67b8f3 --- /dev/null +++ b/_posts/news/2016-11-30-rsync-unrestricted.md @@ -0,0 +1,8 @@ +--- +category: news +layout: news +title: "不再对 rsync 服务磁盘 I/O 进行限制" +author: Xavier Yao +--- + +各服务恢复正常。 diff --git a/_posts/news/2016-12-03-hardware-maintenance.txt b/_posts/news/2016-12-03-hardware-maintenance.txt new file mode 100644 index 0000000..77a637a --- /dev/null +++ b/_posts/news/2016-12-03-hardware-maintenance.txt @@ -0,0 +1,8 @@ +--- +category: news +layout: news +title: "镜像站将于 12/4 10:30 进行停机维护" +author: Harry Chen +--- + +TUNA 镜像站将于北京时间2016年12月4日上午10时30分进行停机维护,届时将暂时停止镜像服务。预计 12:00 前可恢复正常服务。对于给您带来的不便,我们深表歉意。 \ No newline at end of file diff --git a/_posts/news/2016-12-27-chromiumos.md b/_posts/news/2016-12-27-chromiumos.md new file mode 100644 index 0000000..e53bfc0 --- /dev/null +++ b/_posts/news/2016-12-27-chromiumos.md @@ -0,0 +1,12 @@ +--- +category: news +layout: news +title: "新增 Chromium OS 镜像" +author: Yiqun Hui +--- + +TUNA 镜像站新增chromium OS源代码镜像。 + +由于各方面原因,该镜像暂时只镜像master分支,即只有出现在[这个文件](https://chromium.googlesource.com/chromiumos/manifest/+/master/full.xml)中的项目才会被同步。 + +使用方法见 [chromium OS 镜像使用帮助](/help/chromiumos/)。 diff --git a/_posts/news/2017-03-14-ipv6-failure.md b/_posts/news/2017-03-14-ipv6-failure.md new file mode 100644 index 0000000..fdd29fc --- /dev/null +++ b/_posts/news/2017-03-14-ipv6-failure.md @@ -0,0 +1,8 @@ +--- +category: news +layout: news +title: "镜像站 IPv6 国际链路故障" +author: Harry Chen +--- + +由于 CERNET 2 的 IPv6 国际链路出现故障,TUNA 镜像站的多个镜像同步均失败。在此期间,您可以暂时使用官方镜像列表中的其他镜像站。对于对您带来的不便,我们深表歉意。 diff --git a/_posts/news/2017-04-01-april-fools-day.md b/_posts/news/2017-04-01-april-fools-day.md new file mode 100644 index 0000000..0c1a066 --- /dev/null +++ b/_posts/news/2017-04-01-april-fools-day.md @@ -0,0 +1,20 @@ +--- +category: news +layout: news +title: "我们做出了一个艰难的决定" +author: TUNA 镜像站全体运维人员 +--- + +由于 TUNA 镜像站经营不善,团长带着女朋友跑了,整个组织濒临破产边缘。经第一届金枪鱼全体代表大会讨论研究决定,TUNA 名下的 Telegram 群组和镜像站将启用免费使用+付费增值模式。具体收费标准如下: + +{: .table} +| 项目 | 会员 | 黄金会员 | 钻石会员 | SVIP | 备注 | +| --- | --- | --- | --- | --- | --- | +| 收费标准 | 免费 | 15元/月 **¥179/年** | 30元/月 **¥359/年** | 50元/月 **¥599/年** | | +| Telegram 发言 | 5条/周 | 30条/周 | 90条/周 | **无限** | 超出部分 1元/条 | +| Telegram 发言置顶 | 无 | 1条/月 | 3条/月 | **10条/月** | 超出部分 10元/条 | +| 镜像源限速 | 100KB/s | 1MB/s | 5MB/s | **不限速** | 需使用专用包管理器`tuna-get`,`apt-get`等官方包管理器限速100KB/s | +| 包管理器去广告 | 无 | 5s后可跳过 | 可跳过 | **无广告** | | +| 其它特权 | 无 | 无 | **Telegram群红名** | **上线提醒** | | + +此标准发布即日起不执行。 diff --git a/_posts/news/2017-05-11-lineage-and-adobe-fonts.md b/_posts/news/2017-05-11-lineage-and-adobe-fonts.md new file mode 100644 index 0000000..f2e5435 --- /dev/null +++ b/_posts/news/2017-05-11-lineage-and-adobe-fonts.md @@ -0,0 +1,12 @@ +--- +category: news +layout: news +title: "新增 Lineage 与 Adobe 开源字体镜像" +author: Xavier Yao +--- + +TUNA 镜像站新增 LineageOS 源代码和 ROM 镜像,及 Adobe 各开源字体镜像。 + +LineageOS 是一个面向智能手机和平板电脑的自由、开源的 Android 分支。它是深受欢迎的定制 ROM CyanogenMod 的继任者,在 2016 年 12 月 Cyanogen 公司突然宣布停止开发并关闭项目基础设施后复刻而生。ROM 下载方式参见[Lineage ROM下载方式](/help/lineage-rom/),源码下载方式见[Lineage OS源码下载方式](/help/lineageOS/) + +Adobe 开源字体包括思源黑体、思源宋体、Source Code Pro等,TUNA镜像站提供各字体及其源代码的下载。 diff --git a/_posts/news/2017-05-28-llvm-repos.md b/_posts/news/2017-05-28-llvm-repos.md new file mode 100644 index 0000000..efd61c1 --- /dev/null +++ b/_posts/news/2017-05-28-llvm-repos.md @@ -0,0 +1,11 @@ +--- +category: news +layout: news +title: "新增 LLVM 编译器套件 Git 仓库镜像" +author: Harry Chen +--- + +TUNA 镜像站新增来自 LLVM 编译器套件的多个 Git 仓库镜像。 + +[LLVM](http://llvm.org) 是著名的开源编译器基础设施,由编译器后端(llvm)、编译器前端(clang)、调试器(lldb)、C++运行库(libcxx)等多个套件组成。 +为方便用户获取其源码,我们对官方的大部分仓库进行了镜像。详细说明以及使用方法请参见 [LLVM Git Repos 镜像使用帮助](/help/llvm/) diff --git a/gen_desc.py b/gen_desc.py new file mode 100755 index 0000000..e335d38 --- /dev/null +++ b/gen_desc.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 + +import json +import urllib.request +from collections import OrderedDict + +tunasync = json.loads( + urllib.request + .urlopen("https://mirrors.tuna.tsinghua.edu.cn/static/tunasync.json") + .read() + .decode('utf-8') +) + +mirrors = list({t['name'] for t in tunasync}) +mirrors.sort() + +with open('_data/mirror_desc.json') as f: + descriptions = json.load(f) + +descriptions = { + x['name']: x['desc'] for x in descriptions +} +for m in mirrors: + if m not in descriptions: + descriptions[m] = "" + +descriptions = sorted( + [ + OrderedDict([('name', name), ('desc', desc)]) + for name, desc in descriptions.items() + ], + key=lambda x: x['name'] +) + +content = ( + json + .dumps(descriptions, indent=2) + .encode('utf-8') + .decode('unicode-escape') + .encode('utf-8') +) + +with open('_data/mirror_desc.json', 'wb') as f: + f.write(content) + +# vim: ts=4 sw=4 sts=4 expandtab diff --git a/gen_robot.sh b/gen_robot.sh index e765c4e..8beafa8 100755 --- a/gen_robot.sh +++ b/gen_robot.sh @@ -4,6 +4,7 @@ echo '# robots.txt for https://mirrors.tuna.tsinghua.edu.cn' > robots.txt echo 'User-agent: *' >> robots.txt echo '' >> robots.txt -curl -s https://mirrors.tuna.tsinghua.edu.cn/static/tunasync.json | jq -r '.[] | .name' | while read name; do +curl -s https://mirrors.tuna.tsinghua.edu.cn/static/tunasync.json | jq -r '.[] | .name' | uniq | while read name; do + [[ -z ${name} ]] && continue echo "Disallow: /${name}" >> robots.txt done diff --git a/geninfo/genisolist.ini b/geninfo/genisolist.ini new file mode 100644 index 0000000..4c9149a --- /dev/null +++ b/geninfo/genisolist.ini @@ -0,0 +1,320 @@ +# This file is the config required by genisolist.py + +# This special section named "%main%" defined following variables: +# "root": HTTP root of mirrors. The script will locate the images in it. +# "urlbase": URL of mirrors prepended to image path. We want to use relative +# path, so set it to '/' instead of complete URL. +# "d[N]": For distribution sorting. where N is an positive integer. The value +# is disto name specified in below sections. Lower N makes the distro +# show higher. Default N is 0xFFFF for distro not mentioned. +[%main%] +root = /data/ +urlbase = / +d10 = Arch Linux +d20 = Debian +d25 = CentOS +d30 = Fedora +d40 = Ubuntu +d50 = Ubuntu 衍生版 +d60 = Deepin + +# Sections whose name isn't "%main%" defined a detect rule of image detection. +[archlinux] +# Section name is of no use, the display name is specified in "distro" option. +distro = Arch Linux +# listvers defined how many latest versions to display. +listvers = 1 +# "location" specifies globbing pathname of the image. The path is relative to +# the HTTP root (aka "root" in [%main%] section). Not all images match it is +# considered, you can use "pattern" option below to filter. +location = archlinux/iso/latest/archlinux-*.iso +# "pattern" is a regular expression. If the pattern is found in image path +# found by "location", then the image is valid. Group capturing is to extract +# image info from image path name. +pattern = archlinux-(\d+\.\d+\.\d+)-(\w+).iso +# Following 3 options describes image info. "type" and "platform" is optional. +# $1, $2... here will be replaced by the string captured in above "pattern". +# Additionally, $0 will be replaced by the whole string matches the pattern. +# "version" is also used as the key to sort images of the same distro. +version = $1 +type = CLI-only +platform = $2 +# "key_by" should be used when images of different types or platform have +# different version number, see lineageOS below. + +[ubuntu desktop] +distro = Ubuntu +listvers = 4 +# If one glob is not enough for locating all images, you can use "location_N" +# to specify more globs. N start from 0 and must a sequence (0,1,2...). +location_0 = ubuntu-releases/[a-z]*/ubuntu-*-desktop-i386.iso +location_1 = ubuntu-releases/[a-z]*/ubuntu-*-desktop-amd64.iso +pattern = ubuntu-([0-9.]+)-desktop-(\w+).iso +version = $1 +type = Desktop LiveDVD +platform = $2 + +[ubuntu server] +distro = Ubuntu +listvers = 4 +# If one glob is not enough for locating all images, you can use "location_N" +# to specify more globs. N start from 0 and must a sequence (0,1,2...). +location_0 = ubuntu-releases/[a-z]*/ubuntu-*-server-i386.iso +location_1 = ubuntu-releases/[a-z]*/ubuntu-*-server-amd64.iso +pattern = ubuntu-([0-9.]+)-server-(\w+).iso +version = $1 +type = Server +platform = $2 + +# You can apply multiple rules (sections) for the same distro like following +# four sections. They will be shown in the same submenu on our web page. +[ubuntukylin] +distro = Ubuntu 衍生版 +listvers = 1 +location_0 = ubuntu-cdimage/ubuntukylin/releases/[a-z]*/release/ubuntukylin-*-desktop-i386.iso +location_1 = ubuntu-cdimage/ubuntukylin/releases/[a-z]*/release/ubuntukylin-*-desktop-amd64.iso +pattern = ubuntukylin-([0-9.]+)-desktop-(\w+).iso +# Just a small trick. Constant string prefix won't affect sorting. +version = Ubuntu Kylin $1 +platform = $2 + +[kubuntu] +distro = Ubuntu 衍生版 +listvers = 1 +location_0 = ubuntu-cdimage/kubuntu/releases/[a-z]*/release/kubuntu-*-desktop-i386.iso +location_1 = ubuntu-cdimage/kubuntu/releases/[a-z]*/release/kubuntu-*-desktop-amd64.iso +pattern = kubuntu-([0-9.]+)-desktop-(\w+).iso +version = Kubuntu $1 +platform = $2 + + +[lubuntu] +distro = Ubuntu 衍生版 +listvers = 1 +location_0 = ubuntu-cdimage/lubuntu/releases/[a-z]*/release/lubuntu-*-desktop-i386.iso +location_1 = ubuntu-cdimage/lubuntu/releases/[a-z]*/release/lubuntu-*-desktop-amd64.iso +pattern = lubuntu-([0-9.]+)-desktop-(\w+).iso +version = Lubuntu $1 +platform = $2 + +[xubuntu] +distro = Ubuntu 衍生版 +listvers = 1 +location_0 = ubuntu-cdimage/xubuntu/releases/[a-z]*/release/xubuntu-*-desktop-i386.iso +location_1 = ubuntu-cdimage/xubuntu/releases/[a-z]*/release/xubuntu-*-desktop-amd64.iso +pattern = xubuntu-([0-9.]+)-desktop-(\w+).iso +version = Xubuntu $1 +platform = $2 + +[ubuntu_gnome] +distro = Ubuntu 衍生版 +listvers = 1 +location_0 = ubuntu-cdimage/ubuntu-gnome/releases/[a-z]*/release/ubuntu-gnome-*-desktop-i386.iso +location_1 = ubuntu-cdimage/ubuntu-gnome/releases/[a-z]*/release/ubuntu-gnome-*-desktop-amd64.iso +pattern = ubuntu-gnome-([0-9.]+)-desktop-(\w+).iso +version = Ubuntu Gnome $1 +platform = $2 + +[ubuntu_mate] +distro = Ubuntu 衍生版 +listvers = 1 +location_0 = ubuntu-cdimage/ubuntu-mate/releases/[a-z]*/release/ubuntu-mate-*-desktop-i386.iso +location_1 = ubuntu-cdimage/ubuntu-mate/releases/[a-z]*/release/ubuntu-mate-*-desktop-amd64.iso +pattern = ubuntu-mate-([0-9.]+)-desktop-(\w+).iso +version = Ubuntu Mate $1 +platform = $2 + +[debian_cd] +distro = Debian +listvers = 1 +location_0 = debian-cd/current/amd64/iso-cd/debian-*-amd64-*-CD-1.iso +location_1 = debian-cd/current/i386/iso-cd/debian-*-i386-*-CD-1.iso +pattern = debian-([0-9.]+)-(\w+)-(\w+)-CD-1.iso +version = $1 +type = CD installer with $3 +platform = $2 + +[debian_dvd] +distro = Debian +listvers = 1 +location_0 = debian-cd/current/amd64/iso-dvd/debian-*-amd64-DVD-*.iso +location_1 = debian-cd/current/i386/iso-dvd/debian-*-i386-DVD-*.iso +pattern = debian-([0-9.]+)-(\w+)-DVD-(\d).iso +version = $1 +type = DVD installer (Part $3) +platform = $2 + +[debian_live] +distro = Debian +listvers = 1 +location_0 = debian-cd/current-live/amd64/iso-hybrid/debian-live-*-amd64-*.iso +location_1 = debian-cd/current-live/i386/iso-hybrid/debian-live-*-i386-*.iso +pattern = debian-live-([0-9.]+)-(\w+)-(\w+).iso +version = $1 +type = Live CD with $3 +platform = $2 + +[centos] +distro = CentOS +listvers = 2 +location = centos/[0-9].*/isos/*/CentOS-[0-9]*.iso +pattern = CentOS-([0-9.]+)-(\w+)-((bin-)?\w+?)(-[0-9]+|).iso +version = $1 +type = $3 +platform = $2 + +[fedora] +distro = Fedora +listvers = 2 +location_0 = fedora/releases/[1-9][0-9]/Workstation/*/iso/Fedora-Workstation-Live-*-[1-9][0-9]-*.iso +location_1 = fedora/releases/[1-9][0-9]/Spins/*/iso/Fedora-KDE-Live-*-[1-9][0-9]-*.iso +location_2 = fedora/releases/[1-9][0-9]/Spins/*/iso/Fedora-Xfce-Live-*-[1-9][0-9]-*.iso +pattern = Fedora-(Workstation|KDE|Xfce)-Live-(\w+)-(\d+)-.*\.iso +version = $3 +type = $1 +platform = $2 + +[opensuse_leap] +distro = openSUSE +listvers = 3 +location_0 = opensuse/distribution/leap/[0-9][0-9].[0-9]/iso/openSUSE-Leap-[0-9][0-9].[0-9]-DVD-*.iso +pattern = openSUSE-Leap-([0-9.]+)-DVD-(\w+).iso +version = $1 +platform = $2 + +[opensuse tumbleweed] +distro = openSUSE +listvers = 1 +location_0 = opensuse/tumbleweed/iso/openSUSE-Tumbleweed-DVD-*-Current.iso +location_1 = opensuse/tumbleweed/iso/openSUSE-Tumbleweed-GNOME-Live-*-Current.iso +location_2 = opensuse/tumbleweed/iso/openSUSE-Tumbleweed-KDE-Live-*-Current.iso +pattern = openSUSE-Tumbleweed-(DVD|GNOME-Live|KDE-Live)-(\w+)-Current.iso +version = Tumbleweed +type = $1 +platform = $2 + +[opensuse] +distro = openSUSE +listvers = 1 +location_0 = opensuse/distribution/[0-9][0-9].[0-9]/iso/openSUSE-[0-9][0-9].[0-9]-DVD-*.iso +location_1 = opensuse/distribution/[0-9][0-9].[0-9]/iso/openSUSE-[0-9][0-9].[0-9]-GNOME-Live-*.iso +location_2 = opensuse/distribution/[0-9][0-9].[0-9]/iso/openSUSE-[0-9][0-9].[0-9]-KDE-Live-*.iso +pattern = openSUSE-([0-9.]+)-(DVD|GNOME-Live|KDE-Live)-(\w+).iso +version = $1 +type = $2 +platform = $3 + + +[deepin] +distro = Deepin +listvers = 1 +location = deepin-cd/1*/*.iso +pattern = deepin-([0-9.]+)-(\w+).iso +version = $1 +platform = $2 + +[qt5] +distro = Qt 5 +listvers = 1 +location = qt/official_releases/qt/5.*/5.*/qt-opensource-* +pattern = qt-opensource-(.*?)-([\d.]+).(run|dmg|exe) +platform = $1 +version = $2 +category = app + +[msys2] +distro = MSYS2 +listvers = 1 +location = msys2/distrib/msys2-*.exe +pattern = msys2-(i686|x86_64)-(latest).exe +platform = Windows +type = $1 +version = $2 +category = app + +[virtualbox] +distro = VirtualBox +listvers = 1 +location = virtualbox/virtualbox-* +pattern = virtualbox-(.*?)-(latest).(exe|dmg) +platform = $1 +version = $2 +category = app + +[texlive] +distro = TeX 排版系统 +listvers = 1 +location = CTAN/systems/texlive/Images/texlive*.iso +pattern = texlive(\d+)-\d+.iso +platform = Windows & Linux +version = TeX Live $1 +category = app + +[mactex] +distro = TeX 排版系统 +listvers = 1 +location = CTAN/systems/mac/mactex/mactex-*.pkg +pattern = mactex-(\d+).pkg +platform = macOS +version = MacTeX $1 +category = app + +[miktex] +distro = TeX 排版系统 +listvers = 1 +location = CTAN/systems/win32/miktex/setup/basic-miktex-* +pattern = basic-miktex-((\d+.)+\d+)(|-)*(x64)*.exe +platform = Windows +type = $4 +version = MikTeX $1 +category = app + +[anaconda3] +distro = Conda +listvers = 1 +location = anaconda/archive/Anaconda* +pattern = (Anaconda3)-(\d+.\d+.\d+)-(Windows|Linux|MacOSX)-(x86_64|x86).\w+ +platform = $3 +type = $4 +version = $1 $2 +category = app + +[anaconda2] +distro = Conda +listvers = 1 +location = anaconda/archive/Anaconda* +pattern = (Anaconda2)-(\d+.\d+.\d+)-(Windows|Linux|MacOSX)-(x86_64|x86).\w+ +platform = $3 +type = $4 +version = $1 $2 +category = app + +[miniconda3] +distro = Conda +listvers = 1 +location = anaconda/miniconda/Miniconda* +pattern = (Miniconda3)-(\d+.\d+.\d+)-(Windows|Linux|MacOSX)-(x86_64|x86).\w+ +platform = $3 +type = $4 +version = $1 $2 +category = app + +[miniconda2] +distro = Conda +listvers = 1 +location = anaconda/miniconda/Miniconda* +pattern = (Miniconda2)-(\d+.\d+.\d+)-(Windows|Linux|MacOSX)-(x86_64|x86).\w+ +platform = $3 +type = $4 +version = $1 $2 +category = app + +[lineageos] +distro = LineageOS +listvers = 1 +location = lineage-rom/full/*/*/*.zip +pattern = lineage-([0-9.]+)-(\d+)-nightly-(\w+)-signed.zip +platform = $3 +type = $1 +version = $2 +key_by = $1 $3 diff --git a/geninfo/genisolist.py b/geninfo/genisolist.py new file mode 100755 index 0000000..2ed2323 --- /dev/null +++ b/geninfo/genisolist.py @@ -0,0 +1,157 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import os +import re +import glob +import json +import logging +from urllib.parse import urljoin +from distutils.version import LooseVersion +from configparser import ConfigParser + +logger = logging.getLogger(__name__) +CONFIG_FILE = os.path.join(os.path.dirname(__file__), 'genisolist.ini') + + +def getPlatformPriority(platform): + platform = platform.lower() + if platform in ['amd64', 'x86_64', '64bit']: + return 100 + elif platform in ['i386', 'i486', 'i586', 'i686', 'x86', '32bit']: + return 90 + else: + return 0 + + +def renderTemplate(template, result): + group_count = len(result.groups()) + 1 + for i in range(group_count): + template = template.replace("$%d" % i, result.group(i) or "") + return template + + +def parseSection(items): + items = dict(items) + + if 'location' in items: + locations = [items['location']] + else: + locations = [] + i = 0 + while ("location_%d" % i) in items: + locations.append(items["location_%d" % i]) + i += 1 + + pattern = items.get("pattern", "") + prog = re.compile(pattern) + + images = [] + images = {} + for location in locations: + logger.debug("[GLOB] %s", location) + + for imagepath in glob.glob(location): + logger.debug("[FILE] %s", imagepath) + + result = prog.search(imagepath) + + if not(result): + logger.debug("[MATCH] None") + continue + else: + logger.debug("[MATCH] %r", result.groups()) + + imageinfo = {"filepath": imagepath, "distro": items["distro"]} + + for prop in ("version", "type", "platform", "category"): + imageinfo[prop] = renderTemplate(items.get(prop, ""), result) + + logger.debug("[JSON] %r", imageinfo) + key = renderTemplate(items.get("key_by", ""), result) + if key not in images: + images[key] = [] + images[key].append(imageinfo) + + for image_group in images.values(): + image_group.sort(key=lambda k: (LooseVersion(k['version']), + getPlatformPriority(k['platform']), + k['type']), + reverse=True) + + i = 0 + versions = set() + listvers = int(items.get('listvers', 0xFF)) + for image in image_group: + versions.add(image['version']) + if len(versions) <= listvers: + yield image + else: + break + + +def getDetail(image_info, urlbase): + url = urljoin(urlbase, image_info['filepath']) + desc = "%s (%s%s)" % ( + image_info['version'], + image_info['platform'], + ", %s" % image_info['type'] if image_info['type'] else '' + ) + + category = image_info.get('category', 'os') or "os" + return (desc, url, category) + + +def getJsonOutput(url_dict, prio={}): + raw = [] + for distro in url_dict: + raw.append({ + "distro": distro, + "category": list({c for _, _, c in url_dict[distro]})[0], + "urls": [ + {"name": name, "url": url} for name, url, _ in url_dict[distro] + ] + }) + + raw.sort(key=lambda d: prio.get(d["distro"], 0xFFFF)) + + return json.dumps(raw) + + +def getImageList(): + ini = ConfigParser() + if not(ini.read(CONFIG_FILE)): + raise Exception("%s not found!" % CONFIG_FILE) + + root = ini.get("%main%", 'root') + urlbase = ini.get("%main%", 'urlbase') + + prior = {} + for (name, value) in ini.items("%main%"): + if re.match("d\d+$", name): + prior[value] = int(name[1:]) + + oldcwd = os.getcwd() + os.chdir(root) + + url_dict = {} + for section in ini.sections(): + if section == "%main%": + continue + for image in parseSection(ini.items(section)): + if not image['distro'] in url_dict: + url_dict[image['distro']] = [] + + url_dict[image['distro']].append( + getDetail(image, urlbase) + ) + + os.chdir(oldcwd) + + return getJsonOutput(url_dict, prior) + + +if __name__ == "__main__": + import sys + logging.basicConfig(stream=sys.stderr, level=logging.DEBUG) + print(getImageList()) diff --git a/index.html b/index.html index e4e87a9..662dfae 100644 --- a/index.html +++ b/index.html @@ -9,20 +9,8 @@ permalink: /
+
-
-
-
- -
-
@@ -38,53 +26,95 @@ permalink: /
-
-
-

新闻公告

- - -
-
- -
-
-

联系我们

- -
-
-
- -
+ +
+

新闻公告

+ + +
+ +
+

联系我们

+ +
+
{% include footer.html %} + + + {% raw %} + + {% endraw %} + + {% raw %} + {% endraw %} + + /g,"$1").replace(//g,"$1")),t.chars&&t.chars(n),""});f+=e.length-h.length,e=h,o("",d,f-v,f)}else{var m=e.indexOf("<");if(0===m){if(Ho.test(e)){var g=e.indexOf("-->");if(g>=0){n(g+3);continue}}if(Uo.test(e)){var y=e.indexOf("]>");if(y>=0){n(y+2);continue}}var _=e.match(Fo);if(_){n(_[0].length);continue}var b=e.match(Bo);if(b){var $=f;n(b[0].length),o(b[0],b[1],$,f);continue}var w=r();if(w){i(w);continue}}var C=void 0,x=void 0,k=void 0;if(m>0){for(x=e.slice(m);!(Bo.test(x)||Ro.test(x)||Ho.test(x)||Uo.test(x)||(k=x.indexOf("<",1),k<0));)m+=k,x=e.slice(m);C=e.substring(0,m),n(m)}m<0&&(C=e,e=""),t.chars&&C&&t.chars(C)}if(e===a&&t.chars){t.chars(e);break}}o()}function rn(e){function t(){(a||(a=[])).push(e.slice(d,i).trim()),d=i+1}var n,r,i,o,a,s=!1,c=!1,u=0,l=0,f=0,d=0;for(i=0;ia&&o.push(JSON.stringify(e.slice(a,i)));var s=rn(r[1].trim());o.push("_s("+s+")"),a=i+r[0].length}return a=sa}function pr(e){return 34===e||39===e}function vr(e){var t=1;for(fa=la;!dr();)if(e=fr(),pr(e))hr(e);else if(91===e&&t++,93===e&&t--,0===t){da=la;break}}function hr(e){for(var t=e;!dr()&&(e=fr(),e!==t););}function mr(e,t,n){pa=n;var r=t.value,i=t.modifiers,o=e.tag,a=e.attrsMap.type;return"select"===o?br(e,r,i):"input"===o&&"checkbox"===a?gr(e,r,i):"input"===o&&"radio"===a?yr(e,r,i):_r(e,r,i),!0}function gr(e,t,n){var r=n&&n.number,i=pn(e,"value")||"null",o=pn(e,"true-value")||"true",a=pn(e,"false-value")||"false";un(e,"checked","Array.isArray("+t+")?_i("+t+","+i+")>-1:_q("+t+","+o+")"),dn(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$c){$$i<0&&("+t+"=$$a.concat($$v))}else{$$i>-1&&("+t+"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{"+t+"=$$c}",null,!0)}function yr(e,t,n){var r=n&&n.number,i=pn(e,"value")||"null";i=r?"_n("+i+")":i,un(e,"checked","_q("+t+","+i+")"),dn(e,"change",$r(t,i),null,!0)}function _r(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=o||Vr&&"range"===r?"change":"input",u=!o&&"range"!==r,l="input"===e.tag||"textarea"===e.tag,f=l?"$event.target.value"+(s?".trim()":""):"$event";f=a||"number"===r?"_n("+f+")":f;var d=$r(t,f);l&&u&&(d="if($event.target.composing)return;"+d),un(e,"value",l?"_s("+t+")":"("+t+")"),dn(e,c,d,null,!0)}function br(e,t,n){var r=n&&n.number,i='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(r?"_n(val)":"val")+"})"+(null==e.attrsMap.multiple?"[0]":""),o=$r(t,i);dn(e,"change",o,null,!0)}function $r(e,t){var n=lr(e);return null===n.idx?e+"="+t:"var $$exp = "+n.exp+", $$idx = "+n.idx+";if (!Array.isArray($$exp)){"+e+"="+t+"}else{$$exp.splice($$idx, 1, "+t+")}"}function wr(e,t){t.value&&un(e,"textContent","_s("+t.value+")")}function Cr(e,t){t.value&&un(e,"innerHTML","_s("+t.value+")")}function xr(e,t){return t=t?u(u({},Ka),t):Ka,or(e,t)}function kr(e,t,n){var r=(t&&t.warn||$i,t&&t.delimiters?String(t.delimiters)+e:e);if(qa[r])return qa[r];var i={},o=xr(e,t);i.render=Ar(o.render);var a=o.staticRenderFns.length;i.staticRenderFns=new Array(a);for(var s=0;s0,qr=zr&&zr.indexOf("edge/")>0,Kr=zr&&zr.indexOf("android")>0,Wr=zr&&/iphone|ipad|ipod|ios/.test(zr),Zr=Ur&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Gr=function(){function e(){r=!1;var e=n.slice(0);n.length=0;for(var t=0;t\/=]+)/,Lo=/(?:=)/,No=[/"([^"]*)"+/.source,/'([^']*)'+/.source,/([^\s"'=<>`]+)/.source],Do=new RegExp("^\\s*"+jo.source+"(?:\\s*("+Lo.source+")\\s*(?:"+No.join("|")+"))?"),Mo="[a-zA-Z_][\\w\\-\\.]*",Po="((?:"+Mo+"\\:)?"+Mo+")",Ro=new RegExp("^<"+Po),Io=/^\s*(\/?)>/,Bo=new RegExp("^<\\/"+Po+"[^>]*>"),Fo=/^]+>/i,Ho=/^
{% include footer.html %} - + {% endraw %} +