Mark's blog https://009898.xyz/ zh-CN 这是 Mark 的个人博客,记录些东西。 Thu, 10 Oct 2024 22:36:00 +0800 Thu, 10 Oct 2024 22:36:00 +0800 Centos7 Debian9 锐速安装 https://009898.xyz/archives/46 https://009898.xyz/archives/46 Thu, 10 Oct 2024 22:36:00 +0800 Mark 在线路差的小鸡上,锐速>bbrplus>bbr

bbrplus 测试是 almalinux8.9 使用 https://github.com/ylx2016/Linux-NetSpeed 安装的

Centos7 锐速安装记录:

在CentOS 7上使用YUM源可以通过以下步骤进行:

首先备份你当前的YUM源配置文件,以防需要恢复:
sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
下载 YUM 配置文件
推荐华为源
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.huaweicloud.com/repository/conf/CentOS-7-reg.repo

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
清除缓存并生成新的缓存: yum clean all yum makecache

安装 bt

安装 x-ui

下载指定版本内核
wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/kernel-3.10.0-957.el7.x86_64.rpm

安装这个内核
yum install kernel-3.10.0-957.el7.x86_64.rpm

卸载其他内核
yum install ca-certificates wget -y && update-ca-trust force-enable wget -O tcpx.sh "https://github.com/ylx2016/Linux-NetSpeed/raw/master/tcpx.sh" && chmod +x tcpx.sh && ./tcpx.sh 选择 52 输入要保留的内核 3.10.0-957.el7.x86_64

安装 lotserver
bash <(wget --no-check-certificate -qO- https://raw.githubusercontent.com/1265578519/lotServer/main/lotServerInstall.sh) install

Centos7 开机启动

  1. 创建 /root/lotserver_start.sh
#!/bin/bash
/usr/bin/sh /appex/bin/lotServer.sh restart

echo "nohup sh /root/lotserver_start.sh > /dev/null 2&>1 &" >> /etc/rc.d/rc.local

  1. echo "/usr/bin/sh /appex/bin/lotServer.sh restart" >> /etc/rc.d/rc.local

chmod +x /etc/rc.d/rc.local

Debian9 锐速安装记录:
下载内核到 VPS:
wget http://cloudsign.s500.xrea.com/linux-image-4.9.0-4-amd64_4.9.65-3+deb9u1_amd64.deb](http://cloudsign.s500.xrea.com/linux-image-4.9.0-4-amd64_4.9.65-3+deb9u1_amd64.deb

安装内核:
dpkg -i linux-image-4.9.0-4-amd64_4.9.65-3+deb9u1_amd64.deb

查看系统中已安装的内核:
dpkg -l|grep linux-image

此时会看到形如以下所示:
linux-image-4.9.0-4-amd64 linux-image-4.9.0-8-amd64

卸载除 4.9.0-4 以外的所有内核:
apt purge linux-image-4.9.0-8-amd64

系统此时会弹出提示,选择 NO 并回车。随后再次执行步骤3/4,直到确认只剩下 4.9.0-4

或者使用上面 tcpx.sh 卸载其他内核

更新引导并重启系统:
update-grub reboot

安装 lotserver 同上。

其他:锐速许可证搭建
https://github.com/Tai7sy/LotServer_KeyGen

更新许可,使用ifconfig查看网卡mac地址,替换00:00:00:00:00:00

============================================

/appex/etc/apx.lic
位置不一定一样需要修改
wget -qO /appex/etc/apx.lic 'http://cloudsign.s500.xrea.com/lotserver/keygen.php?ver=1&mac=00:00:00:00:00:00'

查看当前系统内核 uname -r 查看当前默认内核启动项 grub2-editenv list 更改默认启动内核项 grub2-set-default 1(改成你要改的内核对应的数字)

reboot 查看当前系统内核 uname -r

]]>
0 https://009898.xyz/archives/46#comments https://009898.xyz/feed/
(转)Windows Server 2012 R2桌面化详细设置图解 https://009898.xyz/archives/45 https://009898.xyz/archives/45 Thu, 10 Oct 2024 22:35:23 +0800 Mark 控制面板关闭防火墙,再搜索关闭自动更新。

一、任务栏左下角启动服务器管理器,然后进行设置。

1、登录不显示服务器管理器

