config.yaml 9.2 KB

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