Skip to content

lwimmer/G3T2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published