Skip to main content

moderne.yml reference

Moderne DX reads its configuration from a moderne.yml file, which java -jar moderne-dx.jar init writes with comments to fill in. This page lists every setting it reads. The installation guide shows the ones every deployment needs.

A value of the form ${NAME} is an environment variable, or a NAME=value line of the moderne.env file beside moderne.yml. Only the user DX runs as may read moderne.env. A path that is not absolute resolves against the directory that holds moderne.yml, unless a setting below says otherwise.

A value of the form ${moderne-cli:key} is what the Moderne CLI holds for the key, as mod config get <key> prints it. Each time DX starts, it asks the CLI of the user it runs as.

Commands​

Every command but init reads the moderne.yml file in the working directory, or the one --config <path> names.

CommandWhat it does
java -jar moderne-dx.jar init [<dir>]Writes moderne.yml, moderne.env with a new SCM token key, and a systemd unit, keeping any file already there. A new moderne.yml takes the license key and the CGP username and token from the Moderne CLI on this machine, where the CLI holds them.
java -jar moderne-dx.jar doctorChecks the configuration and the machine. Once DX runs, it also checks each name through DX's proxy.
java -jar moderne-dx.jar startStarts DX in the foreground, and keeps every service running until it stops.
java -jar moderne-dx.jar statusSays whether DX runs, and which services are up.
java -jar moderne-dx.jar stopStops a running DX.
java -jar moderne-dx.jar trustHas this machine trust DX's own certificate authority. On macOS it adds the authority to your login keychain. On Linux it prints the commands that do.

Deployment​

SettingDefaultDescription
moderne.tenant.namedxThe tag on every metric. The browser's title shows any other name. Lowercase letters, digits, and dashes, but not app.
moderne.license.keyYour Moderne DX license key. Without a valid one, the CLIs connected to DX stop running recipes.

URLs and the proxy​

DX serves four names on one port, through a proxy inside it. The four URLs share a scheme and a port, and each has a host of its own.

SettingDefaultDescription
moderne.dx.public-urlhttps://moderne.localhost:8443Where people open the UI. An http or https URL with a host name and no path. DX's own certificate authority serves an https URL under localhost, nip.io, or sslip.io.
moderne.dx.api-urlapi. before the public URL's hostWhere the CLI and the UI reach DX's API.
moderne.dx.login-urllogin. before the public URL's hostWhere users sign in, through Keycloak.
moderne.dx.status-urlstatus. before the public URL's hostWhere the status page shows every service's metrics and logs.
moderne.dx.tls.certificateA PEM file with the certificate for an https public URL first, then its chain. It must cover the public URL's host and the names under it.
moderne.dx.tls.private-keyThe certificate's private key, as a PEM file.
moderne.dx.bind-address127.0.0.1 for a URL under localhost, 0.0.0.0 otherwiseThe IP address the proxy listens on. Every other process listens on 127.0.0.1.
moderne.dx.ports.proxyThe public URL's portThe port the proxy listens on. Name it when a load balancer that ends TLS forwards to DX, and leave out tls.
moderne.dx.ports.proxy-http8080With DX's own certificate authority, the port where the proxy hands out the authority's certificate and redirects http to https.
moderne.dx.logoThe Moderne iconAn SVG file that the UI shows as your deployment's icon.
moderne.dx.javaThe Java that runs the jarThe java executable that DX's services run on. It must be Java 25.

Recipes​

Name the Code Genome Project, your own repository that proxies it, or both. DX tries your own first.

SettingDescription
moderne.recipe.marketplace.repositories.code-genome-project.usernameYour Code Genome Project username.
moderne.recipe.marketplace.repositories.code-genome-project.tokenYour Code Genome Project token. DX resolves recipes from the Code Genome Project with it. The installer at DX's /cli downloads the Moderne CLI with it too, or anonymously without it.
moderne.recipe.marketplace.repositories.maven, npm, pypi, nuget, goYour own recipe repositories, with the same settings as the Moderne Connector's recipe marketplace repositories.

Organization sources​

Each entry of moderne.organization.sources.http reads a repos-lock.csv file over HTTP or HTTPS:

SettingDefaultDescription
uriRequiredThe URL of the file.
usernameThe user to read the file and its LSTs as.
passwordThat user's password.
bearer-tokenA token to send in place of a user and password.
lst-version2The LST format the source's mass ingest publishes, 2 or 3. DX keeps a V3 copy of each V2 LST for code search.
organizationsAllThe organizations to keep, at any level of the file's org columns, with every repository under them.

