Skip to main content

Configure for Data (S6)

Learn how to configure the IonFS CLI to securely store data with S6.

Summary overview#

Before we get started, we'll cover a summary of how each configuration file should look once they've been setup.

To use ionfs with S6, we need to configure three things:

  • The Ionburst credentials file.
  • The metadata repository settings - in this case, the AWS credentials file.
  • The ionfs settings file.

Ionburst Credentials#

ionfs requires a profile configured in the Ionburst credentials file, a well-known directory in the user's home folder.

  • On MacOS/Linux, this file is located at ~/.ionburst/credentials, and
  • on Windows, it is located at %USERPROFILE%\.ionburst\credentials.

An example of the final credentials file should look similar to this. In this example, the credentials profile we will create is called ionfs-example, and the profile is configured to use the Ionburst Cloud eu-west-1 region.

[ionfs-example]
ionburst_id=IBGCFRFEUJ2TDEXAMPLE
ionburst_key=bG9va211bWknbWFiYXNlNjRlbmNvZGVkc3RyaW5n
ionburst_uri=https://api.eu-west-1.ionburst.cloud

Metadata settings#

As this example is using Amazon S3 for the ionfs metadata, we have to create an AWS credentials file. This file is stored within a well-known directory in the user's home folder.

  • On MacOS/Linux, this file is located at ~/.aws/credentials, and
  • on Windows, it is located at %USERPROFILE%\.aws\credentials.

The credentials file is INI formatted, and allows multiple sets of credentials, or profiles, to be used:

[example_profile]
aws_access_key_id=AKIAIOSFODNN7EXAMPLE
aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

IonFS CLI settings#

ionfs uses its own configuration file located within a well-known directory in the user's home folder.

  • On MacOS/Linux, this file is located at ~/.ionfs/appsettings.json, and
  • on Windows, it is located at %USERPROFILE%\.ionfs\appsettings.json.

An example of the ionfs configuration file should look similar to the below. In this example, ionfs is configured to use a metadata repository "s3-example-ionfs", the Ionburst credentials profile "ionfs-example", and the AWS credentials profile "example_profile".

{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"IonFS": {
"MaxSize": "50000000",
"Verbose": "false",
"DefaultClassification": "Restricted",
"Repositories": [
{
"Name": "s3-example-ionfs",
"Usage": "Data",
"Class": "Ionburst.Apps.IonFS.Repo.S3.MetadataS3",
"Assembly": "Ionburst.Apps.IonFS.Repo.S3",
"DataStore": "s3-example-ionfs"
}
],
"DefaultRepository": "s3-example-ionfs",
},
"Ionburst": {
"Profile": "ionfs-example",
"IonburstUri": "https://api.eu-west-1.ionburst.cloud/",
"TraceCredentialsFile": "OFF"
},
"AWS": {
"Profile": "example_profile",
"Region": "eu-west-1"
}
}

IonFS S6 Setup#

Creating the credentials file#

Open a new terminal.

Next, we need to create the .ionburst directory:

mkdir ~/.ionburst

The credentials file can then be created within this directory:

touch ~/.ionburst/credentials

You can now verify this with the following:

ls ~/.ionburst/credentials

On verifying, the output should look similar to this:

[hello@ionfs-example ~]$ ls ~/.ionburst/credentials
/home/hello/.ionburst/credentials

Add a profile to the credentials file#

To create a new profile in the Ionburst credentials file, the following can be used:

echo "[ionfs-example]" >> ~/.ionburst/credentials
echo "ionburst_id=IBGCFRFEUJ2TDEXAMPLE" >> ~/.ionburst/credentials
echo "ionburst_key=bG9va211bWknbWFiYXNlNjRlbmNvZGVkc3RyaW5n" >> ~/.ionburst/credentials
echo "ionburst_uri=https://api.eu-west-1.ionburst.cloud/" >> ~/.ionburst/credentials

This will add a profile ionfs-example to the credentials file. Please ensure the >> operator is used to avoid overwriting any existing contents in the credentials file.

The file contents can be verified with the following:

