summaryrefslogtreecommitdiff
path: root/main.go (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Makefile, main.go: Use cover page as iadocs/index.htmlRunxi Yu2024-10-061-1/+2
|
* main.go: -config -> -cRunxi Yu2024-10-061-1/+1
|
* *.go: Limit to approximately 80 characters per lineRunxi Yu2024-10-061-13/+62
|
* main.go, Makefile: Add .editorconfig and .gitignore to srcFSRunxi Yu2024-10-061-1/+1
|
* Revert "Makefile, main.go: Add vendor dependencies to srcFS"v0.1.6Runxi Yu2024-10-061-1/+1
| | | | This reverts commit a25fdc67f05cfb1b37ac750460a21ddbb18008de.
* Makefile, main.go: Add vendor dependencies to srcFSRunxi Yu2024-10-061-1/+1
|
* main.go: Don't embed LaTeX aux/log/etc files for iadocsRunxi Yu2024-10-061-2/+2
|
* main.go: Reorder startup eventsRunxi Yu2024-10-061-16/+16
|
* Makefile, main.go: Add go.* to the served sourcesRunxi Yu2024-10-061-1/+1
|
* *: Overhaul structure again and embed everythingRunxi Yu2024-10-061-0/+153
| | | | | | | | - Remove sub-Makefiles; recursive make is annoying - Just use one top-level Makefile that builds everything - Embed templates and minified static resources into the binary - Embed all compiled documentation into the binary and serve - Embed all source into the binary and serve
* *.go: Move to backendRunxi Yu2024-10-051-125/+0
| | | | And adjust Makefiles, admin handbook, and lint.sh accordingly.
* {config,main}.go: Enhance configuration file processingRunxi Yu2024-10-051-1/+7
| | | | Implements: https://todo.sr.ht/~runxiyu/cca/5
* {main,utils,ws}.go: Initialize cancelPool directly tooRunxi Yu2024-10-051-6/+0
|
* {main,ws}.go: Initialize chanPool directly instead of setupChanPool()Runxi Yu2024-10-051-6/+0
| | | | | | It is possible to use var chanPool = make(map[string](*chan string)) directly during declaration, even if it's a global variable. There is no need to call a function to initialize it.
* {config,main}.go, cca.scfg.example: Settable static pathRunxi Yu2024-10-041-5/+3
| | | | | | | | | Because of the poor performance of using NGINX as a reverse proxy, I've added native TLS in commit 4a1a7af76408e956ebc343bf28960fdd00c00c58. Serving static files was already supported, but it was expected that people use a static web server to do so, so we didn't support a configurable static path. Now since reverse proxy setups are discouraged, it makes more sense to be better at serving static files.
* {config,main}.go, cca.scfg.example: Support TLSRunxi Yu2024-10-041-8/+34
|
* main.go, cca.scfg.example: Remove FastCGI supportRunxi Yu2024-10-041-4/+2
| | | | | | I would love to serve FastCGI but it is a huge pain to get WebSocket working, at least with NGINX. I don't think OpenBSD httpd would be better at this either.
* {main,ws,wsm}.go: Attempt to cancel old sessionsRunxi Yu2024-10-031-0/+6
| | | | | | | | | | | | | | | | | | | When beginning to handle a WebSocket connection, we shall create a new context, with the request context as its parent. We use the new context for everything from now on, except for reporting error messages, which is handled by creating a reportError function in a closure in makeReportError and passing it along to command-handling functions. Note that if one user attempts to rapidly launch WebSocket connections, there might still be a race condition where the old connection hasn't been completely established yet (i.e. an entry hasn't been added to cancelPool) and the new connection isn't able to cancel the old connection. I'm a bit tired to think of a solution now but it could probably be solved by moving the cancellation registration and cancelling sooner during the initial handshake. Note that more parts of the event loop needs to select from ctx.Done (from newCtx) for this to work reliably.
* {main,pw}.go, Makefile, index_login.html: Remove password auth stubRunxi Yu2024-10-011-1/+0
| | | | | | | | | | I don't think password authentication is really useful, since Microsoft Entra ID is the "proper" way of doing authentication in our school system and there's just little reason to have a password login. I previously wanted to use password authentication for stress testing, but stress testing really could just use completely fake authentication and there's no need for any password whatsoever.
* main.go: Actually repsect config.Perf.ReadHeaderTimeoutRunxi Yu2024-09-301-1/+1
|
* *: Change license to AGPL-3.0-or-laterRunxi Yu2024-09-301-21/+11
|
* main.go: Use http.Server.ServeRunxi Yu2024-09-261-1/+5
|
* Revert "main.go: Use http.Server with timeouts"Runxi Yu2024-09-261-5/+1
| | | | | | | This reverts commit 65d3c85e3bee4b5961e53338f8b42e5a68ff1b04. I'm reverting this for now because it seems to make requests hang indefinitely.
* main.go: Use http.Server with timeoutsRunxi Yu2024-09-261-1/+5
|
* ws.go: Very basic channelsRunxi Yu2024-09-131-0/+6
|
* *: Password login stubRunxi Yu2024-09-081-0/+1
|
* *: Display coursesRunxi Yu2024-09-081-0/+6
|
* *: Basic WebSocket connection may be established nowRunxi Yu2024-09-081-0/+1
|
* *: Basic authentication and templatesRunxi Yu2024-09-071-0/+96
These are imported from FBFP and slightly modified to be specific to YKPS (while not being hard to port to other environments that use APIs that use OAUTH 2.0). Some code is also simplified. Database code still needs an audit, and things are not tested yet.