The init command names Moderne's public mass ingest, https://moderne-lsts.s3.us-west-2.amazonaws.com/repos-lock.csv, with organizations: [Netflix]. A business unit can run a DX of its own by naming just its organizations.

Each entry of moderne.organization.sources.file reads a file on the machine:

SettingDefaultDescription
pathRequiredThe file's path, relative to moderne.storage.permanent-dir.
lst-version2The LST format the source's mass ingest publishes, 2 or 3.
organizationsAllThe organizations to keep, as for an http source.

DX downloads each LST with the credentials of the source whose host serves it. An s3:// LST comes over HTTPS from its bucket, without credentials, when an organization source is in that bucket. Each entry of moderne.lst.http gives credentials for another host:

SettingDefaultDescription
hostRequiredThe host that serves LSTs, as the publishUri column names it.
usernameThe user to download as.
passwordThat user's password.
bearer-tokenA token to send in place of a user and password.

Repository access control​

Every user can read every repository until moderne.scm names an SCM's OAuth app. DX then shows that SCM's repositories only to the users who can read them. The user-level repository access control guide lists the settings of each SCM, and moderne.authorization.scm-token-key.

Sign-in​

DX makes each of these secrets at its first start, and keeps it under <permanent-dir>/dx/secrets, unless moderne.yml names one.

SettingDescription
moderne-keycloak.server.passwordThe password of Keycloak's admin user, who configures your identity provider.
moderne-keycloak.initial-user.passwordThe first password of the realm's moderne user. It applies only when the realm is made.
moderne.keycloak.client-secretThe secret the UI and DX's services share with Keycloak.
moderne.dx.ui-secretThe key the UI signs its sessions with.

Keycloak keeps its realm in a database file under the permanent directory unless spring.datasource names a database:

SettingDescription
spring.datasource.urlA PostgreSQL JDBC URL, such as jdbc:postgresql://db.acme.com:5432/keycloak.
spring.datasource.usernameThe database user.
spring.datasource.passwordThat user's password.

Storage​

SettingDefaultDescription
moderne.storage.permanent-dirdata/permanent beside moderne.ymlEverything DX cannot rebuild. Back it up.
moderne.storage.ephemeral-dirdata/ephemeral beside moderne.ymlWhat DX rebuilds when it needs to, such as the unpacked jar and code search's index.

Telemetry​

We recommend storing CLI telemetry in an Amazon S3 bucket or an Azure Blob Storage container. Configuring telemetry lists the credentials and permissions each one needs.

SettingDescription
moderne.gateway.telemetry.s3.bucketThe Amazon S3 bucket to store telemetry in.
moderne.gateway.telemetry.azure.account-nameThe Azure storage account that holds the container.
moderne.gateway.telemetry.azure.container-nameThe Azure Blob Storage container to store telemetry in.

If you name neither, DX stores telemetry in <permanent-dir>/telemetry.

Memory​

moderne.dx.memory.<service> sets a service's heap, as a size such as 2g or 1536m. The defaults fit a laptop.

ServiceDefault
code-search2g
recipe-marketplace1536m
changeset-reader1g
gateway768m
authentication512m
authorization512m
organization512m
changeset-git512m
atlas512m
repository-converter512m
conversions4g

conversions is the heap of the CLI process that converts V2 LSTs. It converts one LST at a time per gigabyte, up to one per core.

Code search leaves out a repository whose index has a single part larger than moderne.code-search.shard-max-bytes, 512 MB by default. To index larger repositories, raise it along with moderne.dx.memory.code-search. A 6 GB heap holds parts of about 2 GB.

Ports​

Each of DX's processes listens on the loopback address at a port of its own. moderne.dx.ports.<process> moves one when another program holds its port.

ProcessPort
ui3000
gateway4000
router4001
organization8081
recipe-marketplace8082
authorization8085
changeset-reader8088
repository-converter8089
proxy-health8094
code-search8095
changeset-git8097
atlas8098
authentication8180

Two more ports cannot be moved: 8099, where the router answers its health check, and 7101, where the services send their metrics and logs.

Other settings​

SettingDefaultDescription
moderne.monitoring.atlas.disk.retention2dHow long the status page keeps metrics and logs.
moderne.cli.executablemod on the PATHThe Moderne CLI that DX's services run. DX asks it for ${moderne-cli:key} values.

Environment variables​

VariableDescription
NODE_EXTRA_CA_CERTSA PEM file of certificate authorities that the UI trusts beyond the public ones. Set it when your certificate comes from a private CA. DX's own certificate authority needs no setting.