Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 25 Nov 2014, 20:42
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Browsers and Internet
box.com - davfs2 - libneon
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
plinej

Joined: 13 Aug 2006
Posts: 1522

PostPosted: Thu 17 May 2012, 21:30    Post_subject:  box.com - davfs2 - libneon
Sub_title: mounting your box.com account in Puppy
 

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.
davfs2-1.4.6-i486.pet
Description  compiled in Racy 5.3
pet

 Download 
Filename  davfs2-1.4.6-i486.pet 
Filesize  54.99 KB 
Downloaded  407 Time(s) 
mount-box.tar.gz
Description  new startup script as of 5/26
gz

 Download 
Filename  mount-box.tar.gz 
Filesize  897 Bytes 
Downloaded  347 Time(s) 
libneon-27.2.6.pet
Description 
pet

 Download 
Filename  libneon-27.2.6.pet 
Filesize  52.12 KB 
Downloaded  444 Time(s) 

_________________
An archive of quite a few pet packages, mostly that I've compiled, is located at http://my.opera.com/jpline/blog

Edited_times_total
Back to top
View user's profile Send_private_message 
plinej

Joined: 13 Aug 2006
Posts: 1522

PostPosted: Thu 17 May 2012, 21:33    Post_subject:  

This is the mount box script:

Code:

#!/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

_________________
An archive of quite a few pet packages, mostly that I've compiled, is located at http://my.opera.com/jpline/blog
Back to top
View user's profile Send_private_message 
jamesbond

Joined: 26 Feb 2007
Posts: 2230
Location: The Blue Marble

PostPosted: Thu 24 May 2012, 10:42    Post_subject:  

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:
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, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send_private_message 
plinej

Joined: 13 Aug 2006
Posts: 1522

PostPosted: Sat 26 May 2012, 19:31    Post_subject:  

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:
#!/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

_________________
An archive of quite a few pet packages, mostly that I've compiled, is located at http://my.opera.com/jpline/blog
Back to top
View user's profile Send_private_message 
plinej

Joined: 13 Aug 2006
Posts: 1522

PostPosted: Mon 28 May 2012, 19:49    Post_subject:  

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

_________________
An archive of quite a few pet packages, mostly that I've compiled, is located at http://my.opera.com/jpline/blog
Back to top
View user's profile Send_private_message 
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: Fri 01 Jun 2012, 16:49    Post_subject: Mount-box-enc  

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 Very Happy )

Code:

#!/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
Back to top
View user's profile Send_private_message 
sdiamond

Joined: 19 Jul 2012
Posts: 2

PostPosted: Thu 19 Jul 2012, 12:10    Post_subject:  Fails to mount  

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:

Quote:

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!
Back to top
View user's profile Send_private_message 
sdiamond

Joined: 19 Jul 2012
Posts: 2

PostPosted: Thu 19 Jul 2012, 12:57    Post_subject: Re: Fails to mount  

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:

Quote:
# 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.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Browsers and Internet
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0932s ][ Queries: 13 (0.0060s) ][ GZIP on ]