2024-08-29 21:07:49 +00:00
|
|
|
module "photoprism" {
|
2023-08-07 18:37:19 +00:00
|
|
|
source = "./service"
|
|
|
|
|
|
|
|
name = "photoprism"
|
2024-06-28 19:37:45 +00:00
|
|
|
image = "photoprism/photoprism:240711"
|
2023-08-07 18:37:19 +00:00
|
|
|
image_pull_timeout = "10m"
|
2023-11-30 18:05:39 +00:00
|
|
|
# constraints = [{
|
|
|
|
# attribute = "$${meta.hw_transcode.type}"
|
|
|
|
# # operator = "is_set"
|
|
|
|
# value = "raspberry"
|
|
|
|
# }]
|
2024-03-23 04:09:19 +00:00
|
|
|
priority = 60
|
2023-08-07 18:37:19 +00:00
|
|
|
|
2023-11-30 18:05:39 +00:00
|
|
|
# docker_devices = [{
|
|
|
|
# host_path = "$${meta.hw_transcode.device}"
|
|
|
|
# container_path = "$${meta.hw_transcode.device}"
|
|
|
|
# }]
|
2023-08-07 18:37:19 +00:00
|
|
|
resources = {
|
2024-03-23 04:07:07 +00:00
|
|
|
cpu = 1500
|
2024-03-26 16:48:31 +00:00
|
|
|
memory = 2200
|
2023-08-07 18:37:19 +00:00
|
|
|
memory_max = 4000
|
|
|
|
}
|
|
|
|
sticky_disk = true
|
|
|
|
host_volumes = [
|
|
|
|
{
|
|
|
|
name = "photoprism-storage"
|
|
|
|
dest = "/photoprism-storage"
|
|
|
|
read_only = false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name = "photoprism-media"
|
|
|
|
dest = "/photoprism-media"
|
|
|
|
read_only = false
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
ingress = true
|
|
|
|
service_port = 2342
|
2023-08-24 19:36:47 +00:00
|
|
|
use_wesher = var.use_wesher
|
2023-08-07 18:37:19 +00:00
|
|
|
|
|
|
|
mysql_bootstrap = {
|
|
|
|
enabled = true
|
|
|
|
}
|
|
|
|
|
2024-08-29 21:07:49 +00:00
|
|
|
oidc_client_config = {
|
|
|
|
description = "Photoprism"
|
|
|
|
redirect_uris = [
|
|
|
|
"https://photoprism.thefij.rocks/api/v1/oidc/redirect",
|
|
|
|
]
|
|
|
|
scopes = ["openid", "email", "profile"]
|
|
|
|
}
|
|
|
|
|
2023-08-07 18:37:19 +00:00
|
|
|
env = {
|
|
|
|
PHOTOPRISM_DEBUG = true
|
|
|
|
# UI
|
|
|
|
PHOTOPRISM_SITE_CAPTION = "AI-Powered Photos App"
|
|
|
|
PHOTOPRISM_SITE_DESCRIPTION = "Fijolek home photos"
|
|
|
|
PHOTOPRISM_SITE_TITLE = "PhotoPrism"
|
2023-08-24 22:03:36 +00:00
|
|
|
PHOTOPRISM_SITE_URL = "https://photoprism.${var.base_hostname}/"
|
2023-08-07 18:37:19 +00:00
|
|
|
PHOTOPRISM_SPONSOR = "true"
|
|
|
|
# Worker config
|
2024-06-08 20:40:40 +00:00
|
|
|
PHOTOPRISM_WORKERS = 2
|
|
|
|
PHOTOPRISM_BACKUP_DATABASE = false
|
2023-08-07 18:37:19 +00:00
|
|
|
# Paths
|
|
|
|
PHOTOPRISM_ORIGINALS_PATH = "/photoprism-media/Library"
|
|
|
|
PHOTOPRISM_IMPORT_PATH = "/photoprism-media/Import"
|
|
|
|
PHOTOPRISM_STORAGE_PATH = "/photoprism-storage" # Storage PATH for generated files like cache and thumbnails
|
|
|
|
# Unix permissions
|
|
|
|
PHOTOPRISM_UID = 500
|
|
|
|
PHOTOPRISM_GID = 100
|
|
|
|
PHOTOPRISM_UMASK = 0000
|
2024-06-28 19:37:45 +00:00
|
|
|
# OIDC
|
|
|
|
PHOTOPRISM_OIDC_URI = "https://authelia.thefij.rocks"
|
|
|
|
PHOTOPRISM_OIDC_PROVIDER = "Authelia"
|
|
|
|
PHOTOPRISM_OIDC_REGISTER = true
|
2024-11-01 22:50:08 +00:00
|
|
|
PHOTOPRISM_OIDC_REDIRECT = true
|
2024-06-28 19:37:45 +00:00
|
|
|
PHOTOPRISM_OIDC_SCOPES = "openid email profile"
|
2023-08-07 18:37:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
templates = [
|
|
|
|
{
|
|
|
|
data = <<EOF
|
|
|
|
{{ with nomadVar "nomad/jobs/photoprism" -}}
|
|
|
|
PHOTOPRISM_ADMIN_USER={{ .admin_user }}
|
|
|
|
PHOTOPRISM_ADMIN_PASSWORD={{ .admin_password }}
|
|
|
|
PHOTOPRISM_DATABASE_DRIVER=mysql
|
|
|
|
PHOTOPRISM_DATABASE_NAME={{ .db_name }}
|
|
|
|
PHOTOPRISM_DATABASE_USER={{ .db_user }}
|
|
|
|
PHOTOPRISM_DATABASE_PASSWORD={{ .db_pass }}
|
|
|
|
PHOTOPRISM_DATABASE_SERVER=127.0.0.1:3306
|
|
|
|
{{- end }}
|
|
|
|
{{ if eq (env "meta.hw_transcode.type") "raspberry" -}}
|
|
|
|
PHOTOPRISM_FFMPEG_ENCODER=raspberry
|
|
|
|
PHOTOPRISM_FFMPEG_BUFFERS=64
|
|
|
|
{{ else if eq (env "meta.hw_transcode.type") "intel" -}}
|
|
|
|
PHOTOPRISM_FFMPEG_ENCODER=intel
|
|
|
|
PHOTOPRISM_INIT="intel tensorflow"
|
|
|
|
{{- end }}
|
2024-08-29 21:07:49 +00:00
|
|
|
{{ with nomadVar "secrets/authelia/photoprism" -}}
|
|
|
|
PHOTOPRISM_OIDC_CLIENT={{ .client_id }}
|
|
|
|
PHOTOPRISM_OIDC_SECRET={{ .secret }}
|
|
|
|
{{- end }}
|
2023-08-07 18:37:19 +00:00
|
|
|
EOF
|
|
|
|
dest_prefix = "$${NOMAD_SECRETS_DIR}/"
|
|
|
|
dest = "env"
|
|
|
|
env = true
|
|
|
|
mount = false
|
|
|
|
},
|
|
|
|
]
|
2024-10-02 18:28:24 +00:00
|
|
|
|
|
|
|
actions = [
|
|
|
|
{
|
|
|
|
name = "import"
|
|
|
|
command = "photoprism"
|
|
|
|
args = ["import", "/photoprism-media/Import"]
|
2024-10-08 17:09:31 +00:00
|
|
|
cron = "0 0 3 * * * *"
|
2024-10-02 18:28:24 +00:00
|
|
|
},
|
|
|
|
]
|
2023-08-07 18:37:19 +00:00
|
|
|
}
|