Commit graph

64 commits

Author SHA1 Message Date
abhishek9686 b2361be29b track failover usage 2024-04-17 17:22:47 +05:30
abhishek9686 4fe282d5d7 add trial license status to server status api 2024-01-23 10:34:45 +05:30
abhishek9686 1f44817e64 add tenantid check 2024-01-23 08:33:17 +05:30
abhishek9686 17980cc222 get trial end date only if license key is missing 2024-01-20 01:39:31 +05:30
abhishek9686 7a39ef3e4e add trial end date to server status api 2024-01-20 01:30:09 +05:30
Gabriel de Souza Seibel 944405f0b7
[ACC-339] Add route to restart server (#2672)
* Add route to restart server with SIGINT

* Respond with 200 in /api/server/health DELETE

* Log before sending SIGINT

* Change route to shutdown
2023-11-22 12:02:11 +04:00
Gabriel de Souza Seibel 001442e75e
[NET-493] - Additional data fields to send to account management (#2583)
* Send relays and internet gws count to amb

* Unify usage funcs in logic pkg

* Fix ee build

* Revert "Unify usage funcs in logic pkg"

This reverts commit 28afc91f7e.

* Add more resource metrics on getUsage handler

* Use pro module's function to get server usage on lic val

* Move GetRelays to pro package
2023-10-06 10:22:58 +04:00
Aceix fde74e0627
fix(NET-581): add tenant tier to status api (#2558)
* fix(NET-581): add tenant tier to status api

* fix(NET-581): make tenant tier boolean in status api

* fix(NET-581): rename EE to Pro
2023-09-11 09:39:33 +05:30
Gabriel de Souza Seibel 1a1ba1ccf4
[NET-546] Move ee code to ee package, unify ee status and terminology (#2538)
* Move ee code to ee package and unify ee status to IsPro

* Consolidate naming for paid/professional/enterprise version as "pro". Notes:

- Changes image tags
- Changes build tags
- Changes package names
- Doesn't change links to docs that mention "ee"
- Doesn't change parameters sent to PostHog that mention "ee"

* Revert docker image tag being -pro, back to -ee

* Revert go build tag being pro, back to ee

* Add build tags for some ee content

* [2] Revert go build tag being pro, back to ee

* Fix test workflow

* Add a json tag to be backwards compatible with frontend "IsEE" check

* Add a json tag for the serverconfig struct for IsEE

* Ammend json tag to Is_EE

* fix ee tags

---------

Co-authored-by: Abhishek Kondur <abhi281342@gmail.com>
2023-09-01 07:42:05 +05:30
Gabriel de Souza Seibel 8ce7da2ce9
[NET-494 / ACC-322] New free tier limits (#2495)
* Rename var

* Rename consts and use iota

* Use switch instead of repeated else if

* Rename limits related vars

* Introduce new free tier limits

* Measure new limits and report on license validation

* Separate usage and limits, have new ones

* Don't check for hosts and clients limits, but for machines instead

* Error on egress creation @ free tier w/ internet gateways

* Remove clients and hosts limit from code

* Rename var

* Rename consts and use iota

* Use switch instead of repeated else if

* Rename limits related vars

* Introduce new free tier limits

* Measure new limits and report on license validation

* Separate usage and limits, have new ones

* Don't check for hosts and clients limits, but for machines instead

* Error on egress creation @ free tier w/ internet gateways

* Remove clients and hosts limit from code
2023-08-08 23:17:49 +05:30
Gabriel de Souza Seibel 922e7dbf2c
[NET-404] Run in limited mode when ee checks fail (#2474)
* Add limited http handlers functionality to rest handler

* Export ee.errValidation (ee.ErrValidation)

* Export a fatal error handled by the hook manager

* Export a new status variable for unlicensed server

* Mark server as unlicensed when ee checks fail

* Handle license validation failures with a (re)boot in a limited state

* Revert "Export a fatal error handled by the hook manager"

This reverts commit 069c21974a8d36e889c73ad78023448d787d62a5.

* Revert "Export ee.errValidation (ee.ErrValidation)"

This reverts commit 59dbab8c79773ca5d879f28cbaf53f3dd4297b9b.

* Revert "Add limited http handlers functionality to rest handler"

This reverts commit e2f1f28facaca54713db76a588839cd2733cf673.

* Revert "Handle license validation failures with a (re)boot in a limited state"

This reverts commit 58cfbbaf522a1345aac1fa67964ebff0a6d60cd8.

* Revert "Mark server as unlicensed when ee checks fail"

This reverts commit 77c6dbdd3c9cfa6e7d6becedef6251e8617ae367.

* Handle license validation failures with a middleware

* Forbid responses if unlicensed ee and not in status api

* Remove unused func
2023-08-03 12:16:58 +05:30
Abhishek K 230e062c84
GRA-1298: License check changes, free tier limits for saas (#2418)
* set free tier limits through config

* add host limit to config

* check for host limit on free tier

* fix license validation, replace node limit with hosts

* add hosts to telemetry data

* debug init

* validate license every 1hr

* hook manager, api to fetch server usage

* hook manager, server usage api

* encode json server usage api

* update ngork url

* update license validation endpoint

* avoid setting limits on eer

* adding hotfix

* correct users limits env var

* add comments to exported funcs

---------

Co-authored-by: afeiszli <alex.feiszli@gmail.com>
2023-06-28 20:33:06 +05:30
Abhishek K 6c2582651c
Net-137: Node relays (#2401)
* revert relays

* initial relay commit

* get relayed allowed ips

* add more relay validation checks, peer logic cleanup

* rm relayed nodes from relay node when relayed node is deleted

* fix egress updates for relayed nodes

* rm unused func

* remove  debug logs

* avoid adding egress ranges on the relayed gw node

---------

Co-authored-by: Matthew R Kasun <mkasun@nusak.ca>
2023-06-19 12:26:14 -04:00
Tobias Cudnik 723375b334
NET-152 enrollment keys for non admins (#2346)
* return 401 instead of 403

* fixed http.StatusForbidden

* Tagged build version (temp)

* Unauthorized_Err when applicable

* untagged version

* fixed PUT /api/users/networks/user1

* - expired token redirs to login
- added `/api/enrollment_keys` for non-admins
- unit test for enrollment keys for non-admins

* handle user perms in `/hosts`

* removed debug

* misc

* - support masteradmin
- return hosts with partial access

* added `ismaster` to middleware
2023-05-31 13:11:54 +05:30
Tobias Cudnik 3a4363c890
NET-163: Return 403 instead of 401 (#2326)
* return 401 instead of 403

* fixed http.StatusForbidden

* Tagged build version (temp)

* Unauthorized_Err when applicable

* untagged version
2023-05-25 09:40:39 -04:00
0xdcarns 7a2c225eb1 added mq and database connected funcs and endpoint 2023-02-06 12:09:21 -05:00
walkerwmanuel 6611941ca2 Replaced string methods with HTTP consts 2022-12-23 09:49:08 -05:00
Abhishek Kondur a04549eebe rm register endpoint 2022-09-30 23:19:33 +05:30
Abhishek Kondur faf7addcf5 Merge branch 'bugfix_v0.16.1_ee_checks' of https://github.com/gravitl/netmaker into feature_dyn_sec_latest 2022-09-26 18:09:34 +05:30
Abhishek Kondur f632bec11d merge conflicts resolved 2022-09-26 17:47:20 +05:30
Abhishek Kondur cbcb046139 added server health check api 2022-09-26 16:55:33 +05:30
Matthew R. Kasun 5f7d6ea1ef logic.Is_EE --> systemcfg.Is_EE 2022-09-25 07:11:26 -04:00
afeiszli d19cac35fa removed remove network 2022-09-19 12:59:37 -04:00
Alex Feiszli 53d2250049
Merge branch 'develop' into bugfix_v0.16.0_swagger_sections 2022-09-19 12:55:32 -04:00
cameronts 4cc32a5b50 Fix sections for /server/ and /users/ paths in Swagger docs 2022-09-15 05:47:48 -07:00
afeiszli b670755cce refactoring for ee 2022-09-14 13:26:31 -04:00
afeiszli 4917c457db added ee check 2022-09-13 15:44:45 -04:00
cameronts 661290c84d Update swagger docs 2022-09-10 21:51:59 -07:00
cameronts cb23b871dd Added swagger for API docs. 2022-09-06 05:20:24 -07:00
Abhishek Kondur 0c9f3cf251 GRA-414: added additional logs for sever controllers 2022-07-12 20:03:14 +04:00
afeiszli f28d361bea refactoring cert logic to use database 2022-06-30 22:30:28 -04:00
afeiszli b281047168 adding functions to handle certs in DB 2022-06-30 21:56:11 -04:00
afeiszli 8d422526b3 refactoring servercfg 2022-05-31 12:07:56 -04:00
afeiszli e4189ad8bd refactoring serverinfo logic 2022-05-31 08:42:12 -04:00
afeiszli 0865a535c7 changing broker retrieval/setting logic 2022-05-30 12:39:33 -04:00
Matthew R. Kasun f5aa1d1e62 reorder register/join 2022-04-25 10:38:29 -04:00
Matthew R. Kasun 955e0e544c join as api call
Signed-off-by: Matthew R. Kasun <mkasun@nusak.ca>
2022-04-20 15:46:19 -04:00
Matthew R. Kasun 2b1f20e94b changes from code review
Signed-off-by: Matthew R. Kasun <mkasun@nusak.ca>
2022-04-18 18:21:55 -04:00
Matthew R. Kasun 1cbbd52e7d fixed comment
Signed-off-by: Matthew R. Kasun <mkasun@nusak.ca>
2022-04-18 09:47:01 -04:00
Matthew R. Kasun 94b89dfff1 Merge branch 'feature_v0.13.0_mq_cleanup' into feature_v0.13.0_mq_register 2022-04-18 09:27:51 -04:00
Matthew R. Kasun d312bf6636 return certs in correct order
Signed-off-by: Matthew R. Kasun <mkasun@nusak.ca>
2022-04-18 09:22:11 -04:00
Matthew R. Kasun f8fe382c02 cleanup and comments 2022-04-16 16:43:10 -04:00
Matthew R. Kasun eae74e3430 gen certs with go rather than openssl 2022-04-16 08:37:55 -04:00
Matthew R. Kasun a2805ddc80 register/cert gen 2022-04-16 08:27:22 -04:00
Matthew R. Kasun 4f19beda00 save returned certs/keys 2022-04-15 16:07:19 -04:00
0xdcarns 08e219cdcc idk 2022-04-15 15:20:46 -04:00
0xdcarns 1cf9ac77e9 changed encoding of structs 2022-04-15 15:03:54 -04:00
Matthew R. Kasun 7524f08146 response update
Signed-off-by: Matthew R. Kasun <mkasun@nusak.ca>
2022-04-15 13:43:05 -04:00
Matthew R. Kasun a6c388db67 use openssl to gen client key/cert 2022-04-15 13:32:10 -04:00
Matthew R. Kasun 84de5c5216 use issuer's public key for certs 2022-04-15 09:54:35 -04:00