diff --git a/doc/EN/app_pleroma.org b/doc/EN/app_pleroma.org index 5bdfcb04..e11809f4 100644 --- a/doc/EN/app_pleroma.org +++ b/doc/EN/app_pleroma.org @@ -10,11 +10,9 @@ [[file:images/logo.png]] #+END_CENTER -#+BEGIN_EXPORT html -
-

Pleroma

-
-#+END_EXPORT +#+BEGIN_CENTER +[[file:images/pleroma-logo.png]] +#+END_CENTER Pleroma is an OStatus-compatible social networking server, compatible with GNU Social, PostActiv and Mastodon. It is high-performance and so is especially well suited for running on low power single board computers without much RAM. diff --git a/img/pleroma-logo.png b/img/pleroma-logo.png new file mode 100644 index 00000000..964ec025 Binary files /dev/null and b/img/pleroma-logo.png differ diff --git a/src/freedombone-app-pleroma b/src/freedombone-app-pleroma index 31db299f..2a86ce5b 100755 --- a/src/freedombone-app-pleroma +++ b/src/freedombone-app-pleroma @@ -62,6 +62,127 @@ pleroma_variables=(ONION_ONLY MY_EMAIL_ADDRESS MY_USERNAME) +function pleroma_block_domain_script { + database_name='pleroma' + pleroma_domain=$PLEROMA_DOMAIN_NAME + + echo '#!/bin/bash' > /usr/bin/pleroma-delete-domain + echo '' >> /usr/bin/pleroma-delete-domain + echo 'database_name=$1' >> /usr/bin/pleroma-delete-domain + echo 'remove_domain=$2' >> /usr/bin/pleroma-delete-domain + echo 'domain_name=$3' >> /usr/bin/pleroma-delete-domain + echo "POSTGRESQL_PASSWORD=\$(${PROJECT_NAME}-pass -u root -a pleroma)" >> /usr/bin/pleroma-delete-domain + echo '' >> /usr/bin/pleroma-delete-domain + echo 'if [ ${#remove_domain} -lt 2 ]; then' >> /usr/bin/pleroma-delete-domain + echo ' echo $"No domain was specified"' >> /usr/bin/pleroma-delete-domain + echo ' exit 1' >> /usr/bin/pleroma-delete-domain + echo 'fi' >> /usr/bin/pleroma-delete-domain + echo '' >> /usr/bin/pleroma-delete-domain + echo 'if [[ "$remove_domain" != *"."* ]]; then' >> /usr/bin/pleroma-delete-domain + echo ' echo $"This doesnt look like a domain"' >> /usr/bin/pleroma-delete-domain + echo ' exit 2' >> /usr/bin/pleroma-delete-domain + echo 'fi' >> /usr/bin/pleroma-delete-domain + echo '' >> /usr/bin/pleroma-delete-domain + echo 'if [ ${#database_name} -lt 2 ]; then' >> /usr/bin/pleroma-delete-domain + echo ' echo $"No database was specified"' >> /usr/bin/pleroma-delete-domain + echo ' exit 3' >> /usr/bin/pleroma-delete-domain + echo 'fi' >> /usr/bin/pleroma-delete-domain + echo '' >> /usr/bin/pleroma-delete-domain + echo "database_query=\"select user_id from profile where profileurl like '%\${remove_domain}%';\"" >> /usr/bin/pleroma-delete-domain + echo 'declare -a ids=$(mysql -u root --password="$POSTGRESQL_PASSWORD" << EOF' >> /usr/bin/pleroma-delete-domain + echo 'use $database_name;' >> /usr/bin/pleroma-delete-domain + echo '$database_query' >> /usr/bin/pleroma-delete-domain + echo 'EOF' >> /usr/bin/pleroma-delete-domain + echo ')' >> /usr/bin/pleroma-delete-domain + echo '' >> /usr/bin/pleroma-delete-domain + echo 'ctr=0' >> /usr/bin/pleroma-delete-domain + echo 'for id in $ids' >> /usr/bin/pleroma-delete-domain + echo 'do' >> /usr/bin/pleroma-delete-domain + echo ' if [ $ctr -gt 0 ]; then' >> /usr/bin/pleroma-delete-domain + echo ' #echo "Removing user ID $id on $remove_domain"' >> /usr/bin/pleroma-delete-domain + echo '' >> /usr/bin/pleroma-delete-domain + echo " database_query=\"delete from conversation where uri like '%\${remove_domain}%';\"" >> /usr/bin/pleroma-delete-domain + echo ' mysql -u root --password="$POSTGRESQL_PASSWORD" -e "$database_query" $database_name' >> /usr/bin/pleroma-delete-domain + echo '' >> /usr/bin/pleroma-delete-domain + echo ' database_query="delete from reply where profile_id=${id};"' >> /usr/bin/pleroma-delete-domain + echo ' mysql -u root --password="$POSTGRESQL_PASSWORD" -e "$database_query" $database_name' >> /usr/bin/pleroma-delete-domain + echo '' >> /usr/bin/pleroma-delete-domain + echo ' database_query="delete from reply where replied_id=${id};"' >> /usr/bin/pleroma-delete-domain + echo ' mysql -u root --password="$POSTGRESQL_PASSWORD" -e "$database_query" $database_name' >> /usr/bin/pleroma-delete-domain + echo '' >> /usr/bin/pleroma-delete-domain + echo ' if [ $domain_name ]; then' >> /usr/bin/pleroma-delete-domain + echo ' database_query="select rendered from notice where profile_id=${id} and rendered like '"'"'%/file/%'"'"';"' >> /usr/bin/pleroma-delete-domain + echo ' declare -a stored_files=$(mysql -u root --password="$POSTGRESQL_PASSWORD" << EOF' >> /usr/bin/pleroma-delete-domain + echo 'use $database_name;' >> /usr/bin/pleroma-delete-domain + echo '$database_query' >> /usr/bin/pleroma-delete-domain + echo 'EOF' >> /usr/bin/pleroma-delete-domain + echo ')' >> /usr/bin/pleroma-delete-domain + echo -n " files_to_delete=\$(echo \"\$stored_files\" | " >> /usr/bin/pleroma-delete-domain + echo 'sed -n '"'"'s/.*href="\([^"]*\).*/\1/p'"'"' | awk -F '"'"'file/'"'"' '"'"'{print $2}'"'"')' >> /usr/bin/pleroma-delete-domain + echo ' filectr=0' >> /usr/bin/pleroma-delete-domain + echo ' for f in $files_to_delete' >> /usr/bin/pleroma-delete-domain + echo ' do' >> /usr/bin/pleroma-delete-domain + echo ' if [ $filectr -gt 0 ]; then' >> /usr/bin/pleroma-delete-domain + echo ' if $(ls /var/www/${domain_name}/htdocs/file/*${f}* 1> /dev/null 2>&1); then' >> /usr/bin/pleroma-delete-domain + echo ' rm /var/www/${domain_name}/htdocs/file/*${f}*' >> /usr/bin/pleroma-delete-domain + echo ' fi' >> /usr/bin/pleroma-delete-domain + echo ' fi' >> /usr/bin/pleroma-delete-domain + echo ' filectr=$((filectr + 1))' >> /usr/bin/pleroma-delete-domain + echo ' done' >> /usr/bin/pleroma-delete-domain + echo ' fi' >> /usr/bin/pleroma-delete-domain + echo '' >> /usr/bin/pleroma-delete-domain + echo ' database_query="delete from notice where profile_id=${id};"' >> /usr/bin/pleroma-delete-domain + echo ' mysql -u root --password="$POSTGRESQL_PASSWORD" -e "$database_query" $database_name' >> /usr/bin/pleroma-delete-domain + echo '' >> /usr/bin/pleroma-delete-domain + echo ' database_query="delete from profile where id=${id};"' >> /usr/bin/pleroma-delete-domain + echo ' mysql -u root --password="$POSTGRESQL_PASSWORD" -e "$database_query" $database_name' >> /usr/bin/pleroma-delete-domain + echo '' >> /usr/bin/pleroma-delete-domain + echo ' database_query="delete from qvitternotification where to_profile_id=${id} or from_profile_id=${id};"' >> /usr/bin/pleroma-delete-domain + echo ' mysql -u root --password="$POSTGRESQL_PASSWORD" -e "$database_query" $database_name' >> /usr/bin/pleroma-delete-domain + echo ' fi' >> /usr/bin/pleroma-delete-domain + echo ' ctr=$((ctr + 1))' >> /usr/bin/pleroma-delete-domain + echo 'done' >> /usr/bin/pleroma-delete-domain + chmod +x /usr/bin/pleroma-delete-domain + + echo '#!/bin/bash' > /usr/bin/${database_name}-firewall + echo '' >> /usr/bin/${database_name}-firewall + echo "PROJECT_NAME=$PROJECT_NAME" >> /usr/bin/${database_name}-firewall + + if [[ $ONION_ONLY == 'no' ]]; then + echo "PLEROMA_DOMAIN_NAME=$PLEROMA_DOMAIN_NAME" >> /usr/bin/${database_name}-firewall + else + echo "PLEROMA_DOMAIN_NAME=$PLEROMA_ONION_HOSTNAME" >> /usr/bin/${database_name}-firewall + fi + + echo "database_name=$database_name" >> /usr/bin/${database_name}-firewall + echo 'FIREWALL_DOMAINS=$HOME/${PROJECT_NAME}-firewall-domains.cfg' >> /usr/bin/${database_name}-firewall + echo '' >> /usr/bin/${database_name}-firewall + echo 'while read block; do' >> /usr/bin/${database_name}-firewall + echo ' if [[ "$block" != *"@"* ]]; then' >> /usr/bin/${database_name}-firewall + echo ' /usr/bin/pleroma-delete-domain "$database_name" "$block" "$PLEROMA_DOMAIN_NAME"' >> /usr/bin/${database_name}-firewall + echo ' else' >> /usr/bin/${database_name}-firewall + echo ' /usr/bin/pleroma-delete-user "$database_name" "$block" "$PLEROMA_DOMAIN_NAME"' >> /usr/bin/${database_name}-firewall + echo ' fi' >> /usr/bin/${database_name}-firewall + echo 'done <$FIREWALL_DOMAINS' >> /usr/bin/${database_name}-firewall + echo '' >> /usr/bin/${database_name}-firewall + echo '# remove any metadata from images uploaded in the last 2 minutes' >> /usr/bin/${database_name}-firewall + echo 'if [ -d /var/www/$PLEROMA_DOMAIN_NAME/htdocs ]; then' >> /usr/bin/${database_name}-firewall + echo ' cd /var/www/$PLEROMA_DOMAIN_NAME/htdocs' >> /usr/bin/${database_name}-firewall + echo ' declare -a recent_image=$(find file ! -name thumb-* -mmin -2 -type f -exec ls -l {} + | awk -F '"'"'file/'"'"' '"'"'{print $2}'"'"')' >> /usr/bin/${database_name}-firewall + echo ' for f in ${recent_image[@]}' >> /usr/bin/${database_name}-firewall + echo ' do' >> /usr/bin/${database_name}-firewall + echo ' if [ ${#f} -gt 1 ]; then' >> /usr/bin/${database_name}-firewall + echo ' exiftool -q -all= "file/${f}"' >> /usr/bin/${database_name}-firewall + echo ' fi' >> /usr/bin/${database_name}-firewall + echo ' done' >> /usr/bin/${database_name}-firewall + echo 'fi' >> /usr/bin/${database_name}-firewall + chmod +x /usr/bin/${database_name}-firewall + + if ! grep -q "${database_name}-firewall" /etc/crontab; then + echo "*/1 * * * * root /usr/bin/${database_name}-firewall" >> /etc/crontab + fi +} + function pleroma_recompile { # necessary after parameter changes sudo -u pleroma mix clean diff --git a/website/EN/app_pleroma.html b/website/EN/app_pleroma.html index dc4f59fb..4e4011a7 100644 --- a/website/EN/app_pleroma.html +++ b/website/EN/app_pleroma.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + @@ -244,9 +244,13 @@ for the JavaScript code in this tag. -
-

Pleroma

-
+
+ +
+

pleroma-logo.png +

+
+

Pleroma is an OStatus-compatible social networking server, compatible with GNU Social, PostActiv and Mastodon. It is high-performance and so is especially well suited for running on low power single board computers without much RAM. @@ -260,9 +264,9 @@ Pleroma is an OStatus-compatible social networking server, compatible with GNU S -

-

Installation

-
+
+

Installation

+

Log into your system with:

@@ -282,9 +286,9 @@ Select Add/Remove Apps then pleroma. You will then be asked for a
-
-

Initial setup

-
+
+

Initial setup

+

The first thing you'll need to do is register a new account. You can set your profile details and profile image by selecting the small settings icon to the right of your name.