config.yaml 16 KB

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