Skip to content

Docker Deployment

Supported Architectures

Transfer Agent 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 Transfer Agent release
develop Release from development branch
x.y.z Specific tagged version

Transfer Agent Setup

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

By default you can access the transfer agent at:

http://DOMAIN:8080/

Docker Compose

MASV recommends Docker Compose for managing Transfer Agent in Docker.

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

To authenticate with a docker-compose file, define a Docker environment variable or Docker secret.

This example uses an environment variable, API_KEY to pass to the Transfer Agent service command line:

version: "3"
services:
  transferagent:
    image: masvio/transfer-agent:latest
    container_name: transfer-agent
    environment:
      - TZ=UTC
      - API_KEY=${API_KEY}
    volumes:
      - /path/to/your/config/:/config
      - /path/to/your/data/:/data
    ports:
      - 8080:8080
    restart: unless-stopped
    command: ["-api-key", "$API_KEY"]

Docker command line

You can start and stop Transfer Agent in Docker from the command line.

# 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. Transfer Agent accepts datetime parameters in API calls and users should expect their Transfer Agent timezone to match the host machine.

Parameters

We can configure the Transfer Agent 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 Transfer Agent expects and creates a few folders 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

Tip

Create these folders on the Docker host before starting the container. Otherwise, Docker creates these folders with root as owner.

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 Transfer Agent.

  • 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