No description
Find a file
Simon Ser 5e33919cce Show MONITOR online/offline notifications in user buffers
We were only showing QUIT, which was weird because it wouldn't
say when the user becomes online again. Use MONITOR instead.
2023-08-25 13:10:05 +02:00
components Show MONITOR online/offline notifications in user buffers 2023-08-25 13:10:05 +02:00
lib lib/client: ensure server prefix is never null 2023-08-17 10:45:56 +02:00
.build.yml ci: deploy to new server 2022-07-09 12:26:39 +02:00
.editorconfig Add .editorconfig 2020-07-22 14:51:37 +02:00
.gitignore gitignore: add Parcel files 2021-10-20 10:55:49 +02:00
commands.js Migrate to async/await 2023-04-19 12:51:13 +02:00
dev-server.js Add usage message to development server 2021-12-01 10:44:03 +01:00
index.html Improve noscript UI appearance 2021-11-29 13:53:23 +01:00
keybindings.js Add buffer switcher 2023-06-08 15:07:28 +02:00
LICENSE Initial commit 2020-04-24 19:03:43 +02:00
main.js Avoid inline script in index.html 2021-11-17 10:58:02 +01:00
manifest.json Add web app manifest 2021-06-22 10:42:16 +02:00
package-lock.json Upgrade dependencies 2023-08-17 10:50:31 +02:00
package.json Set min node version in package.json 2022-02-10 14:46:42 +01:00
README.md readme: document default for server.url in config.json 2023-03-13 20:36:47 +01:00
state.js state: simplify MONITOR reply handling 2023-08-25 13:09:14 +02:00
store.js store: fix undefined Unread 2023-06-08 12:09:24 +02:00
style.css Add buffer switcher 2023-06-08 15:07:28 +02:00

gamja

A simple IRC web client.

screenshot

Usage

Requires an IRC WebSocket server.

First install dependencies:

npm install --production

Then configure an HTTP server to serve the gamja files. Below are some server-specific instructions.

soju

Add a WebSocket listener to soju, e.g. listen wss://127.0.0.1:8080.

Configure your reverse proxy to serve gamja files and proxy /socket to soju.

webircgateway

Setup webircgateway to serve gamja files:

[fileserving]
enabled = true
webroot = /path/to/gamja

Then connect to webircgateway and append ?server=/webirc/websocket/ to the URL.

nginx

If you use nginx as a reverse HTTP proxy, make sure to bump the default read timeout to a value higher than the IRC server PING interval. Example:

location / {
	root /path/to/gamja;
}

location /socket {
	proxy_pass http://127.0.0.1:8080;
	proxy_read_timeout 600s;
	proxy_http_version 1.1;
	proxy_set_header Upgrade $http_upgrade;
	proxy_set_header Connection "Upgrade";
	proxy_set_header X-Forwarded-For $remote_addr;
	proxy_set_header X-Forwarded-Proto $scheme;
}

If you are unable to configure the proxy timeout accordingly, or if your IRC server doesn't send PINGs, you can set the server.ping option in config.json (see below).

Development server

If you don't have an IRC WebSocket server at hand, gamja's development server can be used. For instance, to run gamja on Libera Chat:

npm install --include=dev
npm start -- irc.libera.chat

See npm start -- -h for a list of options.

Production build

Optionally, Parcel can be used to build a minified version of gamja.

npm install --include=dev
npm run build

Query parameters

gamja settings can be overridden using URL query parameters:

  • server: path or URL to the WebSocket server
  • nick: nickname
  • channels: comma-separated list of channels to join (# needs to be escaped)
  • open: IRC URL to open
  • debug: if set to 1, debug mode is enabled

Alternatively, the channels can be set with the URL fragment (ie, by just appending the channel name to the gamja URL).

Configuration file

gamja default settings can be set using a config.json file at the root:

{
	// IRC server settings.
	"server": {
		// WebSocket URL or path to connect to (string). Defaults to "/socket".
		"url": "wss://irc.example.org",
		// Channel(s) to auto-join (string or array of strings).
		"autojoin": "#gamja",
		// Controls how the password UI is presented to the user. Set to
		// "mandatory" to require a password, "optional" to accept one but not
		// require it, "disabled" to never ask for a password, "external" to
		// use SASL EXTERNAL, "oauth2" to use SASL OAUTHBEARER. Defaults to
		// "optional".
		"auth": "optional",
		// Default nickname (string). If it contains a "*" character, it will
		// be replaced with a random string.
		"nick": "asdf",
		// Don't display the login UI, immediately connect to the server
		// (boolean).
		"autoconnect": true,
		// Interval in seconds to send PING commands (number). Set to 0 to
		// disable. Enabling PINGs can have an impact on client power usage and
		// should only be enabled if necessary.
		"ping": 60
	},
	// OAuth 2.0 settings.
	"oauth2": {
		// OAuth 2.0 server URL (string). The server must support OAuth 2.0
		// Authorization Server Metadata (RFC 8414) or OpenID Connect
		// Discovery.
		"url": "https://auth.example.org",
		// OAuth 2.0 client ID (string).
		"client_id": "asdf",
		// OAuth 2.0 client secret (string).
		"client_secret": "ghjk",
		// OAuth 2.0 scope (string).
		"scope": "profile"
	}
}

Contributing

Send patches on the mailing list, report bugs on the issue tracker. Discuss in #soju on Libera Chat.

License

AGPLv3, see LICENSE.

Copyright (C) 2020 The gamja Contributors