config.yaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  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. # Docs: https://docs.olivetin.app/advanced_configuration/logs.html
  9. logLevel: "INFO"
  10. # Actions are commands that are executed by OliveTin, and normally show up as
  11. # buttons on the WebUI.
  12. #
  13. # Docs: https://docs.olivetin.app/action_execution/create_your_first.html
  14. actions:
  15. # This is the most simple action, it just runs the command and flashes the
  16. # button to indicate status.
  17. #
  18. # If you are running OliveTin in a container remember to pass through the
  19. # docker socket! https://docs.olivetin.app/solutions/container-control-panel/index.html
  20. - title: Ping the Internet
  21. shell: ping -c 3 1.1.1.1
  22. icon: ping
  23. popupOnStart: execution-dialog-stdout-only
  24. # This uses `popupOnStart: execution-dialog-stdout-only` to simply show just
  25. # the command output.
  26. - title: Check disk space
  27. icon: disk
  28. shell: df -h /media
  29. popupOnStart: execution-dialog-stdout-only
  30. # This uses `popupOnStart: execution-dialog` to show a dialog with more
  31. # information about the command that was run.
  32. - title: check dmesg logs
  33. shell: dmesg | tail
  34. icon: logs
  35. popupOnStart: execution-dialog
  36. # This uses `popupOnStart: execution-button` to display a mini button that
  37. # links to the logs.
  38. #
  39. # You can also rate-limit actions too.
  40. - title: date
  41. shell: date
  42. id: date
  43. timeout: 6
  44. icon: clock
  45. popupOnStart: execution-button
  46. maxRate:
  47. - limit: 3
  48. duration: 1m
  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 {{ .CurrentEntity }}
  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. exec:
  117. - "olivetin-get-theme"
  118. - "{{ themeGitRepo }}"
  119. - "{{ themeFolderName }}"
  120. icon: theme
  121. arguments:
  122. - name: themeGitRepo
  123. title: Theme's Git Repository
  124. description: Find new themes at https://olivetin.app/themes
  125. type: url
  126. - name: themeFolderName
  127. title: Theme's Folder Name
  128. type: ascii_identifier
  129. # Sometimes you want to run actions on other servers - don't overcomplicate
  130. # it, just use SSH! OliveTin includes a helper to make this easier, which is
  131. # entirely optional. You can also setup SSH manually.
  132. #
  133. # Docs: https://docs.olivetin.app/action_examples/ssh-easy.html
  134. # Docs: https://docs.olivetin.app/action_examples/ssh-manual.html
  135. - title: "Setup easy SSH"
  136. icon: ssh
  137. shell: olivetin-setup-easy-ssh
  138. popupOnStart: execution-dialog
  139. # Here's how to use SSH with the "easy" config, to restart a service on
  140. # another server.
  141. #
  142. # Docs: https://docs.olivetin.app/action_examples/ssh-easy.html
  143. # Docs: https://docs.olivetin.app/action_examples/systemd_service.html
  144. - title: Restart httpd on server1
  145. id: restart_httpd
  146. icon: restart
  147. timeout: 1
  148. shell: ssh -F /config/ssh/easy.cfg root@server1 'service httpd restart'
  149. # Lots of people use OliveTin to build web interfaces for their electronics
  150. # projects. It's best to install OliveTin as a native package (eg, .deb), and
  151. # then you can use either a python script or the `gpio` command.
  152. - title: Toggle GPIO light
  153. shell: gpioset gpiochip1 9=1
  154. icon: light
  155. # There are several built-in shortcuts for the `icon` option, but you
  156. # can also just specify any HTML, this includes any unicode character,
  157. # or a <img = "..." /> link to a custom icon.
  158. #
  159. # Docs: https://docs.olivetin.app/action_customization/icons.html
  160. #
  161. # Lots of people use OliveTin to easily execute ansible-playbooks. You
  162. # probably want a much longer timeout as well (so that ansible completes).
  163. #
  164. # Docs: https://docs.olivetin.app/action_examples/ansible.html
  165. - title: "Run Automation Playbook"
  166. icon: '&#129302;'
  167. shell: ansible-playbook -i /etc/hosts /root/myRepo/myPlaybook.yaml
  168. timeout: 120
  169. # The following actions are "dummy" actions, used in a Dashboard. As long as
  170. # you have these referenced in a dashboard, they will not show up in the
  171. # `actions` view.
  172. - title: Ping hypervisor1
  173. shell: echo "hypervisor1 online"
  174. - title: Ping hypervisor2
  175. shell: echo "hypervisor2 online"
  176. - title: Ping hypervisor3
  177. shell: echo "hypervisor3 online"
  178. - title: Ping hypervisor4
  179. shell: echo "hypervisor4 online"
  180. - title: "{{ server.name }} Wake on Lan"
  181. shell: echo "Sending Wake on LAN to {{ server.hostname }}"
  182. icon: <iconify-icon icon="carbon:awake"></iconify-icon>
  183. entity: server
  184. - title: "{{ server.name }} Power Off"
  185. shell: "echo 'Power Off Server: {{ server.hostname }}'"
  186. icon: <iconify-icon icon="carbon:flash-off"></iconify-icon>
  187. entity: server
  188. - title: "{{ server.name }} Print server name"
  189. shell: 'echo "Server name: {{ server.name }}"'
  190. entity: server
  191. - title: Ping All Servers
  192. shell: "echo 'Ping all servers'"
  193. icon: ping
  194. - title: Start {{ .CurrentEntity.Names }}
  195. icon: box
  196. shell: docker start {{ .CurrentEntity.Names }}
  197. entity: container
  198. triggers: ["Update container entity file"]
  199. - title: Stop {{ .CurrentEntity.Names }}
  200. icon: box
  201. shell: docker stop {{ .CurrentEntity.Names }}
  202. entity: container
  203. triggers: ["Update container entity file"]
  204. # Lastly, you can hide actions from the web UI, this is useful for creating
  205. # background helpers that execute only on startup or a cron, for updating
  206. # entity files.
  207. # - title: Update container entity file
  208. # shell: 'docker ps -a --format json > /etc/OliveTin/entities/containers.json'
  209. # hidden: true
  210. # execOnStartup: true
  211. # execOnCron: '*/1 * * * *'
  212. # An entity is something that exists - a "thing", like a VM, or a Container
  213. # is an entity. OliveTin allows you to then dynamically generate actions based
  214. # around these entities.
  215. #
  216. # This is really useful if you want to generate wake on lan or poweroff actions
  217. # for `server` entities, for example.
  218. #
  219. # A very popular use case that entities were designed for was for `container`
  220. # entities - in a similar way you could generate `start`, `stop`, and `restart`
  221. # container actions.
  222. #
  223. # Entities are just loaded fome files on disk, OliveTin will also watch these
  224. # files for updates while OliveTin is running, and update entities.
  225. #
  226. # Entities can have properties defined in those files, and those can be used
  227. # in your configuration as variables. For example; `container.status`,
  228. # or `vm.hostname`.
  229. #
  230. # Docs: https://docs.olivetin.app/entities/intro.html
  231. entities:
  232. # YAML files are the default expected format, so you can use .yml or .yaml,
  233. # or even .txt, as long as the file contains valid a valid yaml LIST, then it
  234. # will load properly.
  235. #
  236. # Docs: https://docs.olivetin.app/entities/intro.html
  237. - file: entities/servers.yaml
  238. name: server
  239. - file: entities/containers.json
  240. name: container
  241. # Dashboards are a way of taking actions from the default "actions" view, and
  242. # organizing them into groups - either into folders, or fieldsets.
  243. #
  244. # The only way to properly use entities, are to use them with a `fieldset` on
  245. # a dashboard.
  246. #
  247. # Docs: https://docs.olivetin.app/dashboards/intro.html
  248. dashboards:
  249. # Top level items are dashboards.
  250. - title: My Servers
  251. contents:
  252. - title: All Servers
  253. type: fieldset
  254. contents:
  255. # The contents of a dashboard will try to look for an action with a
  256. # matching title IF the `contents: ` property is empty.
  257. - title: Ping All Servers
  258. # If you create an item with some "contents:", OliveTin will show that as
  259. # directory.
  260. - title: Hypervisors
  261. contents:
  262. - title: Ping hypervisor1
  263. - title: Ping hypervisor2
  264. - title: More hypervisors
  265. type: directory
  266. contents:
  267. - title: Ping hypervisor3
  268. - title: Ping hypervisor4
  269. # If you specify `type: fieldset` and some `contents`, it will show your
  270. # actions grouped together without a folder.
  271. - type: fieldset
  272. entity: server
  273. title: 'Server: {{ .CurrentEntity.hostname }}'
  274. contents:
  275. # By default OliveTin will look for an action with a matching title
  276. # and put it on the dashboard.
  277. #
  278. # Fieldsets also support `type: display`, which can display arbitary
  279. # text. This is useful for displaying things like a container's state.
  280. - type: display
  281. title: |
  282. Hostname: <strong>{{ server.name }}</strong>
  283. IP Address: <strong>{{ server.ip }}</strong>
  284. # These are the actions (defined above) that we want on the dashboard.
  285. - title: '{{ server.name }} Wake on Lan'
  286. - title: '{{ server.name }} Power Off'
  287. - title: More Options
  288. type: directory
  289. contents:
  290. - title: '{{ server.name }} Print server name'
  291. # This is the second dashboard.
  292. - title: My Containers
  293. contents:
  294. - title: 'Container {{ .CurrentEntity.Names }} ({{ .CurrentEntity.Image }})'
  295. entity: container
  296. type: fieldset
  297. contents:
  298. - type: display
  299. title: |
  300. {{ container.RunningFor }} <br /><br /><strong>{{ container.State }}</strong>
  301. - title: 'Start {{ .CurrentEntity.Names }}'
  302. - title: 'Stop {{ .CurrentEntity.Names }}'
  303. # Security - Authentication
  304. # This setting effectively enables or disables guests.
  305. # If set to "true", then users will have to login to do anything.
  306. authRequireGuestsToLogin: false
  307. # This form of auth is the simplest to setup - just define users and passwords
  308. # in the config. OliveTin also supports header-based auth, OAuth2,
  309. # and JWT authentication which are documented separately.
  310. #
  311. # Docs: https://docs.olivetin.app/security/local.html
  312. #
  313. # How to get a hashed password:
  314. # Docs: https://docs.olivetin.app/security/local.html#_get_a_argon2id_hashed_password
  315. authLocalUsers:
  316. enabled: true
  317. # users:
  318. # - username: alice
  319. # usergroup: admins
  320. # password: "$argon2id$v=19$m=65536,t=4,p=2$puyxA0s555TSFx7hnFLCXA$PyhLGpZtvpMMvc2DgMWkM8OJMKO55euwV5gm//1iwx4"
  321. # Security - Access Control
  322. # Policies affect the whole app (eg: ability to view the log list).
  323. # Docs: https://docs.olivetin.app/security/acl.html
  324. defaultPolicy:
  325. showDiagnostics: true
  326. showLogList: true
  327. # Permissions affect actions (eg: ability to view a specific log).
  328. # Docs: https://docs.olivetin.app/security/acl.html
  329. defaultPermissions:
  330. view: true
  331. exec: true
  332. logs: true
  333. # OliveTin uses access control lists to match up policy and permissions to users.
  334. # Docs: https://docs.olivetin.app/security/acl.html
  335. accessControlLists:
  336. - name: admin_acl
  337. matchUsergroups: ["admins"]
  338. policy:
  339. showDiagnostics: true
  340. permissions:
  341. view: true
  342. exec: true
  343. logs: true
  344. # OliveTin contains many more configuration options not in this default config.
  345. # Check out docs.olivetin.app for a setting if you feel like you're missing something.