### Install Packages on Startup using microdnf (YAML) Source: https://docs.olivetin.app/action_execution/onstartup This example shows how to install additional commands, specifically 'bind-utils' using 'microdnf', when OliveTin starts. This method requires running OliveTin as a root user and is configured in the `config.yaml` file with `execOnStartup: true`. ```yaml actions: - title: Install dnsmasq shell: microdnf install bind-utils execOnStartup: true ``` -------------------------------- ### Download and Configure OliveTin Source: https://docs.olivetin.app/install/docker_compose Commands to download the sample OliveTin configuration file and a basic example of the config.yaml content. This file is essential for OliveTin to start correctly and defines initial actions. ```shell user@host: cd /etc/OliveTin/ user@host: curl -O https://raw.githubusercontent.com/OliveTin/OliveTin/main/config.yaml ``` ```yaml actions: - title: "Hello world!" shell: echo 'Hello World!' ``` -------------------------------- ### Example OliveTin Request Object Source: https://docs.olivetin.app/api/start_action An example of a JSON request object used to start an action in OliveTin. This specific example demonstrates starting a 'Generate cryptocurrency' action with no arguments. ```json { "actionId": "Generate cryptocurrency", "arguments": [], "uniqueTrackingId": "my-tracking-id" } ``` -------------------------------- ### Download Sample OliveTin Configuration File Source: https://docs.olivetin.app/install/podmandocker This command downloads a sample `config.yaml` file for OliveTin using `curl`. This file is essential for OliveTin to start correctly within the container. Ensure you are in the correct directory where the volume was mounted. ```shell user@host: cd /etc/OliveTin/ user@host: curl -O https://raw.githubusercontent.com/OliveTin/OliveTin/main/config.yaml ``` -------------------------------- ### Basic OliveTin Configuration (YAML) Source: https://docs.olivetin.app/install/bsd This is the most basic configuration file for OliveTin. It defines a single action titled 'Hello world!' that executes a shell command to print 'Hello World!'. This file is essential for OliveTin to start up. ```yaml actions: - title: "Hello world!" shell: echo 'Hello World!' ``` -------------------------------- ### Start OliveTin Service Source: https://docs.olivetin.app/install/docker_compose Command to start the OliveTin Docker container after it has been created and configured. This initiates the OliveTin service, making it accessible via its web interface. ```shell user@host: docker start olivetin ``` -------------------------------- ### Start OliveTin Windows Service Source: https://docs.olivetin.app/install/windows_service This command starts the OliveTin service that has been registered on your Windows system. You can execute this command in a command prompt or use the Microsoft Management Console (MMC). ```bash sc.exe start OliveTin ``` -------------------------------- ### Start Docker Container Source: https://docs.olivetin.app/solutions/container-control-panel/index Starts a specified Docker container. This action is triggered when the container entity file is updated. ```shell docker start {{ container.Names }} ``` -------------------------------- ### Install OliveTin .deb Package Source: https://docs.olivetin.app/install/linux_deb Downloads and installs the OliveTin .deb package for amd64 architecture. Ensure you have wget and dpkg installed. ```shell user@host: wget https://github.com/OliveTin/OliveTin/releases/latest/download/OliveTin_linux_amd64.deb user@host: dpkg -i OliveTin_linux_amd64.deb ``` -------------------------------- ### Test OliveTin Startup from Command Line Source: https://docs.olivetin.app/install/windows_service This command tests the OliveTin executable by running it directly from the command line. It should be executed from the directory where OliveTin.exe is located. Successful execution will show the service starting and listening on port 1337. ```bash ./OliveTin.exe ``` -------------------------------- ### GitHub Webhook Setup Guide Source: https://docs.olivetin.app/action_execution/onwebhook_github This section outlines the steps to configure GitHub webhooks in your repository and how to set up OliveTin to receive these webhooks. ```APIDOC ## GitHub Webhook Setup OliveTin includes built-in templates for GitHub webhooks that simplify configuration. ### Supported GitHub Templates * `github-push` - Triggered on push events * `github-pr` or `github-pull-request` - Triggered on pull request events * `github-release` - Triggered on release events * `github-workflow` - Triggered on workflow run events ### 1. Configure the Webhook in GitHub 1. Go to your GitHub repository → **Settings** → **Webhooks** → **Add webhook** 2. Set the **Payload URL** to `http://your-olivetin-server:1337/webhooks` 3. Set **Content type** to `application/json` 4. Enter a **Secret** (you’ll use this in your OliveTin config) 5. Choose which events to trigger the webhook: * Select **Just the push event** for push triggers * Or select **Let me select individual events** for more control 6. Click **Add webhook** ### 2. Configure OliveTin Use the `template` property to apply GitHub-specific settings in your `config.yaml`: ```yaml actions: - title: Deploy on Push shell: | echo "Deploying commit {{ git_commit }} to {{ git_branch }}" /opt/scripts/deploy.sh "{{ git_branch }}" arguments: - name: git_commit type: ascii - name: git_branch type: ascii execOnWebhook: - template: github-push secret: your-github-webhook-secret ``` ``` -------------------------------- ### Docker Container Entity File Example Source: https://docs.olivetin.app/solutions/container-control-panel/index An example of an entity file (`containers.json`) generated by `docker ps --format json`. This file stores information about running Docker containers, which OliveTin can use to build control panels. ```json {"Command":"\"/bin/bash\"","CreatedAt":"2024-02-28 22:33:35 +0000 GMT","ID":"fcf468e18a0e","Image":"fedora","Labels":"maintainer=Clement Verna \u003ccverna@fedoraproject.org\u003e","LocalVolumes":"0","Mounts":"","Names":"minecraft","Networks":"bridge","Ports":"","RunningFor":"3 minutes ago","Size":"0B","State":"created","Status":"Created"} {"Command":"\"/bin/bash\"","CreatedAt":"2024-02-23 23:18:57 +0000 GMT","ID":"442dd6fe316a","Image":"fedora","Labels":"maintainer=Clement Verna \u003ccverna@fedoraproject.org\u003e","LocalVolumes":"0","Mounts":"","Names":"brave_shirley","Networks":"bridge","Ports":"","RunningFor":"4 days ago","Size":"0B","State":"created","Status":"Created"} ``` -------------------------------- ### Example Use Cases for OliveTin Commands Source: https://docs.olivetin.app/index Demonstrates practical examples of how OliveTin can be used to simplify and secure access to shell commands for various user groups and scenarios. These examples showcase predefined commands with placeholders for dynamic input. ```shell # Safely give access to commands, for less technical people; # eg: Give your family a button to `podman restart plex` # eg: Give junior admins a simple web form with dropdowns, to start your custom script. `backupScript.sh --folder {{ customerName }}` # eg: Enable SSH access to the server for the next 20 mins `firewall-cmd --add-service ssh --timeout 20m` # Simplify complex commands, make them accessible and repeatable; # eg: Expose complex commands on touchscreen tablets stuck on walls around your house. `wake-on-lan aa:bb:cc:11:22:33` # eg: Run long running on your servers from your cell phone. `dnf update -y` # eg: Define complex commands with lots of preset arguments, and turn a few arguments into dropdown select boxes. `docker rm {{ container }} && docker create {{ container }} && docker start {{ container }}` ``` -------------------------------- ### StartActionByGet (GET) Source: https://docs.olivetin.app/api/start_action Starts an action immediately by providing the Action ID in the URL. Returns an Execution Tracking ID. ```APIDOC ## GET /api/StartActionByGet ### Description Starts an action immediately by providing the Action ID in the URL. Returns an Execution Tracking ID. ### Method GET ### Endpoint /api/StartActionByGet?actionId={actionId} ### Parameters #### Query Parameters - **actionId** (string) - Required - The ID of the action to start. ### Response #### Success Response (200) - **executionTrackingId** (string) - The ID for tracking the execution. #### Response Example ```json { "executionTrackingId": "5bb4860c-bbd0-4bc9-a7d6-42240551500c" } ``` ``` -------------------------------- ### Install OliveTin from AUR Source: https://docs.olivetin.app/install/linux_arch Installs the OliveTin package from the Arch User Repository (AUR) using the `yay` helper. This command updates the system and then installs the `olivetin` package. ```shell user@host: yay -Syu olivetin ``` -------------------------------- ### Start Action by ID using cURL (GET) Source: https://docs.olivetin.app/api/method_StartActionByGet This example demonstrates how to initiate an action in OliveTin using the StartActionByGet method via a cURL command. The action ID ('pingGithub') is appended to the API endpoint. This method is suitable for simple integrations where arguments are not required. ```shell user@host: curl http://olivetin.example.com/api/StartActionByGet/pingGithub ``` -------------------------------- ### StartActionByGetAndWait (GET) Source: https://docs.olivetin.app/api/start_action Starts an action and waits for it to complete, returning a Log Entry. Uses the Action ID in the URL. ```APIDOC ## GET /api/StartActionByGetAndWait ### Description Starts an action and waits for it to complete, returning a Log Entry. Uses the Action ID in the URL. ### Method GET ### Endpoint /api/StartActionByGetAndWait?actionId={actionId} ### Parameters #### Query Parameters - **actionId** (string) - Required - The ID of the action to start. ### Response #### Success Response (200) - **logEntry** (object) - Contains details about the completed action. - **datetimeStarted** (string) - The start time of the execution. - **actionTitle** (string) - The title of the action. - **stdout** (string) - Standard output from the action. - **stderr** (string) - Standard error from the action. - **timedOut** (boolean) - Whether the action timed out. - **exitCode** (integer) - The exit code of the action. - **user** (string) - The user who initiated the action. - **userClass** (string) - The class of the user. - **actionIcon** (string) - The icon associated with the action. - **tags** (array) - Tags associated with the action. - **executionTrackingId** (string) - The tracking ID for the execution. - **datetimeFinished** (string) - The finish time of the execution. - **actionId** (string) - The ID of the action. - **executionStarted** (boolean) - Whether the execution started. - **executionFinished** (boolean) - Whether the execution finished. - **blocked** (boolean) - Whether the execution was blocked. #### Response Example ```json { "logEntry": { "datetimeStarted": "2024-02-27 14:14:49", "actionTitle": "Restart httpd on server1", "stdout": "", "stderr": "", "timedOut": true, "exitCode": -1, "user": "", "userClass": "", "actionIcon": "🔄", "tags": [], "executionTrackingId": "b04b1e90-d457-4158-b7dc-da9e81f21568", "datetimeFinished": "2024-02-27 14:14:52", "actionId": "restart_httpd", "executionStarted": true, "executionFinished": true, "blocked": false } } ``` ``` -------------------------------- ### Create and Configure OliveTin Docker Container Source: https://docs.olivetin.app/install/podmandocker This snippet demonstrates the commands to create a Docker container for OliveTin, including setting up the necessary directory for configuration and mapping the port and volume. It assumes the user has Docker installed. ```shell user@host: mkdir /etc/OliveTin/ user@host: # ie: Your config file is /etc/OliveTin/config.yaml on the host machine. We'll create this in the post-installation step. user@host: docker pull jamesread/olivetin user@host: docker create --name olivetin -p 1337:1337 -v /etc/OliveTin/:/config:ro docker.io/jamesread/olivetin ``` -------------------------------- ### Example Log Entry Response Source: https://docs.olivetin.app/api/start_action Shows the structure of a log entry returned by OliveTin's API when an action has completed. This response includes details about the action's execution, such as start and end times, exit code, and output. ```json { "logEntry": { "datetimeStarted": "2024-02-27 14:14:49", "actionTitle": "Restart httpd on server1", "stdout": "", "stderr": "", "timedOut": true, "exitCode": -1, "user": "", "userClass": "", "actionIcon": "🔄", "tags": [ ], "executionTrackingId": "b04b1e90-d457-4158-b7dc-da9e81f21568", "datetimeFinished": "2024-02-27 14:14:52", "actionId": "restart_httpd", "executionStarted": true, "executionFinished": true, "blocked": false } } ``` -------------------------------- ### Install OliveTin using RPM package Source: https://docs.olivetin.app/install/linux_rpm Installs the OliveTin .rpm package from a provided URL. This command requires root privileges and assumes the system has `rpm` installed. ```bash user@host: rpm -U https://github.com/OliveTin/OliveTin/releases/latest/download/OliveTin_linux_amd64.rpm ``` -------------------------------- ### Docker Run Command with Privileged Access Source: https://docs.olivetin.app/action_examples/containers This `docker run` command illustrates creating and starting an OliveTin container with privileged access and the Docker socket bind-mounted. It's an alternative to `docker create` for immediate container execution. ```bash docker run --privileged --user root -v /var/run/docker.sock:/var/run/docker.sock --name OliveTin jamesread/olivetin ``` -------------------------------- ### Running OliveTin Container with Custom User Source: https://docs.olivetin.app/troubleshooting/puid-pgid This example demonstrates how to create and start an OliveTin container, specifying a custom user for the container process using the `--user` argument. This is the recommended method for setting the container's user, as OliveTin does not follow the PUID/PGID convention. ```shell user@host: docker create --name olivetin -p 1337:1337 -v /etc/OliveTin/:/config:ro docker.io/jamesread/olivetin --user container:container user@host: docker start olivetin ``` -------------------------------- ### Systemd Service File for Multiple OliveTin Instances (Systemd) Source: https://docs.olivetin.app/reference/multiple_instances A sample systemd service file for a second OliveTin instance. This demonstrates how to specify the working directory and executable path for a non-default installation, ensuring the service starts correctly. ```systemd [Unit] Description=OliveTin2 [Service] WorkingDirectory=/opt/OliveTin_two/ ExecStart=/opt/OliveTin_two/OliveTin Restart=always [Install] WantedBy=multi-user.target ``` -------------------------------- ### Example Shell Command Source: https://docs.olivetin.app/args/input A basic example of the 'echo' shell command with a string argument. This demonstrates how arguments are passed to commands. ```shell echo "Hello world" ``` -------------------------------- ### Basic Docker Compose for OliveTin Source: https://docs.olivetin.app/install/docker_compose A foundational docker-compose.yml file to set up the OliveTin service. It defines the container name, image, volume for configuration persistence, and port mapping. The restart policy ensures the container is automatically restarted. ```yaml services: olivetin: container_name: olivetin image: jamesread/olivetin volumes: - OliveTin-config:/config # replace host path or volume as needed ports: - "1337:1337" restart: unless-stopped volumes: OliveTin-config: external: false ``` -------------------------------- ### StartAction (POST) Source: https://docs.olivetin.app/api/start_action Starts an action immediately using a JSON request body. Returns an Execution Tracking ID. ```APIDOC ## POST /api/StartAction ### Description Starts an action immediately using a JSON request body. Returns an Execution Tracking ID. ### Method POST ### Endpoint /api/StartAction ### Parameters #### Request Body - **actionId** (string) - Required - The ID of the action to start. - **arguments** (array) - Optional - An array of arguments for the action. - **name** (string) - Required - The name of the argument. - **value** (string) - Required - The value of the argument. - **uniqueTrackingId** (string) - Optional - A custom ID for tracking the execution. ### Request Example ```json { "actionId": "Generate cryptocurrency", "arguments": [], "uniqueTrackingId": "my-tracking-id" } ``` ### Response #### Success Response (200) - **executionTrackingId** (string) - The ID for tracking the execution. #### Response Example ```json { "executionTrackingId": "5bb4860c-bbd0-4bc9-a7d6-42240551500c" } ``` ``` -------------------------------- ### OAuth2 Configuration Example (YAML) Source: https://docs.olivetin.app/security/oauth2 Example YAML configuration for setting up OAuth2 authentication in OliveTin. This includes the redirect URL and provider-specific client ID and secret for GitHub. ```yaml authOAuth2RedirectUrl: http://localhost:1337/oauth/callback authOAuth2Providers: github: clientId: 1234567890 clientSecret: 1234567890 ``` -------------------------------- ### Start OliveTin Docker Container Source: https://docs.olivetin.app/solutions/wol/index This command starts the previously created Docker container named 'olivetin_wol', making the OliveTin web interface accessible for configuring and triggering Wake On LAN actions. ```bash docker start olivetin_wol ``` -------------------------------- ### Example Systemd Units JSON Output Source: https://docs.olivetin.app/solutions/systemd-control-panel/index This is an example of the JSON file generated by the systemctl command. Each line represents a systemd unit with its status and description. ```json {"unit":"boot.mount","load":"loaded","active":"active","sub":"mounted","description":"/boot"} {"unit":"podman.service","load":"loaded","active":"inactive","sub":"dead","description":"Podman API Service"} {"unit":"upsilon-drone.service","load":"loaded","active":"active","sub":"running","description":"upsilon-drone"} {"unit":"podman.socket","load":"loaded","active":"active","sub":"listening","description":"Podman API Socket"} ``` -------------------------------- ### Example OliveTin SOS Report Source: https://docs.olivetin.app/troubleshooting/sosreport This is an example of the output generated by the OliveTin sosreport feature. It includes build, runtime, and configuration details that are useful for support requests. ```text ### SOSREPORT START (copy all text to SOSREPORT END) # Build: commit: nocommit version: dev date: nodate # Runtime: os: linux osreleaseprettyname: PRETTY_NAME="Fedora Linux 37 (Workstation Edition)" arch: amd64 incontainer: false lastbrowseruseragent: "" # Config: countofactions: 7 loglevel: INFO ### SOSREPORT END (copy all text from SOSREPORT START) ``` -------------------------------- ### Execute Shell Command on Startup (YAML) Source: https://docs.olivetin.app/action_execution/onstartup This snippet demonstrates how to configure OliveTin to execute a simple shell command, 'echo "Hello!"', every time OliveTin starts. It requires the `execOnStartup` parameter to be set to `true` within the `actions` section of the `config.yaml` file. ```yaml actions: - title: Say hello shell: echo "Hello!" execOnStartup: true ``` -------------------------------- ### Define a basic action in config.yaml Source: https://docs.olivetin.app/action_execution/create_your_first This snippet shows how to define a simple action in the config.yaml file. It includes a title, the shell command to execute, and an icon. The action title must be unique. ```yaml actions: - title: Say hello shell: echo "Hello!" icon: smile ``` -------------------------------- ### Enable and Start OliveTin Service (systemd) Source: https://docs.olivetin.app/install/linux_fedora Enables the OliveTin service to start automatically on boot and starts it immediately. This command uses systemd to manage the service and requires root privileges. ```shell user@host: systemctl enable --now OliveTin ``` -------------------------------- ### Example: Deploy on Push to Main Branch using GitHub Push Template Source: https://docs.olivetin.app/action_execution/onwebhook_github This OliveTin configuration example shows how to deploy code to production when a push event occurs on the 'main' branch. It utilizes the 'github-push' template and extracts commit details like SHA and author for logging purposes. The shell script conditionally deploys based on the git_ref. ```yaml actions: - title: Deploy to Production shell: | if [ "{{ git_ref }}" = "refs/heads/main" ]; then echo "Deploying {{ git_commit }} by {{ git_author }}" /opt/scripts/deploy.sh production else echo "Ignoring push to non-main branch" fi arguments: - name: git_ref type: ascii - name: git_commit type: ascii - name: git_author type: ascii execOnWebhook: - template: github-push secret: your-secret ``` -------------------------------- ### Start Action By GET and Wait Source: https://docs.olivetin.app/integrations/homeassistant This endpoint triggers a specific OliveTin action and waits for its completion. It's designed to be called via a GET request. ```APIDOC ## GET /api/StartActionAndWait/{action_id} ### Description Triggers a specified OliveTin action and waits for it to complete. This method is suitable for Home Assistant integrations where a synchronous response is desired. ### Method GET ### Endpoint `/api/StartActionAndWait/{action_id}` ### Parameters #### Path Parameters - **action_id** (string) - Required - The unique identifier of the action to be triggered. ### Request Example ``` http://your-olivet-tin-ip:1337/api/StartActionAndWait/server_sleep ``` ### Response #### Success Response (200) - **output** (string) - The output of the executed action. - **error** (string) - Any error message produced during action execution. #### Response Example ```json { "output": "Action completed successfully.", "error": null } ``` ``` -------------------------------- ### Register OliveTin as a Windows Service Source: https://docs.olivetin.app/install/windows_service This command registers OliveTin as a Windows service using `sc.exe`. It specifies the service name, the path to the executable, and sets the startup mode to automatic. Run this command in an Administrator command prompt. ```bash sc.exe create OliveTin binPath= "C:\\Program Files\\OliveTin\\OliveTin.exe" start= auto ``` -------------------------------- ### Troubleshoot OliveTin Container Logs Source: https://docs.olivetin.app/install/docker_compose Command to view the logs of the OliveTin Docker container. This is crucial for diagnosing startup issues or any problems encountered while running OliveTin. ```shell user@host: docker logs OliveTin ``` -------------------------------- ### Example Execution Tracking ID Response Source: https://docs.olivetin.app/api/start_action Illustrates the response format when an action is successfully initiated and an execution tracking ID is returned. This ID can be used to monitor the action's progress. ```json {"executionTrackingId":"5bb4860c-bbd0-4bc9-a7d6-42240551500c"} ``` -------------------------------- ### Docker Compose with Docker Socket Access Source: https://docs.olivetin.app/install/docker_compose An updated docker-compose.yml snippet that includes mounting the Docker socket. This allows the OliveTin container to interact with and control other Docker containers on the host system. ```yaml services: olivetin: container_name: olivetin image: jamesread/olivetin volumes: - /docker/OliveTin:/config # replace host path or volume as needed - /var/run/docker.sock:/var/run/docker.sock ... ``` -------------------------------- ### Complete OliveTin Configuration with Enabled Expressions (YAML) Source: https://docs.olivetin.app/action_customization/enabledExpression A full example of an OliveTin configuration file, including entity definitions, actions with enabledExpressions, and dashboard setup, demonstrating how enabledExpression integrates into the overall system. ```yaml entities: - file: /etc/OliveTin/lights.yaml name: light actions: - title: Turn On Light shell: /opt/smart-home/light-control.sh on {{ .CurrentEntity.id }} icon: 💡 entity: light enabledExpression: "{{ eq .CurrentEntity.powered_on false }}" - title: Turn Off Light shell: /opt/smart-home/light-control.sh off {{ .CurrentEntity.id }} icon: 🔌 entity: light enabledExpression: "{{ eq .CurrentEntity.powered_on true }}" dashboards: - title: Light Controls contents: - title: Lights type: fieldset entity: light contents: - type: display title: | {{ .CurrentEntity.name }} - title: Turn On Light - title: Turn Off Light ``` -------------------------------- ### Configure FirewallD for OliveTin Source: https://docs.olivetin.app/install/docker_compose Instructions to open port 1337 on a server using FirewallD, allowing external access to the OliveTin web interface. This involves adding the port permanently and reloading the firewall rules. ```shell user@host: firewall-cmd --add-port 1337/tcp --permanent user@host: firewall-cmd --reload ``` -------------------------------- ### Configure OliveTin Container to Run as Root Source: https://docs.olivetin.app/install/docker_compose A docker-compose.yml configuration snippet to set the OliveTin container to run with root privileges. This is often necessary when the container needs to interact with system resources like the Docker socket. ```yaml services: olivetin: container_name: olivetin image: jamesread/olivetin user: root ... ``` -------------------------------- ### OliveTin YAML Configuration for Docker Actions Source: https://docs.olivetin.app/action_examples/containers This snippet shows a basic OliveTin configuration file (config.yaml) that defines actions to stop and start a Docker container named 'plex'. It uses the 'shell' executor to run Docker commands. ```yaml actions: - title: Stop Plex shell: docker stop plex - title: Start plex shell: docker start plex ``` -------------------------------- ### Docker Create Command with Privileged Access Source: https://docs.olivetin.app/action_examples/containers This command demonstrates how to create a Docker container for OliveTin with `--privileged` and `--user root` flags, along with a bind mount for the Docker socket. This is the simplest method for granting OliveTin permissions to control other containers. ```bash docker create --privileged --user root -v /var/run/docker.sock:/var/run/docker.sock ...additional args here... ``` -------------------------------- ### StartActionByGetAndWait Source: https://docs.olivetin.app/api/method_StartActionByGetAndWait Starts an action using its ID provided in the URL and waits for the action to complete before returning the log entry. ```APIDOC ## GET /websites/olivetin_app/api/actions/{action_id}/wait ### Description This method starts an action identified by its ID and waits for the action to finish before returning the result. This is useful if you want to get the output of the action or check its result without having to poll for it. ### Method GET ### Endpoint `/websites/olivetin_app/api/actions/{action_id}/wait` ### Parameters #### Path Parameters - **action_id** (string) - Required - The ID of the action to start and wait for. ### Request Example ``` GET /websites/olivetin_app/api/actions/your_action_id/wait ``` ### Response #### Success Response (200) - **log_entry** (object) - The log entry of the completed action. - **timestamp** (string) - The timestamp of the log entry. - **level** (string) - The log level (e.g., INFO, ERROR). - **message** (string) - The log message. #### Response Example ```json { "log_entry": { "timestamp": "2023-10-27T10:00:00Z", "level": "INFO", "message": "Action completed successfully." } } ``` ``` -------------------------------- ### Configure OliveTin Actions for Kubernetes Commands Source: https://docs.olivetin.app/solutions/k8s-control-panel-hosted/index This YAML configuration snippet, to be applied to the 'olivetin-config' ConfigMap, defines several actions for OliveTin. These actions allow users to execute common kubectl commands like 'get pods', 'restart postgres deployment', and 'evacuate node', with an example of dynamic argument input for 'NodeName'. ```yaml apiVersion: v1 data: config.yaml: | defaultPopupOnStart: execution-dialog-output-only actions: - title: get pods icon: shell: kubectl get pods - title: restart postgres deployment icon: shell: kubectl rollout restart deployment postgres - title: evacuate node icon: shell: kubectl drain {{ NodeName }} --ignore-daemonsets --delete-emptydir-data arguments: - name: NodeName choices: - value: node1 - value: node2 - value: node3 kind: ConfigMap metadata: annotations: meta.helm.sh/release-name: olivetin meta.helm.sh/release-namespace: default labels: app.kubernetes.io/managed-by: Helm name: olivetin-config namespace: default ``` -------------------------------- ### POST /StartActionAndWait Source: https://docs.olivetin.app/api/method_StartActionAndWait Initiates an action within OliveTin and waits for the action to complete, returning the resulting log entry. This method is ideal for scripting scenarios where the script needs to know the outcome of the action. ```APIDOC ## POST /StartActionAndWait ### Description This method is useful if you are writing a script and want to wait for the action to finish so that you can check the result, or get the output. ### Method POST ### Endpoint /StartActionAndWait ### Parameters #### Request Body - **request** (OliveTin request object) - Required - An object specifying the action to be executed. ### Request Example ```json { "action_id": "your_action_id", "parameters": { "param1": "value1" } } ``` ### Response #### Success Response (200) - **log_entry** (Log Entry) - The log entry detailing the execution and outcome of the action. #### Response Example ```json { "timestamp": "2023-10-27T10:00:00Z", "level": "INFO", "message": "Action completed successfully." } ``` ``` -------------------------------- ### Execute SSH Commands Using OliveTin Configuration Source: https://docs.olivetin.app/action_examples/ssh-easy This YAML configuration demonstrates how to use the SSH configuration file generated by the `olivetin-setup-easy-ssh` script within OliveTin actions. It specifies the use of the `-F` flag to point to the generated configuration file, enabling SSH connections to remote servers to execute commands. This method simplifies SSH access for automated tasks within a containerized environment. ```yaml actions: - title: SSH into a server shell: ssh -F /config/ssh/config root@myserver '/opt/script-on-my-server.sh' ``` -------------------------------- ### Install OliveTin via .apk on Alpine Linux Source: https://docs.olivetin.app/install/linux_alpine This snippet shows how to download the OliveTin .apk package and install it using the apk add command. It requires root privileges for the installation step. Ensure you have wget installed to download the package. ```shell user@host: wget https://github.com/OliveTin/OliveTin/releases/latest/download/OliveTin_linux_amd64.apk user@host: apk add --allow-untrusted OliveTin_linux_amd64.apk ``` -------------------------------- ### Configure OliveTin for Easy SSH Setup Source: https://docs.olivetin.app/action_examples/ssh-easy This YAML configuration sets up an action within OliveTin to execute the `olivetin-setup-easy-ssh` script. This script automates the generation of SSH keys and configuration files for easy container-to-server connections. It is intended for use within OliveTin containers and is not compatible with Windows, MacOS, or host environments. ```yaml actions: - title: Setup SSH shell: olivetin-setup-easy-ssh popupOnStart: execution-dialog ``` -------------------------------- ### Install OliveTin using Helm Source: https://docs.olivetin.app/install/helm Installs the OliveTin application on your Kubernetes cluster using the Helm package manager. This command deploys the chart with default settings. ```bash user@host: helm install olivetin olivetin/olivetin ``` -------------------------------- ### Install OliveTin and Dependencies on Manjaro Source: https://docs.olivetin.app/install/linux_manjaro Installs the 'buf' utility and the 'olivetin' package from the AUR using pamac. It also creates necessary directories for OliveTin configuration and custom themes. ```bash PATH=$PATH:~/go/bin/ pamac install buf pamac install olivetin sudo mkdir -p /etc/OliveTin/custom-webui/themes/ sudo mkdir -p /etc/OliveTin/entities/ ``` -------------------------------- ### Basic Custom Theme CSS Example Source: https://docs.olivetin.app/reference/reference_themes_for_users This CSS code snippet demonstrates how to apply a simple background color to the body of the OliveTin interface. This is loaded on top of the existing stylesheet and can be used for testing custom themes. ```css body { background-color: red !important; } ```