meta: release v1.3.1

pull/103/head v1.3.1
Jake McGinty 2021-06-01 00:23:14 +09:00
parent b7f299c147
commit ba0b062ce9
22 changed files with 248 additions and 85 deletions

View File

@ -75,6 +75,7 @@ jobs:
build-rpm: build-rpm:
name: 'Build RPM packages' name: 'Build RPM packages'
continue-on-error: true
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:

10
Cargo.lock generated
View File

@ -151,7 +151,7 @@ dependencies = [
[[package]] [[package]]
name = "client" name = "client"
version = "1.3.0" version = "1.3.1"
dependencies = [ dependencies = [
"colored", "colored",
"dialoguer", "dialoguer",
@ -895,7 +895,7 @@ dependencies = [
[[package]] [[package]]
name = "server" name = "server"
version = "1.3.0" version = "1.3.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -928,7 +928,7 @@ dependencies = [
[[package]] [[package]]
name = "shared" name = "shared"
version = "1.3.0" version = "1.3.1"
dependencies = [ dependencies = [
"colored", "colored",
"dialoguer", "dialoguer",
@ -1280,7 +1280,7 @@ checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
[[package]] [[package]]
name = "wgctrl" name = "wgctrl"
version = "1.3.0" version = "1.3.1"
dependencies = [ dependencies = [
"base64", "base64",
"hex", "hex",
@ -1293,7 +1293,7 @@ dependencies = [
[[package]] [[package]]
name = "wgctrl-sys" name = "wgctrl-sys"
version = "1.3.0" version = "1.3.1"
dependencies = [ dependencies = [
"bindgen", "bindgen",
"cc", "cc",

View File

@ -204,10 +204,10 @@ brew install tonarino/innernet/innernet
```sh ```sh
# to install innernet: # to install innernet:
cargo install --git https://github.com/tonarino/innernet --tag v1.3.0 client cargo install --git https://github.com/tonarino/innernet --tag v1.3.1 client
# to install innernet-server: # to install innernet-server:
cargo install --git https://github.com/tonarino/innernet --tag v1.3.0 server cargo install --git https://github.com/tonarino/innernet --tag v1.3.1 server
``` ```
Note that you'll be responsible for updating manually. Note that you'll be responsible for updating manually.

View File

@ -7,7 +7,7 @@ license = "MIT"
name = "client" name = "client"
publish = false publish = false
repository = "https://github.com/tonarino/innernet" repository = "https://github.com/tonarino/innernet"
version = "1.3.0" version = "1.3.1"
[[bin]] [[bin]]
name = "innernet" name = "innernet"

View File

@ -1,47 +1,53 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.3. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.3.
.TH INNERNET-SERVER "8" "May 2021" "innernet-server 1.3.0" "System Administration Utilities" .TH INNERNET-SERVER "8" "June 2021" "innernet-server 1.3.1" "System Administration Utilities"
.SH NAME .SH NAME
innernet-server \- manual page for innernet-server 1.3.0 innernet-server \- manual page for innernet-server 1.3.1
.SH DESCRIPTION .SH DESCRIPTION
innernet\-server 1.3.0 innernet\-server 1.3.1
A server to coordinate innernet networks. A server to coordinate innernet networks.
.SS "USAGE:" .SS "USAGE:"
.IP .IP
innernet\-server [FLAGS] [OPTIONS] <SUBCOMMAND> innernet\-server [OPTIONS] <SUBCOMMAND>
.SS "FLAGS:" .SS "OPTIONS:"
.TP
\fB\-\-no\-routing\fR
Whether the routing should be done by innernet or is done by an external tool like e.g.
babeld
.TP
\fB\-\-backend\fR <backend>
Specify a WireGuard backend to use. If not set, innernet will auto\-select based on
availability [default: kernel] [possible values: kernel, userspace]
.TP .TP
\fB\-h\fR, \fB\-\-help\fR \fB\-h\fR, \fB\-\-help\fR
Prints help information Prints help information
.TP .TP
\fB\-\-no\-routing\fR
Whether the routing should be done by innernet or is done by an external tool like e.g. babeld
.TP
\fB\-V\fR, \fB\-\-version\fR \fB\-V\fR, \fB\-\-version\fR
Prints version information Prints version information
.SS "OPTIONS:"
.TP
\fB\-\-backend\fR <backend>
Specify a WireGuard backend to use. If not set, innernet will auto\-select based on
availability [default: userspace] [possible values: userspace]
.SS "SUBCOMMANDS:" .SS "SUBCOMMANDS:"
.TP .TP
add\-cidr
Add a new CIDR to an existing network
.TP
add\-peer
Add a peer to an existing network
.TP
delete\-cidr
Delete a CIDR
.TP
help
Prints this message or the help of the given subcommand(s)
.TP
new new
Create a new network Create a new network
.TP .TP
uninstall
Permanently uninstall a created network, rendering it unusable. Use with care
.TP
serve serve
Serve the coordinating server for an existing network Serve the coordinating server for an existing network
.TP .TP
uninstall add\-peer
Permanently uninstall a created network, rendering it unusable. Use with care Add a peer to an existing network
.TP
rename\-peer
Rename an existing peer
.TP
add\-cidr
Add a new CIDR to an existing network
.TP
delete\-cidr
Delete a CIDR
.TP
completions
Generate shell completion scripts
.TP
help
Prints this message or the help of the given subcommand(s)

Binary file not shown.

View File

@ -34,6 +34,9 @@ _innernet-server() {
new) new)
cmd+="__new" cmd+="__new"
;; ;;
rename-peer)
cmd+="__rename__peer"
;;
serve) serve)
cmd+="__serve" cmd+="__serve"
;; ;;
@ -47,7 +50,7 @@ _innernet-server() {
case "${cmd}" in case "${cmd}" in
innernet-server) innernet-server)
opts=" -h -V --no-routing --help --version --backend new uninstall serve add-peer add-cidr delete-cidr completions help init init" opts=" -h -V --no-routing --help --version --backend new uninstall serve add-peer rename-peer add-cidr delete-cidr completions help init init"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
@ -243,6 +246,29 @@ _innernet-server() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
;; ;;
innernet__server__rename__peer)
opts=" -h -V --yes --help --version --name --new-name <interface> "
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--name)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--new-name)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
innernet__server__serve) innernet__server__serve)
opts=" -h -V --no-routing --help --version --backend <interface> " opts=" -h -V --no-routing --help --version --backend <interface> "
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then

View File

@ -25,6 +25,7 @@ edit:completion:arg-completer[innernet-server] = [@words]{
cand uninstall 'Permanently uninstall a created network, rendering it unusable. Use with care' cand uninstall 'Permanently uninstall a created network, rendering it unusable. Use with care'
cand serve 'Serve the coordinating server for an existing network' cand serve 'Serve the coordinating server for an existing network'
cand add-peer 'Add a peer to an existing network' cand add-peer 'Add a peer to an existing network'
cand rename-peer 'Rename an existing peer'
cand add-cidr 'Add a new CIDR to an existing network' cand add-cidr 'Add a new CIDR to an existing network'
cand delete-cidr 'Delete a CIDR' cand delete-cidr 'Delete a CIDR'
cand completions 'Generate shell completion scripts' cand completions 'Generate shell completion scripts'
@ -69,6 +70,15 @@ edit:completion:arg-completer[innernet-server] = [@words]{
cand -V 'Prints version information' cand -V 'Prints version information'
cand --version 'Prints version information' cand --version 'Prints version information'
} }
&'innernet-server;rename-peer'= {
cand --name 'Name of peer to rename'
cand --new-name 'The new name of the peer'
cand --yes 'Bypass confirmation'
cand -h 'Prints help information'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
}
&'innernet-server;add-cidr'= { &'innernet-server;add-cidr'= {
cand --name 'The CIDR name (eg. "engineers")' cand --name 'The CIDR name (eg. "engineers")'
cand --cidr 'The CIDR network (eg. "10.42.5.0/24")' cand --cidr 'The CIDR network (eg. "10.42.5.0/24")'

View File

@ -6,6 +6,7 @@ complete -c innernet-server -n "__fish_use_subcommand" -f -a "new" -d 'Create a
complete -c innernet-server -n "__fish_use_subcommand" -f -a "uninstall" -d 'Permanently uninstall a created network, rendering it unusable. Use with care' complete -c innernet-server -n "__fish_use_subcommand" -f -a "uninstall" -d 'Permanently uninstall a created network, rendering it unusable. Use with care'
complete -c innernet-server -n "__fish_use_subcommand" -f -a "serve" -d 'Serve the coordinating server for an existing network' complete -c innernet-server -n "__fish_use_subcommand" -f -a "serve" -d 'Serve the coordinating server for an existing network'
complete -c innernet-server -n "__fish_use_subcommand" -f -a "add-peer" -d 'Add a peer to an existing network' complete -c innernet-server -n "__fish_use_subcommand" -f -a "add-peer" -d 'Add a peer to an existing network'
complete -c innernet-server -n "__fish_use_subcommand" -f -a "rename-peer" -d 'Rename an existing peer'
complete -c innernet-server -n "__fish_use_subcommand" -f -a "add-cidr" -d 'Add a new CIDR to an existing network' complete -c innernet-server -n "__fish_use_subcommand" -f -a "add-cidr" -d 'Add a new CIDR to an existing network'
complete -c innernet-server -n "__fish_use_subcommand" -f -a "delete-cidr" -d 'Delete a CIDR' complete -c innernet-server -n "__fish_use_subcommand" -f -a "delete-cidr" -d 'Delete a CIDR'
complete -c innernet-server -n "__fish_use_subcommand" -f -a "completions" -d 'Generate shell completion scripts' complete -c innernet-server -n "__fish_use_subcommand" -f -a "completions" -d 'Generate shell completion scripts'
@ -33,6 +34,11 @@ complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -l auto-ip
complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -l yes -d 'Bypass confirmation' complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -l yes -d 'Bypass confirmation'
complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -s h -l help -d 'Prints help information' complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -s h -l help -d 'Prints help information'
complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -s V -l version -d 'Prints version information' complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -s V -l version -d 'Prints version information'
complete -c innernet-server -n "__fish_seen_subcommand_from rename-peer" -l name -d 'Name of peer to rename'
complete -c innernet-server -n "__fish_seen_subcommand_from rename-peer" -l new-name -d 'The new name of the peer'
complete -c innernet-server -n "__fish_seen_subcommand_from rename-peer" -l yes -d 'Bypass confirmation'
complete -c innernet-server -n "__fish_seen_subcommand_from rename-peer" -s h -l help -d 'Prints help information'
complete -c innernet-server -n "__fish_seen_subcommand_from rename-peer" -s V -l version -d 'Prints version information'
complete -c innernet-server -n "__fish_seen_subcommand_from add-cidr" -l name -d 'The CIDR name (eg. "engineers")' complete -c innernet-server -n "__fish_seen_subcommand_from add-cidr" -l name -d 'The CIDR name (eg. "engineers")'
complete -c innernet-server -n "__fish_seen_subcommand_from add-cidr" -l cidr -d 'The CIDR network (eg. "10.42.5.0/24")' complete -c innernet-server -n "__fish_seen_subcommand_from add-cidr" -l cidr -d 'The CIDR network (eg. "10.42.5.0/24")'
complete -c innernet-server -n "__fish_seen_subcommand_from add-cidr" -l parent -d 'The CIDR parent name' complete -c innernet-server -n "__fish_seen_subcommand_from add-cidr" -l parent -d 'The CIDR parent name'

View File

@ -30,6 +30,7 @@ Register-ArgumentCompleter -Native -CommandName 'innernet-server' -ScriptBlock {
[CompletionResult]::new('uninstall', 'uninstall', [CompletionResultType]::ParameterValue, 'Permanently uninstall a created network, rendering it unusable. Use with care') [CompletionResult]::new('uninstall', 'uninstall', [CompletionResultType]::ParameterValue, 'Permanently uninstall a created network, rendering it unusable. Use with care')
[CompletionResult]::new('serve', 'serve', [CompletionResultType]::ParameterValue, 'Serve the coordinating server for an existing network') [CompletionResult]::new('serve', 'serve', [CompletionResultType]::ParameterValue, 'Serve the coordinating server for an existing network')
[CompletionResult]::new('add-peer', 'add-peer', [CompletionResultType]::ParameterValue, 'Add a peer to an existing network') [CompletionResult]::new('add-peer', 'add-peer', [CompletionResultType]::ParameterValue, 'Add a peer to an existing network')
[CompletionResult]::new('rename-peer', 'rename-peer', [CompletionResultType]::ParameterValue, 'Rename an existing peer')
[CompletionResult]::new('add-cidr', 'add-cidr', [CompletionResultType]::ParameterValue, 'Add a new CIDR to an existing network') [CompletionResult]::new('add-cidr', 'add-cidr', [CompletionResultType]::ParameterValue, 'Add a new CIDR to an existing network')
[CompletionResult]::new('delete-cidr', 'delete-cidr', [CompletionResultType]::ParameterValue, 'Delete a CIDR') [CompletionResult]::new('delete-cidr', 'delete-cidr', [CompletionResultType]::ParameterValue, 'Delete a CIDR')
[CompletionResult]::new('completions', 'completions', [CompletionResultType]::ParameterValue, 'Generate shell completion scripts') [CompletionResult]::new('completions', 'completions', [CompletionResultType]::ParameterValue, 'Generate shell completion scripts')
@ -79,6 +80,16 @@ Register-ArgumentCompleter -Native -CommandName 'innernet-server' -ScriptBlock {
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information') [CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet-server;rename-peer' {
[CompletionResult]::new('--name', 'name', [CompletionResultType]::ParameterName, 'Name of peer to rename')
[CompletionResult]::new('--new-name', 'new-name', [CompletionResultType]::ParameterName, 'The new name of the peer')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break
}
'innernet-server;add-cidr' { 'innernet-server;add-cidr' {
[CompletionResult]::new('--name', 'name', [CompletionResultType]::ParameterName, 'The CIDR name (eg. "engineers")') [CompletionResult]::new('--name', 'name', [CompletionResultType]::ParameterName, 'The CIDR name (eg. "engineers")')
[CompletionResult]::new('--cidr', 'cidr', [CompletionResultType]::ParameterName, 'The CIDR network (eg. "10.42.5.0/24")') [CompletionResult]::new('--cidr', 'cidr', [CompletionResultType]::ParameterName, 'The CIDR network (eg. "10.42.5.0/24")')

View File

@ -106,6 +106,18 @@ _arguments "${_arguments_options[@]}" \
':interface:_files' \ ':interface:_files' \
&& ret=0 && ret=0
;; ;;
(rename-peer)
_arguments "${_arguments_options[@]}" \
'--name=[Name of peer to rename]' \
'--new-name=[The new name of the peer]' \
'--yes[Bypass confirmation]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0
;;
(add-cidr) (add-cidr)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'--name=[The CIDR name (eg. "engineers")]' \ '--name=[The CIDR name (eg. "engineers")]' \
@ -159,6 +171,7 @@ _innernet-server_commands() {
"uninstall:Permanently uninstall a created network, rendering it unusable. Use with care" \ "uninstall:Permanently uninstall a created network, rendering it unusable. Use with care" \
"serve:Serve the coordinating server for an existing network" \ "serve:Serve the coordinating server for an existing network" \
"add-peer:Add a peer to an existing network" \ "add-peer:Add a peer to an existing network" \
"rename-peer:Rename an existing peer" \
"add-cidr:Add a new CIDR to an existing network" \ "add-cidr:Add a new CIDR to an existing network" \
"delete-cidr:Delete a CIDR" \ "delete-cidr:Delete a CIDR" \
"completions:Generate shell completion scripts" \ "completions:Generate shell completion scripts" \
@ -222,6 +235,13 @@ _innernet-server__new_commands() {
) )
_describe -t commands 'innernet-server new commands' commands "$@" _describe -t commands 'innernet-server new commands' commands "$@"
} }
(( $+functions[_innernet-server__rename-peer_commands] )) ||
_innernet-server__rename-peer_commands() {
local commands; commands=(
)
_describe -t commands 'innernet-server rename-peer commands' commands "$@"
}
(( $+functions[_innernet-server__serve_commands] )) || (( $+functions[_innernet-server__serve_commands] )) ||
_innernet-server__serve_commands() { _innernet-server__serve_commands() {
local commands; commands=( local commands; commands=(

View File

@ -1,47 +1,63 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.3. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.3.
.TH INNERNET "8" "May 2021" "innernet 1.3.0" "System Administration Utilities" .TH INNERNET "8" "June 2021" "innernet 1.3.1" "System Administration Utilities"
.SH NAME .SH NAME
innernet \- manual page for innernet 1.3.0 innernet \- manual page for innernet 1.3.1
.SH DESCRIPTION .SH DESCRIPTION
innernet 1.3.0 innernet 1.3.1
A client to manage innernet network interfaces. A client to manage innernet network interfaces.
.SS "USAGE:" .SS "USAGE:"
.IP .IP
innernet [FLAGS] [OPTIONS] [SUBCOMMAND] innernet [OPTIONS] [SUBCOMMAND]
.SS "FLAGS:" .SS "OPTIONS:"
.HP .HP
\fB\-h\fR, \fB\-\-help\fR \fB\-v\fR, \fB\-\-verbose\fR
.IP .IP
Prints help information Verbose output, use \fB\-vv\fR for even higher verbositude
.HP .HP
\fB\-\-no\-routing\fR \fB\-\-no\-routing\fR
.IP .IP
Whether the routing should be done by innernet or is done by an external tool like e.g. babeld Whether the routing should be done by innernet or is done by an external tool like e.g. babeld
.HP .HP
\fB\-V\fR, \fB\-\-version\fR
.IP
Prints version information
.HP
\fB\-v\fR
.SS "OPTIONS:"
.HP
\fB\-\-backend\fR <backend> \fB\-\-backend\fR <backend>
.IP .IP
Specify a WireGuard backend to use. If not set, innernet will auto\-select based on availability [default: Specify a WireGuard backend to use. If not set, innernet will auto\-select based on availability [default:
userspace] [possible values: userspace] kernel] [possible values: kernel, userspace]
.HP
\fB\-h\fR, \fB\-\-help\fR
.IP
Prints help information
.HP
\fB\-V\fR, \fB\-\-version\fR
.IP
Prints version information
.SS "SUBCOMMANDS:" .SS "SUBCOMMANDS:"
.TP .TP
add\-association install
Add an association between CIDRs Install a new innernet config
.TP .TP
add\-cidr show
Add a new CIDR Enumerate all innernet connections
.TP
up
Bring up your local interface, and update it with latest peer list
.TP
fetch
Fetch and update your local interface with the latest peer list
.TP
uninstall
Uninstall an innernet network
.TP
down
Bring down the interface (equivalent to "wg\-quick down <interface>")
.TP .TP
add\-peer add\-peer
Add a new peer Add a new peer
.TP .TP
delete\-association rename\-peer
Delete an association between CIDRs Rename a peer
.TP
add\-cidr
Add a new CIDR
.TP .TP
delete\-cidr delete\-cidr
Delete a CIDR Delete a CIDR
@ -49,35 +65,26 @@ Delete a CIDR
disable\-peer disable\-peer
Disable an enabled peer Disable an enabled peer
.TP .TP
down
Bring down the interface (equivalent to "wg\-quick down <interface>")
.TP
enable\-peer enable\-peer
Enable a disabled peer Enable a disabled peer
.TP .TP
fetch add\-association
Fetch and update your local interface with the latest peer list Add an association between CIDRs
.TP .TP
help delete\-association
Prints this message or the help of the given subcommand(s) Delete an association between CIDRs
.TP
install
Install a new innernet config
.TP .TP
list\-associations list\-associations
List existing assocations between CIDRs List existing assocations between CIDRs
.TP .TP
override\-endpoint
Override your external endpoint that the server sends to other peers
.TP
set\-listen\-port set\-listen\-port
Set the local listen port Set the local listen port
.TP .TP
show override\-endpoint
Enumerate all innernet connections Override your external endpoint that the server sends to other peers
.TP .TP
uninstall completions
Uninstall an innernet network Generate shell completion scripts
.TP .TP
up help
Bring up your local interface, and update it with latest peer list Prints this message or the help of the given subcommand(s)

Binary file not shown.

View File

@ -61,6 +61,9 @@ _innernet() {
redeem) redeem)
cmd+="__redeem" cmd+="__redeem"
;; ;;
rename-peer)
cmd+="__rename__peer"
;;
set-listen-port) set-listen-port)
cmd+="__set__listen__port" cmd+="__set__listen__port"
;; ;;
@ -80,7 +83,7 @@ _innernet() {
case "${cmd}" in case "${cmd}" in
innernet) innernet)
opts=" -v -h -V --no-routing --help --version --backend install show up fetch uninstall down add-peer add-cidr delete-cidr disable-peer enable-peer add-association delete-association list-associations set-listen-port override-endpoint completions help redeem redeem list list" opts=" -v -h -V --verbose --no-routing --help --version --backend install show up fetch uninstall down add-peer rename-peer add-cidr delete-cidr disable-peer enable-peer add-association delete-association list-associations set-listen-port override-endpoint completions help redeem redeem list list"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
@ -399,6 +402,29 @@ _innernet() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
;; ;;
innernet__rename__peer)
opts=" -h -V --yes --help --version --name --new-name <interface> "
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--name)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--new-name)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
innernet__set__listen__port) innernet__set__listen__port)
opts=" -u -h -V --unset --help --version <interface> " opts=" -u -h -V --unset --help --version <interface> "
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then

