Giter VIP home page Giter VIP logo

boxfs2's Introduction

BOXFS

A FUSE-based filesystem for box.com.

This software is licensed under the GPLv3 Licence and comes with NO WARRANTY. Use at your own risk. See gpl-3.0.txt.

Boxfs use the v2 version of box.com api (see http://developers.box.com/docs/), older versions used the v1 api.

Compiling

If you prefer a static build or don't want to install libapp and libjson system-wide, you can run make static to:

  • download (git clone) libapp and libjson, inside the boxfs source tree
  • compile them
  • link boxfs against those local libs

Usage

Boxfs can read options from command line or from a config file.

The simplest way to start is to run the script boxfs-init and let it create a configuration file for you.

The first time you run boxfs, you will need to complete the authentication (oauth2) process and grant access to your box.com account. It's easy, just follow the instructions on the terminal and on your browser.

The first mount can be quite slow because boxfs will fetch and cache info (metadata, not file contents!) about your folders.

Usage: boxfs [options] [mountPoint]

Options:
  -h                          shows this help message
  -f               conffile   file containing configuration options
  -t --token_file  tokenfile  file containing oauth tokens
  -c --cache_dir   cachedir   directory used to cache metadata
  -e --expire_time N          expire time for cache entries (in minutes)
  -l --largefiles             enable support for large files (splitting)
  -v --verbose                turn on verbose syslogging
  -U --uid                    user id to use as file owner (defaults to you)
  -G --gid                    group id to use for group permissions
  -F --fperm                  file permissions (default 0644)
  -D --dperm                  directory permissions (default 0755)

When you've done using your files, unmount your filsystem with fusermount -u mountpoint

Authors and Contributors

Boxfs is written by Domenico Rotiroti with contributions from other GitHub users.

See README.V1 for a list of people who helped in the previous releases.

Known problems/limitations

  • Sharing, tags and other file metadata are not handled
  • Updates made from outside boxfs are not visible until remount
  • Can't create empty files

boxfs2's People

Contributors

brycied00d avatar drotiro avatar michaelansel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

boxfs2's Issues

mtime of a file is 9 hours off

Hello,
if I create or change a file in the mounted box directory its timestamps are off by 9 hours after remount (reconnect). Probably the timezone has some effect too, mine is currently CEST which is GMT +2 hours.

Check the following scenario:

[jhradek@vice ~]$ box
mkdir "/home/jhradek/cloud" && boxfs -f "/home/jhradek/.boxfs/conf"

[jhradek@vice ~]$ cd cloud
/home/jhradek/cloud

[jhradek@vice cloud]$ mount | grep boxfs
boxfs on /home/jhradek/cloud type fuse.boxfs (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)

[jhradek@vice cloud]$ ls -l testfile
ls: cannot access testfile: No such file or directory

[jhradek@vice cloud]$ date
Sat Jun  7 11:07:45 CEST 2014

[jhradek@vice cloud]$ echo "hello world" > testfile

[jhradek@vice cloud]$ ls -l testfile
-rw-r--r-- 1 jhradek users 12 Jun  7 11:07 testfile

[jhradek@vice cloud]$ stat testfile
  File: ‘testfile’
  Size: 12          Blocks: 0          IO Block: 4096   regular file
Device: 23h/35d Inode: 8           Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/  jhradek)   Gid: (  100/   users)
Access: 2014-06-07 11:07:52.000000000 +0200
Modify: 2014-06-07 11:07:52.000000000 +0200
Change: 2014-06-07 11:07:52.000000000 +0200
 Birth: -

[jhradek@vice cloud]$ cat testfile
hello world

[jhradek@vice cloud]$ cd ..

[jhradek@vice ~]$ box -
sudo umount "/home/jhradek/cloud" && rmdir "/home/jhradek/cloud"

[jhradek@vice ~]$ box
mkdir "/home/jhradek/cloud" && boxfs -f "/home/jhradek/.boxfs/conf"

[jhradek@vice ~]$ cd cloud/
/home/jhradek/cloud

[jhradek@vice cloud]$ ls -l testfile 
-rw-r--r-- 1 jhradek users 12 Jun  7 02:08 testfile

[jhradek@vice cloud]$ stat testfile
  File: ‘testfile’
  Size: 12          Blocks: 0          IO Block: 4096   regular file
Device: 23h/35d Inode: 6           Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/  jhradek)   Gid: (  100/   users)
Access: 2014-06-07 02:08:22.000000000 +0200
Modify: 2014-06-07 02:08:22.000000000 +0200
Change: 2014-06-07 02:08:21.000000000 +0200
 Birth: -

Regards,
Jan hradek

Issue running boxfs -f

Hi, I justo found this!

