diff --git a/README.md b/README.md index ffa042d..f2fb788 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,6 @@ For user friendly details about Pleroma: [see here](https://blog.soykaf.com/post 1. **Pleroma** require a dedicated **root domain**, eg. pleroma.domain.tld 1. **Pleroma** require a valid **certificate** installed on the domain. Yunohost can **install Letsencrypt certificate** on the domain from **admin web-interface** or through **command-line**. 1. This package is **multi-instance** that means you can run **multiple Pleroma instances** on a **single server**. -1. There is **No LDAP** support for Pleroma yet. ## Screenshots @@ -78,7 +77,7 @@ You can make users **moderators**. They will then be able to **delete any post** #### Multi-users support -LDAP and HTTP auth are not supported. +LDAP supported but HTTP auth not. The app can be used by multiple users. diff --git a/check_process b/check_process index c13fe25..6dba010 100755 --- a/check_process +++ b/check_process @@ -39,6 +39,8 @@ upgrade=1 from_commit=8f418ba020cee267f76bb781b03a41d384707a5b # 2.0.2~ynh2 upgrade=1 from_commit=251a08383f59be006803fd12013baa92b03c1ef7 + # 2.0.5~ynh1 + upgrade=1 from_commit=06f0005707e77fae566fedbd6e5e37f390df5173 backup_restore=1 multi_instance=0 # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. @@ -70,3 +72,5 @@ Notification=yes name=2.0.2~ynh1 ; commit=251a08383f59be006803fd12013baa92b03c1ef7 name=2.0.2~ynh2 + ; commit=06f0005707e77fae566fedbd6e5e37f390df5173 + name=2.0.5~ynh1 diff --git a/conf/ldap.exs b/conf/ldap.exs new file mode 100644 index 0000000..b7e3272 --- /dev/null +++ b/conf/ldap.exs @@ -0,0 +1,11 @@ +config :pleroma, Pleroma.Web.Auth.Authenticator, Pleroma.Web.Auth.LDAPAuthenticator +config :pleroma, :ldap, + enabled: true, + host: "localhost", + port: 389, + ssl: false, + # sslopts: [], + tls: false, + # tlsopts: [], + base: "ou=users,dc=yunohost,dc=org", + uid: "uid" \ No newline at end of file diff --git a/conf/nginx.conf b/conf/nginx.conf index e1fb8e7..3c252af 100755 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -10,6 +10,7 @@ proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://localhost:__PORT__; diff --git a/manifest.json b/manifest.json index 4e33892..5bda6f9 100755 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Pleroma is an OStatus-compatible social networking server written in Elixir, compatible with GNU Social and Mastodon", "fr": "Pleroma est un réseau social écrit en Elixir, compatible avec OStatus, GNU Social et Mastodon" }, - "version": "2.0.5~ynh1", + "version": "2.0.5~ynh2", "url": "https://git.pleroma.social/pleroma/pleroma", "license": "AGPL-3.0-only", "maintainer": [ diff --git a/scripts/install b/scripts/install index 77533ef..4f97183 100755 --- a/scripts/install +++ b/scripts/install @@ -214,6 +214,13 @@ pushd $final_path/$app --listen-ip 127.0.0.1 \ --listen-port $port \ --db-configurable Y" +popd + +cat "../conf/ldap.exs" >> "$config" + +ynh_replace_string --match_string="config :pleroma, configurable_from_database: false" --replace_string="config :pleroma, configurable_from_database: true" --target_file="$config" + +pushd $final_path/$app su "$app" -s $SHELL -lc "$final_path/$app/bin/pleroma_ctl migrate" diff --git a/scripts/upgrade b/scripts/upgrade index bd90dc8..1871ea7 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -172,6 +172,12 @@ if ynh_version_gt "1.1.1~ynh1" "${previous_version}" ; then ynh_secure_remove --file="$final_path/$app" fi +if ynh_version_gt "2.0.5~ynh1" "${previous_version}" ; then + config="/etc/$app/config.exs" + cat "../conf/ldap.exs" >> "$config" + ynh_replace_string --match_string="config :pleroma, configurable_from_database: false" --replace_string="config :pleroma, configurable_from_database: true" --target_file="$config" +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #=================================================