Fastero runs a Streamlit app from a Git repository on GitHub, GitLab or Bitbucket and serves it behind your team's login. Owners, Admins and Editors of a project can create and change apps; Viewers can open them.
Before you start
- Have the repository's https address and the branch you want.
- For a private repository, have a personal access token with read access. On GitHub that is a fine-grained token with Contents: Read-only for the repository, or a classic token with the repo scope. On GitLab it is a token with read_repository.
Create the app
- Open Workbench from the top bar.
- Click the + button (Add new) above the tabs and choose New Streamlit app.
- In Create Streamlit App, choose Git Repo.
- Enter an App Name and choose the Python version. The app keeps this version.
- Enter the Repository URL, such as
https://github.com/your-team/sales-app.git. - Leave Branch (optional) empty for the default branch, or type one.
- For a private repository, paste the Access Token, or on GitHub click Connect GitHub to use your account.
- If the app is not at the repository's root, enter its folder in Subdirectory (optional).
- Click Create. The app opens in a tab, and is listed under Apps in the Explorer. Click Start App to run it.
Which file runs
Fastero runs app.py from the repository's root, or from the subdirectory you chose. Without one, it runs the first it finds of streamlit_app.py, main.py, Home.py and app/main.py, then the only .py file at the root, or the one there that imports Streamlit.
Packages
Fastero installs requirements.txt from the app's folder with pip at every start, and reuses the packages while the file stays the same. Without it, the app gets Fastero's default packages, Streamlit and pandas among them. A Python version pinned in runtime.txt or .python-version is not used.
An app can hold up to 12 MB of text files, and up to 100 MB of images and data files.
Secrets
Owners and Admins add secrets in Settings (the gear in the top bar) under Secrets: click Add Secret and enter a Name, a Type and a Value.
- A Text secret is read with
st.secrets["NAME"]. Name itsection.key, such asdb.password, to readst.secrets["db"]["password"]. - A text secret whose name uses only letters, digits and underscores is also an environment variable.
- A File secret is saved in
/app/secretsunder its own file name.
import os
import streamlit as st
password = st.secrets["db"]["password"]
api_key = os.environ["API_KEY"]Fastero writes .streamlit/secrets.toml from your organization's and project's secrets when the app starts, unless the app's files include their own. Stop and start the app after you change a secret.
To read one of your connections, click Database in the app's toolbar and pick it. The app reads it with st.connection("<connection name>").
Who can open the app
The app is never public: people sign in to open it, and anyone in the project can. Owners and Admins can invite others with Share in the toolbar: enter an address in Invite by email and click Send invite. Invited people join the project as Viewers. They can use the app and wake it, but cannot edit its files or settings.
Update the app
A push to the repository does not restart the app. Each start fetches the branch's latest commit, so click Stop App, then Start App, to pick up a change.
To change the repository, branch, token or subdirectory, edit them under Source: Git in the toolbar and click Save. Fastero fetches the repository again.
Edits you make in Fastero appear under Edits in the toolbar. Send as pull request sends them to the repository, which needs a token with write access. Discard fetches the latest commit over them. Until you do either, the app starts with your edits, not the latest commit.
Logs
When a start fails, the stopped app shows Open the log of the last start, with pip's errors included. Only people who can edit the app see it.
An app sleeps after 10 minutes without use, and opening it wakes it. Always-on keeps it running.