quackduck / devzat Goto Github PK
View Code? Open in Web Editor NEWThe devs are over here at devzat, chat over SSH!
License: MIT License
The devs are over here at devzat, chat over SSH!
License: MIT License
Originally posted by @quackduck in #154 (comment)
As far as I understand, there is no way to write single new lines when not in a code block. Single new lines are ignored by the markdown engine and double new lines are showed as a two new lines after formatting.
We might want to support a way to have two new lines. Maybe supporting the HTML <br>
tag would be the best way as it is a very common way to bypass this limitation of markdown.
While using devzat today we came up with the idea, that it would be nice to be able to reply to a comment of someone else!
It might be achievable through a small (like maybe 3 or 4 characters long) hash value shown in front of every message.
Typing
ping 1234 response
or something could work out nicely
Devzat should have an API for people to write their own bots & plugins.
The API should have some sort of authentication built in so server managers can ensure privacy and control what bots and plugins run on their instance. This is clearly needed in case we decide the API should provide a way to edit user messages (this would let custom emojis become such a plugin instead of a core feature, for example)
One way this could be done is to have authenticated JSON + HTTP endpoints for receiving or sending messages.
@Merlin04 & @CodeLongAndProsper90 have ideas I really like. Plugins can be programs that only run on the server (so plugins would need to be allowed by the server manager) and communicate with the Devzat instance in some way.
After a while if a users has been connected without saying anything their connection to the server will be closed.
Connection to closed by remote host.
i tried to compile it with modified "cmds" output in chinese, but some how it outputs strangely with unreadable contexts when i send that,it seems that there was an encoding error or sth,is there any way to fix that?
This has O(n) time, as opposed to the previous O(1) algo that worked when paste-bracketing wasn't enabled: https://github.com/quackduck/devzat/blob/main/devchat.go#L458
back when i ran a chat network we had a trivia bot, somewhere along the lines a questions database appeared and this is a snapshot of that.
https://github.com/electronoob/Voyager/blob/master/Modules/Trivia/questions.txt
pretty simple format. seems like the kind of thing you might want to add to your server.
France declares war on Austria, Prussia and Sardinia in which year*1792
I'm getting a permission denied error even though I have a public key generated. Any ideas?
λ ssh [email protected]
[email protected]: Permission denied (publickey).
λ ls ~/.ssh
id_rsa id_rsa.pub known_hosts known_hosts.old
Nice project! 👍
I'd be nice to have timestamps in the chat for messages and events, maybe optional ones that can be toggled.
Someone in the chat suggested I make an issue for this, but no rush or anything.
I think it will be easier for people to self-host this project on perm or as an enterprise solution for communication if there will be some proper documentation and releases for the project.
Would be cool to take this issue if possible.
Include DM status so that it isn't confusing whether a message will be a DM or go to a room.
Possible formats:
ishan: previous message
[to arc] ishan: wheee input
ishan: previous message
[arc] ishan: wheee input
Maybe this should show the current room in non-main rooms
ishan: previous message
[to #chaos] ishan: wheee input
ishan: previous message
[#chaos] ishan: wheee input
Maybe a more shell-y prompt like this:
ishan: previous message
ishan ~/#chaos $ wheee input
A major issue with these is that sent messages have a prefix shorter than and different to the prompt. As of now, the format is:
ishan: previous message
ishan: whee input
The current format has messages that look very similar to how they did on the prompt. However, people do have to use the pwd
or cd
commands to figure out their room/DM status as of now.
Hi there,
I tried to join for the first time tonight and was kicked then kb'd immediately. I'm guessing it has something to do with your current spam issues and me joining at a really bad time. This is the message I see when I try to connect:
devbot: You are banned. If you feel this was a mistake, please reach out at github.com/quackduck/devzat/issues or email
[email protected]. Please include the following information: [ID
42ae49dc6cdbb80b81ba2144385996e1b10cbb33896a062efbb68f9fe6cb1578]
Thanks for taking a look!
Many thanks for creating this awesome tool, it's really appreciated. However, I would like to integrate the hosted devzat into my terminal dashboard. But I couldn't get it working.
When I'm trying to connect with ssh to my host with port number supplied, everything is fine.
When I use a terminal dashboard like WTF Util or Termui or Sampler and using the same arguments as I did for SSH, I get an 255 error (in case of WTF terminal) or an error from sampler that it was not a stdin terminal.
So I'm out of ideas and was curious if devzat coulld support stdin output, or be integrated in another way in a terminal dashboard?
Its a mobile data ip so, probably banning more then 1 person, also my enter button broke and pressed constatly. No text was typed. I was bannend, Please unban
[ID cfbbc1395ac6f6c1b7628ff814d158d1f1045ede7b85d7809e85015db8c0c270]
Running a command like
ls anything_here
will throw an error like
ls: anything_here Permission denied
but still run the base command afterwards.
Line 721 in 73bbc47
when user A
issues command pwd
while in a private chat with user B
, both A
and B
will have shit printed in their shell. that's wild.
A Message being sent to you when connecting which gives basic info would be pretty cool. Should probably be able to be changed by command aswell.
I tried to change my name by using nick
command. However, when I entered the name changing prompt, I found I cannot cancel the operation and I had to type another name except the current one (if you type the current name, it will warn you the name is already in use).
I think there should be an option to support cancel such operations, or stay things unchanged. Just for a reference, my personal habit is to use Ctrl+D
to stop input in linux systems. But here I will exit the chat room directly if I type Ctrl+D
.
Relevant codes are in below:
Line 384 in b836179
There's no Nick command on beta
goal: allow for easy browsing of all devzat active installs, similar to 3rd party server lists for discord (see "disboard.org" and others).
the MUD gaming community has something called "global mud protocol" that allows you to ping servers for current status and general server info, if the server admin has implemented it.
basically this would allow devzat to feel like a single, scaled service even as it potentially scales to lots of disparate hosts.
For example, once I have joined the chat, I would run settings ~/.ssh/devzat_settings
. It would look something like this:
color pastel green
nick narnillian
pronouns he/him
Essentially, it would hold some boilerplate commands, with the same syntax and execution as if I ran them manually. Any command could be run from this file
The behavior of cd
is a bit weird. When being called with no argument, it list the content of all rooms. In an UNIX shell, cd
with no arguments brings the user to their home directory.
To make Devzat feels more UNIXy, we could change cd
so that calling it with no arguments is an alias to cd #main
and we add a -R
option to ls
that list the content of all rooms.
What do you think about it?
It would be cool if you would be able to protect your username with a password or something so the other side can be sure that you are actually you. Just an idea.
Enable using an option in the config file for when self-hosted server communities are large enough to need it. A couple randos on Hacker News have demonstrated that a swear filter is really necessary.
No idea why, no specific trigger I noticed
Then we could have better detection if messages are dms, instead of the hacky way (as I note in the comment) we do this detection rn:
if strings.HasSuffix(senderName, " <- ") || strings.HasSuffix(senderName, " -> ") { // kinda hacky
https://github.com/quackduck/devzat/blob/main/devchat.go#L265
As you know, Devzat is down from time to time. I think I managed to witness it crash when I tried to log in. Here is a copy-paste of my terminal when trying to log in.
^[n.n]^ ~ >ssh devzat
1h17m earlier
dunne: id dunne
2edd3297a02dd08d598fd0d8464de431e20cce345591fa73a89e3eabd5a786a1
dunne: users
[Arkaeriit dunne]
dunne: id Arkaeriit
d6acd2f5c5a8ef95563883032ef0b7c0239129b2d3672f964e5711b5016e05f5
dunne: kick d6acd2f5c5a8ef95563883032ef0b7c0239129b2d3672f964e5711b5016e05f5
User not found
dunne: kick Arkaeriit
devbot: Not authorized
dunne: :(
devbot: dunne has left the chat
devbot: dunne stayed on for 2m
1h16m earlier
devbot: https://twitter.com/devzat/status/1465281827774607369
5m earlier
devbot: Arkaeriit has left the chat
devbot: Arkaeriit stayed on for 3h0m
Connection to devzat.hackclub.com closed by remote host.
Connection to devzat.hackclub.com closed.
^[n.n]^ ~ >ssh devzat
ssh: connect to host devzat.hackclub.com port 22: Connection refused
This happen at around 12:44 UTC.
A few minutes before the crash, I was disconnected because I turned down my computer and the crash happen when I tried to log back in. Maybe the crash is related to the unconventional exit.
It would be nice to have the following definable in a YAML config file.
The following could be merged into a single credentials file:
The slack bot forwards messages from slack back to slack causing messages to be sent twice
If we did not upload a public key to the server, it is impossible to log in.
If we upload a key with ssh-copy-id it works but I really think we should let people join without keys.
I tried to send [](https://xkcd.com/949/)
and I got:
[running]: runtime/debug.Stack()
┃ /snap/go/current/src/runtime/debug/stack.go:24 +0x65
┃
main.protectFromPanic()
┃ /home/ubuntu/devzat/util.go:109 +0x5f
┃
panic({0xe50200, 0x17a61a0})
┃ /snap/go/current/src/runtime/panic.go:884 +0x213
┃
github.com/quackduck/go-term-markdown.(*renderer).RenderNode(0xc0000f0420, {0x1180fe0, 0xc000090000}, {0x118a660?, 0xc000538b60?}, 0x1)
┃ /home/ubuntu/go/pkg/mod/github.com/quackduck/[email protected]/renderer.go:310 +0x1381
┃
github.com/gomarkdown/markdown.Render.func1({0x118a660?, 0xc000538b60?}, 0x20?)
┃ /home/ubuntu/go/pkg/mod/github.com/gomarkdown/[email protected]/markdown.go:63 +0x47
┃
github.com/gomarkdown/markdown/ast.NodeVisitorFunc.Visit(0x118a810?, {0x118a660?, 0xc000538b60?}, 0xe0?)
┃ /home/ubuntu/go/pkg/mod/github.com/gomarkdown/[email protected]/ast/node.go:574 +0x2e
┃
github.com/gomarkdown/markdown/ast.Walk({0x118a660, 0xc000538b60}, {0x1183760, 0xc000078d60})
┃ /home/ubuntu/go/pkg/mod/github.com/gomarkdown/[email protected]/ast/node.go:546 +0x59
┃
github.com/gomarkdown/markdown/ast.Walk({0x118a810, 0xc000131380}, {0x1183760, 0xc000078d60})
┃ /home/ubuntu/go/pkg/mod/github.com/gomarkdown/[email protected]/ast/node.go:557 +0x145
┃
github.com/gomarkdown/markdown/ast.Walk({0x118a348, 0xc000131320}, {0x1183760, 0xc000078d60})
┃ /home/ubuntu/go/pkg/mod/github.com/gomarkdown/[email protected]/ast/node.go:557 +0x145
┃
github.com/gomarkdown/markdown/ast.WalkFunc(...)
┃ /home/ubuntu/go/pkg/mod/github.com/gomarkdown/[email protected]/ast/node.go:580
┃
github.com/gomarkdown/markdown.Render({0x118a348, 0xc000131320}, {0x1187d10, 0xc0000f0420})
┃ /home/ubuntu/go/pkg/mod/github.com/gomarkdown/[email protected]/markdown.go:62 +0xd7
┃
github.com/quackduck/go-term-markdown.Render({0xc000820ac0, 0x1a}, 0xf4e1c3?, 0x2?, {0x0, 0x0, 0x0})
┃ /home/ubuntu/go/pkg/mod/github.com/quackduck/[email protected]/markdown.go:32 +0xbe
┃
main.mdRender({0xc000820aa0?, 0x4?}, 0x6, 0xbf)
┃ /home/ubuntu/devzat/util.go:134 +0x10f
┃
main.(*User).writeln(0xc00057a900, {0xc00077ee28, 0x13}, {0xc000820aa0, 0x19})
┃ /home/ubuntu/devzat/main.go:583 +0x291
┃
main.(*Room).broadcastNoBridges(0x17b05e0, {0xc00077ee28, 0x13}, {0xc000820aa0, 0x19})
┃ /home/ubuntu/devzat/main.go:266 +0x125
┃
main.(*Room).broadcast(0x17b05e0?, {0xc00077ee28?, 0x13?}, {0xc000820aa0?, 0x19?})
┃ /home/ubuntu/devzat/main.go:217 +0x348
┃
main.runCommands({0xc000820a00?, 0xc000346330?}, 0xc00020e400)
┃ /home/ubuntu/devzat/commands.go:121 +0x432
┃
main.(*User).repl(0xc00020e400)
┃ /home/ubuntu/devzat/main.go:804 +0x445
┃
main.main.func3({0x1190bd8?, 0xc00029a340})
┃ /home/ubuntu/devzat/main.go:152 +0xaf
┃
github.com/gliderlabs/ssh.(*session).handleRequests.func1()
┃ /home/ubuntu/go/pkg/mod/github.com/gliderlabs/[email protected]/session.go:261 +0x2d
┃
created by github.com/gliderlabs/ssh.(*session).handleRequests
┃ /home/ubuntu/go/pkg/mod/github.com/gliderlabs/[email protected]/session.go:260 +0x51c
┃
Add support to kick users online that have the same id as you.
Use case:
I can work on this but it won't look good. xD
I tried running the ssh devzat.hackclub.com command.
I keep getting this error:
ssh: Connection to @devzat.hackclub.com:22 exited: Connect failed: Connection refused
OMG this is amazing. Thanks for sharing this. I would like to ask if it is possible to support other language? For e.g., when I use Vietnamese, the font is messed up. Is there a solution for this? Thanks!
Demo of the issue: https://asciinema.org/a/1dhK4SCMVSAnm8l6FFBdvxtcZ
Function with the problem:
Line 749 in da1ceb1
The code in question is this, from the util.go
file:
func saveBans() {
f, err := os.Create("bans.json")
if err != nil {
l.Println(err)
return
}
j := json.NewEncoder(f)
j.SetIndent("", " ")
err = j.Encode(bans)
if err != nil {
rooms["#main"].broadcast(devbot, "error saving bans: "+err.Error())
l.Println(err)
return
}
f.Close()
}
func readBans() {
f, err := os.Open("bans.json")
if err != nil && !os.IsNotExist(err) { // if there is an error and it is not a "file does not exist" error
l.Println(err)
return
}
err = json.NewDecoder(f).Decode(&bans)
if err != nil {
rooms["#main"].broadcast(devbot, "error reading bans: "+err.Error())
l.Println(err)
return
}
f.Close()
}
These should probably have a defer f.Close()
call after the file is opened successfully. Currently, the file handle never gets closed if the file exists and Encode/Decode fails.
The input in Devzat is quite poor. The fact that it is not possible to comfortably edit multi-lines messages is a bit sad. We should probably refactor that system. Maybe there are some external library to handle that kind of tasks.
Unicode support would be nice.
Looks like there is support for different chat systems, such as Slack. Matrix server is a privacy focused decentralized chat and VOIP... I would request creating a bridge for Matrix. It too, has a Slack bridge and may be something to leverage with this system.
I don't have any screenshots but when I try to log into the server using Kitty terminal it craps out a bunch of junk on the screen I don't have any screenshots right now. I'm at work but I will give you more details later
b@m1 ruby % ssh [email protected]
The authenticity of host 'devzat.hackclub.com (150.136.142.44)' can't be established.
RSA key fingerprint is SHA256:0NFbqn9ACSQBVVjvqcVsGl0vtVUq9n//nJgEwB25UFk.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'devzat.hackclub.com,150.136.142.44' (RSA) to the list of known hosts.
1h6m earlier
devbot: https://twitter.com/devzat/status/1516081481306808328
integ1: cmds
Commands
= DM with
users List users
color Change your name's color
exit Leave the chat
help Show help
man Get help for a specific command
emojis See a list of emojis
bell on|off|all ANSI bell on pings (on), never (off) or for every message (all)
clear Clear the screen
hang <char|word> Play hangman
tic Play tic tac toe!
devmonk Test your typing speed
cd #room|user Join #room, DM user or run cd to see a list
tz [24h] Set your IANA timezone (like tz Asia/Dubai) and optionally set 24h
nick Change your username
pronouns @user|pronouns Set your pronouns or get another user's
theme |list Change the syntax highlighting theme
rest Uncommon commands list
cmds Show this message
ishan: whats your gh username
integ1: cd
Rooms and users
#main: [integ1] Admins: [ishan]
integ1: dope
integ1: later
integ1: exit
devbot: integ1 has left the chat. They were online for 2m
1h4m earlier
devbot: https://twitter.com/devzat/status/1516081966747205632
39m earlier
devbot: TuzArbuz has joined the chat
devbot: TuzArbuz has left the chat
33m earlier
ishan: oop
27m earlier
ishan: where's electronoob :/
4m earlier
ishan: i wish there was a go port of https://github.com/finnbear/rustrict
Welcome to the chat. There is one more user
devbot: dataf3l has joined the chat
dataf3l: users
[dataf3l] Admins: [ishan]
dataf3l: love this new technology
dataf3l: is there like a listserv or like a list of channels of any kind?
1m in
devbot: https://twitter.com/devzat/status/1516098352571883527
dataf3l: cd #javascript
devbot: dataf3l has joined #javascript
dataf3l: users
[dataf3l] Admins: []
11m in
devbot: ishan has joined #javascript
ishan: hey there
ishan: ls
README.md dataf3l/ ishan/ #main/ #javascript/
25m in
ishan: cd
Rooms and users
#javascript: [dataf3l] Admins: [ishan]
#main: [] Admins: []
48m in
ishan: yeet
ishan: cd
Rooms and users
#javascript: [dataf3l] Admins: [ishan]
#main: [.bashrc] Admins: []
ishan: cd #main
ishan is joining #main
1h13m in
dataf3l: ls
README.md dataf3l/ #main/ #javascript/
dataf3l: cd #main
devbot: dataf3l has joined #main
devbot: Slap the developers in the face for me, the server almost crashed, also tell them this: runtime error: slice bounds out of range [21:20], stack: goroutine 1826 [running]: runtime/debug.Stack()
┃ /usr/local/go/src/runtime/debug/stack.go:24 +0x65
main.main.func3.1()
┃ /home/ubuntu/devzat/main.go:162 +0x5f
panic({0xa4d2a0, 0xc0002fc708})
┃ /usr/local/go/src/runtime/panic.go:1038 +0x215
github.com/TwiN/go-away.(*ProfanityDetector).Censor(0xc0000ab1a0, {0xc000484540, 0x19})
┃ /home/ubuntu/go/pkg/mod/github.com/!twi!n/[email protected]/goaway.go:178 +0x70f
main.rmBadWords(...)
┃ /home/ubuntu/devzat/util.go:280
main.runCommands({0xc000484540, 0x19}, 0xc00007e2d0)
┃ /home/ubuntu/devzat/commands.go:88 +0x66
main.(*User).repl(0xc00007e2d0)
┃ /home/ubuntu/devzat/main.go:663 +0x3d8
main.main.func3({0xc3b7b0, 0xc0001acf70})
┃ /home/ubuntu/devzat/main.go:165 +0x53
github.com/gliderlabs/ssh.(*session).handleRequests.func1()
┃ /home/ubuntu/go/pkg/mod/github.com/gliderlabs/[email protected]/session.go:262 +0x2d
created by github.com/gliderlabs/ssh.(*session).handleRequests
┃ /home/ubuntu/go/pkg/mod/github.com/gliderlabs/[email protected]/session.go:261 +0x514
Connection to devzat.hackclub.com closed by remote host.
Connection to devzat.hackclub.com closed.
b@m1 ruby %
Can you write down the steps?
Issue
Right now admins look all the same as any other user. Any user can nick themselves as the preferred username of an admin, such as ishan
.
It should be imperative that administrators can be distinguished easily from normal users. The only method right now is to go to the repository and check admins.json
, but that will not work if this software is deployed elsewhere, on top of being clumsy and annoying.
There are three suggested solutions to this problem:
admins
or operators
command, which lists the IDs of all admins (any user's ID is public), not unlike lsbans
. This is easy to implement although tedious to sort through, especially if there are a lot of admins.users
, allowing a member to quickly check if any given user is an administrator.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.