config.yaml 15 KB

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