This simple app is a tool to explore the environment and file system of Space micros.
If you want to better understand how Deta runtime works, this app definitely helps.
The app allows to:
- browse the filesystem of the micro runtime.
- see the environment variables of the micro runtime.
- execute arbitary programs or shell scripts interactively.
Click on Files
in the top menu.
The browser looks like this:
For example, you can navigate to the /var/task
directory and check, what files you actually deployed within the app.
The browser can download directories as a tar.gz
file by clicking on ⇩.
Also, the browser can show binary files as the hex dump by clicking on 👁️. For example:
Click on Environment
in the top menu.
The response is JSON, and its "nicification" in the the web browser extension (JSONVue
in this case).
Click on Run
in the top menu, then type one or command in the input field and press "Run".
For example:
The app is written in Go, so you need to install the Go compiler. The app was created using Go 1.20.
- Install Go
- Checkout the source code:
git clone git@github.com:begoon/deta-explore.git
cd deta-explore
- Build
make build
- Run app locally, just in case:
./exe
or
make run
- Create your Data Space deployment:
(cd micro && space new)
then follow the instructions from space
CLI.
If space
CLI succeeds, the micro/.space
folder will be created.
- Deployment
make deploy
This comment builds the executable for specifically linux/amd4
architecture and
then pushes it to Deta Space. Alternately, we can change the Spacefile
to push
the sources to Deta instead, and then build the executable in Deta. The current
Spacefile
pushes the already built executable.
After the push, CLI will give you the URL of your app, which you can just click on.
NOTE
In the Spacefile
, ALL public routes are disabled via public_routes
to be /none
("none"
is just an arbitary nonexistent path). Be careful making your deployment public. The environment
variables viewer may expose your deta project key and the api key.
Bottom line: use the app responsibly :-)