From 301a199172ed9a6b502658b1b7459f57b2b12ce7 Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Tue, 31 Oct 2023 08:29:52 +0100 Subject: [PATCH 1/4] Enable allow_email and add a post install doc (#39) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Enable allow_email and add post install doc * WIP post config with API * Auto-update README * tests: add missing args for upgrade from * tests: add missing args for upgrade from² --------- Co-authored-by: yunohost-bot --- README.md | 1 - README_fr.md | 1 - doc/POST_INSTALL.md | 16 ++++++++++++++++ manifest.toml | 12 ++++++++---- scripts/_common.sh | 23 +++++++++++++++++++++++ tests.toml | 3 +++ 6 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 doc/POST_INSTALL.md diff --git a/README.md b/README.md index db5d485..58eee85 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,6 @@ Listmonk is a standalone, self-hosted, newsletter and mailing list manager. It i * Official app website: * Official admin documentation: * Upstream app code repository: -* YunoHost documentation for this app: * Report a bug: ## Developer info diff --git a/README_fr.md b/README_fr.md index f5308cf..da6b4c2 100644 --- a/README_fr.md +++ b/README_fr.md @@ -32,7 +32,6 @@ Listmonk est un gestionnaire de newsletter et de liste de diffusion autonome et * Site officiel de l’app : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : -* Documentation YunoHost pour cette app : * Signaler un bug : ## Informations pour les développeurs diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md new file mode 100644 index 0000000..fbf8d69 --- /dev/null +++ b/doc/POST_INSTALL.md @@ -0,0 +1,16 @@ +You have to configure SMTP from the web interface at https://__DOMAIN__/admin + +Visit Settings -> General and replace these values: + +- Root URL: https://__DOMAIN__ +- Default from email: listmonk <__APP__@__DOMAIN__> + +Visit Settings -> SMTP and replace with these values: + +- Host: 127.0.0.1 +- Port: 25 +- Auth protocol: PLAIN +- User: __APP__ +- Password: __MAIL_PWD__ + +Then, test the connection diff --git a/manifest.toml b/manifest.toml index 1b5ca1d..08b4076 100644 --- a/manifest.toml +++ b/manifest.toml @@ -34,9 +34,6 @@ ram.runtime = "50M" type = "group" default = "visitors" - [install.admin] - type = "user" - [resources] [resources.sources] @@ -50,7 +47,13 @@ ram.runtime = "50M" arm64.sha256 = "832c5a34ed78446c179ed5423cdbce51d3e51333c1ea6cf11c74b63e0776193a" in_subdir = false + autoupdate.strategy = "latest_github_release" + autoupdate.asset.amd64 = ".*_linux_amd64.tar.gz" + autoupdate.asset.armhf = ".*_linux_armv7.tar.gz" + autoupdate.asset.arm64 = ".*_linux_arm64.tar.gz" + [resources.system_user] + allow_email = true [resources.ports] @@ -65,10 +68,11 @@ ram.runtime = "50M" admin.auth_header = false admin.allowed = "admins" + # internal API, should not be allowed to visitors api.url = "/api" api.show_tile = false api.auth_header = false - api.allowed = "visitors" + api.allowed = "admins" [resources.apt] packages = "postgresql" diff --git a/scripts/_common.sh b/scripts/_common.sh index 944a65e..35ad7ea 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,6 +8,29 @@ # PERSONAL HELPERS #================================================= +# FIXME https://listmonk.app/docs/swagger/#/Settings/getSettings +_listmonk_configure_with_api () { + python -c """ +from urllib.request import urlopen, Request +with urlopen('http://localhost:$port/api/settings') as url: + data = json.load(url) + +data['data']['app.root_url'] = "https://$domain" +data['data']['app.from_email'] = "listmonk " +data['data']['smtp'][0]['host'] = "127.0.0.1" +data['data']['smtp'][0]['auth_protocol'] = "plain" +data['data']['smtp'][0]['username'] = "$app" +data['data']['smtp'][0]['password'] = "$mail_pwd" + +data_bytes = bytes(json.dumps(data), encoding='utf8') + +request = Request('http://localhost:$port/api/settings', method='PUT', data=data_bytes, headers={'Content-Type': 'application/json'}) + +with urlopen(request) as response: + print(response.read()) +""" +} + #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/tests.toml b/tests.toml index a26dece..cc52fda 100644 --- a/tests.toml +++ b/tests.toml @@ -7,3 +7,6 @@ test_format = 1.0 # ------------------------------- test_upgrade_from.4b1297d8.name = "Upgrade from 2.3.0" + test_upgrade_from.4b1297d8.args.admin = "package_checker" + test_upgrade_from.4b1297d8.args.password = "much_s3cur1ty" + test_upgrade_from.4b1297d8.args.domain = "domain.tld" From 72821621b4b34078259671a454c9e33c637d1366 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 12 Nov 2023 19:58:40 +0000 Subject: [PATCH 2/4] Auto-update README --- README.md | 1 + README_fr.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 58eee85..bd79597 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ Listmonk is a standalone, self-hosted, newsletter and mailing list manager. It i * Official app website: * Official admin documentation: * Upstream app code repository: +* YunoHost Store: * Report a bug: ## Developer info diff --git a/README_fr.md b/README_fr.md index da6b4c2..bbe1f9b 100644 --- a/README_fr.md +++ b/README_fr.md @@ -32,6 +32,7 @@ Listmonk est un gestionnaire de newsletter et de liste de diffusion autonome et * Site officiel de l’app : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : +* YunoHost Store: * Signaler un bug : ## Informations pour les développeurs From 0a04411ae5c0cfcfa820a47d7b41400d4ab7fa41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 12 Nov 2023 20:59:18 +0100 Subject: [PATCH 3/4] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 08b4076..2eb253f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Listmonk" description.en = "Newsletter and mailing list manager" description.fr = "Manager de newsletter et mailing list" -version = "2.5.1~ynh2" +version = "2.5.1~ynh3" maintainers = ["Navan Chauhan"] From 797b5951236df0ef1558a8d729953a1051067db3 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 12 Nov 2023 19:59:22 +0000 Subject: [PATCH 4/4] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bd79597..2a760c1 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Listmonk is a standalone, self-hosted, newsletter and mailing list manager. It is fast, feature-rich, and packed into a single binary. It uses a PostgreSQL database as its data base. -**Shipped version:** 2.5.1~ynh2 +**Shipped version:** 2.5.1~ynh3 **Demo:** https://demo.listmonk.app/ diff --git a/README_fr.md b/README_fr.md index bbe1f9b..02434e8 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Listmonk est un gestionnaire de newsletter et de liste de diffusion autonome et auto-hébergé. Il est rapide, riche en fonctionnalités et emballé dans un seul binaire. Il utilise une base de données PostgreSQL comme base de données. -**Version incluse :** 2.5.1~ynh2 +**Version incluse :** 2.5.1~ynh3 **Démo :** https://demo.listmonk.app/