config.yaml 11 KB

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