feat: rebranded from vpn-router to linux-manager.

This commit is contained in:
slawek committed 2026-11-22 09:51:07 +01:00
1 parent 8efe21bfa6
commit 85a1ffa21f
238 files changed
+5010 -3761

No files matched your search

@@ -1,6 +1,6 @@
# bash completion for vpn-router-backup -*- shell-script -*-
# bash completion for linux-manager-backup -*- shell-script -*-
_vpn_router_backup()
_linux_manager_backup()
{
local cur prev words cword split
_init_completion -s || return
@@ -31,11 +31,11 @@ _vpn_router_backup()
return
fi
# restore takes a local archive, or with --pbs a snapshot name, which vpn-router-backup list shows.
# restore takes a local archive, or with --pbs a snapshot name, which linux-manager-backup list shows.
if [[ $command == restore ]] && ((args == 0)) && ! $pbs; then
_filedir
fi
} &&
complete -F _vpn_router_backup vpn-router-backup
complete -F _linux_manager_backup linux-manager-backup
# ex: filetype=sh
@@ -1,23 +1,23 @@
# bash completion for vpn-router-ca -*- shell-script -*-
# bash completion for linux-manager-ca -*- shell-script -*-
# Python of the package that prints the revocation reasons (reasons) or, from the configuration read as root, the
# issuing CAs (cas) or the certificate templates (templates), which other users do not get.
_vpn_router_ca_python()
_linux_manager_ca_python()
{
python3 -c '
import sys
sys.path.insert(0, "/usr/lib/vpn-router")
import vpnrouter
import vpnrouter_pki
sys.path.insert(0, "/usr/lib/linux-manager")
import linuxmanager
import linuxmanager_pki
if sys.argv[1] == "reasons":
print("\n".join(vpnrouter_pki.REASONS))
print("\n".join(linuxmanager_pki.REASONS))
else:
cfg = vpnrouter.load_config()
print("\n".join(vpnrouter.issuing_cas(cfg) if sys.argv[1] == "cas" else vpnrouter.pki_templates(cfg)))
cfg = linuxmanager.load_config()
print("\n".join(linuxmanager.issuing_cas(cfg) if sys.argv[1] == "cas" else linuxmanager.pki_templates(cfg)))
' "$@" 2>/dev/null
}
_vpn_router_ca()
_linux_manager_ca()
{
local cur prev words cword split
_init_completion -s || return
@@ -43,15 +43,15 @@ _vpn_router_ca()
case $prev in
--ca)
COMPREPLY=($(compgen -W "$(_vpn_router_ca_python cas)" -- "$cur"))
COMPREPLY=($(compgen -W "$(_linux_manager_ca_python cas)" -- "$cur"))
return
;;
--template)
COMPREPLY=($(compgen -W "$(_vpn_router_ca_python templates)" -- "$cur"))
COMPREPLY=($(compgen -W "$(_linux_manager_ca_python templates)" -- "$cur"))
return
;;
--reason)
COMPREPLY=($(compgen -W "$(_vpn_router_ca_python reasons)" -- "$cur"))
COMPREPLY=($(compgen -W "$(_linux_manager_ca_python reasons)" -- "$cur"))
return
;;
--csr | --pfx | --out)
@@ -89,10 +89,10 @@ _vpn_router_ca()
case $command,$action,$args in
ca,,*) COMPREPLY=($(compgen -W 'csr import' -- "$cur")) ;;
root,,*) COMPREPLY=($(compgen -W 'export-key remove-key import-key import-crl' -- "$cur")) ;;
ca,*,0) COMPREPLY=($(compgen -W "$(_vpn_router_ca_python cas)" -- "$cur")) ;;
ca,*,0) COMPREPLY=($(compgen -W "$(_linux_manager_ca_python cas)" -- "$cur")) ;;
ca,import,1 | root,import-key,0 | root,import-crl,0) _filedir ;;
esac
} &&
complete -F _vpn_router_ca vpn-router-ca
complete -F _linux_manager_ca linux-manager-ca
# ex: filetype=sh
@@ -1,6 +1,6 @@
# bash completion for vpn-router-caddy -*- shell-script -*-
# bash completion for linux-manager-caddy -*- shell-script -*-
_vpn_router_caddy()
_linux_manager_caddy()
{
local cur prev words cword
_init_completion || return
@@ -19,6 +19,6 @@ _vpn_router_caddy()
COMPREPLY=($(compgen -W 'status apply use-upstream' -- "$cur"))
fi
} &&
complete -F _vpn_router_caddy vpn-router-caddy
complete -F _linux_manager_caddy linux-manager-caddy
# ex: filetype=sh
@@ -1,6 +1,6 @@
# bash completion for vpn-config-edit -*- shell-script -*-
# bash completion for linux-manager-config-edit -*- shell-script -*-
# Python of the package that answers from its schema (vpnrouter.SCHEMA, vpnrouter.CONNECTION) and, read as root, the
# Python of the package that answers from its schema (linuxmanager.SCHEMA, linuxmanager.CONNECTION) and, read as root, the
# site-to-site connections of the configuration: settings prints SECTION.OPTION of every setting and
# site_to_site.NAME.OPTION of every connection, connections site_to_site.NAME, and values the values of a boolean
# setting, $1.
@@ -8,20 +8,20 @@ _vpn_config_edit_python()
{
python3 -c '
import sys
sys.path.insert(0, "/usr/lib/vpn-router")
import vpnrouter
sys.path.insert(0, "/usr/lib/linux-manager")
import linuxmanager
try:
connections = vpnrouter.read_settings().get("site_to_site", {})
except (OSError, vpnrouter.ConfigError):
connections = linuxmanager.read_settings().get("site_to_site", {})
except (OSError, linuxmanager.ConfigError):
connections = {}
if sys.argv[1] == "settings":
print("\n".join(f"{section}.{option}" for section, options in vpnrouter.SCHEMA.items() for option in options))
print("\n".join(f"site_to_site.{name}.{option}" for name in connections for option in vpnrouter.CONNECTION))
print("\n".join(f"{section}.{option}" for section, options in linuxmanager.SCHEMA.items() for option in options))
print("\n".join(f"site_to_site.{name}.{option}" for name in connections for option in linuxmanager.CONNECTION))
elif sys.argv[1] == "connections":
print("\n".join(f"site_to_site.{name}" for name in connections))
else:
section, _, option = sys.argv[2].rpartition(".")
defaults = vpnrouter.CONNECTION if section.startswith("site_to_site.") else vpnrouter.SCHEMA.get(section, {})
defaults = linuxmanager.CONNECTION if section.startswith("site_to_site.") else linuxmanager.SCHEMA.get(section, {})
if isinstance(defaults.get(option), bool):
print("true\nfalse")
' "$@" 2>/dev/null
@@ -54,6 +54,6 @@ _vpn_config_edit()
remove,0) COMPREPLY=($(compgen -W "$(_vpn_config_edit_python connections)" -- "$cur")) ;;
esac
} &&
complete -F _vpn_config_edit vpn-config-edit
complete -F _vpn_config_edit linux-manager-config-edit
# ex: filetype=sh
@@ -1,19 +1,19 @@
# bash completion for vpn-router-group -*- shell-script -*-
# bash completion for linux-manager-group -*- shell-script -*-
# The names of the users and of the groups of the router's directory, read as root; nothing for other users.
_vpn_router_group_users()
# The names of the users and of the groups of the server's directory, read as root; nothing for other users.
_linux_manager_group_users()
{
vpn-router-user --json list 2>/dev/null |
linux-manager-user --json list 2>/dev/null |
python3 -c 'import json, sys; print("\n".join(user["name"] for user in json.load(sys.stdin)["users"]))' 2>/dev/null
}
_vpn_router_group_names()
_linux_manager_group_names()
{
vpn-router-group --json list 2>/dev/null |
linux-manager-group --json list 2>/dev/null |
python3 -c 'import json, sys; print("\n".join(group["name"] for group in json.load(sys.stdin)["groups"]))' 2>/dev/null
}
_vpn_router_group()
_linux_manager_group()
{
local cur prev words cword split
_init_completion -s || return
@@ -43,7 +43,7 @@ _vpn_router_group()
case $prev in
--member)
COMPREPLY=($(compgen -W "$(_vpn_router_group_users)" -- "$cur"))
COMPREPLY=($(compgen -W "$(_linux_manager_group_users)" -- "$cur"))
return
;;
--description | --name)
@@ -64,11 +64,11 @@ _vpn_router_group()
# The group, which add takes new, then the user of member-add and member-remove.
if ((args == 0)) && [[ $command != @(list|add) ]]; then
COMPREPLY=($(compgen -W "$(_vpn_router_group_names)" -- "$cur"))
COMPREPLY=($(compgen -W "$(_linux_manager_group_names)" -- "$cur"))
elif ((args == 1)) && [[ $command == member-@(add|remove) ]]; then
COMPREPLY=($(compgen -W "$(_vpn_router_group_users)" -- "$cur"))
COMPREPLY=($(compgen -W "$(_linux_manager_group_users)" -- "$cur"))
fi
} &&
complete -F _vpn_router_group vpn-router-group
complete -F _linux_manager_group linux-manager-group
# ex: filetype=sh
@@ -1,32 +1,32 @@
# bash completion for vpn-router-role -*- shell-script -*-
# bash completion for linux-manager-role -*- shell-script -*-
# The service accounts, the users, the groups and the roles of a resource of the router's directory, read as root;
# The service accounts, the users, the groups and the roles of a resource of the server's directory, read as root;
# nothing for other users.
_vpn_router_role_resources()
_linux_manager_role_resources()
{
vpn-router-user --json list 2>/dev/null |
linux-manager-user --json list 2>/dev/null |
python3 -c 'import json, sys; print("\n".join(user["name"] for user in json.load(sys.stdin)["users"] if user["service"]))' 2>/dev/null
}
_vpn_router_role_accounts()
_linux_manager_role_accounts()
{
vpn-router-user --json list 2>/dev/null |
linux-manager-user --json list 2>/dev/null |
python3 -c 'import json, sys; print("\n".join(user["name"] for user in json.load(sys.stdin)["users"]))' 2>/dev/null
}
_vpn_router_role_groups()
_linux_manager_role_groups()
{
vpn-router-group --json list 2>/dev/null |
linux-manager-group --json list 2>/dev/null |
python3 -c 'import json, sys; print("\n".join(group["name"] for group in json.load(sys.stdin)["groups"]))' 2>/dev/null
}
_vpn_router_role_names()
_linux_manager_role_names()
{
vpn-router-role --json list "$1" 2>/dev/null |
linux-manager-role --json list "$1" 2>/dev/null |
python3 -c 'import json, sys; print("\n".join(role["name"] for role in json.load(sys.stdin)["roles"]))' 2>/dev/null
}
_vpn_router_role()
_linux_manager_role()
{
local cur prev words cword split
_init_completion -s || return
@@ -59,11 +59,11 @@ _vpn_router_role()
case $prev in
--group)
COMPREPLY=($(compgen -W "$(_vpn_router_role_groups)" -- "$cur"))
COMPREPLY=($(compgen -W "$(_linux_manager_role_groups)" -- "$cur"))
return
;;
--account)
COMPREPLY=($(compgen -W "$(_vpn_router_role_accounts)" -- "$cur"))
COMPREPLY=($(compgen -W "$(_linux_manager_role_accounts)" -- "$cur"))
return
;;
--description)
@@ -84,11 +84,11 @@ _vpn_router_role()
# The resource, then the role, which add takes new.
if ((args == 0)); then
COMPREPLY=($(compgen -W "$(_vpn_router_role_resources)" -- "$cur"))
COMPREPLY=($(compgen -W "$(_linux_manager_role_resources)" -- "$cur"))
elif ((args == 1)) && [[ $command != @(list|add) ]]; then
COMPREPLY=($(compgen -W "$(_vpn_router_role_names "$resource")" -- "$cur"))
COMPREPLY=($(compgen -W "$(_linux_manager_role_names "$resource")" -- "$cur"))
fi
} &&
complete -F _vpn_router_role vpn-router-role
complete -F _linux_manager_role linux-manager-role
# ex: filetype=sh
@@ -1,25 +1,25 @@
# bash completion for vpn-router-site -*- shell-script -*-
# bash completion for linux-manager-site -*- shell-script -*-
# The names of the sites, of the groups and of the general-purpose issuing CAs, read as root; nothing for other users.
_vpn_router_site_names()
_linux_manager_site_names()
{
vpn-router-site --json list 2>/dev/null |
linux-manager-site --json list 2>/dev/null |
python3 -c 'import json, sys; print("\n".join(site["name"] for site in json.load(sys.stdin)["sites"]))' 2>/dev/null
}
_vpn_router_site_groups()
_linux_manager_site_groups()
{
vpn-router-group --json list 2>/dev/null |
linux-manager-group --json list 2>/dev/null |
python3 -c 'import json, sys; print("\n".join(group["name"] for group in json.load(sys.stdin)["groups"]))' 2>/dev/null
}
_vpn_router_site_cas()
_linux_manager_site_cas()
{
python3 -c 'import sys; sys.path.insert(0, "/usr/lib/vpn-router"); import vpnrouter
print("\n".join(vpnrouter.load_config()["pki"]["issuing_cas"]))' 2>/dev/null
python3 -c 'import sys; sys.path.insert(0, "/usr/lib/linux-manager"); import linuxmanager
print("\n".join(linuxmanager.load_config()["pki"]["issuing_cas"]))' 2>/dev/null
}
_vpn_router_site()
_linux_manager_site()
{
local cur prev words cword split
_init_completion -s || return
@@ -57,11 +57,11 @@ _vpn_router_site()
return
;;
--ca)
COMPREPLY=($(compgen -W "$(_vpn_router_site_cas)" -- "$cur"))
COMPREPLY=($(compgen -W "$(_linux_manager_site_cas)" -- "$cur"))
return
;;
--editors)
COMPREPLY=($(compgen -W "$(_vpn_router_site_groups)" -- "$cur"))
COMPREPLY=($(compgen -W "$(_linux_manager_site_groups)" -- "$cur"))
return
;;
--dns)
@@ -95,9 +95,9 @@ _vpn_router_site()
# The site, which add takes new.
if ((args == 0)) && [[ $command != @(list|add) ]]; then
COMPREPLY=($(compgen -W "$(_vpn_router_site_names)" -- "$cur"))
COMPREPLY=($(compgen -W "$(_linux_manager_site_names)" -- "$cur"))
fi
} &&
complete -F _vpn_router_site vpn-router-site
complete -F _linux_manager_site linux-manager-site
# ex: filetype=sh
@@ -1,6 +1,6 @@
# bash completion for vpn-router-token -*- shell-script -*-
# bash completion for linux-manager-token -*- shell-script -*-
_vpn_router_token()
_linux_manager_token()
{
local cur prev words cword split
_init_completion -s || return
@@ -20,6 +20,6 @@ _vpn_router_token()
[[ $word == --@(minutes|hours|days)* ]] || options+=' --minutes --hours --days'
COMPREPLY=($(compgen -W "$options" -- "$cur"))
} &&
complete -F _vpn_router_token vpn-router-token
complete -F _linux_manager_token linux-manager-token
# ex: filetype=sh
@@ -1,27 +1,27 @@
# bash completion for vpn-router-user -*- shell-script -*-
# bash completion for linux-manager-user -*- shell-script -*-
# The names of the users and of the groups of the router's directory, read as root; nothing for other users.
_vpn_router_user_names()
# The names of the users and of the groups of the server's directory, read as root; nothing for other users.
_linux_manager_user_names()
{
vpn-router-user --json list 2>/dev/null |
linux-manager-user --json list 2>/dev/null |
python3 -c 'import json, sys; print("\n".join(user["name"] for user in json.load(sys.stdin)["users"]))' 2>/dev/null
}
_vpn_router_user_groups()
_linux_manager_user_groups()
{
vpn-router-group --json list 2>/dev/null |
linux-manager-group --json list 2>/dev/null |
python3 -c 'import json, sys; print("\n".join(group["name"] for group in json.load(sys.stdin)["groups"]))' 2>/dev/null
}
# The scopes of the resources, <resource>:<scope>, read as root.
_vpn_router_user_scopes()
_linux_manager_user_scopes()
{
vpn-router-user --json list 2>/dev/null |
linux-manager-user --json list 2>/dev/null |
python3 -c 'import json, sys; print("\n".join(user["name"] + ":" + scope for user in json.load(sys.stdin)["users"]
for scope in user.get("resource_scopes", [])))' 2>/dev/null
}
_vpn_router_user()
_linux_manager_user()
{
local cur prev words cword split
_init_completion -s || return
@@ -56,7 +56,7 @@ _vpn_router_user()
case $prev in
--allowed-group)
COMPREPLY=($(compgen -W "$(_vpn_router_user_groups)" -- "$cur"))
COMPREPLY=($(compgen -W "$(_linux_manager_user_groups)" -- "$cur"))
return
;;
--grant)
@@ -68,7 +68,7 @@ _vpn_router_user()
return
;;
--client-scope)
COMPREPLY=($(compgen -W "$(_vpn_router_user_scopes)" -- "$cur"))
COMPREPLY=($(compgen -W "$(_linux_manager_user_scopes)" -- "$cur"))
return
;;
--resource-scope)
@@ -100,9 +100,9 @@ _vpn_router_user()
# The user name, which add takes new; otp-enrol then takes a code.
if ((args == 0)) && [[ $command != @(list|add) ]]; then
COMPREPLY=($(compgen -W "$(_vpn_router_user_names)" -- "$cur"))
COMPREPLY=($(compgen -W "$(_linux_manager_user_names)" -- "$cur"))
fi
} &&
complete -F _vpn_router_user vpn-router-user
complete -F _linux_manager_user linux-manager-user
# ex: filetype=sh