Domino DAOS T2 S3 Credentials
Starting in Domino 11, the Domino Attachment Object Service (DAOS) tier 2 storage feature enables you to use an S3-compatible storage service to store older attachment objects that haven’t been accessed within a specified number of days.
This feature allows you to reduce the amount of data stored on Domino® servers that use DAOS. It can also improve the performance of any incremental file backups that you do for DAOS.
Before you enable DAOS tier 2 storage, you must configure Domino® credential store to store the credentials that are used for connections to the storage service.
This document describes how to configure a new credential store. Section 5 describes how to add the storage service credentials to the Domino credential store.
The document says:
Create a text file, for example, dominocred.txt, that contains the service credentials
That means that you have to create a textfile in the Domino server file system.
I find this approach not very practical. In many cases Domino administrators do not necessarily have access to the file system. This means that sometimes cumbersome requests have to be made , so that authorized persons can copy the necessary file to the server.
Here another solution had to be found. I have thought about the following small workaround.
In credstore.nsf, I made a copy of the S3 Credential form and opened the existing items for editing. The form serves as a request document.
In the QueryClose event of the form I have a little LotusScript that calls an agent. The request document’s NoteId is passed to the agent.
import java.io.BufferedWriter;
import java.io.FileWriter;
import lotus.domino.AgentBase;
import lotus.domino.AgentContext;
import lotus.domino.Database;
import lotus.domino.Document;
import lotus.domino.Session;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
Database db = session.getCurrentDatabase();
Document param = null;
AgentContext agentContext = session.getAgentContext();
param = db.getDocumentByID(agentContext.getCurrentAgent().getParameterDocID());
if (null != param) {
String dataDir = session.getEnvironmentString("Directory",true) + "/";
String fileName = dataDir + param.getUniversalID() + ".txt";
BufferedWriter writer = new BufferedWriter(new FileWriter(fileName, true));
writer.append("[" + param.getItemValueString("$ServiceTag") + "]\n");
writer.append("aws_access_key_id = " + param.getItemValueString("AWSAccessKeyId") + "\n");
writer.append("aws_secret_access_key = " + param.getItemValueString("Fingerprint") + "\n");
writer.close();
sleep(2000);
String cmd = "tell daosmgr S3 storecred " + fileName;
session.sendConsoleCommand("", cmd);
param.remove(true);
}
param.recycle();
db.recycle();
session.recycle();
} catch (Exception e) {
e.printStackTrace();
}
}
}
The agent reads the items from the request document and creates a text file with the required format and content in the Domino datadir.
The agent then sends a console command to create the S3 credentials in the credstore.nsf.
The credentials are added to the credential store with the named credential.
The text file is deleted as well as the request document in the credstore.nsf. when the command completes. No credentials are visible at the console or in log files.
A small workaround that makes the life of a Domino administrator easier.