License Service#

Environment Variables#

設定ファイル内の設定値は環境変数で上書きできます。

例えば、設定ファイルが次のようになっている場合、

[section]
  attributes-1 = "value"

以下のような環境変数で設定を上書きできます。

LICENSE_SECTION_ATTRIBUTES_1="overwrite"

設定値が文字列の配列である場合は、カンマ区切りでの指定が可能です。

例えば、設定ファイルが次のようになっている場合、

[section]
  array-attributes = ['val1', 'val2']

環境変数に以下のような値を与えることで設定を上書きできます。

LICENSE_SECTION_ARRAY_ATTRIBUTES="overwrite1,overwrite2"

テーブルの配列([[section-name]]のように二重角括弧で記述)の中の項目は、環境変数による上書きはできません。

Reference#

すべての設定項目と、デフォルト値を示します。

api#

Property

Description

Default

bind-address

0.0.0.0:8080

[api]
  bind-address = '0.0.0.0:8080'

logger#

Property

Description

Default

level

info

encoding

json

[logger]
  level = 'info'
  encoding = 'json'

postgres#

Property

Description

Default

dbname

license

username

license

password

license

address

attrdb-license:5432

max-idle-conns

10

max-open-conns

10

max-conn-idle-time

0s

max-conn-lifetime

10m0s

[postgres]
  dbname = 'license'
  username = 'license'
  password = 'license'
  address = 'attrdb-license:5432'
  max-idle-conns = 10
  max-open-conns = 10
  max-conn-idle-time = '0s'
  max-conn-lifetime = '10m0s'

health#

Property

Description

Default

enable

false

bind-address

0.0.0.0:9080

base-path

[health]
  enable = false
  bind-address = '0.0.0.0:9080'
  base-path = ''

jet-stream#

Property

Description

Default

url

nats://nats:4222

username

intdash

password

aptpod1234

max-delivery-count

3

stream-prefix

max-pings-outstanding

3

ping-interval

5s

max-reconnects

1800

reconnect-wait

2s

replicas

0

tls-insecure

TLS証明書の検証をスキップします(デフォルト: false)。

false

max-age

Streamに保持するメッセージの最大保存期間です。0はデフォルト値が使用されます。

2160h0m0s

max-bytes

Streamが保持できる最大バイト数です。-1は無制限、0はデフォルト値が使用されます。

-1

max-msgs

Streamが保持できる最大メッセージ数です。0は無制限です。

0

max-msgs-per-subject

各サブジェクトごとの最大メッセージ数です。0は無制限です。

0

max-msg-size

単一メッセージの最大サイズです。0は無制限です。

0

duplicates

重複メッセージを追跡するウィンドウ期間です。0はサーバーデフォルト(2分)です。

2m0s

description

Streamの説明文です。

[jet-stream]
  url = 'nats://nats:4222'
  username = 'intdash'
  password = 'aptpod1234'
  max-delivery-count = 3
  stream-prefix = ''
  max-pings-outstanding = 3
  ping-interval = '5s'
  max-reconnects = 1800
  reconnect-wait = '2s'
  replicas = 0
  # TLS証明書の検証をスキップします(デフォルト: false)。
  tls-insecure = false
  # Streamに保持するメッセージの最大保存期間です。0はデフォルト値が使用されます。
  max-age = '2160h0m0s'
  # Streamが保持できる最大バイト数です。-1は無制限、0はデフォルト値が使用されます。
  max-bytes = -1
  # Streamが保持できる最大メッセージ数です。0は無制限です。
  max-msgs = 0
  # 各サブジェクトごとの最大メッセージ数です。0は無制限です。
  max-msgs-per-subject = 0
  # 単一メッセージの最大サイズです。0は無制限です。
  max-msg-size = 0
  # 重複メッセージを追跡するウィンドウ期間です。0はサーバーデフォルト(2分)です。
  duplicates = '2m0s'
  # Streamの説明文です。
  description = ''

event-bus#

Property

Description

Default

driver

jet-stream

publish-interval

10s

function-timeout

1h

[event-bus]
  driver = 'jet-stream'
  publish-interval = '10s'
  function-timeout = '1h'

exporter#

Property

Description

Default

driver

各サービスから収集した利用量をどこに出力するかを指定します。有効な値は noop`(どこにも出力しない), `opensearch です。

noop

[exporter]
  # 各サービスから収集した利用量をどこに出力するかを指定します。
  # 有効な値は `noop`(どこにも出力しない), `opensearch` です。
  driver = 'noop'

opensearch#

未設定の場合、デフォルト値が使用されます。

Property

Description

Default

region

CognitoとOpenSearchのリージョンです。

ap-northeast-1

identity-pool-id

CognitoのIdentity Pool IDです。形式: ap-northeast-1:xxxxx-xxxxx-xxxxx-xxxxx-xxxxx

user-pool-id

CognitoのUser Pool IDです。形式: ap-northeast-1xxxxxxxxxx

client-id

CognitoのUser Pool App Client IDです。

client-secret

CognitoのUser Pool App Client Secretです。

username

OpenSearchに書き込むCognito Userのユーザ名です。形式: data-writer@example.com

password

OpenSearchに書き込むCognito Userのパスワードです。

address

OpenSearchのエンドポイントです。形式: (AWSの場合) https://search-xxxxxxxxxxxxxx.ap-northeast-1.es.amazonaws.com

[opensearch]
  # CognitoとOpenSearchのリージョンです。
  region = 'ap-northeast-1'
  # CognitoのIdentity Pool IDです。
  # 形式: ap-northeast-1:xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
  identity-pool-id = ''
  # CognitoのUser Pool IDです。
  # 形式: ap-northeast-1xxxxxxxxxx
  user-pool-id = ''
  # CognitoのUser Pool App Client IDです。
  client-id = ''
  # CognitoのUser Pool App Client Secretです。
  client-secret = ''
  # OpenSearchに書き込むCognito Userのユーザ名です。
  # 形式: data-writer@example.com
  username = ''
  # OpenSearchに書き込むCognito Userのパスワードです。
  password = ''
  # OpenSearchのエンドポイントです。
  # 形式: (AWSの場合) https://search-xxxxxxxxxxxxxx.ap-northeast-1.es.amazonaws.com
  address = ''

license#

ライセンスの情報を取得するエンドポイントです。

Property

Description

Default

info-endpoint

http://127.0.0.1:8081/auth/license/info

[license]
  info-endpoint = 'http://127.0.0.1:8081/auth/license/info'