!BdLmuYxxJLTcSOjoxj:matrix.org

Admin' of Matrix Using I.E.: Bash Scripting, cURL, JSON, et cetera. ☞ ؟⸮UNOFFICIAL⸮؟ – Self Support Community for community self support.

42 Members
Depositary workgroup for some good code snippets that get things done in Matrix rooms and Homeservers, despite lag and GUI client freezing¦hanging, from ye ole terminal emulated command prompt. ¶Aimed at intermediate skilled practicioners. ¶Kindly prefer POST over GET method as appropriate, where putting your access_token in a URL/URL that leaves the browser is not smart. ¶Get a cli on that mobile! • Try to post files that Matrix clients may read natively. • We should have a list of all working Event Types i.e. m.room.power_levels . • https://web.archive.org/web/20180712100113/https://gist.github.com/RickCogley/69f430d4418ae5498e8febab44d241c9 • https://matrix.org/docs/api/client-server/ • https://github.com/anoadragon453/matrix-scripts • https://en.wiktionary.org/wiki/depositary http://grammarist.com/usage/depository-repository/ https://en.wiktionary.org/wiki/depository25 Servers

Load older messages


Timestamp Message
15 Mar 2020
15:27:12@MilkManzJourDaddy:matrix.orgMMJD-MxO

Best I can do for now is dump from some of my notes...