I installed all dependencies without error
I run boxfs-init without errors.
But boxfs -f ~/.boxfs/conf gives me:

boxfs: error while loading shared libraries: libapp.so: cannot open shared object file: No such file or directory

What did I did wrong?

installer for boxfs

Is there a installer file for boxfs like .deb or something else which supports Linux Mint 19?

thanks,

Can cp to Box but get 0 byte file when cp from to local machine

Hi, I know its been a few years since you worked on this but I was looking for an alternative to davfs2 that would allow direct access to files for streaming rather than caching first and I came across boxfs2. I got it setup and have my Box account mounted and I can copy files TO the box folder but when I try to access a file in the Box folder or cp it locally the command completes instantly and the file size is 0 bytes. There is no error. If you could help or have suggestions I would be grateful. Alternatively if boxfs2 is similar to davfs2 in that the full file has to be cached locally before accessing it is possible could you tell me? It would save me the time of troubleshooting the copy issue. Thanks

Authentication process not accepting input

Hi again,

After creating a standard config through boxfs-init and set my mount point, I run boxfs -f .boxfs/conf and start the authentication process. When I grant access and try to copy the code from the URL parameters, my terminal does not accept the input.

I took a look at the code found that in libapp/app.c you disable the c_lflag ECHO for this specific input. Although it should only disable the echo, as a test, I commented and compiled the calls to app_term_set_echo and after I tried the authentication process again I could successfully input the code.

I read the termios struct documentation, but found nothing related.

After this, fuse gives me a permission denied error, I guess this is my particular problem.

DISCLAIMER: The input in the authentication process I do it from an OS X terminal with a SSH to a Debian machine (I paste the code by doing Cmd+v or Shft + Cmd + v)

fstab mount?

HI,

Thank you for this project. Is there a way to add boxfs mount to fstab?

New Token every time

Everytime I run boxfs, I have to acquire a new token. Not sure why the old token file isn't usable. The token file is in the folder referenced by the config file and has 0400 permissions.

# Conf file for boxfs
# edit to fit your needs.

# Put oauth2 tokens here:
token_file = /media/Data/.box/token

# Set a valid mount point
mountpoint = /media/Data/Box.com

verbose    = no
largefiles = no

# Configure the cache
cache_dir   = /media/Data/.box/cache
expire_time = 1440

# Configure your uid and gid below:
#uid = 1000
#gid = 1000
fperm = 644
dperm = 755

Is this a bug? Am I misinterpreting the performance?

Segmentation fault

Hi Domenico,

I compiled boxfs2 on a Debian with libcurl3 and the rest of the dependencies mentioned. After running the init script I run boxfs with the conf file created and I get a segmentation fault. Here is the syslog message:

Nov 30 20:41:28 manuel kernel: [16253110.231448] boxfs[15214]: segfault at 0 ip 00007f0cdc792e21 sp 00007fff41c50548 error 4 in libc-2.13.so[7f0cdc712000+180000]

Is it a configuration/compile issue or am I missing something?

Auth code not working

I can not get Auth to work.
Command line is sudo ./boxfs -f /home/casucan/.boxfs/conf

Conf file looks like.

Conf file for boxfs

edit to fit your needs.

Put oauth2 tokens here:

token_file = /home/casucan/.boxfs/token

Set a valid mount point

mountpoint = /usr/local/boxfs

verbose = no
largefiles = no

Configure the cache

cache_dir = /home/casucan/.boxfs/cache
expire_time = 1440

Configure your uid and gid below:

uid = 1000

gid = 1000

fperm = 644

dperm = 755

It asks me to go to the https://www.box.com/api/oauth2/authorize web site to get the code.
I type in code and get error message.
Unable to get access token: Auth code doesn't exist or is invalid for the client

How can I correct this?

stopped working on 03/03

Without changing anything I now get the error "unable to parse server response:" empty string when I try to mount with a token. sudo boxfs -u [email protected] /mnt/mybox "gives me Unable to initialize Box.net connection."
box.com account is still valid.

fuse.h no such file or directory

After installing the necessary components, upon running the make file I'm greeted with the following:
boxapi.h:11:18: fatal error: fuse.h: No such file or directory
compilation terminated.
make: *** [boxfs.o] Error 1

undefined reference to json_*

I was interested in testing this out, but am unable to compile it in Ubuntu 14.04. It seems to have issues with libjson. I was using make static. Here's the relevant output:

