feat: implement notifications and admin notification api

This commit is contained in:
2026-06-01 12:11:14 -04:00
parent 89394795e5
commit 07dea33680
11 changed files with 757 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "immich_notifications Data Source - immich"
subcategory: ""
description: |-
Retrieves a list of notifications for the current user.
---
# immich_notifications (Data Source)
Retrieves a list of notifications for the current user.
## Example Usage
```terraform
data "immich_notifications" "my_unread" {
unread_only = true
}
output "unread_notifications" {
value = data.immich_notifications.my_unread.notifications
}
```
<!-- schema generated by tfplugindocs -->
## Schema
### Optional
- `unread_only` (Boolean) Filter for only unread notifications.
### Read-Only
- `notifications` (Attributes List) List of notifications. (see [below for nested schema](#nestedatt--notifications))
<a id="nestedatt--notifications"></a>
### Nested Schema for `notifications`
Read-Only:
- `created_at` (String) Timestamp when the notification was created.
- `description` (String) Notification message body.
- `id` (String) Unique identifier for the notification.
- `level` (String) Severity level.
- `title` (String) Notification title.
- `type` (String) Type of notification.
+36
View File
@@ -0,0 +1,36 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "immich_admin_notification Resource - immich"
subcategory: ""
description: |-
Sends a system-wide notification as an administrator. Note: This resource triggers a notification upon creation. Deleting the resource will attempt to remove the notification.
---
# immich_admin_notification (Resource)
Sends a system-wide notification as an administrator. Note: This resource triggers a notification upon creation. Deleting the resource will attempt to remove the notification.
## Example Usage
```terraform
resource "immich_admin_notification" "announcement" {
type = "SYSTEM"
level = "INFO"
title = "Maintenance Scheduled"
description = "Immich will be down for maintenance on Sunday at 2 AM UTC."
}
```
<!-- schema generated by tfplugindocs -->
## Schema
### Required
- `description` (String) Notification message body.
- `level` (String) Severity level (`INFO`, `WARNING`, `ERROR`).
- `title` (String) Notification title.
- `type` (String) Type of notification (e.g. `SYSTEM`).
### Read-Only
- `id` (String) Unique identifier for the created notification.
+61
View File
@@ -37,6 +37,24 @@ resource "immich_system_config" "example" {
url = "http://immich-machine-learning:3003"
clip_model = "ViT-L-14__openai"
}
notifications = {
smtp = {
enabled = true
host = "smtp.example.com"
port = 587
username = "user@example.com"
password = "secure-smtp-password"
from = "immich@example.com"
secure = true
}
}
templates = {
email = {
welcome_template = "Welcome to Immich, {{name}}!"
}
}
}
```
@@ -46,9 +64,11 @@ resource "immich_system_config" "example" {
### Optional
- `machine_learning` (Attributes) (see [below for nested schema](#nestedatt--machine_learning))
- `notifications` (Attributes) (see [below for nested schema](#nestedatt--notifications))
- `oauth` (Attributes) (see [below for nested schema](#nestedatt--oauth))
- `password_login` (Attributes) (see [below for nested schema](#nestedatt--password_login))
- `storage_template` (Attributes) (see [below for nested schema](#nestedatt--storage_template))
- `templates` (Attributes) (see [below for nested schema](#nestedatt--templates))
<a id="nestedatt--machine_learning"></a>
### Nested Schema for `machine_learning`
@@ -61,6 +81,30 @@ Optional:
- `url` (String) URL of the machine learning server.
<a id="nestedatt--notifications"></a>
### Nested Schema for `notifications`
Optional:
- `smtp` (Attributes) (see [below for nested schema](#nestedatt--notifications--smtp))
<a id="nestedatt--notifications--smtp"></a>
### Nested Schema for `notifications.smtp`
Optional:
- `enabled` (Boolean) Enable SMTP email notifications.
- `from` (String) Sender email address.
- `host` (String) SMTP server hostname.
- `ignore_cert` (Boolean) Whether to ignore certificate validation errors.
- `password` (String, Sensitive) SMTP authentication password.
- `port` (Number) SMTP server port.
- `reply_to` (String) Reply-to email address.
- `secure` (Boolean) Whether to use TLS/SSL.
- `username` (String) SMTP authentication username.
<a id="nestedatt--oauth"></a>
### Nested Schema for `oauth`
@@ -94,3 +138,20 @@ Optional:
Optional:
- `template` (String) Storage template (e.g. `{{y}}/{{y}}-{{m}}-{{d}}/{{filename}}`).
<a id="nestedatt--templates"></a>
### Nested Schema for `templates`
Optional:
- `email` (Attributes) (see [below for nested schema](#nestedatt--templates--email))
<a id="nestedatt--templates--email"></a>
### Nested Schema for `templates.email`
Optional:
- `album_invite_template` (String) Email template for album invitations.
- `album_update_template` (String) Email template for album updates.
- `welcome_template` (String) Email template for welcome emails.