Merge branch 'master' into lenovo-y480
This commit is contained in:
4
ansible/group_vars/vps_debian.yml
Normal file
4
ansible/group_vars/vps_debian.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
ansible_user: zedhugh
|
||||||
|
ansible_python_interpreter: /usr/bin/python3
|
||||||
|
ansible_ssh_port: 44444
|
||||||
2
ansible/inventory.ini
Normal file
2
ansible/inventory.ini
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[vps_debian]
|
||||||
|
yunyoo-tokyo
|
||||||
85
ansible/playbooks/frps.yaml
Normal file
85
ansible/playbooks/frps.yaml
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
---
|
||||||
|
- name: 配置 frps 服务端
|
||||||
|
hosts: vps_debian
|
||||||
|
gather_facts: false
|
||||||
|
become: true
|
||||||
|
vars:
|
||||||
|
frp_version: "0.71.0"
|
||||||
|
frp_download_url: "https://github.com/fatedier/frp/releases/download/v{{ frp_version }}/frp_{{ frp_version }}_linux_amd64.tar.gz"
|
||||||
|
frp_local_archive: "/tmp/frp_{{ frp_version }}_linux_amd64.tar.gz"
|
||||||
|
frp_local_tmp_dir: "/tmp/frp_{{ frp_version }}_linux_amd64"
|
||||||
|
frp_install_dir: "/opt/frp"
|
||||||
|
frp_config_dir: "/etc/frp"
|
||||||
|
vars_files:
|
||||||
|
- ../vars/vault.yaml
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: 创建 frp 目录
|
||||||
|
file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
loop:
|
||||||
|
- "{{ frp_install_dir }}"
|
||||||
|
- "{{ frp_config_dir }}"
|
||||||
|
|
||||||
|
- name: 检查本地是否已有该版本的压缩包
|
||||||
|
stat:
|
||||||
|
path: "{{ frp_local_archive }}"
|
||||||
|
register: local_archive
|
||||||
|
delegate_to: localhost
|
||||||
|
run_once: true
|
||||||
|
|
||||||
|
- name: 下载 frp 压缩包到本地
|
||||||
|
get_url:
|
||||||
|
url: "{{ frp_download_url }}"
|
||||||
|
dest: "{{ frp_local_archive }}"
|
||||||
|
timeout: 60
|
||||||
|
delegate_to: localhost
|
||||||
|
run_once: true
|
||||||
|
become: false
|
||||||
|
when: not local_archive.stat.exists
|
||||||
|
|
||||||
|
- name: 解压 frp 压缩包到本地
|
||||||
|
unarchive:
|
||||||
|
src: "{{ frp_local_archive }}"
|
||||||
|
dest: "/tmp/"
|
||||||
|
creates: "{{ frp_local_tmp_dir }}"
|
||||||
|
delegate_to: localhost
|
||||||
|
run_once: true
|
||||||
|
become: false
|
||||||
|
when: not local_archive.stat.exists
|
||||||
|
|
||||||
|
- name: 复制 frps 二进制文件到目标机器
|
||||||
|
copy:
|
||||||
|
src: "{{ frp_local_tmp_dir }}/frps"
|
||||||
|
dest: "{{ frp_install_dir }}/frps"
|
||||||
|
mode: '0755'
|
||||||
|
notify: restart frps
|
||||||
|
|
||||||
|
- name: 生成 frps.toml 配置文件
|
||||||
|
template:
|
||||||
|
src: ../templates/frps.toml.j2
|
||||||
|
dest: "{{ frp_config_dir }}/frps.toml"
|
||||||
|
mode: '0644'
|
||||||
|
notify: restart frps
|
||||||
|
|
||||||
|
- name: 创建 frps 的 systemd 服务文件
|
||||||
|
template:
|
||||||
|
src: ../templates/frps.service.j2
|
||||||
|
dest: /etc/systemd/system/frps.service
|
||||||
|
mode: '0644'
|
||||||
|
notify: restart frps
|
||||||
|
|
||||||
|
- name: 启用并启动 frps 服务
|
||||||
|
systemd:
|
||||||
|
name: frps
|
||||||
|
enabled: true
|
||||||
|
state: started
|
||||||
|
daemon_reload: true
|
||||||
|
|
||||||
|
handlers:
|
||||||
|
- name: restart frps
|
||||||
|
systemd:
|
||||||
|
name: frps
|
||||||
|
state: restarted
|
||||||
34
ansible/playbooks/shadowsocks-libev.yaml
Normal file
34
ansible/playbooks/shadowsocks-libev.yaml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
- name: 配置 shadowsocks-libev 服务器
|
||||||
|
hosts: vps_debian
|
||||||
|
become: true
|
||||||
|
vars_files:
|
||||||
|
- ../vars/vault.yaml
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: 安装 shadowsocks-libev
|
||||||
|
apt:
|
||||||
|
name: shadowsocks-libev
|
||||||
|
state: present
|
||||||
|
update_cache: true
|
||||||
|
|
||||||
|
- name: 配置 shadowsocks-libev 服务器
|
||||||
|
template:
|
||||||
|
src: ../templates/ss-config.json.j2
|
||||||
|
dest: /etc/shadowsocks-libev/config.json
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
notify: restart shadowsocks-libev server
|
||||||
|
|
||||||
|
- name: 启动 shadowsocks-libev 服务器
|
||||||
|
systemd:
|
||||||
|
name: shadowsocks-libev
|
||||||
|
enabled: true
|
||||||
|
state: started
|
||||||
|
|
||||||
|
handlers:
|
||||||
|
- name: restart shadowsocks-libev server
|
||||||
|
systemd:
|
||||||
|
name: shadowsocks-libev
|
||||||
|
state: restarted
|
||||||
95
ansible/playbooks/vps_debian_provision.yaml
Normal file
95
ansible/playbooks/vps_debian_provision.yaml
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
---
|
||||||
|
- name: 新机器初始化
|
||||||
|
hosts: vps_debian
|
||||||
|
gather_facts: yes
|
||||||
|
|
||||||
|
vars:
|
||||||
|
ansible_user: root
|
||||||
|
ansible_ssh_port: 22
|
||||||
|
|
||||||
|
admin_user: zedhugh
|
||||||
|
ssh_port: 44444
|
||||||
|
timezone: Asia/Shanghai
|
||||||
|
ssh_public_key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: 启用 BBR
|
||||||
|
sysctl:
|
||||||
|
name: net.ipv4.tcp_congestion_control
|
||||||
|
value: bbr
|
||||||
|
sysctl_set: yes
|
||||||
|
reload: yes
|
||||||
|
|
||||||
|
- name: 设置时区
|
||||||
|
timezone:
|
||||||
|
name: "{{ timezone }}"
|
||||||
|
|
||||||
|
- name: 创建管理员用户
|
||||||
|
user:
|
||||||
|
name: "{{ admin_user }}"
|
||||||
|
shell: /bin/bash
|
||||||
|
create_home: yes
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: 确保 sudo 已安装
|
||||||
|
apt:
|
||||||
|
name: sudo
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: 确保 sudoers.d 目录存在
|
||||||
|
file:
|
||||||
|
path: /etc/sudoers.d
|
||||||
|
state: directory
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: 配置 sudo 免密码
|
||||||
|
copy:
|
||||||
|
content: "{{ admin_user }} ALL=(ALL) NOPASSWD: ALL\n"
|
||||||
|
dest: "/etc/sudoers.d/{{ admin_user }}"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: '0440'
|
||||||
|
validate: '/usr/sbin/visudo -cf %s'
|
||||||
|
|
||||||
|
- name: 复制 SSH 密钥
|
||||||
|
authorized_key:
|
||||||
|
user: "{{ admin_user }}"
|
||||||
|
key: "{{ ssh_public_key }}"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: 修改 SSH 端口
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/ssh/sshd_config
|
||||||
|
regexp: "^#?Port "
|
||||||
|
line: "Port {{ ssh_port }}"
|
||||||
|
notify: restart ssh
|
||||||
|
|
||||||
|
- name: 禁止 root 密码登录
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/ssh/sshd_config
|
||||||
|
regexp: "^#?PermitRootLogin"
|
||||||
|
line: "PermitRootLogin prohibit-password"
|
||||||
|
notify: restart ssh
|
||||||
|
|
||||||
|
- name: 禁止密码认证
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/ssh/sshd_config
|
||||||
|
regexp: "^#?PasswordAuthentication"
|
||||||
|
line: "PasswordAuthentication no"
|
||||||
|
notify: restart ssh
|
||||||
|
|
||||||
|
- name: 开启公钥认证
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/ssh/sshd_config
|
||||||
|
regexp: "^#?PubkeyAuthentication"
|
||||||
|
line: "PubkeyAuthentication yes"
|
||||||
|
notify: restart ssh
|
||||||
|
|
||||||
|
|
||||||
|
handlers:
|
||||||
|
- name: restart ssh
|
||||||
|
systemd:
|
||||||
|
name: sshd
|
||||||
|
state: restarted
|
||||||
45
ansible/playbooks/xray-server.yaml
Normal file
45
ansible/playbooks/xray-server.yaml
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
---
|
||||||
|
- name: 配置 xray 服务
|
||||||
|
hosts: vps_debian
|
||||||
|
become: true
|
||||||
|
gather_facts: false
|
||||||
|
vars:
|
||||||
|
xray_config_file: /usr/local/etc/xray/config.json
|
||||||
|
xray_bin: /usr/local/bin/xray
|
||||||
|
vars_files:
|
||||||
|
- ../vars/vault.yaml
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: 确保有 curl 软件包
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- curl
|
||||||
|
state: present
|
||||||
|
update_cache: true
|
||||||
|
|
||||||
|
- name: 安装 xray
|
||||||
|
shell: |
|
||||||
|
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install
|
||||||
|
notify: restart xray
|
||||||
|
|
||||||
|
- name: 生成 xray 配置
|
||||||
|
template:
|
||||||
|
src: ../templates/xray-config.json.j2
|
||||||
|
dest: "{{ xray_config_file }}"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
notify: restart xray
|
||||||
|
|
||||||
|
- name: 启动 xray 服务并添加开机启动
|
||||||
|
systemd:
|
||||||
|
name: xray
|
||||||
|
enabled: true
|
||||||
|
state: started
|
||||||
|
daemon_reload: true
|
||||||
|
|
||||||
|
handlers:
|
||||||
|
- name: restart xray
|
||||||
|
systemd:
|
||||||
|
name: xray
|
||||||
|
state: restarted
|
||||||
13
ansible/templates/frps.service.j2
Normal file
13
ansible/templates/frps.service.j2
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
[Uint]
|
||||||
|
Description=Frp Server Service
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=5s
|
||||||
|
ExecStart={{ frp_install_dir }}/frps -c {{ frp_config_dir }}/frps.toml
|
||||||
|
LimitNOFILE=1048576
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
14
ansible/templates/frps.toml.j2
Normal file
14
ansible/templates/frps.toml.j2
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
bindPort = {{ vault_frps_bind_port }}
|
||||||
|
|
||||||
|
vhostHTTPPort = {{ vault_frps_vhost_http_port }}
|
||||||
|
vhostHTTPSPort = {{ vault_frps_vhost_https_port }}
|
||||||
|
|
||||||
|
auth.method = "token"
|
||||||
|
auth.token = "{{ vault_frps_token }}"
|
||||||
|
|
||||||
|
webServer.addr = "0.0.0.0"
|
||||||
|
webServer.port = {{ vault_frps_dashboard_port }}
|
||||||
|
webServer.user = "{{ vault_frps_dashboard_user }}"
|
||||||
|
webServer.password = "{{ vault_frps_dashboard_password }}"
|
||||||
|
|
||||||
|
log.to = "/var/log/frps.log"
|
||||||
9
ansible/templates/ss-config.json.j2
Normal file
9
ansible/templates/ss-config.json.j2
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"server": "0.0.0.0",
|
||||||
|
"mode": "{{ vault_ss_mode }}",
|
||||||
|
"server_port": {{ vault_ss_server_port }},
|
||||||
|
"local_port": {{ vault_ss_local_port }},
|
||||||
|
"password": "{{ vault_ss_password }}",
|
||||||
|
"timeout": 60,
|
||||||
|
"method": "{{ vault_ss_method }}"
|
||||||
|
}
|
||||||
44
ansible/templates/xray-config.json.j2
Normal file
44
ansible/templates/xray-config.json.j2
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
"log": {
|
||||||
|
"loglevel": "warning",
|
||||||
|
"access": "/var/log/xray/access.log",
|
||||||
|
"error": "/var/log/xray/error.log"
|
||||||
|
},
|
||||||
|
"inbounds": [
|
||||||
|
{
|
||||||
|
"listen": "0.0.0.0",
|
||||||
|
"port": {{ vault_xray_port }},
|
||||||
|
"protocol": "vless",
|
||||||
|
"settings": {
|
||||||
|
"clients": [
|
||||||
|
{
|
||||||
|
"id": "{{ vault_xray_uuid }}",
|
||||||
|
"flow": "xtls-rprx-vision"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"decryption": "none",
|
||||||
|
"udp": true
|
||||||
|
},
|
||||||
|
"streamSettings": {
|
||||||
|
"network": "tcp",
|
||||||
|
"security": "reality",
|
||||||
|
"realitySettings": {
|
||||||
|
"dest": "dl.google.com:443",
|
||||||
|
"serverNames": ["dl.google.com"],
|
||||||
|
"privateKey": "{{ vault_xray_private_key }}",
|
||||||
|
"shortIds": ["{{ vault_xray_short_id }}"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sniffing": {
|
||||||
|
"enabled": true,
|
||||||
|
"destOverride": ["http", "tls", "quic"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outbounds": [
|
||||||
|
{
|
||||||
|
"protocol": "freedom",
|
||||||
|
"tag": "direct"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
34
ansible/vars/vault.yaml
Normal file
34
ansible/vars/vault.yaml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
|
31623833356637343262363863626534323535626238346439333262633332633136633261306466
|
||||||
|
6236333066363461326664306262633937323864306462370a333631643039653664643662366234
|
||||||
|
30643231336631313930663637396537663162623938363263336333343262376561323765356630
|
||||||
|
6332383136383336640a336536316566393461666463616265363830383331363838613839636338
|
||||||
|
63666365333233646533303166316333393535313466393832643966306331666434333065333238
|
||||||
|
37633735313832366131653833363762393265656439663135376265366466333838623761646535
|
||||||
|
64633236663738653233633566633734306138393462383532306436373537343332343565356466
|
||||||
|
62386664373631336138396134613833636232663936363963656638353133386430376631383438
|
||||||
|
35313866343438636564373566373239656233376432363362613466356334346339616562316530
|
||||||
|
62306361646362353631336134326136346663623061643231666433353265653736323162616166
|
||||||
|
32313132643832306563623861393735623439376432346136623732353737356338616432316161
|
||||||
|
64316436653531356362316366383039616465313233393663663566316532626138363936363736
|
||||||
|
31386237653634343236326639376531653465636233636662303037643930633661623338356537
|
||||||
|
34636639383662646234313037363230373333333731323666383232626330663561396330356361
|
||||||
|
36346537376431333235393938636664306532373863353862663166613862363165643433626361
|
||||||
|
37616337356538373733313130633334353436643437366534326636616539316166336137346461
|
||||||
|
63633130623436316463623461353762313533636262653262393930666434386664326464636562
|
||||||
|
35636233656365616332383565623230353062663236316437333830626463333366633230393432
|
||||||
|
33386533346436623132313036646536366339646333643732633133626631396463653533363763
|
||||||
|
37623439303931363933336432386430336662353138663231316436356535373831653232633562
|
||||||
|
33626463303134323032643535373038303530376632393162356630613134396261633661393335
|
||||||
|
30646133366166313533666565326335656231663864666333366136616264356535303033313832
|
||||||
|
35323432613063356161383365653964613339346136333363363763316463396364383264343634
|
||||||
|
65623039343064356430386662323135303134306539313138316633396635333331636137356665
|
||||||
|
38623531613138316162353733663631396562313033393066303266396533613762643936663936
|
||||||
|
65663762646264616439666138636364343264323961343739336330663237666661303639363835
|
||||||
|
63636562636336613665366533333563323239633338663738363931383333356264313166393132
|
||||||
|
30643636303333616161346166323933623432613633643965313366643565343931633338303237
|
||||||
|
35636365333262386135623866343839313836616664663764323938636630393062383462343437
|
||||||
|
32636664663635643934396166373462303638343437623961373362366230633466363936326162
|
||||||
|
38303130346439323863643836666565326530363362306432623036303562636532333966386463
|
||||||
|
31353063363839633736366133353535643064363461653030346432393461623666616666643231
|
||||||
|
63333831653963356632316333396130653934653134623339323438653638643031
|
||||||
16
docker/README.org
Normal file
16
docker/README.org
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#+title: docker 配置说明
|
||||||
|
|
||||||
|
每个及其需要用到的 docker 都通过 =docker-compose.yaml= 配置,避免每次升级都自己手动写命令行。
|
||||||
|
|
||||||
|
* 文件用途
|
||||||
|
|
||||||
|
| 文件 | 说明 |
|
||||||
|
|----------------------+--------------------------------|
|
||||||
|
| y480.yaml | 家用服务器 docker compose 配置 |
|
||||||
|
| xray-config.json | xray 服务器配置 |
|
||||||
|
| V2RayA-RoutingA.conf | V2rayA 路由配置 |
|
||||||
|
|
||||||
|
* docker 镜像对应的 git 仓库
|
||||||
|
|
||||||
|
- https://github.com/ronggang/OWSS
|
||||||
|
- https://github.com/v2rayA/v2rayA
|
||||||
35
docker/V2RayA-RoutingA.conf
Normal file
35
docker/V2RayA-RoutingA.conf
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
default: direct
|
||||||
|
|
||||||
|
# 去广告
|
||||||
|
domain(geosite:category-ads-all) -> block
|
||||||
|
|
||||||
|
domain(geosite: gfw) -> proxy
|
||||||
|
|
||||||
|
# 国外域名即使有中国IP也要优先代理
|
||||||
|
domain(geosite:geolocation-!cn)->proxy
|
||||||
|
|
||||||
|
|
||||||
|
default: proxy
|
||||||
|
|
||||||
|
# 特定域名直连
|
||||||
|
domain(domain: gitweb.gentoo.org, domain: zedhugh.fun, domain: www.gnu.org)->direct
|
||||||
|
domain(geosite:codeberg) -> direct
|
||||||
|
|
||||||
|
domain(domain: linuxeden.com) -> proxy
|
||||||
|
|
||||||
|
# 去广告
|
||||||
|
domain(geosite:category-ads-all) -> block
|
||||||
|
|
||||||
|
# 国外域名即使有中国IP也要优先代理
|
||||||
|
domain(geosite:geolocation-!cn)->proxy
|
||||||
|
|
||||||
|
# 学术网站
|
||||||
|
domain(geosite:google-scholar)->proxy
|
||||||
|
domain(geosite:category-scholar-!cn, geosite:category-scholar-cn)->direct
|
||||||
|
|
||||||
|
# 国内直连
|
||||||
|
domain(geosite:cn) -> direct
|
||||||
|
ip(geoip:cn) -> direct
|
||||||
|
|
||||||
|
# 局域网直连
|
||||||
|
ip(geoip:private) -> direct
|
||||||
17
docker/v2raya.yaml
Normal file
17
docker/v2raya.yaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
services:
|
||||||
|
v2raya:
|
||||||
|
image: mzz2017/v2raya:latest
|
||||||
|
container_name: v2raya
|
||||||
|
restart: always
|
||||||
|
privileged: true
|
||||||
|
network_mode: host
|
||||||
|
volumes:
|
||||||
|
- /lib/modules:/lib/modules:ro
|
||||||
|
- /etc/resolv.conf:/etc/resolv.conf
|
||||||
|
- /etc/v2raya:/etc/v2raya
|
||||||
|
environment:
|
||||||
|
# V2RAYA_V2RAY_BIN: /usr/local/bin/v2ray # 老版本用这个,要开 xray 不设置这个环境变量
|
||||||
|
# V2RAYA_V2RAY_BIN: /usr/bin/v2raya_core # 新版本用这个,或者不设置这个环境变量
|
||||||
|
V2RAYA_LOG_FILE: /tmp/v2raya.log
|
||||||
|
V2RAYA_NFTABLES_SUPPORT: off
|
||||||
|
IPTABLES_MODE: legacy
|
||||||
36
docker/webdav-config.yaml
Normal file
36
docker/webdav-config.yaml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
address: 0.0.0.0
|
||||||
|
port: 46065
|
||||||
|
auth: true
|
||||||
|
prefix: /
|
||||||
|
tls: false
|
||||||
|
behindProxy: true
|
||||||
|
log:
|
||||||
|
format: console
|
||||||
|
colors: true
|
||||||
|
outputs:
|
||||||
|
- /logs/webdav.log
|
||||||
|
logLevel: info
|
||||||
|
|
||||||
|
directory: /data
|
||||||
|
permissions: R
|
||||||
|
|
||||||
|
users:
|
||||||
|
- username: zedhugh
|
||||||
|
password: "{bcrypt}$2a$10$nP6GQJidzLyhwkkQGQH/KOAQq2KjNW5Fbb.I/XD2OD2oxCxEoXbUO"
|
||||||
|
directory: /data
|
||||||
|
permissions: CRUD
|
||||||
|
|
||||||
|
- username: PT
|
||||||
|
password: "{bcrypt}$2a$10$cK9NWvSafxne2Fv6P6ZH7.Q/tVKk5M4pqXgsuOi2bF/zsCopFHsC2"
|
||||||
|
directory: /data/users/PT
|
||||||
|
permissions: CRUD
|
||||||
|
|
||||||
|
- username: v2rayNG
|
||||||
|
password: "{bcrypt}$2a$10$jvjejyOea8Xqsik8a9M71.rvC/0kdFah2WuMCTKHBQJ8PxGkdFmKC"
|
||||||
|
directory: /data/users/v2rayNG
|
||||||
|
permissions: CRUD
|
||||||
|
|
||||||
|
- username: guest
|
||||||
|
password: "guest"
|
||||||
|
directory: /data/public
|
||||||
|
permissions: R
|
||||||
36
docker/webdav.yaml
Normal file
36
docker/webdav.yaml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
x-data-volume: &data-volume
|
||||||
|
type: bind
|
||||||
|
source: /var/db/webDAV
|
||||||
|
target: /data
|
||||||
|
|
||||||
|
x-user-dirs: &user-dirs
|
||||||
|
/data/users/PT
|
||||||
|
/data/users/v2rayNG
|
||||||
|
/data/public
|
||||||
|
|
||||||
|
services:
|
||||||
|
WebDAV-init:
|
||||||
|
image: busybox:latest
|
||||||
|
container_name: webdav-init
|
||||||
|
restart: no
|
||||||
|
volumes:
|
||||||
|
- *data-volume
|
||||||
|
environment:
|
||||||
|
DIRS: *user-dirs
|
||||||
|
command: sh -c "mkdir -p $$DIRS"
|
||||||
|
|
||||||
|
WebDAV:
|
||||||
|
image: hacdias/webdav:latest
|
||||||
|
container_name: webdav
|
||||||
|
restart: always
|
||||||
|
depends_on:
|
||||||
|
WebDAV-init:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
command: ["-c", "/config.yaml"]
|
||||||
|
network_mode: host
|
||||||
|
volumes:
|
||||||
|
- ./webdav-config.yaml:/config.yaml:ro
|
||||||
|
- /var/log:/logs
|
||||||
|
- *data-volume
|
||||||
|
environment:
|
||||||
|
TZ: Asia/Shanghai
|
||||||
10
dot/.bashrc
10
dot/.bashrc
@@ -63,3 +63,13 @@ for _ in ${HOME}/.bashrc.d/*; do
|
|||||||
source "$_"
|
source "$_"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ "$(uname)" == "FreeBSD" ]]; then
|
||||||
|
# ls with color
|
||||||
|
alias ls="ls -G"
|
||||||
|
|
||||||
|
# bash-completion need load manually in FreeBSD
|
||||||
|
if [[ -f /usr/local/share/bash-completion/bash_completion.sh ]]; then
|
||||||
|
source /usr/local/share/bash-completion/bash_completion.sh
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}"))
|
basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
|
||||||
source "${basedir}/function.bash"
|
source "${basedir}/function.bash"
|
||||||
|
|
||||||
unset basedir
|
unset basedir
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}"))
|
basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
|
||||||
source "${basedir}/function.bash"
|
source "${basedir}/function.bash"
|
||||||
|
|
||||||
unset basedir
|
unset basedir
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ generate-bash-completion() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
local completion_dir="${HOME}/.local/share/bash-completion/completions"
|
local completion_dir="${HOME}/.local/share/bash-completion/completions"
|
||||||
local completion_file="$(realpath -m "${completion_dir}/${file}")"
|
local completion_file="${completion_dir}/${file}"
|
||||||
|
|
||||||
if [[ -d "$completion_dir" && ! -w "$completion_dir" ]]; then
|
if [[ -d "$completion_dir" && ! -w "$completion_dir" ]]; then
|
||||||
echo "ERROR: has no permission to write to directory '${completion_dir}'" >&2
|
echo "ERROR: has no permission to write to directory '${completion_dir}'" >&2
|
||||||
@@ -64,7 +64,7 @@ load-bash-completion() {
|
|||||||
local completion_dir="${HOME}/.local/share/bash-completion/completions"
|
local completion_dir="${HOME}/.local/share/bash-completion/completions"
|
||||||
|
|
||||||
for file in "${files[@]}"; do
|
for file in "${files[@]}"; do
|
||||||
local completion_file="$(realpath -m "${completion_dir}/${file}")"
|
local completion_file="${completion_dir}/${file}"
|
||||||
|
|
||||||
if [[ ! -e "$completion_file" ]]; then
|
if [[ ! -e "$completion_file" ]]; then
|
||||||
if [[ "$silence" == false ]]; then
|
if [[ "$silence" == false ]]; then
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}"))
|
basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
|
||||||
source "${basedir}/function.bash"
|
source "${basedir}/function.bash"
|
||||||
|
|
||||||
unset basedir
|
unset basedir
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}"))
|
basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
|
||||||
source "${basedir}/../function.bash"
|
source "${basedir}/../function.bash"
|
||||||
|
|
||||||
unset basedir
|
unset basedir
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}"))
|
basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
|
||||||
source "${basedir}/../function.bash"
|
source "${basedir}/../function.bash"
|
||||||
|
|
||||||
unset basedir
|
unset basedir
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}"))
|
basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
|
||||||
source "${basedir}/function.bash"
|
source "${basedir}/function.bash"
|
||||||
|
|
||||||
unset basedir
|
unset basedir
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}"))
|
basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
|
||||||
source "${basedir}/function.bash"
|
source "${basedir}/function.bash"
|
||||||
|
|
||||||
unset basedir
|
unset basedir
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}"))
|
basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
|
||||||
source "${basedir}/function.bash"
|
source "${basedir}/function.bash"
|
||||||
|
|
||||||
unset basedir
|
unset basedir
|
||||||
|
|||||||
@@ -7,12 +7,14 @@ const direct_ip_list = [
|
|||||||
["192.168.0.0", "255.255.255.0"],
|
["192.168.0.0", "255.255.255.0"],
|
||||||
["192.168.1.0", "255.255.255.0"],
|
["192.168.1.0", "255.255.255.0"],
|
||||||
["192.168.2.0", "255.255.255.0"],
|
["192.168.2.0", "255.255.255.0"],
|
||||||
|
["127.0.0.1", "255.255.255.0"],
|
||||||
];
|
];
|
||||||
|
|
||||||
const direct_domain_list = [
|
const direct_domain_list = [
|
||||||
"zedhugh.fun",
|
"zedhugh.fun",
|
||||||
"codeberg.org",
|
"codeberg.org",
|
||||||
"gitweb.gentoo.org",
|
"gitweb.gentoo.org",
|
||||||
|
"localhost"
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# Maximum cache size to maintain
|
# Maximum cache size to maintain
|
||||||
max_size = 20.0G
|
max_size = 50.0G
|
||||||
|
|
||||||
# Allow others to run 'ebuild' and share the cache.
|
# Allow others to run 'ebuild' and share the cache.
|
||||||
umask = 002
|
umask = 002
|
||||||
|
|
||||||
|
compiler_check = %compiler% -dumpversion
|
||||||
|
|
||||||
|
cache_dir = /var/cache/ccache
|
||||||
|
# chown distcc:portage /var/cache/ccache
|
||||||
|
# chmod 2775 /var/cache/ccache
|
||||||
@@ -20,10 +20,14 @@ QUICKPKG_DEFAULT_OPTS="--include-config y"
|
|||||||
BINPKG_FORMAT="gpkg"
|
BINPKG_FORMAT="gpkg"
|
||||||
EMERGE_DEFAULT_OPTS="--buildpkg --buildpkg-exclude \"virtual/* sys-kernel/*-sources */*-bin\" ${EMERGE_DEFAULT_OPTS}"
|
EMERGE_DEFAULT_OPTS="--buildpkg --buildpkg-exclude \"virtual/* sys-kernel/*-sources */*-bin\" ${EMERGE_DEFAULT_OPTS}"
|
||||||
|
|
||||||
# ccache and distcc
|
# distcc
|
||||||
# FEATURES="distcc ${FEATURES}"
|
FEATURES="distcc ${FEATURES}"
|
||||||
# CCACHE_DIR="/var/cache/ccache"
|
DISTCC_DIR="/var/tmp/distcc"
|
||||||
# FEATURES="ccache ${FEATURES}"
|
|
||||||
|
# ccache
|
||||||
|
FEATURES="ccache ${FEATURES}"
|
||||||
|
CCACHE_DIR="/var/cache/ccache"
|
||||||
|
CCACHE_UMASK="0002"
|
||||||
|
|
||||||
# ABI_X86="32 64"
|
# ABI_X86="32 64"
|
||||||
ALSA_CARDS="hda-intel"
|
ALSA_CARDS="hda-intel"
|
||||||
@@ -34,8 +38,7 @@ VIDEO_CARDS="amdgpu dummy fbdev intel nouveau radeon radeonsi vesa"
|
|||||||
GENTOO_MIRRORS="
|
GENTOO_MIRRORS="
|
||||||
http://distfiles.gentoo.org/
|
http://distfiles.gentoo.org/
|
||||||
"
|
"
|
||||||
MAKEOPTS="-j4 ${MAKEOPTS}"
|
|
||||||
|
|
||||||
DESKTOP_USE="X alsa apng dbus fbcon ffmpeg flac fuse gif gtk gtk2 gtk3 http2 icu jack jpeg mp3 mp4 mpeg mtp nvidia ogg opengl pdf png pipewire pulseaudio svg tiff unicode vaapi vdpau webp xinerama xv xvmc"
|
DESKTOP_USE="X alsa apng dbus fbcon ffmpeg flac fuse gif gtk gtk2 gtk3 http2 icu jack jpeg mp3 mp4 mpeg mtp nvidia ogg opengl pdf png pipewire pulseaudio svg tiff unicode vaapi vdpau vulkan webp xinerama xv xvmc"
|
||||||
#USE="${USE} ${DESKTOP_USE} consolekit cups policykit pulseaudio truetype udev xft xcb xkb -bluetooth -gpm -libva -modemmanager"
|
#USE="${USE} ${DESKTOP_USE} consolekit cups policykit pulseaudio truetype udev xft xcb xkb -bluetooth -gpm -libva -modemmanager"
|
||||||
USE="${USE} ${DESKTOP_USE} bluetooth cups elogind policykit truetype udev xft xcb xkb -gpm -libva -modemmanager"
|
USE="${USE} ${DESKTOP_USE} bluetooth cups elogind policykit truetype udev xft xcb xkb -gpm -libva -modemmanager"
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
app-editors/cursor ~amd64
|
app-editors/cursor ~amd64
|
||||||
app-editors/emacs **
|
app-editors/emacs **
|
||||||
app-editors/vscode ~amd64
|
app-editors/vscode ~amd64
|
||||||
app-emacs/emacs-common ~amd64
|
|
||||||
|
|
||||||
# imput method
|
# imput method
|
||||||
app-i18n/fcitx ~amd64
|
app-i18n/fcitx ~amd64
|
||||||
@@ -15,7 +14,7 @@ app-i18n/librime ~amd64
|
|||||||
# dev-libs/tree-sitter* ~amd64
|
# dev-libs/tree-sitter* ~amd64
|
||||||
|
|
||||||
# audroid studio
|
# audroid studio
|
||||||
dev-util/android-studio::gentoo ~amd64
|
dev-util/android-studio ~amd64
|
||||||
|
|
||||||
# frp
|
# frp
|
||||||
net-vpn/frp ~amd64
|
net-vpn/frp ~amd64
|
||||||
@@ -50,3 +49,6 @@ sci-ml/llama-cpp **
|
|||||||
|
|
||||||
# nvidia cuda toolkit
|
# nvidia cuda toolkit
|
||||||
dev-util/nvidia-cuda-toolkit ~amd64
|
dev-util/nvidia-cuda-toolkit ~amd64
|
||||||
|
|
||||||
|
# proxy
|
||||||
|
net-proxy/shadowsocks-rust ~amd64
|
||||||
@@ -22,7 +22,7 @@ net-im/wemeet wemeet_license
|
|||||||
net-misc/anydesk AnyDesk-TOS
|
net-misc/anydesk AnyDesk-TOS
|
||||||
net-misc/baidunetdisk BaiduNetDisk
|
net-misc/baidunetdisk BaiduNetDisk
|
||||||
net-misc/teamviewer TeamViewer
|
net-misc/teamviewer TeamViewer
|
||||||
sys-kernel/linux-firmware no-source-code linux-fw-redistributable
|
sys-kernel/linux-firmware linux-fw-redistributable
|
||||||
www-client/google-chrome google-chrome
|
www-client/google-chrome google-chrome
|
||||||
www-client/microsoft-edge microsoft-edge
|
www-client/microsoft-edge microsoft-edge
|
||||||
www-plugins/adobe-flash AdobeFlash-11.x
|
www-plugins/adobe-flash AdobeFlash-11.x
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
dev-lang/rust
|
dev-lang/rust
|
||||||
net-proxy/shadowsocks-rust::gentoo-zh
|
|
||||||
>=x11-drivers/nvidia-drivers-581
|
>=x11-drivers/nvidia-drivers-581
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ x11-terms/rxvt-unicode 256-color blink fading-colors pixbuf unicode3
|
|||||||
#www-servers/uwsgi cgi python
|
#www-servers/uwsgi cgi python
|
||||||
|
|
||||||
# emacs
|
# emacs
|
||||||
app-editors/emacs cairo dynamic-loading gtk gui gzip-el harfbuzz json libxml2 sound source sqlite tree-sitter wide-int
|
app-editors/emacs cairo dynamic-loading -gtk gui gzip-el harfbuzz json libxml2 sound source sqlite tree-sitter wide-int
|
||||||
app-emacs/emacs-common gui
|
app-emacs/emacs-common gui
|
||||||
|
|
||||||
# 7zip
|
# 7zip
|
||||||
|
|||||||
Binary file not shown.
@@ -40,7 +40,7 @@ docker 拉取命令
|
|||||||
--network=host \
|
--network=host \
|
||||||
--name v2raya \
|
--name v2raya \
|
||||||
-e V2RAYA_LOG_FILE=/tmp/v2raya.log \
|
-e V2RAYA_LOG_FILE=/tmp/v2raya.log \
|
||||||
-e V2RAYA_V2RAY_BIN=/usr/local/bin/v2ray \
|
-e V2RAYA_V2RAY_BIN=/usr/bin/v2raya_core \
|
||||||
-e V2RAYA_NFTABLES_SUPPORT=off \
|
-e V2RAYA_NFTABLES_SUPPORT=off \
|
||||||
-e IPTABLES_MODE=legacy \
|
-e IPTABLES_MODE=legacy \
|
||||||
-v /lib/modules:/lib/modules:ro \
|
-v /lib/modules:/lib/modules:ro \
|
||||||
|
|||||||
Reference in New Issue
Block a user