From 87e008d56de974947ebb99c2cc40b25d3c2cf43e Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 25 Jun 2025 03:59:52 +0900 Subject: treewide: rename to hakurei Fortify makes little sense for a container tool. Signed-off-by: Ophestra --- dist/comp/_fortify | 82 ------------------------------------------------------ dist/comp/_hakurei | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ dist/fsurc.default | 1 - dist/hsurc.default | 1 + dist/install.sh | 12 ++++---- dist/release.sh | 12 ++++---- 6 files changed, 95 insertions(+), 95 deletions(-) delete mode 100644 dist/comp/_fortify create mode 100644 dist/comp/_hakurei delete mode 100644 dist/fsurc.default create mode 100644 dist/hsurc.default (limited to 'dist') diff --git a/dist/comp/_fortify b/dist/comp/_fortify deleted file mode 100644 index 2eeaf845..00000000 --- a/dist/comp/_fortify +++ /dev/null @@ -1,82 +0,0 @@ -#compdef fortify - -_fortify_app() { - __fortify_files - return $? -} - -_fortify_run() { - _arguments \ - '--id[Reverse-DNS style Application identifier, leave empty to inherit instance identifier]:id' \ - '-a[Application identity]: :_numbers' \ - '-g[Groups inherited by all container processes]: :_groups' \ - '-d[Container home directory]: :_files -/' \ - '-u[Passwd user name within sandbox]: :_users' \ - '--wayland[Enable connection to Wayland via security-context-v1]' \ - '-X[Enable direct connection to X11]' \ - '--dbus[Enable proxied connection to D-Bus]' \ - '--pulse[Enable direct connection to PulseAudio]' \ - '--dbus-config[Path to session bus proxy config file]: :_files -g "*.json"' \ - '--dbus-system[Path to system bus proxy config file]: :_files -g "*.json"' \ - '--mpris[Allow owning MPRIS D-Bus path]' \ - '--dbus-log[Force buffered logging in the D-Bus proxy]' -} - -_fortify_ps() { - _arguments \ - '--short[List instances only]' -} - -_fortify_show() { - _alternative \ - 'instances:domains:__fortify_instances' \ - 'files:files:__fortify_files' -} - -__fortify_files() { - _files -g "*.(json|ftfy)" - return $? -} - -__fortify_instances() { - local -a out - shift -p - out=( ${(f)"$(_call_program commands fortify ps --short 2>&1)"} ) - if (( $#out == 0 )); then - _message "No active instances" - else - _describe "active instances" out - fi - return $? -} - -(( $+functions[_fortify_commands] )) || _fortify_commands() -{ - local -a _fortify_cmds - _fortify_cmds=( - "app:Launch app defined by the specified config file" - "run:Configure and start a permissive default sandbox" - "show:Show the contents of an app configuration" - "ps:List active apps and their state" - "version:Show fortify version" - "license:Show full license text" - "template:Produce a config template" - "help:Show help message" - ) - if (( CURRENT == 1 )); then - _describe -t commands 'action' _fortify_cmds || compadd "$@" - else - local curcontext="$curcontext" - cmd="${${_fortify_cmds[(r)$words[1]:*]%%:*}}" - if (( $+functions[_fortify_$cmd] )); then - _fortify_$cmd - else - _message "no more options" - fi - fi -} - -_arguments -C \ - '-v[Verbose output]' \ - '--json[Serialise output in JSON when applicable]' \ - '*::fortify command:_fortify_commands' \ No newline at end of file diff --git a/dist/comp/_hakurei b/dist/comp/_hakurei new file mode 100644 index 00000000..a8554268 --- /dev/null +++ b/dist/comp/_hakurei @@ -0,0 +1,82 @@ +#compdef hakurei + +_hakurei_app() { + __hakurei_files + return $? +} + +_hakurei_run() { + _arguments \ + '--id[Reverse-DNS style Application identifier, leave empty to inherit instance identifier]:id' \ + '-a[Application identity]: :_numbers' \ + '-g[Groups inherited by all container processes]: :_groups' \ + '-d[Container home directory]: :_files -/' \ + '-u[Passwd user name within sandbox]: :_users' \ + '--wayland[Enable connection to Wayland via security-context-v1]' \ + '-X[Enable direct connection to X11]' \ + '--dbus[Enable proxied connection to D-Bus]' \ + '--pulse[Enable direct connection to PulseAudio]' \ + '--dbus-config[Path to session bus proxy config file]: :_files -g "*.json"' \ + '--dbus-system[Path to system bus proxy config file]: :_files -g "*.json"' \ + '--mpris[Allow owning MPRIS D-Bus path]' \ + '--dbus-log[Force buffered logging in the D-Bus proxy]' +} + +_hakurei_ps() { + _arguments \ + '--short[List instances only]' +} + +_hakurei_show() { + _alternative \ + 'instances:domains:__hakurei_instances' \ + 'files:files:__hakurei_files' +} + +__hakurei_files() { + _files -g "*.(json|hakurei)" + return $? +} + +__hakurei_instances() { + local -a out + shift -p + out=( ${(f)"$(_call_program commands hakurei ps --short 2>&1)"} ) + if (( $#out == 0 )); then + _message "No active instances" + else + _describe "active instances" out + fi + return $? +} + +(( $+functions[_hakurei_commands] )) || _hakurei_commands() +{ + local -a _hakurei_cmds + _hakurei_cmds=( + "app:Load app from configuration file" + "run:Configure and start a permissive default sandbox" + "show:Show live or local app configuration" + "ps:List active instances" + "version:Display version information" + "license:Show full license text" + "template:Produce a config template" + "help:Show help message" + ) + if (( CURRENT == 1 )); then + _describe -t commands 'action' _hakurei_cmds || compadd "$@" + else + local curcontext="$curcontext" + cmd="${${_hakurei_cmds[(r)$words[1]:*]%%:*}}" + if (( $+functions[_hakurei_$cmd] )); then + _hakurei_$cmd + else + _message "no more options" + fi + fi +} + +_arguments -C \ + '-v[Increase log verbosity]' \ + '--json[Serialise output in JSON when applicable]' \ + '*::hakurei command:_hakurei_commands' \ No newline at end of file diff --git a/dist/fsurc.default b/dist/fsurc.default deleted file mode 100644 index f770d5ef..00000000 --- a/dist/fsurc.default +++ /dev/null @@ -1 +0,0 @@ -1000 0 \ No newline at end of file diff --git a/dist/hsurc.default b/dist/hsurc.default new file mode 100644 index 00000000..f770d5ef --- /dev/null +++ b/dist/hsurc.default @@ -0,0 +1 @@ +1000 0 \ No newline at end of file diff --git a/dist/install.sh b/dist/install.sh index bd1e8a28..37f55084 100755 --- a/dist/install.sh +++ b/dist/install.sh @@ -1,12 +1,12 @@ #!/bin/sh cd "$(dirname -- "$0")" || exit 1 -install -vDm0755 "bin/fortify" "${FORTIFY_INSTALL_PREFIX}/usr/bin/fortify" -install -vDm0755 "bin/fpkg" "${FORTIFY_INSTALL_PREFIX}/usr/bin/fpkg" +install -vDm0755 "bin/hakurei" "${HAKUREI_INSTALL_PREFIX}/usr/bin/hakurei" +install -vDm0755 "bin/fpkg" "${HAKUREI_INSTALL_PREFIX}/usr/bin/fpkg" -install -vDm6511 "bin/fsu" "${FORTIFY_INSTALL_PREFIX}/usr/bin/fsu" -if [ ! -f "${FORTIFY_INSTALL_PREFIX}/etc/fsurc" ]; then - install -vDm0400 "fsurc.default" "${FORTIFY_INSTALL_PREFIX}/etc/fsurc" +install -vDm6511 "bin/hsu" "${HAKUREI_INSTALL_PREFIX}/usr/bin/hsu" +if [ ! -f "${HAKUREI_INSTALL_PREFIX}/etc/hsurc" ]; then + install -vDm0400 "hsurc.default" "${HAKUREI_INSTALL_PREFIX}/etc/hsurc" fi -install -vDm0644 "comp/_fortify" "${FORTIFY_INSTALL_PREFIX}/usr/share/zsh/site-functions/_fortify" \ No newline at end of file +install -vDm0644 "comp/_hakurei" "${HAKUREI_INSTALL_PREFIX}/usr/share/zsh/site-functions/_hakurei" \ No newline at end of file diff --git a/dist/release.sh b/dist/release.sh index a50c6614..90f44c02 100755 --- a/dist/release.sh +++ b/dist/release.sh @@ -1,18 +1,18 @@ #!/bin/sh -e cd "$(dirname -- "$0")/.." -VERSION="${FORTIFY_VERSION:-untagged}" -pname="fortify-${VERSION}" +VERSION="${HAKUREI_VERSION:-untagged}" +pname="hakurei-${VERSION}" out="dist/${pname}" mkdir -p "${out}" -cp -v "README.md" "dist/fsurc.default" "dist/install.sh" "${out}" +cp -v "README.md" "dist/hsurc.default" "dist/install.sh" "${out}" cp -rv "dist/comp" "${out}" go generate ./... go build -trimpath -v -o "${out}/bin/" -ldflags "-s -w -buildid= -extldflags '-static' - -X git.gensokyo.uk/security/fortify/internal.version=${VERSION} - -X git.gensokyo.uk/security/fortify/internal.fsu=/usr/bin/fsu - -X main.fmain=/usr/bin/fortify + -X git.gensokyo.uk/security/hakurei/internal.version=${VERSION} + -X git.gensokyo.uk/security/hakurei/internal.hsu=/usr/bin/hsu + -X main.hmain=/usr/bin/hakurei -X main.fpkg=/usr/bin/fpkg" ./... rm -f "./${out}.tar.gz" && tar -C dist -czf "${out}.tar.gz" "${pname}" -- cgit v1.3.1