diff --git a/app/vmauth/auth_config.go b/app/vmauth/auth_config.go index 4c7fa1527c..19dc197e3a 100644 --- a/app/vmauth/auth_config.go +++ b/app/vmauth/auth_config.go @@ -37,7 +37,7 @@ type UserInfo struct { Username string `yaml:"username,omitempty"` Password string `yaml:"password,omitempty"` URLPrefix *URLPrefix `yaml:"url_prefix,omitempty"` - URLMap []URLMap `yaml:"url_map,omitempty"` + URLMaps []URLMap `yaml:"url_map,omitempty"` Headers []Header `yaml:"headers,omitempty"` requests *metrics.Counter @@ -284,7 +284,7 @@ func parseAuthConfig(data []byte) (map[string]*UserInfo, error) { return nil, err } } - for _, e := range ui.URLMap { + for _, e := range ui.URLMaps { if len(e.SrcPaths) == 0 { return nil, fmt.Errorf("missing `src_paths` in `url_map`") } @@ -295,7 +295,7 @@ func parseAuthConfig(data []byte) (map[string]*UserInfo, error) { return nil, err } } - if len(ui.URLMap) == 0 && ui.URLPrefix == nil { + if len(ui.URLMaps) == 0 && ui.URLPrefix == nil { return nil, fmt.Errorf("missing `url_prefix`") } if ui.BearerToken != "" { diff --git a/app/vmauth/auth_config_test.go b/app/vmauth/auth_config_test.go index a18fffd101..d0a2f12baa 100644 --- a/app/vmauth/auth_config_test.go +++ b/app/vmauth/auth_config_test.go @@ -278,7 +278,7 @@ users: `, map[string]*UserInfo{ getAuthToken("foo", "", ""): { BearerToken: "foo", - URLMap: []URLMap{ + URLMaps: []URLMap{ { SrcPaths: getSrcPaths([]string{"/api/v1/query", "/api/v1/query_range", "/api/v1/label/[^./]+/.+"}), URLPrefix: mustParseURL("http://vmselect/select/0/prometheus"), @@ -304,7 +304,7 @@ users: }, getAuthToken("", "foo", ""): { BearerToken: "foo", - URLMap: []URLMap{ + URLMaps: []URLMap{ { SrcPaths: getSrcPaths([]string{"/api/v1/query", "/api/v1/query_range", "/api/v1/label/[^./]+/.+"}), URLPrefix: mustParseURL("http://vmselect/select/0/prometheus"), diff --git a/app/vmauth/target_url.go b/app/vmauth/target_url.go index 3df9a2e803..5f3d0df633 100644 --- a/app/vmauth/target_url.go +++ b/app/vmauth/target_url.go @@ -52,7 +52,7 @@ func createTargetURL(ui *UserInfo, uOrig *url.URL) (*url.URL, []Header, error) { // See https://github.com/VictoriaMetrics/VictoriaMetrics/pull/1554 u.Path = "" } - for _, e := range ui.URLMap { + for _, e := range ui.URLMaps { for _, sp := range e.SrcPaths { if sp.match(u.Path) { return e.URLPrefix.mergeURLs(&u), e.Headers, nil diff --git a/app/vmauth/target_url_test.go b/app/vmauth/target_url_test.go index 84c9e681ba..a942dd8ac9 100644 --- a/app/vmauth/target_url_test.go +++ b/app/vmauth/target_url_test.go @@ -54,7 +54,7 @@ func TestCreateTargetURLSuccess(t *testing.T) { // Complex routing with `url_map` ui := &UserInfo{ - URLMap: []URLMap{ + URLMaps: []URLMap{ { SrcPaths: getSrcPaths([]string{"/api/v1/query"}), URLPrefix: mustParseURL("http://vmselect/0/prometheus"), @@ -86,7 +86,7 @@ func TestCreateTargetURLSuccess(t *testing.T) { // Complex routing regexp paths in `url_map` ui = &UserInfo{ - URLMap: []URLMap{ + URLMaps: []URLMap{ { SrcPaths: getSrcPaths([]string{"/api/v1/query(_range)?", "/api/v1/label/[^/]+/values"}), URLPrefix: mustParseURL("http://vmselect/0/prometheus"), @@ -132,7 +132,7 @@ func TestCreateTargetURLFailure(t *testing.T) { } f(&UserInfo{}, "/foo/bar") f(&UserInfo{ - URLMap: []URLMap{ + URLMaps: []URLMap{ { SrcPaths: getSrcPaths([]string{"/api/v1/query"}), URLPrefix: mustParseURL("http://foobar/baz"), diff --git a/docs/Cluster-VictoriaMetrics.md b/docs/Cluster-VictoriaMetrics.md index fd66e13b72..7a474efa9b 100644 --- a/docs/Cluster-VictoriaMetrics.md +++ b/docs/Cluster-VictoriaMetrics.md @@ -37,7 +37,7 @@ Each service may scale independently and may run on the most suitable hardware. This is a [shared nothing architecture](https://en.wikipedia.org/wiki/Shared-nothing_architecture). It increases cluster availability, and simplifies cluster maintenance as well as cluster scaling. -![Naive cluster scheme](assets/images/Naive_cluster_scheme.png) +![Naive cluster scheme](Cluster-VictoriaMetrics_cluster-scheme.png) ## Multitenancy diff --git a/docs/assets/images/Naive_cluster_scheme.png b/docs/Cluster-VictoriaMetrics_cluster-scheme.png similarity index 100% rename from docs/assets/images/Naive_cluster_scheme.png rename to docs/Cluster-VictoriaMetrics_cluster-scheme.png diff --git a/docs/assets/README.md b/docs/assets/README.md new file mode 100644 index 0000000000..93e9b55bae --- /dev/null +++ b/docs/assets/README.md @@ -0,0 +1,12 @@ +This folder must contain only files, which are needed for generating https://docs.victoriametrics.com . + +This folder **should not contain** files specific for a particular documentation pages such as images +used in a particular doc. Such files must be placed in the same folder as the doc itself +and they must have the same prefix as the doc filename. For example, all the images for docs/foo/bar.md +should have filenames starting from docs/foo/bar. This simplifies lifetime management for these files. +For example, if the corresponding doc is removed, then it is easy to remove all the associated +images with a simple `rm -rf docs/foo/bar*` command. This also simplifies referring the associated images +from docs displayed at various views: + +- https://docs.victoriametrics.com +- https://github.com/VictoriaMetrics/VictoriaMetrics/tree/master/docs diff --git a/docs/managed_victoriametrics/README.md b/docs/managed-victoriametrics/README.md similarity index 100% rename from docs/managed_victoriametrics/README.md rename to docs/managed-victoriametrics/README.md diff --git a/docs/managed_victoriametrics/quickstart.md b/docs/managed-victoriametrics/quickstart.md similarity index 67% rename from docs/managed_victoriametrics/quickstart.md rename to docs/managed-victoriametrics/quickstart.md index 16d20bf521..67d0989922 100644 --- a/docs/managed_victoriametrics/quickstart.md +++ b/docs/managed-victoriametrics/quickstart.md @@ -9,7 +9,35 @@ monitoring, logs collection, access protection, software updates, backups, etc. Managed VictoriaMetrics id distributed via [AWS Marketplace](https://aws.amazon.com/marketplace/pp/prodview-4tbfq5icmbmyc). To start using the service, one should have already registered AWS account and visit [VictoriaMetrics product page](https://aws.amazon.com/marketplace/pp/prodview-4tbfq5icmbmyc). -See more details [here](https://dbaas.victoriametrics.com/howToRegister). + +### Amazon Web Services + +Managed VictoriaMetrics id distributed via AWS Marketplace. +To start using the service, one should have already registered AWS account. Then, go to the +VictoriaMetrics product page +and click "Continue to Subscribe" button: + +

+ +

+ +Then on product page press the "Subscribe" button: + +

+ +

+ +You'll be taken to Managed VictoriaMetrics auth page: + +

+ +

+ +Choose to register manually or via Google Auth. + +Please note, that initial registering is only possible via link from AWS Marketplace. + +See what to do after registering in Quick Start guide. ## How to restore password @@ -18,13 +46,13 @@ If you forgot password, it can be restored in the following way: 1. Click `Forgot your password?` link at [this page](https://dbaas.victoriametrics.com/signIn):

- +

2. Enter your email in the field and click `Send Email` button:

- +

3. Follow the instruction sent to your email in order to gain access to your VictoriaMetrics cloud account: @@ -42,13 +70,13 @@ In case of questions contact our support support@victoriametrics.com 4. Navigate to the Profile page by clicking the corresponding link at the top right corner:

- +

5. Enter new password at the Profile page and press `Save` button:

- +

@@ -58,7 +86,7 @@ Instances is a page where user can list and manage VictoriaMetrics single-node i To create an instance click on the button `Create`:

- +

In the opened form, choose parameters of the new instance such as: @@ -69,7 +97,7 @@ In the opened form, choose parameters of the new instance such as: * `Retention` period for stored metrics.

- +

Once created, instance will remain for a short period of time in `PROVISIONING` status @@ -77,7 +105,7 @@ while the hardware spins-up, just wait for a couple of minutes and reload the pa You'll also be notified via email once provisioning is finished:

- +

## Access @@ -86,7 +114,7 @@ After transition from `PROVISIONING` to `RUNNING` state, VictoriaMetrics is full and ready to accept write or read requests. But first, click on instance name to get the access token:

- +

Access tokens are used in token-based authentication to allow an application to access the VictoriaMetrics API. @@ -94,7 +122,7 @@ Supported token types are `Read-Only`, `Write-Only` and `Read-Write`. Click on t to see usage examples:

- +

Follow usage example in order to configure access to VictoriaMetrics for your Prometheus, diff --git a/docs/managed-victoriametrics/quickstart_continue-subscribe.png b/docs/managed-victoriametrics/quickstart_continue-subscribe.png new file mode 100644 index 0000000000..f2bd6638b5 Binary files /dev/null and b/docs/managed-victoriametrics/quickstart_continue-subscribe.png differ diff --git a/docs/managed_victoriametrics/quickstart-instance-create.png b/docs/managed-victoriametrics/quickstart_instance-create.png similarity index 100% rename from docs/managed_victoriametrics/quickstart-instance-create.png rename to docs/managed-victoriametrics/quickstart_instance-create.png diff --git a/docs/managed_victoriametrics/quickstart-instance-provisioning.png b/docs/managed-victoriametrics/quickstart_instance-provisioning.png similarity index 100% rename from docs/managed_victoriametrics/quickstart-instance-provisioning.png rename to docs/managed-victoriametrics/quickstart_instance-provisioning.png diff --git a/docs/managed_victoriametrics/quickstart-instances.png b/docs/managed-victoriametrics/quickstart_instances.png similarity index 100% rename from docs/managed_victoriametrics/quickstart-instances.png rename to docs/managed-victoriametrics/quickstart_instances.png diff --git a/docs/managed_victoriametrics/restore-password-email.png b/docs/managed-victoriametrics/quickstart_restore-password-email.png similarity index 100% rename from docs/managed_victoriametrics/restore-password-email.png rename to docs/managed-victoriametrics/quickstart_restore-password-email.png diff --git a/docs/managed_victoriametrics/restore-password-profile.png b/docs/managed-victoriametrics/quickstart_restore-password-profile.png similarity index 100% rename from docs/managed_victoriametrics/restore-password-profile.png rename to docs/managed-victoriametrics/quickstart_restore-password-profile.png diff --git a/docs/managed_victoriametrics/restore-password-save-password.png b/docs/managed-victoriametrics/quickstart_restore-password-save-password.png similarity index 100% rename from docs/managed_victoriametrics/restore-password-save-password.png rename to docs/managed-victoriametrics/quickstart_restore-password-save-password.png diff --git a/docs/managed_victoriametrics/restore-password.png b/docs/managed-victoriametrics/quickstart_restore-password.png similarity index 100% rename from docs/managed_victoriametrics/restore-password.png rename to docs/managed-victoriametrics/quickstart_restore-password.png diff --git a/docs/managed-victoriametrics/quickstart_signin.png b/docs/managed-victoriametrics/quickstart_signin.png new file mode 100644 index 0000000000..54897fa3d5 Binary files /dev/null and b/docs/managed-victoriametrics/quickstart_signin.png differ diff --git a/docs/managed-victoriametrics/quickstart_subscribe.png b/docs/managed-victoriametrics/quickstart_subscribe.png new file mode 100644 index 0000000000..6405bbf24e Binary files /dev/null and b/docs/managed-victoriametrics/quickstart_subscribe.png differ diff --git a/docs/managed_victoriametrics/quickstart-token-usage.png b/docs/managed-victoriametrics/quickstart_token-usage.png similarity index 100% rename from docs/managed_victoriametrics/quickstart-token-usage.png rename to docs/managed-victoriametrics/quickstart_token-usage.png diff --git a/docs/managed_victoriametrics/quickstart-tokens.png b/docs/managed-victoriametrics/quickstart_tokens.png similarity index 100% rename from docs/managed_victoriametrics/quickstart-tokens.png rename to docs/managed-victoriametrics/quickstart_tokens.png diff --git a/docs/managed-victoriametrics/user-managment.md b/docs/managed-victoriametrics/user-managment.md new file mode 100644 index 0000000000..94d51d7e44 --- /dev/null +++ b/docs/managed-victoriametrics/user-managment.md @@ -0,0 +1,213 @@ +# User Management in Managed VictoriaMetrics + +The user management system enables admins to control user access and onboard and offboard users to the Managed VictoriaMetrics. It organizes users according to their needs and role. + +The document covers the following topics +1. [User Roles](#user-roles) +2. [User List](#user-list) +3. [How to Add User](#how-to-add-user) +4. [How to Update User](#how-to-update-user) +5. [How to Delete User](#how-to-delete-user) + +## User roles + +Managed VictoriaMetrics provides different levels of user access. It defines what information users can access and edit in your account. + +You assign the role to the user during the user creation procedure. You can change the role after the creation + + +#### Roles definition + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
User RoleCategoriesDescription
AdminDeployments + Access to all deployments tabs and information +

Create, update and delete deployment

+
Billing DetailsCheck billing information
NotificationsCreate and update notifications
Audit LogsCan check all information in audit logs
User ManagementAdd, edit and delete users
EditorDeployments + Access to all deployments tabs and information +

Create, update and delete deployment

+
NotificationsCreate and update notifications
Audit LogsCan check all information in audit logs
ViewerDeploymentsAccess to Overview, Monitoring, Explore and Alerts deployments tabs and information
+ +#### User statuses + + + + + + + + + + + + + + + +
ActiveThe user can log in and use Managed VictoriaMetrics. The user role defines the access level.
Pending InvitationAn invitation was sent. The user must accept this.
InactiveThe user is registered in the Managed VictoriaMetrics but has no access to perform any actions. Admin can active or completely delete the user.
+ + +## User list + +It shows all users with different roles, and you can apply provided actions with them. + +

+ +

+ +In the table, there is additional information about the users: + + + + + + + + + + + + + + + + + + + + + + + + + + + +
User Name:First name and last name
Email:Registration user email
Status:Active, Inactive or Pending Invitation
User Role:Admin, Editor or Viewer
Last Active:Last login date and time
Auth method:Auth options to login into the Managed VictoriaMetrics
+ +## How to Add User + +Click on + + + +the user invitation button and fill out the form in the modal, which will appear after you click. All fields are mandatory. + +

+ +

+ +After filling out the form, click on the + + + +button. The user will be saved, and an invitation email to the provided email address will be sent. As a confirmation, you will see the success message. + +**The invitation link is only active for 24 hours.** + +The user will be at Pending Invitation status. After accepting the invitation user status changes to Active. + +

+ +

+ +## How to Update User + +To edit the user role and details, activate or deactivate a user, and click on + + + +or + + + +to edit the user. + +

+ +

+ +User editing form: + +

+ +

+ +To save changes, click the + + + +button. If changes are saved successfully, you will see a message at the top of the page. + +

+ +

+ +## How to Delete User + +You can delete a user from your account. However, you will need to invite them again if you want to give them access. + +Click on + + + +to delete the user. + +

+ +

+ +To confirm the deletion of a user, you will need to re-enter their email address and press the **Delete** button + +

+ +

+ +You will be redirected to the main page with a success or error message + +

+ +

diff --git a/docs/managed-victoriametrics/user-managment_delete-user-btn.png b/docs/managed-victoriametrics/user-managment_delete-user-btn.png new file mode 100644 index 0000000000..65025be993 Binary files /dev/null and b/docs/managed-victoriametrics/user-managment_delete-user-btn.png differ diff --git a/docs/managed-victoriametrics/user-managment_delete-user-button.png b/docs/managed-victoriametrics/user-managment_delete-user-button.png new file mode 100644 index 0000000000..593c319305 Binary files /dev/null and b/docs/managed-victoriametrics/user-managment_delete-user-button.png differ diff --git a/docs/managed-victoriametrics/user-managment_delete-user-confirm.png b/docs/managed-victoriametrics/user-managment_delete-user-confirm.png new file mode 100644 index 0000000000..09734a8909 Binary files /dev/null and b/docs/managed-victoriametrics/user-managment_delete-user-confirm.png differ diff --git a/docs/managed-victoriametrics/user-managment_delete-user-success.png b/docs/managed-victoriametrics/user-managment_delete-user-success.png new file mode 100644 index 0000000000..5dfc827d7c Binary files /dev/null and b/docs/managed-victoriametrics/user-managment_delete-user-success.png differ diff --git a/docs/managed-victoriametrics/user-managment_edit-user-btn.png b/docs/managed-victoriametrics/user-managment_edit-user-btn.png new file mode 100644 index 0000000000..1e139af8b1 Binary files /dev/null and b/docs/managed-victoriametrics/user-managment_edit-user-btn.png differ diff --git a/docs/managed-victoriametrics/user-managment_edit-user-link.png b/docs/managed-victoriametrics/user-managment_edit-user-link.png new file mode 100644 index 0000000000..fb424e08e5 Binary files /dev/null and b/docs/managed-victoriametrics/user-managment_edit-user-link.png differ diff --git a/docs/managed-victoriametrics/user-managment_invite-button.png b/docs/managed-victoriametrics/user-managment_invite-button.png new file mode 100644 index 0000000000..d9e3e5327d Binary files /dev/null and b/docs/managed-victoriametrics/user-managment_invite-button.png differ diff --git a/docs/managed-victoriametrics/user-managment_invite-user-button.png b/docs/managed-victoriametrics/user-managment_invite-user-button.png new file mode 100644 index 0000000000..f0cbe003de Binary files /dev/null and b/docs/managed-victoriametrics/user-managment_invite-user-button.png differ diff --git a/docs/managed-victoriametrics/user-managment_invite-user-modal.png b/docs/managed-victoriametrics/user-managment_invite-user-modal.png new file mode 100644 index 0000000000..5631830edb Binary files /dev/null and b/docs/managed-victoriametrics/user-managment_invite-user-modal.png differ diff --git a/docs/managed-victoriametrics/user-managment_success-invitation.png b/docs/managed-victoriametrics/user-managment_success-invitation.png new file mode 100644 index 0000000000..8cfce34274 Binary files /dev/null and b/docs/managed-victoriametrics/user-managment_success-invitation.png differ diff --git a/docs/managed-victoriametrics/user-managment_update-user-buttons.png b/docs/managed-victoriametrics/user-managment_update-user-buttons.png new file mode 100644 index 0000000000..428b0c6d07 Binary files /dev/null and b/docs/managed-victoriametrics/user-managment_update-user-buttons.png differ diff --git a/docs/managed-victoriametrics/user-managment_update-user-save-button.png b/docs/managed-victoriametrics/user-managment_update-user-save-button.png new file mode 100644 index 0000000000..c1a3a2a6e3 Binary files /dev/null and b/docs/managed-victoriametrics/user-managment_update-user-save-button.png differ diff --git a/docs/managed-victoriametrics/user-managment_update-user-success.png b/docs/managed-victoriametrics/user-managment_update-user-success.png new file mode 100644 index 0000000000..24b8ba1e75 Binary files /dev/null and b/docs/managed-victoriametrics/user-managment_update-user-success.png differ diff --git a/docs/managed-victoriametrics/user-managment_update-user.png b/docs/managed-victoriametrics/user-managment_update-user.png new file mode 100644 index 0000000000..8482101013 Binary files /dev/null and b/docs/managed-victoriametrics/user-managment_update-user.png differ diff --git a/docs/managed-victoriametrics/user-managment_users-list.png b/docs/managed-victoriametrics/user-managment_users-list.png new file mode 100644 index 0000000000..acca183013 Binary files /dev/null and b/docs/managed-victoriametrics/user-managment_users-list.png differ diff --git a/lib/netutil/proxyprotocol.go b/lib/netutil/proxyprotocol.go index c45dd6f604..fd1628a265 100644 --- a/lib/netutil/proxyprotocol.go +++ b/lib/netutil/proxyprotocol.go @@ -99,7 +99,7 @@ func readProxyProto(r io.Reader) (net.Addr, error) { case 1: // ipv4 (aka AF_INET) if len(bb.B) < 12 { - return nil, fmt.Errorf("cannot ipv4 address from proxy protocol block with the length %d bytes; expected at least 12 bytes", len(bb.B)) + return nil, fmt.Errorf("cannot read ipv4 address from proxy protocol block with the length %d bytes; expected at least 12 bytes", len(bb.B)) } remoteAddr := &net.TCPAddr{ IP: net.IPv4(bb.B[0], bb.B[1], bb.B[2], bb.B[3]),