Updating pleroma filtering scripts
This commit is contained in:
parent
b535fb9b97
commit
5c656e0c16
|
@ -108,6 +108,7 @@ function create_pleroma_blocklist {
|
|||
echo 'users_query="DELETE FROM users WHERE"';
|
||||
echo 'websub_server_subscriptions_query="DELETE FROM websub_server_subscriptions WHERE"';
|
||||
echo 'websub_server_subscriptions_updated=';
|
||||
echo 'filter_str=';
|
||||
echo 'while read blocked; do';
|
||||
echo " if [[ \"\$blocked\" == *\".\"* || \"\$blocked\" == *\"@\"* ]]; then";
|
||||
echo " if [ \${#blocked} -gt 4 ]; then";
|
||||
|
@ -119,6 +120,13 @@ function create_pleroma_blocklist {
|
|||
echo " users_query=\"\${users_query} nickname ilike '%\${blocked}%'\"";
|
||||
echo ' objects_updated=1';
|
||||
echo " if [[ \"\$blocked\" != *\"@\"* ]]; then";
|
||||
echo ' # Create a filter string for the pleroma configuration';
|
||||
echo " if [ \"\$filter_str\" ]; then";
|
||||
echo " filter_str=\"\${filter_str}, \\\"\$blocked\\\"\"";
|
||||
echo ' else';
|
||||
echo " filter_str=\"\${blocked}\"";
|
||||
echo ' fi';
|
||||
echo '';
|
||||
echo " if ! grep -q \"127.0.0.1 \$blocked\" /etc/hosts; then";
|
||||
echo " echo \"127.0.0.1 \$blocked\" >> /etc/hosts";
|
||||
echo ' fi';
|
||||
|
@ -132,6 +140,19 @@ function create_pleroma_blocklist {
|
|||
echo ' fi';
|
||||
echo 'done </root/freedombone-firewall-domains.cfg';
|
||||
echo '';
|
||||
echo "if [ \"\$filter_str\" ]; then";
|
||||
echo " if ! grep -q \" \$filter_str \" $pleroma_secret; then";
|
||||
echo " sed -i \"s|media_removal:.*|media_removal: [ \$filter_str ],|g\" $pleroma_secret";
|
||||
echo " sed -i \"s|federated_timeline_removal:.*|federated_timeline_removal: [ \$filter_str ],|g\" $pleroma_secret";
|
||||
echo " sed -i \"s|removal:.*|removal: [ \$filter_str ]|g\" $pleroma_secret";
|
||||
echo " chown -R pleroma:pleroma $PLEROMA_DIR";
|
||||
echo ' sudo -u pleroma mix clean';
|
||||
echo ' sudo -u pleroma mix deps.compile';
|
||||
echo ' sudo -u pleroma mix compile';
|
||||
echo ' systemctl restart pleroma';
|
||||
echo ' fi';
|
||||
echo 'fi';
|
||||
echo '';
|
||||
echo 'cd /etc/postgresql';
|
||||
echo "if [ \$objects_updated ]; then";
|
||||
echo " sudo -u postgres psql -d pleroma -c \"\$objects_query\"";
|
||||
|
|
Loading…
Reference in New Issue