草根站长利用极狐GitLab做为图床外链 #JIHULAB 101
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">我是小白,白嫖的白,<span style="color: black;">首要</span>,感谢极狐GitLab<span style="color: black;">供给</span>的白嫖平台,不是,SaaS平台,为<span style="color: black;">咱们</span><span style="color: black;">供给</span>的免费服务。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">说到草根站长,<span style="color: black;">非常多</span>人不<span style="color: black;">晓得</span><span style="color: black;">她们</span>的存在,我从高中就<span style="color: black;">起始</span>接触建站圈,我<span style="color: black;">亦</span>是草根站长,<span style="color: black;">咱们</span>草根站长这个群体<span style="color: black;">包括</span>个人网站、个人博客网站、生活<span style="color: black;">兴趣</span>分享网站等,基本是互联网最底层的群体,大<span style="color: black;">都数</span>是为了<span style="color: black;">一起</span><span style="color: black;">兴趣</span>聚集在<span style="color: black;">一块</span>,大部分都<span style="color: black;">无</span>盈利的可能。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">由于</span>大部分<span style="color: black;">无</span>盈利的方式,<span style="color: black;">因此</span>对草根站长<span style="color: black;">来讲</span>,服务器资源、存储空间、网络流量都<span style="color: black;">非常</span>昂贵,非了分担成本,草根站长<span style="color: black;">常常</span>会<span style="color: black;">选取</span><span style="color: black;">各样</span>免费的图床来分担流量,让自己的服务器尽可能的减轻压力、压缩配置成本。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">图床<span style="color: black;">通常</span><span style="color: black;">指的是</span>储存<span style="color: black;">照片</span>的服务器,将<span style="color: black;">照片</span>上传到图床服务器得到一个链接,<span style="color: black;">经过</span>这个链接外链到自己的页面展示<span style="color: black;">照片</span>,自己的服务器上不存储<span style="color: black;">照片</span>资源,从而达到节省服务器空间和流量的目的。</span></p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">极狐GitLab</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">极狐是国内版GitLab,所有数据存储在境内,<span style="color: black;">因此</span>网络质量非常好,除了<span style="color: black;">研发</span>者托管代码以外,换个<span style="color: black;">运用</span>姿势,<span style="color: black;">做为</span>草根站长还<span style="color: black;">能够</span><span style="color: black;">做为</span>图床来用,<span style="color: black;">选取</span>极狐GitLab<span style="color: black;">做为</span>图床我有以下观点:</span></p><span style="color: black;">极狐GitLab SaaS平台有专门的<span style="color: black;">靠谱</span>性工程师运维,底层有多种机制<span style="color: black;">守护</span>代码和数据不丢失、SaaS平台的高可用,<span style="color: black;">保准</span>服务不中断。</span><span style="color: black;">极狐GitLab SaaS平台托管在国内机房,网络质量良好、总带宽很大,虽然比不了CDN但几乎<span style="color: black;">无</span>感觉到很慢。</span><span style="color: black;">极狐GitLab 的核心功能是 Git 版本<span style="color: black;">掌控</span>,<span style="color: black;">咱们</span>每一次修改都会有版本历史记录,有效防止误操作删除资源文件。</span>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">上传<span style="color: black;">照片</span>类型</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">在极狐GitLab SaaS平台上创建一个公开的仓库,<span style="color: black;">重视</span>要是公开的仓库,私有的不行。</span></p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">而后</span><span style="color: black;">咱们</span>直接在页面上就<span style="color: black;">能够</span>创建文件夹,例如创建img文件夹</span></p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/18d389f52fb749fb80c85c344fbe3d2e~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1729713935&x-signature=9dS1XyTh%2FQVn3jqP0aQRzCqtqp8%3D" style="width: 50%; margin-bottom: 20px;"></div>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/7163361b56504929bad50c148c0cc344~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1729713935&x-signature=lp73BGKwHDIvqydJoxy7wD%2FsHos%3D" style="width: 50%; margin-bottom: 20px;"></div>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/e0474f3dc88846ee9c5b2386557ba98c~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1729713935&x-signature=oNt7SIWRqgX8ITo8RIYYpVcgvKg%3D" style="width: 50%; margin-bottom: 20px;"></div>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/8bf520dca1b941159164dc5cab6433a0~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1729713935&x-signature=4i1jxDaD1MHGtrkCuLb1c%2BJqOm8%3D" style="width: 50%; margin-bottom: 20px;"></div>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/d7712894e6074914aad9ded92834585f~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1729713935&x-signature=G3pM6l8yXyIWx4kF5jhd2UYhZgM%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">直接在页面上就<span style="color: black;">能够</span>上传<span style="color: black;">照片</span>,<span style="color: black;">而后</span>右击复制<span style="color: black;">照片</span>的链接<span style="color: black;">位置</span>,就<span style="color: black;">能够</span>在自己的网页中<span style="color: black;">运用</span>了,例如:https://cdn.renfei.net/demo/JIHUGitLabDemo.html</span></p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">上传视频类型</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">倘若</span>你<span style="color: black;">亦</span>有视频的<span style="color: black;">需要</span>,<span style="color: black;">亦</span><span style="color: black;">能够</span>在极狐GitLab SaaS平台上外链,<span style="color: black;">不外</span>在<span style="color: black;">起始</span>之前,需要提醒你几件事:</span></p><span style="color: black;">极狐GitLab SaaS平台单个仓库容量是 2GB,<span style="color: black;">倘若</span>要超出这个容量需要付费购买扩容包</span><span style="color: black;">直接<span style="color: black;">运用</span>Git管理大文件会很慢,<span style="color: black;">因此</span>需要<span style="color: black;">运用</span> Git LFS。</span>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">综上所述,视频是二进制大文件,<span style="color: black;">咱们</span>需要<span style="color: black;">有些</span>技术能力,<span style="color: black;">运用</span> Git LFS 来管理,<span style="color: black;">因此</span>先 clone 自己的仓库到本地,<span style="color: black;">而后</span>执行下面的安装步奏。</span></p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">Git LFS</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">git需要对比<span style="color: black;">每一个</span>文件的差异做版本管理,而大文件<span style="color: black;">常常</span>是二进制文件,<span style="color: black;">每一个</span>版本都<span style="color: black;">保留</span>一份大文件仓库会很大,并且效率<span style="color: black;">亦</span>不高,LFS(Large File Storage) <span style="color: black;">便是</span>为<span style="color: black;">认识</span>决这一问题而产生的工具,它将你所标记的大文件<span style="color: black;">保留</span>至<span style="color: black;">另一</span>的仓库,而在主仓库仅<span style="color: black;">保存</span>其轻量级指针<span style="color: black;">那样</span>在你检出版本时,<span style="color: black;">按照</span>指针的变化<span style="color: black;">状况</span>下更新对应的大文件。而不是在本地<span style="color: black;">保留</span>所有版本的大文件。</span></p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">Git LFS 安装</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">我是 macos 用户,<span style="color: black;">这儿</span>只举例 macos 的环境,其他环境请<span style="color: black;">自动</span>搜索引擎搜索安装方式。</span></p><span style="color: black;">macos 打开终端,<span style="color: black;">运用</span>几个命令<span style="color: black;">就可</span>安装完成。</span><span style="color: black;">macos<span style="color: black;">首要</span>安装HomeBrew,<span style="color: black;">已然</span>安装过的跳过:/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"</span><span style="color: black;"><span style="color: black;">而后</span>输入命令:brew install git-lfs</span><span style="color: black;">最后 cd 到你的仓库目录,执行:git lfs install</span><span style="color: black;">再<span style="color: black;">运用</span>命令声明要跟踪的文件类型,<span style="color: black;">这儿</span>例如跟踪的是 *.mp4 文件:git lfs track "*.mp4"</span><span style="color: black;">这个时候会生成一个 .gitattributes 文件,这个文件<span style="color: black;">亦</span>需要加入仓库的版本跟踪中</span><span style="color: black;">查看现有的<span style="color: black;">跟踪</span>文件类型:git lfs track</span>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/ded8eea341bd492ab8c4311f51f4f2a2~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1729713935&x-signature=0tsAAAr4sBrb4%2F6nWwocUR1QrZ0%3D" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">到<span style="color: black;">这儿</span>,<span style="color: black;">咱们</span>就安装好了 Git LFS,剩下的<span style="color: black;">便是</span>正常的提交,你<span style="color: black;">能够</span><span style="color: black;">运用</span>可视化工具来操作,<span style="color: black;">或</span><span style="color: black;">运用</span>命令,git 的提交命令<span style="color: black;">亦</span>很简单,顺便提一嘴。</span></p>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">Git 提交与推送步奏</h1><span style="color: black;">查看当前仓库状态命令:git status</span><span style="color: black;">将文件添加到版本<span style="color: black;">掌控</span>的命令:git add . <span style="color: black;">或</span> git add xxx</span><span style="color: black;">提交修改的命令:git commit -m "提交时写点备注"</span><span style="color: black;">推送本地仓库到线上仓库命令:git push</span>
<h1 style="color: black; text-align: left; margin-bottom: 10px;">引用视频</h1>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">经过上面的操作,<span style="color: black;">咱们</span>回到极狐GitLab SaaS平台,点击上传的视频文件,会有一个下载链接,右击复制链接,在自己的网页上就<span style="color: black;">能够</span>引用这个视频了,例如:https://cdn.renfei.net/demo/JIHUGitLabDemo.html</span></p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-qvj2lq49k0/b7be50cf8a7c477997b19bb75df78650~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1729713935&x-signature=kaRLz2lAXXQwnPK08BcQdzU4UBs%3D" style="width: 50%; margin-bottom: 20px;"></div>
页:
[1]