Skip to content

Commit

Permalink
add OTS config menu configuration and Domino Download script
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Nashed committed Jul 28, 2024
1 parent da67955 commit d8891fd
Show file tree
Hide file tree
Showing 2 changed files with 150 additions and 18 deletions.
120 changes: 120 additions & 0 deletions docs/nshcfg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
---
layout: default
title: Domino Config Menu
nav_order: 6
description: "One-Touch Domino config menu"
has_children: false
---

# One-touch Domino Setup Support

Domino One Touch Setup is the new and flexible setup introduced in Domino 12.
The JSON based setup allows many configuration options.

The Domino Start Script and the Domino Container Script both leverage the **nshcfg.sh** providing a configurable menu and variable replacement option for OTS setups.

The menu itself is configured via a JSON file. By default the `/etc/sysconfig/domino.cfg` is used.


## Invoking the OTS Menu

The menu can have different type of prefixes and extensions.

### file:/ Prefix

A local file on the same host.

### https:// Prefix

A remote location requested via Curl.

### .json Extension

A OTS JSON file

### .cfg Extension

A menu file containing menu entries

### Domain

If only a domain is specified, the URL is completed appending `/.well-known/domino.cfg`

Example:

```
domino setup https://domino.lab
```

is translated into the well-known configuration URL

```
https://nashcom.lab/.well-known/domino.cfg
```


### "auto" Configuration

The term `auto` checks the domain of the host and completes it with the well-known configuration URL.

```
domino setup auto
```

## Configuration

A menu can be invoked with different entry points, which can be selected.
If no configuration is specified the `index` entry is used.

The menu allows relative and absolute addressing.
If no prefix is specified, an entry in the current file is selected.
This allows menu entries spanning multiple files and remote locations to build cascaded menus.

The default configuration used by the Domino Start Script and Container Control script

## Default configuration - /etc/sysconfig/domino.cfg

```
{
"index": {
"cfg": [
{
"name": ".",
"index": "/onetouch",
"URL": ""
}
]
},
"onetouch": {
"cfg": [
{
"name": "First server JSON",
"oneTouchJSON": "/opt/nashcom/startscript/OneTouchSetup/first_server.json",
"oneTouchENV": "/opt/nashcom/startscript/OneTouchSetup/first_server.env"
},
{
"name": "Additional server JSON",
"oneTouchJSON": "/opt/nashcom/startscript/OneTouchSetup/additional_server.json",
"oneTouchENV": "/opt/nashcom/startscript/OneTouchSetup/additional_server.env"
}
]
}
}
```

## Configuration entries

A configuration entry defines an entry. The following options are available:

- **name**
Defines the name of the entry

- **oneTouchJSON**
Defines a OTS JSON file

- **oneTouchENV**
Defines a OTS environment file

- **URL**
An URL entry pointing to another configuration file
48 changes: 30 additions & 18 deletions domdownload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# Caching access token for 40 minutes to avoid round trips got get a new access token (token is valid for 60 minutes)
# 0.9.6 Bug fixes
# 0.9.7 Fit & Finish changes
# 0.9.8 Performance counter for Linux but not for Mac because there is only a seconds timer in "date" and we don't want to install tools extra for this
# 0.9.8 Performance counter for Linux but not for Mac because there is only a seconds timer in "date" and we don't want to install tools extra for this
# 0.9.9 Better error output for invalid refesh tokens
# 1.0.0 Support for Alpine Linux
# 1.0.1 Allow to be invoked if stdin is redirected. Default config changes
Expand Down Expand Up @@ -656,7 +656,7 @@ SetRefreshToken()

if [ -z "$REFRESH_TOKEN" ]; then
LogError "No download token specified"
LogMessage "Info: To set a token, please invoke: 'domdownload -token'"
LogMessage "Info: To set a token, please invoke: 'domdownload -token'"
exit 1
fi

Expand Down Expand Up @@ -1253,7 +1253,7 @@ GetDownloadFromPortal()
echo
SELECTED=
while [ -z "$SELECTED" ];
do
do
read -p "Select [1-$N] 0 to cancel, x to go back? " SELECTED;
done
echo
Expand Down Expand Up @@ -1385,7 +1385,7 @@ DownloadFileDataJSON()

CheckConnection

# If online download file and parse. In local mode check if file is already parsed
# If online download file and parse. In local mode check if file is already parsed
if [ "$DOMDOWNLOAD_MODE" = "online" ]; then

