Add comprehensive inline metadata documentation to all BackTunnel scripts

This commit is contained in:
2025-09-21 09:45:43 +02:00
parent 17cdbe9c55
commit 0e82955af5
11 changed files with 466 additions and 20 deletions

View File

@@ -1,5 +1,36 @@
#!/usr/bin/env bash
# Copyright (c) 2025. LUXIM d.o.o., Slovenia - Matjaž Mozetič.
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright (c) 2025 LUXIM d.o.o., Slovenia
# Author: Matjaž Mozetič
#
# Name: backtunnel-share-gui
# Summary: KDE/GUI wrapper to start a BackTunnel share with dialogs and logging.
# Description:
# GUI front-end that prompts for remote, duration, ports, and invite options using kdialog,
# then launches backtunnel-share in a terminal (Konsole/xterm) to create the reverse-SSH share.
# Prefills fields from BackTunnel profiles.ini when available (read-only, best-effort).
# All output is logged to /tmp/backtunnel-share-gui.<uid>.log for troubleshooting.
#
# Usage:
# backtunnel-share-gui <folder>
#
# Examples:
# backtunnel-share-gui ~/projects
#
# Dependencies:
# - bash
# - kdialog (for GUI prompts)
# - konsole or xterm (preferred terminals; falls back to background run if missing)
# - awk (for simple INI parsing), tee
# - backtunnel-share (invoked to perform the actual sharing)
#
# Exit codes:
# 0 command launched (terminal or background)
# 1 invalid usage or no folder selected
#
# Notes:
# - Profiles are used only to prefill fields; @profile is not used directly by this GUI.
# - If no terminal emulator is available, runs in background and shows a message with the log path.
# GUI wrapper for BackTunnel "Share" action (Dolphin service menu)
# Prompts for parameters via kdialog and launches backtunnel-share in a terminal.
@@ -95,4 +126,4 @@ else
nohup "${cmd[@]}" >>"$LOG" 2>&1 &
kdialog --msgbox "Sharing started in background.\nSee log: $LOG"
exit 0
fi
fi