Commit graph

354 commits

Author SHA1 Message Date
Simon Ser 651872ef7d
plugins/base/imap: disable full-text search for now
It's too slow on servers where indexes aren't enabled.

References: https://todo.sr.ht/~sircmpwn/koushin/23
2020-02-05 11:37:01 +01:00
Simon Ser f08ecb9cef
Update echo to 504f39abaf320
This fixes an OpenBSD issue.

Closes: https://todo.sr.ht/~sircmpwn/koushin/50
2020-02-03 19:35:14 +01:00
Simon Ser 6940a826b5
readme: add short description
Closes: https://todo.sr.ht/~sircmpwn/koushin/59
2020-01-30 11:20:56 +01:00
Simon Ser 4d68400036
plugins/base: add settings page
Add a settings page where the user can change the number of messages
displayed per page.
2020-01-28 20:04:33 +01:00
Simon Ser bdf1a8b02b
koushin: add Store interface
References: https://todo.sr.ht/~sircmpwn/koushin/5
2020-01-28 20:04:18 +01:00
Simon Ser c0b4998b38
koushin: rename Session.locker to imapLocker 2020-01-28 15:41:18 +01:00
Simon Ser 85c01b87a9
plugins/base: support attachments in drafts
References: https://todo.sr.ht/~sircmpwn/koushin/16
2020-01-28 12:30:07 +01:00
Simon Ser 50046b62ac
plugins/base: use BodyStructure.Walk instead of custom logic 2020-01-28 11:15:10 +01:00
Simon Ser b325933a8b
Add .editorconfig 2020-01-24 20:59:35 +01:00
Simon Ser 3384c39a17
plugins/base: delete previous draft 2020-01-24 20:27:05 +01:00
Simon Ser d31c56ec98
plugins/base: edit drafts
Note that attachments will be lost. This is a TODO.
2020-01-24 20:07:29 +01:00
Simon Ser 2e367efe58
plugins/base: add fallback if SPECIAL-USE is unsupported 2020-01-24 18:01:01 +01:00
Simon Ser bfc617b702
plugins/base: save message as draft 2020-01-24 17:49:50 +01:00
Simon Ser 267999b6e5
Update docs with new RegisterPluginLoader function 2020-01-21 13:40:55 +01:00
Simon Ser baae776247
readme: fix example usage 2020-01-21 13:38:47 +01:00
Simon Ser 3347e69480
Use %q to quote values in format strings 2020-01-20 22:06:47 +01:00
Simon Ser 9fdccc3a4b
Rename template.go to renderer.go 2020-01-20 22:05:42 +01:00
Simon Ser b58c15d121
Extract Lua infrastructure into a plugin 2020-01-20 22:04:50 +01:00
Simon Ser efa0816333
Add Server.Logger 2020-01-20 22:03:05 +01:00
Simon Ser 01983eb7b5
Introduce PluginLoaderFunc
This allows registered plugins to execute code when loaded. This will
also allow the Lua support code to be a plugin.

Closes: https://todo.sr.ht/~sircmpwn/koushin/54
2020-01-20 21:37:28 +01:00
Simon Ser d19c17c6d5
go fmt 2020-01-20 20:27:49 +01:00
Simon Ser 589b303f9f
plugins/base: append outgoing messages to Sent mailbox
And mark original message as answered.

