Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | staff.html: Initial staff page | Runxi Yu | 2024-10-04 | 1 | -0/+149 | |
| | | | | | It's currently a copy of the student page with a few words changed and no checkboxes | |||||
* | student.html, *.js: {main->student}.js | Runxi Yu | 2024-10-04 | 2 | -1/+1 | |
| | ||||||
* | student.html: {{ .user.Name }} instead of Home in title | Runxi Yu | 2024-10-04 | 1 | -1/+1 | |
| | ||||||
* | bench.go, main.js: Use an HTTPS URL | Runxi Yu | 2024-10-04 | 2 | -2/+2 | |
| | | | | | This URL should be configurable in the JS at least, but I'm not sure how I should be filling out JS templates. I'll leave it hardcoded for now. | |||||
* | {config,main}.go, cca.scfg.example: Support TLS | Runxi Yu | 2024-10-04 | 3 | -8/+65 | |
| | ||||||
* | main.go, cca.scfg.example: Remove FastCGI support | Runxi Yu | 2024-10-04 | 2 | -9/+5 | |
| | | | | | | 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. | |||||
* | bench.go: Use more realistic connection numbers for now | Runxi Yu | 2024-10-04 | 1 | -4/+4 | |
| | ||||||
* | postgres_shell.sh: Delete as unnecessary | Runxi Yu | 2024-10-04 | 1 | -3/+0 | |
| | | | | Just use "psql cca" | |||||
* | bench: Add a bit more stress (30000 connections, 30s wait)v0.1.2 | Runxi Yu | 2024-10-03 | 1 | -2/+2 | |
| | ||||||
* | README.md, iadocs/{cover*, crita*}: Update documentation | Runxi Yu | 2024-10-03 | 3 | -39/+67 | |
| | ||||||
* | cca.scfg.example: Listen on 127.0.0.1:5555 only by default | Runxi Yu | 2024-10-03 | 1 | -3/+3 | |
| | | | | | | I would have used IPv6, i.e. [::1]:5555, but our school network only has IPv4 and it'd be easier to keep everything on the same protocol, though this probably wouldn't matter for standard reverse proxy setups. | |||||
* | style.css: Update color scheme | Runxi Yu | 2024-10-03 | 1 | -22/+20 | |
| | ||||||
* | {config,ws}.go, cca.scfg.example: Allow same-user fake auth | Runxi Yu | 2024-10-03 | 3 | -15/+30 | |
| | | | | This is useful for testing whether connection collisions work well. | |||||
* | ws.go: Don't log chanPool changes | Runxi Yu | 2024-10-03 | 1 | -2/+0 | |
| | ||||||
* | schema.sql: users.expr should be BIGINT | Runxi Yu | 2024-10-03 | 1 | -1/+1 | |
| | ||||||
* | {ws,wsm}.go: Handle context cancellations | Runxi Yu | 2024-10-03 | 2 | -5/+94 | |
| | ||||||
* | student.html: Connection closed could be cause by a login elsewhere | Runxi Yu | 2024-10-03 | 1 | -0/+3 | |
| | ||||||
* | lint.sh: Disable nonamedreturns | Runxi Yu | 2024-10-03 | 1 | -1/+1 | |
| | | | | I used named returns to inspect return values (especially error values) | |||||
* | ws.go: Fix memory leak introduced in last commit | Runxi Yu | 2024-10-03 | 1 | -0/+7 | |
| | | | | | | The entry is deleted from cancelPool if and only if cancelPool's cancel function for the user is equal to &newCancel. This compare-and-delete works because of locking. | |||||
* | ws.go: Fix first race condition in cancelPool management | Runxi Yu | 2024-10-03 | 1 | -13/+2 | |
| | | | | | | | | | | | | | | | Cancel occurs in async. When the cancelled function exits, it deletes the entry in cancelPool, and could replace the new routine's cancel function, which is of course undesirable. Therefore this commit causes handleConn to stop deleting from cancelPool entirely. Note that this introduces a memory leak at the size of context.CancelFunc per user, because we are never deleting from cancelPool. This does not actually solve the race condition documented in fc911928 where two new connections start sufficiently close to each other. | |||||
* | {main,ws,wsm}.go: Attempt to cancel old sessions | Runxi Yu | 2024-10-03 | 3 | -23/+87 | |
| | | | | | | | | | | | | | | | | | | | 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. | |||||
* | README.md, student.html: Correct spelling | Runxi Yu | 2024-10-03 | 2 | -2/+2 | |
| | ||||||
* | README.md: Remove CI badges | Runxi Yu | 2024-10-03 | 1 | -6/+0 | |
| | ||||||
* | ws.go: Update comment on disallowed characters | Runxi Yu | 2024-10-02 | 1 | -5/+4 | |
| | ||||||
* | student.html: Update error messages to be a bit more friendly | Runxi Yu | 2024-10-02 | 1 | -6/+15 | |
| | ||||||
* | index.go, *.html: index->student, index_login->login | Runxi Yu | 2024-10-02 | 3 | -5/+5 | |
| | | | | | | | The new names are a bit more descriptive in what each do, and I intend to add an "admin" template in the future. This has no user-facing effects. | |||||
* | index{,_login}.html: Improve accessibility | Runxi Yu | 2024-10-02 | 2 | -2/+4 | |
| | ||||||
* | main.js: Un-disable already-chosen courses during HELLO/HI | Runxi Yu | 2024-10-02 | 1 | -0/+1 | |
| | ||||||
* | index.html, style.css: Remove ID column because nobody cares | Runxi Yu | 2024-10-02 | 2 | -5/+3 | |
| | ||||||
* | main.js: Unset indeterminate when receiving N | Runxi Yu | 2024-10-02 | 1 | -0/+1 | |
| | ||||||
* | main.js: Set checkbox.indeterminate = true when unchecking | Runxi Yu | 2024-10-02 | 1 | -1/+1 | |
| | ||||||
* | tcourse.sql: Add 1000 of each course for testing | Runxi Yu | 2024-10-02 | 1 | -5/+5 | |
| | ||||||
* | bench: Don't log errors for now | Runxi Yu | 2024-10-02 | 1 | -3/+3 | |
| | ||||||
* | wsm.go, main.js: Use M for number, N for deselect | Runxi Yu | 2024-10-02 | 2 | -3/+6 | |
| | | | | | | | Previously both commands used N, and deselection wasn't really implemented on the JavaScript side. It worked and didn't throw an exception but it's technically wrong and the user could see an empty number field for a split second. | |||||
* | Makefile: Add wsm.go to the source file list | Runxi Yu | 2024-10-02 | 1 | -1/+1 | |
| | ||||||
* | bench: Attempt to choose random courses | Runxi Yu | 2024-10-02 | 1 | -4/+18 | |
| | ||||||
* | bench: Add initial benchmarking suite | Runxi Yu | 2024-10-02 | 5 | -0/+106 | |
| | | | | Currently only connects and creates a fake user | |||||
* | {auth,utils,ws}.go: randomBytes -> randomString | Runxi Yu | 2024-10-02 | 3 | -4/+4 | |
| | ||||||
* | {config,ws}.go, cca.scfg.example: Add fake auth support | Runxi Yu | 2024-10-02 | 5 | -16/+72 | |
| | | | | | Fake authentication is useful when benchmarking the server with an external program without going insane with the OpenID Connect forms. | |||||
* | style.css: message-box border 1px | Runxi Yu | 2024-10-02 | 1 | -1/+1 | |
| | ||||||
* | {auth,db,wsm}.go: Make 23505 (uniqueness violation) a constant | Runxi Yu | 2024-10-01 | 3 | -2/+4 | |
| | ||||||
* | main.js: Only try to mark courses as checked if mar[1] !== ""v0.1.1 | Runxi Yu | 2024-10-01 | 1 | -3/+5 | |
| | | | | | Otherwise, users may get something like "TypeError: Cannot set properties of null (setting 'checked')" | |||||
* | main.js: Everything should be after DOMContentLoaded | Runxi Yu | 2024-10-01 | 1 | -99/+101 | |
| | | | | | | | This is technically a race condition, and users with extremely slow computers and very bad luck might get exceptions from this. I think. | |||||
* | style.css: Make light header background lighter | Runxi Yu | 2024-10-01 | 1 | -1/+1 | |
| | ||||||
* | style.css: Remove thick table border | Runxi Yu | 2024-10-01 | 1 | -1/+1 | |
| | ||||||
* | wsm.go, main.js: Display the user's selected courses on first runv0.1.0 | Runxi Yu | 2024-10-01 | 2 | -2/+22 | |
| | | | | | It's done in the WebSocket routines rather than in the template maker because it's relatively easier to write the logic this way. | |||||
* | style.css: Switch the header to a grey theme | Runxi Yu | 2024-10-01 | 1 | -4/+8 | |
| | ||||||
* | style.css: Revert back to blue theme | Runxi Yu | 2024-10-01 | 1 | -3/+5 | |
| | ||||||
* | {ws,wsm}.go: Split message handlers into their own functions | Runxi Yu | 2024-10-01 | 2 | -124/+182 | |
| | ||||||
* | lint.sh: Disable dogsled and unparam | Runxi Yu | 2024-10-01 | 1 | -1/+1 | |
| | | | | | | | dogsled forbids patterns such as "_, _, _ = a, b, c" for no reason. unparam warns about unused parameters even when I'm assigning them to _ to indicate that it's fine for them to be unused. |