Chat-tails:基于Tailscale的复古终端聊天
Chat-tails: Throwback terminal chat, built on Tailscale

原始链接: https://tailscale.com/blog/chat-tails-terminal-chat

布莱恩·斯科特创建了“chat-tails”,这是一个为《我的世界》玩家设计的、刻意极简的聊天应用程序,优先考虑安全性和复古在线体验。他对现代聊天应用程序感到不满,因此构建了一个类似于旧 IRC 界面的系统——基于文本、短暂且只能通过 Tailscale(一种网络工具)的邀请访问。 Chat-tails 缺乏语音聊天、头像或图像共享等功能,而是专注于为朋友提供一个私密、安全的连接空间,就像在本地网络上一样。它在终端中运行,使用简单的命令进行聊天和基本操作。斯科特利用 tsnet 库和 bubbletea UI 构建了这个应用程序,强调易用性和令人愉悦的美感,尽管它很简单。 这个项目在约两天内完成,也作为一种学习工具,让用户接触到 VPN、SSH 和终端界面等技术。虽然目前仍处于早期开发阶段,但 chat-tails 提供了主流平台之外的独特选择,可能吸引那些寻求隐私、简洁或怀旧在线体验的人。

## Chat-tails 与在线交流的未来 一个名为“Chat-tails”的新项目,基于Tailscale构建,提供复古的终端聊天体验。Hacker News上的讨论迅速转向对日益增长的在线监管的担忧,尤其是在澳大利亚和英国。用户担心年龄验证要求会扩展到VPN,甚至可能扩展到SSH和TLS等基本的网络工具。 一些人推测,政府可能会专注于控制*终端*——访问服务的设备,而不是强制要求在每个平台中安装后门。这引发了隐私问题,一些人认为目标是加强监控,而不是安全。 Yggdrasil、I2P和Tor等替代方案被提及,作为现有解决方案,用于直接、可路由的连接,让人联想到早期的互联网。另一些人指出IRC是一个可行的选择,但它需要更多的技术设置。对话还强调了简单、短暂通信的吸引力,将其与现代消息应用程序的复杂性形成对比。最终,用户们争论了便利性、隐私性以及政府寻求控制在线活动之间的平衡。
相关文章

原文

To find a safe space for his kid to chat with friends while playing Minecraft, Brian Scott had to go back to the future.

The chat went back, that is, to an IRC-like interface, run through a terminal. The connection and setup remain futuristic, because Scott used Tailscale, and tsnet, to build chat-tails.

Chat-tails is the opposite of everything modern chat apps are offering. Nobody can get in without someone doing some work to invite them. All the chats are ephemeral, stored nowhere easy to reach, unsearchable. There are no voice chats, plug-ins, avatars, or images at all, really, unless you count ASCII art. And that’s just the way Brian wanted it.

“It’s about, hey, you have this private space, across your friends’ tailnets, where you can chat, about the game you’re playing or whatever you’re doing,” Scott told me. “It’s supposed to be more like the days where you were all on the same LAN, you would bring your computers together and have a gaming session. Now you can kind of have that same type of feeling, no matter where you are in the world—just a nice private area where you can chat.”

There are two ways of running chat-tails: “Regular mode” and “Tailscale mode.” In Regular Mode, you run ./chat-server, feed it a port number, room name, and maximum number of users, and then it creates the chat, on your local network. You can log into your router and enable a port forward, if you want, every time you create the chat and want to let others in—but opening up a telnet-style chat port on your home router, the one you’re having your kids chat on, seems like a pretty bad idea. Your mileage may vary.

In “Tailscale Mode,” you do all the same things, except you provide two more things. One is a --hostname, which makes the chat accessible (to Tailscale users with whom you’ve shared this chat) at your Tailscale domain, like hostname.something.ts.net. The other thing you give it is an auth key, connecting it to Tailscale. With that, any device on the tailnet, or shared into it, can access the chat through an nc or telnet command, like telnet hostname.something.ts.net 2323.

And then you are chatting, in a terminal. Type some text, hit enter, and everyone sees it. There are four other commands, as of this writing: /who lists the users, /help shows you these four commands, /me gives your text the italicized “action” flavor (“reaches for an ice-cold Diet Coke”), and /quit, it quits. That’s the app, and while it might pick up some features over time (it added history options just recently), it’s doing just what it should right now.

A chat window, showing a list of users with colored names (Kevin, Other_Kevin, Devon), a conversation ("You both are Kevins?" "I'm an Other_Kevin" "* Kevin considers this statement"), and then the list of commands.

Scott is not a full-time code-writing developer, but has about 10 years’ experience working with Go. He had been eyeing the tsnet library for some time, thinking of projects that might fit a melding of Go and Tailscale. When his chat inspiration (chatspiration?) struck, he spent “about two days” learning and tinkering with the library for the first big effort.

“The tsnet (library) was actually the easiest thing,” Brian said. With the networking and verification pieces sorted, he just had to focus on the surprisingly hard task of getting text that one person types in a terminal to show up as text that another terminal user reads. “If you’re thinking of building something like Discord, you would incorporate some kinds of websocket communication, streamline everything across the wire. But for a terminal-based chat app, it’s really just TCP and UDP, just straight-up connections you’re actually dealing with.”

Making the chat look nicer than just a terminal line was helped along by bubbletea, a free and open-source terminal UI library. “While I was making this thing very minimal, I wanted to also make it very pleasing,” Brian said.

Anyone with experience building in Go could extend it or modify it, Brian said. He has looked at Go libraries for things like rendering images in terminal chat, and thought about how Taildrop could be used in a chat where everybody’s using Tailscale. Chat-tails is low-profile enough to easily run on a Raspberry Pi or similarly single-board computer (SBC); it might be leveraged as a portable, ephemeral chat to bring to events. Or it could just become a way for groups with a certain retro bent to replace their personal Slack or Discord setups.

But for now, it’s a fun way to offer his child and friends a safe learning space.

“You launch it on top of Tailscale, scale it as big as you want, and now your community is not only learning about VPN technology, but also the basics of SSH, terminal, things like that,” Brian said. “It feels good, very retro-futuristic, and fun.”

Brian’s chat-tails is included in our community projects hub. Built something neat with Tailscale? Submit it by email [email protected].

If you’re enjoying chat-tails, or other community projects, we’ve got a whole channel for that in our Discord, #community-projects. We’re also listening and sharing great projects on Reddit, Bluesky, Mastodon, and LinkedIn.

联系我们 contact @ memedata.com