config.yaml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  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_buttons/create_your_first.html
  14. actions:
  15. # Lots of people use OliveTin to build web interfaces for their electronics
  16. # projects. It's best to install OliveTin as a native package (eg, .deb), and
  17. # then you can use either a python script or the `gpio` command.
  18. - title: Toggle GPIO light
  19. shell: gpioset gpiochip1 9=1 || true # The "|| true" is to ignore errors the demo environment doesn't have GPIO access.
  20. icon: light
  21. # Lots of people also use OliveTin to monitor their servers, like checking
  22. # disk space, or checking logs. `onclick: execution-dialog` shows output.
  23. - title: Check disk space
  24. icon: disk
  25. shell: df -h /
  26. onclick: execution-dialog
  27. # This uses `onclick: execution-dialog` to show a dialog with more
  28. # information about the command that was run.
  29. - title: Check shell history
  30. shell: cat ~/.bash_history
  31. icon: logs
  32. onclick: execution-dialog
  33. # Every action can still be run on demand from the web UI or API. The keys
  34. # below are optional *additional* triggers (see each action and
  35. # https://docs.olivetin.app/action_execution/ ).
  36. #
  37. # This is the most simple action, it just runs the command and flashes the
  38. # button to indicate status.
  39. #
  40. # If you are running OliveTin in a container remember to pass through the
  41. # docker socket! https://docs.olivetin.app/solutions/container-control-panel/index.html
  42. - title: Ping the Internet
  43. shell: ping -c 3 1.1.1.1
  44. icon: ping
  45. onclick: execution-dialog
  46. # https://docs.olivetin.app/action_execution/onstartup.html
  47. execOnStartup: true
  48. # You can also rate-limit actions too.
  49. - title: Sync Disks
  50. shell: sync
  51. id: syncdisks
  52. icon: disk
  53. onclick: execution-button
  54. maxRate:
  55. - limit: 3
  56. duration: 1m
  57. # You are not limited to operating system commands, and of course you can run
  58. # your own scripts. The backup-jobs action group limits how many backup-related
  59. # actions can run at once; extra requests are queued instead of blocked.
  60. # There is also a timeout that will kill the command if it runs for too long.
  61. - title: Run backup script
  62. shell: /opt/backupScript.sh
  63. shellAfterCompleted: "apprise -t 'Notification: Backup script completed' -b 'The backup script completed with code {{ exitCode}}. The log is: \n {{ output }} '"
  64. groups: [ backup-jobs ]
  65. timeout: 10
  66. icon: backup
  67. onclick: execution-dialog
  68. # https://docs.olivetin.app/action_execution/oncalendar.html
  69. execOnCalendarFile: examples/demo-olivetin-calendar.yaml
  70. - title: Verify backup archive
  71. shell: sleep 3 && echo "Backup archive verified"
  72. groups: [ backup-jobs ]
  73. timeout: 30
  74. icon: backup
  75. onclick: execution-dialog
  76. # When you want to prompt users for input, that is when you should use
  77. # `arguments` - this presents a popup dialog and asks for argument values.
  78. #
  79. # Docs: https://docs.olivetin.app/action_examples/ping.html
  80. - title: Ping host
  81. id: ping_host
  82. shell: ping {{ host }} -c {{ count }}
  83. icon: ping
  84. timeout: 100
  85. onclick: history
  86. # https://docs.olivetin.app/action_execution/onwebhook.html — POST to /webhooks
  87. # with header X-OliveTin-Demo: ping-host (path and payload rules are documented).
  88. execOnWebhook:
  89. - matchHeaders:
  90. X-OliveTin-Demo: ping-host
  91. arguments:
  92. - name: host
  93. title: Host
  94. type: ascii_identifier
  95. default: example.com
  96. description: The host that you want to ping
  97. - name: count
  98. title: Count
  99. type: int
  100. default: 3
  101. description: How many times to do you want to ping?
  102. # OliveTin can control containers - docker is just a command line app.
  103. #
  104. # However, if you are running in a container you will need to do some setup,
  105. # see the docs below.
  106. #
  107. # Docs: https://docs.olivetin.app/solutions/container-control-panel/index.html
  108. - title: Restart Docker Container
  109. icon: restart
  110. shell: docker restart {{ container }}
  111. arguments:
  112. - name: container
  113. title: Container name
  114. choices:
  115. - value: plex
  116. - value: traefik
  117. - value: grafana
  118. # There is a special `confirmation` argument to help against accidental clicks
  119. # on "dangerous" actions.
  120. #
  121. # Docs: https://docs.olivetin.app/args/input_confirmation.html
  122. - title: Delete old backups
  123. icon: ashtonished
  124. justification: true
  125. shell: rm -rf /opt/oliveTinOldBackups/ && sleep 5
  126. arguments:
  127. - type: html
  128. title: Description
  129. default:
  130. The documentation for this action can be found at <a href = "example.com">example.com</a>.
  131. - type: confirmation
  132. title: Are you sure?!
  133. # This is an action that runs a script included with OliveTin, that will
  134. # download themes. You will still need to set theme "themeName" in your config.
  135. #
  136. # Docs: https://docs.olivetin.app/reference/reference_themes_for_users.html
  137. - title: Get OliveTin Theme
  138. exec:
  139. - "olivetin-get-theme"
  140. - "{{ themeGitRepo }}"
  141. - "{{ themeFolderName }}"
  142. icon: theme
  143. arguments:
  144. - name: themeGitRepo
  145. title: Theme's Git Repository
  146. description: Find new themes at https://olivetin.app/themes
  147. type: url
  148. - name: themeFolderName
  149. title: Theme's Folder Name
  150. type: ascii_identifier
  151. # Sometimes you want to run actions on other servers - don't overcomplicate
  152. # it, just use SSH! OliveTin includes a helper to make this easier, which is
  153. # entirely optional. You can also setup SSH manually.
  154. #
  155. # Docs: https://docs.olivetin.app/action_examples/ssh-easy.html
  156. # Docs: https://docs.olivetin.app/action_examples/ssh-manual.html
  157. - title: "Setup easy SSH"
  158. icon: ssh
  159. shell: olivetin-setup-easy-ssh
  160. onclick: execution-dialog
  161. # Second webhook example: POST /webhooks?demo=setup-ssh
  162. execOnWebhook:
  163. - matchQuery:
  164. demo: setup-ssh
  165. # Here's how to use SSH with the "easy" config, to restart a service on
  166. # another server.
  167. #
  168. # Docs: https://docs.olivetin.app/action_examples/ssh-easy.html
  169. # Docs: https://docs.olivetin.app/action_examples/systemd_service.html
  170. - title: Restart httpd on server1
  171. id: restart_httpd
  172. icon: restart
  173. timeout: 1
  174. shell: ssh -F /config/ssh/easy.cfg root@server1 'service httpd restart'
  175. # There are several built-in shortcuts for the `icon` option, but you
  176. # can also just specify any HTML, this includes any unicode character,
  177. # or a <img = "..." /> link to a custom icon.
  178. #
  179. # Docs: https://docs.olivetin.app/action_customization/icons.html
  180. #
  181. # Lots of people use OliveTin to easily execute ansible-playbooks. You
  182. # probably want a much longer timeout as well (so that ansible completes).
  183. #
  184. # Docs: https://docs.olivetin.app/action_examples/ansible.html
  185. - title: "Run Automation Playbook"
  186. icon: '&#129302;'
  187. shell: ansible-playbook -i /etc/hosts /root/myRepo/myPlaybook.yaml
  188. timeout: 120
  189. # The following actions are "dummy" actions, used in a Dashboard. As long as
  190. # you have these referenced in a dashboard, they will not show up in the
  191. # `actions` view.
  192. - title: Ping hypervisor1
  193. shell: echo "hypervisor1 online"
  194. - title: Ping hypervisor2
  195. shell: echo "hypervisor2 online"
  196. - title: Ping hypervisor3
  197. shell: echo "hypervisor3 online"
  198. - title: Ping hypervisor4
  199. shell: echo "hypervisor4 online"
  200. - title: "{{ server.name }} Wake on Lan"
  201. shell: echo "Sending Wake on LAN to {{ server.hostname }}"
  202. icon: <iconify-icon icon="carbon:awake"></iconify-icon>
  203. entity: server
  204. - title: "{{ server.name }} Power Off"
  205. shell: "echo 'Power Off Server: {{ server.hostname }}'"
  206. icon: <iconify-icon icon="carbon:flash-off"></iconify-icon>
  207. entity: server
  208. - title: "{{ server.name }} Print server name"
  209. shell: 'echo "Server name: {{ server.name }}"'
  210. entity: server
  211. - title: Ping All Servers
  212. shell: "echo 'Ping all servers'"
  213. icon: ping
  214. # https://docs.olivetin.app/action_execution/onfilecreated.html
  215. # mkdir -p /tmp/olivetin-demo-file-created
  216. execOnFileCreatedInDir:
  217. - /tmp/olivetin-demo-file-created
  218. - title: Start {{ .CurrentEntity.Names }}
  219. icon: box
  220. shell: docker start {{ .CurrentEntity.Names }}
  221. entity: container
  222. triggers: ["Update container entity file"]
  223. - title: Stop {{ .CurrentEntity.Names }}
  224. icon: box
  225. shell: docker stop {{ .CurrentEntity.Names }}
  226. entity: container
  227. triggers: ["Update container entity file"]
  228. - title: Long running action
  229. shell: sleep 300
  230. timeout: 300
  231. icon: logs
  232. onclick: execution-dialog
  233. groups: [ con2queue10 ]
  234. execOnCron:
  235. - "@hourly"
  236. # Lastly, you can hide actions from the web UI, this is useful for creating
  237. # background helpers that execute only on startup or a cron, for updating
  238. # entity files.
  239. # - title: Update container entity file
  240. # shell: 'docker ps -a --format json > /etc/OliveTin/entities/containers.json'
  241. # hidden: true
  242. # execOnStartup: true
  243. # execOnCron: '*/1 * * * *'
  244. # An entity is something that exists - a "thing", like a VM, or a Container
  245. # is an entity. OliveTin allows you to then dynamically generate actions based
  246. # around these entities.
  247. #
  248. # This is really useful if you want to generate wake on lan or poweroff actions
  249. # for `server` entities, for example.
  250. #
  251. # A very popular use case that entities were designed for was for `container`
  252. # entities - in a similar way you could generate `start`, `stop`, and `restart`
  253. # container actions.
  254. #
  255. # Entities are just loaded fome files on disk, OliveTin will also watch these
  256. # files for updates while OliveTin is running, and update entities.
  257. #
  258. # Entities can have properties defined in those files, and those can be used
  259. # in your configuration as variables. For example; `container.status`,
  260. # or `vm.hostname`.
  261. #
  262. # Docs: https://docs.olivetin.app/entities/intro.html
  263. entities:
  264. # YAML files are the default expected format, so you can use .yml or .yaml,
  265. # or even .txt, as long as the file contains valid a valid yaml LIST, then it
  266. # will load properly.
  267. #
  268. # Docs: https://docs.olivetin.app/entities/intro.html
  269. - file: entities/servers.yaml
  270. name: server
  271. - file: entities/containers.json
  272. name: container
  273. # Action groups share a concurrency limit across multiple actions. When the
  274. # limit is reached, additional requests are queued and run in order.
  275. # Docs: https://docs.olivetin.app/action_customization/concurrency.html#action-groups
  276. actionGroups:
  277. backup-jobs:
  278. maxConcurrent: 1
  279. icon: backup
  280. con2queue10:
  281. maxConcurrent: 2
  282. queueSize: 10
  283. # Dashboards are a way of taking actions from the default "actions" view, and
  284. # organizing them into groups - either into folders, or fieldsets.
  285. #
  286. # The only way to properly use entities, are to use them with a `fieldset` on
  287. # a dashboard.
  288. #
  289. # Docs: https://docs.olivetin.app/dashboards/intro.html
  290. dashboards:
  291. # Top level items are dashboards.
  292. - title: My Servers
  293. contents:
  294. - title: All Servers
  295. type: fieldset
  296. contents:
  297. # The contents of a dashboard will try to look for an action with a
  298. # matching title IF the `contents: ` property is empty.
  299. - title: Ping All Servers
  300. # If you create an item with some "contents:", OliveTin will show that as
  301. # directory.
  302. - title: Hypervisors
  303. contents:
  304. - title: Ping hypervisor1
  305. - title: Ping hypervisor2
  306. - title: More hypervisors
  307. type: directory
  308. contents:
  309. - title: Ping hypervisor3
  310. - title: Ping hypervisor4
  311. # If you specify `type: fieldset` and some `contents`, it will show your
  312. # actions grouped together without a folder.
  313. - type: fieldset
  314. entity: server
  315. title: 'Server: {{ .CurrentEntity.hostname }}'
  316. contents:
  317. # By default OliveTin will look for an action with a matching title
  318. # and put it on the dashboard.
  319. #
  320. # Fieldsets also support `type: display`, which can display arbitary
  321. # text. This is useful for displaying things like a container's state.
  322. - type: display
  323. title: |
  324. Hostname: <strong>{{ server.name }}</strong>
  325. IP Address: <strong>{{ server.ip }}</strong>
  326. # These are the actions (defined above) that we want on the dashboard.
  327. - title: '{{ server.name }} Wake on Lan'
  328. - title: '{{ server.name }} Power Off'
  329. - title: More Options
  330. type: directory
  331. contents:
  332. - title: '{{ server.name }} Print server name'
  333. # This is the second dashboard.
  334. - title: My Containers
  335. contents:
  336. - title: 'Container {{ .CurrentEntity.Names }} ({{ .CurrentEntity.Image }})'
  337. entity: container
  338. type: fieldset
  339. contents:
  340. - type: display
  341. title: |
  342. {{ container.RunningFor }} <br /><br /><strong>{{ container.State }}</strong>
  343. - title: 'Start {{ .CurrentEntity.Names }}'
  344. - title: 'Stop {{ .CurrentEntity.Names }}'
  345. # Security - Authentication
  346. # This setting effectively enables or disables guests.
  347. # If set to "true", then users will have to login to do anything.
  348. authRequireGuestsToLogin: false
  349. # This form of auth is the simplest to setup - just define users and passwords
  350. # in the config. OliveTin also supports header-based auth, OAuth2,
  351. # and JWT authentication which are documented separately.
  352. #
  353. # Docs: https://docs.olivetin.app/security/local.html
  354. #
  355. # How to get a hashed password:
  356. # Docs: https://docs.olivetin.app/security/local.html#_get_a_argon2id_hashed_password
  357. authLocalUsers:
  358. enabled: true
  359. # users:
  360. # - username: alice
  361. # usergroup: admins
  362. # password: "$argon2id$v=19$m=65536,t=4,p=2$puyxA0s555TSFx7hnFLCXA$PyhLGpZtvpMMvc2DgMWkM8OJMKO55euwV5gm//1iwx4"
  363. # Security - Access Control
  364. # Policies affect the whole app (eg: ability to view the log list).
  365. # Docs: https://docs.olivetin.app/security/acl.html
  366. defaultPolicy:
  367. showDiagnostics: true
  368. showLogList: true
  369. # Permissions affect actions (eg: ability to view a specific log).
  370. # Docs: https://docs.olivetin.app/security/acl.html
  371. defaultPermissions:
  372. view: true
  373. exec: true
  374. logs: true
  375. # OliveTin uses access control lists to match up policy and permissions to users.
  376. # Docs: https://docs.olivetin.app/security/acl.html
  377. accessControlLists:
  378. - name: admin_acl
  379. matchUsergroups: ["admins"]
  380. policy:
  381. showDiagnostics: true
  382. permissions:
  383. view: true
  384. exec: true
  385. logs: true
  386. # OliveTin contains many more configuration options not in this default config.
  387. # Check out docs.olivetin.app for a setting if you feel like you're missing something.