View File

@ -16,7 +16,8 @@ edit:completion:arg-completer[innernet] = [@words]{
completions = [ completions = [
&'innernet'= { &'innernet'= {
cand --backend 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability' cand --backend 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability'
cand -v 'v' cand -v 'Verbose output, use -vv for even higher verbositude'
cand --verbose 'Verbose output, use -vv for even higher verbositude'
cand --no-routing 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld' cand --no-routing 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld'
cand -h 'Prints help information' cand -h 'Prints help information'
cand --help 'Prints help information' cand --help 'Prints help information'
@ -29,6 +30,7 @@ edit:completion:arg-completer[innernet] = [@words]{
cand uninstall 'Uninstall an innernet network' cand uninstall 'Uninstall an innernet network'
cand down 'Bring down the interface (equivalent to "wg-quick down <interface>")' cand down 'Bring down the interface (equivalent to "wg-quick down <interface>")'
cand add-peer 'Add a new peer' cand add-peer 'Add a new peer'
cand rename-peer 'Rename a peer'
cand add-cidr 'Add a new CIDR' cand add-cidr 'Add a new CIDR'
cand delete-cidr 'Delete a CIDR' cand delete-cidr 'Delete a CIDR'
cand disable-peer 'Disable an enabled peer' cand disable-peer 'Disable an enabled peer'
@ -108,6 +110,15 @@ edit:completion:arg-completer[innernet] = [@words]{
cand -V 'Prints version information' cand -V 'Prints version information'
cand --version 'Prints version information' cand --version 'Prints version information'
} }
&'innernet;rename-peer'= {
cand --name 'Name of peer to rename'
cand --new-name 'The new name of the peer'
cand --yes 'Bypass confirmation'
cand -h 'Prints help information'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
}
&'innernet;add-cidr'= { &'innernet;add-cidr'= {
cand --name 'The CIDR name (eg. "engineers")' cand --name 'The CIDR name (eg. "engineers")'
cand --cidr 'The CIDR network (eg. "10.42.5.0/24")' cand --cidr 'The CIDR network (eg. "10.42.5.0/24")'

View File

@ -1,5 +1,5 @@
complete -c innernet -n "__fish_use_subcommand" -l backend -d 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability' -r -f -a "kernel userspace" complete -c innernet -n "__fish_use_subcommand" -l backend -d 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability' -r -f -a "kernel userspace"
complete -c innernet -n "__fish_use_subcommand" -s v complete -c innernet -n "__fish_use_subcommand" -s v -l verbose -d 'Verbose output, use -vv for even higher verbositude'
complete -c innernet -n "__fish_use_subcommand" -l no-routing -d 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld' complete -c innernet -n "__fish_use_subcommand" -l no-routing -d 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld'
complete -c innernet -n "__fish_use_subcommand" -s h -l help -d 'Prints help information' complete -c innernet -n "__fish_use_subcommand" -s h -l help -d 'Prints help information'
complete -c innernet -n "__fish_use_subcommand" -s V -l version -d 'Prints version information' complete -c innernet -n "__fish_use_subcommand" -s V -l version -d 'Prints version information'
@ -10,6 +10,7 @@ complete -c innernet -n "__fish_use_subcommand" -f -a "fetch" -d 'Fetch and upda
complete -c innernet -n "__fish_use_subcommand" -f -a "uninstall" -d 'Uninstall an innernet network' complete -c innernet -n "__fish_use_subcommand" -f -a "uninstall" -d 'Uninstall an innernet network'
complete -c innernet -n "__fish_use_subcommand" -f -a "down" -d 'Bring down the interface (equivalent to "wg-quick down <interface>")' complete -c innernet -n "__fish_use_subcommand" -f -a "down" -d 'Bring down the interface (equivalent to "wg-quick down <interface>")'
complete -c innernet -n "__fish_use_subcommand" -f -a "add-peer" -d 'Add a new peer' complete -c innernet -n "__fish_use_subcommand" -f -a "add-peer" -d 'Add a new peer'
complete -c innernet -n "__fish_use_subcommand" -f -a "rename-peer" -d 'Rename a peer'
complete -c innernet -n "__fish_use_subcommand" -f -a "add-cidr" -d 'Add a new CIDR' complete -c innernet -n "__fish_use_subcommand" -f -a "add-cidr" -d 'Add a new CIDR'
complete -c innernet -n "__fish_use_subcommand" -f -a "delete-cidr" -d 'Delete a CIDR' complete -c innernet -n "__fish_use_subcommand" -f -a "delete-cidr" -d 'Delete a CIDR'
complete -c innernet -n "__fish_use_subcommand" -f -a "disable-peer" -d 'Disable an enabled peer' complete -c innernet -n "__fish_use_subcommand" -f -a "disable-peer" -d 'Disable an enabled peer'
@ -56,6 +57,11 @@ complete -c innernet -n "__fish_seen_subcommand_from add-peer" -l auto-ip -d 'Au
complete -c innernet -n "__fish_seen_subcommand_from add-peer" -l yes -d 'Bypass confirmation' complete -c innernet -n "__fish_seen_subcommand_from add-peer" -l yes -d 'Bypass confirmation'
complete -c innernet -n "__fish_seen_subcommand_from add-peer" -s h -l help -d 'Prints help information' complete -c innernet -n "__fish_seen_subcommand_from add-peer" -s h -l help -d 'Prints help information'
complete -c innernet -n "__fish_seen_subcommand_from add-peer" -s V -l version -d 'Prints version information' complete -c innernet -n "__fish_seen_subcommand_from add-peer" -s V -l version -d 'Prints version information'
complete -c innernet -n "__fish_seen_subcommand_from rename-peer" -l name -d 'Name of peer to rename'
complete -c innernet -n "__fish_seen_subcommand_from rename-peer" -l new-name -d 'The new name of the peer'
complete -c innernet -n "__fish_seen_subcommand_from rename-peer" -l yes -d 'Bypass confirmation'
complete -c innernet -n "__fish_seen_subcommand_from rename-peer" -s h -l help -d 'Prints help information'
complete -c innernet -n "__fish_seen_subcommand_from rename-peer" -s V -l version -d 'Prints version information'
complete -c innernet -n "__fish_seen_subcommand_from add-cidr" -l name -d 'The CIDR name (eg. "engineers")' complete -c innernet -n "__fish_seen_subcommand_from add-cidr" -l name -d 'The CIDR name (eg. "engineers")'
complete -c innernet -n "__fish_seen_subcommand_from add-cidr" -l cidr -d 'The CIDR network (eg. "10.42.5.0/24")' complete -c innernet -n "__fish_seen_subcommand_from add-cidr" -l cidr -d 'The CIDR network (eg. "10.42.5.0/24")'
complete -c innernet -n "__fish_seen_subcommand_from add-cidr" -l parent -d 'The CIDR parent name' complete -c innernet -n "__fish_seen_subcommand_from add-cidr" -l parent -d 'The CIDR parent name'

View File

@ -21,7 +21,8 @@ Register-ArgumentCompleter -Native -CommandName 'innernet' -ScriptBlock {
$completions = @(switch ($command) { $completions = @(switch ($command) {
'innernet' { 'innernet' {
[CompletionResult]::new('--backend', 'backend', [CompletionResultType]::ParameterName, 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability') [CompletionResult]::new('--backend', 'backend', [CompletionResultType]::ParameterName, 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability')
[CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'v') [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'Verbose output, use -vv for even higher verbositude')
[CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'Verbose output, use -vv for even higher verbositude')
[CompletionResult]::new('--no-routing', 'no-routing', [CompletionResultType]::ParameterName, 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld') [CompletionResult]::new('--no-routing', 'no-routing', [CompletionResultType]::ParameterName, 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
@ -34,6 +35,7 @@ Register-ArgumentCompleter -Native -CommandName 'innernet' -ScriptBlock {
[CompletionResult]::new('uninstall', 'uninstall', [CompletionResultType]::ParameterValue, 'Uninstall an innernet network') [CompletionResult]::new('uninstall', 'uninstall', [CompletionResultType]::ParameterValue, 'Uninstall an innernet network')
[CompletionResult]::new('down', 'down', [CompletionResultType]::ParameterValue, 'Bring down the interface (equivalent to "wg-quick down <interface>")') [CompletionResult]::new('down', 'down', [CompletionResultType]::ParameterValue, 'Bring down the interface (equivalent to "wg-quick down <interface>")')
[CompletionResult]::new('add-peer', 'add-peer', [CompletionResultType]::ParameterValue, 'Add a new peer') [CompletionResult]::new('add-peer', 'add-peer', [CompletionResultType]::ParameterValue, 'Add a new peer')
[CompletionResult]::new('rename-peer', 'rename-peer', [CompletionResultType]::ParameterValue, 'Rename a peer')
[CompletionResult]::new('add-cidr', 'add-cidr', [CompletionResultType]::ParameterValue, 'Add a new CIDR') [CompletionResult]::new('add-cidr', 'add-cidr', [CompletionResultType]::ParameterValue, 'Add a new CIDR')
[CompletionResult]::new('delete-cidr', 'delete-cidr', [CompletionResultType]::ParameterValue, 'Delete a CIDR') [CompletionResult]::new('delete-cidr', 'delete-cidr', [CompletionResultType]::ParameterValue, 'Delete a CIDR')
[CompletionResult]::new('disable-peer', 'disable-peer', [CompletionResultType]::ParameterValue, 'Disable an enabled peer') [CompletionResult]::new('disable-peer', 'disable-peer', [CompletionResultType]::ParameterValue, 'Disable an enabled peer')
@ -121,6 +123,16 @@ Register-ArgumentCompleter -Native -CommandName 'innernet' -ScriptBlock {
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information') [CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;rename-peer' {
[CompletionResult]::new('--name', 'name', [CompletionResultType]::ParameterName, 'Name of peer to rename')
[CompletionResult]::new('--new-name', 'new-name', [CompletionResultType]::ParameterName, 'The new name of the peer')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break
}
'innernet;add-cidr' { 'innernet;add-cidr' {
[CompletionResult]::new('--name', 'name', [CompletionResultType]::ParameterName, 'The CIDR name (eg. "engineers")') [CompletionResult]::new('--name', 'name', [CompletionResultType]::ParameterName, 'The CIDR name (eg. "engineers")')
[CompletionResult]::new('--cidr', 'cidr', [CompletionResultType]::ParameterName, 'The CIDR network (eg. "10.42.5.0/24")') [CompletionResult]::new('--cidr', 'cidr', [CompletionResultType]::ParameterName, 'The CIDR network (eg. "10.42.5.0/24")')

View File

@ -16,7 +16,8 @@ _innernet() {
local context curcontext="$curcontext" state line local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'--backend=[Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability]: :(kernel userspace)' \ '--backend=[Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability]: :(kernel userspace)' \
'*-v[]' \ '*-v[Verbose output, use -vv for even higher verbositude]' \
'*--verbose[Verbose output, use -vv for even higher verbositude]' \
'--no-routing[Whether the routing should be done by innernet or is done by an external tool like e.g. babeld]' \ '--no-routing[Whether the routing should be done by innernet or is done by an external tool like e.g. babeld]' \
'-h[Prints help information]' \ '-h[Prints help information]' \
'--help[Prints help information]' \ '--help[Prints help information]' \
@ -175,6 +176,18 @@ _arguments "${_arguments_options[@]}" \
':interface:_files' \ ':interface:_files' \
&& ret=0 && ret=0
;; ;;
(rename-peer)
_arguments "${_arguments_options[@]}" \
'--name=[Name of peer to rename]' \
'--new-name=[The new name of the peer]' \
'--yes[Bypass confirmation]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0
;;
(add-cidr) (add-cidr)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'--name=[The CIDR name (eg. "engineers")]' \ '--name=[The CIDR name (eg. "engineers")]' \
@ -300,6 +313,7 @@ _innernet_commands() {
"uninstall:Uninstall an innernet network" \ "uninstall:Uninstall an innernet network" \
"down:Bring down the interface (equivalent to "wg-quick down <interface>")" \ "down:Bring down the interface (equivalent to "wg-quick down <interface>")" \
"add-peer:Add a new peer" \ "add-peer:Add a new peer" \
"rename-peer:Rename a peer" \
"add-cidr:Add a new CIDR" \ "add-cidr:Add a new CIDR" \
"delete-cidr:Delete a CIDR" \ "delete-cidr:Delete a CIDR" \
"disable-peer:Disable an enabled peer" \ "disable-peer:Disable an enabled peer" \
@ -440,6 +454,13 @@ _redeem_commands() {
) )
_describe -t commands 'redeem commands' commands "$@" _describe -t commands 'redeem commands' commands "$@"
} }
(( $+functions[_innernet__rename-peer_commands] )) ||
_innernet__rename-peer_commands() {
local commands; commands=(
)
_describe -t commands 'innernet rename-peer commands' commands "$@"
}
(( $+functions[_innernet__set-listen-port_commands] )) || (( $+functions[_innernet__set-listen-port_commands] )) ||
_innernet__set-listen-port_commands() { _innernet__set-listen-port_commands() {
local commands; commands=( local commands; commands=(

View File

@ -6,7 +6,7 @@ license = "MIT"
name = "server" name = "server"
publish = false publish = false
readme = "README.md" readme = "README.md"
version = "1.3.0" version = "1.3.1"
[[bin]] [[bin]]
name = "innernet-server" name = "innernet-server"

View File

@ -4,7 +4,7 @@ edition = "2018"
license = "MIT" license = "MIT"
name = "shared" name = "shared"
publish = false publish = false
version = "1.3.0" version = "1.3.1"
[dependencies] [dependencies]
colored = "2.0" colored = "2.0"

View File

@ -7,7 +7,7 @@ license = "LGPL-2.1-or-later"
name = "wgctrl" name = "wgctrl"
publish = false publish = false
readme = "../README.md" readme = "../README.md"
version = "1.3.0" version = "1.3.1"
[dependencies] [dependencies]
base64 = "0.13" base64 = "0.13"

View File

@ -7,7 +7,7 @@ name = "wgctrl-sys"
publish = false publish = false
readme = "../README.md" readme = "../README.md"
repository = "https://gitlab.com/K900/wgctrl-rs" repository = "https://gitlab.com/K900/wgctrl-rs"
version = "1.3.0" version = "1.3.1"
[dependencies] [dependencies]
libc = "0.2" libc = "0.2"