config.yaml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. # There is a built-in micro proxy that will host the webui and REST API all on
  2. # one port (this is called the "Single HTTP Frontend") and means you just need
  3. # one open port in the container/firewalls/etc.
  4. #
  5. # Listen on all addresses available, port 1337
  6. listenAddressSingleHTTPFrontend: 0.0.0.0:1337
  7. # Choose from INFO (default), WARN and DEBUG
  8. logLevel: "INFO"
  9. # Actions are commands that are executed by OliveTin, and normally show up as
  10. # buttons on the WebUI.
  11. #
  12. # Docs: https://docs.olivetin.app/create-your-first-action.html
  13. actions:
  14. # This is the most simple action, it just runs the command and flashes the
  15. # button to indicate status.
  16. #
  17. # If you are running OliveTin in a container remember to pass through the
  18. # docker socket! https://docs.olivetin.app/action-container-control.html
  19. - title: Ping the Internet
  20. shell: ping -c 3 1.1.1.1
  21. icon: ping
  22. popupOnStart: execution-dialog-stdout-only
  23. # This uses `popupOnStart: execution-dialog-stdout-only` to simply show just
  24. # the command output.
  25. - title: Check disk space
  26. icon: disk
  27. shell: df -h /media
  28. popupOnStart: execution-dialog-stdout-only
  29. # This uses `popupOnStart: execution-dialog` to show a dialog with more
  30. # information about the command that was run.
  31. - title: check dmesg logs
  32. shell: dmesg | tail
  33. icon: logs
  34. popupOnStart: execution-dialog
  35. # This uses `popupOnStart: execution-button` to display a mini button that
  36. # links to the logs.
  37. - title: date
  38. shell: date
  39. timeout: 6
  40. icon: clock
  41. popupOnStart: execution-button
  42. # You are not limited to operating system commands, and of course you can run
  43. # your own scripts. Here `maxConcurrent` stops the script running multiple
  44. # times in parallel. There is also a timeout that will kill the command if it
  45. # runs for too long.
  46. - title: Run backup script
  47. shell: /opt/backupScript.sh
  48. shellAfterCompleted: "apprise -t 'Notification: Backup script completed' -b 'The backup script completed with code {{ exitCode}}. The log is: \n {{ stdout }} '"
  49. maxConcurrent: 1
  50. timeout: 10
  51. icon: backup
  52. popupOnStart: execution-dialog
  53. # When you want to prompt users for input, that is when you should use
  54. # `arguments` - this presents a popup dialog and asks for argument values.
  55. #
  56. # Docs: https://docs.olivetin.app/action-ping.html
  57. - title: Ping host
  58. shell: ping {{ host }} -c {{ count }}
  59. icon: ping
  60. timeout: 100
  61. popupOnStart: execution-dialog-stdout-only
  62. arguments:
  63. - name: host
  64. title: Host
  65. type: ascii_identifier
  66. default: example.com
  67. description: The host that you want to ping
  68. - name: count
  69. title: Count
  70. type: int
  71. default: 3
  72. description: How many times to do you want to ping?
  73. # OliveTin can control containers - docker is just a command line app.
  74. #
  75. # However, if you are running in a container you will need to do some setup,
  76. # see the docs below.
  77. #
  78. # Docs: https://docs.olivetin.app/action-container-control.html
  79. - title: Restart Docker Container
  80. icon: restart
  81. shell: docker restart {{ container }}
  82. arguments:
  83. - name: container
  84. title: Container name
  85. choices:
  86. - value: plex
  87. - value: traefik
  88. - value: grafana
  89. # There is a special `confirmation` argument to help against accidental clicks
  90. # on "dangerous" actions.
  91. #
  92. # Docs: https://docs.olivetin.app/confirmation.html
  93. - title: Delete old backups
  94. icon: ashtonished
  95. shell: rm -rf /opt/oldBackups/
  96. arguments:
  97. - type: confirmation
  98. title: Are you sure?!
  99. # Sometimes you want to run actions on other servers - don't overcomplicate
  100. # it, just use SSH!
  101. #
  102. # Docs: https://docs.olivetin.app/action-ssh.html
  103. # Docs: https://docs.olivetin.app/action-service.html
  104. - title: Restart httpd on server1
  105. id: restart_httpd
  106. icon: restart
  107. timeout: 1
  108. shell: ssh root@server1 'service httpd restart'
  109. # Lots of people use OliveTin to build web interfaces for their electronics
  110. # projects. It's best to install OliveTin as a native package (eg, .deb), and
  111. # then you can use either a python script or the `gpio` command.
  112. - title: Toggle GPIO light
  113. shell: gpioset gpiochip1 9=1
  114. icon: light
  115. # There are several built-in shortcuts for the `icon` option, but you
  116. # can also just specify any HTML, this includes any unicode character,
  117. # or a <img = "..." /> link to a custom icon.
  118. #
  119. # Docs: https://docs.olivetin.app/icons.html
  120. #
  121. # Lots of people use OliveTin to easily execute ansible-playbooks. You
  122. # probably want a much longer timeout as well (so that ansible completes).
  123. #
  124. # Docs: https://docs.olivetin.app/ansible-playbook.html
  125. - title: "Run Automation Playbook"
  126. icon: '&#129302;'
  127. shell: ansible-playbook -i /etc/hosts /root/myRepo/myPlaybook.yaml
  128. timeout: 120
  129. # The following actions are "dummy" actions, used in a Dashboard. As long as
  130. # you have these referenced in a dashboard, they will not who up in the
  131. # `actions` view.
  132. - title: Ping hypervisor1
  133. shell: echo "hypervisor1 online"
  134. - title: Ping hypervisor2
  135. shell: echo "hypervisor2 online"
  136. - title: "{{ server.name }} Wake on Lan"
  137. shell: echo "Sending Wake on LAN to {{ server.hostname }}"
  138. entity: server
  139. - title: "{{ server.name }} Power Off"
  140. shell: "echo 'Power Off Server: {{ server.hostname }}'"
  141. entity: server
  142. - title: Ping All Servers
  143. shell: "echo 'Ping all servers'"
  144. icon: ping
  145. - title: Start {{ container.Names }}
  146. icon: box
  147. shell: docker start {{ container.Names }}
  148. entity: container
  149. trigger: Update container entity file
  150. - title: Stop {{ container.Names }}
  151. icon: box
  152. shell: docker stop {{ container.Names }}
  153. entity: container
  154. trigger: Update container entity file
  155. # Lastly, you can hide actions from the web UI, this is useful for creating
  156. # background helpers that execute only on startup or a cron, for updating
  157. # entity files.
  158. # - title: Update container entity file
  159. # shell: 'docker ps -a --format json > /etc/OliveTin/entities/containers.json'
  160. # hidden: true
  161. # execOnStartup: true
  162. # execOnCron: '*/1 * * * *'
  163. # An entity is something that exists - a "thing", like a VM, or a Container
  164. # is an entity. OliveTin allows you to then dynamically generate actions based
  165. # around these entities.
  166. #
  167. # This is really useful if you want to generate wake on lan or poweroff actions
  168. # for `server` entities, for example.
  169. #
  170. # A very popular use case that entities were designed for was for `container`
  171. # entities - in a similar way you could generate `start`, `stop`, and `restart`
  172. # container actions.
  173. #
  174. # Entities are just loaded fome files on disk, OliveTin will also watch these
  175. # files for updates while OliveTin is running, and update entities.
  176. #
  177. # Entities can have properties defined in those files, and those can be used
  178. # in your configuration as variables. For example; `container.status`,
  179. # or `vm.hostname`.
  180. #
  181. # Docs: http://docs.olivetin.app/entities.html
  182. entities:
  183. # YAML files are the default expected format, so you can use .yml or .yaml,
  184. # or even .txt, as long as the file contains valid a valid yaml LIST, then it
  185. # will load properly.
  186. #
  187. # Docs: https://docs.olivetin.app/entities.html
  188. - file: entities/servers.yaml
  189. name: server
  190. - file: entities/containers.json
  191. name: container
  192. # Dashboards are a way of taking actions from the default "actions" view, and
  193. # organizing them into groups - either into folders, or fieldsets.
  194. #
  195. # The only way to properly use entities, are to use them with a `fieldset` on
  196. # a dashboard.
  197. dashboards:
  198. # Top level items are dashboards.
  199. - title: My Servers
  200. contents:
  201. # The contents of a dashboard will try to look for an action with a
  202. # matching title IF the `contents: ` property is empty.
  203. - title: Ping All Servers
  204. # If you create an item with some "contents:", OliveTin will show that as
  205. # directory.
  206. - title: Hypervisors
  207. contents:
  208. - title: Ping hypervisor1
  209. - title: Ping hypervisor2
  210. # If you specify `type: fieldset` and some `contents`, it will show your
  211. # actions grouped together without a folder.
  212. - type: fieldset
  213. entity: server
  214. title: 'Server: {{ server.hostname }}'
  215. contents:
  216. # By default OliveTin will look for an action with a matching title
  217. # and put it on the dashboard.
  218. #
  219. # Fieldsets also support `type: display`, which can display arbitary
  220. # text. This is useful for displaying things like a container's state.
  221. - type: display
  222. title: |
  223. Hostname: <strong>{{ server.name }}</strong>
  224. IP Address: <strong>{{ server.ip }}</strong>
  225. # These are the actions (defined above) that we want on the dashboard.
  226. - title: '{{ server.name }} Wake on Lan'
  227. - title: '{{ server.name }} Power Off'
  228. # This is the second dashboard.
  229. - title: My Containers
  230. contents:
  231. - title: 'Container {{ container.Names }} ({{ container.Image }})'
  232. entity: container
  233. type: fieldset
  234. contents:
  235. - type: display
  236. title: |
  237. {{ container.RunningFor }} <br /><br /><strong>{{ container.State }}</strong>
  238. - title: 'Start {{ container.Names }}'
  239. - title: 'Stop {{ container.Names }}'