Commit graph

26 commits

Author SHA1 Message Date
ditatompel
253230dc5a
Removing admin module and functions
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.
2024-05-23 03:40:06 +07:00
ditatompel
40b9a6e1d6
Make sure cron goroutine is stopped
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.
2024-05-23 02:58:58 +07:00
ditatompel
8c1f6b0c43
Make cron as it's own package 2024-05-23 02:24:06 +07:00
ditatompel
c6efceb0ac
Adding some const error in client probe cmd 2024-05-23 00:40:13 +07:00
ditatompel
ddc448e90c
Moving monero.go to its own internal package 2024-05-22 22:45:38 +07:00
ditatompel
d5f510ae32
Remove admin login logout handler and endpoints #2 2024-05-18 20:27:30 +07:00
ditatompel
30b37b922f
Ability to list cron from CLI #2
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.
2024-05-18 20:13:00 +07:00
ditatompel
120ba51c87
Ability to edit prober name by ID from CLI #2 2024-05-18 19:50:20 +07:00
ditatompel
b5e2787420
Ability to delete prober by ID from CLI #2 2024-05-18 19:39:27 +07:00
ditatompel
d2f927e3db
Ability to add prober from CLI #2 2024-05-18 19:03:56 +07:00
ditatompel
7b6cfee31d
Set ./cmd/server/admin.go as entrypoint to server build 2024-05-18 18:42:32 +07:00
ditatompel
7dea8380b8
Separating client and server package #3
The client and server package is now separated, so I can build
additional server package with `-tags server`.
2024-05-18 17:59:54 +07:00
ditatompel
e0cd343be7
List Probers as sub-command of probers cmd 2024-05-18 01:42:31 +07:00
ditatompel
59f1dd9421
List Probers CLI command #2
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.
2024-05-18 00:56:13 +07:00
ditatompel
46bc3dc2e8
Using slog for logging level
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.
2024-05-13 18:40:01 +07:00
ditatompel
ce830c393b
Change PRC prober user agent info
Use the repository URL instead my email address for prober user agent
information.
2024-05-13 14:56:29 +07:00
ditatompel
d3113bf598
feat: MySQL db migration
Create database schema migration for this app that run when the `serve`
command is executed.
2024-05-12 04:19:40 +07:00
ditatompel
bd37f17072
Include date_entered when inporting from old API
When importing from old API endpoint, also get the `date_entered` field
and insert to database.
2024-05-12 01:35:41 +07:00
ditatompel
5496692c5d
Avoid naming module using a domain name pattern
I hope it will be less discoverable by other users and less likely to
be used unintentionally in other projects.
2024-05-08 21:35:04 +07:00
ditatompel
2c7e1a4fdb
Add import command (temporary)
This command only available during migration process and will be removed
in future versions.
2024-05-06 23:53:23 +07:00
ditatompel
3b0420d950
Fix accept_tor query param.
The query param for "accept_tor" is wrong.

Morale of the story: Never code when you're drunk
2024-05-06 22:53:23 +07:00
ditatompel
1baddfd2d1
Process submitted job from prober 2024-05-05 01:42:47 +07:00
ditatompel
9b8182082a
Nothing important, just remove print debug info 2024-05-04 22:56:59 +07:00
ditatompel
e9577b9bcf
Follow the monero RPC response
This commit change database name and MoneroNode struct:

- `NodeVersion` to `Version`
- `LastHeight` to `Height`

This commit also add `Status` to the MoneroNode struct.
2024-05-04 22:53:03 +07:00
ditatompel
8724b81431
Probe (client) check remote node
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.
2024-05-04 22:36:57 +07:00
ditatompel
ced266159e
Copying my other project structure to this project 2024-05-04 00:11:56 +07:00