config.yaml 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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. shell: ping -c 3 1.1.1.1
  33. icon: ping
  34. popupOnStart: execution-dialog-stdout-only
  35. execOnStartup: true
  36. # Show just the command output in a popup.
  37. #
  38. # Linux equivalent: shell: df -h /media
  39. # macOS has no /media mountpoint. The root volume is `/`; external/USB disks
  40. # mount under /Volumes. `df -h /` shows the boot disk; drop the path to list
  41. # every mounted volume.
  42. - title: Check disk space
  43. icon: disk
  44. shell: df -h /
  45. popupOnStart: execution-dialog-stdout-only
  46. # Show a fuller dialog with details about the command that ran.
  47. #
  48. # Linux equivalent: shell: dmesg | tail
  49. # macOS `dmesg` requires root and is rarely useful. The unified logging
  50. # system is the macOS way to read kernel/system messages. This shows the
  51. # last 2 minutes of high-level system log entries.
  52. - title: Recent system log
  53. shell: log show --last 2m --style compact | tail -n 40
  54. icon: logs
  55. popupOnStart: execution-dialog
  56. # A mini button that links to the logs, with rate limiting and an hourly cron.
  57. # `date` is identical across platforms.
  58. - title: date
  59. shell: date
  60. id: date
  61. timeout: 6
  62. icon: clock
  63. popupOnStart: execution-button
  64. maxRate:
  65. - limit: 3
  66. duration: 1m
  67. execOnCron:
  68. - "@hourly"
  69. # ---------------------------------------------------------------------------
  70. # macOS-native actions (no Linux equivalent — these showcase the platform)
  71. # ---------------------------------------------------------------------------
  72. # Send a real macOS Notification Center banner via AppleScript.
  73. - title: Send a notification
  74. icon: '🔔' # bell
  75. shell: osascript -e 'display notification "Triggered from OliveTin" with title "OliveTin" sound name "Glass"'
  76. popupOnStart: execution-button
  77. # Stop the Mac from sleeping for 1 hour (handy during long jobs/downloads).
  78. # `caffeinate` is a built-in macOS utility. `-t` is seconds.
  79. - title: Keep awake for 1 hour
  80. icon: '☕' # hot beverage
  81. shell: caffeinate -d -i -t 3600 &
  82. popupOnStart: execution-button
  83. # Put the displays to sleep immediately (the Mac stays running).
  84. - title: Sleep the displays
  85. icon: '💤' # zzz
  86. shell: pmset displaysleepnow
  87. popupOnStart: execution-button
  88. # Battery / power summary using the built-in `pmset`.
  89. - title: Power & battery status
  90. icon: '🔋' # battery
  91. shell: pmset -g batt
  92. popupOnStart: execution-dialog-stdout-only
  93. # ---------------------------------------------------------------------------
  94. # Prompt the user for input with `arguments`. `ping` again works as-is.
  95. # Docs: https://docs.olivetin.app/action_examples/ping.html
  96. - title: Ping host
  97. id: ping_host
  98. shell: ping {{ host }} -c {{ count }}
  99. icon: ping
  100. timeout: 100
  101. popupOnStart: execution-dialog-stdout-only
  102. arguments:
  103. - name: host
  104. title: Host
  105. type: ascii_identifier
  106. default: example.com
  107. description: The host that you want to ping
  108. - name: count
  109. title: Count
  110. type: int
  111. default: 3
  112. description: How many times do you want to ping?
  113. # OliveTin can control Docker containers — `docker` is just a CLI app.
  114. # On macOS this requires Docker Desktop (or colima/podman) to be installed
  115. # and running. The command itself is identical to Linux.
  116. # Docs: https://docs.olivetin.app/solutions/container-control-panel/index.html
  117. - title: Restart Docker Container
  118. icon: restart
  119. shell: docker restart {{ container }}
  120. arguments:
  121. - name: container
  122. title: Container name
  123. choices:
  124. - value: plex
  125. - value: traefik
  126. - value: grafana
  127. # The special `confirmation` argument guards against accidental clicks.
  128. # Docs: https://docs.olivetin.app/args/input_confirmation.html
  129. #
  130. # Linux equivalent: shell: rm -rf /opt/oldBackups/
  131. # Using a path under the user's home is more natural on macOS.
  132. - title: Delete old backups
  133. icon: ashtonished
  134. justification: true
  135. shell: rm -rf "$HOME/Backups/old/"
  136. arguments:
  137. - name: confirm
  138. type: confirmation
  139. title: Are you sure?!
  140. # Run your own scripts, not just OS commands. `maxConcurrent` prevents
  141. # parallel runs; `timeout` kills a command that runs too long.
  142. #
  143. # Linux equivalent: shell: /opt/backupScript.sh
  144. # macOS convention is to keep personal scripts under your home directory.
  145. - title: Run backup script
  146. shell: "$HOME/bin/backupScript.sh"
  147. shellAfterCompleted: "osascript -e 'display notification \"Backup finished with code {{ exitCode }}\" with title \"OliveTin\"'"
  148. maxConcurrent: 1
  149. timeout: 10
  150. icon: backup
  151. popupOnStart: execution-dialog
  152. # Download themes using a script bundled with OliveTin. You still need to set
  153. # `themeName` in this config to actually use the theme.
  154. # Docs: https://docs.olivetin.app/reference/reference_themes_for_users.html
  155. - title: Get OliveTin Theme
  156. exec:
  157. - "olivetin-get-theme"
  158. - "{{ themeGitRepo }}"
  159. - "{{ themeFolderName }}"
  160. icon: theme
  161. arguments:
  162. - name: themeGitRepo
  163. title: Theme's Git Repository
  164. description: Find new themes at https://olivetin.app/themes
  165. type: url
  166. - name: themeFolderName
  167. title: Theme's Folder Name
  168. type: ascii_identifier
  169. # Run actions on other servers over SSH. macOS ships with an OpenSSH client,
  170. # so this works out of the box. The helper below is optional.
  171. # Docs: https://docs.olivetin.app/action_examples/ssh-easy.html
  172. - title: "Setup easy SSH"
  173. icon: ssh
  174. shell: olivetin-setup-easy-ssh
  175. popupOnStart: execution-dialog
  176. # Entities let you generate actions dynamically from "things" (servers,
  177. # containers, VMs) loaded from files on disk.
  178. # Docs: https://docs.olivetin.app/entities/intro.html
  179. #
  180. # entities:
  181. # - file: entities/servers.yaml
  182. # name: server
  183. # Dashboards organise actions into folders and fieldsets.
  184. # Docs: https://docs.olivetin.app/dashboards/intro.html
  185. #
  186. # dashboards:
  187. # - title: My Mac
  188. # contents:
  189. # - title: Power & battery status
  190. # - title: Sleep the displays
  191. # =============================================================================
  192. # Security - Authentication
  193. # =============================================================================
  194. # If "true", users must log in before doing anything.
  195. authRequireGuestsToLogin: false
  196. # The simplest auth: define users/passwords in this config. OliveTin also
  197. # supports header-based auth, OAuth2 and JWT (documented separately).
  198. # Docs: https://docs.olivetin.app/security/local.html
  199. #
  200. # Generating an argon2id hash on macOS:
  201. # brew install argon2
  202. # echo -n 'yourPassword' | argon2 "$(openssl rand -base64 16)" -id -e
  203. # (Linux equivalent typically uses the distro's `argon2` package directly.)
  204. authLocalUsers:
  205. enabled: true
  206. # users:
  207. # - username: alice
  208. # usergroup: admins
  209. # password: "$argon2id$v=19$m=65536,t=4,p=2$puyxA0s555TSFx7hnFLCXA$PyhLGpZtvpMMvc2DgMWkM8OJMKO55euwV5gm//1iwx4"
  210. # =============================================================================
  211. # Security - Access Control
  212. # =============================================================================
  213. # Policies affect the whole app (eg: ability to view the log list).
  214. # Docs: https://docs.olivetin.app/security/acl.html
  215. defaultPolicy:
  216. showDiagnostics: true
  217. showLogList: true
  218. # Permissions affect individual actions.
  219. defaultPermissions:
  220. view: true
  221. exec: true
  222. logs: true
  223. # ACLs match policy/permissions to users.
  224. accessControlLists:
  225. - name: admin_acl
  226. matchUsergroups: ["admins"]
  227. policy:
  228. showDiagnostics: true
  229. permissions:
  230. view: true
  231. exec: true
  232. logs: true
  233. # OliveTin has many more options not shown here. See docs.olivetin.app.