It's ugly, but it get's the job done. This list will need to be
improved a lot (ie, make it searchable and maybe even clickable
emotes?). This is for #99, but should not be considered fixed yet.
This reworks how emotes are cached in relation to their physical
location on disk. Functionally, they should be the same from the user
perspective but it sets up some stuff that will make it easier to add
emotes from various sources.
Added a few more stats to keep track of:
- Max users in chat
- Stream start
Also added a `/stats` command to list the user count (current and max),
as well as uptime (sever and stream, separately).
Resolves#85
This is for #32.
This adds a starting framework for loading, caching, and executing
templates on the server and the client. Currently only the server uses
this functionality.
Temp connections were removed to reduce some complexity. Now a
connection is a full client, even before joining chat. A name is
required to be set to join chat and receive messages.
This change also removes the need for UUIDs on connections and clients.
Added this to the settings so it can be configured at runtime. If set
to true, a Cache-Control header will be sent with the wasm file as well
as the index html.
Functions added:
- LogErrorf()
- LogErrorln()
- LogChatf()
- LogChatln()
- LogInfof()
- LogInfoln()
- LogDebugf()
- LogDebugln()
- LogDevf()
- LogDevln()
New settings configure the logging: LogLevel and LogFile. LogLevel can
be set to one of: error, chat, info, or debug and will default to
error. LogFile is an optional file to write to. Providing a file will
not prevent output in the console.
LogDevf() and LogDevln() only compile when the "dev" flag passed to
build. This will cause Travis-CI to fail the build if it finds any
calls to either function.
- When the access mode changes, print the new mode (and pin, if
applicable) to the server console.
- Don't return an HTTP error when getting a session fails, just make a
new session.
- Save pins to the settings
So far only PIN and Open modes are implemented. It uses a session
cookie to store the validity of the pin/password.
The "Enter pin" page has some unreadable messages on it right now, but
it kinda works.
Parse the X-Forwarded-For header if it exists in the connection. This
will allow bans to work if the server is sitting behind an Nginx
reverse proxy (that has been configured to add the header).
Also added a safe-guard to disallow bans for localhost so you cannot
accidentally ban everybody from connecting if the server is behind a
reverse proxy.
This should resolve#49
Added the "Cache-Control" header to responses for the main.wasm file.
This should help with debugging and updates by telling the browser not
to cache the web assembly binary.
This is an icon that I threw together in a few minutes. I don't want
my avatar as the favicon for this repository.
Also, the favicon.png has moved to the root directory as it is
something that is meant to be customized along with the settings that
is also in the root.
Move the help html to a template and populate the lists dynamically.
This also splits out the base HTML stuff (eg, the <html> and <body>
tags) to a base template file.
Wrapping the connection with a mutex prevents the "concurrent write to
websocket connection" panic. The new functions are ReadData() and
WriteData so as to not collide with ReadJSON() and WriteJSON().
handlePublish, handlePlay, and handleDefault have been added in
handlers.go and removed as anonymous functions in main.go. This also
required moving some struct and variable definitions around a bit.