Skip to content

Configuration env

Thomas Trutt edited this page Apr 14, 2025 · 1 revision

This document covers the general .env settings and how they should be configured. For reference a sample file ahs been provided as part of this repo.

##-----------------------------
#   FOLIO Connection Environment Variables

## FOLIO Base URLs
TEST_BASE_URL = "https://okapi-library.institution.edu"
## FOLIO User Name
TEST_USER_NAME = "app_transfer"
TEST_USER_PASS = "a8F#kL9zX2qW@rT5vYp3mN6oJ"
## FOLIO tenant ID (same across all envs)
TEST_FOLIO_TENANT = "a1b2c3d4e5"

##-----------------------------
#   Save locations
#   File Delivery type
#   AWS - Uploaded to a AWS bucket
#   FTP - uploaded to a FTP site
#   LOCAL - Save toa  local directly

## AWS Settings
AWS_1_ACCESS_KEY_ID = AKIAIOSFODNN7RANDOM1234
AWS_1_SECRET_ACCESS_KEY = R4nd0mStr1ngG3n3r4t3dH3r3W1thM0r3Ch4r4ct3rsF0rS3cur1ty
AWS_1_REGION = us-east-
AWS_1_BUCKET = bucket-name

## SFTP Settings
FTP_2_USER = "foo"
FTP_2_PASSWORD = "pass"
FTP_2_HOST = "192.168.1.55"
FTP_2_PORT = 22
FTP_2_REMOTE_PATH = "/"
FTP_2_CERTIFICATE_LOCATION = "LOCAL"
FTP_2_CERTIFICATE_PATH = "temp/ssh_host_rsa_key"
FTP_2_KEY_TYPE = "RSA"
FTP_2_KNOW_HOSTS_LOCATION = "AWS_1"
FTP_2_KNOW_HOSTS_PATH = "know_hosts"

## Microsoft Azure Settings
MICROSOFT_1_AUTH_LOCATION = "LOCAL"
MICROSOFT_1_AUTH_PATH = "secrets/azure_auth.json"

## SMTP Settings
SMTP_1_DEFAULT_FROM = MyAccount@institution.com
SMTP_1_DEFAULT_REPLY_TO = MyAccount@institution.com
SMTP_1_HOST = smtp.institution.com
SMTP_1_PORT = 587
SMTP_1_USERNAME = MyAccount
SMTP_1_PASSWORD = "G7x!pQ2@rT5vL9zX2qW#kN6oJmYp3mN"
SMTP_1_TLS = true

## Local File System
LOCAL_1_FILE_PATH = "/tmp/exports"

Run Environment Variables

FOLIO Connection Settings

<<RUN_ENV>>_USER_NAME

The user name used to authenticate against the FOLIO system for the environment specified in the RUN_ENV variable.

<<RUN_ENV>>_USER_PASSWORD

The password used to authenticate against the FOLIO system for the environment specified in the RUN_ENV variable.

<<RUN_ENV>>_FOLIO_TENANT

The tenant that you are connecting to in the FOLIO system. This value can be found in the FOLIO system under the Settings -> Software Version in the same section as the API url.

<<RUN_ENV>>_BASE_URL

The base URL for the FOLIO system for the environment specified in the RUN_ENV variable.

  • OKAPI - These urls usually begin with okapi.YOUR_DOMAIN.com
    • Your API url can be found in the FOLIO system under the Settings -> Software Version under the Okapi service section.
  • Eureka - These urls usually begin with kong.YOUR_DOMAIN.com
    • Your API url can be found in the FOLIO system under the Settings -> Software Version under the API gateway services section.

Export Connection Settings

Connection stings are used by the Export functions to send data to other locations. There are several types of connection settings that can be used, and they are outlined below. These are the general settings for each connection type. documentation on how they are used can be found in the Exporting documentation.

AWS S3 Bucket

<<RUN_ENV>>_SECURE

  • (options) true or false
    • true will use the secure connection to the S3 bucket.
    • false will not use the secure connection to the S3 bucket.

If this is set to true then _ACCESS_KEY_ID and _SECRET_ACCESS_KEY will be used to authenticate against the S3 bucket.

<<RUN_ENV>>_ACCESS_KEY_ID

The access key ID used to authenticate against the AWS system for the environment specified in the RUN_ENV variable.

<<RUN_ENV>>_SECRET_ACCESS_KEY

The secret access key used to authenticate against the AWS system for the environment specified in the RUN_ENV variable.

<<RUN_ENV>>_REGION

The region that you are connecting to in the AWS system. This value can be found in the AWS system under the Settings -> Software Version in the same section as the API url.

<<RUN_ENV>>_BUCKET

The bucket that you are connecting to in the AWS system. This value can be found in the AWS system under the Settings -> Software Version in the same section as the API url.

SFTP

<<RUN_ENV>>_USER_NAME

The user name used to authenticate against the SFTP system for the environment specified in the RUN_ENV variable.

<<RUN_ENV>>_PASSWORD

  • (options) CERTIFICATE or a 'PASSWORD'
    • CERTIFICATE will use the certificate to authenticate against the SFTP system.
    • The password that will be used to authenticate against the SFTP system.

