4
0

config.yaml 16 KB

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