diff --git a/app/Models/Service.php b/app/Models/Service.php index 5de1a9745..cd8e578d6 100644 --- a/app/Models/Service.php +++ b/app/Models/Service.php @@ -171,7 +171,7 @@ public function extraFields() ], ]); } - $fields->put('Tolgee', $data); + $fields->put('Tolgee', $data->toArray()); break; case str($image)?->contains('logto'): $data = collect([]); @@ -195,7 +195,7 @@ public function extraFields() ], ]); } - $fields->put('Logto', $data); + $fields->put('Logto', $data->toArray()); break; case str($image)?->contains('unleash-server'): $data = collect([]); @@ -218,7 +218,7 @@ public function extraFields() ], ]); } - $fields->put('Unleash', $data); + $fields->put('Unleash', $data->toArray()); break; case str($image)?->contains('grafana'): $data = collect([]); @@ -241,7 +241,7 @@ public function extraFields() ], ]); } - $fields->put('Grafana', $data); + $fields->put('Grafana', $data->toArray()); break; case str($image)?->contains('directus'): $data = collect([]); @@ -267,7 +267,7 @@ public function extraFields() ], ]); } - $fields->put('Directus', $data); + $fields->put('Directus', $data->toArray()); break; case str($image)?->contains('kong'): $data = collect([]); @@ -370,7 +370,7 @@ public function extraFields() ], ]); } - $fields->put('Weblate', $data); + $fields->put('Weblate', $data->toArray()); break; case str($image)?->contains('meilisearch'): $data = collect([]); @@ -384,7 +384,7 @@ public function extraFields() ], ]); } - $fields->put('Meilisearch', $data); + $fields->put('Meilisearch', $data->toArray()); break; case str($image)?->contains('ghost'): $data = collect([]); @@ -444,7 +444,31 @@ public function extraFields() ]); } - $fields->put('Ghost', $data); + $fields->put('Ghost', $data->toArray()); + break; + default: + $data = collect([]); + $admin_user = $this->environment_variables()->where('key', 'SERVICE_USER_ADMIN')->first(); + $admin_password = $this->environment_variables()->where('key', 'SERVICE_PASSWORD_ADMIN')->first(); + $data = $data->merge([ + 'User' => [ + 'key' => 'SERVICE_USER_ADMIN', + 'value' => data_get($admin_user, 'value', 'admin'), + 'readonly' => true, + 'rules' => 'required', + ], + ]); + if ($admin_password) { + $data = $data->merge([ + 'Password' => [ + 'key' => 'SERVICE_PASSWORD_ADMIN', + 'value' => data_get($admin_password, 'value'), + 'rules' => 'required', + 'isPassword' => true, + ], + ]); + } + $fields->put('Admin', $data->toArray()); break; } } diff --git a/public/svgs/listmonk.svg b/public/svgs/listmonk.svg new file mode 100644 index 000000000..a4e5efd5f --- /dev/null +++ b/public/svgs/listmonk.svg @@ -0,0 +1,2 @@ + + diff --git a/templates/compose/listmonk.yaml b/templates/compose/listmonk.yaml new file mode 100644 index 000000000..faa70fce5 --- /dev/null +++ b/templates/compose/listmonk.yaml @@ -0,0 +1,56 @@ +# documentation: https://listmonk.app/ +# slogan: Self-hosted newsletter and mailing list manager +# tags: newsletter, mailing list, self-hosted, open source +# logo: svgs/listmonk.svg +# port: 9000 + +services: + listmonk: + image: listmonk/listmonk:latest + environment: + - SERVICE_FQDN_LISTMONK_9000 + - LISTMONK_app__address=0.0.0.0:9000 + - LISTMONK_db__host=postgres + - LISTMONK_db__name=listmonk + - LISTMONK_db__user=$SERVICE_USER_POSTGRES + - LISTMONK_db__password=$SERVICE_PASSWORD_POSTGRES + - LISTMONK_db__port=5432 + - LISTMONK_app__admin_username=admin + - LISTMONK_app__admin_password=$SERVICE_PASSWORD_ADMIN + - TZ=Etc/UTC + volumes: + - "listmonk-data:/listmonk/uploads" + depends_on: + postgres: + condition: service_healthy + healthcheck: + test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:9000"] + interval: 5s + timeout: 20s + retries: 10 + listmonk-initial-database-setup: + image: listmonk/listmonk:latest + command: "./listmonk --install --yes --idempotent" + restart: "no" + depends_on: + postgres: + condition: service_healthy + environment: + - LISTMONK_db__host=postgres + - LISTMONK_db__name=listmonk + - LISTMONK_db__user=$SERVICE_USER_POSTGRES + - LISTMONK_db__password=$SERVICE_PASSWORD_POSTGRES + - LISTMONK_db__port=5432 + postgres: + image: "postgres:latest" + environment: + - POSTGRES_DB=listmonk + - POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES + - POSTGRES_USER=$SERVICE_USER_POSTGRES + volumes: + - "pg-data:/var/lib/postgresql/data" + healthcheck: + test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] + interval: 5s + timeout: 20s + retries: 10 diff --git a/templates/service-templates.json b/templates/service-templates.json index d7fd23e4c..8c916e474 100644 --- a/templates/service-templates.json +++ b/templates/service-templates.json @@ -505,6 +505,20 @@ "minversion": "0.0.0", "port": "7512" }, + "listmonk": { + "documentation": "https:\/\/listmonk.app\/", + "slogan": "Self-hosted newsletter and mailing list manager", + "compose": "c2VydmljZXM6CiAgbGlzdG1vbms6CiAgICBpbWFnZTogJ2xpc3Rtb25rL2xpc3Rtb25rOmxhdGVzdCcKICAgIGVudmlyb25tZW50OgogICAgICAtIFNFUlZJQ0VfRlFETl9MSVNUTU9OS185MDAwCiAgICAgIC0gJ0xJU1RNT05LX2FwcF9fYWRkcmVzcz0wLjAuMC4wOjkwMDAnCiAgICAgIC0gTElTVE1PTktfZGJfX2hvc3Q9cG9zdGdyZXMKICAgICAgLSBMSVNUTU9OS19kYl9fbmFtZT1saXN0bW9uawogICAgICAtIExJU1RNT05LX2RiX191c2VyPSRTRVJWSUNFX1VTRVJfUE9TVEdSRVMKICAgICAgLSBMSVNUTU9OS19kYl9fcGFzc3dvcmQ9JFNFUlZJQ0VfUEFTU1dPUkRfUE9TVEdSRVMKICAgICAgLSBMSVNUTU9OS19kYl9fcG9ydD01NDMyCiAgICAgIC0gTElTVE1PTktfYXBwX19hZG1pbl91c2VybmFtZT1hZG1pbgogICAgICAtIExJU1RNT05LX2FwcF9fYWRtaW5fcGFzc3dvcmQ9JFNFUlZJQ0VfUEFTU1dPUkRfQURNSU4KICAgICAgLSBUWj1FdGMvVVRDCiAgICB2b2x1bWVzOgogICAgICAtICdsaXN0bW9uay1kYXRhOi9saXN0bW9uay91cGxvYWRzJwogICAgZGVwZW5kc19vbjoKICAgICAgcG9zdGdyZXM6CiAgICAgICAgY29uZGl0aW9uOiBzZXJ2aWNlX2hlYWx0aHkKICAgIGhlYWx0aGNoZW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sL2RhdGEnCiAgICBoZWFsdGhjaGVjazoKICAgICAgdGVzdDoKICAgICAgICAtIENNRC1TSEVMTAogICAgICAgIC0gJ3BnX2lzcmVhZHkgLVUgJCR7UE9TVEdSRVNfVVNFUn0gLWQgJCR7UE9TVEdSRVNfREJ9JwogICAgICBpbnRlcnZhbDogNXMKICAgICAgdGltZW91dDogMjBzCiAgICAgIHJldHJpZXM6IDEwCg==", + "tags": [ + "newsletter", + "mailing list", + "self-hosted", + "open source" + ], + "logo": "svgs\/listmonk.svg", + "minversion": "0.0.0", + "port": "9000" + }, "logto": { "documentation": "https:\/\/docs.logto.io\/docs\/tutorials\/get-started\/#logto-oss-self-hosted", "slogan": "Logto offers a comprehensive identity solution covering both the front and backend, complete with pre-built infrastructure and enterprise-grade solutions.",