mirror of
https://github.com/YunoHost-Apps/weblate_ynh.git
synced 2024-10-01 13:35:04 +02:00
Remove SMTP and use sendmail
This commit is contained in:
parent
8fdd49a756
commit
f88c29ddf9
6 changed files with 15 additions and 26 deletions
13
README.md
13
README.md
|
@ -4,14 +4,21 @@ The YunoHost team uses [Weblate](https://weblate.org) for translations: https://
|
|||
|
||||
## Admin
|
||||
|
||||
An admin user is created at installation, the password is *weblate*.
|
||||
An admin user is created at installation, the login is what you provided at installation, the password is *weblate*.
|
||||
|
||||
# Github
|
||||
|
||||
Pulling works fine. But pushing still needs some love. Please read [Weblate's documentation about this](https://docs.weblate.org/en/latest/vcs.html).
|
||||
|
||||
I understant we need to manually install [hub](https://github.com/github/hub), a tool that creates pull-requests.
|
||||
Which will require to download and install a binary file, as Debian 8 don't have Go>=1.8
|
||||
|
||||
## Weblate and databases
|
||||
|
||||
Weblate [recommands PostgreSQL](https://docs.weblate.org/en/latest/admin/install.html#database-setup-for-weblate), but YunoHost uses Mysql.
|
||||
|
||||
Carefull, this installs PostgreSQL and change default configuration to ask for every connexion and every user a password (local all all password).
|
||||
Carefull, this application install PostgreSQL and change the default configuration to ask for every connexion and every user a password (local all all password).
|
||||
|
||||
## LDAP connexion
|
||||
|
||||
It doesn't work yet, but it looks doable: https://docs.weblate.org/en/latest/admin/auth.html?highlight=LDAP#ldap-authentication
|
||||
It doesn't work yet, but while [it looks doable](https://docs.weblate.org/en/latest/admin/auth.html?highlight=LDAP#ldap-authentication), I'm unsure it is a good idea to link this kind of tools to you LDAP.
|
||||
|
|
|
@ -554,12 +554,7 @@ EMAIL_SEND_HTML = True
|
|||
# Subject of emails includes site title
|
||||
EMAIL_SUBJECT_PREFIX = '[{0}] '.format(SITE_TITLE)
|
||||
|
||||
# SMTP settings
|
||||
EMAIL_HOST="localhost"
|
||||
EMAIL_HOST_USER="__NAME__"
|
||||
EMAIL_HOST_PASSWORD="__SMTPPWD__"
|
||||
EMAIL_PORT=465
|
||||
EMAIL_USE_SSL=True
|
||||
EMAIL_BACKEND = 'django_sendmail_backend.backends.EmailBackend'
|
||||
|
||||
# Enable remote hooks
|
||||
ENABLE_HOOKS = True
|
||||
|
|
|
@ -1,17 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Create a system user
|
||||
#
|
||||
# usage: ynh_system_user_create user_name [home_dir]
|
||||
# | arg: user_name - Name of the system user that will be create
|
||||
# | arg: password - user password (for SMTP access)
|
||||
ynh_system_user_create_smtp () {
|
||||
if ! ynh_system_user_exists "$1" # Check if the user exists on the system
|
||||
then # If the user doesn't exist
|
||||
sudo useradd --no-create-home --system --user-group "$1" --shell /bin/false --password "$2" || ynh_die "Unable to create $1 system account"
|
||||
fi
|
||||
}
|
||||
|
||||
ynh_psql_test_if_first_run() {
|
||||
if [ -f /etc/yunohost/psql ];
|
||||
then
|
||||
|
|
|
@ -104,8 +104,7 @@ ynh_add_nginx_config
|
|||
|
||||
# Create system user for email notifications
|
||||
smtp_pwd=$(ynh_string_random)
|
||||
ynh_system_user_create_smtp "$app" "$smtp_pwd"
|
||||
ynh_app_setting_set "$app" smtppwd "$smtp_pwd"
|
||||
ynh_system_user_create "$app" "/home/$app"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC SETUP
|
||||
|
@ -137,7 +136,7 @@ virtualenv "${final_path}/venv"
|
|||
set +eu
|
||||
source "${final_path}/venv/bin/activate"
|
||||
"${final_path}/venv/bin/pip" install Weblate==2.16
|
||||
"${final_path}/venv/bin/pip" install pytz python-bidi PyYaML Babel pyuca pylibravatar pydns psycopg2
|
||||
"${final_path}/venv/bin/pip" install pytz python-bidi PyYaML Babel pyuca pylibravatar pydns psycopg2 django_sendmail_backend
|
||||
)
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -62,7 +62,7 @@ ynh_restore_file "$final_path"
|
|||
#=================================================
|
||||
|
||||
# Create the dedicated user (if not existing)
|
||||
ynh_system_user_create_smtp "$app" "$smtp_pwd"
|
||||
ynh_system_user_create "$app" "/home/$app"
|
||||
|
||||
#=================================================
|
||||
# RESTORE USER RIGHTS
|
||||
|
|
|
@ -64,7 +64,7 @@ ynh_add_nginx_config
|
|||
#=================================================
|
||||
|
||||
# Create a system user
|
||||
ynh_system_user_create_smtp "$app" "$smtp_pwd"
|
||||
ynh_system_user_create "$app" "/home/$app"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC UPGRADE
|
||||
|
|
Loading…
Reference in a new issue