All New

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Register

Login

All New Register Login

All gists

Recently created
Least recently created
Recently updated
Least recently updated

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 => INFO: ๐ŸŸข ๐Ÿ”’ Restarting WireGuard...
2 => DEBUG: ๐Ÿ” rule::apply: peer_name=desktop-roboclean ip=10.1.1.3
3 => DEBUG: ๐Ÿ” Applied rule 'user' to: 10.1.1.3
4 => DEBUG: ๐Ÿ” rule::apply: peer_name=desktop-test ip=10.1.1.1
5 => DEBUG: ๐Ÿ” Applied rule 'user' to: 10.1.1.1
6 => DEBUG: ๐Ÿ” rule::apply: peer_name=desktop-test1 ip=10.1.1.2
7 => DEBUG: ๐Ÿ” Applied rule 'user' to: 10.1.1.2
8 => DEBUG: ๐Ÿ” rule::apply: peer_name=guest-test ip=10.1.103.1
9 => DEBUG: ๐Ÿ” Applied rule 'guest' to: 10.1.103.1
10 => DEBUG: ๐Ÿ” rule::apply: peer_name=guest-test2 ip=10.1.103.2

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 root@wireguard:~# wgctl group unblock --name test
2 => DEBUG: ๐Ÿ” _unblock_peer: restoring phone-test
3 => DEBUG: ๐Ÿ” Unblocked all traffic from: 10.1.3.5
4 => DEBUG: ๐Ÿ” flush_peer: starting for 10.1.3.5
5 => DEBUG: ๐Ÿ” flush_peer: removed 0 FORWARD rules for: 10.1.3.5
6 => DEBUG: ๐Ÿ” Unwatched client: phone-test
7 => DEBUG: ๐Ÿ” Added peer to server config: phone-test
8 => DEBUG: ๐Ÿ” WireGuard config reloaded
9 => DEBUG: ๐Ÿ” _unblock_peer: done
10 => DEBUG: ๐Ÿ” _unblock_peer: restoring phone-test1

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 function peers::is_blocked() {
2 local name="${1:-}"
3 local block_file
4 block_file="$(ctx::block::path "${name}.block")"
5 [[ ! -f "$block_file" ]] && return 1
6 local result
7 result=$(json::block_is_blocked "$block_file")
8 [[ "$result" == "true" ]]
9 }

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 function fw::restore_block_rules() {
2 while IFS= read -r peer_name; do
3 local block_file
4 block_file="$(ctx::block::path "${peer_name}.block")"
5 [[ ! -f "$block_file" ]] && continue
6
7 local client_ip
8 client_ip=$(peers::get_ip "$peer_name")
9 [[ -z "$client_ip" ]] && continue

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 function cmd::inspect::_blocks_info() {
2 local name="${1:-}"
3 local block_file
4 block_file="$(ctx::block::path "${name}.block")"
5 [[ ! -f "$block_file" ]] && return 0
6
7 local data
8 data=$(json::block_get "$block_file")
9 [[ -z "$data" ]] && return 0

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 local block_file
2 block_file=$(block::file "$name")
3 if [[ -f "$block_file" ]]; then
4 local is_bl
5 is_bl=$(json::block_is_blocked "$block_file")
6 _restricted["$name"]=$( [[ "$is_bl" == "true" ]] && echo true || echo false )
7 else
8 _restricted["$name"]=false
9 fi

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 while IFS= read -r name; do
2 [[ -f "$(ctx::block::path "${name}.block")" ]] \
3 && p_restricted["$name"]=true || p_restricted["$name"]=false
4 local pubkey
5 pubkey=$(keys::public "$name" 2>/dev/null || echo "")
6 if [[ -n "$pubkey" ]] && ! echo "$wg_peers" | grep -qF "$pubkey"; then
7 p_blocked["$name"]=true
8 else
9 p_blocked["$name"]=false
10 fi

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 local block_file
2 block_file="$(ctx::block::path "${name}.block")"
3 local blocks=""
4 if [[ -f "$block_file" ]] && [[ -s "$block_file" ]]; then
5 while IFS=" " read -r client_ip target port proto; do
6 if [[ -z "$target" ]]; then
7 blocks+=" all traffic blocked\n"
8 else
9 local rule=" ${target}"
10 [[ -n "$port" ]] && rule+=":${port}/${proto}"

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 function cmd::unblock::_unblock_all() {
2 local name="${1:?name required}"
3 local client_ip="${2:?client_ip required}"
4 local quiet="${3:-false}"
5
6 local block_file
7 block_file="$(ctx::block::path "${name}.block")"
8
9 # Set direct block to false
10 block::set_direct "$name" "$client_ip" "false"

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 5 months ago
1 wgctl group block --name test
2 /etc/wireguard/wgctl/core/json_helper.py
3 => DEBUG: ๐Ÿ” Blocked all traffic from: 10.1.3.5
4 => DEBUG: ๐Ÿ” apply_full: calling block::add_rule for phone-test 10.1.3.5
5 => DEBUG: ๐Ÿ” block::add_rule: file=/etc/wireguard/.wgctl/blocks/phone-test.block type=full name=full block
6 => DEBUG: ๐Ÿ” block::add_rule: done, file contents:
7 {
8 "peer_ip": "10.1.3.5",
9 "blocked_direct": false,
10 "blocked_by_groups": [
Newer Older

Powered by Opengist โ‹… Load: 108msโ‹…

English
ฤŒeลกtina Deutsch English Espaรฑol Franรงais Magyar Italiano ๆ—ฅๆœฌ่ชž Polski Portuguรชs ะ ัƒััะบะธะน Tรผrkรงe ะฃะบั€ะฐั—ะฝััŒะบะฐ ไธญๆ–‡ ็น้ซ”ไธญๆ–‡
โ‹… KrilHub