DebugText "Downloading: $DOWNLOAD_URL -> $DOWNLOAD_FILE"
Expand Down Expand Up @@ -1521,9 +1521,18 @@ GetSoftwareConfig()
fi

# cut is faster to than JQ and is a very simple operation
MYHCL_TOKEN_URL=$(echo "$CONFIG" | /usr/bin/cut -d"|" -f1)
MYHCL_DOWNLOAD_URL_PREFIX=$(echo "$CONFIG" | /usr/bin/cut -d"|" -f2)
MYHCL_DOWNLOAD_URL_SUFFIX=$(echo "$CONFIG" | /usr/bin/cut -d"|" -f3)

if [ -z "$MYHCL_TOKEN_URL" ]; then
MYHCL_TOKEN_URL=$(echo "$CONFIG" | /usr/bin/cut -d"|" -f1)
fi

if [ -z "$MYHCL_DOWNLOAD_URL_PREFIX" ]; then
MYHCL_DOWNLOAD_URL_PREFIX=$(echo "$CONFIG" | /usr/bin/cut -d"|" -f2)
fi

if [ -z "$MYHCL_DOWNLOAD_URL_SUFFIX" ]; then
MYHCL_DOWNLOAD_URL_SUFFIX=$(echo "$CONFIG" | /usr/bin/cut -d"|" -f3)
fi

DebugText "Token URL: " $MYHCL_TOKEN_URL
DebugText "Download Prefix:" $MYHCL_DOWNLOAD_URL_PREFIX
Expand Down Expand Up @@ -1693,7 +1702,7 @@ GetDownloadFromSoftwareJSON()
echo
SELECTED=
while [ -z "$SELECTED" ];
do
do
read -p "Select Product [1-$N] 0 to cancel? " SELECTED;
done
echo
Expand Down Expand Up @@ -1747,7 +1756,7 @@ GetDownloadFromSoftwareJSON()
echo
SELECTED=
while [ -z "$SELECTED" ];
do
do
read -p "Select Type [1-$N] 0 to cancel? " SELECTED;
done
echo
Expand Down Expand Up @@ -1801,7 +1810,7 @@ GetDownloadFromSoftwareJSON()
echo
SELECTED=
while [ -z "$SELECTED" ];
do
do
read -p "Select Platform [1-$N] 0 to cancel? " SELECTED;
done
echo
Expand Down Expand Up @@ -1855,7 +1864,7 @@ GetDownloadFromSoftwareJSON()
echo
SELECTED=
while [ -z "$SELECTED" ];
do
do
read -p "Select Version [1-$N] 0 to cancel? " SELECTED;
done
echo
Expand Down Expand Up @@ -1910,7 +1919,7 @@ GetDownloadFromSoftwareJSON()
echo
SELECTED=
while [ -z "$SELECTED" ];
do
do
read -p "Select Language [1-$N] 0 to cancel? " SELECTED;
done
echo
Expand Down Expand Up @@ -1965,7 +1974,7 @@ GetDownloadFromSoftwareJSON()
echo
SELECTED=
while [ -z "$SELECTED" ];
do
do
read -p "Select WebKit [1-$N] 0 to cancel? " SELECTED;
done
echo
Expand Down Expand Up @@ -1997,9 +2006,9 @@ GetDownloadFromSoftwareJSON()

TranslatePlatform()
{

local PLATFORM_LOWERCASE=$(echo "$SEARCH_PLATFORM" | /usr/bin/awk '{print tolower($0)}')

case "$PLATFORM_LOWERCASE" in

linux|tux)
Expand Down Expand Up @@ -2257,10 +2266,13 @@ if [ -z "$MYHCL_PORTAL_URL" ]; then
MYHCL_PORTAL_URL=https://my.hcltechsw.com
fi

MYHCL_CDN_URL=https://d1rvrben0dw4ya.cloudfront.net

if [ -z "$MYHCL_CDN_URL" ]; then
MYHCL_CDN_URL=https://d1rvrben0dw4ya.cloudfront.net
fi

MYHCL_CATALOG_URL=$MYHCL_PORTAL_URL/catalog/domino
if [ -z "$MYHCL_CATALOG_URL" ]; then
MYHCL_CATALOG_URL=$MYHCL_PORTAL_URL/catalog/domino
fi

if [ -z "$MYHCL_API_URL" ]; then
MYHCL_API_URL=https://api.hcltechsw.com
Expand Down

0 comments on commit d8891fd

Please sign in to comment.