Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | .gitignore: Ignore vendor | Runxi Yu | 2024-10-06 | 1 | -0/+1 | |
| | ||||||
* | .gitignore: Only ignore dist/build in rootv0.1.5 | Runxi Yu | 2024-10-06 | 1 | -2/+2 | |
| | ||||||
* | docs/.gitignore: Delete because empty | Runxi Yu | 2024-10-06 | 1 | -0/+0 | |
| | ||||||
* | wsm.go: Check course group constraint first when choosing | Runxi Yu | 2024-10-06 | 1 | -13/+15 | |
| | ||||||
* | {courses,wsc,wsm,wsp}.go: Send course number immediately on user interaction | Runxi Yu | 2024-10-06 | 4 | -14/+42 | |
| | ||||||
* | main.go: Don't embed LaTeX aux/log/etc files for iadocs | Runxi Yu | 2024-10-06 | 1 | -2/+2 | |
| | ||||||
* | main.go: Reorder startup events | Runxi Yu | 2024-10-06 | 1 | -16/+16 | |
| | ||||||
* | Makefile, main.go: Add go.* to the served sources | Runxi Yu | 2024-10-06 | 2 | -2/+2 | |
| | ||||||
* | bench.go: Use deadlock instead of timed exit | Runxi Yu | 2024-10-06 | 1 | -10/+7 | |
| | ||||||
* | bench: Fix timer | Runxi Yu | 2024-10-06 | 1 | -2/+2 | |
| | ||||||
* | *: Overhaul structure again and embed everything | Runxi Yu | 2024-10-06 | 32 | -151/+144 | |
| | | | | | | | | - 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 | |||||
* | Makefile: Add tmpl to .PHONYv0.1.4 | Runxi Yu | 2024-10-05 | 1 | -1/+1 | |
| | | | | Otherwise templates won't be copied | |||||
* | */Makefile: Update again | Runxi Yu | 2024-10-05 | 6 | -14/+45 | |
| | ||||||
* | *: Further restructuring | Runxi Yu | 2024-10-05 | 11 | -7/+66 | |
| | ||||||
* | *.go: Move to backend | Runxi Yu | 2024-10-05 | 18 | -2/+4 | |
| | | | | And adjust Makefiles, admin handbook, and lint.sh accordingly. | |||||
* | iadocs: Update IA documentation | Runxi Yu | 2024-10-05 | 10 | -44/+279 | |
| | ||||||
* | docs: max-width: 50rem; | Runxi Yu | 2024-10-05 | 1 | -1/+1 | |
| | ||||||
* | docs/admin: Document database setup | Runxi Yu | 2024-10-05 | 1 | -1/+10 | |
| | ||||||
* | docs/admin: Update protocol information | Runxi Yu | 2024-10-05 | 1 | -3/+2 | |
| | ||||||
* | iadocs: Cover page update | Runxi Yu | 2024-10-05 | 1 | -5/+5 | |
| | ||||||
* | {,u}sem.go, ws*.go: Restructure files | Runxi Yu | 2024-10-05 | 5 | -235/+319 | |
| | ||||||
* | {config,main}.go: Enhance configuration file processing | Runxi Yu | 2024-10-05 | 2 | -8/+124 | |
| | | | | Implements: https://todo.sr.ht/~runxiyu/cca/5 | |||||
* | bench.go: Reformat | Runxi Yu | 2024-10-05 | 1 | -2/+2 | |
| | ||||||
* | bench.go: Separate connection stage from selection stagev0.1.3 | Runxi Yu | 2024-10-05 | 1 | -2/+10 | |
| | ||||||
* | bench.go: More realistic benchmark for one course only | Runxi Yu | 2024-10-05 | 1 | -9/+18 | |
| | ||||||
* | Makefile: BSD Make also supports wildcards in targets | Runxi Yu | 2024-10-05 | 1 | -1/+1 | |
| | ||||||
* | Makefile: Add sem.go to source file list | Runxi Yu | 2024-10-05 | 1 | -1/+1 | |
| | ||||||
* | {config,ws}.go, cca.scfg.example: Add perf.course_update_interval | Runxi Yu | 2024-10-05 | 3 | -6/+14 | |
| | | | | | | This causes a drastic increase in performance. References: https://todo.sr.ht/~runxiyu/cca/7 | |||||
* | {courses,wsm}.go: Use in-memory structure to fetch cgroup, not SQL | Runxi Yu | 2024-10-05 | 2 | -26/+18 | |
| | ||||||
* | {config,ws}.go, cca.scfg.example: Remove chanPool/SendQ | Runxi Yu | 2024-10-05 | 3 | -59/+0 | |
| | ||||||
* | ws.go: &usemT{} //exhaustruct:ignore | Runxi Yu | 2024-10-05 | 1 | -1/+1 | |
| | ||||||
* | ws.go: Check error of populateUserCourseGroups | Runxi Yu | 2024-10-05 | 1 | -1/+4 | |
| | ||||||
* | wsm.go: Omit comparison to bool constant | Runxi Yu | 2024-10-05 | 1 | -1/+1 | |
| | ||||||
* | wsm.go: Report error when course doesn't exist | Runxi Yu | 2024-10-05 | 1 | -0/+8 | |
| | | | | | Luckily we encounter a database error before we have the chance to dereference a null pointer. But it's still good practice to check. | |||||
* | {courses,sem,ws,wsm}.go: Second step towards an efficient state propagator | Runxi Yu | 2024-10-05 | 4 | -16/+24 | |
| | | | | References: https://todo.sr.ht/~runxiyu/cca/7 | |||||
* | {courses,sem,ws}.go: First step towards an efficient state propagator | Runxi Yu | 2024-10-05 | 3 | -6/+110 | |
| | | | | References: https://todo.sr.ht/~runxiyu/cca/7 | |||||
* | go.sum: go mod tidy (removing old checksums) | Runxi Yu | 2024-10-05 | 1 | -6/+0 | |
| | ||||||
* | ws.go: Index chanPool by userID, rather than session cookie | Runxi Yu | 2024-10-05 | 1 | -5/+2 | |
| | ||||||
* | {main,utils,ws}.go: Initialize cancelPool directly too | Runxi Yu | 2024-10-05 | 3 | -25/+1 | |
| | ||||||
* | Bump dependencies | Runxi Yu | 2024-10-05 | 2 | -3/+9 | |
| | ||||||
* | {main,ws}.go: Initialize chanPool directly instead of setupChanPool() | Runxi Yu | 2024-10-05 | 2 | -22/+1 | |
| | | | | | | 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. | |||||
* | courses.go: Reformat | Runxi Yu | 2024-10-05 | 1 | -1/+1 | |
| | ||||||
* | {courses,wsm}.go: Add getCourseByID | Runxi Yu | 2024-10-05 | 2 | -10/+8 | |
| | | | | This also deduplicates some code. | |||||
* | {courses,wsm}.go: Add (*courseT).decrementSelectedAndPropagate | Runxi Yu | 2024-10-05 | 2 | -24/+15 | |
| | | | | This is being done quite a few times, so let's make it a function. | |||||
* | {courses,ws,wsm}.go: Update userCourseGroups during choose/unchoose | Runxi Yu | 2024-10-05 | 3 | -12/+51 | |
| | ||||||
* | config.go: Emit warning when fake auth is enabled | Runxi Yu | 2024-10-05 | 1 | -0/+2 | |
| | ||||||
* | bench.go: Don't close request body | Runxi Yu | 2024-10-05 | 1 | -6/+0 | |
| | | | | | | The WebSocket library closes it for us (which is not behavior that I like, but fine). Closing it again causes segmentation faults as Body becomes a null pointer or something like that. | |||||
* | {courses,ws}.go: Populate userCourseGroups in a separate function | Runxi Yu | 2024-10-05 | 2 | -32/+35 | |
| | ||||||
* | {courses,ws}.go: Populate userCourseGroups for each connection | Runxi Yu | 2024-10-04 | 2 | -5/+63 | |
| | | | | | | | | | | | | | | | | | | It is way too expensive to query the database every time we need to check whether a user has chosen a course in a group. Since we can (hopefully) guarantee that there is only one usable connection for any given moment and user, we could store this data along with the connection as a local variable in handleConn, which would be eligible for garbage collection when handleConn exits. Here we create the data structures that globally represent courseTypes and courseGroups, and during the initial stages of handleConn, perform database queries to populate userCourseGroups with the groups that the user has already chosen. Note that the HELLO command handler does similar database queries, and as per the TODO listed in the comments, should be moved up here for efficiency. (HELLO also serves as some sort of an initial connection check; this should probably be replaced with WebSocket's native pings.) | |||||
* | courses.go, schema.sql: Validate course{Type,Group} in server, not SQL | Runxi Yu | 2024-10-04 | 4 | -30/+45 | |
| |