en:tecdoc:abusenotif

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
en:tecdoc:abusenotif [2021/03/17 16:13]
jomat created
en:tecdoc:abusenotif [2021/03/17 16:18]
jomat
Line 36: Line 36:
  
 curl -X PUT "https://asra.gr/_matrix/client/r0/rooms/${ROOM}/send/m.room.message/"`uuid -m -F SIV`"?access_token=${AT}" -H  "accept: application/json" -H  "Content-Type: application/json" -d " \"body\": \"@room New user registered: ${U} from ${IP}\",  \"msgtype\": \"m.text\"}" >> /tmp/reguser.txt 2>> /tmp/reguser.txt curl -X PUT "https://asra.gr/_matrix/client/r0/rooms/${ROOM}/send/m.room.message/"`uuid -m -F SIV`"?access_token=${AT}" -H  "accept: application/json" -H  "Content-Type: application/json" -d " \"body\": \"@room New user registered: ${U} from ${IP}\",  \"msgtype\": \"m.text\"}" >> /tmp/reguser.txt 2>> /tmp/reguser.txt
 +</code>
 +
 +====== Content Reports ======
 +<code - nginx.conf>
 + location ~ /_matrix/client/r0/rooms/.*/report/.* {
 + client_max_body_size 100M;
 + client_body_buffer_size 100M;
 +
 + proxy_pass http://127.0.0.1:8008;
 +                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 + proxy_set_header Host     $host;
 + proxy_set_header X-Real-IP $remote_addr;
 +                proxy_set_header X-Forwarded-Proto $scheme;
 +                proxy_set_header X-Forwarded-Ssl on;
 +                proxy_set_header X-SSL 1;                
 + rewrite_by_lua '
 +                  if ngx.var.request_method == "POST" then
 +                    os.execute("/usr/local/bin/matrix_event_reported")
 +                  end
 +                ';
 + }
 +</code>
 +
 +<code - /usr/local/bin/matrix_event_reported>
 +#!/bin/sh
 +
 +AT='MDMA...'
 +ROOM='!x1y2z3:example.com'
 +
 +echo date $* >> /tmp/report.log 
 +
 +
 +#https://asra.gr/.well-known/matrix/support
 +# abuse@matrix.org: https://matrix.to/#/!OGEhHVWSdvArJzumhm:matrix.org/$3CNYJIakytzbO6qI4eR8JmCVJUMUUm57YmjJJIOR-ic
 +
 +curl -X PUT "https://asra.gr/_matrix/client/r0/rooms/${ROOM}/send/m.room.message/"`uuid -m -F SIV`"?access_token=${AT}" -H  "accept: application/json" -H  "Content-Type: application/json" -d " \"body\": \"@room there was a event reported\",  \"msgtype\": \"m.text\"}"
 </code> </code>
  • en/tecdoc/abusenotif.txt
  • Last modified: 2021/08/22 10:04
  • by jomat