Closes: https://todo.sr.ht/~sircmpwn/koushin/15
2020-01-20 20:25:41 +01:00
Simon Ser 3340fcd63d
Check IMAP/SMTP servers on startup
Closes: https://todo.sr.ht/~sircmpwn/koushin/46
2020-01-20 18:46:50 +01:00
Simon Ser 3bf17752ab
plugins/base: remove external resources URLs, sanitize CSS 2020-01-20 18:28:49 +01:00
Simon Ser b9a180b154
Disable DNS prefetching 2020-01-20 18:26:22 +01:00
Simon Ser a66ef1059b
Make the text/* part content a []byte 2020-01-20 16:20:16 +01:00
Simon Ser 8d248bc32f
Extract HTML sanitizer to its own file 2020-01-20 16:20:16 +01:00
Simon Ser d745f98bb7
Add polyfill for browsers not supporting srcdoc 2020-01-20 16:20:15 +01:00
Simon Ser efaf6fd444
Open e-mail links in new tab 2020-01-20 16:20:15 +01:00
Simon Ser 721c3ce3eb
Resize e-mail iframe with content 2020-01-20 16:20:15 +01:00
Simon Ser af5ffd12f9
Add support for HTML parts 2020-01-20 16:20:15 +01:00
Simon Ser 577685ca14
Update dependencies 2020-01-20 15:41:37 +01:00
Simon Ser e6e457e4a7
Fix dangling goroutine on session expiration
The timer channel may already have been drained by `case <-timer.C`. In
this case, we need not to drain it again or we'll block forever.

To fix this, stop draining the timer channel. Since we're not going to
use the timer again anyway, it should be fine.
2020-01-20 15:25:46 +01:00
Simon Ser 8b10324ab6
go fmt 2020-01-20 13:22:18 +01:00
Simon Ser a0800c2436
Auto-discover upstream SMTP and IMAP servers
Closes: https://todo.sr.ht/~sircmpwn/koushin/49
2020-01-20 13:08:05 +01:00
Simon Ser db328bf7c3
Generalize upstream server URLs
koushin now takes a list of upstream URLs instead of an IMAP and SMTP
URL. This allows to specify upstream server URLs for plugins. In the
future, this will allow for auto-discovering upstream servers based on a
single domain name.

References: https://todo.sr.ht/~sircmpwn/koushin/49
2020-01-20 12:00:04 +01:00
Reto Brunner d5124c9645
Hide echo banner 2020-01-17 00:26:13 +01:00
Dejan Strbac 83a5132d15
Add current path to the global context 2020-01-16 13:36:03 +01:00
Dejan Strbac 15a77185b4
Include flags when fetching items over IMAP 2020-01-16 13:34:10 +01:00
Simon Ser 425445f443
Add Session.SetHTTPBasicAuth
This is not 100% idiot-proof, but still makes it mroe difficult for
plugins to steal credentials.
2020-01-10 19:37:24 +01:00
Simon Ser c38b1d47f9
Fix panic when injecting a template with nil data 2020-01-10 19:34:59 +01:00
Simon Ser 24718f1ac4
Redirect to original URL after login 2020-01-10 17:29:37 +01:00
Simon Ser b014c1898f
Close Lua plugins on reload 2020-01-10 17:00:34 +01:00
Simon Ser 171da51289
cmd/koushin: add -addr flag 2020-01-08 12:01:50 +01:00
Simon Ser 04199eb121
readme: document hot reload 2020-01-08 12:01:48 +01:00
Simon Ser ad1d2ee7f4
Implement plugin/template reload on SIGUSR1
There's no way around having a global mutex, because we need to update
the HTTP routes when reloading plugins. During reload we need to lock
the whole server.

Closes: https://todo.sr.ht/~sircmpwn/koushin/43
2020-01-08 11:50:29 +01:00
Simon Ser 3d8569d185
cmd/koushin: reload on SIGUSR1
References: https://todo.sr.ht/~sircmpwn/koushin/43
2020-01-08 11:02:39 +01:00
Simon Ser 97b314b6e7
Add Server.Reload
This only reloads templates for now. In the future it'll also reload
Lua plugins.
2020-01-08 10:52:28 +01:00
Simon Ser f6758264b2
Make New return the Server
This will be useful to implement hot reload.
2020-01-08 10:38:33 +01:00
Simon Ser 3d9ddc05be
themes/sourcehut: add search input to mailbox view 2019-12-25 19:34:24 +01:00