1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gotosocial_ynh.git synced 2024-09-03 19:16:06 +02:00

Merge pull request #73 from YunoHost-Apps/testing

Testing V0.8.0~ynh2 (SMTP config)
This commit is contained in:
OniriCorpe 2023-04-10 21:59:57 +02:00 committed by GitHub
commit 3256c5a361
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 124 additions and 10 deletions

View file

@ -25,7 +25,7 @@ With GoToSocial, you can keep in touch with your friends, post, read, and share
Documentation is at [docs.gotosocial.org](https://docs.gotosocial.org).
**Shipped version:** 0.8.0~ynh1
**Shipped version:** 0.8.0~ynh2
## Screenshots

View file

@ -25,7 +25,7 @@ Avec GoToSocial, vous pouvez rester en contact avec vos amis, publier, lire et p
Vous pouvez consulter la documentation à l'adresse : [docs.gotosocial.org](https://docs.gotosocial.org).
**Version incluse :** 0.8.0~ynh1
**Version incluse :** 0.8.0~ynh2
## Captures décran

View file

@ -702,30 +702,30 @@ oidc-admin-groups: []
# If this is not set, smtp will not be used to send emails, and you can ignore the other settings.
# Examples: ["mail.example.org", "localhost"]
# Default: ""
smtp-host: "localhost"
smtp-host: "__SMTP_HOST__"
# Int. Port to use to connect to the smtp server.
# Examples: []
# Default: 0
smtp-port: 25
smtp-port: __SMTP_PORT__
# String. Username to use when authenticating with the smtp server.
# This should have been provided to you by your smtp host.
# This is often, but not always, an email address.
# Examples: ["maillord@example.org"]
# Default: ""
smtp-username: ""
smtp-username: "__SMTP_USERNAME__"
# String. Password to use when authenticating with the smtp server.
# This should have been provided to you by your smtp host.
# Examples: ["1234", "password"]
# Default: ""
smtp-password: ""
smtp-password: "__SMTP_PASSWORD__"
# String. 'From' address for sent emails.
# Examples: ["mail@example.org"]
# Default: ""
smtp-from: "GoToSocial@__DOMAIN__"
smtp-from: "__SMTP_FROM__"
# Bool. If true, when an email is sent that has multiple recipients, each recipient
# will be included in the To field, so that each recipient can see who else got the
@ -737,7 +737,7 @@ smtp-from: "GoToSocial@__DOMAIN__"
# It might be useful to change this setting to 'true' if you want to be able to discuss
# new moderation reports with other admins by 'replying-all' to the notification email.
# Default: false
smtp-disclose-recipients: false
smtp-disclose-recipients: __SMTP_DISCLOSE_RECIPIENTS__
#########################
##### SYSLOG CONFIG #####

View file

@ -279,6 +279,73 @@ La livraison dans la boîte de réception partagée peut réduire de manière si
Voir : https://www.w3.org/TR/activitypub/#shared-inbox-delivery"""
type = "select"
################
#### SMTP CONFIG
################
[main.smtp]
name = "SMTP config"
help = "Config for sending emails via an smtp server."
[main.smtp.smtp_host]
ask.en = "SMTP Server Hostname"
ask.fr = "Nom d'hôte du serveur SMTP"
bind = "smtp-host:__FINALPATH__/config.yaml"
default = "localhost"
help.en = "The hostname of the SMTP server you want to use. Examples: mail.example.org, localhost"
help.fr = "Le nom d'hôte du serveur SMTP que vous souhaitez utiliser. Exemples: mail.example.org, localhost"
type = "string"
[main.smtp.smtp_port]
ask.en = "SMTP Port"
ask.fr = "Port SMTP"
bind = "smtp-port:__FINALPATH__/config.yaml"
default = "25"
help.en = "Port to use to connect to the SMTP server"
help.fr = "Port à utiliser pour se connecter au serveur SMTP"
type = "number"
[main.smtp.smtp_username]
ask.en = "SMTP Username"
ask.fr = "Nom d'utilisateur SMTP"
bind = "smtp-username:__FINALPATH__/config.yaml"
default = ""
help.en = "Username to use when authenticating with the SMTP server"
help.fr = "Nom d'utilisateur à utiliser lors de l'authentification avec le serveur SMTP"
type = "string"
[main.smtp.smtp_password]
ask.en = "SMTP Password"
ask.fr = "Mot de passe SMTP"
bind = "smtp-password:__FINALPATH__/config.yaml"
default = ""
help.en = "Password to use when authenticating with the SMTP server"
help.fr = "Mot de passe à utiliser lors de l'authentification avec le serveur SMTP"
type = "password"
[main.smtp.smtp_from]
ask.en = "SMTP From Address"
ask.fr = "Adresse d'expédition SMTP"
bind = "smtp-from:__FINALPATH__/config.yaml"
default = "GoToSocial@__DOMAIN__"
help.en = "From address for sent emails"
help.fr = "L'adresse utilisée pour les e-mails envoyés"
type = "email"
[main.smtp.smtp_disclose_recipients]
ask.en = "SMTP Disclose Recipients"
ask.fr = "SMTP Divulguer les destinataires"
bind = "smtp-disclose-recipients:__FINALPATH__/config.yaml"
choices = ["true", "false"]
default = "false"
help.en = """true: Disclose all recipients in the To field\
false: Email will be sent to Undisclosed Recipients"""
help.fr = """true : divulguer tous les destinataires dans le champ À\
false : l'e-mail sera envoyé sans divulguer les destinataires"""
type = "select"
####################
#### ADVANCED SETTINGS
####################

View file

@ -6,7 +6,7 @@
"en": "ActivityPub social network server",
"fr": "Serveur de réseau social basé sur ActivityPub"
},
"version": "0.8.0~ynh1",
"version": "0.8.0~ynh2",
"url": "https://github.com/superseriousbusiness/gotosocial",
"upstream": {
"license": "AGPL-3.0-only",

View file

@ -71,6 +71,13 @@ statuses_poll_max_options="6"
statuses_poll_option_max_chars="50"
statuses_media_max_files="6"
smtp_host="localhost"
smtp_port="25"
smtp_username=""
smtp_password=""
smtp_from="noreply@$domain"
smtp_disclose_recipients="false"
advanced_cookies_samesite="lax"
advanced_rate_limit_requests="300"
@ -135,6 +142,13 @@ ynh_app_setting_set --app="$app" --key=statuses_poll_max_options --value="$statu
ynh_app_setting_set --app="$app" --key=statuses_poll_option_max_chars --value="$statuses_poll_option_max_chars"
ynh_app_setting_set --app="$app" --key=statuses_media_max_files --value="$statuses_media_max_files"
ynh_app_setting_set --app="$app" --key=smtp_host --value="$smtp_host"
ynh_app_setting_set --app="$app" --key=smtp_port --value="$smtp_port"
ynh_app_setting_set --app="$app" --key=smtp_username --value="$smtp_username"
ynh_app_setting_set --app="$app" --key=smtp_password --value="$smtp_password"
ynh_app_setting_set --app="$app" --key=smtp_from --value="$smtp_from"
ynh_app_setting_set --app="$app" --key=smtp_disclose_recipients --value="$smtp_disclose_recipients"
ynh_app_setting_set --app="$app" --key=advanced_cookies_samesite --value="$advanced_cookies_samesite"
ynh_app_setting_set --app="$app" --key=advanced_rate_limit_requests --value="$advanced_rate_limit_requests"

View file

@ -76,6 +76,13 @@ statuses_poll_max_options=$(ynh_app_setting_get --app="$app" --key=statuses_poll
statuses_poll_option_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_poll_option_max_chars)
statuses_media_max_files=$(ynh_app_setting_get --app="$app" --key=statuses_media_max_files)
smtp_host=$(ynh_app_setting_get --app="$app" --key=smtp_host)
smtp_port=$(ynh_app_setting_get --app="$app" --key=smtp_port)
smtp_username=$(ynh_app_setting_get --app="$app" --key=smtp_username)
smtp_password=$(ynh_app_setting_get --app="$app" --key=smtp_password)
smtp_from=$(ynh_app_setting_get --app="$app" --key=smtp_from)
smtp_disclose_recipients=$(ynh_app_setting_get --app="$app" --key=smtp_disclose_recipients)
advanced_cookies_samesite=$(ynh_app_setting_get --app="$app" --key=advanced_cookies_samesite)
advanced_rate_limit_requests=$(ynh_app_setting_get --app="$app" --key=advanced_rate_limit_requests)

View file

@ -64,6 +64,13 @@ statuses_poll_max_options=$(ynh_app_setting_get --app="$app" --key=statuses_poll
statuses_poll_option_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_poll_option_max_chars)
statuses_media_max_files=$(ynh_app_setting_get --app="$app" --key=statuses_media_max_files)
smtp_host=$(ynh_app_setting_get --app="$app" --key=smtp_host)
smtp_port=$(ynh_app_setting_get --app="$app" --key=smtp_port)
smtp_username=$(ynh_app_setting_get --app="$app" --key=smtp_username)
smtp_password=$(ynh_app_setting_get --app="$app" --key=smtp_password)
smtp_from=$(ynh_app_setting_get --app="$app" --key=smtp_from)
smtp_disclose_recipients=$(ynh_app_setting_get --app="$app" --key=smtp_disclose_recipients)
advanced_cookies_samesite=$(ynh_app_setting_get --app="$app" --key=advanced_cookies_samesite)
advanced_rate_limit_requests=$(ynh_app_setting_get --app="$app" --key=advanced_rate_limit_requests)
@ -238,6 +245,25 @@ then
ynh_app_setting_set --app="$app" --key=instance_expose_suspended_web --value="$instance_expose_suspended_web"
fi
# Upgrade from <0.8.0~ynh2:
if ynh_compare_current_package_version --comparison lt --version 0.8.0~ynh2 || [ -z "$smtp_host" ]
then
# declaration of new parameter
smtp_host="localhost"
smtp_port="25"
smtp_username=""
smtp_password=""
smtp_from="noreply@$domain"
smtp_disclose_recipients="false"
# registration of parameters
ynh_app_setting_set --app="$app" --key=smtp_host --value="$smtp_host"
ynh_app_setting_set --app="$app" --key=smtp_port --value="$smtp_port"
ynh_app_setting_set --app="$app" --key=smtp_username --value="$smtp_username"
ynh_app_setting_set --app="$app" --key=smtp_password --value="$smtp_password"
ynh_app_setting_set --app="$app" --key=smtp_from --value="$smtp_from"
ynh_app_setting_set --app="$app" --key=smtp_disclose_recipients --value="$smtp_disclose_recipients"
fi
#=================================================
# CREATE DEDICATED USER
#=================================================