Getting into an app

A terminal, a console in the browser, and the data directory.

On this page

Three ways of reaching an environment by hand, from the command line and from the console.

What it isFor
moor run -itA terminal of your own, in a one-off instanceA shell, a database prompt, anything that asks you things
moor execA command in a container that is runningLooking at what that container has
The Console tabOne command at a time, in a browserWhen all you have is a browser
moor files and the Files tabThe environment's data directoryLooking at, fetching and putting files

All of them take being able to deploy to the app, as they can read what it keeps and act as it. Who started what, and who read which file, is in the audit log. What is done at a terminal after that is not.

A terminal#

moor run -it -- /bin/sh

This starts a one-off instance of the current release, as moor run does, with its variables, its data directory, and its user and limits if the server keeps apps apart. You get a terminal of your own in it, the same size as yours, and it hears when yours changes size.

With -i alone there is no terminal, only standard input, for feeding something to a command:

moor run -i -- psql mydb < dump.sql

On Windows, the terminal is a pseudo-console, and what it sends is understood by Windows Terminal and by anything else that understands the same escapes.

A terminal takes an API token, which moor login gets you. A session in a browser cannot start one: any page you visit could ask your browser to open one, and it would send your cookies.

Inside a running container#

A one-off instance is a new one. To see what a particular container has, give its instance, from moor ps:

moor exec ins_01J8Z3 -it -- /bin/sh
moor exec ins_01J8Z3 -- ps aux

A command that is more than plain words goes through /bin/sh in the container, so an image with no shell can only run plain commands. What is running there belongs to the container: leaving stops moor's side of it, and a container engine may let the command go on until it ends or the container does. An app that is not in a container has nothing of its own to go into, as a process sees the same files from anywhere, and moor exec says so: moor run has them, with its variables and its user.

The Console tab#

An app's Console tab, for those who can deploy to it, runs one command at a time and shows what it says as it says it. Each runs by itself: nothing carries over from one to the next, so a cd is forgotten, and it cannot ask you anything, as what it reads is empty. For those things, there is a terminal.

The Console tab: a box to run a command in the current release, and the earlier commands with how each wentThe Console tab: a box to run a command in the current release, and the earlier commands with how each went
An app's Console tab.

The up and down arrows go back through what has been run. What a command says is kept with its run, with secrets taken out, as it is for moor run.

The data directory#

Each environment has a data directory of its own, which is where its app keeps what it means to keep. An app's Files tab shows what is in it, with a preview of short text files, and can download, upload, make directories and remove. So can the command line:

The Files tab: the files and folders in the data directory, with sizes, and forms to upload a file or make a folderThe Files tab: the files and folders in the data directory, with sizes, and forms to upload a file or make a folder
An app's Files tab.
moor files
moor files uploads --env staging
moor files get backups/nightly.sql
moor files put seed.sql
moor files mkdir imports
moor files put data.csv imports/data.csv --replace
moor files rm -r imports

Suggest a change to this page