Skip to content

Latest commit

 

History

History
238 lines (155 loc) · 9.4 KB

README.md

File metadata and controls

238 lines (155 loc) · 9.4 KB

PHANTOM REPOSITORY server

PHANTOM REPOSITORY server interfaces between the different PHANTOM tools, storing files and the metadata related to them.

1.- Introduction

The PHANTOM REPOSITORY server is composed of two components: a web server and a data storage system. The web server provides various functionalities for data query and data analysis via RESTful APIs with documents in JSON format. The server's URL is "http://localhost:8000" by default.

Repository Schema

2.- Prerequisites

The server is implemented using Node.js, and connects to Elasticsearch to store and access Metadata. Before you start installing the required components, please note that the installation and setup steps mentioned below assume that you are running a current Linux as the operating system. The installation was tested with Ubuntu 16.04 LTS. Before you can proceed, please clone the repository:

git clone https://github.com/PHANTOM-Platform/Repository.git;

OR alternatively, if you prefer to use svn instead of git:

svn export https://github.com/PHANTOM-Platform/Repository.git/trunk Repository;

Dependencies

This project requires the following dependencies to be installed:

Component Homepage Version
ElasticSearch https://www.elastic.co/products/elasticsearch = 2.4.6
Node.js https://apr.apache.org/ >= 4.5
npm https://www.npmjs.com/ >= 1.3.6
curl http://curl.haxx.se/download/ 7.37.0
git
netstat(net-tools package)
python

Installation of npm

When using Ubuntu, for example, please install npm as follows:

sudo apt-get install npm;

Alternatively, you can install it using your operating system's software installer.

Installation of Nodejs and ElasticSearch

This section assumes that you've successfully installed all required dependencies as described in the previous paragraphs.

1.- To ease the installation and preparation process, there is one shell script provided, which downloads and installs all the dependencies and packages.

Installs Nodejs 9.4.0. and Elastic-Search 2.4.6 on the folder {your_local_home_folder}/phantom_server. Please choose the appropriate shell scripts depending on your Operating System:

Shell script for Intel-x86 32bits (tested on Ubuntu):

bash setup-server-x86-32.sh

or the Shell script for Intel-x86 64bits (tested on Ubuntu):

bash setup-server-x86-64.sh

or the Shell script for Armv7l 64bits (tested on Raspbian):

bash setup-server-armv7-64.sh

The default port is 8000, which can be modified at the file repo_app.js.

2.- The PHANTOM Repository relies on the Elasticsearch running on the SAME server, which should be installed by the previous scripts.

Please take a look on the next suggested reference books, if you face difficulties on the setup of ElasticSearch-Database server:

3.- Start/Stop the server

1.- The PHANTOM Repository relies on the Elasticsearch running on the SAME server.

bash start-es.sh;

2.- Start a PHANTOM REPOSITORY by executing, it is important to not do as root:

For security reasons, the services may not start if they are requested from root.

bash start-repo.sh;

You can use the following command to verify if the database and the server are running

Test of the Nodejs Front-end running service:

curl http://localhost:8000;

Test if the Front-end has access to the Elasticsearch DataBase Server.

curl -s http://localhost:8000/verify_es_connection;

For more details on setup the server, please look into the examples of Admin-use at api_command_line or api_bash_scripts (not developed for api_java because we will allow only the admin access on the localhost).

After the usage, the server can be stopped by:

bash stop-repo.sh;

4.- Configuration of USERS' accounts

After the installation, and before users can use the repository, it is needed to register the users.

The script setup-new-server.sh provides an automatic method for register multiple users. In particular, the script registers the list of users_ids and passwords from the file list_of_users.ini.

bash setup-new-server.sh

NOTICE: For securoity reasons, users' accounts can be ONLY registered on the server. Requests from different IPs will be rejected.

5.- RESTful API Queries

Please refer to the Reference Manual of the RESTful API to get more details. The Manual contains a description of each of the implemented methods, with examples of use, and type of possible responses.

6.- Example of use

Notice that the files uploaded require to define their metadata, and their domain of use in case of wish to take advantage/use of the PHANTOM security server. Next figure shows an example of metadata.

Repository Schema

The folders api_command_line, api_bash_scripts, and api_java shows examples of using the PHANTOM REPOSITORY

Please access to those folders to get more details.

Video: Examples of use

There are some video tutorials available at Youtube and this channel:

Youtube PHANTOM Channel

Acknowledgment

This project is realized through PHANTOM. The PHANTOM project receives funding under the European Union's Horizon 2020 Research and Innovation Programme under grant agreement number 688146.

Contributing

Find a bug? Have a feature request? Please create an issue.

Main Contributors

Montanana, Jose Miguel, HLRS

Cheptsov, Alexey, HLRS

Release History

Date Version Comment
2018-03-22 0.9.0 First prototype
2019-05-15 1.0.0 Tested with Real Use Cases

License

Copyright (C) 2018 University of Stuttgart

Apache License v2.