Skip to content

Commit

Permalink
TFS 2.0: Sock and permission fix
Browse files Browse the repository at this point in the history
  • Loading branch information
radio24 committed Oct 20, 2024
1 parent bf8d104 commit bb068bb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
4 changes: 2 additions & 2 deletions bin/set_interfaces_3
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ read_config()
if [ "$NUMBER_OF_WORD" == "1" ]; then
I_DEVICE1=$CLIENT_IFACE
if [ "$INTERNET_IFACE" == "eth0" ]; then I_DEVICE2="eth1"; else I_DEVICE2="eth0"; fi
if grep "^TORBOX_MINI=0" ${RUNFILE} ; then
if grep -q "^TORBOX_MINI=0" ${RUNFILE} ; then
I_DEVICE3="usb0"
else
I_DEVICE3="tun1"
fi
elif [ "$NUMBER_OF_WORD" == "2" ]; then
I_DEVICE1=$(cut -d ' ' -f1 <<< $CLIENT_IFACE)
I_DEVICE2=$(cut -d ' ' -f1 <<< $CLIENT_IFACE)
if grep "^TORBOX_MINI=0" ${RUNFILE} ; then
if grep -q "^TORBOX_MINI=0" ${RUNFILE} ; then
I_DEVICE3="usb0"
else
I_DEVICE3="tun1"
Expand Down
12 changes: 1 addition & 11 deletions etc/nginx/sites-available/sample-onion-filesharing.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ server {
error_log /var/log/nginx/error_SERVICE.log;

location / {
proxy_pass http://unix:/var/run/tfs_SERVICE.sock;
}

location /static/ {
alias /home/torbox/torbox/lib/static/;
autoindex off;
}

location /files/ {
alias FOLDER; # Path to shared dir - this is an anker, don't remove it!
autoindex off;
proxy_pass http://unix:/var/run/tfs_SERVICE.sock:;
}
}
7 changes: 5 additions & 2 deletions lib/fileshare/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ def upload_files():
if '..' in upload_path:
abort(400, {'error': 'Invalid directory specified'})

# uplod_path must be a subdirectory of DOWNLOADS_PATH
upload_path = os.path.join(DOWNLOADS_PATH, upload_path)
# upload_path must be a subdirectory of DOWNLOADS_PATH
if upload_path == "/":
upload_path = DOWNLOADS_PATH
else:
upload_path = os.path.join(DOWNLOADS_PATH, upload_path)

# Check if the specified directory exists
if not os.path.exists(upload_path) or not os.path.isdir(upload_path):
Expand Down
4 changes: 2 additions & 2 deletions lib/torbox.lib
Original file line number Diff line number Diff line change
Expand Up @@ -1086,15 +1086,15 @@ stopping_domain_exclusion()
if [ "$NUMBER_OF_WORD" == "1" ]; then
I_DEVICE1=$CLIENT_IFACE
if [ "$INTERNET_IFACE" == "eth0" ]; then I_DEVICE2="eth1"; else I_DEVICE2="eth0"; fi
if grep "^TORBOX_MINI=0" ${RUNFILE} ; then
if grep -q "^TORBOX_MINI=0" ${RUNFILE} ; then
I_DEVICE3="usb0"
else
I_DEVICE3="tun1"
fi
elif [ "$NUMBER_OF_WORD" == "2" ]; then
I_DEVICE1=$(cut -d ' ' -f1 <<< $CLIENT_IFACE)
I_DEVICE2=$(cut -d ' ' -f1 <<< $CLIENT_IFACE)
if grep "^TORBOX_MINI=0" ${RUNFILE} ; then
if grep -q "^TORBOX_MINI=0" ${RUNFILE} ; then
I_DEVICE3="usb0"
else
I_DEVICE3="tun1"
Expand Down

0 comments on commit bb068bb

Please sign in to comment.