You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.7 KiB

# TUSDaemon default settings
# The default TUSD working directory.
# The TUSD Go executable location.
# The TUSD upload folder where the files are temporary stored during uploads.
# Fixed setting in order to make TUSD work behind NGINX.
# The location of the web hooks scripts. These are used for communicating with the REST API.
# Fixed setting which hooks are currently used.
# Check if OS variables are set though a Docker setup. Then these three values are already set and no .env file is needed
if [[ ${WEBHOOK_URL} = "" && ${DROPOFF_API_HAWK_KEY} = "" && ${DROPOFF_API_HAWK_SECRET} = "" && ! -f .env ]]; then
echo "Please create a configuration file (.env) first."
exit 1
if [ -f .env ]; then
# Every default variable above here can be changed the the '.env' file
source .env
# Check if reqruired encryption binary is available. If not, stop working and give a message
if [ ! -f /usr/bin/encfs ]; then
echo "Please install EncFS to support encryption: sudo apt install encfs"
exit 1
# Webhook logic in TUS can only be either '-hooks-dir' or '-hooks-http' and not both. This is due to the blocking behavior of certain webhooks.
# Start with Webhook files
"${TUSD_EXECUTABLE}" "${TUSD_ARGUMENTS}" -upload-dir "${TUSD_UPLOADDIR}" -hooks-dir "${TUSD_HOOKDIR}" -hooks-enabled-events "${TUSD_ENABLED_HOOKS}"
# Start with webhook urls
#"${TUSD_EXECUTABLE}" "${TUSD_ARGUMENTS}" -upload-dir "${TUSD_UPLOADDIR}" -hooks-http "${WEBHOOK_URL}" -hooks-enabled-events "${TUSD_ENABLED_HOOKS}"