208 lines
5.6 KiB
Plaintext
208 lines
5.6 KiB
Plaintext
|
||
===========无脑按顺序执行===============
|
||
|
||
先解析域名,github 1-6应该都解析过了
|
||
|
||
安装环境先 https://nextpanel.dev/docs/installation/debian
|
||
|
||
基本配置
|
||
apt update
|
||
alias ll='ls -l'
|
||
apt install vim
|
||
apt install git
|
||
|
||
ssh目录
|
||
cd /var/www
|
||
mkdir .ssh
|
||
cd .ssh
|
||
|
||
ssh安装
|
||
sudo apt update &&
|
||
sudo apt install openssh-client &&
|
||
ssh-keygen -t rsa -b 4096 -C "clashfreenodecom@proton.me"
|
||
提示生成地址写 /var/www/.ssh/id_rsa_clashfreenodecom
|
||
(邮箱不要后缀)
|
||
别忘了权限
|
||
|
||
密钥添加到github账号
|
||
|
||
ssh权限
|
||
chown -R www-data:www-data /var/www/.ssh &&
|
||
chmod 700 /var/www/.ssh &&
|
||
chmod 600 /var/www/.ssh/*
|
||
|
||
www创建
|
||
cd /
|
||
mkdir www
|
||
cd www
|
||
mkdir wwwroot
|
||
cd wwwroot
|
||
|
||
项目文件
|
||
git clone https://gitea.diaodu.us/tom/github
|
||
mv github github-5.diaodu.us
|
||
cd进去
|
||
mkdir github
|
||
chmod -R 755 *
|
||
chown -R www-data:www-data *
|
||
chmod -R 777 github
|
||
just里取出env,配置一下(github,hotshotgg)
|
||
cp ./just/env ./.env
|
||
对应配置改一下
|
||
|
||
数据库 - 直接连招
|
||
mysql
|
||
CREATE DATABASE github CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||
CREATE USER 'hotdog'@'localhost';
|
||
GRANT ALL PRIVILEGES ON github.* TO 'hotdog'@'localhost' IDENTIFIED BY 'hotshotgg';
|
||
FLUSH PRIVILEGES;
|
||
|
||
数据库导入
|
||
just里有sql,导入
|
||
mysql -uhotdog -p github < github.sql
|
||
导出的话:mysqldump -uroot -p --no-data github > github.sql
|
||
|
||
nginx配置
|
||
vim /etc/nginx/nginx.conf 用户改为www-data
|
||
添加nginx域名配置(.conf后缀别忘了)(下面有nginx配置,复制就行)
|
||
vim /etc/nginx/conf.d/github-5.diaodu.us.conf
|
||
systemctl restart nginx
|
||
|
||
安装证书
|
||
sudo apt update &&
|
||
sudo apt install -y snapd &&
|
||
sudo snap install --classic certbot &&
|
||
sudo ln -s /snap/bin/certbot /usr/bin/certbot &&
|
||
sudo certbot --nginx
|
||
systemctl restart nginx
|
||
|
||
测试:https://github-5.diaodu.us/test/hello
|
||
|
||
去tg上配置他
|
||
github-6 -- /hub#list
|
||
先在dove里添加github-6的dove
|
||
|
||
github上创建对应仓库
|
||
|
||
tg测试
|
||
测试 /test#cron__id 1
|
||
到SSH config updated successfully.
|
||
到git push -u origin main错误,就基本ok了,到linux上提交确认kownhost
|
||
sudo -u www-data git add .
|
||
sudo -u www-data git push -u origin main --force
|
||
提交成功就ok,通了
|
||
|
||
最后挂上cron:* * * * * curl -s https://github-2.diaodu.us/cron > /dev/null
|
||
别忘了把inday_count调到正常
|
||
|
||
==========安装证书流程==============
|
||
|
||
sudo apt update
|
||
sudo apt install snapd
|
||
|
||
sudo snap install --classic certbot
|
||
|
||
sudo ln -s /snap/bin/certbot /usr/bin/certbot
|
||
|
||
sudo certbot --nginx
|
||
|
||
=============添加拉取仓库流程==================
|
||
|
||
先走通标准流程,会自动init,生成fn和vertion那些传上去。
|
||
|
||
然后:
|
||
git remote add tom https://gitea.diaodu.us/tom/github-pachong.git - 添加拉取地址,tom是自定义名字
|
||
git config --global --add safe.directory /www/wwwroot/github-6.diaodu.us/github/xibanyahu-phppachong - 附加
|
||
git pull tom master
|
||
git reset --hard tom/master - 覆盖切换
|
||
chown www-data:www-data * - 老活
|
||
然后/test#cron__id 1,不出意外就通了
|
||
|
||
之后每次拉取都:
|
||
git pull tom master
|
||
git reset --hard tom/master
|
||
|
||
|
||
=============nginx配置========================
|
||
|
||
server {
|
||
listen 80;
|
||
listen [::]:80;
|
||
|
||
root /www/wwwroot/github-5.diaodu.us/public;
|
||
index index.php;
|
||
server_name github-5.diaodu.us;
|
||
|
||
location / {
|
||
try_files $uri /index.php$is_args$args;
|
||
}
|
||
|
||
location ~ \.php$ {
|
||
try_files $fastcgi_script_name =404;
|
||
include fastcgi_params;
|
||
fastcgi_index index.php;
|
||
fastcgi_buffers 8 16k;
|
||
fastcgi_buffer_size 32k;
|
||
fastcgi_pass unix:/run/php/php-fpm.sock;
|
||
fastcgi_param DOCUMENT_ROOT $realpath_root;
|
||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
||
}
|
||
}
|
||
|
||
=========杂货===========
|
||
|
||
git config --global --add safe.directory /www/wwwroot/github-2.diaodu.us
|
||
|
||
可一次运行可能需要777权限
|
||
|
||
iphonevpn clash telegram nefilx vpn vless clashmeta vmess surge ssr
|
||
|
||
|
||
======
|
||
|
||
sudo -u www-data git push -u origin main --force
|
||
|
||
{
|
||
"id": 1,
|
||
"user_name": "jichangtuijian99", // github的username
|
||
"project_name": "jichangtuijian99.github.io", // 这个应该是本地文件名,应该随便取也行
|
||
"mail_name": "dabiandan", // github注册的email,只要前面
|
||
"mail_tail": "outlook.com", // 后面
|
||
"sale_code": "clashv2rayfree.com", // 销售码
|
||
"sale_rate": 7, // 销售折扣
|
||
"sale_price": 8, // 折后价格
|
||
"i_in10": "false", // 模式选一 :: 每10分钟
|
||
"inday_count": 3, // 模式选一 :: 一天几次(随机)
|
||
"cron_condition": "false", // 模式选一 :: 算数
|
||
"mod": "fn_jctj_a", // blade mod
|
||
"mod_type": "blade", // 现在都是blade
|
||
"status": 1, // 1运行,0不运行
|
||
"memo": "",
|
||
"ship_code": "fuuu",
|
||
"fn_www": "clashfreenode.com",
|
||
"show_huodong": 1,
|
||
"show_error": 1
|
||
}
|
||
|
||
{
|
||
"id": 1,
|
||
"user_name": "danmaifu",
|
||
"project_name": "mianfeijiedian",
|
||
"mail_name": "erdama123",
|
||
"mail_tail": "outlook.com",
|
||
"sale_code": "clashv2rayfree.com",
|
||
"sale_rate": 7,
|
||
"sale_price": 8,
|
||
"i_in10": "false",
|
||
"inday_count": 4,
|
||
"cron_condition": "false",
|
||
"mod": "fn_c",
|
||
"mod_type": "blade",
|
||
"status": 1,
|
||
"memo": "",
|
||
"ship_code": "fuuu",
|
||
"fn_www": "clashfreenode.com",
|
||
"show_huodong": 1,
|
||
"show_error": 1
|
||
}
|