For app publishers

Variables

Plain settings the app reads at start, and the ones cyantula adds itself.

What this is

A variable is a plain setting the app reads when it starts: a web address, a name, an on/off flag. It is not private, so cyantula shows it back to you as you saved it. Keys and passwords are different. They are secrets and live under Secrets.

To deploy is to put a version of the app online. A new value only takes effect after a deploy, and this page can start that deploy for you when you save.

Where to find it

  1. Open the Apps page and click your app.
  2. Switch to Advanced at the top of the app page.
  3. Click the card Build & deploy, then Variables.

This page is only in the Advanced view. In the Simple view the same values are in What this app needs.

A number next to Variables counts required variables that are still empty.

What you see

Variables (with the number of variables next to it) and two buttons at the top right:

  • Import .env: reads a .env file from your computer. A .env file is a plain text file where each line is NAME=value. Developers use it to keep an app's settings.
  • + Add variable.

Under them, an explanation of the page and, when something applies, coloured notices (see "When something looks wrong").

The table has these columns:

  • Name: the name as the app's code reads it. A small dot next to the name means the app's code reads it. A variable without the dot is no longer read by the app. Its value is kept until you remove it. Some names carry a pill:
    • app default: nobody chose this value. It is what the app falls back on by itself. Type a value to override it.
    • dev only, dev only · production ready and removed next release: these appear when you use a dev address. See Dev address.
    • A grey line may explain what the variable is for.
  • Value: the box with the value. The small ✕ inside the box empties the value.
  • Dev value: only when the app has a dev address. It is empty, with the text same as live, until you give the dev address a value of its own.
  • Required: a tick box. A required variable must have a value, or the deploy waits.
  • A ☰ menu at the end of each row.

The ☰ menu offers:

  • Read a file into the value (or …into the live value and …into the dev value): puts the contents of a file you choose in the box, for example a key file. Nothing is saved until you click Save.
  • Empty the value: keeps the variable but removes its value.
  • Remove the dev value: the dev address goes back to using the live value.
  • Rename this variable.
  • Remove this variable.

Under the table:

  • Redeploy live, and Redeploy dev when a dev address exists. These ticked boxes decide which addresses restart when you save.
  • The save button. Its label changes: Save & redeploy, Save only, or Save (N required still empty).

Injected by cyantula is a second card. It lists settings cyantula puts in your app by itself on every deploy, such as the app's own web address, with their real values. You do not set them and you cannot add them yourself. Your app should read them rather than have the address typed into its code. If email or AI is switched on for the app, a line tells you that a few more are added, and points you to the Email or AI page.

How to add a variable

  1. Click + Add variable.
  2. A window called Add a variable opens. Under What is it?, Variable is selected. Choose Secret only for a key or password.
  3. Under Name, type the name as the app's code reads it. Capital letters, digits and underscores only. Lower-case letters turn into capitals.
  4. Under Value, type the value. You can leave it empty and fill it in later. To use a file instead, click Read a file into the value.
  5. If the app has a dev address, choose under Where does it apply?: Live + dev or Dev only.
  6. Leave Required ticked if the app cannot run without it.
  7. Click Add variable. A note at the bottom of the window says what will happen: whether the addresses restart now or the value waits for the next deploy.

You know it worked when the variable shows up in the table and a green message appears.

How to change a value

  1. Click in the Value box and change the text.
  2. Decide whether to redeploy. Leave Redeploy live ticked to apply it right away. Untick it to store the value now and apply it with the next deploy.
  3. Click the save button.
  4. A message says Saved — the live app is deploying the new configuration now. The status next to the app name follows the deploy.

If you saved without redeploying, a blue bar says The live app is still running the previous configuration. Deploy it to apply the saved values. Click Deploy live on it when ready.

How to import a .env file

  1. Click Import .env and pick the file on your computer.
  2. A window called Import and the file name opens. Nothing is saved yet. It compares the file with what cyantula already stores.
  3. For each line, a pill says what would happen: new, replaces, fills in, same as stored or no value. Secrets are shown as dots.
  4. Tick the lines you want. Tick what differs, Tick all and Untick all help.
  5. For a new line you can tick secret — never shown back once saved.
  6. If the app has a dev address, choose where to write the values: live (shared with dev) or the dev address only.
  7. Click Update N & redeploy (or Update N).

A line Skipped, as at publish lists names the import ignores: database settings, settings cyantula adds itself, and paths that point at your own computer.

How to rename a variable

  1. Open the ☰ menu on its row and click Rename this variable.
  2. Type the New name and click Rename.

The value and the Required tick stay. Only the name changes. Rename it here only when the app's code reads the new name too.

How to empty or remove a variable

  • Empty: ☰ menu, Empty the value (or click the ✕ in the box). A window asks Empty …? Click Empty it. The variable stays without a value. If it is required, the app needs a value before it deploys again.
  • Remove: ☰ menu, Remove this variable. A window asks Remove … everywhere? and says its dev value is deleted too, and that if the app still reads it, the next deploy asks for it again. Click Remove.

When something looks wrong

  • The deploy is paused until every required variable below has a value. The app waits for a value. Fill in the rows marked as missing.
  • N required secrets still have no value — they are on the Secrets tab. Click Go to Secrets.
  • The dev address is paused until its required variables have a value. Only the dev address is affected. The live app keeps running.
  • Saved configuration is not live yet (a bar on the app page): click Deploy now.
  • No variables yet, with + Add your first variable and Import .env: nothing is stored yet. The app's variables are listed here after a deploy, or you add them yourself.
  • That did not work — and a reason. Nothing was changed. Try again. If a value was too big, the message says to upload it as a file instead. See Storage.
  • … already exists — change its value in the table instead. The name is taken.
  • cyantula sets … itself on every deploy — your app can read it as it is. You cannot add a name that cyantula already provides.
  • Capitals, digits and underscores, not starting with a digit. Fix the name.
  • … is busy right now and asked for the redeploy to wait. The app is in the middle of a job. The new values go live as soon as it is free.
  • Deploying now: … with a Watch the log button. A deploy is running. Click Watch the log to follow it under Deploys & logs.

Good to know

  • Only people who manage the app can see and change variables.
  • Variables are shown to you in plain text. Do not put passwords or keys here. Use Secrets.
  • A change to a variable only takes effect after a deploy.
  • A file the app opens by its path, such as a certificate, is not a variable. Upload it under Files on Storage.
  • Removing a variable cannot be undone. Add it again if you need it back.
  • The dev address uses the same values as the live app unless you give it a dev value. A change only the dev address reads never restarts the live app.