4
0

config.yaml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. # =============================================================================
  2. # OliveTin example configuration — macOS (Apple Silicon & Intel)
  3. # =============================================================================
  4. #
  5. # This is a macOS-flavoured version of the stock `example.config.yaml`. Every
  6. # action that differs from the Linux example carries a `# Linux equivalent:`
  7. # comment so you can see exactly what was changed and why.
  8. #
  9. # All commands here are tested against macOS with /bin/zsh (the default login
  10. # shell since macOS Catalina) and also work under /bin/bash. OliveTin runs the
  11. # `shell:` string with `sh -c` by default, so these are written to be portable
  12. # POSIX/zsh/bash one-liners.
  13. #
  14. # To use this file, copy it next to the OliveTin binary as `config.yaml`:
  15. # cp ./var/macos/config.yaml config.yaml
  16. # ./OliveTin
  17. #
  18. # Docs: https://docs.olivetin.app/
  19. # =============================================================================
  20. # The built-in micro proxy hosts the WebUI and REST API on a single port.
  21. # Listen on all addresses, port 1337. Open http://localhost:1337 after start.
  22. listenAddressSingleHTTPFrontend: 0.0.0.0:1337
  23. # Choose from INFO (default), WARN and DEBUG.
  24. # Docs: https://docs.olivetin.app/advanced_configuration/logs.html
  25. logLevel: "INFO"
  26. # Actions are commands that OliveTin executes, normally shown as buttons.
  27. # Docs: https://docs.olivetin.app/action_execution/create_your_first.html
  28. actions:
  29. # The simplest possible action: run a command, flash the button for status.
  30. # `ping` works identically on macOS and Linux.
  31. - title: Ping the Internet
  32. acls: [guest_actions]
  33. shell: ping -c 3 1.1.1.1
  34. icon: ping
  35. popupOnStart: execution-dialog-stdout-only
  36. execOnStartup: true
  37. # Show just the command output in a popup.
  38. #
  39. # Linux equivalent: shell: df -h /media
  40. # macOS has no /media mountpoint. The root volume is `/`; external/USB disks
  41. # mount under /Volumes. `df -h /` shows the boot disk; drop the path to list
  42. # every mounted volume.
  43. - title: Check disk space
  44. acls: [guest_actions]
  45. icon: disk
  46. shell: df -h /
  47. popupOnStart: execution-dialog-stdout-only
  48. # Show a fuller dialog with details about the command that ran.
  49. #
  50. # Linux equivalent: shell: dmesg | tail
  51. # macOS `dmesg` requires root and is rarely useful. The unified logging
  52. # system is the macOS way to read kernel/system messages. This shows the
  53. # last 2 minutes of high-level system log entries.
  54. - title: Recent system log
  55. shell: log show --last 2m --style compact | tail -n 40
  56. icon: logs
  57. popupOnStart: execution-dialog
  58. # A mini button that links to the logs, with rate limiting and an hourly cron.
  59. # `date` is identical across platforms.
  60. - title: date
  61. acls: [guest_actions]
  62. shell: date
  63. id: date
  64. timeout: 6
  65. icon: clock
  66. popupOnStart: execution-button
  67. maxRate:
  68. - limit: 3
  69. duration: 1m
  70. execOnCron:
  71. - "@hourly"
  72. # ---------------------------------------------------------------------------
  73. # macOS-native actions (no Linux equivalent — these showcase the platform)
  74. # ---------------------------------------------------------------------------
  75. # Send a real macOS Notification Center banner via AppleScript.
  76. - title: Send a notification
  77. icon: '🔔' # bell
  78. shell: osascript -e 'display notification "Triggered from OliveTin" with title "OliveTin" sound name "Glass"'
  79. popupOnStart: execution-button
  80. # Stop the Mac from sleeping for 1 hour (handy during long jobs/downloads).
  81. # `caffeinate` is a built-in macOS utility. `-t` is seconds.
  82. - title: Keep awake for 1 hour
  83. icon: '☕' # hot beverage
  84. shell: caffeinate -d -i -t 3600 &
  85. popupOnStart: execution-button
  86. # Put the displays to sleep immediately (the Mac stays running).
  87. - title: Sleep the displays
  88. icon: '💤' # zzz
  89. shell: pmset displaysleepnow
  90. popupOnStart: execution-button
  91. # Battery / power summary using the built-in `pmset`.
  92. - title: Power & battery status
  93. acls: [guest_actions]
  94. icon: '🔋' # battery
  95. shell: pmset -g batt
  96. popupOnStart: execution-dialog-stdout-only
  97. # ---------------------------------------------------------------------------
  98. # Prompt the user for input with `arguments`. `ping` again works as-is.
  99. # Docs: https://docs.olivetin.app/action_examples/ping.html
  100. - title: Ping host
  101. acls: [guest_actions]
  102. id: ping_host
  103. shell: ping {{ host }} -c {{ count }}
  104. icon: ping
  105. timeout: 100
  106. popupOnStart: execution-dialog-stdout-only
  107. arguments:
  108. - name: host
  109. title: Host
  110. type: ascii_identifier
  111. default: example.com
  112. description: The host that you want to ping
  113. - name: count
  114. title: Count
  115. type: int
  116. default: 3
  117. description: How many times do you want to ping?
  118. # OliveTin can control Docker containers — `docker` is just a CLI app.
  119. # On macOS this requires Docker Desktop (or colima/podman) to be installed
  120. # and running. The command itself is identical to Linux.
  121. # Docs: https://docs.olivetin.app/solutions/container-control-panel/index.html
  122. - title: Restart Docker Container
  123. icon: restart
  124. shell: docker restart {{ container }}
  125. arguments:
  126. - name: container
  127. title: Container name
  128. choices:
  129. - value: plex
  130. - value: traefik
  131. - value: grafana
  132. # The special `confirmation` argument guards against accidental clicks.
  133. # Docs: https://docs.olivetin.app/args/input_confirmation.html
  134. #
  135. # Linux equivalent: shell: rm -rf /opt/oldBackups/
  136. # Using a path under the user's home is more natural on macOS.
  137. - title: Delete old backups
  138. icon: ashtonished
  139. justification: " "
  140. shell: rm -rf "$HOME/Backups/old/"
  141. arguments:
  142. - name: confirm
  143. type: confirmation
  144. title: Are you sure?!
  145. # Run your own scripts, not just OS commands. `maxConcurrent` prevents
  146. # parallel runs; `timeout` kills a command that runs too long.
  147. #
  148. # Linux equivalent: shell: /opt/backupScript.sh
  149. # macOS convention is to keep personal scripts under your home directory.
  150. - title: Run backup script
  151. shell: "$HOME/bin/backupScript.sh"
  152. shellAfterCompleted: "osascript -e 'display notification \"Backup finished with code {{ exitCode }}\" with title \"OliveTin\"'"
  153. maxConcurrent: 1
  154. timeout: 10
  155. icon: backup
  156. popupOnStart: execution-dialog
  157. # Download themes using a script bundled with OliveTin. You still need to set
  158. # `themeName` in this config to actually use the theme.
  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. # Run actions on other servers over SSH. macOS ships with an OpenSSH client,
  175. # so this works out of the box. The helper below is optional.
  176. # Docs: https://docs.olivetin.app/action_examples/ssh-easy.html
  177. - title: "Setup easy SSH"
  178. icon: ssh
  179. shell: olivetin-setup-easy-ssh
  180. popupOnStart: execution-dialog
  181. # Entities let you generate actions dynamically from "things" (servers,
  182. # containers, VMs) loaded from files on disk.
  183. # Docs: https://docs.olivetin.app/entities/intro.html
  184. #
  185. # entities:
  186. # - file: entities/servers.yaml
  187. # name: server
  188. # Dashboards organise actions into folders and fieldsets.
  189. # Docs: https://docs.olivetin.app/dashboards/intro.html
  190. #
  191. # dashboards:
  192. # - title: My Mac
  193. # contents:
  194. # - title: Power & battery status
  195. # - title: Sleep the displays
  196. # =============================================================================
  197. # Security - Authentication
  198. # =============================================================================
  199. # If "true", users must log in before doing anything.
  200. authRequireGuestsToLogin: false
  201. # The simplest auth: define users/passwords in this config. OliveTin also
  202. # supports header-based auth, OAuth2 and JWT (documented separately).
  203. # Docs: https://docs.olivetin.app/security/local.html
  204. #
  205. # Generating an argon2id hash on macOS:
  206. # brew install argon2
  207. # echo -n 'yourPassword' | argon2 "$(openssl rand -base64 16)" -id -e
  208. # (Linux equivalent typically uses the distro's `argon2` package directly.)
  209. authLocalUsers:
  210. enabled: true
  211. # users:
  212. # - username: alice
  213. # usergroup: admins
  214. # password: "$argon2id$v=19$m=65536,t=4,p=2$puyxA0s555TSFx7hnFLCXA$PyhLGpZtvpMMvc2DgMWkM8OJMKO55euwV5gm//1iwx4"
  215. # =============================================================================
  216. # Security - Access Control
  217. # =============================================================================
  218. # Policies affect the whole app (eg: ability to view the log list).
  219. # Docs: https://docs.olivetin.app/security/acl.html
  220. defaultPolicy:
  221. showDiagnostics: true
  222. showLogList: true
  223. # Permissions affect individual actions.
  224. #
  225. # Guests can see every action, but can only run the harmless demo actions that
  226. # carry `acls: [guest_actions]`. Everything else needs a user in the "admins"
  227. # usergroup. Only give guests actions that you are happy for anyone who can
  228. # reach OliveTin to run.
  229. # Docs: https://docs.olivetin.app/security/acl.html
  230. defaultPermissions:
  231. view: true
  232. exec: false
  233. logs: false
  234. kill: false
  235. # OliveTin uses access control lists to match up policy and permissions to users.
  236. # Docs: https://docs.olivetin.app/security/acl.html
  237. accessControlLists:
  238. # Admins can do everything with every action.
  239. - name: admin_acl
  240. matchUsergroups: ["admins"]
  241. addToEveryAction: true
  242. policy:
  243. showDiagnostics: true
  244. permissions:
  245. view: true
  246. exec: true
  247. logs: true
  248. kill: true
  249. # Guests can run the demo actions that list this ACL. Add your own
  250. # usergroups here to let logged in users run them too.
  251. - name: guest_actions
  252. matchUsergroups: ["guest"]
  253. permissions:
  254. view: true
  255. exec: true
  256. logs: true
  257. kill: true
  258. # Actions started by execOnStartup, execOnCron, execOnWebhook and the other
  259. # triggers run as the "system" usergroup. Triggers only start the actions
  260. # you configured them on.
  261. - name: system_triggers
  262. matchUsergroups: ["system"]
  263. addToEveryAction: true
  264. permissions:
  265. exec: true
  266. # OliveTin has many more options not shown here. See docs.olivetin.app.