Commit graph

1187 commits

Author SHA1 Message Date
Simon Ser 14d27ff914 doc: note that file uploads require an HTTP listener 2024-02-02 19:32:08 +01:00
Moritz Poldrack 4809bb40ea doc: add documentation for the file-upload key
Signed-off-by: Moritz Poldrack <git@moritz.sh>
2024-01-28 11:46:43 +01:00
Moritz Poldrack 3b1cf73165 Fix crash on start when file-upload is disabled
When started without specifying a fileupload backend, soju crashes
because of a nil-pointer deref.

	panic: runtime error: invalid memory address or nil pointer dereference
	[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x9484bd]

	goroutine 1 [running]:
	main.loadConfig()
		git.sr.ht/~emersion/soju/cmd/soju/main.go:94 +0x51d
	main.main()
		git.sr.ht/~emersion/soju/cmd/soju/main.go:127 +0x165
	panic: runtime error: invalid memory address or nil pointer dereference

Add a guardclause preventing that crash.

Signed-off-by: Moritz Poldrack <git@moritz.sh>
2024-01-28 11:46:40 +01:00
Simon Ser c1fc2f1e61 fileupload: serve select MIME types as inline 2024-01-25 14:23:28 +01:00
Simon Ser 741fd040bb downstream: fix FILEHOST endpoint 2024-01-25 13:09:49 +01:00
Simon Ser 796cf69cac doc/ext/filehost: fix heading level 2024-01-25 12:40:38 +01:00
Simon Ser fd4aa892b2 Add http-ingress config directive
Co-authored-by: delthas <delthas@dille.cc>
2024-01-24 23:32:24 +01:00
Simon Ser b76cb6d5e6 Add support for file uploads
Co-authored-by: delthas <delthas@dille.cc>
2024-01-24 23:32:07 +01:00
Simon Ser ae10ac1af6 doc/ext/bouncer-networks: drop work-in-progress disclaimer
This extension is now widely deployed, so we will stick to
backwards-compatible changes only.
2024-01-24 17:25:23 +01:00
Simon Ser b3a4fa43ab Upgrade dependencies 2024-01-24 11:33:53 +01:00
Simon Ser f1d4c904d9 doc/per-user-ip: fix subnet length in ip route command 2024-01-24 10:58:20 +01:00
Simon Ser 1f98b1f054 service: don't send PART if not joined in "channel delete" 2024-01-24 09:29:25 +01:00
Simon Ser 6ea4e2e1eb config: fix MaxUserNetworks default value 2024-01-24 09:29:05 +01:00
Simon Ser 866845ea95 cmd/soju: add withDefaultPort helper 2024-01-08 18:22:39 +01:00
Simon Ser 4c818d28cc Add https:// and http+insecure:// listeners
Same as wss:// and ws+insecure://, except we'll be able to add more
endpoints for future features (e.g. file uploads).
2024-01-08 17:49:02 +01:00
Simon Ser ef8a9caff4 config: use scfg unmarshaler 2024-01-08 17:30:14 +01:00
Henrique Dias c5d07658ab Upgrade to go-sqlite3 to fix musl build
go-sqlite3 does not build with musl 1.2.4+, which is packaged in some
distros (e.g. Alpine 3.19+). This update fixes it. More info:
https://github.com/mattn/go-sqlite3/pull/1177
2023-12-21 15:36:41 +01:00
Simon Ser e184c30cef upstream: consoldate TCP dial into function 2023-12-21 13:57:28 +01:00
Simon Ser d423a1ca24 Add conn.Shutdown
References: https://todo.sr.ht/~emersion/soju/156
2023-12-11 11:50:16 +01:00
Simon Ser e9678cee2f downstream: use fresh context to send timeout errors
Using an expired context will never actually send the error message
here.
2023-12-11 11:39:57 +01:00
Simon Ser 6729297159 server: fix malformed Web Push subscriber URI
The library prepends "mailto:".
2023-12-09 01:30:48 +01:00
Simon Ser 3e1efea6e5 contrib/certbot: set -eu in renewal hook
That way the script fails if the reload fails.
2023-12-08 17:04:17 +01:00
Simon Ser 2216dd91a0 database: move schema into separate file 2023-12-06 11:39:46 +01:00
Simon Ser ec3f0bfd96 contrib/tlstunnel: new document 2023-12-01 11:10:38 +01:00
Simon Ser a52cd5aa43 contrib/certbot: new document 2023-12-01 10:35:01 +01:00
Simon Ser 5ac4978456 Add .b4-config 2023-11-28 14:53:07 +01:00
Simon Ser 06fd7a460a doc/man: add note that memory message store is basic 2023-11-28 00:26:21 +01:00
Simon Ser 67f7d9aa3f Add support for draft/no-implicit-names
Same as the soju extension.
2023-11-27 13:49:40 +01:00
Simon Ser 47346b0f10 conn: drop ErrClosed workaround for WebSocket
The fix has been merged upstream.
2023-11-25 08:14:45 +01:00
Antonio Mika c859d2134a Update user.go to not broadcast a push notification when generated from us 2023-11-17 15:30:54 +01:00
Simon Ser d354a30b43 upstream: use unspecified AWAY reason if possible 2023-11-12 16:37:46 +01:00
sentriz 5ae86d69cc database: use postgresQueryTimeout for PostgresDB StoreMessages
using the sqliteQueryTimeout means a `undefined: sqliteQueryTimeout`
when building with `-tags=nosqlite`
2023-11-06 15:20:42 +01:00
Simon Ser e6d6476a0d Upgrade dependencies 2023-11-01 00:17:57 +01:00
Simon Ser 5bd38100c6 database: drop unnecessary comment
The error message is clear enough already.
2023-11-01 00:05:18 +01:00
Simon Ser 1e5fac0e0a contrib/znc-import: leave password empty by default
No need for the "!!" hack, an empty password field means that
auth is disabled already.
2023-11-01 00:05:17 +01:00
Simon Ser edaae4d06b cmd/sojudb: use User.SetPassword 2023-11-01 00:05:03 +01:00
Simon Ser 4f7b577734 database: add NewUser 2023-11-01 00:04:57 +01:00
Simon Ser 38e32ddd6c database: fix default value for Network.AutoAway 2023-10-31 23:51:32 +01:00
Simon Ser e19dd8f0da database: add NewNetwork 2023-10-31 23:51:04 +01:00
Calvin Lee bb8397057e Fix saving +draft/react is msgstores
This commit fixes a bug where only TAGMSGs with a `+react` tag would be
stored, when a `+draft/react` tag is normative. I have kept messages
containing `+react` as well, as they will most likely be used in the
future.

