config.yaml 14 KB

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