Improve user blocking in pleroma
This commit is contained in:
parent
2a68cf0ef3
commit
67e6ceadb7
|
@ -140,6 +140,14 @@ function create_pleroma_blocklist {
|
|||
echo ' fi';
|
||||
echo " websub_server_subscriptions_query=\"\${websub_server_subscriptions_query} callback like '%\${blocked}%'\"";
|
||||
echo ' websub_server_subscriptions_updated=1';
|
||||
echo ' else';
|
||||
|
||||
echo " curr_user_query=\"SELECT nickname FROM users where nickname ilike '%\${blocked}%'\"";
|
||||
echo " curr_user_present=\$(sudo -u postgres psql -d pleroma -c \"\$curr_user_query\")";
|
||||
echo " if [[ \"\$curr_user_present\" != *'(0 '* ]]; then";
|
||||
echo " cd $PLEROMA_DIR";
|
||||
echo " sudo -u pleroma mix deactivate_user \${blocked}";
|
||||
echo ' fi';
|
||||
echo ' fi';
|
||||
echo ' fi';
|
||||
echo ' fi';
|
||||
|
@ -158,14 +166,14 @@ function create_pleroma_blocklist {
|
|||
echo ' fi';
|
||||
echo 'fi';
|
||||
echo '';
|
||||
echo 'cd /etc/postgresql';
|
||||
echo "if [ \$objects_updated ]; then";
|
||||
echo " sudo -u postgres psql -d pleroma -c \"\$objects_query\"";
|
||||
echo " sudo -u postgres psql -d pleroma -c \"\$users_query\"";
|
||||
echo 'fi';
|
||||
echo "if [ \$websub_server_subscriptions_updated ]; then";
|
||||
echo " sudo -u postgres psql -d pleroma -c \"\$websub_server_subscriptions_query\"";
|
||||
echo 'fi';
|
||||
echo '#cd /etc/postgresql';
|
||||
echo "#if [ \$objects_updated ]; then";
|
||||
echo "# sudo -u postgres psql -d pleroma -c \"\$objects_query\"";
|
||||
echo "# sudo -u postgres psql -d pleroma -c \"\$users_query\"";
|
||||
echo '#fi';
|
||||
echo "#if [ \$websub_server_subscriptions_updated ]; then";
|
||||
echo "# sudo -u postgres psql -d pleroma -c \"\$websub_server_subscriptions_query\"";
|
||||
echo '#fi';
|
||||
echo 'rm /tmp/pleroma-blocking.lock'; } > $blocking_script_file
|
||||
|
||||
chmod +x $blocking_script_file
|
||||
|
|
Loading…
Reference in New Issue