Coder Social home page Coder Social logo

cozygalvinism / pesterchum Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 1.91 MB

Pesterchum has hit the web! This web app let's you chat with your chumbuds while also staying very easy to install and use!

Home Page: https://cozygalvinism.github.io/pesterchum/

Makefile 0.48% Vue 13.93% JavaScript 76.07% SCSS 1.55% HTML 5.91% Dockerfile 2.06%
pesterchum homestuck vue webapp pwa irc

pesterchum's Introduction

Pesterchum

This is the repository for the WIP Pesterchum web application, located here!

It consists of multiple parts:

  1. The actual web app
  2. The gateway for the IRC connection
  3. The documentation for handling the "Pesterchum protocol"

The web app

The web app is written in Vue and is my first ever Vue project. I'm apologizing, if the code is written badly, if you have suggestions on how to improve it, please create a pull request or an issue!

The web app itself runs entirely in the browser, so nothing is stored on any server, only on your device. It is also installable through the magic of service workers, which means, that it acts like an independant app (you can see this beautifully on Android phones, because web apps are listed in the app list as regular installed apps!). It also features some theming options and, while it isn't as themeable as the original client, you can always provide your own theme using a pull request and let me merge it. If you do so, please create a theme for both light and dark mode. You can already natively change the colour of the app in the settings, if the yellow is too bright for you. The base theme is provided by vue-material, but this may change in the future, depending if I can actually implement a very own theme engine.

So far, the entire app CAN work offline, but you obviously won't be able to chat with people if you're not online, since you can't reach the actual servers. But you can at least change your preferences of the app!

While developing the web app, I have encountered an issue, which would have been a real show stopper: Chrome and Firefox will not let you connect to the usual IRC ports. This is most likely to prevent abuse and it's not circumventable by normal means. However, since I don't like giving up, I found a gateway server program, made by and for KiwiIRC.

The gateway for the IRC connection

The webircgateway is a simple Websocket gateway to IRC networks, which allows for connecting to IRC servers after all. It also has a builtin abuse prevention by forcing the user to solve a captcha (The Pesterchum app will include an invisible captcha, so you don't need to worry). I am hosting such a server here and will continue to do so. As far as I'm aware, there is little to no logging if the program is ran on the Warning log level, which is what I am going to do. In order to make hosting this server easier, I initially used a Docker image made by jtbouse (or UGNS), but this proved to be flawed, as the Docker image didn't have any ca-certificates installed (which are needed for the captcha check), so I modified the Dockerfile to my needs and am hosting it here as well, along with a default config. I personally use this default config, though slightly modified to use my captcha key and secret. For even more convenience, I wrote a docker-compose.yml file, which mounts the configuration file for the gateway, so you don't even have to do anything (except putting in your own captcha key and secret and setting up a reverse proxy) except running docker-compose up -d while you are in this directory (given you installed Docker; please do not create issues for this project related to the webircgateway).

If you want to test the IRC gateway, connect to my IRC gateway via Websocket at wss://ircgw.galvinism.ink/webirc/websocket/ while at the same time, open up this website and send the following messages in this order (you will not receive a response for each of these commands):

HOST pesterchum.xyz:6667
NICK ectoBiologist
USER pcc31 pesterchum.xyz pesterchum.xyz pcc31
CAPTCHA [the captcha string you see when opening the website without the square brackets]

This should let you connect to the IRC server and display the MOTD. You might get kicked off right away if you don't respond to PINGs accordingly, but as a PoC it works. Obviously the Pesterchum client handles the nitty-gritty IRC communication on its' own, as well as the handling of the "Pesterchum protocol".

The documentation for handling the "Pesterchum protocol"

Because there was little to no information on how Pesterchum is working behind the scenes, I was pretty much forced to dig through the Pesterchum source code which usually wouldn't be an issue, but since the entire application is over 10 years old, there's a ton of old coding practices as well as the source code running on the very much outdated Python 2.7 and Qt 4 engine. There are some forks, that claim to convert Pesterchum into a Python 3 + Qt 5 application, but so far, I haven't been able to find a version that's working properly.

Because I am a nice guy, I want to spare anyone this ridiculous task of reading source code and trying to understand it, so I am documenting everything to know about the Pesterchum protocol.

I will also mark this version of the protocol v1. In the future, I may implement features, that the normal Pesterchum client will not be able to process, which will run under a different protocol version (let's call this v2), though this version will be fully backwards compatible in order to not entirely break the old clients.

The documentation can eventually be found at the wiki of this repository.

Credits

  • illuminatedwax - for creating the original Pesterchum client and providing the server for it for the longest time
  • AstoriaFloyd - for modifying the original client to allow for multiple server selection
  • turntechCatnip and chaoticCharacte - for hosting alternative Pesterchum servers and therefore keeping the client running
  • KiwiIRC - for providing the webircgateway package
  • GitHub - for hosting the web app

Please let me know if I missed someone or got something wrong :)

pesterchum's People

Contributors

cozygalvinism avatar dependabot[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

pesterchum's Issues

Chat views

The chat views for memos and PMs still need to be implemented. How they will look like and where they will be, I haven't decided yet.

Implement IRC connection and command handling

This one is gonna be the heart of the whole application. In the beginning, I will most likely port the irc.py file from the Pesterchum repo over to JavaScript first and get it running with that and after that optimize the code to work as well, if not better than the original code.

  • NOTICE
  • PRIVMSG
  • WELCOME / 001
  • NICKNAMEINUSE / 433
  • QUIT
  • KICK
  • PART
  • JOIN
  • MODE
  • NICK
  • NAMREPLY / 353
  • ENDOFNAMES / 366
  • LISTSTART / 321
  • LIST / 322
  • LISTEND /323
  • UMODEIS / 221
  • INVITE
  • INVITEONLYCHAN / 473
  • CHANNELMODEIS / 324
  • CANNOTSENDTOCHAN / 404
  • TOOMANYPEEPS / 010
  • PING

Keeping chat and memo logs

Although this can make the app slow to load, so there might be a feature to archive logs and save them to a file and/or possibly even upload them to Pastebin/Hastebin?

Quirks

Quirks are a huge thing in the original Pesterchum, so this one obviously needs them too. I will most likely end up writing an easy to use regex creator for quirks along with an "advanced" mode for people that know regex.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.