Log in to leave a comment
/reload command (admin only) - this command essentially reloads all server config meaning you dont have to restart server every time you edit config eg to add a user as admin etc.--version or -v flag to the server (lantern-server) so you can quickly check what version of the code you have installed (will add to client cli later today).
Log in to leave a comment
/purge command to remove the last n messages from chat/snap command - takes photo directly from your camera and sends to the active chat (initial implementation courtesy of dennis.Log in to leave a comment
/purge command - admin only - removes the last n messages from the main chat, this has been needed for a long time..
Log in to leave a comment
/snap command which takes a picture from your webcam/laptop camera and sends it to the active chat.
Log in to leave a comment
Mostly just a few smaller features :)
/rename allows for the renaming of user acccounts - changed from /changeusername./disp correctly redacts in main chat regardless of state of client./disp command shows a “not supported in DMs message” if ran in DMs instead of sending the message to the main chat lmaoosascript / notify-send
No real changes, just reinstall with pip or pipx.
pip install --upgrade lantern-chat
If you encounter any issues or bugs, please submit an issue (or a PR).
Log in to leave a comment
/img command.pip install --upgrade lantern-chat
Some users may encounter an error message asking them to create a virtual env, the easiest way to get around this (other than creating a venv) is to install the package with
pipx- this will place the binaries forlanternandlantern-serverin the~/.local/bindirectory so make sure that is in yourPATH.
/img to open the file picker or simply paste an image into the chat with CTRL + V.
/disp <seconds> <message> command — sends a message that redacts itself[bob]: hello world becomes [bob]: ***** ****** per character, spaces maintained)And I have also been working on image support - by converting images to ascii. Currently, I’ve finished the image conversion logic and I am currently working on creating a menu that acts as a file picker and then will move onto the networking.
Log in to leave a comment
finished the command mode logic and integrated it into the status bar. Commands can also be used simultaneously ie “wq” saves and quits.
this now allows for the running of commands like
Log in to leave a comment
big news!
lantern is now available as a pip package on PYPI. Install it with:
pip install lantern-chat
This provides two commands - lantern and lanten-server. lanten allows you to run the client and of course lantern-server allows you to run the server. All configs are stored in ~/.config/lantern. :)
If prefer to build from source or install it via a wheel file then check out the releases below:
https://github.com/benjibrown/lantern/releases/tag/v1.0.0
Log in to leave a comment
lots of debugging and also some additional features:
TODO:
Log in to leave a comment
finally have an actual text editor (although file saving isnt quite there yet lol)
finished off the editor and statusbar widgets today. visual mode selection highlighting landed in editor.py, then the rest of the editor rendering got polished up gutter, cursor, cursorline, the works. statusbar is now complete with the mode pill, filename, modified dot and cursor position. also started a theme config file (colors.toml) so colours can eventually be swapped out without touching code -c atppuccin mocha as the default for now.
Log in to leave a comment
Log in to leave a comment
its official, the spaghetti code of my classes and functions has now become organised spaghetti
updated the main file so txtr actually does something when called (although still no ui yet)
finished the modes logic:
INSERT - text goes into the buffer (where you actually edit files as you would normally)
NORMAL - default mode, each keypress is a command
VISUAL - selection of characters
VISUAL LINE - same as visual but line by line
COMMAND (WIP) - the : command prompt, hardly ready yet.
Also added some vim inspired keybinds (heavily inspired as this is a vim-style editor and its what im used to)
The basic things include:
gg and G - jump to start/end
u/ctrl r - undo/redo
and a lot more, theyre all in the repo :)
Also cleaned up some buffer code and fixed a little bit of logic :)
(and i managed to make it actually install as a pip package this time)
Log in to leave a comment
the buffer is pretty much sorted, the main logic for deletions, undo/redo (i love stacks), file writing/opening etc is done.
Log in to leave a comment
New project!! (lantern is still going dw)
This is my first devlog for txtr (aka texitor).
txtr/texitor will be a Vim-style text editor, specifically designed for incredibly fast LaTeX typesetting or in more simple terms, writing cool math equations way faster than you could hand write them :)
So far, I have created the initial structure of the project, created a pyproject.toml file for the pip package that this will eventually be distributed as and also have begun to code some core logic such as the buffer and modes (insert, visual, normal etc).
(no code output yet so heres a ss of the repo lol)
Log in to leave a comment
Couple things added, mostly just been testing the client.
Log in to leave a comment
Bug 1 — Chunked history packet loss
Channel history is sent as a series of chunks when you join:
[CHANNEL_HISTORY]|0|<chunk>
[CHANNEL_HISTORY]|1|<chunk>
[CHANNEL_HISTORY]|2|<chunk>
[CHANNEL_HISTORY_END]
The client reassembles these by index into a buffer then JSON parses the whole thing. If UDP drops a single chunk (or [CHANNEL_HISTORY_END] itself arrives before a chunk due to reordering), you get either empty slots in the buffer or json.loads() fails on malformed data. Either way it silently falls into an exceptblock that just sets authenticated = True` and moves on. Hence, no messages load.
Bug 2 — DM history truncated
[DM_HISTORY] was sent as one big UDP packet. Both sides called recvfrom(4096) — 4096 bytes is the buffer size. A DM conversation with any meaningful history easily exceeds that. The packet gets truncated, JSON parse fails, empty conversation. Same exact thing lol.
Log in to leave a comment
The past hour I’ve worked on lantern I haven’t actually written much new code.
My main aim has been testing the program over a different network (not my home) and across multiple devices.
This has allowed me to find numerous bugs which I will be working on in future to resolve.
–> When you join, the server sends history as multiple [CHANNEL_HISTORY]|{idx}|{chunk} packets, then [CHANNEL_HISTORY_END]. If any single chunk is dropped (or arrives after END due to reordering), the client does “”.join(buffer) with empty slots → malformed JSON –> silent failure in the
except block –> no messages shown.
This is the main downside of UDP and so i am thinking about swapping the whole chat client over to TCP - I’ll probably push the existing UDP client to a different branch and work on the updated TCP version on the maim branch of the repo. This will take a while…
Log in to leave a comment
Been busy today so haven’t gotten much done but oh well.
Log in to leave a comment
Log in to leave a comment
Removed a bit of debug code I left in the source lol
Have done a bit more work toward the autocomplete function for commands, I have finished writing the key capture methods for it (ie arrow keys used to scroll popup menu if active, if not then scroll chat) and I am now finishing off command descriptions and working on displaying the actual window.
begin implementation of cmd autocomplete (36a9937)
remove debug code - print(token) unnecessary and server host shouldnt need access to user tokens (a4671c5)
Log in to leave a comment
Began implementation of command autocomplete - popup menu appears when typing /… .
Moved ADMIN tag to other side of username
Fixed a few bugs
/stats command now displays stats for the user running the command if no user given
/stats command to output either ur stats or the requested users stats - messages sent, banned state, mute state etc, will add last online etc later (c485e9e)
move admin tag to the right side of username, update .gitignore (69d01d6)
begin implementation of cmd autocomplete (36a9937)
Log in to leave a comment
Updated the README - more instructions on how to actually use Lantern and how to spin up a server.
Also added the requirements.txt file which is referenced in the README, allowing for easy installation of dependencies
–> luckily the only dependency that is not pre-installed on python is “rich”, so Lantern remains relatively lightweight in terms of packages required.
I will be adding a more modular config system for the sever, allowing you to easily customise many features such as max message length, custom join messages etc.
I will also be working on a stats command that allows you to easily view your own stats or other user’s stats (messages sent, privileges, muted state, last online etc).
req.txt (17a9493)
readme lol (31cb702)
Log in to leave a comment
Log in to leave a comment
Big update today :)
Log in to leave a comment
Few implementations I have been working that have proven to be pretty time consuming:
User session tokens - instead of identifying users purely on their username, I have decided to implement a function that assigns each user a session token every time they connect to the client. This means that people cannot impersonate users (still a WIP).
Following on from this, I am currently working on adding server admins.
–> Server admins will be able to mute users, ban users, change usernames etc. This is the main reason for adding user tokens as the sever will store the user tokens for all users but also those for server admins and will check that every admin command used is only sent by a user who has an admin user token before executing the command.
These two features are still a WIP.
I have also implemented server side max message length control - so instead of this being determined by clients, it is not retrieved from the server upon connection. I am also going to implement more sever-side config options.
Also updated the README on the Github repo.
Few new commands too - /logout to logout of the current user account.
System alerts now appear even when you are in DM mode.
Will probably remove the /channel command and just use /back. - might add configurable command aliases if I feel it is worth the time.
Log in to leave a comment
Couple quick fixes today (still took 2 hours to debug this lol)
Log in to leave a comment
Log in to leave a comment
Also currently working on a nicer help menu that isn’t just a boring list of commands.
Log in to leave a comment
Short Update
Log in to leave a comment
Current WIP:
There are a few other additions I have made - will include these in the next devlog. Currently working on a hotfix for the notifications and ensuring they only send when the window that the client is running in is not focused.
Log in to leave a comment
Added notification support, notifications are sent under one of the following conditions:
In order to implement this, I will likely just check when a user has last interacted with the TUI ie the last time they pressed any key and comparing that to the current time and if it is above a certain threshold then sending a notification.
Log in to leave a comment
First iteration has been pushed to GitHub.
Current/New features:
Log in to leave a comment
I have built the first prototype of the chat client - currently all the code is split into a server and client file however I will be shifting to an OOP approach before publishing this first iteration to GitHub. I have added a basic TUI in curses alongside some args that can be passed when the program is run, these are:
-s/–server –> change server (defaults to 0.0.0.0)
-p/–port –> change port (defaults to 6000)
-u/–username –> set username (defaults to your local device username)
Username formats all follow the same structure:
[username]@[hostname]
where username is either your local account username (ie the name of your home directory) or the username passed as an argument to the program and hostname is your device’s hostname.
The server is required for clients to be able to talk over a LAN/network - the server logs all users, messages and allows for clients to fetch the online users to display in a user list on the main TUI.
I have also implemented a status bar which gives the current time, number of users connected, your ping in ms, and your uptime as a client.
Some networks such as my school network prevent me from using this client to chat over a LAN (something to do with opening ports and connecting to sockets) - a work around I have devised for this is to use a tunneling service to tunnel the port my server is hosted at to an IP that is accessible from any network.
Log in to leave a comment
Spent some time researching different ways I could build a TUI through python. I have settled on Curses - although it is much more complex compared to other TUI libraries such as blessed or textual, this additional complexity makes way for much greater levels of customization and functionality. I have begun reading the docs and creating small terminal interfaces to familiarize myself with curses.
Log in to leave a comment
Created the main framework for the project - including the main program file and any additional files.
I have decided that the initial implementation of this project will have a focus on first creating an effective networking system before then moving on to working on the TUI and creating an “active users” list.
Log in to leave a comment