N.b. I generally do mine via Bash on Linux, but also sometimes cli/terminal(emulator). Use case for single quote "'" and double-quote """ are mixed below, as in original spec'/gists or what has worked for @me.

In the !Room_ID:SomeHomeserver.tld , I had to excape "!" as "%21"

Be careful about Room Power Levels. I recommend to NEVER leave a default Mod' PL50 with the default PLs. They may /upgrade a room on you, or stomp the E2EE button, et cetera, which can be most problematic.

15:27:34@MilkManzJourDaddy:matrix.orgMMJD-MxO

Example for KICK which works for me:

	curl -XPOST -d '{"reason": "<Kick_Reason>", "user_id":"<MXID_to_be_KICKED>"}' "https://<YourHomeserverDomain.tld>/_matrix/client/r0/rooms/<Room_ID_from_which_to_KICK_the MXID>/kick?access_token=<Access_Token>"
15:28:27@MilkManzJourDaddy:matrix.orgMMJD-MxO

Create Room (in context for tombstone-ing an old room):

	curl -s -X POST -H "Authorization: Bearer <Access_Token>" -H "Content-Type: application/json" --data-binary '{"name":"My New Room","room_version":"5","creation_content":{"predecessor":{"room_id":"THE_OLD_ROOM_ID","event_id":"THE_LAST_EVENT_ID_IN_THE_OLD_ROOM"}}}' https://<YourHomeserverDomain.tld>/_matrix/client/r0/createRoom"

Tombstone:

	curl -s -X PUT -H "Authorization: Bearer <Access_Token>" -H "Content-Type: application/json" --data-binary '{"replacement_room":"!anBfpQxBwlcTjcymls:<YourHomeserverDomain.tld>"}' 'https://<YourHomeserverDomain.tld>/_matrix/client/r0/rooms/<Old_Room_ID>/state/m.room.tombstone'

So, MAYBE just omiting a reference to an old room might work for the createRoom endpoint.

15:28:37@MilkManzJourDaddy:matrix.orgMMJD-MxO¯\_(ツ)_/¯
15:28:58@MilkManzJourDaddy:matrix.orgMMJD-MxOSee also: https://matrix.org/docs/spec/client_server/latest.html#post-matrix-client-r0-createroom
15:30:10@MilkManzJourDaddy:matrix.orgMMJD-MxO *

Create Room (in context for tombstone-ing an old room):

	curl -s -X POST -H "Authorization: Bearer <Access_Token>" -H "Content-Type: application/json" --data-binary '{"name":"My New Room","room_version":"5","creation_content":{"predecessor":{"room_id":"THE_OLD_ROOM_ID","event_id":"THE_LAST_EVENT_ID_IN_THE_OLD_ROOM"}}}' https://<YourHomeserverDomain.tld>/_matrix/client/r0/createRoom"

Tombstone:

	curl -s -X PUT -H "Authorization: Bearer <Access_Token>" -H "Content-Type: application/json" --data-binary '{"replacement_room":"!anBfpQxBwlcTjcymls:<YourHomeserverDomain.tld>"}' 'https://<YourHomeserverDomain.tld>/_matrix/client/r0/rooms/<Old_Room_ID>/state/m.room.tombstone'

So, MAYBE just omiting a reference to an old room might work for the createRoom endpoint.

15:32:02@MilkManzJourDaddy:matrix.orgMMJD-MxOYou will probablyy want a cURL "device"...
15:35:44@MilkManzJourDaddy:matrix.orgMMJD-MxO Here ya' go:
curl -XPOST -d '{"type":"m.login.password", "user":"<Your_MXID>", "password":"<Your_Password>", "initial_device_display_name": "<Your_Arbitrary_Device_Name>"}' "https://<YourHomeserverDomain.tld>/_matrix/client/r0/login"
15:37:10@MilkManzJourDaddy:matrix.orgMMJD-MxO IIRC that should return an Access_Token.
15:38:19@MilkManzJourDaddy:matrix.orgMMJD-MxOSee https://matrix.org/docs/spec/client_server/latest.html -- and maybe you can find a good gist on i.e. GitHub/Gitlab. Searx is your friend.
15:38:23@MilkManzJourDaddy:matrix.orgMMJD-MxO😉
16 Mar 2020
04:18:30@its_notme:matrix.orgits_notme Holy Toledo! That is complicated!
Thank you non-the-less, though, for the answer!
08:01:23@MilkManzJourDaddy:matrix.orgMMJD-MxO Write a Bash script and tell us about "complicated", because some things are plenty counterintuitive.
08:01:34@MilkManzJourDaddy:matrix.orgMMJD-MxO😉
08:01:42@MilkManzJourDaddy:matrix.orgMMJD-MxO You're Welcome.¦No problem.¦🍻
18 Mar 2020
06:27:55@michelle:privacytools.io@michelle joined the room.
06:40:35@michelle:privacytools.io@michelleI just managed to sneak in under the wire?
06:42:09@michelle:privacytools.io@michelle * I just managed to sneak in under the wire?
10:27:56@MilkManzJourDaddy:matrix.orgMMJD-MxO@michelle: WTF are you talking about, even? In the catalogue of rooms I maintain, I ask folks to be topical, and behave.
10:30:24@MilkManzJourDaddy:matrix.orgMMJD-MxO

(I see the edits, via Riot-Android.)

Did I sneak in under the wire or piss you off enough to lock the door?

15:22:35@michelle:privacytools.io@michelle
In reply to @MilkManzJourDaddy:matrix.org
@michelle: WTF are you talking about, even? In the catalogue of rooms I maintain, I ask folks to be topical, and behave.
I was asking if you decided to stop uninvited guests from joining before or after I joined. Didn't think you'd appreciate it phrased as a joke so I edited.
15:29:44@MilkManzJourDaddy:matrix.orgMMJD-MxO

We had trouble with sockpuppeting trolls. Their Homeserver Dev'Op'(s) refused to act, or were complicit. After I ACL Banned their Homeserver, they started making SockPuppets on other Homeservers, i.e. matrix.org . In the future after I "upgrade" manually via cURL, new joiners will be muted.

This is topical in our self Regulators' room. I'll make certain you have an invite, if not already a member. I made that invite-only, for the same reason.

15:45:51@MilkManzJourDaddy:matrix.orgMMJD-MxO

And I actually LOVE good comedy, and loathe that outrage mobs have eviscerated the art. Even so, "There's a time and a place for [almost] everything."

</offtopic>

21 Mar 2020
13:55:04@MilkManzJourDaddy:matrix.orgMMJD-MxObanned@tojoarigoto:matrix.org@tojoarigoto:matrix.org (Obvious sockpuppet used to promote rival rooms and FUD on the peacable rooms other people maintain.).
28 Mar 2020
21:36:43@MilkManzJourDaddy:matrix.orgMMJD-MxObanned@frauhamsterx:matrix.org@frauhamsterx:matrix.org (Sockpuppeting ban evader who is either deliberately trolling or a dysfunctional and delusional or paranoid person who is in need of counseling. Sad, but not our responsibility.).
29 Mar 2020
01:29:16@EricGrahamMacEachern:matrix.orgEric Graham MacEachern changed their display name from EricGrahamMacEachern to EricGrahamMacEac.
01:47:26@EricGrahamMacEachern:matrix.orgEric Graham MacEachern changed their display name from EricGrahamMacEac to "Eric Graham MacEachern".
01:47:59@EricGrahamMacEachern:matrix.orgEric Graham MacEachern changed their display name from "Eric Graham MacEachern" to EricGrahamMacEachern.
01:51:11@EricGrahamMacEachern:matrix.orgEric Graham MacEachern changed their display name from EricGrahamMacEachern to Eric Graham MacEachern.
6 Apr 2020
15:59:29@MilkManzJourDaddy:matrix.orgMMJD-MxObanned@runnurs:matrix.org@runnurs:matrix.org (Spam-'bot.).

There are no newer messages yet.


Back to Room List