astroenvs is a terminal menu for running astronomy tools on an astronomy computing server that makes creating instances of Jupyter Notebooks more easely, managing both ports and tokens. It started as ipynb.sh, a small bash script I wrote to launch Jupyter on the AST221 cluster (no sudo, no apt, restricted network). Since version 1.0.0 it is a proper manager and ships with astrolab-setup.
Run astroenvs (or ipynb) and move with the arrow keys, Enter to choose, Esc to go back, / to filter and Tab to complete paths.
What it manages
- Jupyter Lab. Pick a start folder, an access mode and a token, and it prints the URL. Ports start at 8888 and the first free one is used. Servers started outside the manager (
jupyter server list) show up too. - CARTA. Same flow, with ports from 3002. The file browser opens in your chosen folder.
- DS9. Choose a folder and a FITS file (
.fits,.fit,.fts,.fits.gz,.fz), and the window opens on your computer over X11. - CASA. Starts in the current terminal; without X11 it falls back to
--nologger --nogui. - Instances and logs. Active servers are listed with their folder and full URL, and the main menu shows a running count. Logs are listed newest first, and if a server fails to start you see the end of its log right away.
- Stopping. Stop one instance (with PID, port and folder) or all of them. Jupyter gets a clean shutdown so kernels close properly.
Sandboxed servers for sharing
To share a notebook server with a classmate, start it sandboxed: only the chosen folder is writable, the Python environment and TinyTeX are read-only, the home folder and /tmp are empty and wiped on stop, and your other files and processes are invisible. It relies on Linux user namespaces.
Security defaults
- Tokens are passed to Jupyter through environment variables, not command-line arguments that anyone can see with
ps. - The manager warns about tokens shorter than 16 characters.
~/.astrolab, which stores logs and URLs, is readable only by you.
Usage, configuration (~/.astroenvs.env) and troubleshooting are documented at docs.jjsm.science.