<<RUN_ENV>>_HOST

The host that you are connecting to in the SFTP system. This can be an ip address or a domain name.

<<RUN_ENV>>_PORT

  • The port that you are connecting to in the SFTP system. This is usually 22 for SFTP systems.

<<RUN_ENV>>_REMOTE_PATH

  • The remote path that you are connecting to in the SFTP system. This is usually / for the base directory.

<<RUN_ENV>>_CERTIFICATE_LOCATION

optional

  • (options) LOCAL or <<RUN_ENV>>
    • LOCAL will use the local file system to find the certificate.
    • <<RUN_ENV>> will use the connection string for that environment to find the certificate. Fro example 'AWS_1' will use the AWS_1 connection string to connect to that S3 bucket.

<<RUN_ENV>>_CERTIFICATE_PATH

  • The path to the certificate that will be used to authenticate against the SFTP system.
    • For LOCAL this will be a relative or absolute directory and file name sting.
    • For <<RUN_ENV>> esp in the case of AWS S3 bucket this would be the file name.

<<RUN_ENV>>_KEY_TYPE

  • (options) RSA or ED25519
    • RSA will use the RSA key type to authenticate against the SFTP system.
    • ED25519 will use the ED25519 key type to authenticate against the SFTP system.

<<RUN_ENV>>_KNOW_HOSTS_LOCATION

optional

  • (options) false, LOCAL, <<RUN_ENV>>
    • false will not use a know hosts file to authenticate against the SFTP system.
    • LOCAL will use the local file system to find the know hosts file.
    • <<RUN_ENV>> will use the connection string for that environment to find the certificate. Fro example 'AWS_1' will use the AWS_1 connection string to connect to that S3 bucket.

<<RUN_ENV>>_KNOW_HOSTS_PATH

  • The path to the know_hosts file that will be used for SFTP system.
    • For LOCAL this will be a relative or absolute directory and file name sting.
    • For <<RUN_ENV>> esp in the case of AWS S3 bucket this would be the file name.

Microsoft 360 {#Office360}

This connection can allow access to multiple Microsoft 360 services. This currently includes support for:

  • Email
  • OneDrive
  • Sharepoint (feature not yet implemented)
  • Teams (feature not yet implemented)

<<RUN_ENV>>_EMAIL_TYPE

  • Must be set to MICROSOFT. This will tell the export system which email processor to use.

<<RUN_ENV>>_AUTH_LOCATION

  • (options) LOCAL or <<RUN_ENV>>
    • LOCAL will use the local file system to find the certificate.
    • S3 will use a S3 bucket to find the certificate.
      • The _SECURE flag on the AWS environment variable will determine if the connection is secure or not.
        • false is used when this code is being ran as a lambda and does have direct access to the S3 bucket.
        • true is used when this code is not being ran as a lambda and does not have direct access to the S3 bucket.
    • <<RUN_ENV>> will use the connection string for that environment to find the certificate. Fro example 'AWS_1' will use the AWS_1 connection string to connect to that S3 bucket.

<<RUN_ENV>>_AUTH_PATH

  • The path to the JSON Token that will be used to authenticate against the system.
    • For LOCAL this will be a relative or absolute directory and file name sting.
    • For <<RUN_ENV>> esp in the case of AWS S3 bucket this would be the file name.

<<RUN_ENV>>_CLIENT_ID

  • Your Application (client) ID. Found on the 'Overview' page.

<<RUN_ENV>>_CERTIFICATE_SECRET_ID

  • Your client Value. Found on the 'Certificates & secrets' page for your app certificate.

Email Connection Settings

Microsoft Outlook (email)

Feature not yet implemented See: Microsoft 360 for more information on how to set up the connection.

Email - Smtp Connections

<<RUN_ENV>>_EMAIL_TYPE

  • Must be set to SMTP. This will tell the export system which email processor to use.

<<RUN_ENV>>_HOST

  • The host that you are connecting to in the SMTP system. This can be an ip address or a domain name.

<<RUN_ENV>>_PORT

  • The port that you are connecting to in the SMTP system. This is usually 25 for SMTP systems.

<<RUN_ENV>>_USERNAME

  • The user name used to authenticate against the SMTP system for the environment specified in the RUN_ENV variable.

<<RUN_ENV>>_PASSWORD

  • The password used to authenticate against the SMTP system for the environment specified in the RUN_ENV variable.

<<RUN_ENV>>_DEFAULT_FROM

  • The email address that will be used to send the email from. This is usually the same as the user name.

<<RUN_ENV>>_TLS

  • (options) true or false
    • true will use TLS to authenticate against the SMTP system.
    • false will not use TLS to authenticate against the SMTP system.

Local File System

<<RUN_ENV>>_FILE_PATH

  • The path to the local file system that will be used to save the files.
    • This can be a relative or absolute path.

Messaging Connection Settings

Slack

Feature not yet implemented

Microsoft Teams

Feature not yet implemented See: Microsoft 360 for more information on how to set up the connection.

Remote Storage

Feature not yet implemented

Microsoft Sharepoint

Feature not yet implemented See: Microsoft 360 for more information on how to set up the connection.

Clone this wiki locally