Added a Ruleset configuration to the logranger application, along with associated error handling. The code now loads a ruleset file from configuration, checks for duplicate rules, and logs each rule as it is found. The ruleset is also integrated within the server setup. The PIDFile now includes a default RuleFile reference in config.go.
The provided diff includes an extra pattern to the .gitignore list - 'etc/*.local.*.toml'. This was done to ensure that all variations of local configuration files are ignored by Git, preventing them from being unnecessarily tracked.
The 'parser' struct in config.go has been updated with Fig configuration annotation. This allows ease of configuration as it sources the configuration options from the environment, making the code cleaner and more flexible.
The processing deadline handling was moved from the connection-level anonymous go-routine to the HandleConnection method. This refactor allows the reading from the connection to be looped, improving the handling of timeouts and parsing failure cases.
The comments for the 'ErrCertConfigEmpty' variable in error.go contained a typo. This has been corrected to more accurately reflect the error that is returned when a TLS listener is configured without setting certificate or key paths.
This update upgrades the go-parsesyslog dependency version to v0.2.2. It also enhances the server's connection handling. This is done by expanding the `HandleConnection` method to handle network errors and EOF scenarios more thoroughly, adjusting processing time measurements, and handling deadlines for connection processing. Furthermore, the initialization of the syslog parser has now been moved to the `NewServer` function for efficiency.
Introduced a new Connection struct and related functions in `connection.go` to facilitate network connections. Incorporated the `go-parsesyslog` package to parse incoming network data. Implemented functions in `server.go` to accept and handle incoming network connections, bolstering the application's network interaction functionality.
The .env file has been added to the .gitignore file to ensure it's not tracked in the git repository. This change helps to protect sensitive environment variable settings by preventing them from being inadvertently published within the project repository.
The logranger.toml file is moved to the 'etc' directory, and its pid_file location is updated. The .gitignore file is also edited to ignore local configuration files in the 'etc' directory to prevent them from being tracked. This creates a cleaner project structure and ensures local configurations are kept private.
The documentation for some methods in the server-related files (config.go, server.go, and listener.go) has been updated to provide more accurate and descriptive explanations of their functionality. Additionally, the New methods for Config and Server objects have been changed to reflect that they create instances of these objects. Some method functionalities like 'setLogLevel' in server.go have been extended for more accurate operation based on the config log level.
Introduced SPDX-FileCopyrightText and SPDX-License-Identifier: MIT to the newly created file 'go.sum.license'. This ensures the appropriate licensing information is present and accurately defines the rights as per recent license policy changes.
Redid signal handling in the main server code leading to simpler, more readable code. Removed the SPDX license identifiers from 'go.sum' following recent policy changes.
All source code files as well as README.md, .gitignore, and various configuration files have been updated with an SPDX license identifier, changing license from CC0-1.0 to MIT. The copyright year has been updated to 2023, and the copyright holder's email address has been corrected from 'winni@neessen.dev' to 'wn@neessen.dev'. An MIT license text file has been additionally added.
This commit introduces the creation of the core server and its components: config loading mechanism, listener setup, and error handling. The provided configuration allows the server to run different types of listeners. Additionally, it includes robust log-level settings to facilitate debugging and operational transparency.
This commit introduces two new workflows for Github Actions: REUSE Compliance Check and golangci-lint. It also includes the funding options for the project in a dedicated FUNDING.yml file. These changes will enhance code quality checks and offer ways to support the project financially.
This commit introduces a SonarQube configuration setup, adds an .idea/.gitignore file, and expands the root .gitignore file. The SonarQube setup includes a GitHub Actions workflow and a project properties file. The .gitignore files are updated to properly ignore files for JetBrains IDEs, local testfiles, SonarQube, and others.