Setup and Configuration
Docker setup and configuration to simulate inabit approvals remotely on your server
Overview
This standalone project is designed to be deployed on a user's own server, enabling integration with inabit from remote.
Its primary purpose is to facilitate the approval of pending transactions within a gated approvals flow. This is essentially replacing an owner/approver's mobile approvals app, allowing users to control approvals on their server.
Functionality
Upon running, the application must successfully initialize and communicate with Inabit. This involves several steps depending on the initiation state. If the 'signer' is approved, the handling of pending transaction flow may proceed.
First Run
During the first run, a pairing process is initiated. This includes:
Logging into Inabit using the provided login token.
Validating the user's current state.
Requesting a pairing token.
Producing an encrypted key used for signing, saving it to a mapped volume.
Sending pairing data to Inabit and requesting the 'Owner' to authorize the approver.
Refreshing the login token i.e. acquiring automatically a new valid login token.
Recurring Runs
For subsequent runs, after validating that the user is paired, the application continues its operation as usual.
Initiation Errors
If anything goes wrong during the initiation stage, the approver initiation process will be aborted.
Prerequisites
An initial login token of a valid user within Inabit with the role: 'apiSigner'.
Enabled communication with the Inabit server (valid URL and whitelisted IPs and ports).
Deployment
From within the root directory inabit/inabit-remote
:
Set Login Token
The login token is approver's token valid for 30 days, allowing authentication with Inabit.
The token is automatically refreshed, i.e. switched to a new 30 days valid token, on:
each docker init.
every 15 days (configurable)
The refreshed login token is saved to a mapped volume on host machine.
The login token must be mapped to a selected location in the host filesystem for initialization and persistency.
Create a folder named
refresh
.Set into the folder the login token file
r.dat
(which includes the login token).Map the folder in the
docker-compose.prod.yml
:
Add the following environment variables in correspondence:
Build
Run
Required Configurations
The required config can be provided in 2 ways:
Baked into the docker by building the docker with a valid
.env
file.Through the
docker-compose.prod.yml
file variables override sectionenvironment
.
In case using .env
is selected, remember to modify or remove the environment:
section, from docker-compose.prod.yml
. In case of a change of the .env
, a new docker image build must proceed.
Required Environment Variables
Important
The approvers' key must be mapped to a selected location in the host filesystem for persistency. This is the required combination of env variables:
In the Docker Compose file:
Ensure Correspondence
Ensure there is correspondence between the volume mapping and the selected KEY_FILE_PATH
settings. The volume mapping in the Docker Compose file should reflect the chosen KEY_FILE_PATH
for persisting the encrypted key:
Pairing
On Docker init , it is first checked if the approver is in status Paired
or WaitingForApproval
.
If not, a pairing flow starts:
Within the flow interaction with Inabit,
a pairing data is exchanged with Inabit including the public signing key of the approver.
an approval message is sent to the owner of the organization.
a pairing code is produced in the approver start up log trace, and must be passed directly to the owner for pairing completion.
Wish to see how you can automate approving and signing transactions?
Refer to the next page to understand how to automate signing transactions using our docker!
Automate Signing Transactions