config.yaml 11 KB

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