Commit graph

121 commits

Author SHA1 Message Date
Ayase Minori
7956cc7308 fix: Update fresh dependency
Update fresh dependency version from 1.5.2 to 1.5.4
2023-11-22 07:04:36 +00:00
Ayase Minori
2d82486c48 fix: Fix socket state and onClick function in CounterCard
Fix socket state initialization, onClick function, and modify component rendering in CounterCard
2023-11-22 06:51:17 +00:00
Ayase Minori
0f63c6f833 feat: Add Partytown and update MarkdownContent import paths
Added Partytown package and updated import paths for MarkdownContent components.
2023-11-22 05:48:25 +00:00
Ayase Minori
4e39f69f31
Update takeback public analytics page in README 2023-10-28 16:49:22 +08:00
Ayase Minori
bd2e5438c5
Update Takeback tracking link 2023-10-28 16:48:40 +08:00
Amnish Singh Arora
e6558e0824
Rate Limit Kuru Squash (#19)
* Rate Limit Kuru Squash

* Remove console.log

* Update the THRESHOLD_CLICKS to 30

* Improve the timeout algorithm
2023-10-26 08:33:30 +08:00
Ayase Minori
4b6fe1c5f3 aint no way deno doesnt like emojis 💀 2023-10-24 00:24:47 +08:00
Ayase Minori
548a35c4bf
send a message immediately on connect 2023-10-24 00:15:41 +08:00
Ayase Minori
41be1559f1
refactor: Update dependencies and refactor code (#18)
* refactor: Update dependencies and refactor code

Removed axios-web and replaced with BroadcastChannel and WebSocket for counter and global count functionalities.

* feat: Update CounterCard and routes

Update CounterCard timeout and routes POST method

* Debug socket message

* ensure value is always treated as a BigInt internally

* Frogot to put it below that 💀

* Move type conversion to database

* I swear if this doesnt work im going to choke someone

* assign converted value to a variable

SURELY this will work right?

* Revert db to use numbers again
2023-10-24 00:11:50 +08:00
Ayane Satomi
06ba0c3dfc Remove clientside logging for the heartbeat
It works now so I have no need for it anymore
2023-10-23 14:03:22 +00:00
Ayane Satomi
97d20ea68f Remove header validation since its crashing everyone 2023-10-23 13:57:40 +00:00
Ayane Satomi
438712c05b Use Sec-Fetch-Mode to check instead 2023-10-23 13:53:35 +00:00
Ayane Satomi
69e462f758 guard against arbitrarily large numbers on payload on serverside too 2023-10-23 13:40:51 +00:00
Ayane Satomi
fa903f2932 Ensure endpoints are only accessed by actual browsers 2023-10-23 13:37:32 +00:00
Ayane Satomi
725c7a1d24 feat: Add user agent check
Add code to check if useragent is a browser
2023-10-23 13:32:04 +00:00
Ayane Satomi
cdf547e4bd feat: Add websocket handling
Added websocket functionality for keeping the connection alive and handling events.
2023-10-23 13:22:03 +00:00
Ayase Minori
866965acc9
Merge pull request #17 from sr229/sr229/reliable-ws
Make Websockets more reliable
2023-10-23 18:20:15 +08:00
Ayane Satomi
4ddc835f93 Gracefully log errors instead of trying something stupid here 2023-10-23 10:18:31 +00:00
Ayane Satomi
d46adc06c5 re-set connection handlers on reconnection 2023-10-23 10:16:08 +00:00
Ayane Satomi
2ab8369d4e Gracefully handle network interruptions 2023-10-23 10:04:13 +00:00
Ayane Satomi
d00cf3a9c3 Make server not send anything if socket state is anything but open 2023-10-23 09:09:00 +00:00
Ayase Minori
4574557fdc
We're now websocket xd 2023-10-23 01:05:39 +08:00
Ayase Minori
4d1aded8a8
Remove evtsrc logging 2023-10-23 01:00:10 +08:00
Ayase Minori
cc34b8f0d9
Merge pull request #16 from sr229/sr229/websockets
Change Transport from SSEs to Websockets
2023-10-23 00:50:56 +08:00
Ayane Satomi
c6f3decb45 Fix BroadcastChannel sending Encoded bytes 2023-10-22 16:43:51 +00:00
Ayane Satomi
4ea19cd5a0 Switch transport to Websockets 2023-10-22 16:34:52 +00:00
Ayase Minori
c83a6b956a
allow blank issues 2023-10-22 16:44:00 +08:00
Ayase Minori
25497d2a94
Rollback Cloudflare site for now
We're having problems routing the SSEs so we're going back to the deno subdomain
2023-10-22 14:51:47 +08:00
Ayane Satomi
33c03ca078 fix: Remove script tag
Removed a script tag from _app.tsx file.
2023-10-22 06:38:31 +00:00
Ayane Satomi
bc4fc678c7 feat: Add Cloudflare Insights beacon.
Adds a script tag to include Cloudflare Insights beacon in _app.tsx.
2023-10-22 06:35:25 +00:00
Ayase Minori
b5a93a58fa
Change canonical site to the Cloudflare-backed site 2023-10-22 14:28:28 +08:00
Ayane Satomi
ab29f592eb style: Updated Footer component
Removed unnecessary class and added line breaks for readability
2023-10-22 06:00:43 +00:00
Ayane Satomi
238c01bcd7 feat: Update globalCount type to bigint
Update globalCount type from number to bigint in CounterCard and index files, and in setGlobalStatistics function
2023-10-22 05:56:36 +00:00
Ayane Satomi
f2abd5110c refactor: Refactor CounterCard component to use BigInt for globalCount
Refactor CounterCard component to use BigInt for globalCount state and parse globalCount as an integer
2023-10-22 05:50:37 +00:00
Ayane Satomi
6b05b7d6a9 refactor: Move logging to proper conditional block 2023-10-22 05:47:48 +00:00
Ayane Satomi
be94406c49 fix: guard against large numbers
Guard against numbers beyond MAX_SAFE_INTEGER and reset count if necessary.
2023-10-22 05:45:44 +00:00
Ayase Minori
09378ab37d
Merge pull request #14 from sr229/sr229/csp
style: Update Cache-Control header settings
2023-10-21 23:25:12 +08:00
Ayane Satomi
033da63a46 feat: Add X-Content-Type-Options header
Added 'X-Content-Type-Options' header with value 'nosniff' to the middleware
2023-10-21 15:21:34 +00:00
Ayane Satomi
cabcf3fe8d style: Update Cache-Control header settings
Updated the max-age value of the Cache-Control header from 14400 to 3600 and removed X-CSRF-Token and Authorization headers.
2023-10-21 15:17:26 +00:00
Ayane Satomi
5d7a5f4aae refactor: Update cache control headers in _middleware.ts
Remove 'must-revalidate' from cache control headers in _middleware.ts
2023-10-21 15:08:01 +00:00
Ayase Minori
a01319b3d2
Change swr to must-revalidate 2023-10-21 23:05:25 +08:00
Ayane Satomi
319c45a5ac fix: Update meta content type
Changed meta content type from text/html; charset=utf-8 to utf-8.
2023-10-21 15:03:18 +00:00
Ayane Satomi
3eaa783c15 feat: Added middleware for handling CORS
Added middleware for handling CORS and setting necessary headers
2023-10-21 14:55:25 +00:00
Ayane Satomi
dd9b86af93 feat: Add deploy workflow
Added a new workflow for deploying to Deno Deploy.
2023-10-21 14:10:57 +00:00
Ayane Satomi
1572ec1584 fix: Updated logging message in CounterCard component
Log message in CounterCard component updated to include timestamp
2023-10-21 14:06:35 +00:00
Ayane Satomi
b82a792781 feat: Add timestamp to console log messages
Add timestamp to console log messages in CounterCard.tsx
2023-10-21 14:02:59 +00:00
Ayase Minori
2bcaa50d9c
Remove No-WS claim
It still uses Websockets so my bad on this one
2023-10-21 22:01:07 +08:00
Ayase Minori
e12b4e136f
Merge pull request #13 from sr229/sr229/md-island
Decouple Markdown and Footer to their own islands and route
2023-10-21 21:28:23 +08:00
Ayane Satomi
1cbb7d8651 feat: Update CounterCard and MarkdownContent styles
Update CounterCard and MarkdownContent styles, and add Credits Content
2023-10-21 13:24:38 +00:00
Ayane Satomi
45409382db Seperate Markdown content in its own island
Signed-off-by: Ayane Satomi <chinodesuuu@gmail.com>
2023-10-21 12:00:46 +00:00