2、本地服务器,看到右边的IE增强的安全配置,如图所示,关闭两项内容。这样就关闭了IE增强安全提示框。

3、“工具”菜单,启动“服务”,启动两项声音服务(Windows Audio\Windows Audio Endpoint Builder),并设为自动属性。

4、 “管理”菜单,添加服务器角色与功能。添加功能:Search服务、Server Backup、无线LAN,以及“用户界面和基础结构”下的桌面体验,优质 Windows 音频视频体验等。如果你需要添加 .Net Framework 3.5 功能,自己再选上。

二、WIN键+R键,输入GPEDIT.MSC,进入组策略。

1、禁用“密码符合复杂性要求”,“密码最长使用期限”改为0(无期限)

2、启用“交互式登录:无需按 Ctrl+Alt+Del”

3、禁用“显示"关闭事件跟踪程序"”

4、计算机配置 -> 管理模版 -> 系统,启用“在登录时不显示"管理你的服务器"页”

5、用户配置 -> 管理模版 -> "开始"菜单和任务栏,设置“更改"开始"菜单电源按钮”的默认操作为“关机”,系统默认是“注销”。

控制面板 搜索:icon - 选择 显示或隐藏桌面上的通用图标 开启桌面图标。

四、设置处理器计划和数据执行保护

1、在任务栏左下角开始按钮上点右键,选择“系统”菜单,再选择“高级系统设置”,再如下操作:选性能下的“设置”属性 -> 高级 -> 选程序。

2、在任务栏左下角开始按钮上点右键,选择“系统”菜单,再选择“高级系统设置”,再如下操作:选性能下的“设置”属性 -> 数据执行保护 -> 选第一项。

彻底关闭自动维护功能的方法

Step 1

由于自动维护任务为系统级的权限,因此默认情况下,无法完全禁用此任务,因此需要获得自动维护任务所需文件的完整访问权限。具体做法如下:

C:\Windows\System32\Tasks\Microsoft\Windows\TaskScheduler\Maintenance configurator

属性 --安全-- 高级--所有者,将administrator设置为所有者。

然后 将administrator 设置完全控制。

Step 2

禁用相关任务计划

计算机管理--任务计划程序--Microsoft--Windows--TaskScheduler

       Idle Maintenance--右键--禁用

       Maintenance Configurator--右键--禁用(没执行Step 1将提示无权限)

       Regular Maintenance--右键--禁用

、 Windows Server 2012R2 启用网络发现失败

解决方法 快捷键Win+R打开运行,输入services.msc回车打开服务,将以下3个服务启动类型改为自动(延迟启动)并启动。 Function Discovery Resource Publication SDP Discovery Upnp Device Host 网络共享中心,开启网络发现。

]]>
0 https://009898.xyz/archives/45#comments https://009898.xyz/feed/
我的博客写的真烂 https://009898.xyz/archives/44 https://009898.xyz/archives/44 Thu, 10 Oct 2024 22:35:00 +0800 Mark 问题点:

  1. 好多记录都没好好记,步骤不够详细,缺乏完整过程
  2. 排版格式不好,很多错乱的标题大小,格式不标准
]]>
0 https://009898.xyz/archives/44#comments https://009898.xyz/feed/
VMware workstation搭建与安装AlmaLinux虚拟机 https://009898.xyz/archives/43 https://009898.xyz/archives/43 Thu, 10 Oct 2024 22:34:50 +0800 Mark EasyImages-normal 222.PNG

输入如下命令查看虚拟网络信息,因为虚拟机默认使用VMware Workstation的NAT网络,已经自动使用DHCP分配了IP。可以使用SSH远程连接到这个IP。 nmcli

修改AlmaLinux-9.2虚拟机IP为静态IP,后续重启虚拟机后IP地址不会变 EasyImages-Right_Upload

]]>
0 https://009898.xyz/archives/43#comments https://009898.xyz/feed/
宝塔BT7.9.2(含)以下版本RCE安全漏洞及其修复 https://009898.xyz/archives/42 https://009898.xyz/archives/42 Thu, 10 Oct 2024 22:34:36 +0800 Mark 漏洞原因

宝塔日志处理函数未过滤非法字符串导致的 RCE 安全漏洞(XSS)

影响范围

1、网站日志 (影响最大) 2、Nginx错误日志 3、面板运行日志

