128 lines
4.3 KiB
Ruby
128 lines
4.3 KiB
Ruby
![]() |
name 'gallery'
|
||
|
|
||
|
###
|
||
|
# Cookbooks location
|
||
|
###
|
||
|
|
||
|
# ESH
|
||
|
default_source :chef_repo, '../cookbooks'
|
||
|
|
||
|
# Community
|
||
|
default_source :supermarket, 'https://supermarket.chef.io'
|
||
|
|
||
|
###
|
||
|
# Run List
|
||
|
###
|
||
|
|
||
|
run_list %w(
|
||
|
esh_photoprism::mariadb
|
||
|
esh_photoprism::system
|
||
|
esh_photoprism::undocker
|
||
|
)
|
||
|
|
||
|
###
|
||
|
# Attributes
|
||
|
###
|
||
|
|
||
|
###
|
||
|
# esh_writefreely
|
||
|
###
|
||
|
|
||
|
default['esh']['photoprism']['nginx']['ip_addr'] = '127.0.0.1'
|
||
|
default['esh']['photoprism']['nginx']['port'] = '2342'
|
||
|
|
||
|
default['esh']['photoprism']['docker']['url'] = 'docker.io/photoprism'
|
||
|
default['esh']['photoprism']['docker']['image'] = 'photoprism'
|
||
|
default['esh']['photoprism']['docker']['tag'] = '221118-jammy'
|
||
|
default['esh']['photoprism']['docker']['network'] = 'host'
|
||
|
|
||
|
PHOTOPRISM_ADMIN_USER = 'benoit'.freeze
|
||
|
PHOTOPRISM_ADMIN_PASSWORD = ''.freeze
|
||
|
PHOTOPRISM_AUTH_MODE = 'password'.freeze
|
||
|
PHOTOPRISM_SITE_URL = 'https://gallery.benpro.fr'.freeze
|
||
|
PHOTOPRISM_ORIGINALS_LIMIT = 5000
|
||
|
PHOTOPRISM_HTTP_COMPRESSION = 'gzip'.freeze
|
||
|
PHOTOPRISM_LOG_LEVEL = 'info'.freeze
|
||
|
PHOTOPRISM_READONLY = 'true'.freeze
|
||
|
PHOTOPRISM_EXPERIMENTAL = 'false'.freeze
|
||
|
PHOTOPRISM_DISABLE_CHOWN = 'true'.freeze
|
||
|
PHOTOPRISM_DISABLE_WEBDAV = 'true'.freeze
|
||
|
PHOTOPRISM_DISABLE_SETTINGS = 'false'.freeze
|
||
|
PHOTOPRISM_DISABLE_TENSORFLOW = 'false'.freeze
|
||
|
PHOTOPRISM_DISABLE_FACES = 'false'.freeze
|
||
|
PHOTOPRISM_DISABLE_CLASSIFICATION = 'false'.freeze
|
||
|
PHOTOPRISM_DISABLE_RAW = 'false'.freeze
|
||
|
PHOTOPRISM_RAW_PRESETS = 'false'.freeze
|
||
|
PHOTOPRISM_JPEG_QUALITY = 85
|
||
|
PHOTOPRISM_DETECT_NSFW = 'false'.freeze
|
||
|
PHOTOPRISM_UPLOAD_NSFW = 'true'.freeze
|
||
|
PHOTOPRISM_DATABASE_DRIVER = 'mysql'.freeze
|
||
|
PHOTOPRISM_DATABASE_SERVER = 'localhost:3306'.freeze
|
||
|
PHOTOPRISM_DATABASE_NAME = 'photoprism'.freeze
|
||
|
PHOTOPRISM_DATABASE_USER = 'photoprism'.freeze
|
||
|
PHOTOPRISM_DATABASE_PASSWORD = 'Enrage-Spring-Refill1'.freeze
|
||
|
PHOTOPRISM_SITE_CAPTION = 'Benpro Gallery'.freeze
|
||
|
PHOTOPRISM_SITE_DESCRIPTION = 'Benpro photos'.freeze
|
||
|
PHOTOPRISM_SITE_AUTHOR = 'benpro.fr'.freeze
|
||
|
PHOTOPRISM_INIT = 'tensorflow'.freeze
|
||
|
PHOTOPRISM_UID = 998
|
||
|
PHOTOPRISM_GID = 998
|
||
|
|
||
|
default['esh']['photoprism']['mariadb']['password'] = PHOTOPRISM_DATABASE_PASSWORD
|
||
|
|
||
|
default['esh']['photoprism']['docker']['env'] = [
|
||
|
"PHOTOPRISM_ADMIN_USER=#{PHOTOPRISM_ADMIN_USER}",
|
||
|
"PHOTOPRISM_ADMIN_PASSWORD=#{PHOTOPRISM_ADMIN_PASSWORD}",
|
||
|
"PHOTOPRISM_AUTH_MODE=#{PHOTOPRISM_AUTH_MODE}",
|
||
|
"PHOTOPRISM_SITE_URL=#{PHOTOPRISM_SITE_URL}",
|
||
|
"PHOTOPRISM_ORIGINALS_LIMIT=#{PHOTOPRISM_ORIGINALS_LIMIT}",
|
||
|
"PHOTOPRISM_HTTP_COMPRESSION=#{PHOTOPRISM_HTTP_COMPRESSION}",
|
||
|
"PHOTOPRISM_LOG_LEVEL=#{PHOTOPRISM_LOG_LEVEL}",
|
||
|
"PHOTOPRISM_READONLY=#{PHOTOPRISM_READONLY}",
|
||
|
"PHOTOPRISM_EXPERIMENTAL=#{PHOTOPRISM_EXPERIMENTAL}",
|
||
|
"PHOTOPRISM_DISABLE_CHOWN=#{PHOTOPRISM_DISABLE_CHOWN}",
|
||
|
"PHOTOPRISM_DISABLE_WEBDAV=#{PHOTOPRISM_DISABLE_WEBDAV}",
|
||
|
"PHOTOPRISM_DISABLE_SETTINGS=#{PHOTOPRISM_DISABLE_SETTINGS}",
|
||
|
"PHOTOPRISM_DISABLE_TENSORFLOW=#{PHOTOPRISM_DISABLE_TENSORFLOW}",
|
||
|
"PHOTOPRISM_DISABLE_FACES=#{PHOTOPRISM_DISABLE_FACES}",
|
||
|
"PHOTOPRISM_DISABLE_CLASSIFICATION=#{PHOTOPRISM_DISABLE_CLASSIFICATION}",
|
||
|
"PHOTOPRISM_DISABLE_RAW=#{PHOTOPRISM_DISABLE_RAW}",
|
||
|
"PHOTOPRISM_RAW_PRESETS=#{PHOTOPRISM_RAW_PRESETS}",
|
||
|
"PHOTOPRISM_JPEG_QUALITY=#{PHOTOPRISM_JPEG_QUALITY}",
|
||
|
"PHOTOPRISM_DETECT_NSFW=#{PHOTOPRISM_DETECT_NSFW}",
|
||
|
"PHOTOPRISM_UPLOAD_NSFW=#{PHOTOPRISM_UPLOAD_NSFW}",
|
||
|
"PHOTOPRISM_DATABASE_DRIVER=#{PHOTOPRISM_DATABASE_DRIVER}",
|
||
|
"PHOTOPRISM_DATABASE_SERVER=#{PHOTOPRISM_DATABASE_SERVER}",
|
||
|
"PHOTOPRISM_DATABASE_NAME=#{PHOTOPRISM_DATABASE_NAME}",
|
||
|
"PHOTOPRISM_DATABASE_USER=#{PHOTOPRISM_DATABASE_USER}",
|
||
|
"PHOTOPRISM_DATABASE_PASSWORD=#{PHOTOPRISM_DATABASE_PASSWORD}",
|
||
|
"PHOTOPRISM_SITE_CAPTION=#{PHOTOPRISM_SITE_CAPTION}",
|
||
|
"PHOTOPRISM_SITE_DESCRIPTION=#{PHOTOPRISM_SITE_DESCRIPTION}",
|
||
|
"PHOTOPRISM_SITE_AUTHOR=#{PHOTOPRISM_SITE_AUTHOR}",
|
||
|
"PHOTOPRISM_INIT=#{PHOTOPRISM_INIT}",
|
||
|
"PHOTOPRISM_UID=#{PHOTOPRISM_UID}",
|
||
|
"PHOTOPRISM_GID=#{PHOTOPRISM_GID}",
|
||
|
]
|
||
|
|
||
|
default['esh']['photoprism']['docker']['service'] = <<~EOT
|
||
|
[Unit]
|
||
|
Description=ESH Undockerized photoprism Service
|
||
|
After=network.target mariadb.service
|
||
|
Requires=mariadb.service
|
||
|
|
||
|
[Service]
|
||
|
Type=simple
|
||
|
ExecStart=/usr/bin/systemd-nspawn \
|
||
|
--oci-bundle=/var/lib/machines/photoprism \
|
||
|
--machine photoprism \
|
||
|
--hostname photoprism \
|
||
|
--bind=/var/lib/gallery-originals:/photoprism/originals \
|
||
|
--bind=/var/lib/gallery-storage:/photoprism/storage \
|
||
|
--resolv-conf=bind-stub \
|
||
|
--capability=CAP_SETUID
|
||
|
Restart=on-failure
|
||
|
|
||
|
[Install]
|
||
|
WantedBy=multi-user.target
|
||
|
EOT
|