mirror of
https://github.com/winapps-org/winapps.git
synced 2026-11-29 10:55:45 -05:00
Merge pull request #878 from dfillingham/ask-pass
Add config option RDP_ASKPASS, use stdout of an external command as password
This commit is contained in:
@@ -393,7 +393,17 @@ RDP_USER="MyWindowsUser"
|
||||
# [WINDOWS PASSWORD]
|
||||
# NOTES:
|
||||
# - If using FreeRDP v3.9.0 or greater, you *have* to set a password
|
||||
# - RDP_ASKPASS is provided as a more secure option to RDP_PASS:
|
||||
# - Calls an external command and uses its stdout as the password
|
||||
# - The password is not passed on the command line to freerdp, keeping it out of logs
|
||||
# - If specified, takes precedence over RDP_PASS
|
||||
# - Examples to use this:
|
||||
# - RDP_ASKPASS="~/some-custom-command"
|
||||
# - RDP_ASKPASS="bash -c 'cat ~/.some-secret-file'"
|
||||
# - RDP_ASKPASS="bash -c 'kwallet-query --folder winapps --read-password rdp kdewallet'"
|
||||
#
|
||||
RDP_PASS="MyWindowsPassword"
|
||||
RDP_ASKPASS=""
|
||||
|
||||
# [WINDOWS DOMAIN]
|
||||
# DEFAULT VALUE: '' (BLANK)
|
||||
|
||||
+14
-4
@@ -41,6 +41,7 @@ readonly RUNID="${RANDOM}"
|
||||
# WINAPPS CONFIGURATION FILE
|
||||
RDP_USER=""
|
||||
RDP_PASS=""
|
||||
RDP_ASKPASS=""
|
||||
RDP_DOMAIN=""
|
||||
RDP_IP=""
|
||||
VM_NAME="RDPWindows" # FOR 'libvirt' ONLY
|
||||
@@ -611,7 +612,7 @@ function waRunCommand() {
|
||||
$RDP_FLAGS_WINDOWS \
|
||||
/d:"$RDP_DOMAIN" \
|
||||
/u:"$RDP_USER" \
|
||||
/p:"$RDP_PASS" \
|
||||
${RDP_PASSWORD_ARG:+"$RDP_PASSWORD_ARG"} \
|
||||
/scale:"$RDP_SCALE" \
|
||||
+auto-reconnect \
|
||||
+dynamic-resolution \
|
||||
@@ -629,7 +630,7 @@ function waRunCommand() {
|
||||
$RDP_FLAGS_NON_WINDOWS \
|
||||
/d:"$RDP_DOMAIN" \
|
||||
/u:"$RDP_USER" \
|
||||
/p:"$RDP_PASS" \
|
||||
${RDP_PASSWORD_ARG:+"$RDP_PASSWORD_ARG"} \
|
||||
/scale:"$RDP_SCALE" \
|
||||
+auto-reconnect \
|
||||
/app:program:"$2",hidef:"$HIDEF" \
|
||||
@@ -663,7 +664,7 @@ function waRunCommand() {
|
||||
$RDP_FLAGS_NON_WINDOWS \
|
||||
/d:"$RDP_DOMAIN" \
|
||||
/u:"$RDP_USER" \
|
||||
/p:"$RDP_PASS" \
|
||||
${RDP_PASSWORD_ARG:+"$RDP_PASSWORD_ARG"} \
|
||||
/scale:"$RDP_SCALE" \
|
||||
+auto-reconnect \
|
||||
/wm-class:"$FULL_NAME" \
|
||||
@@ -686,7 +687,7 @@ function waRunCommand() {
|
||||
$RDP_FLAGS_NON_WINDOWS \
|
||||
/d:"$RDP_DOMAIN" \
|
||||
/u:"$RDP_USER" \
|
||||
/p:"$RDP_PASS" \
|
||||
${RDP_PASSWORD_ARG:+"$RDP_PASSWORD_ARG"} \
|
||||
/scale:"$RDP_SCALE" \
|
||||
+auto-reconnect \
|
||||
/drive:media,"$REMOVABLE_MEDIA" \
|
||||
@@ -804,6 +805,15 @@ waLastRun
|
||||
waLoadConfig
|
||||
waGetFreeRDPCommand
|
||||
|
||||
# Send password on the command line if a command to retrieve the password from is not given
|
||||
# Otherwise, set FREERDP_ASKPASS which freerdp will read the stdout of to use as the password
|
||||
RDP_PASSWORD_ARG="/p:$RDP_PASS"
|
||||
|
||||
if [[ ! -z "$RDP_ASKPASS" ]]; then
|
||||
export FREERDP_ASKPASS="$RDP_ASKPASS"
|
||||
unset RDP_PASSWORD_ARG
|
||||
fi
|
||||
|
||||
# If using podman backend, modify the FreeRDP command to enter a new namespace.
|
||||
if [ "$WAFLAVOR" = "podman" ]; then
|
||||
FREERDP_COMMAND="podman unshare --rootless-netns ${FREERDP_COMMAND}"
|
||||
|
||||
Reference in New Issue
Block a user