Skip to content

Docker Deployment

Supported Architectures

Our TransferAgent supports multiple architectures to allow for deployment in different unique environments.

Utilizing the masvio/transfer-agent:latest image will automatically pull the correct architecture for your system.

The architectures supported by this image are:

Architecture Tag
x86-64 latest
arm64 latest

Version Tags

We support a number of different tags for our users and internal development. We recommend using the latest tag for the latest updates and security patches. Other non-version stubbed tags can be unstable and may result in lost data.

Tag Description
latest Stable TransferAgent release
develop Release from development branch
x.y.z Specific tagged version

TransferAgent Setup

Provisioning the docker image can be very simple. We provide an initial provisioning script to manage automations and authentication of the TransferAgent.

By default you can access the transfer agent at:

http://DOMAIN:8080/

Usage

For ease of use, we have outlined a docker-compose file and docker cli command. Both can be used to setup our TransferAgent, however we do recommend use of docker-compose.

version: "3"
services:
  transferagent:
    image: masvio/transfer-agent:latest
    container_name: transfer-agent
    environment:
      - TZ=UTC
    volumes:
      - /path/to/your/config/:/config
      - /path/to/your/data/:/data
    ports:
      - 8080:8080
    restart: unless-stopped

Docker CLI (More Info)

# Other flags can be defined as outlined in the Parameters section
docker run -it --rm \
  -p 127.0.0.1:8080:8080 \
  -e TZ=UTC \
  -v /path/to/your/config:/config \
  -v /path/to/your/data:/data \
  masvio/transfer-agent:latest

Environment Variables -e

Flags Type Description
TZ String Specify a timezone to use EG America/Halifax, this is required for automations. Default: UTC

Warning

You should include a TZ variable. TransferAgent accepts datetime parameters in API calls and users should expect their TransferAgent timezone to match the host machine.

Parameters

We can configure the TransferAgent on launch using various command-line flags. The flag name and its description are below.

Flags Type Description
listen String Listen address (port will be system assigned if not specified or 0) (default "http://localhost:8080")
log-format String Easy Logrus log format (default "[%lvl%] %time%: %msg%\n")
log-level String Log level (debug, info, warning, error) (default "debug")
log-out String Where the logs are written (stdout, stderr, {filename}) (default "stdout")
log-timestamp-format String Easy Logrus timestamp format (default "15:04:05")
secret-key String Secret Key that the server will require as a header, for local security purposes
version null Shows the current version/build number, as well as any available updates

Volumes

Our TransferAgent expects and creates a few folder on creation of the docker image. These folders can be overridden if required but we recommend keeping the defaults.

Volume Usage
/config Store application configuration and saved application data
/data Default folder to mount in your automated downloads and uploads

Warning

Directories should be created on the host before their usage with the docker image. On Linux if docker creates the directory the ownership will be set to the root user.

Files

Our docker container allows for various files to be persisted between reboots.

State Database

All state belonging to the database is store in a SQLite database file. This gets loaded on startup of the TransferAgent.

  • Default location
  • /config/app.db

Provisioning File

A provisioning file can be included to automatically create upload and download automations. For a more complete example of a provisioning config file, see provisioning

  • Default location
  • /config/config.yaml
# The authentication method for the MASV API. Depending on the mechanism used, it can either have:
#   - An api_key property for API key based authentication (recommended)
#   - email and password properties for user-based authentication (not recommended)
auth:
   # for API key authentication
   api_key: your-api-key
   # Alternativeley you can use the following for user-based auth
   # email: [email protected]
   # password: topsecret
​settings:
  upload_rate_limit: 100000
  download_rate_limit: 100000
portal_download_automations:
  - 1:
    name: portal-download-auto
    portal_subdomain: YourPortalSubdomain
    destination_folder: /data/portal-downloads
    effective_time: 2021-07-30T00:00:00Z
    enabled: true
portal_upload_automations:
  - 1:
    name: portal-upload-auto
    portal_subdomain: YourPortalSubdomain
    portal_password: changeme1
    path: /data/portal-uploads
    sender_email: [email protected]
    timeout: 5
    delete_files_after_upload: false
    send_loose_files: false
    package_name_suffix: portal-suffix
    message: portal upload msg
    blacklist: ["*.png"]
    enabled: true