cat ~/.ionburst/credentials

An example output should look similar to:

[hello@ionfs-example ~]$ echo "[ionfs-example]" >> ~/.ionburst/credentials
[hello@ionfs-example ~]$ echo "ionburst_id=IBGCFRFEUJ2TDEXAMPLE" >> ~/.ionburst/credentials
[hello@ionfs-example ~]$ echo "ionburst_key=bG9va211bWknbWFiYXNlNjRlbmNvZGVkc3RyaW5n" >> ~/.ionburst/credentials
[hello@ionfs-example ~]$ echo "ionburst_uri=https://api.eu-west-1.ionburst.cloud/" >> ~/.ionburst/credentials
[hello@ionfs-example ~]$ cat ~/.ionburst/credentials
echo "[ionfs-example]" >> ~/.ionburst/credentials
echo "ionburst_id=IBGCFRFEUJ2TDEXAMPLE" >> ~/.ionburst/credentials
echo "ionburst_key=bG9va211bWknbWFiYXNlNjRlbmNvZGVkc3RyaW5n" >> ~/.ionburst/credentials
echo "ionburst_uri=https://api.eu-west-1.ionburst.cloud/" >> ~/.ionburst/credentials

Creating the AWS credentials file#

Next, we need to create the .aws directory:

mkdir ~/.aws

The credentials file can then be created within this directory:

touch ~/.aws/credentials

You can now verify this with the following:

ls ~/.aws/credentials

On verifying, the output should look similar to this:

[hello@ionfs-example ~]$ ls ~/.aws/credentials
/home/hello/.aws/credentials

Add a profile to the AWS credentials file#

To create a new profile in the AWS credentials file, the following can be used:

echo "[example-profile]" >> ~/.aws/credentials
echo "aws_access_key_id=AKIAIOSFODNN7EXAMPLE" >> ~/.aws/credentials
echo "aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" >> ~/.aws/credentials

This will add a profile example-profile to the credentials file. Please ensure the >> operator is used to avoid overwriting any existing contents in the credentials file.

The file contents can be verified with the following:

cat ~/.aws/credentials

An example output should look similar to:

[hello@ionfs-example ~]$ echo "[example-profile]" >> ~/.aws/credentials
[hello@ionfs-example ~]$ echo "aws_access_key_id=AKIAIOSFODNN7EXAMPLE" >> ~/.aws/credentials
[hello@ionfs-example ~]$ echo "aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" >> ~/.aws/credentials
[hello@ionfs-example ~]$ cat ~/.ionburst/credentials
[example-profile]
aws_access_key_id=IBGCFRFEUJ2TDEXAMPLE
aws_secret_access_key=bG9va211bWknbWFiYXNlNjRlbmNvZGVkc3RyaW5n

Creating the ionfs settings file#

Next, we need to create the .ionfs directory:

mkdir ~/.ionfs

The settings file can then be created within this directory:

touch ~/.ionfs/appsettings.json

You can now verify this with the following:

ls ~/.ionfs/appsettings.json

Configure the ionfs settings file#

Open the ionfs settings file in the text editor of your choice.

Paste the example file above into the file.

Adjust the following values:

  • Within the Repositories section
    • Change the "Name" value to the desired name for your metadata repo (optional)
    • Ensure the "Usage" value is set to Data
    • Ensure the "Class" value is set to Ionburst.Apps.IonFS.Repo.S3.MetadataS3
    • Ensure the "Assembly" value is set to Ionburst.Apps.IonFS.Repo.S3
    • Change the "DataStore" value to the name of the S3 bucket created to store ionfs metadata
  • Ensure the value for "DefaultRepository" matches the value in "Name"
  • Within the Ionburst section
    • Change the "Profile" value to the profile created in your Ionburst credentials file
    • Change the "IonburstUri" value to your desired Ionburst Cloud API endpoint
    • Ensure "TraceCredentialsFile" is set to "OFF"
  • Within the AWS section
    • Change the "Profile" value to the profile created in your AWS credentials file
    • Change the "Region" value to the region your S3 bucket was created in