Commit graph

28 commits

Author SHA1 Message Date
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
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
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
ebb58a4489 feat: rename Client model to WebsocketClient
🤖
2024-10-30 09:57:09 +01:00
bdfd5c3b84 feat: remove unused client mutex
- remove unused Mutex from `models.Client` struct
- remove lock from `HandleConnection()`
- replace websocket.Conn with models.Client in `handleClientCommands()`

🤖
2024-10-30 08:09:41 +01:00
d0b1260f62 doc: add and improve comments 2024-10-30 07:39:30 +01:00
ffc994126b break: rename GoTomatoServerConfig -> ServerConfig 2024-10-26 10:19:55 +02:00
c20d36d2d2 break: rename GoTomatoPomodoroConfig -> PomodoroConfig 2024-10-26 10:19:50 +02:00
0180aea8c1 break: rename ServerMessage.GoTomatoVersion -> .ProtocolVersion 2024-10-26 10:19:48 +02:00
16bc946a30 break: rename ClientCommand.PomodoroSettings -> .Settings 2024-10-26 10:19:44 +02:00
61b2f71bf3 break: rename ServerMessage.PomodoroSettings -> .Settings 2024-10-26 10:19:41 +02:00
899417b605 feat: replace standard log with charmbracelet/log
- update logging to use charmbracelet/log package
- improve log messages for server start and errors
- enhance client connection and disconnection logs

🤖
2024-10-26 00:15:02 +02:00
232fe409cb feat: add version and protocol version
- define GoTomatoVersion constant for versioning
- add protocol version field to all server messages
- add `-version` cli parameter
- update README

🤖
2024-10-23 21:28:35 +02:00
cb6616f400 break: add updateSettings command to modify Pomodoro settings
- add `updateSettings` command to modify Pomodoro configuration
- remove ability to set Pomodoro configuration in `start` command
- update demo client
- update README

🤖
2024-10-22 08:51:22 +02:00
a0dba673a2 break: enhance server message structure and settings
- add explicit server messages for start and end
- include pomodoro setttings in server messages
- update README

🤖
2024-10-22 08:10:26 +02:00
f991ba885d feat: allow restrict Pomodoro via password
- introduce password flag in server command line options
- update clientCommand model
- add password requirement for controlling the Pomodoro timer
- document password in README
2024-10-21 17:29:04 +02:00
9615d4d449 feat: implement permanent broadcast message functionality
- add SendPermanentBroadCastMessage to continuously send updates
- refactor BroadcastMessage to use a shared Message struct
- update pomodoro logic to modify broadcast.Message directly
- adjust client command handling to use broadcast.Clients map
- enhance ServerMessage struct with "Ongoing" and "Paused" fields

🤖
2024-10-21 13:07:19 +02:00
f183686272 break: update ServerMessage model
- rename MaxSession to TotalSession (and JSON struct tags)

🤖
2024-10-20 23:42:25 +02:00
2ac1aecba1 feat: allow clients to send pomodoro config
- allow clients to send custom configuration for pomodoro sessions
- update RunPomodoro to accept a configuration parameter
- modify startTimer to handle session count from config
- add default pomodoro configuration in client command handling

🤖
2024-10-20 23:42:25 +02:00
9149b1a78e refactor: rename GoTomatoTimerConfig to GoTomatoPomodoroConfig
🤖
2024-10-20 22:18:50 +02:00
337e5b0ed3 refactor: rename BroadcastMessage model to ServerMessage
🤖
2024-10-20 21:59:18 +02:00
d0e1162726 feat: add comments for configuration fields
- add documentation comments for
  - GoTomatoTimerConfig
  - GoTomatoServerConfig

🤖
2024-10-20 20:49:36 +02:00
45c527cc79 fix: remove default values from GoTomatoServerConfig model 2024-10-20 20:09:34 +02:00
0b2f83cd35 feat: add CLI flags to app
- implement command-line flags for listen address and port
- add usage section to README

🤖
2024-10-20 14:55:02 +02:00
85923b4469 feat: create model for pomodoro settings
- introduce GoTomatoTimerConfig
- create instance variable with current config
- update code to use the new variable
2024-10-20 14:45:18 +02:00
09b475dd61 feat: create model for server config
- introduce GoTomatoServerConfig
- create instance variable with the current config
- update server to use configurable listen address and port

🤖
2024-10-20 14:45:13 +02:00
4471c86a0c fix: prevent concurrent write to websocket connection
- refactor client handling and message broadcasting
- replace Client struct
- implement SendMessage method in Client struct for safer message sending
- update client map to use *models.Client instead of bool
- adjust BroadcastMessage and RunPomodoroTimer functions to use new client type

🤖
2024-10-20 11:06:37 +02:00
c59f737eb7 feat(server): restructure Pomodoro server into modular components
- move server logic to cmd/server/main.go
- create packages for websocket, pomodoro and broadcast handling
- define models for messages
- remove old GoTomato.go file
- update README

🤖
2024-10-19 16:49:09 +02:00