This commit is contained in:
Super Manito
2022-01-01 04:47:37 +08:00
parent 4c6a600067
commit b3937ce664
34 changed files with 382 additions and 28 deletions

BIN
docs/.DS_Store vendored Normal file

Binary file not shown.

0
docs/.nojekyll Normal file
View File

123
docs/README.md Normal file
View File

@@ -0,0 +1,123 @@
- #### __GNU/Linux 一键更换国内软件源脚本__ <!-- {docsify-ignore} -->
- #### __本项目旨在为从事计算机相关行业的朋友们提供便利__ <!-- {docsify-ignore} -->
- #### __理论支持所有架构的环境`arm64` 环境已经过测试__ <!-- {docsify-ignore} -->
## 适配系统
<table>
<tr>
<td rowspan="7"> 支持<br/>版本<br/>
</tr>
<tr>
<td><a href="https://www.debian.org"><img src="../img/icon/debian.svg" width="16" height="16"/></a>&nbsp;Debian</td>
<td align="center">8.0 ~ 11.2</td>
</tr>
<tr>
<td><a href="https://cn.ubuntu.com"><img src="../img/icon/ubuntu.svg" width="16" height="16"/></a>&nbsp;Ubuntu</td>
<td align="center">16.04 ~ 21.10</td>
</tr>
<tr>
<td><a href="https://www.kali.org"><img src="../img/icon/kali.svg" width="16" height="16"/></a>&nbsp;Kali Linux</td>
<td align="center">2.0 ~ 2021.4</td>
</tr>
<tr>
<td><a href="https://access.redhat.com/products/red-hat-enterprise-linux"><img src="../img/icon/redhat.svg" width="16" height="16"/></a>&nbsp;Red Hat Enterprise Linux</td>
<td align="center">7.0 ~ 8.5</td>
</tr>
<tr>
<td><a href="https://www.centos.org"><img src="../img/icon/centos.svg" width="16" height="16"/></a>&nbsp;CentOS</td>
<td align="center">7.0 ~ 8.5</td>
</tr>
<tr>
<td><a href="https://getfedora.org/zh_Hans_CN"><img src="../img/icon/fedora.ico" width="16" height="16"/></a>&nbsp;Fedora</td>
<td align="center">28 ~ 35</td>
</tr>
</table>
> 目前仅支持上述基于 Debian 与 Redhat 系的发行版和及其部分衍生版本 \
> 同样支持上述版本中拥有相同底层核心的其它发行版,例如 [`Armbian`](https://www.armbian.com) [`Kubuntu`](https://kubuntu.org) [`Oracle Linux`](https://www.oracle.com/cn/technical-resources) 等
## 软件源
> 脚本当前使用的开源镜像站
| | 镜像站名称 | 镜像站地址 | IPv6 | Kali Linux | Fedora | EPEL |
| :------: | :------: | :------: | :------: | :------: | :------: | :------: |
| 1 | 阿里云 | [mirrors.aliyun.com](https://developer.aliyun.com/special/mirrors/notice) | √ | √ | √ | √ |
| 2 | 腾讯云 | [mirrors.cloud.tencent.com](https://mirrors.cloud.tencent.com) | √ | √ | √ | √ |
| 3 | 华为云 | [mirrors.huaweicloud.com](https://mirrors.huaweicloud.com) | √ | √ | √ | √ |
| 4 | 网易 | [mirrors.163.com](https://mirrors.163.com) | | | √ | |
| 5 | 搜狐 | [mirrors.sohu.com](https://mirrors.sohu.com) | | | | |
| 6 | 清华大学 | [mirrors.tuna.tsinghua.edu.cn](https://mirrors.tuna.tsinghua.edu.cn) | √ | √ | √ | √ |
| 7 | 浙江大学 | [mirrors.zju.edu.cn](https://mirrors.zju.edu.cn) | | √ | √ | √ |
| 8 | 南京大学 | [mirrors.nju.edu.cn](https://mirrors.nju.edu.cn) | | √ | √ | √ |
| 9 | 重庆大学 | [mirrors.cqu.edu.cn](https://mirrors.cqu.edu.cn) | | √ | √ | √ |
| 10 | 兰州大学 | [mirror.lzu.edu.cn](https://mirror.lzu.edu.cn) | √ | | √ | √ |
| 11 | 上海交通大学 | [mirror.sjtu.edu.cn](https://mirror.sjtu.edu.cn) | √ | √ | √ | √ |
| 12 | 哈尔滨工业大学 | [mirrors.hit.edu.cn](https://mirrors.hit.edu.cn) | √ | √ | | √ |
| 13 | 中国科学技术大学 | [mirrors.ustc.edu.cn](https://mirrors.ustc.edu.cn) | √ | √ | √ | √ |
> 所有镜像站均支持 `Debian` `Ubuntu` `CentOS` 软件源,建议优先选择由企业提供的软件源
?> 如果使用过程中脚本不能正常输出中文内容则可对照此列表使用,顺序与脚本一致
## 执行流程
- └ 选择国内源 `交互`
- └ 检测如果是 RHEL或CentOS 系统选择是否安装/覆盖 EPEL 扩展国内源 `交互`
- └ 选择软件源使用的 WEB 协议 `交互`
- └ 检测 防火墙 和 SELINUX 如果开启并且系统是 RHEL或CentOS 选择是否关闭 `交互`
- └ 备份原有源
- └ 检测如果存在重复的备份文件选择是否覆盖 `交互`
- └ 更换国内源
- └ 选择是否更新软件包 `交互`
- └ 选择是否清理已下载的软件包缓存 `交互`
## 如何使用
```bash
bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh)
```
- 1. 完整复制上面的命令到终端按回车键即可执行,若无法安装 `curl` 软件包可复制源码到本地后手动执行。
- 2. 为了适配所有环境,建议使用 `Root` 用户执行脚本,切换命令为 `sudo -i` ,如遇报错请查看常见问题与帮助。
- 3. 如果您使用的环境没有安装或不支持简体中文环境,请通过 `SSH客户端工具` 使用,否则将无法正确选择交互内容。
- 4. 执行脚本过程中会自动备份原有源无需手动备份,期间会在终端输出多个主观选择交互内容,可按回车键快速确认。
- 5. 脚本支持在原有源配置错误或者不存在的情况下使用,并且可以重复使用;脚本变更的软件源默认使用 `HTTP 协议`
> **Debian** 系 Linux 默认禁用了**源码仓库**和**预发布软件源**,若需启用可将 `list` 源文件中相关内容的所在行**取消注释**
> **RedHat** 系 Linux 配置了所有可以配置的仓库,但有一些仓库**默认没有启用**,若需启用可将 `repo` 源文件中的 `enabled=0` 修改成 `enabled=1`
## 其它脚本
- #### `Docker` 一键安装脚本 <!-- {docsify-ignore} -->
```bash
bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/DockerInstallation.sh)
```
> `Docker CE`Docker Community Edition 镜像仓库,用于下载并安装 Docker 相关软件包。\
> `Docker Hub`Docker Hub 镜像仓库,默认为官方提供的公共库,用于切换下载镜像时的来源仓库,简称镜像加速器。
> 脚本集成安装 `Docker Engine`与 `Docker Compose`,可手动选择安装版本、下载源、镜像加速器,支持国内外服务器环境和 `ARM`架构处理器环境使用
## 常见问题
- #### 如果提示 `Command 'curl' not found` 则说明当前未安装 `curl` 软件包 <!-- {docsify-ignore} -->
```bash
sudo apt install -y curl 或 sudo yum install -y curl
```
- #### 如果提示 `Command 'wget' not found` 则说明当前未安装 `wget` 软件包 <!-- {docsify-ignore} -->
```bash
sudo apt install -y wget 或 sudo yum install -y wget
```
- #### 如果提示 `bash: /proc/self/fd/11: No such file or directory`,请切换至 `Root` 用户执行。 <!-- {docsify-ignore} -->
## License
Copyright © 2021, [SuperManito](https://github.com/SuperManito). Released under the [GPL-2.0](https://github.com/SuperManito/LinuxMirrors/blob/main/LICENSE)
> 项目已设立开源许可协议,传播时需在显著位置标注来源和作者,请尊重本人的知识成果\
> 建议通过命令直接调用脚本,如有意见与建议您可以提交至 __Issues__ ,谢谢
***
__如果您觉得这个项目不错的话可以送颗 ⭐ 吗方便分享给更多的朋友吗__

3
docs/_404.md Normal file
View File

@@ -0,0 +1,3 @@
!> 你走丢了哦~
<a><img src="../img/404.gif"></a>

11
docs/_coverpage.md Normal file
View File

@@ -0,0 +1,11 @@
# ![LinuxMirrors](./img/logo.png)
> 脚本一键更换服务器软件源,让换源更简单!
<a href="https://github.com/SuperManito/LinuxMirrors"><img src="../img/icon/github-1.svg" width="34" height="42"></a>
&nbsp;<a href="https://github.com/SuperManito/LinuxMirrors"><img src="../img/icon/github-2.svg" width="70" height="52"></a>
&nbsp;&nbsp;&nbsp;<a href="https://gitee.com/SuperManito/LinuxMirrors"><img src="../img/icon/gitee.svg" width="100" height="50"/></a>
[Github](https://github.com/SuperManito/LinuxMirrors)
[Gitee](https://gitee.com/SuperManito/LinuxMirrors)
[开始使用](#适配系统)

1
docs/css/default.css Normal file

File diff suppressed because one or more lines are too long

1
docs/css/vue.css Normal file

File diff suppressed because one or more lines are too long

127
docs/index.html Normal file
View File

@@ -0,0 +1,127 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>LinuxMirror · 让换源更简单</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Description">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="./css/vue.css">
<link rel="icon" type="image/x-icon" href="./img/icon/linux.svg" />
</head>
<body>
<div id="app"></div>
<script>
window.$docsify = {
name: 'LinuxMirrors',
repo: 'https://github.com/SuperManito/LinuxMirrors',
// 导航栏logo
logo: './img/logo.png',
// 加载封面
coverpage: true,
// 主题色
themeColor: '#1e90ff',
// 小屏幕设备自动合并导航栏到侧边栏
mergeNavbar: true,
// 启用自定义404页
notFoundPage: true,
// 跳转后自动移到顶部
auto2top: true,
// 搜索
search: 'auto',
search: {
maxAge: 86400000, // 过期时间,单位毫秒,默认一天
placeholder: '搜索',
noData: '找不到结果!',
// 搜索标题的最大层级, 1 - 6
depth: 2,
hideOtherSidebarContent: false, // 是否隐藏其他侧边栏内容
// 避免搜索索引冲突
// 同一域下的多个网站之间
namespace: 'website-1',
// 使用不同的索引作为路径前缀namespaces
// 注意:仅适用于 paths: 'auto' 模式
// 初始化索引时,我们从侧边栏查找第一个路径
// 如果它与列表中的前缀匹配,我们将切换到相应的索引
pathNamespaces: ['/zh-cn', '/ru-ru', '/ru-ru/v1'],
// 您可以提供一个正则表达式来匹配前缀。在这种情况下,
// 匹配到的字符串将被用来识别索引
pathNamespaces: /^(\/(zh-cn|ru-ru))?(\/(v1|v2))?/
},
// 浅色|暗黑主题
darklightTheme: {
siteFont: "PT Sans",
defaultTheme: 'dark',
codeFontFamily: 'Roboto Mono, Monaco, courier, monospace',
bodyFontSize: '17px',
light: {
accent: '#1e90ff',
toogleBackground: '#091a28',
background: '#ffffff',
textColor: '#34495e',
codeTextColor: '#525252',
codeBackgroundColor: '#f8f8f8',
borderColor: 'rgba(0, 0, 0, 0.07)',
blockQuoteColor: '#858585',
highlightColor: '#d22778',
sidebarSublink: '#7c7c7c',
codeTypeColor: '#091a28',
coverBackground: 'linear-gradient(to left bottom, hsl(118, 100%, 85%) 0%,hsl(181, 100%, 85%) 100%)',
toogleImage: 'url(https://cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/icons/moon.svg)'
},
dark: {
accent: '#42b983',
toogleBackground: '#ffffff',
background: '#091a28',
textColor: '#b4b4b4',
codeTextColor: '#ffffff',
codeBackgroundColor: '#0e2233',
borderColor: '#0d2538',
blockQuoteColor: '#858585',
highlightColor: '#bb8b06',
sidebarSublink: '#b4b4b4',
codeTypeColor: '#ffffff',
coverBackground: 'linear-gradient(to left bottom, hsl(118, 100%, 85%) 0%,hsl(181, 100%, 85%) 100%)',
toogleImage: 'url(https://cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/icons/sun.svg)'
},
// 底部跳转页码
pagination: {
previousText: '上一章节',
nextText: '下一章节',
crossChapter: true,
crossChapterText: true,
},
}
}
</script>
<!-- Docsify v4 -->
<script src="./js/docsify@4.js"></script>
<!-- 暗黑主题 -->
<script src="./js/dark-theme.js" type="text/javascript"></script>
<!-- 底部跳转页码 -->
<script src="./js/docsify-pagination.min.js"></script>
<!-- 复制到剪贴板 -->
<script src="./js/docsify-copy-code.min.js"></script>
<!-- Emoji支持 -->
<script src="./js/emoji.min.js"></script>
<!-- 搜索 -->
<script src="./js/search.js"></script>
<!-- 代码高亮 -->
<script src="./js/prism-bash.min.js"></script>
<!-- 更新日志 -->
<script src="./js/change-log.js"></script>
<!-- 离线模式 -->
<script>
if (typeof navigator.serviceWorker !== 'undefined') {
navigator.serviceWorker.register('./js/sw.js')
}
</script>
</body>
</html>

1
docs/js/dark-theme.js Normal file
View File

@@ -0,0 +1 @@
window.$docsify.plugins=[].concat((e,o)=>{let t={siteFont:"PT Sans",defaultTheme:"dark",codeFontFamily:"Roboto Mono, Monaco, courier, monospace",bodyFontSize:"17px",dark:{accent:"#42b983",toogleBackground:"#ffffff",background:"#091a28",textColor:"#b4b4b4",codeTextColor:"#ffffff",codeBackgroundColor:"#0e2233",borderColor:"#0d2538",blockQuoteColor:"#858585",highlightColor:"#d22778",sidebarSublink:"#b4b4b4",codeTypeColor:"#ffffff",coverBackground:"linear-gradient(to left bottom, hsl(118, 100%, 85%) 0%,hsl(181, 100%, 85%) 100%)",toogleImage:"url(https://cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/icons/sun.svg)"},light:{accent:"#42b983",toogleBackground:"#091a28",background:"#ffffff",textColor:"#34495e",codeTextColor:"#525252",codeBackgroundColor:"#f8f8f8",borderColor:"rgba(0, 0, 0, 0.07)",blockQuoteColor:"#858585",highlightColor:"#d22778",sidebarSublink:"#505d6b",codeTypeColor:"#091a28",coverBackground:"linear-gradient(to left bottom, hsl(118, 100%, 85%) 0%,hsl(181, 100%, 85%) 100%)",toogleImage:"url(https://cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/icons/moon.svg)"}};if(o.config.hasOwnProperty("darklightTheme")){for(var[r,l]of Object.entries(o.config.darklightTheme))"light"!==r&&"dark"!==r&&"defaultTheme"!==r&&(t[r]=l);for(var[r,l]of Object.entries(t))"light"!==r&&"dark"!==r&&(t[r]=l,document.documentElement.style.setProperty("--"+r,l));if(o.config.darklightTheme.hasOwnProperty("dark"))for(var[r,l]of Object.entries(o.config.darklightTheme.dark))t.dark[r]=l;if(o.config.darklightTheme.hasOwnProperty("light"))for(var[r,l]of Object.entries(o.config.darklightTheme.light))t.light[r]=l}else for(var[r,l]of Object.entries(t))"light"!==r&&"dark"!==r&&(t[r]=l,document.documentElement.style.setProperty("--"+r,l));window.matchMedia("(prefers-color-scheme: dark)").matches?t.defaultTheme="dark":window.matchMedia("(prefers-color-scheme: light)").matches&&(t.defaultTheme="light");var d=e=>{if(localStorage.setItem("DARK_LIGHT_THEME",e),t.defaultTheme=e,"light"==e)for(var[o,r]of Object.entries(t.light))document.documentElement.style.setProperty("--"+o,r);else if("dark"==e)for(var[o,r]of Object.entries(t.dark))document.documentElement.style.setProperty("--"+o,r);document.documentElement.style.setProperty("color-scheme",e)};e.afterEach((function(e,o){o(e='<div id="docsify-darklight-theme"><p>.</p></div>'+e)})),e.doneEach((function(){let e=localStorage.getItem("DARK_LIGHT_THEME");"light"==e||"dark"==e?(t.defaultTheme=e,d(t.defaultTheme)):d(t.defaultTheme);const o=document.getElementById("docsify-darklight-theme");null!==o&&o.addEventListener("click",(function(){"light"===t.defaultTheme?d("dark"):d("light")}))}))},window.$docsify.plugins);

9
docs/js/docsify-copy-code.min.js vendored Normal file
View File

@@ -0,0 +1,9 @@
/*!
* docsify-copy-code
* v2.1.1
* https://github.com/jperasmus/docsify-copy-code
* (c) 2017-2020 JP Erasmus <jperasmus11@gmail.com>
* MIT license
*/
!function(){"use strict";function s(o){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o})(o)}!function(o,e){void 0===e&&(e={});var t=e.insertAt;if(o&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],c=document.createElement("style");c.type="text/css","top"===t&&n.firstChild?n.insertBefore(c,n.firstChild):n.appendChild(c),c.styleSheet?c.styleSheet.cssText=o:c.appendChild(document.createTextNode(o))}}(".docsify-copy-code-button,.docsify-copy-code-button span{cursor:pointer;transition:all .25s ease}.docsify-copy-code-button{position:absolute;z-index:1;top:0;right:0;overflow:visible;padding:.65em .8em;border:0;border-radius:0;outline:0;font-size:1em;background:grey;background:var(--theme-color,grey);color:#fff;opacity:0}.docsify-copy-code-button span{border-radius:3px;background:inherit;pointer-events:none}.docsify-copy-code-button .error,.docsify-copy-code-button .success{position:absolute;z-index:-100;top:50%;right:0;padding:.5em .65em;font-size:.825em;opacity:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.docsify-copy-code-button.error .error,.docsify-copy-code-button.success .success{right:100%;opacity:1;-webkit-transform:translate(-115%,-50%);transform:translate(-115%,-50%)}.docsify-copy-code-button:focus,pre:hover .docsify-copy-code-button{opacity:1}"),document.querySelector('link[href*="docsify-copy-code"]')&&console.warn("[Deprecation] Link to external docsify-copy-code stylesheet is no longer necessary."),window.DocsifyCopyCodePlugin={init:function(){return function(o,e){o.ready(function(){console.warn("[Deprecation] Manually initializing docsify-copy-code using window.DocsifyCopyCodePlugin.init() is no longer necessary.")})}}},window.$docsify=window.$docsify||{},window.$docsify.plugins=[function(o,r){o.doneEach(function(){var o=Array.apply(null,document.querySelectorAll("pre[data-lang]")),c={buttonText:"点击复制",errorText:"Error",successText:"已复制"};r.config.copyCode&&Object.keys(c).forEach(function(t){var n=r.config.copyCode[t];"string"==typeof n?c[t]=n:"object"===s(n)&&Object.keys(n).some(function(o){var e=-1<location.href.indexOf(o);return c[t]=e?n[o]:c[t],e})});var e=['<button class="docsify-copy-code-button">','<span class="label">'.concat(c.buttonText,"</span>"),'<span class="error">'.concat(c.errorText,"</span>"),'<span class="success">'.concat(c.successText,"</span>"),"</button>"].join("");o.forEach(function(o){o.insertAdjacentHTML("beforeend",e)})}),o.mounted(function(){document.querySelector(".content").addEventListener("click",function(o){if(o.target.classList.contains("docsify-copy-code-button")){var e="BUTTON"===o.target.tagName?o.target:o.target.parentNode,t=document.createRange(),n=e.parentNode.querySelector("code"),c=window.getSelection();t.selectNode(n),c.removeAllRanges(),c.addRange(t);try{document.execCommand("copy")&&(e.classList.add("success"),setTimeout(function(){e.classList.remove("success")},1e3))}catch(o){console.error("docsify-copy-code: ".concat(o)),e.classList.add("error"),setTimeout(function(){e.classList.remove("error")},1e3)}"function"==typeof(c=window.getSelection()).removeRange?c.removeRange(t):"function"==typeof c.removeAllRanges&&c.removeAllRanges()}})})}].concat(window.$docsify.plugins||[])}();
//# sourceMappingURL=docsify-copy-code.min.js.map

1
docs/js/docsify-pagination.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1
docs/js/docsify@4.js Normal file

File diff suppressed because one or more lines are too long

1
docs/js/emoji.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1
docs/js/prism-bash.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1
docs/js/search.js Normal file

File diff suppressed because one or more lines are too long

83
docs/js/sw.js Normal file
View File

@@ -0,0 +1,83 @@
/* ===========================================================
* docsify sw.js
* ===========================================================
* Copyright 2016 @huxpro
* Licensed under Apache 2.0
* Register service worker.
* ========================================================== */
const RUNTIME = 'docsify'
const HOSTNAME_WHITELIST = [
self.location.hostname,
'fonts.gstatic.com',
'fonts.googleapis.com',
'cdn.jsdelivr.net'
]
// The Util Function to hack URLs of intercepted requests
const getFixedUrl = (req) => {
var now = Date.now()
var url = new URL(req.url)
// 1. fixed http URL
// Just keep syncing with location.protocol
// fetch(httpURL) belongs to active mixed content.
// And fetch(httpRequest) is not supported yet.
url.protocol = self.location.protocol
// 2. add query for caching-busting.
// Github Pages served with Cache-Control: max-age=600
// max-age on mutable content is error-prone, with SW life of bugs can even extend.
// Until cache mode of Fetch API landed, we have to workaround cache-busting with query string.
// Cache-Control-Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=453190
if (url.hostname === self.location.hostname) {
url.search += (url.search ? '&' : '?') + 'cache-bust=' + now
}
return url.href
}
/**
* @Lifecycle Activate
* New one activated when old isnt being used.
*
* waitUntil(): activating ====> activated
*/
self.addEventListener('activate', event => {
event.waitUntil(self.clients.claim())
})
/**
* @Functional Fetch
* All network requests are being intercepted here.
*
* void respondWith(Promise<Response> r)
*/
self.addEventListener('fetch', event => {
// Skip some of cross-origin requests, like those for Google Analytics.
if (HOSTNAME_WHITELIST.indexOf(new URL(event.request.url).hostname) > -1) {
// Stale-while-revalidate
// similar to HTTP's stale-while-revalidate: https://www.mnot.net/blog/2007/12/12/stale
// Upgrade from Jake's to Surma's: https://gist.github.com/surma/eb441223daaedf880801ad80006389f1
const cached = caches.match(event.request)
const fixedUrl = getFixedUrl(event.request)
const fetched = fetch(fixedUrl, { cache: 'no-store' })
const fetchedCopy = fetched.then(resp => resp.clone())
// Call respondWith() with whatever we get first.
// If the fetch fails (e.g disconnected), wait for the cache.
// If theres nothing in cache, wait for the fetch.
// If neither yields a response, return offline pages.
event.respondWith(
Promise.race([fetched.catch(_ => cached), cached])
.then(resp => resp || fetched)
.catch(_ => { /* eat any errors */ })
)
// Update the cache with the version we fetched (only for ok status)
event.waitUntil(
Promise.all([fetchedCopy, caches.open(RUNTIME)])
.then(([response, cache]) => response.ok && cache.put(event.request, response))
.catch(_ => { /* eat any errors */ })
)
}
})