Add njalla nginx files and organize into folders (#5)

Co-authored-by: NebulaOnion <nebulaonion@tutanota.com>
Reviewed-on: https://git.anonymousland.org/anonymousland/infrastructure/pulls/5
This commit is contained in:
NebulaOnion 2023-01-23 15:23:38 +00:00
parent c8d934eba8
commit 8d6fb20c2c
538 changed files with 20972 additions and 0 deletions

View file

@ -0,0 +1,2 @@
#!/bin/bash
docker exec -it synapse curl --header "Authorization: Bearer TOKEN" -X GET http://0.0.0.0:8008/_synapse/admin/v1/rooms/ROOMID/block

View file

@ -0,0 +1,29 @@
import requests
import urllib
token = 'TOKEN'
server = 'https://matrix.anonymousland.org'
api_rooms = f'{server}/_synapse/admin/v1/rooms?dir=b&from=0&limit=20&order_by=joined_local_members&access_token={token}'
delete_api = f'{server}/_synapse/admin/v1/rooms/'
local_users = 0
while local_users == 0:
r = requests.get(api_rooms)
print(r.text)
rooms = r.json()
headers = {
'authorization': f'Bearer {token}'
}
for room in rooms['rooms']:
local_users = room['joined_local_members']
if local_users == 0:
roomid = urllib.parse.quote(room['room_id'])
print('delete', delete_api + roomid)
r = requests.delete(delete_api + roomid, headers=headers, json={})
if r.status_code != 200:
print(r.text)
break
else:
print("there are local users in this room", room)
break
print("Done.")

View file

@ -0,0 +1,2 @@
#!/bin/bash
docker exec -it synapse curl --header "Authorization: Bearer TOKEN" -X GET http://0.0.0.0:8008/_synapse/admin/v1/rooms

View file

@ -0,0 +1,2 @@
#!/bin/bash
docker exec -it synapse curl --header "Authorization: Bearer TOKEN" -X POST http://0.0.0.0:8008/_synapse/admin/v1/background_updates/start_job -d '{ "job_name": "populate_stats_process_rooms" }'

View file

@ -0,0 +1,2 @@
#!/bin/bash
docker exec -it synapse curl --header "Authorization: Bearer TOKEN" -X POST http://0.0.0.0:8008/_synapse/admin/v1/purge_media_cache?before_ts=TIME-IN-UNIX