Commit graph

32 commits

Author SHA1 Message Date
Christian Ditaputratama
f227371fa6
fix: Allow tor address with subdomain #149 2024-11-06 20:47:34 +07:00
Christian Ditaputratama
3f5c2b9905
feat: Added TOR address validation #149 2024-11-06 20:21:15 +07:00
Christian Ditaputratama
6e7eccc6b3
chore: Stick with old SortDirection 2024-11-03 20:43:43 +07:00
Christian Ditaputratama
f0a10208e2
feat!: Added CORS filter
DEPRECATED: Using int value for CORS is deprecated, please use "on" to
filter CORS capable nodes. Leave CORS empty to disable CORS filter.
2024-11-03 20:24:55 +07:00
Christian Ditaputratama
c3b6f587ed
feat: Added filter by status 2024-11-03 18:03:13 +07:00
Christian Ditaputratama
0165f0c251
feat: Added folter by protocol 2024-11-03 16:33:50 +07:00
Christian Ditaputratama
97f6312ce9
feat: Added table filter: host and nettype 2024-11-03 16:15:01 +07:00
Christian Ditaputratama
44722f6b43
feat: Added node statuses cell component 2024-11-01 21:19:23 +07:00
Christian Ditaputratama
10182d9dbc
feat!: Added base datatable functionality
Deprecated: `SortDirection` is deprecated, use `SortDir` instead
2024-10-31 22:45:26 +07:00
Christian Ditaputratama
ec6f0a1893
Changed LastChecked from uint to int64
Since the LastChecked record is storing unix timestamp, using `int64`
make it easier to work with `time` package.
2024-10-31 22:40:38 +07:00
Christian Ditaputratama
ef953b36fd
fix: Reject input hostname with protocol
This is quick fix.

Do not accept submitted tor address with protocol since it won't work.

The initial clearnet validation can be done with `net.LookupIP`, but
for tor network can't be done with that method. For now, just inform
to remove the http:// or https:// part to the submitter.
2024-09-16 22:35:14 +07:00
Christian Ditaputratama
f6b048b017
feat: Record node ip addresses #84
For future use investigations about "suspicious" nodes. #105
2024-09-12 01:13:30 +07:00
Christian Ditaputratama
c3f837e122
feat: Check IP-stack info everytime prober send report #84
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.
2024-09-09 18:21:03 +07:00
Christian Ditaputratama
518d4b4335
feat: Added IPv6 nodes support (alpha) #84
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.
2024-09-06 00:08:59 +07:00
Christian Ditaputratama
5a6641a199
refactor: Use ptr for QueryNodes.toSQL()
Since `SortBy` and `SortDirection` is modified directly from `QueryNodes`
pointer, `sortBy` and `sortDirrection` return value from `QueryNodes.toSQL()`
no longger needed
2024-08-05 18:27:00 +07:00
Christian Ditaputratama
97fad6cacb
refactor: Use slice.Contains() nettype check
Instead using `||` for each nettype query check , simply using `slice.Contains`.
Also, checking `any` value is not needed here.
2024-07-29 22:30:03 +07:00
Christian Ditaputratama
4d1a2da49c
refactor: Use moneroRepo struct instead of interface
No need to use interface when calling `monero.New()`.
2024-07-07 03:13:11 +07:00
Christian Ditaputratama
4c7d53547b
feat!: Change the module name to "URL based"
This make me easier to test the module with external services.
2024-07-07 01:28:44 +07:00
ditatompel
70372e58ab
Changed the initialization of the countries slice 2024-06-08 00:53:28 +07:00
ditatompel
054a4809dd
No need to use ptr for NetFee 2024-06-08 00:37:26 +07:00
ditatompel
54d82e0c8f
fix: RowsPerPage nodes API return zero
Forget to set RowsPerPage response
2024-06-03 13:18:52 +07:00
ditatompel
48fe09c1cb
Adding table tbl_fee
This table used to store majority fee of monero nettype.
By calculating majority fee via "cron" every 300s, the function to
get majority fee for nettypes can be done with single query.

The frontend majority static data in the frontend removed and
now use `/api/v1/fees` endpoint to get majority fee value.

Note: Don't know if it works well with `onload` method or not. Let see.
2024-05-31 16:28:21 +07:00
ditatompel
55f6af1f22
Change estimate fee for stagenet to 56000
TODO: Create in-memory cache for NetFees function.
2024-05-31 13:30:56 +07:00
ditatompel
e83045f8b5
toSQL function for QueryLog struct 2024-05-31 13:04:53 +07:00
ditatompel
acc70111c8
fix: slog args message become slog.Attr 2024-05-30 19:41:03 +07:00
ditatompel
a11986ac0c
Separating QueryNode to it's own sql builder func
A quick note that is's ok to use "*" all columns on nodes query
since all columns really want to be displayed to the frontend.
2024-05-30 19:19:03 +07:00
ditatompel
0b331ec6c6
Lowercase & upperase initialism acronyms
See https://google.github.io/styleguide/go/decisions#initialisms
2024-05-30 12:46:33 +07:00
ditatompel
ab82985bdf
Rename MoneroLogQueryParams to QueryLogs
The reason is same with commits reference 99a367f04b
2024-05-27 06:38:11 +07:00
ditatompel
6b5225758e
Rename NewMoneroRepo to just New
Just run `monero.New()` to initialize MoneroRepository.

The database connection is now called from the `New()` function
2024-05-27 06:15:40 +07:00
ditatompel
99a367f04b
chore: Renamed MoneroQueryParams
The `MoneroQueryParams` renamed to `QueryNodes`.
It become much more readable when calling it.

Also added some comment in some functions.
2024-05-27 05:13:03 +07:00
ditatompel
c25e9224b6
lint: No err check 2024-05-24 05:37:27 +07:00
ditatompel
ddc448e90c
Moving monero.go to its own internal package 2024-05-22 22:45:38 +07:00
Renamed from internal/repo/monero.go (Browse further)