Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Latest commit

 

History

History
62 lines (48 loc) · 2.71 KB

File metadata and controls

62 lines (48 loc) · 2.71 KB

Newt's newt config Explained

The config action can create a new skeleton Newt YAML file. It can be used to update an applications configuration and applications metadata. It allows you to select which applications are known by your data pipeline as well as set basic runtime configuration which is used by the newt run command. In addition you can use Newt Config to update the configurations in the applications' property. You might need to do this if the standard ports for the network services need to be changed.

Create your first Newt YAML file

By default if you do not provide a YAML filename the newt config command will use the filename of "app.yaml". Let's try creating a "app.yaml" by running the config action.

newt config app.yaml

You will now get prompted by a series of questions that will configure what is listed inside the applications' property.

Here' is an example of me running the command you can play through.

FIXME: Insert Asciienema demo of run newt config app.yaml here.

FIXME: Explain the menu system and inactive flow of question.

#!/usr/bin/env newt check
#
# This was generated by rsdoiel on 2024-08-08 with newt version 0.0.8 ea131b9.
#
app_metadata:
  name: app
  title: This is a tutorial app using Newt
  copyright: 2024
  logo_link: /media/logo.svg
  logo_text: Logo of the demo app
  header_text: A Newt Turtorial YAML file
  header_link: https://caltechlibrary.github.io/newt
  contact_address: 123 Calle Quattro, Colonia Major, Estat de Providencia, Republic of the Collective Imagination, 456789
applications:
  router:
    port: 8010
  template_engine:
    port: 8011
    base_dir: views
    partials_dir: partials
    ext_name: .hbs
  postgres:
    namespace: app
    port: 5432
    dsn: postgres://{PGUSER}:{PGPASSWORD}@localhost:5432/app.yaml
  postgrest:
    app_path: postgrest
    conf_path: postgrest.conf
    port: 3000
  enviroment:
    - PGUSER
    - PGPASSWORD

When I accepted using Postgres the config action knows that the connection string can be built from the standard environment variables expected by Postgres' psql and database connectors. That is why even through I answered "N" to the question about setting up environment variables to import I still have environment variables listed.

NOTE: The config option can be used to update an existing Newt YAML file, e.g. "app.yaml". If you change the configuration then you'll be prompted to save the changes as the last question. If you save the changes the prior file will be saved to a ".bak" version before writing the changes to disk. If you want to abort your changes completely then you can press "control C" to quit at any time before the final save prompt.

Next up Newt Model