This commit add IsIPv6Only function inside `internal/ip` package
and moving `geo` package from `internal/geo` to `internal/ip/geo`.
Although it increases server resource usage, checking hostname to IP is
required every time the prober sends a report so that the `ipv6_only`
record in the database is not up-to-date. Previously, this feature did
not exist.
This commit accept IPv6 nodes submission.
When user submit new public node, the server will check IP addresses
from given hostname. If host IP addresses doesn't have IPv4, it will
be recorded as "IPv6 only" node.
Probers that support IPv6 may add `IPV6_CAPABLE=true` to the `.env`
file.
Please note that this feature still experimental and may not being
merged to the main branch.
Only return with status code `1` if error type is `errProber` which one
of this following const:
errNoEndpoint, errNoTorSocks, errNoAPIKey, and errInvalidCredentials.
The administration of the server is done using cli tools. So I don't
think that admin account and module is required. At least for now.
Note that this also remove `tbl_admin` creation in database migrate.
Since no release were made until this commit, the database migration
still in version 1. Manual removal database table for `tbl_admin`
is required on the existing running server.
Adding struct chan to run cron Process to stop the goroutine.
Moving db migration inside `fiber.IsChild` block
to avoid multiple execution migration script when in prefork mode.
Give additional time for graceful shutdown.
Since `tbl_cron` will contain a few rows (for now just 1),
cron list function call is not using any arguments.
This commit also remove cron http handler and endpoint.
Listing probers is now only available from server CLI.
The `ProbersQueryParams` struct also changed. I don't think that I will
use more than 20 probers in this project, so paging is not required.
The search param also simplified in one field struct `Search" which
search both in `name` and `api_key` column.
The log level for the apps is using `log/slog` from Go standard library.
This commit change log format for fiber http logger to match with
the slog standard log format (date and time).
This commit also remove `APP_DEBUG` field from config struct.
TODO:
Use `slog` for default app output. Note that in this commit, the `slog`
output only implemented in `cron` "db migrate" and probe client.
This commit change database name and MoneroNode struct:
- `NodeVersion` to `Version`
- `LastHeight` to `Height`
This commit also add `Status` to the MoneroNode struct.
Please note that this commit is not complete. I commit to the repo
because I have something to do with my another project. Just don't
want to lost my work for the last couple hours.