/Script-Actions

Script Examples for Script Actions App

Primary LanguageShellApache License 2.0Apache-2.0

Scripts Actions Documentation

Documentation and scripts examples for the Script Actions App

Description

Run or schedule powerful well tested shell scripts, Python or NodeJS code from your phone in a secure temporary execution cloud environment. It is a unique solution that provides easy and fast access in a secure execution environment with +100 Linux commands and tools available to use them from the phone with one tap! No laptops, no servers needed.

You can build, sell, load and execute scripts from public or private repositories.

Security

Each execution environment is dedicated with isolated storage, hardware and networking resources. The networking allows outbound traffic but inbound traffic is blocked. Following the best practices, we are not storing credentials, API keys or other secrets. This information is injected on-demand in the temporary execution environment which is destroyed after the execution. Everything is protected behind an OAUTH 2.0 Authentication MFA enabled layer.

If you interesting for a PaaS license (private infrastructure) please contact us from the contact form in-app.

Use cases examples

How to build and test your scripts

Requirements

  • You need a Private or Public GIT repository. If your repository is private, don't forget to set its SSH key in-app secret manager.
  • The containerazed execution environment is read-only but you can store temp data under /tmp up to 512 MB.
  • Your code execution duration must not exceed 15 mins.
  • Local Docker engine. (See How to install it)
  • GIT (See how to install git for windows)
  • Development skills.

Steps

  1. Create your Git repository. If is private you can use a separate SSH key for this project and test it with a command like

    GIT_SSH_COMMAND="ssh -i ~/.ssh/your-key " git clone git@github.com:youraccount/private-repo.git

    or set core.sshCommand:

    git config core.sshCommand "ssh -i ~/.ssh/id_rsa_example -F /dev/null"

  2. Edit the .env file and set your reporitory details.

  3. Run your script to test it locally:

    Syntax example for public repository:

    docker run -it --rm --env-file .env itforgeuk/cloudshell:latest sh -c '/checkrepo.sh'

    Syntax example for private repository:

    docker run -it --rm --env-file .env -v ~/.ssh/your_ssh_key:/tmp/.ssh/id_rsa itforgeuk/cloudshell:latest sh -c '/checkrepo.sh'

    Syntax example with Google Cloud Service Account authentication docker run -it --rm --env-file .env -v /full/path/google-auth.json:/tmp/google-auth.json itforgeuk/cloudshell:latest sh -c '/checkrepo.sh'

    Syntax example with Kubernetes authentication docker run -it --rm --env-file .env -v ~/.kube/config:/tmp/kubeconfig itforgeuk/cloudshell:latest sh -c '/checkrepo.sh'

Tips

  • Try to minify your script output to get a more practical output in your app.
  • Avoid build steps in your script that can produce data size over limits and slow execution.
  • Test your credentials as env variables which will be the alternative of secrets manager in the app.

How to run your scripts in app

Your script is well tested and published to your repo. You can now add it in the app:

drawingdrawing

  1. Set your git repository in the "GIT repo" app field. The format for public github repos is:

    https://github.com/yourrepo/yourproject

    or for private repos:

    git@github.com:yourrepo/yourproject

  2. Set your branch, tag or commit hash in the app field.

  3. Set your script path in the app field. Do not start with '/'.

  4. Be sure you have the necessary credentials set in the secret manager.

  5. Set a shedule run if you like.

  6. Save

  7. Your script is ready. Now you can do changes in the repo without edit the action in the app.

Questions

If you read all the above but you still have a question you can write us