Building  boxfs
cc -D_FILE_OFFSET_BITS=64 -I/usr/local/include -I/usr/include/fuse -I/usr/include/libxml2     -o boxfs boxfs.o boxapi.o boxpath.o boxhttp.o boxopts.o boxjson.o boxcache.o boxutils.o -pthread -L/usr/local/lib -lfuse -lxml2 -lcurl -lapp -ljson   -lpthread
boxjson.o: In function `jobj_parse':
boxjson.c:(.text+0x3c7): undefined reference to `json_parser_dom_init'
boxjson.c:(.text+0x3fa): undefined reference to `json_parser_dom_callback'
boxjson.c:(.text+0x402): undefined reference to `json_parser_init'
boxjson.c:(.text+0x441): undefined reference to `json_parser_string'
boxjson.c:(.text+0x45c): undefined reference to `json_parser_is_done'
boxjson.c:(.text+0x47a): undefined reference to `json_parser_free'
boxjson.c:(.text+0x489): undefined reference to `json_parser_dom_free'
collect2: error: ld returned 1 exit status
make: *** [boxfs] Error 1

Full log here:
http://pastebin.com/m8RvbwGU

Any assistance would be appreciated.

Segmentation fault with no trace

Hi there,

I'm trying to mount the box drive using boxfs in my Linux Mint but end up with this,
:~/boxfs2$ boxfs ~/Box.com
Login: [email protected]
Password:
noname.xml:6: parser error : Opening and ending tag mismatch: hr line 5 and body

^ noname.xml:7: parser error : Opening and ending tag mismatch: body line 3 and html ^ noname.xml:8: parser error : Premature end of data in tag html line 1

^
Segmentation fault (core dumped)
:/boxfs2$ make clean
rm -f boxfs.o boxapi.o boxpath.o boxhttp.o boxopts.o boxjson.o boxcache.o boxutils.o *
boxfs
:/boxfs2$ export CFLAGS=-g
:
/boxfs2$ make
Compiling boxfs.c
cc -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/usr/local/include -g -c boxfs.c -o boxfs.o
Compiling boxapi.c
cc -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/usr/local/include -g -c boxapi.c -o boxapi.o
In file included from boxpath.h:16:0,
from boxapi.c:11:
boxjson.h:12:10: fatal error: json.h: No such file or directory
#include <json.h>
^~~~~~~~
compilation terminated.
Makefile:27: recipe for target 'boxapi.o' failed
make: *** [boxapi.o] Error 1

I have tried to find the trace by following this https://github.com/drotiro/boxfs2/wiki/Debugging-a-Segfault but end up with no trace.

your help is highly appreciated

fuse error: On Darwin API version 25 or greater must be used

When compiling on OS X using OSXFUSE, several errors appear regarding the version of fuse being used:

In file included from /usr/local/include/osxfuse/fuse/fuse.h:26:
/usr/local/include/osxfuse/fuse/fuse_common.h:271:8: error: On Darwin API version 25 or greater must be used

The errors appear when compiling these files:

boxapi.c
boxhttp.c
boxopts.c
boxpath.c

It appears that FUSE_USE_VERSION is defined in only boxfs.c, so is undefined in these other files. I think it would be better to move this definition to boxapi.h so it is available when these other files are compiled.

Make -o option, or make ~/.boxfs/conf the default config file.

Currently, boxfs2 does not take an -o option.
-o should take long options (e.g., conffile=/home/user/.boxfs/conf).

This is important if you want people to mount via fuse.
E.g.,
mount -t fuse boxfs ~/Box -o conffile=/home/user/Box
Why would you want to mount via fuse?
Users may need to mount this via fstab, or through systemd mount units.

Currently, this is possible with davfs. boxfs needs this option.

The primary issue is that you cannot use boxfs with mount.fuse because boxfs (for some unknown reason) does not, by default, use ~/.boxfs/conf as its configuration file, even though boxfs-init creates this file. So you /have/ to specify -f each time you want to mount. This is fine from CLI, but for mount.fuse, you need to be able to pass it the conf option somehow, and this should be done via -o.

rsync not working properly

I noticed that when running rsync, it behaves as regular copy-over instead of running a diff. Also, when it finishes, timestams are not preserved because

rsync: failed to set times on "/mnt/box/.20130918_191811.jpg.7mnBxP": No such file or directory (2)

Filenames change after they are done copying and rsync does not keep track of them on boxfs. Is this something to remedy or is it just the charm of boxfs?

Pass own options to libfuse

Hi, I'd like to pass my own options to libfuse. For example, this FUSE over Google Drive https://github.com/astrada/google-drive-ocamlfuse allows one to pass any options directly to libfuse with the -o option, such as:

$ google-drive-ocamlfuse -o allow_other

It states in the help as:

  -o          specify FUSE mount options.

However, I don't see anything similar in boxfs2. It would be nice to have something like that as well.

I wanted to pass my -o allow_other to libfuse with boxfs2 so that I can see the mounted directory through SMB. For now, I've modified the source on my fork in 79457da and it seems to be working well so far.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.