From 3fac8699fcb4132501ad600fb0dd056b08f2b193 Mon Sep 17 00:00:00 2001 From: coolnsx Date: Mon, 30 Jun 2025 19:27:52 +0530 Subject: [PATCH] Feat: Immich Server --- .gitignore | 2 +- immich/env.example | 20 +++++++++++++++++++ immich/immich.container | 31 ++++++++++++++++++++++++++++++ immich/immich.pod | 12 ++++++++++++ immich/immich_db.container | 28 +++++++++++++++++++++++++++ immich/immich_ml.container | 28 +++++++++++++++++++++++++++ immich/immich_valkey.container | 19 ++++++++++++++++++ immich/readme.md | 13 +++++++++++++ opencloud/env.example | 2 ++ opencloud/opencloud_wopi.container | 2 ++ 10 files changed, 156 insertions(+), 1 deletion(-) create mode 100644 immich/env.example create mode 100644 immich/immich.container create mode 100644 immich/immich.pod create mode 100644 immich/immich_db.container create mode 100644 immich/immich_ml.container create mode 100644 immich/immich_valkey.container create mode 100644 immich/readme.md diff --git a/.gitignore b/.gitignore index 535f8eb..e620a3b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ .env -element-config.json +*config.json diff --git a/immich/env.example b/immich/env.example new file mode 100644 index 0000000..b4febee --- /dev/null +++ b/immich/env.example @@ -0,0 +1,20 @@ +# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables + +# The location where your uploaded files are stored +UPLOAD_LOCATION=/path/to/storage + +# List of comma-separated IPs set as trusted proxies +IMMICH_TRUSTED_PROXIES=100.100.100.1 + +# Redis +REDIS_SOCKET=/tmp/immich/valkey.sock + +# Postgres +DB_URL=postgresql://postgres:CHANGEMEASAP@localhost/immich?host=/tmp/immich/ + +DB_PASSWORD=CHANGEMEASAP + +# The values below this line do not need to be changed +################################################################################### +DB_USERNAME=postgres +DB_DATABASE_NAME=immich diff --git a/immich/immich.container b/immich/immich.container new file mode 100644 index 0000000..2c88f5b --- /dev/null +++ b/immich/immich.container @@ -0,0 +1,31 @@ +[Unit] +Description=Immich Container +Requires=immich_db.service immich_valkey.service +After=immich_db.service immich_valkey.service + +[Container] +Pod=immich.pod +ContainerName=immich +Image=ghcr.io/immich-app/immich-server:release + +# Enable auto-update container +AutoUpdate=registry +# pass this to attach it to container +EnvironmentFile=./.env + +Volume=${UPLOAD_LOCATION}:/usr/src/app/upload +Volume=/etc/localtime:/etc/localtime:ro + +# gpu acceleration +AddDevice=/dev/dri +GroupAdd=989 + +[Service] +# pass this to autofill above variables +EnvironmentFile=%h/.config/containers/systemd/immich/.env +Restart=always +TimeoutStartSec=300 + +[Install] +WantedBy=default.target + diff --git a/immich/immich.pod b/immich/immich.pod new file mode 100644 index 0000000..1cf1b98 --- /dev/null +++ b/immich/immich.pod @@ -0,0 +1,12 @@ +[Unit] +Description=Immich Pod + +[Pod] +PodName=immich +#PublishPort=2283:2283 +Network=host +Volume=%h/podman/immich/.socket:/tmp/immich + +# to satisfy immich bitch permissions problems +UIDMap=1000:0:1 +UIDMap=0:1:1000 diff --git a/immich/immich_db.container b/immich/immich_db.container new file mode 100644 index 0000000..bcd660a --- /dev/null +++ b/immich/immich_db.container @@ -0,0 +1,28 @@ +[Unit] +Description=Immich Database Container + +[Container] +Pod=immich.pod +ContainerName=immich_db +Image=ghcr.io/immich-app/postgres:17-vectorchord0.4.3 +Exec=postgres -c shared_preload_libraries=vchord -c unix_socket_directories='/var/run/postgresql/,/tmp/immich/' -c unix_socket_permissions=0770 -c shared_buffers=2GB -c work_mem=64MB -c effective_cache_size=4GB + +# Enable auto-update container +AutoUpdate=registry +# pass this to attach it to container +Environment=POSTGRES_PASSWORD=${DB_PASSWORD} +Environment=POSTGRES_USER=${DB_USERNAME} +Environment=POSTGRES_DB=${DB_DATABASE_NAME} +Environment=POSTGRES_INITDB_ARGS=--data-checksums + +Volume=%h/podman/immich/database:/var/lib/postgresql/data + +[Service] +# pass this to autofill above variables +EnvironmentFile=%h/.config/containers/systemd/immich/.env +Restart=always +TimeoutStartSec=300 + +[Install] +WantedBy=default.target + diff --git a/immich/immich_ml.container b/immich/immich_ml.container new file mode 100644 index 0000000..766d488 --- /dev/null +++ b/immich/immich_ml.container @@ -0,0 +1,28 @@ +[Unit] +Description=Immich Machine Learning Container + +[Container] +Pod=immich.pod +ContainerName=immich_ml +Image=ghcr.io/immich-app/immich-machine-learning:release + +# Enable auto-update container +AutoUpdate=registry +# pass this to attach it to container +EnvironmentFile=./.env + +Volume=%h/podman/immich/ml:/cache + +# gpu acceleration +AddDevice=/dev/dri +GroupAdd=989 + +[Service] +# pass this to autofill above variables +EnvironmentFile=%h/.config/containers/systemd/immich/.env +Restart=always +TimeoutStartSec=300 + +[Install] +WantedBy=default.target + diff --git a/immich/immich_valkey.container b/immich/immich_valkey.container new file mode 100644 index 0000000..c2ae450 --- /dev/null +++ b/immich/immich_valkey.container @@ -0,0 +1,19 @@ +[Unit] +Description=Immich Valkey Container + +[Container] +Pod=immich.pod +ContainerName=immich_valkey +Image=docker.io/valkey/valkey:alpine +Exec=--unixsocket /tmp/immich/valkey.sock --unixsocketperm 777 + +# Enable auto-update container +AutoUpdate=registry + +[Service] +Restart=always +TimeoutStartSec=300 + +[Install] +WantedBy=default.target + diff --git a/immich/readme.md b/immich/readme.md new file mode 100644 index 0000000..a6c31d4 --- /dev/null +++ b/immich/readme.md @@ -0,0 +1,13 @@ +# Immich + +- make required directory +```sh +mkdir ~/podman/immich/{ml,database} +mkdir ${UPLOAD_LOCATION} +``` + +- copy and modify env.example to .env +- change the URL for machine learning container in settings + +## Major Problem +- none diff --git a/opencloud/env.example b/opencloud/env.example index 24fb158..bb6ab1f 100644 --- a/opencloud/env.example +++ b/opencloud/env.example @@ -9,6 +9,8 @@ PROXY_HTTP_ADDR=0.0.0.0:9200 # do not use SSL between the reverse proxy and OpenCloud PROXY_TLS=false OC_INSECURE=true +OC_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD=false +OC_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD=false # email server (if configured) NOTIFICATIONS_SMTP_HOST= NOTIFICATIONS_SMTP_PORT= diff --git a/opencloud/opencloud_wopi.container b/opencloud/opencloud_wopi.container index a9a9b6b..0c76316 100644 --- a/opencloud/opencloud_wopi.container +++ b/opencloud/opencloud_wopi.container @@ -1,5 +1,7 @@ [Unit] Description=Opencloud WOPIServer Container +Requires=opencloud.service +After=opencloud.service [Container] Pod=opencloud.pod