Code Monkey home page Code Monkey logo

g3t2's Introduction

Advanced Internet Computing WS 2016/2017; Group 3; Topic 2: Cloud-based RAID Storage

To compile, run and test use maven. You can use your local maven (mvn) or the included maven wrapper (./mvnw).

Configuration

Before you start you need to setup the configuration. Do so by copying credentials.properties.template to credentials.properties:

cp src/main/resources/credentials.properties.template src/main/resources/credentials.properties

and edit credentials.properties to your needs.

AWS S3

For AWS authentication you need to do the following:

Create a unique S3 bucket. Write the chosen region and bucket name in the credentials file. Copy your Access Key ID and Secret Access Key and put them in the credentials file.

Dropbox

For Dropbox authentication you need to do the following:

Go to https://www.dropbox.com/developers/apps/create and create a new app. You are forwarded to the app settings. There you can generate the required access token for the credentials file.

Box

For Box authentication you need to do the following:

openssl genrsa -out private_key.pem 2048
openssl rsa -pubout -in private_key.pem -out public_key.pem
openssl pkcs8 -topk8 -inform PEM -outform DER -in private_key.pem -out private_key.pkcs8 -nocrypt

Then go to https://app.box.com/developers/services/ and create a new app. To be able to use the public key authentication, you also need to enable two factor authentification for your account. You will see an error message with a link if this is not yet enabled.

With two factor authentication enabled, you can add a public key to the app. Click the button and then copy in the content of the public_key.pem file created earlier.

Next you need to copy the values of the following fields from the app settings page and put them in the credentials file:

  • client_id
  • client_secret
  • the key id of the key you just added

You will also need to copy the api key which is at the bottom of the page. Then go to https://app.box.com/master/settings/openbox and authorize the app. This will ask you for the api key you just copied previously.

Then you have to go to https://app.box.com/master/settings/account and copy the enterprise id.

You also need to add the private key in base64 encoded PKCS8 format. You can get this by running the following command:

sh
base64 -w0 private_key.pkcs8

Compile

mvn compile

Run tests

mvn test

Run app

mvn spring-boot:run

To enable DEBUG logging add --debug. (See Spring doc.)

To access the REST interface you can use curl:

curl http://localhost:8080/file

Some examples:

curl http://localhost:8080/file
curl http://localhost:8080/file/filename
curl http://localhost:8080/file/filename/locations
curl -T filename http://localhost:8080/file/
curl -X DELETE http://localhost:8080/file/filename

For further commands see RestController.

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.