Commit graph

124 commits

Author SHA1 Message Date
2c3ccc86c3 reorder staleClients.go 2024-11-21 18:50:00 +01:00
68b5784255 move websocket vars and const to vars.go 2024-11-21 18:50:00 +01:00
2d469a0b86 add log message when removing stale client 2024-11-21 18:50:00 +01:00
19df804235 fix logging 2024-11-21 18:50:00 +01:00
58ac2d2950 merge ping and stale check 2024-11-21 18:50:00 +01:00
c76ea3628b add timeout consts in new file 2024-11-21 18:50:00 +01:00
51b08b66e0 refactor: drop SendMessage() and merge into SendPermanentBroadCastMessage() 2024-11-21 18:50:00 +01:00
2f18b472f6 move ping from SendMessage() to RemoveStaleClients() 2024-11-21 18:50:00 +01:00
b4eff894b8 remove client from list if stale 2024-11-21 18:50:00 +01:00
84b9e0afd6 comment updates 2024-11-21 18:50:00 +01:00
b5e1b5cc88 add more Mutex Locks for Clients map 2024-11-21 18:50:00 +01:00
7e5b0659b4 move stale client check to RemoveStaleClients() 2024-11-21 18:50:00 +01:00
ccd0c38b58 add client.IsStale() 2024-11-21 18:50:00 +01:00
a25ee424aa skip client after closing unresponsive client 2024-11-21 18:50:00 +01:00
32e00480f8 optimize ping/pong code 2024-11-21 18:50:00 +01:00
d975034680 remove duplicate logging 2024-11-21 18:50:00 +01:00
c348049209 init LastPong 2024-11-21 18:50:00 +01:00
c63ef3c12a add more log output 2024-11-21 18:50:00 +01:00
2ddc1ef9e4 move check for unresponsive clients to additional loops 2024-11-21 18:50:00 +01:00
9fa740b2c6 try to check for last ping connect 2024-11-21 18:50:00 +01:00
df965e633d add ping query 2024-11-21 18:50:00 +01:00
03d94d5999 another try to remove vanished clients 2024-11-21 18:50:00 +01:00
75b3ae87d6 feat: remove client from active connections after write deadline
- add a constant for timeout duration in seconds
- set write deadline for client connections
- remove client from active connections on error
- log additional information when broadcasting fails

🤖
2024-11-21 18:49:58 +01:00
e8e65c4f3a break: remove /ws from websocket path 2024-11-18 19:15:30 +01:00
256837c130 feat: add client instructions to usage output
- add custom usage message
- include instructions for WebSocket client connection

🤖
2024-11-18 19:15:12 +01:00
31179d4af4 break: update terminology from "Work" to "Focus"
- change mode from "Work" to "Focus" in server messages
- modify pomodoro configuration to use "Focus" instead of "Work"
- adjust default settings to reflect new terminology
- ensure all references to work duration are updated to focus duration
- update variable names in HTML and JavaScript for clarity

🤖
2024-11-18 19:14:42 +01:00
b3f403cf1a fix(renovate): make Go deps always a "chore"
- add package rules to set semantic commit type for gomod
2024-11-10 17:03:14 +01:00
64f790bf90 feat(goreleaser): update build command to use .ModulePath variable
- change hardcoded module path to dynamic reference

🤖
2024-11-10 09:40:56 +01:00
8683cb2a6b chore: add yaml schemas to Taskfile.yml and .goreleaser.yaml 2024-11-10 09:39:28 +01:00
13e2c2d0e4 fix(goreleaser): don't force-remove ./dist 2024-11-10 09:39:28 +01:00
2f337bb9d6 feat: add release management via Task
- create `Taskfile.yml`
- initial tasks
  - add new version tag
  - push to remote and run goreleaser
  - create snapshot via goreleaser
2024-11-10 09:39:23 +01:00
05a8701a26 feat: update -version output 2024-11-10 09:15:43 +01:00
2032688c1f feat!: always retrieve version from runtime/debug.Main.Version or latest git tag
- set version from runtime/debug.Main.Version
- use latest git tag as fallback
- allow GoTomatoVersion to be overwritten via ldflags
- this will break `go build .` and `go install .`
2024-11-10 09:15:43 +01:00
9852f80461 fix: restore filter that excludes version bump entries 2024-11-10 09:15:43 +01:00
467d90065c feat(goreleaser): update changelog configuration
- uses the compare Gitea API
- drop `sort` setting
- remove the filter that excludes version bump entries
2024-11-10 09:15:43 +01:00
93f39507c1 feat(gorleaser): set version from git tag on build
- make `GoTomatoVersion` a variable and default it to "devel"
- add ldflags to `.goreleaser.yaml` for version tagging
- remove "v" from output of `-version`
2024-11-10 09:15:16 +01:00
783d158e92 feat: bump version to 0.1.1 2024-11-06 23:23:19 +01:00
f346cbbcaa feat: add initial configuration for GoReleaser
🤖
2024-11-06 23:23:10 +01:00
b15324f6f8 feat: bump version to v0.1.0 2024-11-06 20:51:25 +01:00
cbe2e007de break: drop "v" from version string const
- removes "v" from the ProtocolVersion in the ServerMessage
- remove "v" prefix from GoTomatoVersion constant
- re-add "v" for for human readable output (`-version`)
- update README
2024-11-06 20:50:49 +01:00
d7b7789051 feat: bump version to v0.0.8 2024-11-04 20:35:01 +01:00
600d2ed2ff feat: implement centralized logging helper
- remove direct log usage
- create a new logging helper
- update all log calls to use the new Logger instance
- set timestamp to ISO8601

🤖
2024-11-04 20:33:25 +01:00
76f3954299 feat: bump version to v0.0.7 2024-11-03 11:19:03 +01:00
44a64bfce4 feat: handle X-Forward-For for log output
- add Gorilla handlers package for enhanced HTTP handling
- refactor HTTP server to use a new ServeMux for routing
- update ListenAndServe to utilize ProxyHeaders for better proxy support
- add RealIP field to client model
  - use RealIP fild for connect/disconnect log output
2024-11-03 11:17:23 +01:00
dd9490bb3b feat: bump version to v0.0.6 2024-10-30 11:29:47 +01:00
e7618b19ef feat: validate client settings and improve logging
- add a function to check if Pomodoro settings are valid
- log a warning for invalid client configurations
- log an info message for valid client configurations
- implement Stringer interface for PomodoroConfig model

🤖
2024-10-30 11:28:42 +01:00
f4fd37c551 feat: update logging for client connect and disconnect
- update logging to use ws.RemoteAddr()

🤖
2024-10-30 10:20:44 +01:00
0ee955189c feat: update client management to use local address as identifier
- change Clients map to use net.Addr as the key type
- update `HandleConnection()` to store clients using LocalAddr
- modify `handleClientCommands()` to delete clients by LocalAddr

🤖
2024-10-30 10:20:12 +01:00
ebb58a4489 feat: rename Client model to WebsocketClient
🤖
2024-10-30 09:57:09 +01:00
2d2ea6ff78 feat: bump version to v0.0.5 2024-10-30 08:11:54 +01:00