config.yaml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  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. # Checklist arguments let users pick multiple predefined options. Selected
  134. # values are passed to the action as a comma-separated string.
  135. #
  136. # Docs: https://docs.olivetin.app/args/input_checklist.html
  137. - title: Backup selected directories
  138. icon: backup
  139. shell: 'echo "Backing up: {{ directories }}"'
  140. arguments:
  141. - name: directories
  142. title: Directories to back up
  143. type: checklist
  144. description: Select one or more directories to include in the backup.
  145. choices:
  146. - title: Documents
  147. value: documents
  148. - title: Photos
  149. value: photos
  150. - title: Music
  151. value: music
  152. - title: Videos
  153. value: videos
  154. default: documents,photos
  155. # This is an action that runs a script included with OliveTin, that will
  156. # download themes. You will still need to set theme "themeName" in your config.
  157. #
  158. # Docs: https://docs.olivetin.app/reference/reference_themes_for_users.html
  159. - title: Get OliveTin Theme
  160. exec:
  161. - "olivetin-get-theme"
  162. - "{{ themeGitRepo }}"
  163. - "{{ themeFolderName }}"
  164. icon: theme
  165. arguments:
  166. - name: themeGitRepo
  167. title: Theme's Git Repository
  168. description: Find new themes at https://olivetin.app/themes
  169. type: url
  170. - name: themeFolderName
  171. title: Theme's Folder Name
  172. type: ascii_identifier
  173. # Sometimes you want to run actions on other servers - don't overcomplicate
  174. # it, just use SSH! OliveTin includes a helper to make this easier, which is
  175. # entirely optional. You can also setup SSH manually.
  176. #
  177. # Docs: https://docs.olivetin.app/action_examples/ssh-easy.html
  178. # Docs: https://docs.olivetin.app/action_examples/ssh-manual.html
  179. - title: "Setup easy SSH"
  180. icon: ssh
  181. shell: olivetin-setup-easy-ssh
  182. onclick: execution-dialog
  183. # Second webhook example: POST /webhooks?demo=setup-ssh
  184. execOnWebhook:
  185. - matchQuery:
  186. demo: setup-ssh
  187. # Here's how to use SSH with the "easy" config, to restart a service on
  188. # another server.
  189. #
  190. # Docs: https://docs.olivetin.app/action_examples/ssh-easy.html
  191. # Docs: https://docs.olivetin.app/action_examples/systemd_service.html
  192. - title: Restart httpd on server1
  193. id: restart_httpd
  194. icon: restart
  195. timeout: 1
  196. shell: ssh -F /config/ssh/easy.cfg root@server1 'service httpd restart'
  197. # There are several built-in shortcuts for the `icon` option, but you
  198. # can also just specify any HTML, this includes any unicode character,
  199. # or a <img = "..." /> link to a custom icon.
  200. #
  201. # Docs: https://docs.olivetin.app/action_customization/icons.html
  202. #
  203. # Lots of people use OliveTin to easily execute ansible-playbooks. You
  204. # probably want a much longer timeout as well (so that ansible completes).
  205. #
  206. # Docs: https://docs.olivetin.app/action_examples/ansible.html
  207. - title: "Run Automation Playbook"
  208. icon: '&#129302;'
  209. shell: ansible-playbook -i /etc/hosts /root/myRepo/myPlaybook.yaml
  210. timeout: 120
  211. # The following actions are "dummy" actions, used in a Dashboard. As long as
  212. # you have these referenced in a dashboard, they will not show up in the
  213. # `actions` view.
  214. - title: Ping hypervisor1
  215. shell: echo "hypervisor1 online"
  216. - title: Ping hypervisor2
  217. shell: echo "hypervisor2 online"
  218. - title: Ping hypervisor3
  219. shell: echo "hypervisor3 online"
  220. - title: Ping hypervisor4
  221. shell: echo "hypervisor4 online"
  222. - title: "{{ server.name }} Wake on Lan"
  223. shell: echo "Sending Wake on LAN to {{ server.hostname }}"
  224. icon: <iconify-icon icon="carbon:awake"></iconify-icon>
  225. entity: server
  226. - title: "{{ server.name }} Power Off"
  227. shell: "echo 'Power Off Server: {{ server.hostname }}'"
  228. icon: <iconify-icon icon="carbon:flash-off"></iconify-icon>
  229. entity: server
  230. - title: "{{ server.name }} Print server name"
  231. shell: 'echo "Server name: {{ server.name }}"'
  232. entity: server
  233. - title: Ping All Servers
  234. shell: "echo 'Ping all servers'"
  235. icon: ping
  236. # https://docs.olivetin.app/action_execution/onfilecreated.html
  237. # mkdir -p /tmp/olivetin-demo-file-created
  238. execOnFileCreatedInDir:
  239. - /tmp/olivetin-demo-file-created
  240. - title: Start {{ .CurrentEntity.Names }}
  241. icon: box
  242. shell: docker start {{ .CurrentEntity.Names }}
  243. entity: container
  244. triggers: ["Update container entity file"]
  245. - title: Stop {{ .CurrentEntity.Names }}
  246. icon: box
  247. shell: docker stop {{ .CurrentEntity.Names }}
  248. entity: container
  249. triggers: ["Update container entity file"]
  250. - title: Long running action
  251. shell: sleep 300
  252. timeout: 300
  253. icon: logs
  254. onclick: execution-dialog
  255. groups: [ con2queue10 ]
  256. execOnCron:
  257. - "@hourly"
  258. # Lastly, you can hide actions from the web UI, this is useful for creating
  259. # background helpers that execute only on startup or a cron, for updating
  260. # entity files.
  261. # - title: Update container entity file
  262. # shell: 'docker ps -a --format json > /etc/OliveTin/entities/containers.json'
  263. # hidden: true
  264. # execOnStartup: true
  265. # execOnCron: '*/1 * * * *'
  266. # An entity is something that exists - a "thing", like a VM, or a Container
  267. # is an entity. OliveTin allows you to then dynamically generate actions based
  268. # around these entities.
  269. #
  270. # This is really useful if you want to generate wake on lan or poweroff actions
  271. # for `server` entities, for example.
  272. #
  273. # A very popular use case that entities were designed for was for `container`
  274. # entities - in a similar way you could generate `start`, `stop`, and `restart`
  275. # container actions.
  276. #
  277. # Entities are just loaded fome files on disk, OliveTin will also watch these
  278. # files for updates while OliveTin is running, and update entities.
  279. #
  280. # Entities can have properties defined in those files, and those can be used
  281. # in your configuration as variables. For example; `container.status`,
  282. # or `vm.hostname`.
  283. #
  284. # Docs: https://docs.olivetin.app/entities/intro.html
  285. entities:
  286. # YAML files are the default expected format, so you can use .yml or .yaml,
  287. # or even .txt, as long as the file contains valid a valid yaml LIST, then it
  288. # will load properly.
  289. #
  290. # Docs: https://docs.olivetin.app/entities/intro.html
  291. - file: entities/servers.yaml
  292. name: server
  293. - file: entities/containers.json
  294. name: container
  295. # Action groups share a concurrency limit across multiple actions. When the
  296. # limit is reached, additional requests are queued and run in order.
  297. # Docs: https://docs.olivetin.app/action_customization/concurrency.html#action-groups
  298. actionGroups:
  299. backup-jobs:
  300. maxConcurrent: 1
  301. icon: backup
  302. con2queue10:
  303. maxConcurrent: 2
  304. queueSize: 10
  305. # Dashboards are a way of taking actions from the default "actions" view, and
  306. # organizing them into groups - either into folders, or fieldsets.
  307. #
  308. # The only way to properly use entities, are to use them with a `fieldset` on
  309. # a dashboard.
  310. #
  311. # Docs: https://docs.olivetin.app/dashboards/intro.html
  312. dashboards:
  313. # Top level items are dashboards.
  314. - title: My Servers
  315. contents:
  316. - title: All Servers
  317. type: fieldset
  318. contents:
  319. # The contents of a dashboard will try to look for an action with a
  320. # matching title IF the `contents: ` property is empty.
  321. - title: Ping All Servers
  322. # If you create an item with some "contents:", OliveTin will show that as
  323. # directory.
  324. - title: Hypervisors
  325. contents:
  326. - title: Ping hypervisor1
  327. - title: Ping hypervisor2
  328. - title: More hypervisors
  329. type: directory
  330. contents:
  331. - title: Ping hypervisor3
  332. - title: Ping hypervisor4
  333. # If you specify `type: fieldset` and some `contents`, it will show your
  334. # actions grouped together without a folder.
  335. - type: fieldset
  336. entity: server
  337. title: 'Server: {{ .CurrentEntity.hostname }}'
  338. contents:
  339. # By default OliveTin will look for an action with a matching title
  340. # and put it on the dashboard.
  341. #
  342. # Fieldsets also support `type: display`, which can display arbitary
  343. # text. This is useful for displaying things like a container's state.
  344. - type: display
  345. title: |
  346. Hostname: <strong>{{ server.name }}</strong>
  347. IP Address: <strong>{{ server.ip }}</strong>
  348. # These are the actions (defined above) that we want on the dashboard.
  349. - title: '{{ server.name }} Wake on Lan'
  350. - title: '{{ server.name }} Power Off'
  351. - title: More Options
  352. type: directory
  353. contents:
  354. - title: '{{ server.name }} Print server name'
  355. # This is the second dashboard.
  356. - title: My Containers
  357. contents:
  358. - title: 'Container {{ .CurrentEntity.Names }} ({{ .CurrentEntity.Image }})'
  359. entity: container
  360. type: fieldset
  361. contents:
  362. - type: display
  363. title: |
  364. {{ container.RunningFor }} <br /><br /><strong>{{ container.State }}</strong>
  365. - title: 'Start {{ .CurrentEntity.Names }}'
  366. - title: 'Stop {{ .CurrentEntity.Names }}'
  367. # Security - Authentication
  368. # This setting effectively enables or disables guests.
  369. # If set to "true", then users will have to login to do anything.
  370. authRequireGuestsToLogin: false
  371. # This form of auth is the simplest to setup - just define users and passwords
  372. # in the config. OliveTin also supports header-based auth, OAuth2,
  373. # and JWT authentication which are documented separately.
  374. #
  375. # Docs: https://docs.olivetin.app/security/local.html
  376. #
  377. # How to get a hashed password:
  378. # Docs: https://docs.olivetin.app/security/local.html#_get_a_argon2id_hashed_password
  379. authLocalUsers:
  380. enabled: true
  381. # users:
  382. # - username: alice
  383. # usergroup: admins
  384. # password: "$argon2id$v=19$m=65536,t=4,p=2$puyxA0s555TSFx7hnFLCXA$PyhLGpZtvpMMvc2DgMWkM8OJMKO55euwV5gm//1iwx4"
  385. # Security - Access Control
  386. # Policies affect the whole app (eg: ability to view the log list).
  387. # Docs: https://docs.olivetin.app/security/acl.html
  388. defaultPolicy:
  389. showDiagnostics: true
  390. showLogList: true
  391. # Permissions affect actions (eg: ability to view a specific log).
  392. # Docs: https://docs.olivetin.app/security/acl.html
  393. defaultPermissions:
  394. view: true
  395. exec: true
  396. logs: true
  397. # OliveTin uses access control lists to match up policy and permissions to users.
  398. # Docs: https://docs.olivetin.app/security/acl.html
  399. accessControlLists:
  400. - name: admin_acl
  401. matchUsergroups: ["admins"]
  402. policy:
  403. showDiagnostics: true
  404. permissions:
  405. view: true
  406. exec: true
  407. logs: true
  408. # OliveTin contains many more configuration options not in this default config.
  409. # Check out docs.olivetin.app for a setting if you feel like you're missing something.