I have also reversed the order of tag inspection, as I found the new
order to be more readable.
2023-10-25 16:57:11 +02:00
Calvin Lee 48f81f0b2d contrib/migrate-db: use explicit src/dest network
This commit makes the source and destination network distinction
explicit. This is necessary, as the source and destination network may
not have the same ID in the database, and thus associations will be broken
when migrated.
2023-10-25 16:06:48 +02:00
Calvin Lee d137c69131 database: batch msg inserts
This commit takes insert query compilation and transaction creation out
of the critical loop for migrating message logs. I have tested with
the sqlite backend, and a speedup of approximately 40x has been achieved
for log migration.
2023-10-25 16:03:00 +02:00
Simon Ser 8a2a9706f7 go fmt 2023-10-24 16:54:19 +02:00
Simon Ser d85424fe01 doc: add openssl command to fetch server fingerprint
This is not very pretty, but oh well.
2023-10-24 16:53:56 +02:00
Simon Ser 467f8cd187 service: convert network certfp to lower-case
In tls.Config.VerifyPeerCertificate, we compare it against the
result of hex.EncodeToString.
2023-10-24 16:53:56 +02:00
Simon Ser d93251e714 build: improve readability of Go -ldflags 2023-10-21 18:22:56 +02:00
Simon Ser 5475a41917 build: cleanup all man pages 2023-10-21 18:21:06 +02:00
Calvin Lee 072e15d1e8 fix empty CHATHISTORY TARGETS
Currently, if times sent to `CHATHISTORY TARGETS` are reversed (e.g.
current time occurs first, and initial time occurs second) then no
targets will be returned from the database backend.

Changes have been tested with the sqlite backend.
2023-10-12 09:48:54 +02:00
Simon Ser b49552ed5b Don't send bouncer-networks updates for removed networks
We may asynchronously receive an upstream's connection status after
the network has been removed.

Sending an update is pretty bad since it's interpreted by clients
as a new network.
2023-10-03 12:01:59 +02:00
Simon Ser 73e594d59d Remove remnant comments about multi-upstream mode 2023-10-03 10:14:55 +02:00