hexo/index.html

1133 lines
82 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN">
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="icon" href="/img/logo.png">
<meta name="author" content="浪子">
<meta name="subtitle" content="一个分享自己生活的博客">
<meta name="description" content="曾梦想仗剑走天涯;因太胖放弃原计划.">
<meta name="keywords" content=",DIY,黑苹果,分享,自由">
<link rel="alternate" href="/atom.xml " title="提剑追梦" type="application/atom+xml">
<title>提剑追梦</title>
<link rel="stylesheet" href="/css/style.css" >
<link rel="stylesheet" href="/css/partial/dark.css" >
<link rel="stylesheet" href="/css/partial/highlight/atom-one-light.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/a2396837/CDN@latest/css/iconfont.css">
<link rel="stylesheet" href="https://cdnjs.sgcd.net/lxgw-wenkai-screen-webfont/lxgwwenkaigbscreen.css">
<script src="/js/todark.js"></script>
<meta name="generator" content="Hexo 6.3.0"></head>
</html>
<div class="nav index" style="height: 60px;">
<div class="title animated fadeInDown">
<div class="layui-container">
<div class="nav-title"><a href="/" title="提剑追梦">提剑追梦</a></div>
<div class="nav-list">
<button> <span class=""></span><span style="display: block;"></span><span class=""></span> </button>
<ul class="layui-nav" lay-filter="">
<li class="layui-nav-item">
<a href="/search/ ">
<i class=" fas fa-search-plus " style="color: rgb(3 169 244);"></i>
<span class="layui-nav-item-name">搜索</span>
</a>
</li>
<li class="layui-nav-item">
<a href="/ ">
<i class=" fab fa-fort-awesome " style="color: rgb(255 107 107);"></i>
<span class="layui-nav-item-name">首页</span>
</a>
</li>
<li class="layui-nav-item">
<a href="/archives/ ">
<i class=" fas fa-archive " style="color: rgb(10 189 227);"></i>
<span class="layui-nav-item-name">归档</span>
</a>
</li>
<li class="layui-nav-item">
<a href="/tags/ ">
<i class=" fas fa-hashtag " style="color: rgb(254 202 87);"></i>
<span class="layui-nav-item-name">标签</span>
</a>
</li>
<li class="layui-nav-item">
<a href="/categories ">
<i class=" far fa-folder-open " style="color: rgb(29 209 161);"></i>
<span class="layui-nav-item-name">分类</span>
</a>
</li>
<li class="layui-nav-item">
<a href="/about/ ">
<i class=" fab fa-grav " style="color: rgb(154 106 247);"></i>
<span class="layui-nav-item-name">关于</span>
</a>
</li>
<li class="layui-nav-item">
<a href="/guestbook/ ">
<i class=" fab fa-telegram " style="color: hsl(205deg 100% 50%);"></i>
<span class="layui-nav-item-name">留言</span>
</a>
</li>
<li class="layui-nav-item">
<a href="/links/ ">
<i class=" fab fa-weixin " style="color: hsl(152deg 73% 45%);"></i>
<span class="layui-nav-item-name">友链</span>
</a>
</li>
<li class="layui-nav-item">
<a href="/memos/ ">
<i class=" fas fa-coffee " style="color:#31c7c1;"></i>
<span class="layui-nav-item-name">说说</span>
</a>
</li>
<li class="layui-nav-item">
<a href="/fcircle/ ">
<i class=" fas fa-heart " style="color: rgb(29 209 161);"></i>
<span class="layui-nav-item-name">朋友圈</span>
</a>
</li>
<li class="layui-nav-item" id="btn-toggle-dark">🌙</li>
<span class="layui-nav-bar" style="left: 342px; top: 78px; width: 0px; opacity: 0;"></span>
</ul>
</div>
</div>
</div>
</div>
<header class="header">
<div class="logo">
<a href="/"><img src="https://img.imsun.org/avatar.jpg" onerror=this.onerror=null,this.src="/img/loading.gif"></a>
</div>
</div>
<div class="motto">
<span>曾梦想仗剑走天涯</span>
</div>
<div class="social">
<a class="social-icon" href="https://github.com/jkjoy" target="_blank" title="Github">
<i class="iconfont icon-GitHub" aria-hidden="true"></i>
</a>
<a class="social-icon" href="mailto:jkjoy@163.com" target="_blank" title="Email">
<i class="iconfont icon-email" aria-hidden="true"></i>
</a>
<a class="social-icon" href="https://steamcommunity.com/id/a2396837" target="_blank" title="Steam">
<i class="iconfont icon-steam" aria-hidden="true"></i>
</a>
<a class="social-icon" href="https://space.bilibili.com/8823569" target="_blank" title="Bilibili">
<i class="iconfont icon-bilibili" aria-hidden="true"></i>
</a>
<a class="social-icon" href="https://music.163.com/#/user/home?id=262078590" target="_blank" title="Netmusic">
<i class="iconfont icon-wangyiyunyinle1" aria-hidden="true"></i>
</a>
<a class="social-icon" href="/atom.xml" target="_blank" title="rss">
<i class="iconfont icon-rss" aria-hidden="true"></i>
</a>
</div>
</header>
<div id="recent-posts">
<div class="recent-post-item">
<div class="post-title ">
<a href="/posts/b5a1f33a.html">EasyPanel:一款使用Docker部署的VPS面板</a>
</div>
<div class="post-meta">
<div class="post-meta-item date">
<span title="发表于 2024.04.02"><i class="far fa-calendar-alt"></i> 2024.04.02</span>
</div>
<div class="post-meta-item updated">
<span title="更新于 2024.05.09"><i class="far fa-calendar-check"></i> 2024.05.09</span>
</div>
<div class="post-meta-item categories">
<i class="fas fa-inbox article-meta__icon"></i> <a href="/categories/%E5%88%86%E4%BA%AB/">分享</a>
</div>
<div class="post-meta-item wordcount">
<i class="fas fa-pencil-alt"></i> <span class="post-count">588 字</span>
<i class="far fa-clock"></i> <span class="post-count">2 分钟</span>
</div>
</div>
<div class="content">
<h2 id="EasyPanel"><a href="#EasyPanel" class="headerlink" title="EasyPanel"></a>EasyPanel</h2><p>官方网站 <code>EasyPanel.io</code> </p>
<p><code>EasyPanel</code>是一款基于<code>docker</code>的可视化面板. 拥有<code>付费</code><code>免费</code>两种模式</p>
<p>本文介绍以免费模式为主(主要是收费不菲)<br><img src= "/img/loading.gif" data-src="https://www.imsun.org/usr/uploads/2024/01/20240112071321641777.webp"></p>
<p>从首页的介绍可以看到他的特色就是通过直观的界面部署应用,管理数据库以及签发SSL证书.</p>
<h3 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h3><ul>
<li>建议在纯净的linux系统下安装</li>
</ul>
<p>通过命令行</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">curl -sSL https://get.easypanel.io | sh</span><br></pre></td></tr></table></figure>
<p>即可完成安装,官方给出的配置要求内存大于2G,根据实测,1G的vps运行起来问题也不大.</p>
<p>由于是容器化的部署方式,各个应用之间独立运行.NICE.</p>
<h3 id="使用"><a href="#使用" class="headerlink" title="使用"></a>使用</h3><h4 id="访问"><a href="#访问" class="headerlink" title="访问"></a>访问</h4><p>安装之后通过</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ip:3000</span><br></pre></td></tr></table></figure>
<p>访问面板,初次访问会要求创建管理员账号和密码.</p>
<h4 id="登录"><a href="#登录" class="headerlink" title="登录"></a>登录</h4><p>进入面板会发现很简洁<br><img src= "/img/loading.gif" data-src="https://www.imsun.org/usr/uploads/2024/01/20240112073049083915.webp" alt="进入面板"></p>
<h4 id="创建"><a href="#创建" class="headerlink" title="创建"></a>创建</h4><p>创建项目点击<code>Create Project</code>填写项目名称,确定,进入该项目</p>
<h4 id="模板"><a href="#模板" class="headerlink" title="模板"></a>模板</h4><p><img src= "/img/loading.gif" data-src="https://www.imsun.org/usr/uploads/2024/01/20240112074114481559.webp"></p>
<p>点击<code>templates</code>会发现这里有很多常用的应用模板,只要点击就可以部署.</p>
<p>譬如<code>memos</code> <code>uptime</code> <code>wordpress</code> <code>Flarum</code> <code>GoToSocial</code> <code>Umami</code> <code>Vaultwarden</code> 等上百款应用</p>
<h4 id="服务"><a href="#服务" class="headerlink" title="服务"></a>服务</h4><p>常见的模板应用大多都是全世界著名的应用.国内的某些应用,或者不是很常见的应用该如何部署</p>
<p>此处以<code>gatus</code>为例</p>
<p><img src= "/img/loading.gif" data-src="https://www.imsun.org/usr/uploads/2024/01/20240112074948886487.webp"> </p>
<p>点击<code>APP</code>,填写名称,确认 </p>
<p><img src= "/img/loading.gif" data-src="https://www.imsun.org/usr/uploads/2024/01/20240112075045277316.webp"> </p>
<p>点击<code>General</code><br><code>gatus</code>的docker镜像为<code>twinproduction/gatus:latest</code><br><code>Docker images</code>中填入<code>twinproduction/gatus:latest</code><br><code>SAVE</code>保存.<br><img src= "/img/loading.gif" data-src="https://www.imsun.org/usr/uploads/2024/01/20240112075239607243.webp"><br>点击<code>Domain</code>-<code>ADD Domain</code>-<code>HOST</code>填写域名</p>
<p><img src= "/img/loading.gif" data-src="https://www.imsun.org/usr/uploads/2024/01/20240112075722912648.webp"></p>
<p>全部填写完成之后,点<code>SAVE</code>保存. </p>
<p><img src= "/img/loading.gif" data-src="https://www.imsun.org/usr/uploads/2024/01/20240112080453993746.webp"> </p>
<p>点击<code>Advanced</code>-<code>Mounts</code>-<code>ADD VOLUME Mounts</code> </p>
<p><code>Name</code>为宿主机名称可以自己设置 </p>
<p><code>Mount Path</code>为Docker</p>
<p>挂载目录 <code>/data</code></p>
<p>点击<code>ADD File Mounts</code>,其中 <code>Mount Path</code>为挂载路径,此处填写为<code>/config/config.yaml</code> </p>
<p><code>Content</code>为yaml格式的配置文件 与 <code>config.yaml</code>内容对应 </p>
<p>以下为示例内容可自行修改</p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">storage:</span></span><br><span class="line"> <span class="attr">type:</span> <span class="string">sqlite</span></span><br><span class="line"> <span class="attr">path:</span> <span class="string">/data/data.db</span></span><br><span class="line"></span><br><span class="line"><span class="attr">ui:</span></span><br><span class="line"> <span class="attr">buttons:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="attr">name:</span> <span class="string">&quot;Home&quot;</span></span><br><span class="line"> <span class="attr">link:</span> <span class="string">&quot;https://www.imsun.org&quot;</span></span><br><span class="line"></span><br><span class="line"><span class="attr">endpoints:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="attr">name:</span> <span class="string">bloghb</span></span><br><span class="line"> <span class="attr">group:</span> <span class="string">core</span></span><br><span class="line"> <span class="attr">url:</span> <span class="string">&quot;https://blog.hb.cn&quot;</span></span><br><span class="line"> <span class="attr">interval:</span> <span class="string">3m</span></span><br><span class="line"> <span class="attr">conditions:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">&quot;[STATUS] == 200&quot;</span></span><br><span class="line"></span><br><span class="line"> <span class="bullet">-</span> <span class="attr">name:</span> <span class="string">blogcn</span></span><br><span class="line"> <span class="attr">group:</span> <span class="string">core</span></span><br><span class="line"> <span class="attr">url:</span> <span class="string">&quot;https://blog.asbid.cn&quot;</span></span><br><span class="line"> <span class="attr">interval:</span> <span class="string">3m</span></span><br><span class="line"> <span class="attr">conditions:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">&quot;[STATUS] == 200&quot;</span></span><br><span class="line"></span><br><span class="line"> <span class="bullet">-</span> <span class="attr">name:</span> <span class="string">blogsd</span></span><br><span class="line"> <span class="attr">group:</span> <span class="string">core</span></span><br><span class="line"> <span class="attr">url:</span> <span class="string">&quot;https://blog.sd.cn&quot;</span></span><br><span class="line"> <span class="attr">interval:</span> <span class="string">3m</span></span><br><span class="line"> <span class="attr">conditions:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">&quot;[STATUS] == 200&quot;</span></span><br></pre></td></tr></table></figure>
<p>点击<code>SAVE</code>保存 </p>
<p><img src= "/img/loading.gif" data-src="https://www.imsun.org/usr/uploads/2024/01/20240112081537297595.webp"></p>
<p>点击<code>Deploy</code>. </p>
<p>完成部署 别忘记在DNS处解析域名</p>
<h3 id="gatus演示"><a href="#gatus演示" class="headerlink" title="gatus演示"></a>gatus演示</h3><p><a target="_blank" rel="noopener" href="https://status.0tz.top/">https://status.0tz.top/</a></p>
<h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><p>优势:不用折腾反代,不用担心证书到期,常用应用傻瓜式部署</p>
</div>
</div>
<div class="post-footer">
</div>
<div class="recent-post-item">
<div class="post-title ">
<a href="/posts/5f4f3026.html">巨械师X99主板/E5 2680 V4/RX5600XT 6G/1TB SSD/BCM94360CS[OpenCore引导]</a>
</div>
<div class="post-meta">
<div class="post-meta-item date">
<span title="发表于 2024.03.15"><i class="far fa-calendar-alt"></i> 2024.03.15</span>
</div>
<div class="post-meta-item updated">
<span title="更新于 2024.05.09"><i class="far fa-calendar-check"></i> 2024.05.09</span>
</div>
<div class="post-meta-item categories">
<i class="fas fa-inbox article-meta__icon"></i> <a href="/categories/%E5%88%86%E4%BA%AB/">分享</a>
</div>
<div class="post-meta-item wordcount">
<i class="fas fa-pencil-alt"></i> <span class="post-count">168 字</span>
<i class="far fa-clock"></i> <span class="post-count">1 分钟</span>
</div>
</div>
<div class="content">
<h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>年后配的黑苹果主机,主要是因为英特尔的12 13 14代CPU开始挤牙膏,且价格高居不下.<br>于是攒出这套配置,用于处理多核心任务.<br>总体价格2300左右,差不多一台M1 Macmini标配的价格.</p>
<h2 id="配置"><a href="#配置" class="headerlink" title="配置"></a>配置</h2><table>
<thead>
<tr>
<th align="center">配件</th>
<th align="center">名称</th>
</tr>
</thead>
<tbody><tr>
<td align="center">主板</td>
<td align="center">巨械师X99M</td>
</tr>
<tr>
<td align="center">CPU</td>
<td align="center">E5 2680 V4</td>
</tr>
<tr>
<td align="center">内存</td>
<td align="center">三星DDR4 64G ECC</td>
</tr>
<tr>
<td align="center">硬盘</td>
<td align="center">梵想1TB SSD</td>
</tr>
<tr>
<td align="center">显卡</td>
<td align="center">蓝宝石RX5600XT 6G</td>
</tr>
<tr>
<td align="center">机箱</td>
<td align="center">鱼巢S5</td>
</tr>
<tr>
<td align="center">电源</td>
<td align="center">长城额定700W金牌</td>
</tr>
<tr>
<td align="center">网卡</td>
<td align="center">BCM94360CS2</td>
</tr>
<tr>
<td align="center">散热器</td>
<td align="center"></td>
</tr>
</tbody></table>
<h2 id="说明"><a href="#说明" class="headerlink" title="说明"></a>说明</h2><p>BIOS 设置</p>
<p>需关闭</p>
<p>[ ] - CFG LOCK</p>
<p>[ ] - CSM 兼容</p>
<p>需打开</p>
<p>[x] - Above 4G Decoding</p>
<h2 id="引导下载"><a href="#引导下载" class="headerlink" title="引导下载"></a>引导下载</h2><p>EFI</p>
<p> <a target="_blank" rel="noopener" href="https://pan.sgcd.net/189/%E5%B7%A8%E6%A2%B0%E5%B8%88X99EFI.zip">https://pan.sgcd.net/189/%E5%B7%A8%E6%A2%B0%E5%B8%88X99EFI.zip</a></p>
</div>
</div>
<div class="post-footer">
</div>
<div class="recent-post-item">
<div class="post-title ">
<a href="/posts/b50cb9c4.html">关于网络发展的随笔</a>
</div>
<div class="post-meta">
<div class="post-meta-item date">
<span title="发表于 2023.11.08"><i class="far fa-calendar-alt"></i> 2023.11.08</span>
</div>
<div class="post-meta-item updated">
<span title="更新于 2024.05.09"><i class="far fa-calendar-check"></i> 2024.05.09</span>
</div>
<div class="post-meta-item categories">
<i class="fas fa-inbox article-meta__icon"></i> <a href="/categories/%E9%9A%8F%E7%AC%94/">随笔</a>
</div>
<div class="post-meta-item wordcount">
<i class="fas fa-pencil-alt"></i> <span class="post-count">922 字</span>
<i class="far fa-clock"></i> <span class="post-count">3 分钟</span>
</div>
</div>
<div class="content">
<p>短视频的兴起其实是有迹可循的.</p>
<p>至少从我这个<code>资深</code>网民的眼光来看,是这样的.</p>
<p>我觉得人类基本都是视觉生物,任何类型的刺激都不如视觉上带来的感官刺激更甚.</p>
<p>互联网<code>毒药</code>从古早的文字到图片,然后到多媒体,最后到短视频.这些都是基于视觉带来的刺激升级.</p>
<p>当然这跟互联网的技术发展也是有很大的关系.</p>
<p>早先的互联网主要以文字为主.主要是因为当时的上网方式以电话线拨号为主,费用及其昂贵,带宽也是有限,于是有了多图杀猫的说法.</p>
<p>待到互联网普及的阶段,有了宽带,此时图片这种比文字还要刺激感官的方式便开始流行,各种论坛贴吧都充斥着各种类型的图片.还有当时各种资源网站发布的压缩视频文档.这时是P2P发展的黄金时期.</p>
<p>等到版权意识增加,此类资源网站渐渐退出主流视野,此时各大视频网站开始兴起,各种自制的短剧也取得了不错的口碑也收视.</p>
<p>最早的视频博客,就是现在的youtuber和up主.</p>
<p>当时土豆网就是其中翘楚.<br>我记得当时有很多录播的当红的台剧偶像剧都在土豆网上可以看.都是由个人或者粉丝上传的.<br>也有很多优秀的自制的视频,大多是搞笑的段子和模仿,恶搞.<br>当时恶搞<code>无极</code><code>胡戈</code>,<code>一个馒头引发的血案</code>.<br>后来还有结合实事的<code>鸟笼山剿匪记</code>.</p>
<p><code>叫兽易小星</code><code>杨迪</code>就是从这个时候横空出世的.</p>
<p>我记得当时过最屌的吐槽就是<code>老湿</code>的 评西游记,还有<code>卢正雨</code><code>嘻哈四重奏</code>.</p>
<p>优酷和土豆合并之后,<code>叫兽易小星</code><code>老湿</code>成立的<code>万合天宜</code>的自制短剧<code>万万没想到</code>.</p>
<p>待到了4G 5G的普及,移动互联网成了网络大军的主力.<br>手机这种更加便携更加简单的设备就成了人们网上冲浪的主要工具.</p>
<p>短视频的出现则利用了人们的碎片时间,加上更加成熟的大数据支持,更是让人愈发欲罢不能.</p>
<p>我有几个朋友以前是倾向于微博这种文字类社交媒体的.<br>最早我们认识也是在论坛上.<br>如今,都不怎么用<code>微博</code>了.常用的APP也变成了<code>小红书</code><code>抖音</code>.</p>
<p>现在短视频平台上集合了各类内容,更容易获取到信息,也容易被各种真真假假的视频误导.</p>
<p>如今最让人离谱的就是各种带货直播以各种形式出现,有的就是演一出小短剧.</p>
<p>有的直播象棋,突然就给你整一出卖酒的操作来.</p>
<p>我有个老叔已经六十多了整天看人下棋直播,天天听人卖酒带货,把我整不会了.<br>图啥呢.明知道是假的,还整天看.</p>
<p>我外公八十多岁了,在抖音上到有老中医推荐什么偏方,他竟然用笔都抄下来了,然后当真去买了煮.<br>若不是没有什么副作用,我都不敢想象.</p>
<p>平台若是不监管,出了什么事情,平台是要承担主要责任的.<br>不能钱让平台赚了,出了事跟平台无关,这就说不过去了.</p>
</div>
</div>
<div class="post-footer">
</div>
<div class="recent-post-item">
<div class="post-title ">
<a href="/posts/ebf565b6.html">使用Docker快速部署mastodon实例</a>
</div>
<div class="post-meta">
<div class="post-meta-item date">
<span title="发表于 2023.10.30"><i class="far fa-calendar-alt"></i> 2023.10.30</span>
</div>
<div class="post-meta-item updated">
<span title="更新于 2024.05.09"><i class="far fa-calendar-check"></i> 2024.05.09</span>
</div>
<div class="post-meta-item categories">
<i class="fas fa-inbox article-meta__icon"></i> <a href="/categories/%E5%88%86%E4%BA%AB/">分享</a>
</div>
<div class="post-meta-item wordcount">
<i class="fas fa-pencil-alt"></i> <span class="post-count">308 字</span>
<i class="far fa-clock"></i> <span class="post-count">1 分钟</span>
</div>
</div>
<div class="content">
<h2 id="如何使用Docker快速部署mastodon实例"><a href="#如何使用Docker快速部署mastodon实例" class="headerlink" title="如何使用Docker快速部署mastodon实例"></a>如何使用Docker快速部署mastodon实例</h2><p>直接使用docker compose部署是不可行的,需要按照步骤进行</p>
<h3 id="创建目录"><a href="#创建目录" class="headerlink" title="创建目录"></a>创建目录</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mkdir -p /home/mastodon/mastodon</span><br></pre></td></tr></table></figure>
<h3 id="进入目录"><a href="#进入目录" class="headerlink" title="进入目录"></a>进入目录</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cd /home/mastodon/mastodon</span><br></pre></td></tr></table></figure>
<h3 id="拉取镜像"><a href="#拉取镜像" class="headerlink" title="拉取镜像"></a>拉取镜像</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker pull ghcr.io/mastodon/mastodon</span><br></pre></td></tr></table></figure>
<h3 id="修改docker-compose配置文件"><a href="#修改docker-compose配置文件" class="headerlink" title="修改docker compose配置文件"></a>修改docker compose配置文件</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">wget https://raw.githubusercontent.com/mastodon/mastodon/main/docker-compose.yml</span><br></pre></td></tr></table></figure>
<p>修改<code>docker compose</code>文件中的版本号</p>
<h3 id="初始化PostgreSQL"><a href="#初始化PostgreSQL" class="headerlink" title="初始化PostgreSQL"></a>初始化PostgreSQL</h3><ul>
<li>重要!!!!!<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker run --name postgres14 -v /home/mastodon/mastodon/postgres14:/var/lib/postgresql/data -e POSTGRES_PASSWORD=设置数据库管理员密码 --rm -d postgres:14-alpine</span><br></pre></td></tr></table></figure>
进入数据库<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker exec -it postgres14 psql -U postgres</span><br></pre></td></tr></table></figure>
创建用户名mastodon的密码<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">CREATE USER mastodon WITH PASSWORD &#x27;数据库密码(最好和数据库管理员密码不一样)&#x27; CREATEDB;</span><br></pre></td></tr></table></figure>
停止docker<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker stop postgres14</span><br></pre></td></tr></table></figure></li>
</ul>
<h3 id="配置Mastodon"><a href="#配置Mastodon" class="headerlink" title="配置Mastodon"></a>配置Mastodon</h3><p><code>/home/mastodon/mastodon</code>根文件夹中创建空白<code>.env.production</code>文件</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cd /home/mastodon/mastodon</span><br><span class="line">touch .env.production</span><br></pre></td></tr></table></figure>
<p>运行引导</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker-compose run --rm web bundle exec rake mastodon:setup</span><br></pre></td></tr></table></figure>
<p>按照提示进行操作<br><code>Below is your configuration, save it to an .env.production file outside Docker:</code>之后会出现配置文件的数据,复制下来<br>写入<code>.env.production</code></p>
<p>启动Mastodon</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">docker-compose down</span><br><span class="line">docker-compose up -d</span><br></pre></td></tr></table></figure>
<p>文件夹赋权</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">chown 991:991 -R ./public</span><br><span class="line">chown -R 70:70 ./postgres14</span><br><span class="line">docker-compose down</span><br><span class="line">docker-compose up -d</span><br></pre></td></tr></table></figure>
<p>创建管理员</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker exec mastodon-web-1 tootctl accounts create USERNAME --email EMAIL --confirmed --role Owner</span><br></pre></td></tr></table></figure>
<p>至此完成</p>
</div>
</div>
<div class="post-footer">
</div>
<div class="recent-post-item">
<div class="post-title ">
<a href="/posts/d29d6713.html">快速部署misskey实例</a>
</div>
<div class="post-meta">
<div class="post-meta-item date">
<span title="发表于 2023.10.11"><i class="far fa-calendar-alt"></i> 2023.10.11</span>
</div>
<div class="post-meta-item updated">
<span title="更新于 2024.05.09"><i class="far fa-calendar-check"></i> 2024.05.09</span>
</div>
<div class="post-meta-item categories">
<i class="fas fa-inbox article-meta__icon"></i> <a href="/categories/%E5%88%86%E4%BA%AB/">分享</a>
</div>
<div class="post-meta-item wordcount">
<i class="fas fa-pencil-alt"></i> <span class="post-count">368 字</span>
<i class="far fa-clock"></i> <span class="post-count">1 分钟</span>
</div>
</div>
<div class="content">
<h2 id="使用官方推荐一键脚本"><a href="#使用官方推荐一键脚本" class="headerlink" title="使用官方推荐一键脚本"></a>使用官方推荐一键脚本</h2><p>使用纯净的Ubuntu系统安装,推荐配置双核心四线程.</p>
<h3 id="更新软件"><a href="#更新软件" class="headerlink" title="更新软件"></a>更新软件</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt update; sudo apt full-upgrade -y; sudo reboot</span><br></pre></td></tr></table></figure>
<h3 id="一键脚本"><a href="#一键脚本" class="headerlink" title="一键脚本"></a>一键脚本</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">wget https://raw.githubusercontent.com/joinmisskey/bash-install/main/ubuntu.sh -O ubuntu.sh; sudo bash ubuntu.sh</span><br></pre></td></tr></table></figure>
<p>按照提示输入内容</p>
<h3 id="更新misskey脚本"><a href="#更新misskey脚本" class="headerlink" title="更新misskey脚本"></a>更新misskey脚本</h3><p>更新 Misskey 的脚本不会升级运行环境。 对于脚本的更新内容,另请参阅 “更新日志”</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">wget https://raw.githubusercontent.com/joinmisskey/bash-install/main/update.ubuntu.sh -O update.sh</span><br></pre></td></tr></table></figure>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo bash update.sh</span><br></pre></td></tr></table></figure>
<ul>
<li>使用 systemd 的小伙伴, 添加 -r 可以更新并重启系统。</li>
<li>使用 docker 的小伙伴, 可以特定软件包版本 repository:tag 来更新。</li>
</ul>
<h2 id="使用docker-compose部署"><a href="#使用docker-compose部署" class="headerlink" title="使用docker compose部署"></a>使用docker compose部署</h2><h3 id="环境"><a href="#环境" class="headerlink" title="环境"></a>环境</h3><ul>
<li>git</li>
<li>docker</li>
<li>nginx</li>
</ul>
<h3 id="步骤"><a href="#步骤" class="headerlink" title="步骤"></a>步骤</h3><h4 id="git克隆仓库"><a href="#git克隆仓库" class="headerlink" title="git克隆仓库"></a>git克隆仓库</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">cd /opt</span><br><span class="line">git clone -b master https://github.com/misskey-dev/misskey.git</span><br><span class="line">cd misskey</span><br><span class="line">git checkout master</span><br></pre></td></tr></table></figure>
<h4 id="复制配置文件:"><a href="#复制配置文件:" class="headerlink" title="复制配置文件:"></a>复制配置文件:</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">cp .config/example.yml .config/default.yml</span><br><span class="line">cp .config/docker_example.env .config/docker.env</span><br><span class="line">cp docker-compose.yml.example docker-compose.yml</span><br></pre></td></tr></table></figure>
<h4 id="编辑default-yml中"><a href="#编辑default-yml中" class="headerlink" title="编辑default.yml中"></a>编辑default.yml中</h4><p><code>url</code>设置为实例域名<br>db:<code>host</code>设置为<code>db</code><br>redis:<code>host</code>设置为<code>redis</code></p>
<h4 id="构建镜像"><a href="#构建镜像" class="headerlink" title="构建镜像"></a>构建镜像</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">docker compose build</span><br><span class="line">docker compose run --rm web yarn run init</span><br></pre></td></tr></table></figure>
<p>完成之后</p>
<h4 id="启动容器"><a href="#启动容器" class="headerlink" title="启动容器"></a>启动容器</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker compose up -d</span><br></pre></td></tr></table></figure>
<h4 id="反向代理"><a href="#反向代理" class="headerlink" title="反向代理"></a>反向代理</h4><p>参考以下</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line">map $http_upgrade $connection_upgrade &#123;</span><br><span class="line"> default upgrade;</span><br><span class="line"> &#x27;&#x27; close;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">proxy_cache_path /tmp/nginx_cache levels=1:2 keys_zone=cache1:16m max_size=1g inactive=720m use_temp_path=off;</span><br><span class="line"></span><br><span class="line">server &#123;</span><br><span class="line"> listen 80;</span><br><span class="line"> listen [::]:80;</span><br><span class="line"> server_name misskey.example.com;</span><br><span class="line"> client_max_body_size 0;</span><br><span class="line"></span><br><span class="line"> location / &#123;</span><br><span class="line"> proxy_pass http://127.0.0.1:3000;</span><br><span class="line"> proxy_set_header Host $host;</span><br><span class="line"> proxy_http_version 1.1;</span><br><span class="line"> proxy_redirect off;</span><br><span class="line"></span><br><span class="line"> proxy_set_header X-Real-IP $remote_addr;</span><br><span class="line"> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</span><br><span class="line"> proxy_set_header X-Forwarded-Proto https;</span><br><span class="line"></span><br><span class="line"> proxy_set_header Upgrade $http_upgrade;</span><br><span class="line"> proxy_set_header Connection $connection_upgrade;</span><br><span class="line"></span><br><span class="line"> proxy_cache cache1;</span><br><span class="line"> proxy_cache_lock on;</span><br><span class="line"> proxy_cache_use_stale updating;</span><br><span class="line"> add_header X-Cache $upstream_cache_status;</span><br><span class="line"> &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</div>
</div>
<div class="post-footer">
</div>
<div class="recent-post-item">
<div class="post-title ">
<a href="/posts/1adc954a.html">测试xiuno2Sforum中遇到的各种问题</a>
</div>
<div class="post-meta">
<div class="post-meta-item date">
<span title="发表于 2023.10.06"><i class="far fa-calendar-alt"></i> 2023.10.06</span>
</div>
<div class="post-meta-item updated">
<span title="更新于 2024.05.09"><i class="far fa-calendar-check"></i> 2024.05.09</span>
</div>
<div class="post-meta-item categories">
<i class="fas fa-inbox article-meta__icon"></i> <a href="/categories/%E5%88%86%E4%BA%AB/">分享</a>
</div>
<div class="post-meta-item wordcount">
<i class="fas fa-pencil-alt"></i> <span class="post-count">499 字</span>
<i class="far fa-clock"></i> <span class="post-count">2 分钟</span>
</div>
</div>
<div class="content">
<p>想把<code>xiuno</code>bbs数据转换成<code>SForum</code>,由于最新版本的<code>SForum</code>没有转换工具支持<br>于是采用<code>Sforum</code> v2.2.2测试</p>
<h1 id="测试环境"><a href="#测试环境" class="headerlink" title="测试环境"></a>测试环境</h1><ul>
<li>Ubuntu 22.0.4</li>
<li>php8.0</li>
<li>mariadb10.6</li>
<li>composer</li>
<li>redis</li>
<li>nginx or apache</li>
</ul>
<h2 id="测试程序"><a href="#测试程序" class="headerlink" title="测试程序"></a>测试程序</h2><p>sforum v2.2.2</p>
<p>xiuno2sforum v2.2.2</p>
<h2 id="PHP"><a href="#PHP" class="headerlink" title="PHP"></a>PHP</h2><h3 id="安装PPA-源"><a href="#安装PPA-源" class="headerlink" title="安装PPA 源"></a>安装PPA 源</h3><p>需要使用 PPA 源安装:</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo add-apt-repository ppa:ondrej/php</span><br><span class="line">sudo apt-get update</span><br></pre></td></tr></table></figure>
<h4 id="安装php8-0"><a href="#安装php8-0" class="headerlink" title="安装php8.0"></a>安装php8.0</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">apt install php8.0</span><br></pre></td></tr></table></figure>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">apt install -y php8.0-dev</span><br></pre></td></tr></table></figure>
<h4 id="安装拓展"><a href="#安装拓展" class="headerlink" title="安装拓展"></a>安装拓展</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">apt install php8.0-curl php8.0-xml php8.0-gd php8.0-mbstring php8.0-redis php8.0-swoole php8.0-bcmath</span><br></pre></td></tr></table></figure>
<h3 id="查看php版本"><a href="#查看php版本" class="headerlink" title="查看php版本"></a>查看php版本</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">php -v</span><br></pre></td></tr></table></figure>
<p>查看拓展</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">php -m</span><br></pre></td></tr></table></figure>
<h3 id="切换PHP版本"><a href="#切换PHP版本" class="headerlink" title="切换PHP版本"></a>切换PHP版本</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">update-alternatives --config php</span><br></pre></td></tr></table></figure>
<p>切换到</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">update-alternatives --set php /usr/bin/php8.0</span><br></pre></td></tr></table></figure>
<h3 id="PHP-扩展-ZipArchive"><a href="#PHP-扩展-ZipArchive" class="headerlink" title="PHP 扩展 ZipArchive"></a>PHP 扩展 ZipArchive</h3><p>上传压缩包提示500错误,打开日志发现是缺少组件</p>
<h4 id="服务器上存在多个php版本手动指定php-config文件"><a href="#服务器上存在多个php版本手动指定php-config文件" class="headerlink" title="服务器上存在多个php版本手动指定php-config文件"></a>服务器上存在多个php版本手动指定php-config文件</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">./configure --with-php-config=/www/server/php/73/bin/php-config</span><br></pre></td></tr></table></figure>
<h4 id="安装ZipArchive扩展"><a href="#安装ZipArchive扩展" class="headerlink" title="安装ZipArchive扩展"></a>安装ZipArchive扩展</h4><h5 id="编译ZipArchive"><a href="#编译ZipArchive" class="headerlink" title="编译ZipArchive"></a>编译<code>ZipArchive</code></h5><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">cd ~</span><br><span class="line">wget http://pecl.php.net/get/zip</span><br><span class="line">tar -zxvf zip</span><br><span class="line">cd zip-x.x.x</span><br><span class="line">phpize</span><br><span class="line">./configure</span><br><span class="line">make</span><br><span class="line">make install</span><br></pre></td></tr></table></figure>
<h4 id="成功安装zip之后会返回一个路径"><a href="#成功安装zip之后会返回一个路径" class="headerlink" title="成功安装zip之后会返回一个路径"></a>成功安装zip之后会返回一个路径</h4><p>类似</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Installing shared extensions: /www/server/php/8/lib/php/extensions/no-debug-non-zts-20180731/</span><br></pre></td></tr></table></figure>
<h4 id="加到php-ini中"><a href="#加到php-ini中" class="headerlink" title="加到php.ini中"></a>加到php.ini中</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">extension=/www/server/php/8/lib/php/extensions/no-debug-non-zts-20180731/zip.so</span><br></pre></td></tr></table></figure>
<p><br><code>php.ini</code>中添加</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">extension=zip.so</span><br></pre></td></tr></table></figure>
<h4 id="提示checking-for-libzip-not-found"><a href="#提示checking-for-libzip-not-found" class="headerlink" title="提示checking for libzip... not found"></a>提示<code>checking for libzip... not found</code></h4><h5 id="编译libzip"><a href="#编译libzip" class="headerlink" title="编译libzip"></a>编译<code>libzip</code></h5><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">wget https://libzip.org/download/libzip-1.3.2.tar.gz</span><br><span class="line">tar xvf libzip-1.3.2.tar.gz</span><br><span class="line">cd libzip-1.3.2</span><br><span class="line">./configure</span><br><span class="line">make</span><br><span class="line">make install</span><br><span class="line">export PKG_CONFIG_PATH=&quot;/usr/local/lib/pkgconfig/&quot; </span><br></pre></td></tr></table></figure>
<h3 id="在使用插件转换数据中一直报错无法使用的class-medoo"><a href="#在使用插件转换数据中一直报错无法使用的class-medoo" class="headerlink" title="在使用插件转换数据中一直报错无法使用的class medoo"></a>在使用插件转换数据中一直报错无法使用的class medoo</h3><p>所以使用cpmposer安装</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">composer require catfan/Medoo</span><br></pre></td></tr></table></figure>
<h2 id="mariadb"><a href="#mariadb" class="headerlink" title="mariadb"></a>mariadb</h2><h3 id="创建数据库"><a href="#创建数据库" class="headerlink" title="创建数据库"></a>创建数据库</h3><p><a target="_blank" rel="noopener" href="https://www.jkjoy.cn/2023/dfdf0a76.html">Mariadb创建数据库、用户及授权</a></p>
<h3 id="数据导入"><a href="#数据导入" class="headerlink" title="数据导入"></a>数据导入</h3><p>导入sql备份文件</p>
<p>进入数据库</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mysql -uroot -p</span><br></pre></td></tr></table></figure>
<p>使用数据库bbs</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">use bbs</span><br></pre></td></tr></table></figure>
<p>导入sql路径</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">source /root/bbs.sql;</span><br></pre></td></tr></table></figure>
<h2 id="安装-Redis"><a href="#安装-Redis" class="headerlink" title="安装 Redis"></a>安装 Redis</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">apt install redis-server</span><br></pre></td></tr></table></figure>
<h2 id="安装-Nginx"><a href="#安装-Nginx" class="headerlink" title="安装 Nginx"></a>安装 Nginx</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">apt install nginx</span><br></pre></td></tr></table></figure>
<h2 id="安装composer"><a href="#安装composer" class="headerlink" title="安装composer"></a>安装composer</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">apt install git zip unzip</span><br><span class="line">curl -sS https://getcomposer.org/installer | php</span><br><span class="line">mv composer.phar /usr/local/bin/composer</span><br><span class="line">chmod +x /usr/local/bin/composer</span><br></pre></td></tr></table></figure>
<h2 id="安装SForum-v2-2-2"><a href="#安装SForum-v2-2-2" class="headerlink" title="安装SForum v2.2.2"></a>安装SForum v2.2.2</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">composer create-project zhuchunshu/sforum=v2.2.2 sforum</span><br></pre></td></tr></table></figure>
<p>进入安装目录,</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cd sforum</span><br></pre></td></tr></table></figure>
<p>按照提示,连续执行命令即可完成安装(启动服务也是此命令):</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">php CodeFec CodeFec</span><br></pre></td></tr></table></figure>
</div>
</div>
<div class="post-footer">
</div>
<div class="recent-post-item">
<div class="post-title ">
<a href="/posts/dfdf0a76.html">Mariadb创建数据库、用户及授权</a>
</div>
<div class="post-meta">
<div class="post-meta-item date">
<span title="发表于 2023.10.06"><i class="far fa-calendar-alt"></i> 2023.10.06</span>
</div>
<div class="post-meta-item updated">
<span title="更新于 2024.05.09"><i class="far fa-calendar-check"></i> 2024.05.09</span>
</div>
<div class="post-meta-item categories">
<i class="fas fa-inbox article-meta__icon"></i> <a href="/categories/%E5%88%86%E4%BA%AB/">分享</a>
</div>
<div class="post-meta-item wordcount">
<i class="fas fa-pencil-alt"></i> <span class="post-count">270 字</span>
<i class="far fa-clock"></i> <span class="post-count">1 分钟</span>
</div>
</div>
<div class="content">
<p>在测试<code>SForum</code>程序中使用到的部分关于数据库的操作</p>
<h2 id="安装Mariadb服务器"><a href="#安装Mariadb服务器" class="headerlink" title="安装Mariadb服务器"></a>安装Mariadb服务器</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">apt install mariadb-server-10.6</span><br></pre></td></tr></table></figure>
<h2 id="初始化数据库"><a href="#初始化数据库" class="headerlink" title="初始化数据库"></a>初始化数据库</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mysql_secure_installation</span><br></pre></td></tr></table></figure>
<h2 id="连接数据库"><a href="#连接数据库" class="headerlink" title="连接数据库"></a>连接数据库</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mysql -u root -p </span><br></pre></td></tr></table></figure>
<h2 id="创建数据库"><a href="#创建数据库" class="headerlink" title="创建数据库"></a>创建数据库</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">CREATE DATABASE bbs;</span><br></pre></td></tr></table></figure>
<h2 id="创建一个本地访问数据库的账户"><a href="#创建一个本地访问数据库的账户" class="headerlink" title="创建一个本地访问数据库的账户"></a>创建一个本地访问数据库的账户</h2><h3 id="创建用户"><a href="#创建用户" class="headerlink" title="创建用户"></a>创建用户</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">CREATE USER &#x27;username&#x27;@&#x27;localhost&#x27; IDENTIFIED BY &#x27;password&#x27;;</span><br></pre></td></tr></table></figure>
<h3 id="参数:"><a href="#参数:" class="headerlink" title="参数:"></a>参数:</h3><p><code>username</code>:数据库访问的账户;<code>localhost</code>:数据库的访问方式,外网访问的时候用%替换localhost即可<code>password</code>:数据库访问密码,此处输入密码明文;</p>
<h2 id="给测试账户分配权限"><a href="#给测试账户分配权限" class="headerlink" title="给测试账户分配权限"></a>给测试账户分配权限</h2><h3 id="分配所有权限"><a href="#分配所有权限" class="headerlink" title="分配所有权限"></a>分配所有权限</h3><p>给用户分配所有的权限并且通过localhost访问</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">GRANT ALL ON bbs.* to username@&#x27;localhost&#x27; IDENTIFIED BY &#x27;password&#x27;;</span><br><span class="line">FLUSH privileges;</span><br></pre></td></tr></table></figure>
<h3 id="分配部分权限"><a href="#分配部分权限" class="headerlink" title="分配部分权限"></a>分配部分权限</h3><h4 id="给账户分配部分的权限,并且通过外网访问"><a href="#给账户分配部分的权限,并且通过外网访问" class="headerlink" title="给账户分配部分的权限,并且通过外网访问"></a>给账户分配部分的权限,并且通过外网访问</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">GRANT insert,delete,select,update ON test.* to username@&#x27;%&#x27; IDENTIFIED BY &#x27;password&#x27;;</span><br><span class="line">FLUSH privileges;</span><br></pre></td></tr></table></figure>
<h4 id="或则采用下面的代码,除了操作权限授权外,还赋予授权的权限。"><a href="#或则采用下面的代码,除了操作权限授权外,还赋予授权的权限。" class="headerlink" title="或则采用下面的代码,除了操作权限授权外,还赋予授权的权限。"></a>或则采用下面的代码,除了操作权限授权外,还赋予授权的权限。</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">GRANT ALL ON test.* to username@&#x27;%&#x27; IDENTIFIED BY &#x27;passowrd&#x27; WITH GRANT OPTION;</span><br><span class="line">FLUSH privileges;</span><br></pre></td></tr></table></figure>
</div>
</div>
<div class="post-footer">
</div>
<div class="recent-post-item">
<div class="post-title ">
<a href="/posts/eb6a87ce.html">centos在yum时出现Determining fastest mirrors</a>
</div>
<div class="post-meta">
<div class="post-meta-item date">
<span title="发表于 2023.10.05"><i class="far fa-calendar-alt"></i> 2023.10.05</span>
</div>
<div class="post-meta-item updated">
<span title="更新于 2024.05.09"><i class="far fa-calendar-check"></i> 2024.05.09</span>
</div>
<div class="post-meta-item categories">
<i class="fas fa-inbox article-meta__icon"></i> <a href="/categories/%E5%88%86%E4%BA%AB/">分享</a>
</div>
<div class="post-meta-item wordcount">
<i class="fas fa-pencil-alt"></i> <span class="post-count">252 字</span>
<i class="far fa-clock"></i> <span class="post-count">1 分钟</span>
</div>
</div>
<div class="content">
<h2 id="问题1"><a href="#问题1" class="headerlink" title="问题1"></a>问题1</h2><p><code>yum makecache</code>时,停在<code>Determining fastest mirrors</code>一直在判断最快镜像由于已经指定了yum源所以不需要些插件可以用动禁用。</p>
<p>解决方法:</p>
<p>修改<code>/etc/yum/pluginconf.d/fastestmirror.conf</code>里面的<code>enabled=0</code></p>
<p>修改<code>/etc/yum.conf</code>里面的<code>plugins=0</code></p>
<p>问题解决。</p>
<h2 id="问题2"><a href="#问题2" class="headerlink" title="问题2"></a>问题2</h2><p>Could not retrieve mirrorlist <a target="_blank" rel="noopener" href="http://mirrors.elrepo.org/mirrors-elrepo.el7">http://mirrors.elrepo.org/mirrors-elrepo.el7</a> error was<br>12: Timeout on <a target="_blank" rel="noopener" href="http://mirrors.elrepo.org/mirrors-elrepo.el7">http://mirrors.elrepo.org/mirrors-elrepo.el7</a>: (28, Connection timed out after 30001 milliseconds)</p>
<p>镜像列表<a target="_blank" rel="noopener" href="http://mirrors.elrepo.org/mirrors-elrepo.el7">http://mirrors.elrepo.org/mirrors-elrepo.el7</a> 的地址无法访问</p>
<p>解决方法</p>
<p>更新ELRepo 软件仓库镜像<br>首先按照官网的安装说明,配置 ELRepo</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org</span><br></pre></td></tr></table></figure>
<p>按照你的系统版本,运行:</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm</span><br></pre></td></tr></table></figure>
<p>接下来是换源,建议先备份 <code>/etc/yum.repos.d/elrepo.repo</code> </p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cp /etc/yum.repos.d/elrepo.repo /etc/yum.repos.d/elrepo.repo.bak</span><br></pre></td></tr></table></figure>
<p>然后编辑<code> /etc/yum.repos.d/elrepo.repo</code> 文件,在 <code>mirrorlist= </code>后的地址替换为</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https://mirrors.tuna.tsinghua.edu.cn/elrepo</span><br></pre></td></tr></table></figure>
<p>最后,更新软件包缓存</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">yum makecache</span><br></pre></td></tr></table></figure>
</div>
</div>
<div class="post-footer">
</div>
<div class="recent-post-item">
<div class="post-title ">
<a href="/posts/57ea9005.html">Docker部署Activity-Relay服务</a>
</div>
<div class="post-meta">
<div class="post-meta-item date">
<span title="发表于 2023.10.03"><i class="far fa-calendar-alt"></i> 2023.10.03</span>
</div>
<div class="post-meta-item updated">
<span title="更新于 2024.05.09"><i class="far fa-calendar-check"></i> 2024.05.09</span>
</div>
<div class="post-meta-item categories">
<i class="fas fa-inbox article-meta__icon"></i> <a href="/categories/%E5%88%86%E4%BA%AB/">分享</a>
</div>
<div class="post-meta-item wordcount">
<i class="fas fa-pencil-alt"></i> <span class="post-count">337 字</span>
<i class="far fa-clock"></i> <span class="post-count">1 分钟</span>
</div>
</div>
<div class="content">
<ul>
<li>经过测试国内部署会有无法通讯的问题.</li>
</ul>
<h2 id="测试环境"><a href="#测试环境" class="headerlink" title="测试环境"></a>测试环境</h2><p>centos7.9</p>
<h2 id="准备工作"><a href="#准备工作" class="headerlink" title="准备工作"></a>准备工作</h2><ul>
<li>git</li>
<li>openssl</li>
<li>nginx</li>
<li>docker</li>
<li>docker-compose</li>
</ul>
<h2 id="从仓库Pull-a-repository"><a href="#从仓库Pull-a-repository" class="headerlink" title="从仓库Pull a repository"></a>从仓库Pull a repository</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git clone https://github.com/yukimochi/Activity-Relay.git -b v2.0.0</span><br></pre></td></tr></table></figure>
<h2 id="复制编辑config-yml"><a href="#复制编辑config-yml" class="headerlink" title="复制编辑config.yml"></a>复制编辑config.yml</h2><p>进入<code>Activity-Relay</code>目录</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cd Activity-Relay</span><br><span class="line">cp config.yml.example config.yml</span><br></pre></td></tr></table></figure>
<p>修改相关配置</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">vim config.yml</span><br></pre></td></tr></table></figure>
<h2 id="生成actor-RSA-证书-x2F-actor-pem"><a href="#生成actor-RSA-证书-x2F-actor-pem" class="headerlink" title="生成actor RSA 证书 .&#x2F;actor.pem"></a>生成actor RSA 证书 .&#x2F;actor.pem</h2><p>ubuntu使用</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">openssl genrsa -traditional | tee actor.pem</span><br></pre></td></tr></table></figure>
<p>centos使用</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">openssl genrsa -out actor.pem 1024 | tee actor.pem</span><br></pre></td></tr></table></figure>
<p>赋予权限600</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">chmod 600 actor.pem</span><br></pre></td></tr></table></figure>
<h2 id="构建镜像与运行服务"><a href="#构建镜像与运行服务" class="headerlink" title="构建镜像与运行服务"></a>构建镜像与运行服务</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">docker-compose build</span><br><span class="line">docker-compose up -d</span><br></pre></td></tr></table></figure>
<h2 id="查看容器运行状态"><a href="#查看容器运行状态" class="headerlink" title="查看容器运行状态"></a>查看容器运行状态</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker-compose ps</span><br></pre></td></tr></table></figure>
<h2 id="停止服务"><a href="#停止服务" class="headerlink" title="停止服务"></a>停止服务</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker-compose down</span><br></pre></td></tr></table></figure>
<h2 id="相关参考"><a href="#相关参考" class="headerlink" title="相关参考"></a>相关参考</h2><p>docker-compose配置</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br></pre></td><td class="code"><pre><span class="line">version: &quot;2.3&quot;</span><br><span class="line">services:</span><br><span class="line"> redis:</span><br><span class="line"> restart: always</span><br><span class="line"> image: redis:alpine</span><br><span class="line"> healthcheck:</span><br><span class="line"> test: [&quot;CMD&quot;, &quot;redis-cli&quot;, &quot;ping&quot;]</span><br><span class="line"> volumes:</span><br><span class="line"> - &quot;./redisdata:/data&quot;</span><br><span class="line"></span><br><span class="line"> worker:</span><br><span class="line"> container_name: worker</span><br><span class="line"> build: .</span><br><span class="line"> image: yukimochi/activity-relay</span><br><span class="line"> working_dir: /var/lib/relay</span><br><span class="line"> restart: always</span><br><span class="line"> init: true</span><br><span class="line"> command: relay worker</span><br><span class="line"> volumes:</span><br><span class="line"> - &quot;./actor.pem:/var/lib/relay/actor.pem&quot;</span><br><span class="line"> - &quot;./config.yml:/var/lib/relay/config.yml&quot;</span><br><span class="line"> depends_on:</span><br><span class="line"> - redis</span><br><span class="line"></span><br><span class="line"> server:</span><br><span class="line"> container_name: relay</span><br><span class="line"> build: .</span><br><span class="line"> image: yukimochi/activity-relay</span><br><span class="line"> working_dir: /var/lib/relay</span><br><span class="line"> restart: always</span><br><span class="line"> init: true</span><br><span class="line"> ports:</span><br><span class="line"> - &quot;8080:8080&quot;</span><br><span class="line"> command: relay server</span><br><span class="line"> volumes:</span><br><span class="line"> - &quot;./actor.pem:/var/lib/relay/actor.pem&quot;</span><br><span class="line"> - &quot;./config.yml:/var/lib/relay/config.yml&quot;</span><br><span class="line"> depends_on:</span><br><span class="line"> - redis</span><br><span class="line"></span><br></pre></td></tr></table></figure>
<p>Nginx设置</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">upstream relay &#123;</span><br><span class="line"> server 127.0.0.1:8080;</span><br><span class="line"> &#125;</span><br><span class="line"> server &#123;</span><br><span class="line"> server_name relay.example.com;</span><br><span class="line"></span><br><span class="line"> location / &#123;</span><br><span class="line"> root /var/lib/relay;</span><br><span class="line"> try_files $uri $uri/index.html =404;</span><br><span class="line"> &#125;</span><br><span class="line"></span><br><span class="line"> location /inbox &#123;</span><br><span class="line"> rewrite ^/inbox(.*) /$1 break;</span><br><span class="line"> proxy_pass http://relay/;</span><br><span class="line"> proxy_pass_request_headers on;</span><br><span class="line"> proxy_set_header Host $http_host;</span><br><span class="line"> &#125;</span><br><span class="line"></span><br><span class="line"> location /actor &#123;</span><br><span class="line"> rewrite ^/inbox(.*) /$1 break;</span><br><span class="line"> proxy_pass http://relay/;</span><br><span class="line"> proxy_pass_request_headers on;</span><br><span class="line"> proxy_set_header Host $http_host;</span><br><span class="line"> &#125;</span><br><span class="line"></span><br><span class="line"> &#125;</span><br><span class="line"></span><br></pre></td></tr></table></figure>
</div>
</div>
<div class="post-footer">
</div>
<div class="recent-post-item">
<div class="post-title ">
<a href="/posts/a116570f.html">NEC M700黑苹果OC0.9.4引导</a>
</div>
<div class="post-meta">
<div class="post-meta-item date">
<span title="发表于 2023.10.01"><i class="far fa-calendar-alt"></i> 2023.10.01</span>
</div>
<div class="post-meta-item updated">
<span title="更新于 2024.05.09"><i class="far fa-calendar-check"></i> 2024.05.09</span>
</div>
<div class="post-meta-item categories">
<i class="fas fa-inbox article-meta__icon"></i> <a href="/categories/%E5%88%86%E4%BA%AB/">分享</a>
</div>
<div class="post-meta-item wordcount">
<i class="fas fa-pencil-alt"></i> <span class="post-count">94 字</span>
<i class="far fa-clock"></i> <span class="post-count">1 分钟</span>
</div>
</div>
<div class="content">
<h2 id="NEC-M700黑苹果OC0-9-4引导"><a href="#NEC-M700黑苹果OC0-9-4引导" class="headerlink" title="NEC M700黑苹果OC0.9.4引导"></a>NEC M700黑苹果OC0.9.4引导</h2><h3 id="配置"><a href="#配置" class="headerlink" title="配置"></a>配置</h3><p>CPU QHPW 2.2Ghz 四核心八线程I7es魔改<br>主板NEC<br>内存8GB DDR4 2666Mhz<br>硬盘512GB SSD<br>无线网卡BCM943224pcieBT拆机<br>有线网卡INTEL<br>声卡ALC235</p>
<h3 id="准备工作"><a href="#准备工作" class="headerlink" title="准备工作"></a>准备工作</h3><p>U盘 16G以上<br>解锁CFG LOCK工具<br>ami BIOS提取工具<br>opencore<br>OCAT</p>
<h3 id="解锁CFG-LOCK"><a href="#解锁CFG-LOCK" class="headerlink" title="解锁CFG LOCK"></a>解锁CFG LOCK</h3><p>在WINDOWS系统下通过工具提取出BIOS.<br>通过<code>UEFI TOOL</code>打开提取出的BIOS文件,查找<code>cfg lock</code></p>
</div>
</div>
<div class="post-footer">
</div>
</div>
<nav class="paginator">
<a class="next" href="/page/2/">下一页 ></a>
</nav>
<a id="gotop" href="javascript:" title="返回顶部"><i class="fa fa-arrow-up"></i></a>
<div id="bottom-outer">
<div id="bottom-inner">
© 2020 <i class="fa fa-heart" id="heart"></i> 浪子
<br>
Powered by
<a target="_blank" rel="noopener" href="http://hexo.io">hexo</a> | Theme is <a target="_blank" rel="noopener" href="https://github.com/a2396837/hexo-theme-blank/">blank</a>
<div class="icp-info">
<a href="" target="_blank"> </a>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/layui-src@2.5.5/dist/layui.min.js"></script>
<script src="/js/script.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js"></script>
<script>
window.lazyLoadOptions = {
elements_selector: 'img',
threshold: 0
}
</script>
<script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script>
<script>
var images = $('img').not('.nav-logo img').not('.card img').not($('a>img')).not('.reward-content img')
images.each(function (i, o) {
var lazyloadSrc = $(o).attr('data-src') ? $(o).attr('data-src') : $(o).attr('src')
$(o).wrap(`<a href="${lazyloadSrc}" data-fancybox="group" data-caption="${$(o).attr('alt')}" class="fancybox"></a>`)
})
</script>
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js"></script>
<script>
$().fancybox({
selector: '[data-fancybox]',
loop: true,
transitionEffect: 'slide',
protect: true,
buttons: ['slideShow', 'fullScreen', 'thumbs', 'close']
})
</script>
<div id="QPlayer">
<div id="pContent">
<div id="player">
<span class="cover"></span>
<div class="ctrl">
<div class="musicTag marquee">
<strong>Title</strong>
<span> - </span>
<span class="artist">Artist</span>
</div>
<div class="progress">
<div class="timer left">0:00</div>
<div class="contr">
<div class="rewind icon"></div>
<div class="playback icon"></div>
<div class="fastforward icon"></div>
</div>
<div class="right">
<div class="liebiao icon"></div>
</div>
</div>
</div>
</div>
<div class="ssBtn">
<div class="adf"><i class="fas fa-music" style="color: #Fff;"></i></div>
</div>
</div>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/a2396837/CDN@latest/css/audio.css">
<ol id="playlist"></ol>
</div>
<script src="https://cdn.jsdelivr.net/npm/jquery.marquee@1.5.0/jquery.marquee.min.js"></script>
<script>
var playlist = [];
playlist.push({title:'我要开花',artist:'二手玫瑰',mp3:'https://xy07-1251893119.cos.ap-beijing-1.myqcloud.com/%E4%BA%8C%E6%89%8B%E7%8E%AB%E7%91%B0%20-%20%E6%88%91%E8%A6%81%E5%BC%80%E8%8A%B1.mp3',cover:'https://p1.music.126.net/DSTg1dR7yKsyGq4IK3NL8A==/109951163046050093.jpg'})
var isRotate = true;
var autoplay = false;
</script>
<script src="https://cdn.jsdelivr.net/gh/a2396837/CDN@latest/js/player.js"></script>
<script>
function bgChange(){
var lis= $('.lib');
for(var i=0; i<lis.length; i+=2)
lis[i].style.background = 'rgba(246, 246, 246, 0.5)';
}
window.onload = bgChange;
</script>
<script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module" defer></script>
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.4/dist/clipboard.min.js"></script>
<script>
!function (e, t, a) {
var initCopyCode = function(){
var copyHtml = '';
copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
copyHtml += ' <i class="fa fa-clipboard"></i><span>复制</span>';
copyHtml += '</button>';
$(".highlight .code pre").before(copyHtml);
new ClipboardJS('.btn-copy', {
target: function(trigger) {
return trigger.nextElementSibling;
}
});
}
initCopyCode();
}(window, document);
</script>
<script>
var btntop = $('#gotop');
btntop.on('click', function (e) {
e.preventDefault();
$('html, body').animate({ scrollTop: 0 }, '300');
});
var $table = $('.content table').not($('figure.highlight > table'))
$table.each(function () {
$(this).wrap('<div class="table-wrap"></div>')
})
</script>
</html>