mirror of
https://github.com/YunoHost-Apps/listmonk_ynh.git
synced 2024-09-03 19:36:15 +02:00
Enable allow_email and add a post install doc (#39)
* 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 <yunohost@yunohost.org>
This commit is contained in:
parent
0ae16f056f
commit
301a199172
6 changed files with 50 additions and 6 deletions
|
@ -32,7 +32,6 @@ Listmonk is a standalone, self-hosted, newsletter and mailing list manager. It i
|
|||
* Official app website: <https://listmonk.app/>
|
||||
* Official admin documentation: <https://listmonk.app/docs/>
|
||||
* Upstream app code repository: <https://github.com/knadh/listmonk>
|
||||
* YunoHost documentation for this app: <https://yunohost.org/app_listmonk>
|
||||
* Report a bug: <https://github.com/YunoHost-Apps/listmonk_ynh/issues>
|
||||
|
||||
## Developer info
|
||||
|
|
|
@ -32,7 +32,6 @@ Listmonk est un gestionnaire de newsletter et de liste de diffusion autonome et
|
|||
* Site officiel de l’app : <https://listmonk.app/>
|
||||
* Documentation officielle de l’admin : <https://listmonk.app/docs/>
|
||||
* Dépôt de code officiel de l’app : <https://github.com/knadh/listmonk>
|
||||
* Documentation YunoHost pour cette app : <https://yunohost.org/app_listmonk>
|
||||
* Signaler un bug : <https://github.com/YunoHost-Apps/listmonk_ynh/issues>
|
||||
|
||||
## Informations pour les développeurs
|
||||
|
|
16
doc/POST_INSTALL.md
Normal file
16
doc/POST_INSTALL.md
Normal file
|
@ -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
|
|
@ -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"
|
||||
|
|
|
@ -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 <noreply@$domain>"
|
||||
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
|
||||
#=================================================
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue