From c331d56d0e50a985536ed8687665c9bfa313e8ae Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 2 Oct 2019 00:14:24 +0200 Subject: [PATCH] 1.0.7 + ldap --- README.md | 2 +- conf/arm.src | 6 ++-- conf/arm64.src | 6 ++-- conf/generated_config.exs | 14 +++++++- conf/x86-64.src | 6 ++-- manifest.json | 6 ++-- scripts/install | 72 +++++++++++++++++++++++++-------------- 7 files changed, 72 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 83ff2c6..2557630 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ For user friendly details about Pleroma: [see here](https://blog.soykaf.com/post - Tootdon (Android + iOS) - Tootle (iOS) -**Shipped version:** 1.0.1 +**Shipped version:** 1.0.7 ## Important points to read before installing diff --git a/conf/arm.src b/conf/arm.src index 87f12bd..5f74a90 100644 --- a/conf/arm.src +++ b/conf/arm.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/45357/artifacts/download -SOURCE_SUM=3f223062fca6010abd36aaf9c3ebee8d1c808012ed26639df49103a8969c5af0 +SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/63065/artifacts/download +SOURCE_SUM=3a6c57ce974751dbfc97832af22020df4ff6355c710b30013dfac9fffab74fa4 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=pleroma-v1.0.1.zip +SOURCE_FILENAME=pleroma-v1.0.7.zip diff --git a/conf/arm64.src b/conf/arm64.src index f687dff..ae52c19 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/45359/artifacts/download -SOURCE_SUM=68f0b6e09b423eb1df5774a7fc4aac1518aa3df27cdaae5b824b73ec8839d7f7 +SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/63067/artifacts/download +SOURCE_SUM=fd7ebb7689723bf2874e5fd3ff5c2b8261045d868d4f8e8c9699bee8e1f28a10 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=pleroma-v1.0.1.zip +SOURCE_FILENAME=pleroma-v1.0.7.zip diff --git a/conf/generated_config.exs b/conf/generated_config.exs index 22aebd9..28e013f 100644 --- a/conf/generated_config.exs +++ b/conf/generated_config.exs @@ -9,7 +9,7 @@ config :pleroma, Pleroma.Web.Endpoint, url: [host: "__DOMAIN__", scheme: "https", port: 443], secret_key_base: "__KEY__", signing_salt: "__SIGNING_SALT__", - http: [ip: {127, 0, 0, 1}, port: __PORT__] + http: [ip: {127, 0, 0, 1}, port: 8095] config :pleroma, :instance, name: "__INSTANCE_NAME__", @@ -81,3 +81,15 @@ config :pleroma, Pleroma.Uploaders.Local, uploads: "__DATADIR__/uploads" # storage_url: "https://swift-endpoint.prodider.com/v1/AUTH_/", # object_url: "https://cdn-endpoint.provider.com/" # + +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: "cn" diff --git a/conf/x86-64.src b/conf/x86-64.src index 6162f81..6601cbd 100644 --- a/conf/x86-64.src +++ b/conf/x86-64.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/45355/artifacts/download -SOURCE_SUM=426013286094411c5e53330515cc6601b41fab4b8a53b724b7739f92c95154a2 +SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/63063/artifacts/download +SOURCE_SUM=f248a074baed3a36fbccaf89cc5d643d57eae43ee22c50dd720da5206b89d125 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=pleroma-v1.0.1.zip +SOURCE_FILENAME=pleroma-v1.0.7.zip diff --git a/manifest.json b/manifest.json index 6de7bd5..37a348f 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": "1.0.1~ynh1", + "version": "1.0.7~ynh1", "url": "https://git.pleroma.social/pleroma/pleroma", "license": "AGPL-3.0-only", "maintainer": [ @@ -69,8 +69,8 @@ "en": "Choose a name for your Pleroma instance", "fr": "Choisissez un nom pour votre instance Pleroma" }, - "example": "My Pleroma", - "default": "My Pleroma" + "example": "My_Pleroma", + "default": "My_Pleroma" }, { "name": "registration", diff --git a/scripts/install b/scripts/install index d5ab39e..ce4dde9 100755 --- a/scripts/install +++ b/scripts/install @@ -179,32 +179,32 @@ chown -R $app /etc/$app config="/etc/$app/config.exs" -cp -f ../conf/generated_config.exs $config +#cp -f ../conf/generated_config.exs $config -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config" -ynh_replace_string --match_string="__KEY__" --replace_string="$random_key" --target_file="$config" -ynh_replace_string --match_string="__SIGNING_SALT__" --replace_string="$signing_salt" --target_file="$config" -ynh_replace_string --match_string="__INSTANCE_NAME__" --replace_string="$name" --target_file="$config" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config" -ynh_replace_string --match_string="__ADMIN_EMAIL__" --replace_string="$admin_email" --target_file="$config" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config" -ynh_replace_string --match_string="__DATADIR__" --replace_string="$datadir" --target_file="$config" +# ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config" +#ynh_replace_string --match_string="__KEY__" --replace_string="$random_key" --target_file="$config" +#ynh_replace_string --match_string="__SIGNING_SALT__" --replace_string="$signing_salt" --target_file="$config" +# ynh_replace_string --match_string="__INSTANCE_NAME__" --replace_string="$name" --target_file="$config" +# ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config" +# ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config" +# ynh_replace_string --match_string="__ADMIN_EMAIL__" --replace_string="$admin_email" --target_file="$config" +# ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config" +# ynh_replace_string --match_string="__DATADIR__" --replace_string="$datadir" --target_file="$config" -if [ $cache -eq 1 ] -then - ynh_replace_string --match_string="__MEDIA_CACHE__" --replace_string="true" --target_file="$config" -else - ynh_replace_string --match_string="__MEDIA_CACHE__" --replace_string="false" --target_file="$config" -fi +#if [ $cache -eq 1 ] +#then +# ynh_replace_string --match_string="__MEDIA_CACHE__" --replace_string="true" --target_file="$config" +#else +# ynh_replace_string --match_string="__MEDIA_CACHE__" --replace_string="false" --target_file="$config" +#fi # Set registrations open/closed -if [ $registration -eq 1 ] -then - ynh_replace_string --match_string="__REG__" --replace_string="true" --target_file="$config" -else - ynh_replace_string --match_string="__REG__" --replace_string="false" --target_file="$config" -fi +#if [ $registration -eq 1 ] +#then +# ynh_replace_string --match_string="__REG__" --replace_string="true" --target_file="$config" +#else +# ynh_replace_string --match_string="__REG__" --replace_string="false" --target_file="$config" +#fi #================================================= # SETUP SYSTEMD @@ -222,12 +222,32 @@ ynh_add_systemd_config chown -R "$app":"$app" "$final_path" pushd $final_path/$app - su "$app" -s $SHELL -lc "PLEROMA_CONFIG_PATH=$config $final_path/$app/bin/pleroma_ctl migrate" + su "$app" -s $SHELL -lc "$final_path/$app/bin/pleroma_ctl instance gen --force \ + --output $config \ + --output-psql /tmp/setup_db.psql \ + --domain $domain \ + --instance-name \"$name\" \ + --admin-email $admin_email \ + --notify-email $admin_email \ + --dbhost localhost \ + --dbname $db_name \ + --dbuser $db_user \ + --dbpass $db_pwd \ + --rum N \ + --indexable Y \ + --db-configurable Y \ + --uploads-dir $datadir/uploads \ + --static-dir $datadir/static \ + --listen-ip 127.0.0.1 \ + --listen-port $port" - ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="check_if_time_to_update" + su "$app" -s $SHELL -lc "$final_path/$app/bin/pleroma_ctl migrate" + + ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Started $app social network." + sleep 20 # Add user - su pleroma -s $SHELL -lc "PLEROMA_CONFIG_PATH=$config $final_path/$app/bin/pleroma_ctl user new $admin $admin_email --password $password --moderator --admin -y" + su pleroma -s $SHELL -lc "$final_path/$app/bin/pleroma_ctl user new $admin $admin_email --password $password --moderator --admin -y" #Generate key pair #sudo -u "$app" MIX_ENV=prod mix web_push.gen.keypair >> "config/prod.secret.exs" @@ -272,7 +292,7 @@ yunohost service add $app --description "$app daemon for Pleroma" --log "/var/lo #================================================= ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="restart" --log_path=systemd --line_match="Started pleroma" +ynh_systemd_action --service_name=$app --action="restart" --log_path=systemd --line_match="Started $app social network." #================================================= # SETUP SSOWAT