VirtualHere Synology Password Protection

2 posts / 0 new
Last post
MaWe
VirtualHere Synology Password Protection

Hello,
I would like to install a password query in a VirtualHere installation on a Synology.

I created auth.sh in the Synolgy directory on /volume1/@appstore/VirtualHere
I added the Example 1 from https://www.virtualhere.com/authorization
I gave it execute permissions (chmod +x auth.sh)

I added the clientAuthorization in the config.ini in /volume1/@appstore/VirtualHere
clientAuthorization=/volume1/@appstore/VirtualHere/auth.sh "$VENDOR_ID$" "$PRODUCT_ID$" "$CLIENT_ID$" "$CLIENT_IP$" "$PRODUCT_SERIAL$" "$PASSWORD$" "$DEVPATH$" "$NICKNAME$" "$NUM_BINDINGS$"

what else do I have to set in the client?
I would just need a simple password query

kind regards
Martin

Michael
.

Nothing needs to change in the client. Its only a server setting

1. Put this into /volume1/@appstore/VirtualHere/auth.sh

#!/bin/sh
# Example script for performing basic user authorization for virtualhere
# Also includes a simple password protection mechanism for accessing a device
# Return 2 if the user needs to provide a password (or the password is incorrect) to use the device
# Return 1 if the user is allowed to access this device
# Return 0 if the user is not allowed to access this device
# Parameters are passed in as:
# $1 = VENDOR_ID
# $2 = PRODUCT_ID
# $3 = CLIENT_ID
# $4 = CLIENT_IP
# $5 = PRODUCT_SERIAL
# $6 = PASSWORD
# $7 = DEVPATH
# $8 = NICKNAME
# $9 = NUM_BINDINGS
logger "Authorizing -> '$1' '$2' '$3' '$4' '$5' '$6' '$7' '$8' '$9'"
# "mypassword" = "34819d7beeabb9260a5c854bc85b3e44" as an MD5 hash
if [ "$6" == "34819d7beeabb9260a5c854bc85b3e44" ]; then
  echo "Password ok"
else
  exit 2
fi
exit 1

2. Stop the VirtualHere package in the DSM Package Center
3. Edit the config.ini file and add the line

ClientAuthorization=/volume1/@appstore/VirtualHere/auth.sh "$VENDOR_ID$" "$PRODUCT_ID$" "$CLIENT_ID$" "$CLIENT_IP$" "$PRODUCT_SERIAL$" "$PASSWORD$" "$DEVPATH$" "$NICKNAME$" "$NUM_BINDINGS$"

4. Save the config.ini changes and start the virtualhere server using the DSM

5. Try to use a device, when it asks for a password put in mypassword

Log in or register to post comments