Skip to content

Commit

Permalink
Merge pull request vitalif#201 from TopherGopher/master
Browse files Browse the repository at this point in the history
Drastically increases page sizes for listing - Dockerizes grive2 (cross-platform)
  • Loading branch information
vitalif committed Jul 22, 2018
2 parents 84c57c1 + f19406e commit 5949932
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.git
Dockerfile
.dockerignore
.gitignore
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM ubuntu:16.04

RUN apt-get update && \
apt-get install --yes --no-install-recommends g++ cmake build-essential \
libgcrypt11-dev libyajl-dev libboost-all-dev \
libcurl4-openssl-dev libexpat1-dev libcppunit-dev \
binutils-dev pkg-config zlib1g-dev && \
rm -rf /var/cache/apt/archives /var/lib/apt/lists/*

ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64 /usr/local/bin/dumb-init

RUN chmod +x /usr/local/bin/dumb-init

ADD . /grive2

RUN cd /grive2 && \
mkdir build && \
cd build && \
cmake .. && \
make -j4 && \
mv /grive2/build/grive/grive /usr/local/bin/grive && \
rm -rf /grive2

VOLUME /data

WORKDIR /data

ENTRYPOINT ["dumb-init", "/usr/local/bin/grive"]


# docker build -t grive2 .
# docker run --name grive2 --rm -it -v $PWD:/data grive2:latest
4 changes: 3 additions & 1 deletion libgrive/src/base/State.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ void State::FromRemote( const Entry& e )
std::string k = e.IsDir() ? "folder" : "file";

// common checkings
if ( !e.IsDir() && ( fn.empty() || e.ContentSrc().empty() ) )
if ( IsIgnore( e.Name() ) )
Log( "file %1% is ignored by griveignore", e.Name(), log::verbose ) ;
else if ( !e.IsDir() && ( fn.empty() || e.ContentSrc().empty() ) )
Log( "%1% \"%2%\" is a google document, ignored", k, e.Name(), log::verbose ) ;

else if ( fn.find('/') != fn.npos )
Expand Down
4 changes: 2 additions & 2 deletions libgrive/src/drive2/Syncer2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,12 @@ bool Syncer2::Upload( Resource *res, bool new_rev )

std::unique_ptr<Feed> Syncer2::GetFolders()
{
return std::unique_ptr<Feed>( new Feed2( feeds::files + "?maxResults=1000&q=trashed%3dfalse+and+mimeType%3d%27" + mime_types::folder + "%27" ) );
return std::unique_ptr<Feed>( new Feed2( feeds::files + "?maxResults=100000&q=trashed%3dfalse+and+mimeType%3d%27" + mime_types::folder + "%27" ) );
}

std::unique_ptr<Feed> Syncer2::GetAll()
{
return std::unique_ptr<Feed>( new Feed2( feeds::files + "?maxResults=1000&q=trashed%3dfalse" ) );
return std::unique_ptr<Feed>( new Feed2( feeds::files + "?maxResults=999999999&q=trashed%3dfalse" ) );
}

std::string ChangesFeed( long changestamp, int maxResults = 1000 )
Expand Down

0 comments on commit 5949932

Please sign in to comment.