Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync from ZJU Git #83

Merged
merged 13 commits into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ module.exports = {
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: './',
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['react', '@typescript-eslint', 'prettier'],
plugins: ['react', '@typescript-eslint', 'import', 'prettier'],
rules: {
// needed by prettier
'prettier/prettier': 'warn',
Expand Down
14 changes: 10 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
image: node:lts-bullseye
image:
name: node:20
pull_policy: if-not-present

stages:
- build
Expand All @@ -8,12 +10,16 @@ gatsby-build:
stage: build
variables:
CHOKIDAR_USEPOLLING: 1
GATSBY_TELEMETRY_DISABLED: 1
cache:
paths:
- node_modules/
- .npm/
script:
- bash cached-restore.sh
- yarn run build
- apt-get update && apt-get install -y libvips42 libvips-dev
- npm config set registry https://registry.npmmirror.com
- npm install -g [email protected]
- npm ci --cache .npm --prefer-offline
- npm run build
artifacts:
paths:
- public
Expand Down
16 changes: 0 additions & 16 deletions cached-restore.sh

This file was deleted.

14 changes: 9 additions & 5 deletions caddy/Caddyfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
localhost:50000

file_server
reverse_proxy /api/* https://mirror.zju.edu.cn {
header_up Host {upstream_hostport}
{
admin off
}

http://:50000 {
file_server
reverse_proxy /api/* https://mirror.zju.edu.cn {
header_up Host {upstream_hostport}
}
}
37 changes: 3 additions & 34 deletions docs/zh/ubuntu-ports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,10 @@
mirrorId: ubuntu-ports
---

import ConfigGenerator from '../../src/components/config-generator'

export const ubuntuVersionMap = {
"23.04": "lunar",
"22.10": "kinetic",
"22.04 LTS": "jammy",
"20.04 LTS": "focal",
"18.04 LTS": "bionic",
"16.04 LTS": "xenial",
"14.04 LTS": "trusty",
}


export const GenUbuntuConfig = (version) => {
var ubuntuName = ubuntuVersionMap[version]
return `# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.zju.edu.cn/ubuntu-ports/ ${ubuntuName} main restricted universe multiverse
# deb-src https://mirrors.zju.edu.cn/ubuntu-ports/ ${ubuntuName} main restricted universe multiverse
deb https://mirrors.zju.edu.cn/ubuntu-ports/ ${ubuntuName}-updates main restricted universe multiverse
# deb-src https://mirrors.zju.edu.cn/ubuntu-ports/ ${ubuntuName}-updates main restricted universe multiverse
deb https://mirrors.zju.edu.cn/ubuntu-ports/ ${ubuntuName}-backports main restricted universe multiverse
# deb-src https://mirrors.zju.edu.cn/ubuntu-ports/ ${ubuntuName}-backports main restricted universe multiverse
deb https://mirrors.zju.edu.cn/ubuntu-ports/ ${ubuntuName}-security main restricted universe multiverse
# deb-src https://mirrors.zju.edu.cn/ubuntu-ports/ ${ubuntuName}-security main restricted universe multiverse\n
# 预发布软件源,不建议启用
# deb https://mirrors.zju.edu.cn/ubuntu-ports/ ${ubuntuName}-proposed main restricted universe multiverse
# deb-src https://mirrors.zju.edu.cn/ubuntu-ports/ ${ubuntuName}-proposed main restricted universe multiverse`
}

export const defaultVersion = Object.keys(ubuntuVersionMap).find(x => x.indexOf("LTS") > 0);

> ubuntu-ports 镜像目前仅为校内反向代理清华 TUNA 镜像站。若您的网络环境处于校外, apt 的 HTTP(S) 请求将会被重定向( 302 )至 TUNA 镜像站。

Ubuntu 的软件源配置文件是 `/etc/apt/sources.list`。将系统自带的该文件做个备份,将该文件替换为下面内容,即可使用我们的软件源镜像
本镜像仅包含 arm64 armhf ppc64el riscv64 s390x 架构的软件包

<ConfigGenerator promptString="请选择您的 Ubuntu 版本:" versionList={Object.keys(ubuntuVersionMap)} defaultVersion={defaultVersion} configGen={GenUbuntuConfig} language="bash" />
import UbuntuConfigGenerator from '../../src/components/ubuntu-config-generator'

本镜像仅包含 arm64 armhf ppc64el riscv64 s390x 架构的软件包。
<UbuntuConfigGenerator ubuntuVariant="ubuntu-ports" />
36 changes: 3 additions & 33 deletions docs/zh/ubuntu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,8 @@
mirrorId: ubuntu
---

import ConfigGenerator from '../../src/components/config-generator'
import UbuntuConfigGenerator from '../../src/components/ubuntu-config-generator'

export const ubuntuVersionMap = {
"23.04": "lunar",
"22.10": "kinetic",
"22.04 LTS": "jammy",
"20.04 LTS": "focal",
"18.04 LTS": "bionic",
"16.04 LTS": "xenial",
"14.04 LTS": "trusty",
}
<UbuntuConfigGenerator ubuntuVariant="ubuntu" />

export const GenUbuntuConfig = (version) => {
var ubuntuName = ubuntuVersionMap[version]
return `# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.zju.edu.cn/ubuntu/ ${ubuntuName} main restricted universe multiverse
# deb-src https://mirrors.zju.edu.cn/ubuntu/ ${ubuntuName} main restricted universe multiverse
deb https://mirrors.zju.edu.cn/ubuntu/ ${ubuntuName}-updates main restricted universe multiverse
# deb-src https://mirrors.zju.edu.cn/ubuntu/ ${ubuntuName}-updates main restricted universe multiverse
deb https://mirrors.zju.edu.cn/ubuntu/ ${ubuntuName}-backports main restricted universe multiverse
# deb-src https://mirrors.zju.edu.cn/ubuntu/ ${ubuntuName}-backports main restricted universe multiverse
deb https://mirrors.zju.edu.cn/ubuntu/ ${ubuntuName}-security main restricted universe multiverse
# deb-src https://mirrors.zju.edu.cn/ubuntu/ ${ubuntuName}-security main restricted universe multiverse\n
# 预发布软件源,不建议启用
# deb https://mirrors.zju.edu.cn/ubuntu/ ${ubuntuName}-proposed main restricted universe multiverse
# deb-src https://mirrors.zju.edu.cn/ubuntu/ ${ubuntuName}-proposed main restricted universe multiverse`
}

export const defaultVersion = Object.keys(ubuntuVersionMap).find(x => x.indexOf("LTS") > 0);

Ubuntu 的软件源配置文件是 `/etc/apt/sources.list`。将系统自带的该文件做个备份,将该文件替换为下面内容,即可使用我们的软件源镜像。

<ConfigGenerator promptString="请选择您的 Ubuntu 版本:" versionList={Object.keys(ubuntuVersionMap)} defaultVersion={defaultVersion} configGen={GenUbuntuConfig} language="bash" />

本镜像仅包含 32/64 位 x86 架构处理器的软件包,在 ARM(arm64, armhf)、PowerPC(ppc64el)、RISC-V(riscv64) 和 S390x 等架构的设备上(对应官方源为`ports.ubuntu.com`)请使用 [ubuntu-ports](/docs/ubuntu-ports) 镜像。
本镜像仅包含 32/64 位 x86 架构处理器的软件包,在 ARM(arm64, armhf)、PowerPC(ppc64el)、RISC-V(riscv64) 和 S390x 等架构的设备上(对应官方源为`ports.ubuntu.com`)请使用 [ubuntu-ports](/docs/ubuntu-ports) 镜像。
4 changes: 4 additions & 0 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
import './src/styles/global.scss';
import React from 'react';
import RootLayout from './src/utils/root-layout';

export const wrapRootElement = ({ element }) => <RootLayout>{element}</RootLayout>
15 changes: 0 additions & 15 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,6 @@ module.exports = {
assetPrefix: config.assetPrefix,
pathPrefix: config.pathPrefix,
plugins: [
{
resolve: `gatsby-theme-material-ui`,
options: {
webFontsConfig: {
fonts: {
google: [
{
family: `Metrophobic`
},
],
},
},
}
},
{
resolve: 'gatsby-source-filesystem',
options: {
Expand Down Expand Up @@ -113,7 +99,6 @@ module.exports = {
icon: 'resource/icons/favicon.svg',
},
},
`gatsby-plugin-preact`,
`gatsby-plugin-sass`,
{
resolve: "gatsby-plugin-sitemap",
Expand Down
11 changes: 11 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const { match, compile } = require("path-to-regexp");
const { createFilePath } = require(`gatsby-source-filesystem`)
const { createContentDigest } = require(`gatsby-core-utils`)
const config = require('./config');
const path = require("path");

const mdxResolverPassthrough = (fieldName) => async (
source,
Expand Down Expand Up @@ -194,3 +195,13 @@ exports.createPages = async ({ graphql, actions, reporter }) => {
});
})
}

exports.onCreateWebpackConfig = ({ actions }) => {
actions.setWebpackConfig({
resolve: {
alias: {
'~': path.resolve(__dirname, 'src'),
},
},
});
};
5 changes: 5 additions & 0 deletions gatsby-ssr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import './src/styles/global.scss';
import React from 'react';
import RootLayout from './src/utils/root-layout';

export const wrapRootElement = ({ element }) => <RootLayout>{element}</RootLayout>
8 changes: 8 additions & 0 deletions news/zh/240410_maintenance.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: 镜像站维护通知
name: maintenance_240410
author: Azuk @ ZJUSCT Falcon Team
date: 2024-04-10
---

由于镜像站同步基础设施迁移,部分软件源镜像实际已同步至本地,但以缓存( "Cached" )方式进行展示。标识错误不会影响镜像站的正常使用。对您造成的不便,我们深表歉意。
Loading
Loading