1
0
Fork 0
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:
Jean-Baptiste Holcroft 2017-09-28 16:42:10 +02:00
parent 8fdd49a756
commit f88c29ddf9
6 changed files with 15 additions and 26 deletions

View file

@ -4,14 +4,21 @@ The YunoHost team uses [Weblate](https://weblate.org) for translations: https://
## Admin ## 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 and databases
Weblate [recommands PostgreSQL](https://docs.weblate.org/en/latest/admin/install.html#database-setup-for-weblate), but YunoHost uses Mysql. 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 ## 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.

View file

@ -554,12 +554,7 @@ EMAIL_SEND_HTML = True
# Subject of emails includes site title # Subject of emails includes site title
EMAIL_SUBJECT_PREFIX = '[{0}] '.format(SITE_TITLE) EMAIL_SUBJECT_PREFIX = '[{0}] '.format(SITE_TITLE)
# SMTP settings EMAIL_BACKEND = 'django_sendmail_backend.backends.EmailBackend'
EMAIL_HOST="localhost"
EMAIL_HOST_USER="__NAME__"
EMAIL_HOST_PASSWORD="__SMTPPWD__"
EMAIL_PORT=465
EMAIL_USE_SSL=True
# Enable remote hooks # Enable remote hooks
ENABLE_HOOKS = True ENABLE_HOOKS = True

View file

@ -1,17 +1,5 @@
#!/bin/bash #!/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() { ynh_psql_test_if_first_run() {
if [ -f /etc/yunohost/psql ]; if [ -f /etc/yunohost/psql ];
then then

View file

@ -104,8 +104,7 @@ ynh_add_nginx_config
# Create system user for email notifications # Create system user for email notifications
smtp_pwd=$(ynh_string_random) smtp_pwd=$(ynh_string_random)
ynh_system_user_create_smtp "$app" "$smtp_pwd" ynh_system_user_create "$app" "/home/$app"
ynh_app_setting_set "$app" smtppwd "$smtp_pwd"
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
@ -137,7 +136,7 @@ virtualenv "${final_path}/venv"
set +eu set +eu
source "${final_path}/venv/bin/activate" source "${final_path}/venv/bin/activate"
"${final_path}/venv/bin/pip" install Weblate==2.16 "${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
) )
#================================================= #=================================================

View file

@ -62,7 +62,7 @@ ynh_restore_file "$final_path"
#================================================= #=================================================
# Create the dedicated user (if not existing) # 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 # RESTORE USER RIGHTS

View file

@ -64,7 +64,7 @@ ynh_add_nginx_config
#================================================= #=================================================
# Create a system user # Create a system user
ynh_system_user_create_smtp "$app" "$smtp_pwd" ynh_system_user_create "$app" "/home/$app"
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE