|
|
@@ -6,14 +6,39 @@
|
|
|
listenAddressSingleHTTPFrontend: 0.0.0.0:1337
|
|
|
|
|
|
# Choose from INFO (default), WARN and DEBUG
|
|
|
-# Docs: https://docs.olivetin.app/advanced_configuration/logs.html
|
|
|
+# Docs: https://docs.olivetin.app/advanced_configuration/logs.html
|
|
|
logLevel: "INFO"
|
|
|
|
|
|
# Actions are commands that are executed by OliveTin, and normally show up as
|
|
|
# buttons on the WebUI.
|
|
|
#
|
|
|
-# Docs: https://docs.olivetin.app/action_execution/create_your_first.html
|
|
|
+# Docs: https://docs.olivetin.app/action_buttons/create_your_first.html
|
|
|
actions:
|
|
|
+ # Lots of people use OliveTin to build web interfaces for their electronics
|
|
|
+ # projects. It's best to install OliveTin as a native package (eg, .deb), and
|
|
|
+ # then you can use either a python script or the `gpio` command.
|
|
|
+ - title: Toggle GPIO light
|
|
|
+ shell: gpioset gpiochip1 9=1 || true # The "|| true" is to ignore errors the demo environment doesn't have GPIO access.
|
|
|
+ icon: light
|
|
|
+
|
|
|
+ # Lots of people also use OliveTin to monitor their servers, like checking
|
|
|
+ # disk space, or checking logs. `onclick: execution-dialog` shows output.
|
|
|
+ - title: Check disk space
|
|
|
+ icon: disk
|
|
|
+ shell: df -h /
|
|
|
+ onclick: execution-dialog
|
|
|
+
|
|
|
+ # This uses `onclick: execution-dialog` to show a dialog with more
|
|
|
+ # information about the command that was run.
|
|
|
+ - title: Check shell history
|
|
|
+ shell: cat ~/.bash_history
|
|
|
+ icon: logs
|
|
|
+ onclick: execution-dialog
|
|
|
+
|
|
|
+ # Every action can still be run on demand from the web UI or API. The keys
|
|
|
+ # below are optional *additional* triggers (see each action and
|
|
|
+ # https://docs.olivetin.app/action_execution/ ).
|
|
|
+ #
|
|
|
# This is the most simple action, it just runs the command and flashes the
|
|
|
# button to indicate status.
|
|
|
#
|
|
|
@@ -22,47 +47,40 @@ actions:
|
|
|
- title: Ping the Internet
|
|
|
shell: ping -c 3 1.1.1.1
|
|
|
icon: ping
|
|
|
- popupOnStart: execution-dialog-stdout-only
|
|
|
+ onclick: execution-dialog
|
|
|
+ # https://docs.olivetin.app/action_execution/onstartup.html
|
|
|
+ execOnStartup: true
|
|
|
|
|
|
- # This uses `popupOnStart: execution-dialog-stdout-only` to simply show just
|
|
|
- # the command output.
|
|
|
- - title: Check disk space
|
|
|
- icon: disk
|
|
|
- shell: df -h /media
|
|
|
- popupOnStart: execution-dialog-stdout-only
|
|
|
-
|
|
|
- # This uses `popupOnStart: execution-dialog` to show a dialog with more
|
|
|
- # information about the command that was run.
|
|
|
- - title: check dmesg logs
|
|
|
- shell: dmesg | tail
|
|
|
- icon: logs
|
|
|
- popupOnStart: execution-dialog
|
|
|
-
|
|
|
- # This uses `popupOnStart: execution-button` to display a mini button that
|
|
|
- # links to the logs.
|
|
|
- #
|
|
|
# You can also rate-limit actions too.
|
|
|
- - title: date
|
|
|
- shell: date
|
|
|
- id: date
|
|
|
- timeout: 6
|
|
|
- icon: clock
|
|
|
- popupOnStart: execution-button
|
|
|
+ - title: Sync Disks
|
|
|
+ shell: sync
|
|
|
+ id: syncdisks
|
|
|
+ icon: disk
|
|
|
+ onclick: execution-button
|
|
|
maxRate:
|
|
|
- limit: 3
|
|
|
duration: 1m
|
|
|
|
|
|
# You are not limited to operating system commands, and of course you can run
|
|
|
- # your own scripts. Here `maxConcurrent` stops the script running multiple
|
|
|
- # times in parallel. There is also a timeout that will kill the command if it
|
|
|
- # runs for too long.
|
|
|
+ # your own scripts. The backup-jobs action group limits how many backup-related
|
|
|
+ # actions can run at once; extra requests are queued instead of blocked.
|
|
|
+ # There is also a timeout that will kill the command if it runs for too long.
|
|
|
- title: Run backup script
|
|
|
shell: /opt/backupScript.sh
|
|
|
shellAfterCompleted: "apprise -t 'Notification: Backup script completed' -b 'The backup script completed with code {{ exitCode}}. The log is: \n {{ output }} '"
|
|
|
- maxConcurrent: 1
|
|
|
+ groups: [ backup-jobs ]
|
|
|
timeout: 10
|
|
|
icon: backup
|
|
|
- popupOnStart: execution-dialog
|
|
|
+ onclick: execution-dialog
|
|
|
+ # https://docs.olivetin.app/action_execution/oncalendar.html
|
|
|
+ execOnCalendarFile: examples/demo-olivetin-calendar.yaml
|
|
|
+
|
|
|
+ - title: Verify backup archive
|
|
|
+ shell: sleep 3 && echo "Backup archive verified"
|
|
|
+ groups: [ backup-jobs ]
|
|
|
+ timeout: 30
|
|
|
+ icon: backup
|
|
|
+ onclick: execution-dialog
|
|
|
|
|
|
# When you want to prompt users for input, that is when you should use
|
|
|
# `arguments` - this presents a popup dialog and asks for argument values.
|
|
|
@@ -73,7 +91,12 @@ actions:
|
|
|
shell: ping {{ host }} -c {{ count }}
|
|
|
icon: ping
|
|
|
timeout: 100
|
|
|
- popupOnStart: execution-dialog-stdout-only
|
|
|
+ onclick: history
|
|
|
+ # https://docs.olivetin.app/action_execution/onwebhook.html — POST to /webhooks
|
|
|
+ # with header X-OliveTin-Demo: ping-host (path and payload rules are documented).
|
|
|
+ execOnWebhook:
|
|
|
+ - matchHeaders:
|
|
|
+ X-OliveTin-Demo: ping-host
|
|
|
arguments:
|
|
|
- name: host
|
|
|
title: Host
|
|
|
@@ -95,7 +118,7 @@ actions:
|
|
|
# Docs: https://docs.olivetin.app/solutions/container-control-panel/index.html
|
|
|
- title: Restart Docker Container
|
|
|
icon: restart
|
|
|
- shell: docker restart {{ .CurrentEntity }}
|
|
|
+ shell: docker restart {{ container }}
|
|
|
arguments:
|
|
|
- name: container
|
|
|
title: Container name
|
|
|
@@ -110,7 +133,8 @@ actions:
|
|
|
# Docs: https://docs.olivetin.app/args/input_confirmation.html
|
|
|
- title: Delete old backups
|
|
|
icon: ashtonished
|
|
|
- shell: rm -rf /opt/oldBackups/
|
|
|
+ justification: true
|
|
|
+ shell: rm -rf /opt/oliveTinOldBackups/ && sleep 5
|
|
|
arguments:
|
|
|
- type: html
|
|
|
title: Description
|
|
|
@@ -124,7 +148,7 @@ actions:
|
|
|
#
|
|
|
# Docs: https://docs.olivetin.app/reference/reference_themes_for_users.html
|
|
|
- title: Get OliveTin Theme
|
|
|
- exec:
|
|
|
+ exec:
|
|
|
- "olivetin-get-theme"
|
|
|
- "{{ themeGitRepo }}"
|
|
|
- "{{ themeFolderName }}"
|
|
|
@@ -148,7 +172,11 @@ actions:
|
|
|
- title: "Setup easy SSH"
|
|
|
icon: ssh
|
|
|
shell: olivetin-setup-easy-ssh
|
|
|
- popupOnStart: execution-dialog
|
|
|
+ onclick: execution-dialog
|
|
|
+ # Second webhook example: POST /webhooks?demo=setup-ssh
|
|
|
+ execOnWebhook:
|
|
|
+ - matchQuery:
|
|
|
+ demo: setup-ssh
|
|
|
|
|
|
# Here's how to use SSH with the "easy" config, to restart a service on
|
|
|
# another server.
|
|
|
@@ -161,13 +189,6 @@ actions:
|
|
|
timeout: 1
|
|
|
shell: ssh -F /config/ssh/easy.cfg root@server1 'service httpd restart'
|
|
|
|
|
|
- # Lots of people use OliveTin to build web interfaces for their electronics
|
|
|
- # projects. It's best to install OliveTin as a native package (eg, .deb), and
|
|
|
- # then you can use either a python script or the `gpio` command.
|
|
|
- - title: Toggle GPIO light
|
|
|
- shell: gpioset gpiochip1 9=1
|
|
|
- icon: light
|
|
|
-
|
|
|
# There are several built-in shortcuts for the `icon` option, but you
|
|
|
# can also just specify any HTML, this includes any unicode character,
|
|
|
# or a <img = "..." /> link to a custom icon.
|
|
|
@@ -215,6 +236,10 @@ actions:
|
|
|
- title: Ping All Servers
|
|
|
shell: "echo 'Ping all servers'"
|
|
|
icon: ping
|
|
|
+ # https://docs.olivetin.app/action_execution/onfilecreated.html
|
|
|
+ # mkdir -p /tmp/olivetin-demo-file-created
|
|
|
+ execOnFileCreatedInDir:
|
|
|
+ - /tmp/olivetin-demo-file-created
|
|
|
|
|
|
- title: Start {{ .CurrentEntity.Names }}
|
|
|
icon: box
|
|
|
@@ -228,6 +253,15 @@ actions:
|
|
|
entity: container
|
|
|
triggers: ["Update container entity file"]
|
|
|
|
|
|
+ - title: Long running action
|
|
|
+ shell: sleep 300
|
|
|
+ timeout: 300
|
|
|
+ icon: logs
|
|
|
+ onclick: execution-dialog
|
|
|
+ groups: [ con2queue10 ]
|
|
|
+ execOnCron:
|
|
|
+ - "@hourly"
|
|
|
+
|
|
|
# Lastly, you can hide actions from the web UI, this is useful for creating
|
|
|
# background helpers that execute only on startup or a cron, for updating
|
|
|
# entity files.
|
|
|
@@ -269,6 +303,17 @@ entities:
|
|
|
- file: entities/containers.json
|
|
|
name: container
|
|
|
|
|
|
+# Action groups share a concurrency limit across multiple actions. When the
|
|
|
+# limit is reached, additional requests are queued and run in order.
|
|
|
+# Docs: https://docs.olivetin.app/action_customization/concurrency.html#action-groups
|
|
|
+actionGroups:
|
|
|
+ backup-jobs:
|
|
|
+ maxConcurrent: 1
|
|
|
+ icon: backup
|
|
|
+ con2queue10:
|
|
|
+ maxConcurrent: 2
|
|
|
+ queueSize: 10
|
|
|
+
|
|
|
# Dashboards are a way of taking actions from the default "actions" view, and
|
|
|
# organizing them into groups - either into folders, or fieldsets.
|
|
|
#
|
|
|
@@ -341,7 +386,7 @@ dashboards:
|
|
|
|
|
|
# Security - Authentication
|
|
|
|
|
|
-# This setting effectively enables or disables guests.
|
|
|
+# This setting effectively enables or disables guests.
|
|
|
# If set to "true", then users will have to login to do anything.
|
|
|
authRequireGuestsToLogin: false
|
|
|
|
|
|
@@ -350,7 +395,7 @@ authRequireGuestsToLogin: false
|
|
|
# and JWT authentication which are documented separately.
|
|
|
#
|
|
|
# Docs: https://docs.olivetin.app/security/local.html
|
|
|
-#
|
|
|
+#
|
|
|
# How to get a hashed password:
|
|
|
# Docs: https://docs.olivetin.app/security/local.html#_get_a_argon2id_hashed_password
|
|
|
authLocalUsers:
|