解决方法1

升级到宝塔BT最新版(7.9.3及其以上)

解决方法2

不点击上述功能

解决方法3

修改文件,增加过滤即可。我是小于7.9.3以下版本。 1、网站日志(/www/server/panel/class/panelSite.py),大概在4922多行吧,搜索GetSiteLogs,把GetSiteLogs和get_site_errlog用以下替换掉

    # xss 防御
    def xsssec(self,text):
        replace_list = {
            "<":"<",
            ">":">",
            "'":"'",
            '"':""",
        }
        for k,v in replace_list.items():
            text = text.replace(k,v)
        return public.xssencode2(text)    

    #取网站日志
    def GetSiteLogs(self,get):
        serverType = public.get_webserver()
        if serverType == "nginx":
            logPath = '/www/wwwlogs/' + get.siteName + '.log'
        elif serverType == 'apache':
            logPath = '/www/wwwlogs/' + get.siteName + '-access_log'
        else:
            logPath = '/www/wwwlogs/' + get.siteName + '_ols.access_log'
        if not os.path.exists(logPath): return public.returnMsg(False,'日志为空')
        return public.returnMsg(True,self.xsssec(public.GetNumLines(logPath,1000)))

    #取网站错误日志
    def get_site_errlog(self,get):
        serverType = public.get_webserver()
        if serverType == "nginx":
            logPath = '/www/wwwlogs/' + get.siteName + '.error.log'
        elif serverType == 'apache':
            logPath = '/www/wwwlogs/' + get.siteName + '-error_log'
        else:
            logPath = '/www/wwwlogs/' + get.siteName + '_ols.error_log'
        if not os.path.exists(logPath): return public.returnMsg(False,'日志为空')
        return public.returnMsg(True,self.xsssec(public.GetNumLines(logPath,1000)))

2、Nginx错误日志(/www/server/panel/class/ajax.py),大概在1135多行吧,搜索GetOpeLogs,把GetOpeLogs用以下替换掉

    #取指定日志
    def GetOpeLogs(self,get):
        if not os.path.exists(get.path): return public.returnMsg(False,'AJAX_LOG_FILR_NOT_EXISTS')
        return public.returnMsg(True,public.xsssec(public.GetNumLines(get.path,1000)))

3、面板运行日志(/www/server/panel/class/config.py),大概在1480多行吧,搜索get_panel_error_logs,把get_panel_error_logs用以下替换掉

    # xss 防御
    def xsssec(self,text):
        return text.replace('<', '<').replace('>', '>')
    #取面板运行日志
    def get_panel_error_logs(self,get):
        filename = 'logs/error.log'
        if not os.path.exists(filename): return public.returnMsg(False,'没有找到运行日志')
        result = public.GetNumLines(filename,2000)
        return public.returnMsg(True,self.xsssec(result))
]]>
0 https://009898.xyz/archives/42#comments https://009898.xyz/feed/
最近的一些感慨 https://009898.xyz/archives/41 https://009898.xyz/archives/41 Thu, 10 Oct 2024 22:33:54 +0800 Mark 同龄越来越多的人结婚了, 但其实我们基本都99/00年的,才24/25左右, 我自己也是不断地被家里再催, 再给自己点时间,就到年底再说吧。

工作上最近又来了一批应届生, 得知今年我们公司两个厂, 一共才招了40人不到, 我那会22年看了下校招群,189个, 不得不感慨,现在的工作机会真的是越来越少了。

我也算是挺幸运的,22年那会刚交割, 由外企变到了私企,收购刚完成,岗位很多。 不过我感觉我们22届的应该有走了一半多人。

我目前工作状态还好, 在科室里算是站住了角, 我们小组目前人就四个人,我已经是来的算最老的了。一位24应届的,一位23年从其他组调来的,组长平时不负责小组业务(主要负责开会), 岗位也从助理工程师到工程师了,工资也涨了7%, 后面部门又会有一些变动,不知道会是咋样。

]]>
0 https://009898.xyz/archives/41#comments https://009898.xyz/feed/
记录2 https://009898.xyz/archives/40 https://009898.xyz/archives/40 Thu, 10 Oct 2024 22:33:01 +0800 Mark https://009898.xyz/src/商品溯源第一版.zip

image.png

nvm --version
nvm list
nvm root

打开 setting.txt 加入如下mirror:

root: C:\Users\Administrator\AppData\Roaming\nvm
path: C:\Program Files\nodejs

node_mirror: https://npmmirror.com/mirrors/node/
npm_mirror: https://npmmirror.com/mirrors/npm/
nvm install 16.20.2
nvm use 16.20.2

image.png

npm run serve

image.png

image.png

image.png

image.png

![image.png](https://img.009898.xyz/i/2024/06/30/hhdidv-0.png)

![image.png](https://img.009898.xyz/i/2024/06/30/hhiids-0.png)
]]>
0 https://009898.xyz/archives/40#comments https://009898.xyz/feed/
Cloudflare 自建docker镜像加速器 https://009898.xyz/archives/39 https://009898.xyz/archives/39 Thu, 10 Oct 2024 22:32:37 +0800 Mark 作为一个贫穷的用户,可以免费使用的 CloudFlare Worker来部署加速器

一、 Cloudflared新建Workers和Pages

在面板左侧找到 Workers 和 Pages,然后点击右侧的 创建应用程序、创建 Worker,修改一个好记的名字,部署

二、 接下来编辑代码

将 worker.js 的内容替换为下面内容

'use strict'

const hub_host = 'registry-1.docker.io'
const auth_url = 'https://auth.docker.io'
const workers_url = 'https://你的域名'
//const home_page_url = '远程html链接'

/** @type {RequestInit} */
const PREFLIGHT_INIT = {
    status: 204,
    headers: new Headers({
        'access-control-allow-origin': '*',
        'access-control-allow-methods': 'GET,POST,PUT,PATCH,TRACE,DELETE,HEAD,OPTIONS',
        'access-control-max-age': '1728000',
    }),
}

/**
 * @param {any} body
 * @param {number} status
 * @param {Object<string, string>} headers
 */
function makeRes(body, status = 200, headers = {}) {
    headers['access-control-allow-origin'] = '*'
    return new Response(body, {status, headers})
}

/**
 * @param {string} urlStr
 */
function newUrl(urlStr) {
    try {
        return new URL(urlStr)
    } catch (err) {
        return null
    }
}

addEventListener('fetch', e => {
    const ret = fetchHandler(e)
        .catch(err => makeRes('cfworker error:\n' + err.stack, 502))
    e.respondWith(ret)
})

/**
 * @param {FetchEvent} e
 */
async function fetchHandler(e) {
    const getReqHeader = (key) => e.request.headers.get(key);

    let url = new URL(e.request.url);

    if (url.pathname === '/') {
        // Fetch and return the home page HTML content
        //return fetch(home_page_url);
        return new Response(indexHtml, {
            headers: {
              'Content-Type': 'text/html'
            }
          });
    }

    if (url.pathname === '/token') {
        let token_parameter = {
            headers: {
                'Host': 'auth.docker.io',
                'User-Agent': getReqHeader("User-Agent"),
                'Accept': getReqHeader("Accept"),
                'Accept-Language': getReqHeader("Accept-Language"),
                'Accept-Encoding': getReqHeader("Accept-Encoding"),
                'Connection': 'keep-alive',
                'Cache-Control': 'max-age=0'
            }
        };
        let token_url = auth_url + url.pathname + url.search
        return fetch(new Request(token_url, e.request), token_parameter)
    }

    url.hostname = hub_host;

    let parameter = {
        headers: {
            'Host': hub_host,
            'User-Agent': getReqHeader("User-Agent"),
            'Accept': getReqHeader("Accept"),
            'Accept-Language': getReqHeader("Accept-Language"),
            'Accept-Encoding': getReqHeader("Accept-Encoding"),
            'Connection': 'keep-alive',
            'Cache-Control': 'max-age=0'
        },
        cacheTtl: 3600
    };

    if (e.request.headers.has("Authorization")) {
        parameter.headers.Authorization = getReqHeader("Authorization");
    }

    let original_response = await fetch(new Request(url, e.request), parameter)
    let original_response_clone = original_response.clone();
    let original_text = original_response_clone.body;
    let response_headers = original_response.headers;
    let new_response_headers = new Headers(response_headers);
    let status = original_response.status;

    if (new_response_headers.get("Www-Authenticate")) {
        let auth = new_response_headers.get("Www-Authenticate");
        let re = new RegExp(auth_url, 'g');
        new_response_headers.set("Www-Authenticate", response_headers.get("Www-Authenticate").replace(re, workers_url));
    }

    if (new_response_headers.get("Location")) {
        return httpHandler(e.request, new_response_headers.get("Location"))
    }

    let response = new Response(original_text, {
        status,
        headers: new_response_headers
    })
    return response;

}

/**
 * @param {Request} req
 * @param {string} pathname
 */
function httpHandler(req, pathname) {
    const reqHdrRaw = req.headers

    // preflight
    if (req.method === 'OPTIONS' &&
        reqHdrRaw.has('access-control-request-headers')
    ) {
        return new Response(null, PREFLIGHT_INIT)
    }

    let rawLen = ''

    const reqHdrNew = new Headers(reqHdrRaw)

    const refer = reqHdrNew.get('referer')

    let urlStr = pathname

    const urlObj = newUrl(urlStr)

    /** @type {RequestInit} */
    const reqInit = {
        method: req.method,
        headers: reqHdrNew,
        redirect: 'follow',
        body: req.body
    }
    return proxy(urlObj, reqInit, rawLen, 0)
}

/**
 *
 * @param {URL} urlObj
 * @param {RequestInit} reqInit
 */
async function proxy(urlObj, reqInit, rawLen) {
    const res = await fetch(urlObj.href, reqInit)
    const resHdrOld = res.headers
    const resHdrNew = new Headers(resHdrOld)

    // verify
    if (rawLen) {
        const newLen = resHdrOld.get('content-length') || ''
        const badLen = (rawLen !== newLen)

        if (badLen) {
            return makeRes(res.body, 400, {
                '--error': `bad len: ${newLen}, except: ${rawLen}`,
                'access-control-expose-headers': '--error',
            })
        }
    }
    const status = res.status
    resHdrNew.set('access-control-expose-headers', '*')
    resHdrNew.set('access-control-allow-origin', '*')
    resHdrNew.set('Cache-Control', 'max-age=1500')

    resHdrNew.delete('content-security-policy')
    resHdrNew.delete('content-security-policy-report-only')
    resHdrNew.delete('clear-site-data')

    return new Response(res.body, {
        status,
        headers: resHdrNew
    })
}

const indexHtml = `
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Dockerhub镜像加速说明</title>
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            margin: 0;
            padding: 20px;
            background-image: url('https://cdn.jsdelivr.net/gh/fireinrain/picx-images-hosting@master/20240608/wp8114669-docker-wallpapers.5h6dvj56isg0.webp'); /* Replace with your image path */
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            background-attachment: fixed;
        }
        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            background: rgba(255, 255, 255, 0.8);
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        h1 {
            font-size: 2em;
            margin-bottom: 0.5em;
            color: #007aff;
        }
        p {
            margin-bottom: 1em;
        }
        pre {
            background: #2d2d2d;
            color: #f8f8f2;
            padding: 20px;
            border-radius: 8px;
            overflow-x: auto;
            position: relative;
        }
        pre::before {
            content: " ";
            display: block;
            position: absolute;
            top: 10px;
            left: 10px;
            width: 12px;
            height: 12px;
            background: #ff5f56;
            border-radius: 50%;
            box-shadow: 20px 0 0 #ffbd2e, 40px 0 0 #27c93f;
        }
        code {
            font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
            font-size: 0.875em;
        }
        .copy-button {
            position: absolute;
            top: 10px;
            right: 10px;
            background: #007aff;
            color: white;
            border: none;
            padding: 5px 10px;
            border-radius: 5px;
            cursor: pointer;
            opacity: 0;
            transition: opacity 0.3s;
        }
        pre:hover .copy-button {
            opacity: 1;
        }
</style>
</head>
<body>
    <div class="container">
        <center><h1>镜像加速说明</h1></center>
        <h3>为了加速镜像拉取,你可以使用以下命令设置 registry mirror:</h3>
        <pre><code>
sudo tee /etc/docker/daemon.json <<EOF
{
    "registry-mirrors": ["https://你的域名"]
}
EOF</code><button class="copy-button" onclick="copyCode(this)">复制代码</button></pre>
        <h3>用法:</h3>
        <p>原拉取镜像命令</p>
        <pre><code>
docker pull library/alpine:latest</code><button class="copy-button" onclick="copyCode(this)">复制代码</button></pre>
        <h3>加速拉取镜像命令</h3>
        <pre><code>
docker pull 你的域名/library/alpine:latest</code><button class="copy-button" onclick="copyCode(this)">复制代码</button></pre>
    </div>
    <script>
        function copyCode(button) {
            const code = button.previousSibling;
            const textArea = document.createElement('textarea');
            textArea.value = code.textContent;
            document.body.appendChild(textArea);
            textArea.select();
            document.execCommand('copy');
            document.body.removeChild(textArea);
            button.textContent = '已复制';
            setTimeout(() => {
                button.textContent = '复制代码';
            }, 2000);
        }
</script>
</body>
</html>
`

将代码里的 你的域名 修改成你自己域名之后点击部署即可

三、绑定域名并配置路由

cf workers默认使用的是自动分配的域名,目前是不可访问,所以还需要绑定自己的域名。

进入项目详细-设置里面,选择触发器,点击添加路由。路由就填写对应的子(主)域名,例如主域名是“bbb.com”,想要通过“aaa.bbb.com”拉取docker,那路由就填写“aaa.bbb.com/*”,当然这里想直接用主域名也可以,没限制;区域就选择对应的主域名,然后添加路由。

之后进入dns解析,添加一个对应子(主)域名的解析,例如上面是用“aaa.bbb.com”,那这里就添加一个对应的ipv4解析记录;解析地址随便填写,填8.8.8.8就可以,然后旁边的小云朵一定要启用。

四、验证并拉取镜像

如果以上步骤都无误,就可以直接拉取docker镜像,但是需要对相应的拉取命令做更改。具体更改方法可以访问上面代码里你的域名地址获取 https://你的域名

]]>
0 https://009898.xyz/archives/39#comments https://009898.xyz/feed/
记录 https://009898.xyz/archives/38 https://009898.xyz/archives/38 Thu, 10 Oct 2024 22:30:47 +0800 Mark

root 切换

sudo passwd root
su
cd /root
wget https://009898.xyz/src/installer_debian_x64_2.2.5.5.deb
apt install ./installer_debian_x64_2.2.5.5.deb
systemctl start v2raya.service
wget https://009898.xyz/src/v2ray-linux-64.zip
unzip v2ray-linux-64.zip -d ./v2ray
mkdir -p /usr/local/share/v2ray
cp ./v2ray/*dat /usr/local/share/v2ray
install -Dm755 ./v2ray/v2ray /usr/local/bin/v2ray

安装 Docker

Debian/Ubuntu/CentOS/RHEL 该脚本是 Docker 官方提供的 Linux 自动安装脚本

apt install curl -y
bash <(curl -s -L get.docker.com)

检查Docker

Docker 20.10.0及以上版本,如需安装,参考Docker安装

docker --version
Docker version 20.10.0, build 7287ab3

注意:确保Docker免sudo执行,参考Docker用户组配置

配置镜像加速

tee /etc/docker/daemon.json <<EOF
{
"registry-mirrors": ["https://dockerproxy.009898.xyz"]
}
EOF

重启Docker服务

systemctl daemon-reload
systemctl restart docker

拉取一个Docker镜像以测试配置是否生效

docker run hello-world

出现如下就是成功了

Docker-Compose安装

获取Docker-Compose的github仓库提供的二进制文件,其中版本号1.29.2可切换到更新版本,-o则输出到指定位置

依赖 curl 进行下载

curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

修改执行权限

chmod +x /usr/local/bin/docker-compose

检测安装是否成功

docker-compose --version
docker-compose version 1.29.2, build 5becea4c

Python部署

python版本要求使用python3.x, 推荐使用python3.6及以上版本

add-apt-repository ppa:deadsnakes/ppa
apt-get install -y python3.6
apt-get install -y python3-pip

检查版本,使用Python3.6或以上版本:

python3 --version

PyMySQL部署(Python3.6+)

Python3.6及以上版本,需安装PyMySQL依赖包

Ubuntu

apt-get install -y python3-pip
pip3 install PyMySQL

拉取部署脚本

获取部署安装包:

wget https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/WeBASE/releases/download/v1.5.5/webase-deploy.zip
unzip webase-deploy.zip
cd webase-deploy
python3 deploy.py pullDockerAll
python3 deploy.py installDockerAll
# 一键部署
部署并启动所有服务        python3 deploy.py installDockerAll

停止一键部署的所有服务    python3 deploy.py stopDockerAll
启动一键部署的所有服务    python3 deploy.py startDockerAll
# 节点的启停
启动所有FISCO-BCOS节点:      python3 deploy.py startNode
停止所有FISCO-BCOS节点:      python3 deploy.py stopNode
# WeBASE服务的启停
启动所有WeBASE服务:      python3 deploy.py dockerStart
停止所有WeBASE服务:      python3 deploy.py dockerStop

WeBASE管理平台: 一键部署完成后,打开浏览器(Chrome Safari或Firefox)访问 http://{deployIP}:{webPort} 示例:http://localhost:5000

备注: 部署服务器IP和管理平台服务端口需对应修改,网络策略需开通 使用云服务厂商的服务器时,需要开通网络安全组的对应端口。如开放WeBASE管理台使用的5000端口 WeBASE管理平台使用说明请查看使用手册(获取WeBASE管理平台默认账号和密码,并初始化系统配置) 默认账号为admin,默认密码为Abcd1234。首次登陆要求重置密码

添加节点前置WeBASE-Front到WeBASE管理平台;一键部署时,节点前置与节点管理服务默认是同机部署,添加前置则填写IP为127.0.0.1,默认端口为5002。参考上文中common.properties的配置项front.port={frontPort} 检查节点前置是否启动,可以通过访问 http://{frontIp}:{frontPort}/WeBASE-Front(默认端口5002) 访问前,确保服务端已对本地机器开放端口,如开放front的5002端口。(不建议节点前置的端口对公网开放访问权限,应对部分机器IP按需开放)

]]>
0 https://009898.xyz/archives/38#comments https://009898.xyz/feed/
俄罗斯 IP 无法显示 Youtube 头像 https://009898.xyz/archives/36 https://009898.xyz/archives/36 Thu, 10 Oct 2024 22:24:34 +0800 Mark ggpht.com 头像被俄罗斯屏蔽

Xray 配置 outbounds 和 routing

{
  "api": {
    "services": [
      "HandlerService",
      "LoggerService",
      "StatsService"
    ],
    "tag": "api"
  },
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "port": 62789,
      "protocol": "dokodemo-door",
      "settings": {
        "address": "127.0.0.1"
      },
      "tag": "api"
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    },
    {
      "tag": "ChuZhanDaoVirmachJP",
      "protocol": "vmess",
      "settings": {
            "vnext": [
                {
                    "address": "XXX.XXX.XXX.XXX",
                    "port": XXXX,
                    "users": [
                        {
                            "id": "XXXX",
                            "security": "auto",
                            "alterId": XXXX
                        }
                    ]
                }
            ]
        },
      "streamSettings": {
        "network": "tcp",
        "tcpSettings": {
          "header": {
            "type": "http",
            "request": {
              "version": "1.1",
              "method": "GET",
              "path": [
                "/XXXX"
              ],
              "headers": {
                "Host": [
                  "XXXX.com"
                ],
                "User-Agent": [
                  ""
                ],
                "Accept-Encoding": [
                  "gzip, deflate"
                ],
                "Connection": [
                  "keep-alive"
                ],
                "Pragma": "no-cache"
              }
            }
          }
        }
      }
    },
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "policy": {
    "system": {
      "statsInboundDownlink": true,
      "statsInboundUplink": true
    }
  },
  "routing": {
    "rules": [
      {
        "inboundTag": [
          "api"
        ],
        "outboundTag": "api",
        "type": "field"
      },
      {
        "ip": [
          "geoip:private"
        ],
        "outboundTag": "blocked",
        "type": "field"
      },
      {
        "outboundTag": "blocked",
        "protocol": [
          "bittorrent"
        ],
        "type": "field"
      },
      {
            "type": "field",
            "outboundTag": "ChuZhanDaoVirmachJP",
            "domain": [
                "domain:ggpht.com"
            ]
      }
    ]
  },
  "stats": {}
}
]]>
0 https://009898.xyz/archives/36#comments https://009898.xyz/feed/