Skip to content

Instantly share code, notes, and snippets.

@karuboniru
Last active May 5, 2021 09:48
Show Gist options
  • Select an option

  • Save karuboniru/9892e3e76d4470f5f21cb7291b02b1e6 to your computer and use it in GitHub Desktop.

Select an option

Save karuboniru/9892e3e76d4470f5f21cb7291b02b1e6 to your computer and use it in GitHub Desktop.
variant: fcos
version: 1.0.0
passwd:
users:
- name: core
ssh_authorized_keys:
- "ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBFlngteAj8k7Fv0Ht6dFtQvA+Svxn/qnTuDfUzEvaU33QEyN9jDaJyMdct4elU9ec9aQheskwv5ULSvv7lzgs4ZhgtgGNRfH0mC8cI49DGdSxucaAuPiHmKNTfQa88iZxg== CARD AUTH pubkey pkcs11:id=%04;object=CARD%20AUTH%20pubkey;token=Karuboniru;manufacturer=piv_II?module-path=/usr/lib64/pkcs11/opensc-pkcs11.so"
groups: [ sudo, wheel ]
storage:
files:
- path: /var/lib/v2ray/config.json
overwrite: true
contents:
inline: |
{
"inbounds": [
{
"port": 20005,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "<PUT UUID HERE>",
"alterId": 64
}
]
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
]
}
mode: 0644
- path: /etc/modules-load.d/80-bbr.conf
contents:
inline: |
tcp_bbr
- path: /etc/sysctl.d/80-bbr.conf
contents:
inline: |
net.ipv4.tcp_congestion_control = bbr
systemd:
units:
- name: v2ray.service
enabled: true
contents: |
[Unit]
Description=Run v2ray
After=network-online.target
Wants=network-online.target
[Service]
ExecStartPre=-chcon -t container_file_t -R /var/lib/v2ray
ExecStartPre=-/bin/podman kill v2ray
ExecStartPre=-/bin/podman rm v2ray
ExecStartPre=-/bin/firewall-cmd --add-port=20005/tcp
ExecStartPre=-/bin/firewall-cmd --add-port=20005/udp
ExecStartPre=-/bin/podman pull docker.io/v2fly/v2fly-core:latest
ExecStart=/bin/podman run --name v2ray --volume /var/lib/v2ray:/etc/v2ray:z --net=host docker.io/v2fly/v2fly-core:latest
ExecStop=/bin/podman stop v2ray
ExecStop=-/bin/firewall-cmd --remove-port=20005/tcp
ExecStop=-/bin/firewall-cmd --remove-port=20005/udp
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment