certbot使用cloudflare的api签发ssl

先去cloudflare上申请IP https://dash.cloudflare.com/profile/api-tokens

在Edit zone DNS的模版下授权可以修改DNS的域名

写入API配置

echo " dns_cloudflare_api_token = XXXXXXXXXXXXXXXXXXXXXx" >/root/cloudflare.ini

安装和签发ssl

dnf install -y epel-release
dnf install -y certbot certbot-dns-cloudflare python*-certbot-dns-cloudflare
certbot certonly --agree-tos --email [email protected]  --dns-cloudflare --dns-cloudflare-credentials /root/cloudflare.ini -d kvm.la

WHMCS模版直接掉调用产品数据

function可以丢header.tpl里面

{php}
function getProducts($gid) {
    // 定义要发送的请求数据
    $postData = array('gid' => $gid);
    // 发送请求并获取结果
    $results = localAPI('GetProducts', $postData, 'admin');
    // 初始化一个数组,用于存储产品信息
    $products = array();
    // 遍历结果,提取所需信息并存储到数组中
    foreach ($results['products']['product'] as $product) {
        $description = $product['description'];
        $products[] = array(
            'stockcontrol' =>  $product['stockcontrol'],
            'stocklevel' => $product['stocklevel'],
            'name' => $product['name'],
            'url' => $product['product_url'],
            'pid' => $product['pid'],
            'desc' => $description,
            'prefix' => $product['pricing']['USD']['prefix'],
            'price' => $product['pricing']['USD']['monthly'],
            'yprice' => $product['pricing']['USD']['annually'],
        );
    }
    // 返回产品信息数组
    return $products;
}

// 调用函数获取产品信息,并传递变量gid作为参数
$getProducts= getProducts("1");
$_smarty_tpl->assign('getProducts', $getProducts);
{/php}

{foreach $Getproduct as $value }
                                <tr>
                                {$value.desc}
                                    <td><span class="price">{$value.prefix}{$value.price}<span>/MRC</span></span> </td>
                                    <td>
{if  isset($value.stocklevel)  &&   $value.stocklevel < 1  }
                                        <button type="button" class="btn btn-warning">Sold Out</button>
{else}
                                        <a href="/cart.php?a=add&pid={$value.pid}" class="btn btn-success">Order</a>
{/if}
                                    </td>
</tr>
{/foreach}

register.to疑似跑路

官方网站已经有半年处于维护状态了

且发邮件也了音信.

 蒲公英路由X4C安装frp服务

X4C用来做机房外带管理,  直接穿透外网访问串口服务器等等.
 
 
-----解锁SSH-----
http://10.168.1.1/cgi-bin/oraybox?_api=ssh_set&enabled=1
或者备份数据用7zip打开下载的文件找到etc/config/system修改ssh选项为1 再导入备份重启就可以连接ssh了
5.5.0以上版本密码为oray@12#$%^78
5.5.0以下是admin
 
wget https://github.com/kuoruan/openwrt-frp/releases/download/v0.37.1-1/frpc_0.37.1-1_mipsel_24kc.ipk --no-check-certificate
opkg install frpc_*.ipk

这里备注一下需要mipsel_24kc版本,折腾了大半天走了不少弯路,执行opkg update才发现这个版本能安装.

0.37.1以上版本报错

"Error relocating /usr/bin/frpc: __nanosleep_time64: symbol not found"

frpc.ini配置文件

 cat>/etc/frpc.ini<<EOF
[common]
server_addr = frps.server
server_port = 7000
token = password
log_level = debug
log_max_days = 3
use_compression = true
login_fail_exit = false

[rand-ssh]
type = tcp
local_ip = 0.0.0.0
local_port = 22
remote_port = 0
EOF

启动文件

cat>/etc/init.d/frpc<<EOF
#!/bin/sh /etc/rc.common
START=99
start() {
        sleep 20; nohup /usr/bin/frpc -c /etc/frpc.ini >/root/nohup.out 2>&1 &
}
stop() {
        kill -9 `ps | grep '/usr/bin/frpc' | grep -v 'grep' | awk '{print $1}'`
}
EOF
chmod 755 /etc/init.d/frpc
/etc/init.d/frpc enable && echo on
/etc/init.d/frpc  start

启动文件有点简单粗暴

 

 

超微设置ipmi端口

#获取网卡模式状态
ipmitool raw 0x30 0x70 0x0c 0.

#设置独立网卡模式
ipmitool raw 0x30 0x70 0x0c 1 0.

#设置公网IP共享模式
ipmitool raw 0x30 0x70 0x0c 1 1.

#设置成failover模式
 ipmitool raw 0x30 0x70 0x0c 1 2.

windows版本ipmitool  https://kvm.la/ipmitool-for-windows.html

ConvoyPanel整合coterm的novnc代理服务

官方使用的docker部署, 这里折腾了下改为系统直接安装了

安装好后丢caddy或者nginx反向代理一下就好了, 我这直接用cloudflare的隧道进行代理了.

安装

mkdir  /home/coterm/public -p
cd  /home/coterm/public 
git clone https://github.com/novnc/noVNC

cd /tmp
git clone "https://github.com/ConvoyPanel/coterm.git"
cd coterm
npm install
npm run build
cp -rf  ./build/*   /home/coterm/public/
#编译coterm主程序
cd ./src-rust
cargo run
cargo build --release
install  target/release/coterm /home/coterm/

 环境变量配置

cat>/home/coterm/.env<<EOF
CONVOY_URL=https://XXX.XXXX. XX    #面板地址
COTERM_TOKEN="XXXXX"
BACKEND_PORT=2600
DANGEROUS_DISABLE_TLS_VERIFICATION=false
RUST_BACKTRACE="full"
EOF

系统服务

cat>/etc/systemd/system/coterm.service<<EOF
[Unit]
Description=Coterm Service
After=network.target nss-lookup.target

[Service]
Type = simple
EnvironmentFile=/home/coterm/.env
ExecStart=/home/coterm/coterm
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF