box.com - davfs2 - libneon

Browsers, email, chat, etc.
Post Reply
Message
Author
plinej
Posts: 1742
Joined: Mon 14 Aug 2006, 02:21

box.com - davfs2 - libneon

#1 Post by plinej »

I was looking for a good alternative to dropbox since dropbox has way too much overhead. I was lucky enough to get a free 50 GB's from box.com so after much googling I figured out how to get it all working. Install davfs2 & libneon below then run the mount-box startup script. That is a script that I put together to automate getting everything set up. If you make a mistake when prompted for your username or password you'll need to delete the file "/etc/davfs2/secrets" and run the mount-box script again.
Attachments
mount-box.tar.gz
new startup script as of 5/26
(897 Bytes) Downloaded 735 times
libneon-27.2.6.pet
(52.12 KiB) Downloaded 886 times
davfs2-1.4.6-i486.pet
compiled in Racy 5.3
(54.99 KiB) Downloaded 852 times
Last edited by plinej on Sat 26 May 2012, 23:47, edited 3 times in total.
You can also download many of my packages at:
[url]https://archive.org/download/python3-git-2019-10-10-x86_64[/url]

plinej
Posts: 1742
Joined: Mon 14 Aug 2006, 02:21

#2 Post by plinej »

This is the mount box script:

Code: Select all

#!/bin/sh

ROUTE="`route -n | grep -c '^0\.0\.0\.0'`"

while [ "$ROUTE" = 0 ]; do
	sleep 30
	ROUTE="`route -n | grep -c '^0\.0\.0\.0'`"
done

if [ "`cat /etc/fstab | grep davfs`" = "" ]; then
	echo "https://www.box.com/dav/  /mnt/box  davfs   noauto,user 0 0" >> /etc/fstab
fi

if ! [ -d /mnt/box ]; then
	mkdir /mnt/box
fi

addgroup davfs2 2>/dev/null
adduser -G davfs2 -D davfs2 2>/dev/null

if ! [ -d /etc/davfs2 ]; then
	mkdir /etc/davfs2
fi

if ! [ -f /etc/davfs2/davfs2.conf ]; then
	echo use_locks 0 > /etc/davfs2/davfs2.conf
	echo cache_size 1 >> /etc/davfs2/davfs2.conf
	echo delay_upload 0 >> /etc/davfs2/davfs2.conf
fi

if ! [ -f /etc/davfs2/secrets ]; then
	echo -n "enter your box username (e-mail) - > "
	read USER
	echo -n "enter your box password - > "
	read PASS
	echo "/mnt/box $USER $PASS" > /etc/davfs2/secrets
fi

chmod 600 /etc/davfs2/secrets 2>/dev/null

rm /var/run/mount.davfs/mnt-box.pid 2>/dev/null

umount /mnt/box 2>/dev/null

mount /mnt/box
You can also download many of my packages at:
[url]https://archive.org/download/python3-git-2019-10-10-x86_64[/url]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#3 Post by jamesbond »

Jason, if you use mount.davfs directly (instead of mount -t davfs), you can use echo "y" to it and it will accept the certificate. I just created a simple script called cloud-disk that also uses davfs2 to mount mydrive.ch and 4shared.com (I don't have account in box.com so I can't test).

The key line is:

Code: Select all

echo -e "$user\n$password\ny" | mount.davfs $url $mountpoint
and it works. I don't have to deal with /etc/davfs2.conf (other than to set default options such as locks), also no more meddling with secrets file.

It works, regardless of the warning it says that you shouldn't call it directly.

umount.davfs on the other hand cannot handle mountpoint with spaces in it ...

The pet is available here, it only works for Fatdog64 600 but it can be easily modified to work with any puppies that have davfs2 (and curlftpfs, for that matter).

cheers!
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

plinej
Posts: 1742
Joined: Mon 14 Aug 2006, 02:21

#4 Post by plinej »

Thanks jamesbond! If anyone wants my tweaked script I'll post it below. Now there will be no prompt to accept the certificate and the login information on the initial running of the script will be a gtkdialog gui. Now the whole script can be added to your Startup directory to mount your box account on startup with no interaction. I'll replace the startup script in the first post with this new one as well.


Code: Select all

#!/bin/sh

ROUTE="`route -n | grep -c '^0\.0\.0\.0'`"

while [ "$ROUTE" = 0 ]; do
	sleep 30
	ROUTE="`route -n | grep -c '^0\.0\.0\.0'`"
done

if [ "`cat /etc/fstab | grep davfs`" = "" ]; then
	echo "https://www.box.com/dav/  /mnt/box  davfs   noauto,user 0 0" >> /etc/fstab
fi

if ! [ -d /mnt/box ]; then
	mkdir /mnt/box
fi

addgroup davfs2 2>/dev/null
adduser -G davfs2 -D davfs2 2>/dev/null

if ! [ -d /etc/davfs2 ]; then
	mkdir /etc/davfs2
fi

if ! [ -f /etc/davfs2/davfs2.conf ]; then
	echo use_locks 0 > /etc/davfs2/davfs2.conf
	echo cache_size 1 >> /etc/davfs2/davfs2.conf
	echo delay_upload 0 >> /etc/davfs2/davfs2.conf
fi

GTKDIALOG=""
if [ "`which gtkdialog4`" != "" ]; then
	GTKDIALOG=gtkdialog4
elif [ "`which gtkdialog3`" != "" ]; then
	GTKDIALOG=gtkdialog3
elif [ "`which gtkdialog`" != "" ]; then
	GTKDIALOG=gtkdialog
elif [ "$GTKDIALOG" = "" ]; then
if ! [ -f /etc/davfs2/secrets ]; then
	echo -n "enter your box username (e-mail) - > "
	read USER
	echo -n "enter your box password - > "
	read PASS
	echo "/mnt/box $USER $PASS" > /etc/davfs2/secrets
fi
fi

if [ "$GTKDIALOG" != "" ]; then
if ! [ -f /etc/davfs2/secrets ]; then
export BOX="
<window title=\"Login for box\">
<hbox>
<vbox>
    
    <hbox>
      <text><label>enter your box username (e-mail):</label></text>
      <entry>
        <variable>USER</variable>
      </entry>
    </hbox>
    
    <hbox>
      <text><label>enter your box password:</label></text>
      <entry>
        <variable>PASS</variable>
      </entry>
    </hbox>    

      <hbox>
 
    <button>
       <input file stock=\"gtk-ok\"></input>
      <label>OK</label>
      <action type=\"exit\">Exit-now</action>
    </button>

  </hbox>

</vbox>
</hbox>
</window>
"

RETSTRING="`$GTKDIALOG --program=BOX --center`"
USER=`echo "$RETSTRING" | grep USER= | sed 's/USER=\"//' | sed 's/\"//'`
PASS=`echo "$RETSTRING" | grep PASS= | sed 's/PASS=\"//' | sed 's/\"//'`
echo "/mnt/box $USER $PASS" > /etc/davfs2/secrets
fi
fi

chmod 600 /etc/davfs2/secrets 2>/dev/null

rm /var/run/mount.davfs/mnt-box.pid 2>/dev/null

umount /mnt/box 2>/dev/null

echo -e y | mount /mnt/box
You can also download many of my packages at:
[url]https://archive.org/download/python3-git-2019-10-10-x86_64[/url]

plinej
Posts: 1742
Joined: Mon 14 Aug 2006, 02:21

#5 Post by plinej »

I tweaked this script and added lots of other account types besides box.com as well as throwing together a gui and posted it at:

http://www.murga-linux.com/puppy/viewtopic.php?t=78638
You can also download many of my packages at:
[url]https://archive.org/download/python3-git-2019-10-10-x86_64[/url]

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

Mount-box-enc

#6 Post by seaside »

plinej,

Thanks very much for your pets and scripts for desktop cloud storage sites.

Posted below is my signon script for box.com (mount-box-enc) which encrypts the password (for those that don't like to see their password sitting as plain text in a file) and stores it in a file "/etc/davfs2/logons"

This script can be placed in the /root/Startup directory or on the desktop. It could also be a menu item by making a "mount-box-enc.desktop" file.

Cheers,
s
(Too bad, I missed out on the 50g storage offer earlier :D )

Code: Select all

#!/bin/sh

# mount-box-enc
# mounts box.com as folder to /mnt/box password encrypted
# Seaside 6/1/12

[[ `mount | grep www.box.com` ]] && Xdialog --msgbox '"www.box.com" is already mounted -- Exiting' 0 0  && exit

[ ! `which mount.davfs` ] && Xdialog --msgbox '"mount.davfs" not found -- Exiting' 0 0  && exit

[ ! -d /mnt/box ]  && mkdir /mnt/box
addgroup davfs2 2>/dev/null
adduser -G davfs2 -D davfs2 2>/dev/null

[ ! -d /etc/davfs2 ] && mkdir /etc/davfs2

grep davfs /etc/fstab || echo "https://www.box.com/dav/  /mnt/box  davfs   noauto,user 0 0" >> /etc/fstab

[ ! -f /etc/davfs2/davfs2.conf ] && echo 'use_locks 0 
cache_size 1 
delay_upload 0' > /etc/davfs2/davfs2.conf

if ! [ -f /etc/davfs2/logons ]; then

export MAIN_DIALOG='
<window title="Box Signin ">
 <vbox>
  <hbox>
     <entry>
      <default>User Name (E-mail)</default>
      <variable>NAME</variable>
    </entry>
  </hbox>
  <hbox>
  <entry activates-default="true">
      <default>Password</default>
      <variable>PASS</variable>
    </entry>
  </hbox>
  <hbox>
  <button can-default="true" has-default="true"> 
      <input file stock="gtk-ok"></input>
      <label>OK</label>
      <action type="exit">Exit-now</action>
    </button>
   <button cancel></button>
  </hbox> 
   </vbox>
   </window>
'
CHOICES=`gtkdialog3 -p MAIN_DIALOG -c`
eval "$CHOICES"
PASS=`echo "$PASS"|openssl enc -base64 ` 
echo "NAME=$NAME
PASS=$PASS" > /etc/davfs2/logons

fi


. /etc/davfs2/logons

PASS=`echo "$PASS"|openssl enc -base64 -d` 

echo -e "$NAME\n$PASS\ny"| mount -t davfs https://www.box.com/dav /mnt/box

rox /mnt/box
exit

sdiamond
Posts: 2
Joined: Thu 19 Jul 2012, 15:53

Fails to mount

#7 Post by sdiamond »

Greetings, everyone. I'm very new to Puppy and have minimal knowledge of *nix in general, so please bear with me and be specific if you're kind enough to reply.

I've installed both PET packages from the OP and tried both scripts. I'm getting the same error message each time I run one of the scripts or try to navigate to the /mnt/box directory:
Mounting /mnt/box
/sbin/mount.davfs: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
Mount failed


Done
There was one error.
When I use the stock browser to go to https://www.box.com/dav I can log in fine, see my Box folders, and download files. So there's no connectivity or account access problem.

Any ideas about what could be wrong and what I can do to correct it? Thanks in advance!

sdiamond
Posts: 2
Joined: Thu 19 Jul 2012, 15:53

Re: Fails to mount

#8 Post by sdiamond »

sdiamond wrote:Any ideas about what could be wrong and what I can do to correct it?
After further research I have a better idea of what's wrong, but still no fix. BTW, I'm running Slacko Puppy 5.3.3 Frugal. Following this post, I did the following with the result shown:
# ldd /sbin/mount.davfs
linux-gate.so.1 => (0xfffe000)
libneon.so.27 => /usr/lib/libneon.co.27 (oxb77ab000)
...
libssl.so.1.0.0 => not found
libcrypto.so.1.0.0 => not found
I also saw this post in a thread that discusses (among other things) missing 1.0 versions of libssl and libcrypto. When I run that command, my output is missing two packages, Packages-puppy-lucid-official and Packages-puppy-squeeze-official. What now? Is there someplace I can just download and install these?

Thanks!

ETA: Neither of those two packages exists in my /initrd/pup_ro2/root/.packages directory (and I wouldn't know how to restore them if they did). I do see the lucid package listed here, but I don't have a clue what to do with that file.

night flight
Posts: 10
Joined: Tue 19 Feb 2019, 20:05
Location: Northern Germany

#9 Post by night flight »

Dear plinej, nearly seven years later: thank you very much for these pets! I combined the davfs2-pet with a different libneon-27-pet dated 2019, edited the secrets-file, and now I can access any WebDAV targets :D

Coming from Microsoft Windows, there was nothing with: install a client and get started. But I can be dogged. It was quite a lot of research, trying out, interpreting error messages and fiddling around.

Now I am happy. As a beginner, I learned a lot again.
I use a Lenovo IdeaPad S10-2, built in 2009. I love it. My Slacko 5.7 (32 Bit) is on a 10 GB SD Card. So I can boot it everywhere (Smartphones excluded :P ).

Post Reply