This change implements the category / rule Server which will showcase
storig arbirtray alongside the hostname which are not part of hostname
generation.
This change moves the responsibility of calling the HostnameRule.Generate
function to the corresponding HostnameRule.{Insert,Update} functions
which will allow autonomy especially for the update functions on when
a hostname needs to be regenerated.
These changes refactor the router handling into its own package to keep
main.go clean. Also API handlers are here refactored to their corresponding
files.
This commit adds a LICENSE file to the repository root and begins the
process of migrating from the preliminary MIT license we chose to the
Apache License 2.0
This commit adds the ability to provide a config file in different ways:
The following options are given in the order in which they are checked:
1. A config file path passed by the -c parameter on the command line
2. A config file path passed by the HS_CONFIGFILE environment variable
3. A config.json file in the application root
Should these fail we try to get the parameters for the config struct
directly from environment variables or secret files as used in a
container environment. As example the JwtKey can be supplied by either
passing the value through:
* An environment variable HS_CONFIG_JWTKEY which contains the value directly
* An environment variable HS_CONFIG_JWTKEY_FILE which contains a path
pointing to the Secret File
In BaseRule.baseUpdate our goal is to check if a hostname exists before
trying to rename that hostname into something else. This patch fixes an
error where the newly generated Hostname was used to check for the
existence of the old hostname.
This commits upgrades the following go dependencies:
- github.com/bytedance/sonic v1.9.2
- github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d
- github.com/chenzhuoyu/iasm v0.9.1
We should not hardcode the database name at different places in
db.Init(). This will allow to make the database path configurable
in a later change, and importantly prevent discrepancies
* bump go.uber.org/atomic version to "v1.11.0"
* bump github.com/bytedance/sonic version to "v1.9.2"
* bump github.com/gabriel-vasile/mimetype version to "v1.4.3"
* bump github.com/go-playground/validator/v10 version to "v10.17.0"
* bump github.com/klauspost/cpuid/v2 version to "v2.2.6"
* bump github.com/mattn/go-isatty version to "v0.0.20"
* bump github.com/pelletier/go-toml/v2 version to "v2.1.1"
* bump github.com/ugorji/go/codec version to "v1.2.12"
* bump golang.org/x/arch version to "v0.7.0"
* bump golang.org/x/crypto version to "v0.18.0"
* bump google.golang.org/protobuf version to "v1.32.0"
This commits adds a .gitignore file which will prevent committing of:
* Files referenced in Go.gitignore
* VisualStudioCode specific files (.vscode, ...)
* Windows specific files (ie thumbs.db)
* SQLite Databases