config.yaml 10 KB

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