2. Local Installation and Usage

2.1. Installation
2.2. Preparation of Filesharing Service
2.3. Building and Running the Service
2.4. Database Structure
warning

This section is meant mainly for Sipwise developers, in a regular NGCP deployment you don’t have to perform any action described here. To see the next step required in a regular deployment, please read Filesharing Service Activation Section 3, “Activation of Filesharing Service on NGCP” section.

2.1. Installation

If you have access to the source code / project via Gerrit, go to the root folder and run the following commands:

npm install -g gulp
npm install

2.2. Preparation of Filesharing Service

  • Copy src/config/local.template.ts, rename it to src/config/local.ts and modify it for your own needs (e.g. dsn credentials)
  • You need a new database named fileshare and also the NGCP provisioning database for subscriber authentication

2.3. Building and Running the Service

Please perform the following commands in order to enable and start comx-fileshare-service:

npm run build
npm start

2.4. Database Structure

Table information for the fileshare database:

  • downloads table:

    Table E.1. Details of downloads Table in fileshare Database

    Field Name Field Type Description

    id

    CHAR, PRIMARY KEY

    Internal ID of the download action

    state

    ENUM

    State of the download

    uploaded_id

    CHAR, FOREIGN KEY

    External ID used for accessing the uploaded file in uploads table

    created_at

    DATETIME

    Download action creation time

    updated_at

    DATETIME

    Time of last download action modification


  • sessions table:

    Table E.2. Details of sessions Table in fileshare Database

    Field Name Field Type Description

    id

    CHAR, PRIMARY KEY

    Internal ID of the session

    ttl

    INT

    Time-to-live value of the session (in seconds)

    created_at

    DATETIME

    Session creation time

    updated_at

    DATETIME

    Time of last session modification


  • uploads table:

    Table E.3. Details of uploads Table in fileshare Database

    Field Name Field Type Description

    id

    CHAR, PRIMARY KEY

    Internal ID of the file entry

    data

    LONGBLOB

    The file data

    original_name

    VARCHAR

    Original name of the file

    mime_type

    VARCHAR

    MIME type of the file

    size

    INT

    File size in bytes

    ttl

    INT

    Time-to-live value of the file

    state

    ENUM

    State of the file

    session_id

    CHAR, FOREIGN KEY

    External ID used to access session data in sessions table

    created_at

    DATETIME

    File creation / upload time

    updated_at

    DATETIME

    Time of last file modification