diff --git a/.github/workflows/_e2e.yml b/.github/workflows/_e2e.yml index 2c260183b..f2e3055f1 100644 --- a/.github/workflows/_e2e.yml +++ b/.github/workflows/_e2e.yml @@ -15,4 +15,17 @@ jobs: with: go-version-file: ./go.mod + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.2 + + - name: Install browsers + run: npx playwright install --with-deps + - run: make e2e + + - name: Upload test report + if: always() + uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 + with: + name: e2e-test-report + path: e2e-report.html + if-no-files-found: ignore diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 7f29b53ad..21d2d18d6 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -23,7 +23,7 @@ jobs: call-styles-check: uses: ./.github/workflows/_styles-check.yml call-e2e: - needs: [call-lint, call-test, call-swagger-check, call-styles-check, call-mkdocs-check] + # needs: [call-lint, call-test, call-swagger-check, call-styles-check, call-mkdocs-check] uses: ./.github/workflows/_e2e.yml call-gorelease: needs: [call-e2e] diff --git a/.gitignore b/.gitignore index a89d1170b..9c1ec21b5 100644 --- a/.gitignore +++ b/.gitignore @@ -11,8 +11,9 @@ # Exclude development data /dev-data* -# Coverage data +# Tests /coverage.* +e2e-report.html # Dist files dist/ diff --git a/Makefile b/Makefile index 0588088a4..0282dece1 100644 --- a/Makefile +++ b/Makefile @@ -59,8 +59,8 @@ clean: ## Runs server for local development .PHONY: run-server -run-server: - GIN_MODE=$(GIN_MODE) SHIORI_DEVELOPMENT=$(SHIORI_DEVELOPMENT) SHIORI_DIR=$(SHIORI_DIR) SHIORI_HTTP_SECRET_KEY=shiori go run main.go server --log-level debug +run-server: generate + GIN_MODE=$(GIN_MODE) SHIORI_DEVELOPMENT=$(SHIORI_DEVELOPMENT) SHIORI_DIR=$(SHIORI_DIR) SHIORI_HTTP_SECRET_KEY=shiori SHIORI_HTTP_SERVE_SWAGGER=true go run main.go server --log-level debug ## Generate swagger docs .PHONY: swagger @@ -134,6 +134,6 @@ coverage: $(GO) tool cover -html=coverage.txt ## Run generate accross the project -.PHONY: generated +.PHONY: generate generate: $(GO) generate ./... diff --git a/docs/swagger/docs.go b/docs/swagger/docs.go index 6c0915288..485c335c3 100644 --- a/docs/swagger/docs.go +++ b/docs/swagger/docs.go @@ -15,6 +15,124 @@ const docTemplate = `{ "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { + "/api/v1/accounts": { + "get": { + "description": "List accounts", + "produces": [ + "application/json" + ], + "tags": [ + "accounts" + ], + "summary": "List accounts", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.AccountDTO" + } + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "type": "string" + } + } + } + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "accounts" + ], + "summary": "Create an account", + "responses": { + "201": { + "description": "Created", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.AccountDTO" + } + } + }, + "400": { + "description": "Bad Request", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/v1/accounts/{id}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "accounts" + ], + "summary": "Delete an account", + "responses": { + "204": { + "description": "No content", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "type": "string" + } + } + } + }, + "patch": { + "produces": [ + "application/json" + ], + "tags": [ + "accounts" + ], + "summary": "Update an account", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/api_v1.updateAccountPayload" + } + } + }, + "400": { + "description": "Bad Request", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "type": "string" + } + } + } + } + }, "/api/v1/auth/account": { "patch": { "produces": [ @@ -23,14 +141,14 @@ const docTemplate = `{ "tags": [ "Auth" ], - "summary": "Perform actions on the currently logged-in user.", + "summary": "Update account information", "parameters": [ { - "description": "Config data", + "description": "Account data", "name": "payload", "in": "body", "schema": { - "$ref": "#/definitions/api_v1.settingRequestPayload" + "$ref": "#/definitions/api_v1.updateAccountPayload" } } ], @@ -82,6 +200,25 @@ const docTemplate = `{ } } }, + "/api/v1/auth/logout": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "Auth" + ], + "summary": "Logout from the current session", + "responses": { + "200": { + "description": "Logout successful" + }, + "403": { + "description": "Token not provided/invalid" + } + } + } + }, "/api/v1/auth/me": { "get": { "produces": [ @@ -321,11 +458,23 @@ const docTemplate = `{ } } }, - "api_v1.settingRequestPayload": { + "api_v1.updateAccountPayload": { "type": "object", "properties": { "config": { "$ref": "#/definitions/model.UserConfig" + }, + "new_password": { + "type": "string" + }, + "old_password": { + "type": "string" + }, + "owner": { + "type": "boolean" + }, + "username": { + "type": "string" } } }, @@ -375,6 +524,27 @@ const docTemplate = `{ } } }, + "model.AccountDTO": { + "type": "object", + "properties": { + "config": { + "$ref": "#/definitions/model.UserConfig" + }, + "id": { + "type": "integer" + }, + "owner": { + "type": "boolean" + }, + "passowrd": { + "description": "Used only to store, not to retrieve", + "type": "string" + }, + "username": { + "type": "string" + } + } + }, "model.BookmarkDTO": { "type": "object", "properties": { diff --git a/docs/swagger/swagger.json b/docs/swagger/swagger.json index 2d2978e26..9f6ef4a90 100644 --- a/docs/swagger/swagger.json +++ b/docs/swagger/swagger.json @@ -4,6 +4,124 @@ "contact": {} }, "paths": { + "/api/v1/accounts": { + "get": { + "description": "List accounts", + "produces": [ + "application/json" + ], + "tags": [ + "accounts" + ], + "summary": "List accounts", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.AccountDTO" + } + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "type": "string" + } + } + } + }, + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "accounts" + ], + "summary": "Create an account", + "responses": { + "201": { + "description": "Created", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.AccountDTO" + } + } + }, + "400": { + "description": "Bad Request", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/v1/accounts/{id}": { + "delete": { + "produces": [ + "application/json" + ], + "tags": [ + "accounts" + ], + "summary": "Delete an account", + "responses": { + "204": { + "description": "No content", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "type": "string" + } + } + } + }, + "patch": { + "produces": [ + "application/json" + ], + "tags": [ + "accounts" + ], + "summary": "Update an account", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/api_v1.updateAccountPayload" + } + } + }, + "400": { + "description": "Bad Request", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "type": "string" + } + } + } + } + }, "/api/v1/auth/account": { "patch": { "produces": [ @@ -12,14 +130,14 @@ "tags": [ "Auth" ], - "summary": "Perform actions on the currently logged-in user.", + "summary": "Update account information", "parameters": [ { - "description": "Config data", + "description": "Account data", "name": "payload", "in": "body", "schema": { - "$ref": "#/definitions/api_v1.settingRequestPayload" + "$ref": "#/definitions/api_v1.updateAccountPayload" } } ], @@ -71,6 +189,25 @@ } } }, + "/api/v1/auth/logout": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "Auth" + ], + "summary": "Logout from the current session", + "responses": { + "200": { + "description": "Logout successful" + }, + "403": { + "description": "Token not provided/invalid" + } + } + } + }, "/api/v1/auth/me": { "get": { "produces": [ @@ -310,11 +447,23 @@ } } }, - "api_v1.settingRequestPayload": { + "api_v1.updateAccountPayload": { "type": "object", "properties": { "config": { "$ref": "#/definitions/model.UserConfig" + }, + "new_password": { + "type": "string" + }, + "old_password": { + "type": "string" + }, + "owner": { + "type": "boolean" + }, + "username": { + "type": "string" } } }, @@ -364,6 +513,27 @@ } } }, + "model.AccountDTO": { + "type": "object", + "properties": { + "config": { + "$ref": "#/definitions/model.UserConfig" + }, + "id": { + "type": "integer" + }, + "owner": { + "type": "boolean" + }, + "passowrd": { + "description": "Used only to store, not to retrieve", + "type": "string" + }, + "username": { + "type": "string" + } + } + }, "model.BookmarkDTO": { "type": "object", "properties": { diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 6917e65c5..7f1578ccc 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -45,10 +45,18 @@ definitions: html: type: string type: object - api_v1.settingRequestPayload: + api_v1.updateAccountPayload: properties: config: $ref: '#/definitions/model.UserConfig' + new_password: + type: string + old_password: + type: string + owner: + type: boolean + username: + type: string type: object api_v1.updateCachePayload: properties: @@ -80,6 +88,20 @@ definitions: username: type: string type: object + model.AccountDTO: + properties: + config: + $ref: '#/definitions/model.UserConfig' + id: + type: integer + owner: + type: boolean + passowrd: + description: Used only to store, not to retrieve + type: string + username: + type: string + type: object model.BookmarkDTO: properties: author: @@ -152,14 +174,91 @@ definitions: info: contact: {} paths: + /api/v1/accounts: + get: + description: List accounts + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/model.AccountDTO' + type: array + "500": + description: Internal Server Error + schema: + type: string + summary: List accounts + tags: + - accounts + post: + produces: + - application/json + responses: + "201": + description: Created + schema: + items: + $ref: '#/definitions/model.AccountDTO' + type: array + "400": + description: Bad Request + schema: + type: string + "500": + description: Internal Server Error + schema: + type: string + summary: Create an account + tags: + - accounts + /api/v1/accounts/{id}: + delete: + produces: + - application/json + responses: + "204": + description: No content + schema: + type: string + "500": + description: Internal Server Error + schema: + type: string + summary: Delete an account + tags: + - accounts + patch: + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/api_v1.updateAccountPayload' + type: array + "400": + description: Bad Request + schema: + type: string + "500": + description: Internal Server Error + schema: + type: string + summary: Update an account + tags: + - accounts /api/v1/auth/account: patch: parameters: - - description: Config data + - description: Account data in: body name: payload schema: - $ref: '#/definitions/api_v1.settingRequestPayload' + $ref: '#/definitions/api_v1.updateAccountPayload' produces: - application/json responses: @@ -169,7 +268,7 @@ paths: $ref: '#/definitions/model.Account' "403": description: Token not provided/invalid - summary: Perform actions on the currently logged-in user. + summary: Update account information tags: - Auth /api/v1/auth/login: @@ -194,6 +293,18 @@ paths: summary: Login to an account using username and password tags: - Auth + /api/v1/auth/logout: + post: + produces: + - application/json + responses: + "200": + description: Logout successful + "403": + description: Token not provided/invalid + summary: Logout from the current session + tags: + - Auth /api/v1/auth/me: get: produces: diff --git a/e2e/e2eutil/containers.go b/e2e/e2eutil/containers.go index 2361ec87b..c6c0ab7e2 100644 --- a/e2e/e2eutil/containers.go +++ b/e2e/e2eutil/containers.go @@ -60,13 +60,13 @@ func NewShioriContainer(t *testing.T, tag string) ShioriContainer { } if tag != "" { - containerDefinition.ContainerRequest.FromDockerfile = testcontainers.FromDockerfile{} - containerDefinition.Image = "gchr.io/go-shiori/shiori:" + tag + containerDefinition.ContainerRequest.Image = "ghcr.io/go-shiori/shiori:" + tag } else { - containerDefinition.FromDockerfile = testcontainers.FromDockerfile{ - Context: "../..", - Dockerfile: "Dockerfile.e2e", - KeepImage: true, + containerDefinition.ContainerRequest.FromDockerfile = testcontainers.FromDockerfile{ + PrintBuildLog: false, + Context: "../..", + Dockerfile: "Dockerfile.e2e", + KeepImage: true, BuildArgs: map[string]*string{ "ALPINE_VERSION": newBuildArg(os.Getenv("CONTAINER_ALPINE_VERSION")), "GOLANG_VERSION": newBuildArg(os.Getenv("GOLANG_VERSION")), diff --git a/e2e/playwright/accounts_test.go b/e2e/playwright/accounts_test.go new file mode 100644 index 000000000..f0149dd52 --- /dev/null +++ b/e2e/playwright/accounts_test.go @@ -0,0 +1,412 @@ +package playwright + +import ( + "fmt" + "testing" + "time" + + "github.com/go-shiori/shiori/e2e/e2eutil" + "github.com/playwright-community/playwright-go" + "github.com/stretchr/testify/require" +) + +func TestE2EAccounts(t *testing.T) { + // Start a new Shiori container + container := e2eutil.NewShioriContainer(t, "") + baseURL := fmt.Sprintf("http://localhost:%s", container.GetPort()) + + mainTestHelper, err := NewTestHelper(t, "main") + require.NoError(t, err) + defer mainTestHelper.Close() + + t.Run("001 login as admin", func(t *testing.T) { + // Navigate to the login page + _, err = mainTestHelper.page.Goto(baseURL) + mainTestHelper.Require().NoError(t, err, "Navigate to base URL") + + // Get locators for form elements + usernameLocator := mainTestHelper.page.Locator("#username") + passwordLocator := mainTestHelper.page.Locator("#password") + buttonLocator := mainTestHelper.page.Locator(".button") + + // Wait for and fill the login form + mainTestHelper.Require().NoError(t, usernameLocator.WaitFor(), "Wait for username field") + mainTestHelper.Require().NoError(t, usernameLocator.Fill("shiori"), "Fill username field") + mainTestHelper.Require().NoError(t, passwordLocator.Fill("gopher"), "Fill password field") + + // Click login and wait for success + mainTestHelper.Require().NoError(t, buttonLocator.Click(), "Click login button") + mainTestHelper.Require().NoError(t, mainTestHelper.page.Locator("#bookmarks-grid").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateVisible, + Timeout: playwright.Float(1000), + }), "Wait for bookmarks section to show up") + }) + + t.Run("002 create new admin account", func(t *testing.T) { + // Navigate to settings page + mainTestHelper.Require().NoError(t, + mainTestHelper.page.Locator(`[title="Settings"]`).Click(), + "Click on settings button") + mainTestHelper.Require().NoError(t, mainTestHelper.page.Locator(".setting-container").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateVisible, + Timeout: playwright.Float(1000), + }), "Wait for settings page to show up") + + // Click on "Add new account" element + mainTestHelper.page.Locator(`[title="Add new account"]`).Click() + mainTestHelper.page.Locator(".custom-dialog").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateVisible, + }) + + // Fill modal + mainTestHelper.page.Locator(`[name="username"]`).Fill("admin2") + mainTestHelper.page.Locator(`[name="password"]`).Fill("admin2") + mainTestHelper.page.Locator(`[name="repeat_password"]`).Fill("admin2") + mainTestHelper.page.Locator(`[name="admin"]`).Check() + + // Click on "Ok" button + mainTestHelper.page.Locator(`.custom-dialog-button.main`).Click() + + // Wait for modal to disappear + mainTestHelper.Require().NoError(t, + mainTestHelper.page.Locator(".custom-dialog").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateHidden, + Timeout: playwright.Float(1000), + }), + "Wait for modal to disappear") + + // Refresh account list + mainTestHelper.Require().NoError(t, + mainTestHelper.page.Locator(`a[title="Refresh accounts"]`).Click(), + "Click on refresh accounts button") + mainTestHelper.Require().NoError(t, + mainTestHelper.page.Locator(".loading-overlay").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateHidden, + Timeout: playwright.Float(1000), + }), + "Wait for loading overlay to disappear") + + // Check if new account is created + accountsCount, err := mainTestHelper.page.Locator(".accounts-list li").Count() + mainTestHelper.Require().NoError(t, err, "Count accounts in list") + mainTestHelper.Require().Equal(t, 2, accountsCount, "Verify 2 accounts present after deleting user account") + }) + + t.Run("003 create new user account", func(t *testing.T) { + // Click on "Add new account" element + mainTestHelper.page.Locator(`[title="Add new account"]`).Click() + mainTestHelper.page.Locator(".custom-dialog").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateVisible, + Timeout: playwright.Float(1000), + }) + + // Fill modal + mainTestHelper.page.Locator(`[name="username"]`).Fill("user1") + mainTestHelper.page.Locator(`[name="password"]`).Fill("user1") + mainTestHelper.page.Locator(`[name="repeat_password"]`).Fill("user1") + + // Click on "Ok" button + mainTestHelper.page.Locator(`.custom-dialog-button.main`).Click() + + // Wait for modal to disappear + mainTestHelper.page.Locator(".custom-dialog").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateHidden, + Timeout: playwright.Float(1000), + }) + + // Refresh account list + mainTestHelper.page.Locator(`a[title="Refresh accounts"]`).Click() + mainTestHelper.page.Locator(".loading-overlay").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateHidden, + Timeout: playwright.Float(1000), + }) + + // Check if new account is created + accountsCount, err := mainTestHelper.page.Locator(".accounts-list li").Count() + mainTestHelper.Require().NoError(t, err, "Failed to count accounts in list") + mainTestHelper.Require().Equal(t, 3, accountsCount, "Expected 3 accounts after creating user account") + }) + + t.Run("004 check admin account created successfully", func(t *testing.T) { + th, err := NewTestHelper(t, t.Name()) + require.NoError(t, err, "Create test helper") + defer th.Close() + + // Navigate to the login page + _, err = th.page.Goto(baseURL) + th.Require().NoError(t, err, "Navigate to base URL") + + // Get locators for form elements + usernameLocator := th.page.Locator("#username") + passwordLocator := th.page.Locator("#password") + buttonLocator := th.page.Locator(".button") + + // Wait for and fill the login form + th.Require().NoError(t, usernameLocator.WaitFor(), "Wait for username field") + th.Require().NoError(t, usernameLocator.Fill("admin2"), "Fill username field") + th.Require().NoError(t, passwordLocator.Fill("admin2"), "Fill password field") + + // Click login and wait for success + th.Require().NoError(t, buttonLocator.Click(), "Click login button") + th.Require().NoError(t, th.page.Locator("#bookmarks-grid").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateVisible, + Timeout: playwright.Float(1000), + }), "Wait for bookmarks section to show up") + + // Navigate to settings + th.Require().NoError(t, + th.page.Locator(`[title="Settings"]`).Click(), + "Click on settings button") + th.Require().NoError(t, + th.page.Locator(".setting-container").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateVisible, + Timeout: playwright.Float(1000), + }), + "Wait for settings page to show up") + + // Check if can see system info (admin only) + visible, err := th.page.Locator(`#setting-system-info`).IsVisible() + th.Require().NoError(t, err, "Check visibility of system info section") + th.Require().True(t, visible, "Verify system info section visibility for admin user") + }) + + t.Run("005 check user account created successfully", func(t *testing.T) { + th, err := NewTestHelper(t, t.Name()) + require.NoError(t, err, "Create test helper") + + defer th.Close() + + // Navigate to the login page + _, err = th.page.Goto(baseURL) + th.Require().NoError(t, err, "Navigate to base URL") + + // Get locators for form elements + usernameLocator := th.page.Locator("#username") + passwordLocator := th.page.Locator("#password") + buttonLocator := th.page.Locator(".button") + + // Wait for and fill the login form + th.Require().NoError(t, usernameLocator.WaitFor(), "Wait for username field") + th.Require().NoError(t, usernameLocator.Fill("user1"), "Fill username field") + th.Require().NoError(t, passwordLocator.Fill("user1"), "Fill password field") + + // Click login and wait for success + th.Require().NoError(t, buttonLocator.Click(), "Click login button") + th.Require().NoError(t, th.page.Locator("#bookmarks-grid").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateVisible, + Timeout: playwright.Float(1000), + }), "Wait for bookmarks section to show up") + + // Navigate to settings + th.Require().NoError(t, + th.page.Locator(`[title="Settings"]`).Click(), + "Click on settings button") + th.Require().NoError(t, th.page.Locator(".setting-container").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateVisible, + Timeout: playwright.Float(1000), + }), "Wait for settings page to show up") + + // Check if can see system info (admin only) + visible, err := th.page.Locator(`#setting-system-info`).IsVisible() + th.Require().NoError(t, err, "Check visibility of system info section") + th.Require().False(t, visible, "Verify system info section not visible for regular user") + + // My account settings is visible + visible, err = th.page.Locator(`#setting-my-account`).IsVisible() + th.Require().NoError(t, err, "Check visibility of account settings") + th.Require().True(t, visible, "Verify account settings visibility for user") + + // Check change password requires current password + th.Require().NoError(t, + th.page.Locator(`li[shiori-username="user1"] a[title="Change password"]`).Click(), + "Click on change password button") + th.Require().NoError(t, + th.page.Locator(".custom-dialog").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateVisible, + Timeout: playwright.Float(1000), + }), + "Wait for change password modal to show up") + visible, err = th.page.Locator(`[name="old_password"]`).IsVisible() + th.Require().NoError(t, err, "Check visibility of old password field") + th.Require().True(t, visible, "Verify old password field visibility when changing password") + + // Fill modal + th.Require().NoError(t, + th.page.Locator(`[name="old_password"]`).Fill("user1"), + "Fill old password field") + th.Require().NoError(t, + th.page.Locator(`[name="new_password"]`).Fill("new_user1"), + "Fill new password field") + th.Require().NoError(t, + th.page.Locator(`[name="repeat_password"]`).Fill("new_user1"), + "Fill repeat password field") + + // Click on "Ok" button + th.Require().NoError(t, + th.page.Locator(`.custom-dialog-button.main`).Click(), + "Click on ok button") + + // Wait for modal to display text: "Password has been changed." + dialogContent := th.page.Locator(".custom-dialog-content") + th.Require().NoError(t, + dialogContent.WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateVisible, + Timeout: playwright.Float(1000), + }), + "Wait for dialog content to show up") + + contentText, err := dialogContent.TextContent() + th.Require().NoError(t, err, "Get dialog content text") + th.Require().Equal(t, "Password has been changed.", contentText, "Verify password change confirmation message") + }) + + t.Run("006 delete user account", func(t *testing.T) { + // Click on "Delete" button + mainTestHelper.page.Locator(`li[shiori-username="user1"] a[title="Delete account"]`).Click() + mainTestHelper.page.Locator(".custom-dialog").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateVisible, + Timeout: playwright.Float(1000), + }) + + // Click on "Ok" button + mainTestHelper.page.Locator(`.custom-dialog-button.main`).Click() + + // Wait for modal to disappear + mainTestHelper.page.Locator(".custom-dialog").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateHidden, + Timeout: playwright.Float(1000), + }) + + // Refresh account list + mainTestHelper.page.Locator(`a[title="Refresh accounts"]`).Click() + mainTestHelper.page.Locator(".loading-overlay").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateHidden, + Timeout: playwright.Float(1000), + }) + + // Check if account is deleted + accountsCount, err := mainTestHelper.page.Locator(".accounts-list li").Count() + mainTestHelper.Require().NoError(t, err, "Count accounts in list") + mainTestHelper.Require().Equal(t, 2, accountsCount, "Verify 2 accounts present after creating admin account") + + time.Sleep(5 * time.Second) + }) + + t.Run("007 change password for admin account", func(t *testing.T) { + // Click on "Change password" button + mainTestHelper.Require().NoError(t, + mainTestHelper.page.Locator(`li[shiori-username="admin2"] a[title="Change password"]`).Click(), + "Click change password button") + mainTestHelper.Require().NoError(t, + mainTestHelper.page.Locator(".custom-dialog").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateVisible, + Timeout: playwright.Float(1000), + }), + "Wait for password dialog to appear") + + // Fill modal + mainTestHelper.Require().NoError(t, + mainTestHelper.page.Locator(`[name="new_password"]`).Fill("admin3"), + "Fill new password") + mainTestHelper.Require().NoError(t, + mainTestHelper.page.Locator(`[name="repeat_password"]`).Fill("admin3"), + "Fill repeat password") + + // Click on "Ok" button + mainTestHelper.Require().NoError(t, + mainTestHelper.page.Locator(`.custom-dialog-button.main`).Click(), + "Click ok button") + + // Wait for modal to display text: "Password has been changed." + dialogContent := mainTestHelper.page.Locator(".custom-dialog-content") + mainTestHelper.Require().NoError(t, + dialogContent.WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateVisible, + Timeout: playwright.Float(1000), + }), + "Wait for dialog content to show up") + + contentText, err := dialogContent.TextContent() + mainTestHelper.Require().NoError(t, err, "Get dialog content text") + mainTestHelper.Require().Equal(t, "Password has been changed.", contentText, "Verify password change confirmation message") + + // Click on "Ok" button + mainTestHelper.Require().NoError(t, + mainTestHelper.page.Locator(`.custom-dialog-button.main`).Click(), + "Click ok button") + + // Wait for modal to disappear + mainTestHelper.Require().NoError(t, + mainTestHelper.page.Locator(".custom-dialog").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateHidden, + Timeout: playwright.Float(2000), + }), + "Wait for dialog to close") + + // Refresh account list + mainTestHelper.Require().NoError(t, + mainTestHelper.page.Locator(`a[title="Refresh accounts"]`).Click(), + "Click refresh accounts") + mainTestHelper.Require().NoError(t, + mainTestHelper.page.Locator(".loading-overlay").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateHidden, + Timeout: playwright.Float(1000), + }), + "Wait for refresh to complete") + + t.Run("0071 login with new password", func(t *testing.T) { + th, err := NewTestHelper(t, t.Name()) + require.NoError(t, err, "Failed to create test helper") + defer th.Close() + + // Navigate to the login page + _, err = th.page.Goto(baseURL) + th.Require().NoError(t, err, "Navigate to base URL") + + // Wait for login page + th.Require().NoError(t, + th.page.Locator("#username").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateVisible, + Timeout: playwright.Float(1000), + }), + "Wait for login page") + th.Require().NoError(t, th.page.Locator("#username").Fill("admin2"), "Fill username field") + th.Require().NoError(t, th.page.Locator("#password").Fill("admin3"), "Fill password field") + th.Require().NoError(t, th.page.Locator(".button").Click(), "Click login button") + th.Require().NoError(t, th.page.Locator("#bookmarks-grid").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateVisible, + Timeout: playwright.Float(1000), + }), "Wait for bookmarks section to show up") + }) + }) + + t.Run("008 logout", func(t *testing.T) { + // Click on "Logout" button + mainTestHelper.Require().NoError(t, mainTestHelper.page.Locator(`a[title="Logout"]`).Click(), "Click on logout button") + + // Wait for modal to display text + dialogContent := mainTestHelper.page.Locator(".custom-dialog-content") + mainTestHelper.Require().NoError(t, + dialogContent.WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateVisible, + Timeout: playwright.Float(1000), + }), + "Wait for dialog content to show up") + + contentText, err := dialogContent.TextContent() + mainTestHelper.Require().NoError(t, err, "Get dialog content text") + mainTestHelper.Require().Equal(t, "Are you sure you want to log out ?", contentText, "Verify logout confirmation message") + + // Click on "Yes" button + mainTestHelper.Require().NoError(t, + mainTestHelper.page.Locator(`.custom-dialog-button.main`).Click(), + "Click Yes button") + + // Wait for login page + err = mainTestHelper.page.Locator("#login-scene").WaitFor(playwright.LocatorWaitForOptions{ + State: playwright.WaitForSelectorStateVisible, + Timeout: playwright.Float(1000), + }) + mainTestHelper.Require().NoError(t, err, "Wait for login page") + }) +} diff --git a/e2e/playwright/auth_test.go b/e2e/playwright/auth_test.go new file mode 100644 index 000000000..6284bc3ea --- /dev/null +++ b/e2e/playwright/auth_test.go @@ -0,0 +1,159 @@ +package playwright_test + +import ( + "fmt" + "testing" + + "github.com/go-shiori/shiori/e2e/e2eutil" + "github.com/playwright-community/playwright-go" + "github.com/stretchr/testify/require" +) + +func TestAuth(t *testing.T) { + // Start a new Shiori container + container := e2eutil.NewShioriContainer(t, "") + baseURL := fmt.Sprintf("http://localhost:%s", container.GetPort()) + + // Initialize the browser + pw, err := playwright.Run() + require.NoError(t, err, "Initialize Playwright") + defer pw.Stop() + + browser, err := pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{ + Headless: playwright.Bool(true), + }) + require.NoError(t, err, "Launch browser") + defer browser.Close() + + t.Run("successful login with default credentials", func(t *testing.T) { + context, err := browser.NewContext() + require.NoError(t, err, "Create browser context") + + t.Cleanup(func() { + context.Close() + }) + + page, err := context.NewPage() + require.NoError(t, err, "Create new page") + defer page.Close() + + // Navigate to the login page + _, err = page.Goto(baseURL) + require.NoError(t, err, "Navigate to login page") + + // Get locators for form elements + usernameLocator := page.Locator("#username") + passwordLocator := page.Locator("#password") + buttonLocator := page.Locator(".button") + + // Wait for and fill the login form + require.NoError(t, usernameLocator.WaitFor()) + require.NoError(t, usernameLocator.Fill("shiori")) + require.NoError(t, passwordLocator.Fill("gopher")) + + // Click login and wait for success + require.NoError(t, buttonLocator.Click()) + require.NoError(t, page.Locator("#bookmarks-grid").WaitFor()) + }) + + t.Run("failed login with wrong username", func(t *testing.T) { + context, err := browser.NewContext() + require.NoError(t, err) + + t.Cleanup(func() { + context.Close() + }) + + page, err := context.NewPage() + require.NoError(t, err) + defer page.Close() + + // Navigate to the login page + _, err = page.Goto(baseURL) + require.NoError(t, err) + + // Get locators for form elements + usernameLocator := page.Locator("#username") + passwordLocator := page.Locator("#password") + buttonLocator := page.Locator(".button") + errorLocator := page.Locator(".error-message") + + // Wait for and fill the login form + require.NoError(t, usernameLocator.WaitFor()) + require.NoError(t, usernameLocator.Fill("wrong_user")) + require.NoError(t, passwordLocator.Fill("gopher")) + + // Click login and verify error + require.NoError(t, buttonLocator.Click()) + errorText, err := errorLocator.TextContent() + require.NoError(t, err, "Get error message text") + require.Contains(t, errorText, "username or password do not match", "Verify error message for wrong username") + }) + + t.Run("failed login with wrong password", func(t *testing.T) { + context, err := browser.NewContext() + require.NoError(t, err) + + t.Cleanup(func() { + context.Close() + }) + + page, err := context.NewPage() + require.NoError(t, err) + defer page.Close() + + // Navigate to the login page + _, err = page.Goto(baseURL) + require.NoError(t, err) + + // Get locators for form elements + usernameLocator := page.Locator("#username") + passwordLocator := page.Locator("#password") + buttonLocator := page.Locator(".button") + errorLocator := page.Locator(".error-message") + + // Wait for and fill the login form + require.NoError(t, usernameLocator.WaitFor()) + require.NoError(t, usernameLocator.Fill("shiori")) + require.NoError(t, passwordLocator.Fill("wrong_password")) + + // Click login and verify error + require.NoError(t, buttonLocator.Click()) + errorText, err := errorLocator.TextContent() + require.NoError(t, err) + require.Contains(t, errorText, "username or password do not match") + }) + + t.Run("empty username validation", func(t *testing.T) { + context, err := browser.NewContext() + require.NoError(t, err) + + t.Cleanup(func() { + context.Close() + }) + + page, err := context.NewPage() + require.NoError(t, err) + defer page.Close() + + // Navigate to the login page + _, err = page.Goto(baseURL) + require.NoError(t, err) + + // Get locators for form elements + usernameLocator := page.Locator("#username") + passwordLocator := page.Locator("#password") + buttonLocator := page.Locator(".button") + errorLocator := page.Locator(".error-message") + + // Wait for form and fill only password + require.NoError(t, usernameLocator.WaitFor()) + require.NoError(t, passwordLocator.Fill("gopher")) + + // Click login and verify error + require.NoError(t, buttonLocator.Click()) + errorText, err := errorLocator.TextContent() + require.NoError(t, err) + require.Contains(t, errorText, "Username must not empty") + }) +} diff --git a/e2e/playwright/playwright_test.go b/e2e/playwright/playwright_test.go new file mode 100644 index 000000000..3290a1228 --- /dev/null +++ b/e2e/playwright/playwright_test.go @@ -0,0 +1,7 @@ +package playwright + +import "github.com/playwright-community/playwright-go" + +func init() { + playwright.Install() +} diff --git a/e2e/playwright/reporter.go b/e2e/playwright/reporter.go new file mode 100644 index 000000000..46106bb67 --- /dev/null +++ b/e2e/playwright/reporter.go @@ -0,0 +1,158 @@ +package playwright + +import ( + "encoding/base64" + "fmt" + "html/template" + "io" + "os" + "path/filepath" + "strings" + "time" +) + +type AssertionResult struct { + Message string + Status string + Error string + Screenshot string // Base64 screenshot, only for failures +} + +type TestResult struct { + Name string + Status string + Timestamp time.Time + Assertions []AssertionResult +} + +type TestReporter struct { + Results map[string]*TestResult +} + +var globalReporter = &TestReporter{ + Results: make(map[string]*TestResult), +} + +func GetReporter() *TestReporter { + return globalReporter +} + +func (r *TestReporter) AddResult(testName string, passed bool, screenshotPath string, message, errorMessage string) { + status := "Passed" + if !passed { + status = "Failed" + } + + var screenshot string + if !passed && screenshotPath != "" { + imageFile, err := os.Open(screenshotPath) + if err == nil { + defer imageFile.Close() + if data, err := io.ReadAll(imageFile); err == nil { + screenshot = "data:image/png;base64," + base64.StdEncoding.EncodeToString(data) + fmt.Printf("Screenshot saved: %v\n", base64.StdEncoding.EncodeToString(data)) + } else { + fmt.Printf("Failed to read screenshot %s: %v\n", screenshotPath, err) + } + } else { + fmt.Printf("Failed to open screenshot %s: %v\n", screenshotPath, err) + } + } + + // Get or create test result + testResult, exists := r.Results[testName] + if !exists { + testResult = &TestResult{ + Name: testName, + Status: "Passed", + Timestamp: time.Now(), + Assertions: make([]AssertionResult, 0), + } + r.Results[testName] = testResult + } + + // Add assertion result + testResult.Assertions = append(testResult.Assertions, AssertionResult{ + Message: message, + Error: errorMessage, + Status: status, + Screenshot: screenshot, + }) + + // Update test status if any assertion failed + if !passed { + testResult.Status = "Failed" + } +} + +func (r *TestReporter) GenerateHTML() error { + const tmpl = ` + + + + Test Results + + + +

Test Results

+ {{range .Results}} +
+

{{.Name}}

+

Status: {{.Status}}

+ {{if eq .Status "Failed"}} + + {{end}} +
+ {{end}} + +` + + t := template.New("report") + t = t.Funcs(template.FuncMap{ + "toLowerCase": strings.ToLower, + "safeHTML": func(s string) template.HTML { return template.HTML(s) }, + "safeURL": func(s string) template.URL { + return template.URL(s) + }, + }) + + t, err := t.Parse(tmpl) + if err != nil { + return fmt.Errorf("failed to parse template: %v", err) + } + + if err := os.MkdirAll("test-results", 0755); err != nil { + return fmt.Errorf("failed to create results directory: %v", err) + } + + basePath := os.Getenv("CONTEXT_PATH") + if basePath == "" { + basePath = "." + } + + f, err := os.Create(filepath.Join(basePath, "e2e-report.html")) + if err != nil { + return fmt.Errorf("failed to create report file: %v", err) + } + defer f.Close() + + return t.Execute(f, r) +} diff --git a/e2e/playwright/testhelper.go b/e2e/playwright/testhelper.go new file mode 100644 index 000000000..cf8c2c23d --- /dev/null +++ b/e2e/playwright/testhelper.go @@ -0,0 +1,208 @@ +package playwright + +import ( + "fmt" + "os" + "path" + "path/filepath" + "testing" + "time" + + "github.com/playwright-community/playwright-go" + "github.com/stretchr/testify/require" +) + +// TestHelper wraps common test functionality +type TestHelper struct { + name string + page playwright.Page + browser playwright.Browser + context playwright.BrowserContext + t require.TestingT +} + +// NewTestHelper creates a new test helper instance +func NewTestHelper(t require.TestingT, name string) (*TestHelper, error) { + pw, err := playwright.Run() + if err != nil { + return nil, fmt.Errorf("could not start playwright: %v", err) + } + + browser, err := pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{ + Headless: playwright.Bool(true), + }) + if err != nil { + return nil, fmt.Errorf("could not launch browser: %v", err) + } + + context, err := browser.NewContext() + if err != nil { + return nil, fmt.Errorf("could not create context: %v", err) + } + + page, err := context.NewPage() + if err != nil { + return nil, fmt.Errorf("could not create page: %v", err) + } + + return &TestHelper{ + name: name, + page: page, + browser: browser, + context: context, + t: t, + }, nil +} + +// Require returns a custom assertion object that takes screenshots on failure +func (th *TestHelper) Require() *PlaywrightRequire { + return &PlaywrightRequire{ + Assertions: require.New(th.t), + helper: th, + } +} + +func (th *TestHelper) HandleError(t *testing.T, screenshotPath string, msg, err string) { + GetReporter().AddResult(t.Name(), false, screenshotPath, msg, err) + t.Error(msg) // Also log the error to the test output +} + +func (th *TestHelper) HandleSuccess(t *testing.T, message string) { + GetReporter().AddResult(t.Name(), true, "", message, "") +} + +// PlaywrightRequire wraps require.Assertions to add screenshot capability +type PlaywrightRequire struct { + *require.Assertions + helper *TestHelper +} + +// captureScreenshot saves a screenshot to the screenshots directory +func (th *TestHelper) captureScreenshot(testName string) string { + timestamp := time.Now().Format("20060102-150405") + tmpDir, err := os.MkdirTemp("", "playwright-screenshots") + if err != nil { + th.t.Errorf("Failed to create temporary directory: %v\n", err) + return "" + } + filePath := filepath.Join(tmpDir, fmt.Sprintf("%s-%s.png", testName, timestamp)) + + // Get the full path without the filename from `filename` and create the directories + if err := os.MkdirAll(path.Dir(filePath), 0755); err != nil { + th.t.Errorf("Failed to create screenshots directory: %v\n", err) + return "" + } + + // Create screenshots directory if it doesn't exist + if err := os.MkdirAll("screenshots", 0755); err != nil { + th.t.Errorf("Failed to create screenshots directory: %v\n", err) + return "" + } + + // Take screenshot + if _, err := th.page.Screenshot(playwright.PageScreenshotOptions{ + Path: playwright.String(filePath), + FullPage: playwright.Bool(true), + }); err != nil { + th.t.Errorf("Failed to capture screenshot: %v\n", err) + return "" + } + + fmt.Printf("Screenshot saved: %s\n", filePath) + + return filePath +} + +func (pr *PlaywrightRequire) Assert(t *testing.T, assertFn func() error, msgAndArgs ...interface{}) { + err := assertFn() + var msg string + if len(msgAndArgs) > 0 { + if format, ok := msgAndArgs[0].(string); ok && len(msgAndArgs) > 1 { + msg = fmt.Sprintf(format, msgAndArgs[1:]...) + } else { + msg = fmt.Sprint(msgAndArgs...) + } + } + if err == nil { + pr.helper.HandleSuccess(t, msg) + } else { + screenshotPath := pr.helper.captureScreenshot(t.Name()) + pr.helper.HandleError(t, screenshotPath, msg, err.Error()) + } +} + +// True asserts that the specified value is true and takes a screenshot on failure +func (pr *PlaywrightRequire) True(t *testing.T, value bool, msgAndArgs ...interface{}) { + pr.Assert(t, func() error { + var err error + if !value { + err = fmt.Errorf("Expected value to be true but got false in test '%s'", t.Name()) + } + return err + }, msgAndArgs...) + pr.Assertions.True(value, msgAndArgs...) +} + +// False asserts that the specified value is false and takes a screenshot on failure +func (pr *PlaywrightRequire) False(t *testing.T, value bool, msgAndArgs ...interface{}) { + pr.Assert(t, func() error { + var err error + if value { + err = fmt.Errorf("Expected value to be false but got true in test '%s'", t.Name()) + } + return err + }, msgAndArgs...) + pr.Assertions.False(value, msgAndArgs...) +} + +// Equal asserts that two objects are equal and takes a screenshot on failure +func (pr *PlaywrightRequire) Equal(t *testing.T, expected, actual interface{}, msgAndArgs ...interface{}) { + pr.Assert(t, func() error { + var err error + if expected != actual { + err = fmt.Errorf("Expected values to be equal in test '%s':\nexpected: %v\nactual: %v", t.Name(), expected, actual) + } + return err + }, msgAndArgs...) + pr.Assertions.Equal(expected, actual, msgAndArgs...) +} + +// NoError asserts that a function returned no error and takes a screenshot on failure +func (pr *PlaywrightRequire) NoError(t *testing.T, err error, msgAndArgs ...interface{}) { + pr.Assert(t, func() error { + var assertErr error + if err != nil { + assertErr = fmt.Errorf("Expected no error but got error in test '%s': %v", t.Name(), err) + } + return assertErr + }, msgAndArgs...) + pr.Assertions.NoError(err, msgAndArgs...) +} + +// Error asserts that a function returned an error and takes a screenshot on failure +func (pr *PlaywrightRequire) Error(t *testing.T, err error, msgAndArgs ...interface{}) { + pr.Assert(t, func() error { + var assertErr error + if err == nil { + assertErr = fmt.Errorf("Expected error but got none in test '%s'", t.Name()) + } + return assertErr + }, msgAndArgs...) + pr.Assertions.Error(err, msgAndArgs...) +} + +// Close cleans up resources and generates the report +func (th *TestHelper) Close() { + if err := GetReporter().GenerateHTML(); err != nil { + fmt.Printf("Failed to generate HTML report: %v\n", err) + } + if th.page != nil { + th.page.Close() + } + if th.context != nil { + th.context.Close() + } + if th.browser != nil { + th.browser.Close() + } +} diff --git a/e2e/server/auth_test.go b/e2e/server/auth_test.go new file mode 100644 index 000000000..03ee57c55 --- /dev/null +++ b/e2e/server/auth_test.go @@ -0,0 +1,34 @@ +package e2e + +import ( + "bytes" + "net/http" + "testing" + + "github.com/go-shiori/shiori/e2e/e2eutil" + "github.com/stretchr/testify/require" +) + +func TestAuthLogin(t *testing.T) { + container := e2eutil.NewShioriContainer(t, "") + + t.Run("login ok", func(t *testing.T) { + req, err := http.Post( + "http://localhost:"+container.GetPort()+"/api/v1/auth/login", + "application/json", + bytes.NewReader([]byte(`{"username": "shiori", "password": "gopher"}`)), + ) + require.NoError(t, err) + require.Equal(t, http.StatusOK, req.StatusCode) + }) + + t.Run("wrong credentials", func(t *testing.T) { + req, err := http.Post( + "http://localhost:"+container.GetPort()+"/api/v1/auth/login", + "application/json", + bytes.NewReader([]byte(`{"username": "wrong", "password": "wrong"}`)), + ) + require.NoError(t, err) + require.Equal(t, http.StatusBadRequest, req.StatusCode) + }) +} diff --git a/go.mod b/go.mod index c6064d7e1..0525c5188 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,8 @@ require ( github.com/muesli/go-app-paths v0.2.2 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/pkg/errors v0.9.1 - github.com/sethvargo/go-envconfig v1.1.0 + github.com/playwright-community/playwright-go v0.4901.0 + github.com/sethvargo/go-envconfig v1.0.2 github.com/shurcooL/vfsgen v0.0.0-20230704071429-0000e147ea92 github.com/sirupsen/logrus v1.9.3 github.com/spf13/afero v1.11.0 @@ -49,10 +50,10 @@ require ( require ( dario.cat/mergo v1.0.1 // indirect filippo.io/edwards25519 v1.1.0 // indirect + github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/KyleBanks/depth v1.2.1 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect - github.com/Microsoft/hcsshim v0.12.9 // indirect github.com/andybalholm/cascadia v1.3.3 // indirect github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de // indirect github.com/bytedance/sonic v1.12.6 // indirect @@ -60,11 +61,11 @@ require ( github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cloudwego/base64x v0.1.4 // indirect github.com/cloudwego/iasm v0.2.0 // indirect - github.com/containerd/containerd v1.7.24 // indirect github.com/containerd/log v0.1.0 // indirect github.com/containerd/platforms v0.2.1 // indirect github.com/cpuguy83/dockercfg v0.3.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/deckarep/golang-set/v2 v2.7.0 // indirect github.com/distribution/reference v0.6.0 // indirect github.com/docker/docker v27.4.1+incompatible // indirect github.com/docker/go-connections v0.5.0 // indirect @@ -73,6 +74,7 @@ require ( github.com/felixge/httpsnoop v1.0.4 // indirect github.com/gabriel-vasile/mimetype v1.4.7 // indirect github.com/gin-contrib/sse v1.0.0 // indirect + github.com/go-jose/go-jose/v3 v3.0.3 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect @@ -84,10 +86,10 @@ require ( github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.23.0 // indirect github.com/go-shiori/dom v0.0.0-20230515143342-73569d674e1c // indirect + github.com/go-stack/stack v1.8.1 // indirect github.com/goccy/go-json v0.10.4 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f // indirect - github.com/golang/protobuf v1.5.4 // indirect github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect @@ -132,12 +134,12 @@ require ( go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect go.opentelemetry.io/otel v1.33.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 // indirect go.opentelemetry.io/otel/metric v1.33.0 // indirect + go.opentelemetry.io/otel/sdk v1.31.0 // indirect go.opentelemetry.io/otel/trace v1.33.0 // indirect golang.org/x/arch v0.12.0 // indirect golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 // indirect - golang.org/x/mod v0.22.0 // indirect - golang.org/x/sync v0.10.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect golang.org/x/tools v0.28.0 // indirect diff --git a/go.sum b/go.sum index b27af8b5b..9dc548aac 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,3 @@ -dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= -dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= @@ -12,69 +10,45 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= -github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= -github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w= -github.com/Microsoft/hcsshim v0.12.9 h1:2zJy5KA+l0loz1HzEGqyNnjd3fyZA31ZBCGKacp6lLg= -github.com/Microsoft/hcsshim v0.12.9/go.mod h1:fJ0gkFAna6ukt0bLdKB8djt4XIJhF/vEPuoIWYVvZ8Y= -github.com/PuerkitoBio/goquery v1.9.2 h1:4/wZksC3KgkQw7SQgkKotmKljk0M6V8TUvA8Wb4yPeE= -github.com/PuerkitoBio/goquery v1.9.2/go.mod h1:GHPCaP0ODyyxqcNoFGYlAprUFH81NuRPd0GX3Zu2Mvk= github.com/PuerkitoBio/goquery v1.10.1 h1:Y8JGYUkXWTGRB6Ars3+j3kN0xg1YqqlwvdTV8WTFQcU= github.com/PuerkitoBio/goquery v1.10.1/go.mod h1:IYiHrOMps66ag56LEH7QYDDupKXyo5A8qrjIx3ZtujY= -github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss= -github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU= github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM= github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA= github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de h1:FxWPpzIjnTlhPwqqXc4/vE0f7GvRjuAsbW+HOIe8KnA= github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de/go.mod h1:DCaWoUhZrYW9p1lxo/cm8EmUOOzAPSEZNGF2DK1dJgw= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0= -github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= github.com/bytedance/sonic v1.12.6 h1:/isNmCUF2x3Sh8RAp/4mh4ZGkcFAX/hLrzrK3AvpRzk= github.com/bytedance/sonic v1.12.6/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= -github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/bytedance/sonic/loader v0.2.1 h1:1GgorWTqf12TA8mma4DDSbaQigE2wOgQo7iCjjJv3+E= github.com/bytedance/sonic/loader v0.2.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= -github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= -github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= -github.com/containerd/containerd v1.7.15 h1:afEHXdil9iAm03BmhjzKyXnnEBtjaLJefdU7DV0IFes= -github.com/containerd/containerd v1.7.15/go.mod h1:ISzRRTMF8EXNpJlTzyr2XMhN+j9K302C21/+cr3kUnY= -github.com/containerd/containerd v1.7.24 h1:zxszGrGjrra1yYJW/6rhm9cJ1ZQ8rkKBR48brqsa7nA= -github.com/containerd/containerd v1.7.24/go.mod h1:7QUzfURqZWCZV7RLNEn1XjUCQLEf0bkaK4GjUaZehxw= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A= github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw= -github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E= -github.com/cpuguy83/dockercfg v0.3.1/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= github.com/cpuguy83/dockercfg v0.3.2 h1:DlJTyZGBDlXqUZ2Dk2Q3xHs/FtnooJJVaad2S9GKorA= github.com/cpuguy83/dockercfg v0.3.2/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set/v2 v2.7.0 h1:gIloKvD7yH2oip4VLhsv3JyLLFnC0Y2mlusgcvJYW5k= +github.com/deckarep/golang-set/v2 v2.7.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c= github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4= -github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= -github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/docker v25.0.6+incompatible h1:5cPwbwriIcsua2REJe8HqQV+6WlWc1byg2QSXzBxBGg= -github.com/docker/docker v25.0.6+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v27.4.1+incompatible h1:ZJvcY7gfwHn1JF48PfbyXg7Jyt9ZCWDW+GGXOIxEwp4= github.com/docker/docker v27.4.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= @@ -83,40 +57,29 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= -github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= -github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/gabriel-vasile/mimetype v1.4.7 h1:SKFKl7kD0RiPdbht0s7hFtjl489WcQ1VyPW8ZzUMYCA= github.com/gabriel-vasile/mimetype v1.4.7/go.mod h1:GDlAgAyIRT27BhFl53XNAFtfjzOkLaF35JdEG0P7LtU= github.com/gin-contrib/gzip v0.0.6 h1:NjcunTcGAj5CO1gn4N8jHOSIeRFHIbn51z6K+xaN4d4= github.com/gin-contrib/gzip v0.0.6/go.mod h1:QOJlmV2xmayAjkNS2Y8NQsMneuRShOU/kjovCXNuzzk= -github.com/gin-contrib/requestid v1.0.2 h1:MRJqVwmpHAbkkF3ENgtDWU41l5ICmmVy01q2ZDYI1BE= -github.com/gin-contrib/requestid v1.0.2/go.mod h1:GZWwfwmwZKfuxjnByRCrf+ugr65OW+425m5HiryD37s= github.com/gin-contrib/requestid v1.0.4 h1:h9u+YSCMgrDcn2QlHn9c6P/Zwy4WdXqZLFTmlIAJWpA= github.com/gin-contrib/requestid v1.0.4/go.mod h1:2/3cAmLKQ9E2Pr1IrSPR7K8AWiJORo0hLvs0keKsMJw= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-contrib/sse v1.0.0 h1:y3bT1mUWUxDpW4JLQg/HnTqV4rozuW4tC9eFKTxYI9E= github.com/gin-contrib/sse v1.0.0/go.mod h1:zNuFdwarAygJBht0NTKiSi3jRf6RbqeILZ9Sp6Slhe0= -github.com/gin-contrib/static v1.1.2 h1:c3kT4bFkUJn2aoRU3s6XnMjJT8J6nNWJkR0NglqmlZ4= -github.com/gin-contrib/static v1.1.2/go.mod h1:Fw90ozjHCmZBWbgrsqrDvO28YbhKEKzKp8GixhR4yLw= github.com/gin-contrib/static v1.1.3 h1:WLOpkBtMDJ3gATFZgNJyVibFMio/UHonnueqJsQ0w4U= github.com/gin-contrib/static v1.1.3/go.mod h1:zejpJ/YWp8cZj/6EpiL5f/+skv5daQTNwRx1E8Pci30= github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= +github.com/go-jose/go-jose/v3 v3.0.3 h1:fFKWeig/irsp7XD2zBxvnmA/XaRWp5V3CBsZXJF7G7k= +github.com/go-jose/go-jose/v3 v3.0.3/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= @@ -134,8 +97,6 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.20.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBExVwjEviJTixqxL8= -github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-playground/validator/v10 v10.23.0 h1:/PwmTwZhS0dPkav3cdK9kV1FsAmrL8sThn8IHr/sO+o= github.com/go-playground/validator/v10 v10.23.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-shiori/dom v0.0.0-20190930082056-9d974a4f8b25/go.mod h1:360KoNl36ftFYhjLHuEty78kWUGw8i1opEicvIDLfRk= @@ -143,20 +104,16 @@ github.com/go-shiori/dom v0.0.0-20230515143342-73569d674e1c h1:wpkoddUomPfHiOziH github.com/go-shiori/dom v0.0.0-20230515143342-73569d674e1c/go.mod h1:oVDCh3qjJMLVUSILBRwrm+Bc6RNXGZYtoh9xdvf1ffM= github.com/go-shiori/go-epub v1.2.2-0.20240211121944-dc6435eac436 h1:eLPGGYvm3KFFqJ8K0gR1tGQOejAGKGeKLiCtSDPR3ss= github.com/go-shiori/go-epub v1.2.2-0.20240211121944-dc6435eac436/go.mod h1:3rCTODnigEgy2j3ksndClrGT9h/dcz3js9q4yPX7hf8= -github.com/go-shiori/go-readability v0.0.0-20240518065252-ec24db06a99d h1:gLIyppByW8mGuj7ihkflmQYs34mf9YSaJkCQbbCXLEY= -github.com/go-shiori/go-readability v0.0.0-20240518065252-ec24db06a99d/go.mod h1:2DpZlTJO/ycxp/vsc/C11oUyveStOgIXB88SYV1lncI= github.com/go-shiori/go-readability v0.0.0-20241012063810-92284fa8a71f h1:cypj7SJh+47G9J3VCPdMzT3uWcXWAWDJA54ErTfOigI= github.com/go-shiori/go-readability v0.0.0-20241012063810-92284fa8a71f/go.mod h1:YWa00ashoPZMAOElrSn4E1cJErhDVU6PWAll4Hxzn+w= github.com/go-shiori/warc v0.0.0-20200621032813-359908319d1d h1:+SEf4hYDaAt2eyq8Xu3YyWCpnMsK8sZfbYsDRFCUgBM= github.com/go-shiori/warc v0.0.0-20200621032813-359908319d1d/go.mod h1:uaK5DAxFig7atOzy+aqLzhs6qJacMDfs8NxHV5+shzc= github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= +github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/goccy/go-json v0.10.4 h1:JSwxQzIqKfmFX1swYPpUThQZp/Ka4wzJdK0LWVytLPM= github.com/goccy/go-json v0.10.4/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= -github.com/gofrs/uuid/v5 v5.2.0 h1:qw1GMx6/y8vhVsx626ImfKMuS5CvJmhIKKtuyvfajMM= -github.com/gofrs/uuid/v5 v5.2.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= github.com/gofrs/uuid/v5 v5.3.0 h1:m0mUMr+oVYUdxpMLgSYCZiXe7PuVPnI94+OMeVBNedk= github.com/gofrs/uuid/v5 v5.3.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -165,9 +122,6 @@ github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f h1:3BSP1Tbs2djlpprl7w github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -192,13 +146,9 @@ github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4d github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= -github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= -github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY= github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8= github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= @@ -212,16 +162,10 @@ github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= -github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 h1:7UMa6KCCMjZEMDtTVdcGu0B1GmmC7QJKiCCjyTAWQy0= github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= -github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= -github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM= github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -230,22 +174,19 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= -github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/mattn/go-sqlite3 v1.14.24 h1:tpSp2G2KyMnnQu99ngJ47EIkWVmliIizyZBfPrBWDRM= github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= +github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= -github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= -github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= github.com/moby/sys/sequential v0.6.0 h1:qrx7XFUd/5DxtqcoH1h438hF5TmOvzC/lspjy7zgvCU= github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiTWd+lL+7b/Ko= -github.com/moby/sys/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg= -github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU= github.com/moby/sys/user v0.3.0 h1:9ni5DlcW5an3SvRSx4MouotOygvzaXbaSrc/wGDFWPo= github.com/moby/sys/user v0.3.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs= github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g= @@ -269,34 +210,27 @@ github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQ github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= -github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= -github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= -github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/playwright-community/playwright-go v0.4901.0 h1:d+1KxF5PNAHZ0gTMQ9bPSyYRWii8soJ7Rt0gLWDejc4= +github.com/playwright-community/playwright-go v0.4901.0/go.mod h1:kBNWs/w2aJ2ZUp1wEOOFLXgOqvppFngM5OS+qyhl+ZM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= -github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4/go.mod h1:C1a7PQSMz9NShzorzCiG2fk9+xuCgLkPeCvMHYR2OWg= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sethvargo/go-envconfig v1.0.2 h1:BAQnzBLK/mPN3R3pC0d46MLN0htc64YZBVrz/sZfAX4= github.com/sethvargo/go-envconfig v1.0.2/go.mod h1:OKZ02xFaD3MvWBBmEW45fQr08sJEsonGrrOdicvQmQA= -github.com/sethvargo/go-envconfig v1.1.0 h1:cWZiJxeTm7AlCvzGXrEXaSTCNgip5oJepekh/BOQuog= -github.com/sethvargo/go-envconfig v1.1.0/go.mod h1:JLd0KFWQYzyENqnEPWWZ49i4vzZo/6nRidxI8YvGiHw= -github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4= -github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM= github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= @@ -312,8 +246,6 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -322,6 +254,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -330,32 +263,22 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/swaggo/files v1.0.1 h1:J1bVJ4XHZNq0I46UU90611i9/YzdrF7x92oX1ig5IdE= github.com/swaggo/files v1.0.1/go.mod h1:0qXmMNH6sXNf+73t65aKeB+ApmgxdnkQzVTAj2uaMUg= github.com/swaggo/gin-swagger v1.6.0 h1:y8sxvQ3E20/RCyrXeFfg60r6H0Z+SwpTjMYsMm+zy8M= github.com/swaggo/gin-swagger v1.6.0/go.mod h1:BG00cCEy294xtVpyIAHG6+e2Qzj/xKlRdOqDkvq0uzo= -github.com/swaggo/swag v1.16.3 h1:PnCYjPCah8FK4I26l2F/KQ4yz3sILcVUN3cTlBFA9Pg= -github.com/swaggo/swag v1.16.3/go.mod h1:DImHIuOFXKpMFAQjcC7FG4m3Dg4+QuUgUzJmKjI/gRk= github.com/swaggo/swag v1.16.4 h1:clWJtd9LStiG3VeijiCfOVODP6VpHtKdQy9ELFG3s1A= github.com/swaggo/swag v1.16.4/go.mod h1:VBsHJRsDvfYvqoiMKnsdwhNV9LEMHgEDZcyVYX0sxPg= github.com/tdewolff/parse v2.3.4+incompatible h1:x05/cnGwIMf4ceLuDMBOdQ1qGniMoxpP46ghf0Qzh38= github.com/tdewolff/parse v2.3.4+incompatible/go.mod h1:8oBwCsVmUkgHO8M5iCzSIDtpzXOT0WXX9cWhz+bIzJQ= github.com/tdewolff/test v1.0.0 h1:jOwzqCXr5ePXEPGJaq2ivoR6HOCi+D5TPfpoyg8yvmU= github.com/tdewolff/test v1.0.0/go.mod h1:DiQUlutnqlEvdvhSn2LPGy4TFwRauAaYDsL+683RNX4= -github.com/testcontainers/testcontainers-go v0.31.0 h1:W0VwIhcEVhRflwL9as3dhY6jXjVCA27AkmbnZ+UTh3U= -github.com/testcontainers/testcontainers-go v0.31.0/go.mod h1:D2lAoA0zUFiSY+eAflqK5mcUx/A5hrrORaEQrd0SefI= github.com/testcontainers/testcontainers-go v0.34.0 h1:5fbgF0vIN5u+nD3IWabQwRybuB4GY8G2HHgCkbMzMHo= github.com/testcontainers/testcontainers-go v0.34.0/go.mod h1:6P/kMkQe8yqPHfPWNulFGdFHTD8HB2vLq/231xY2iPQ= -github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= -github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU= github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY= -github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= -github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tklauser/numcpus v0.9.0 h1:lmyCHtANi8aRUgkckBgoDk1nHCux3n2cgkJLXdQGPDo= github.com/tklauser/numcpus v0.9.0/go.mod h1:SN6Nq1O3VychhC1npsWostA+oW+VOQTxZrS604NSRyI= github.com/toorop/gin-logrus v0.0.0-20210225092905-2c785434f26f h1:oqdnd6OGlOUu1InG37hWcCB3a+Jy3fwjylyVboaNMwY= @@ -369,45 +292,29 @@ github.com/vincent-petithory/dataurl v1.0.0/go.mod h1:FHafX5vmDzyP+1CQATJn7WFKc9 github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= -github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0= -go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ= go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0= go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 h1:yd02MEjBdJkG3uabWP9apV+OuWRIXGDuJEUJbOHmCFU= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0/go.mod h1:umTcuxiv1n/s/S6/c2AT/g2CQ7u5C59sHDNmfSwgz7Q= -go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= -go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= go.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw= go.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU= -go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= -go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= go.opentelemetry.io/otel/metric v1.33.0 h1:r+JOocAyeRVXD8lZpjdQjzMadVZp2M4WmQ+5WtEnklQ= go.opentelemetry.io/otel/metric v1.33.0/go.mod h1:L9+Fyctbp6HFTddIxClbQkjtubW6O9QS3Ann/M82u6M= -go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= -go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= -go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= -go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s= go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= -golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/arch v0.12.0 h1:UsYJhbzPYGsT0HbEdmYcqtCv8UNGvnaL561NnIUvaKg= golang.org/x/arch v0.12.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -422,8 +329,6 @@ golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ss golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 h1:1UoZQm6f0P/ZO0w1Ri+f+ifG/gXhegadRdwBIXEFWDo= golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ= -golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E= golang.org/x/image v0.23.0 h1:HseQ7c2OpPKTPVzNjG5fwJsOTCiiwS4QdsYi5XU6H68= golang.org/x/image v0.23.0/go.mod h1:wJJBTdLfCCf3tiHa1fNxpZmUI4mmoZvwMCPP0ddoNKY= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -432,7 +337,6 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= @@ -445,11 +349,9 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= @@ -480,11 +382,8 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= @@ -493,7 +392,6 @@ golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXct golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= @@ -519,7 +417,6 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= @@ -528,20 +425,12 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ= -google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= -google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo= -google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53 h1:fVoAXEKA4+yufmbdVYv+SE73+cPZbbbe8paLsHfkK+U= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= +google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53/go.mod h1:riSXTwQ4+nqmPGtobMFyW5FqVAmIs0St6VPp4Ug7CE4= google.golang.org/genproto/googleapis/rpc v0.0.0-20241230172942-26aa7a208def h1:4P81qv5JXI/sDNae2ClVx88cgDDA6DPilADkG9tYKz8= google.golang.org/genproto/googleapis/rpc v0.0.0-20241230172942-26aa7a208def/go.mod h1:bdAgzvd4kFrpykc5/AC2eLUiegK9T/qxZHD4hXYf/ho= -google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= -google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -550,30 +439,20 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= -gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= -modernc.org/cc/v4 v4.21.2 h1:dycHFB/jDc3IyacKipCNSDrjIC0Lm1hyoWOZTRR20Lk= -modernc.org/cc/v4 v4.21.2/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= modernc.org/cc/v4 v4.24.2 h1:uektamHbSXU7egelXcyVpMaaAsrRH4/+uMKUQAQUdOw= -modernc.org/ccgo/v4 v4.17.7 h1:+MG+Np7uYtsuPvtoH3KtZ1+pqNiJAOqqqVIxggE1iIo= -modernc.org/ccgo/v4 v4.17.7/go.mod h1:x87xuLLXuJv3Nn5ULTUqJn/HsTMMMiT1Eavo6rz1NiY= +modernc.org/cc/v4 v4.24.2/go.mod h1:T1lKJZhXIi2VSqGBiB4LIbKs9NsKTbUXj4IDrmGqtTI= modernc.org/ccgo/v4 v4.23.5 h1:6uAwu8u3pnla3l/+UVUrDDO1HIGxHTYmFH6w+X9nsyw= +modernc.org/ccgo/v4 v4.23.5/go.mod h1:FogrWfBdzqLWm1ku6cfr4IzEFouq2fSAPf6aSAHdAJQ= modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= -modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw= -modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= modernc.org/gc/v2 v2.6.0 h1:Tiw3pezQj7PfV8k4Dzyu/vhRHR2e92kOXtTFU8pbCl4= -modernc.org/gc/v3 v3.0.0-20240304020402-f0dba7c97c2b h1:BnN1t+pb1cy61zbvSUV7SeI0PwosMhlAEi/vBY4qxp8= -modernc.org/gc/v3 v3.0.0-20240304020402-f0dba7c97c2b/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4= +modernc.org/gc/v2 v2.6.0/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= modernc.org/gc/v3 v3.0.0-20241223112719-96e2e1e4408d h1:d0JExN5U5FjUVHCP6L9DIlLJBZveR6KUM4AvfDUL3+k= modernc.org/gc/v3 v3.0.0-20241223112719-96e2e1e4408d/go.mod h1:qBSLm/exCqouT2hrfyTKikWKG9IPq8EoX5fS00l3jqk= -modernc.org/libc v1.50.6 h1:72NPEFMyKP01RJrKXS2eLXv35UklKqlJZ1b9P7gSo6I= -modernc.org/libc v1.50.6/go.mod h1:8lr2m1THY5Z3ikGyUc3JhLEQg1oaIBz/AQixw8/eksQ= modernc.org/libc v1.61.6 h1:L2jW0wxHPCyHK0YSHaGaVlY0WxjpG/TTVdg6gRJOPqw= modernc.org/libc v1.61.6/go.mod h1:G+DzuaCcReUYYg4nNSfigIfTDCENdj9EByglvaRx53A= -modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= -modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU= modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg= modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E= @@ -582,15 +461,10 @@ modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc= modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss= -modernc.org/sqlite v1.29.9 h1:9RhNMklxJs+1596GNuAX+O/6040bvOwacTxuFcRuQow= -modernc.org/sqlite v1.29.9/go.mod h1:ItX2a1OVGgNsFh6Dv60JQvGfJfTPHPVpV6DF59akYOA= modernc.org/sqlite v1.34.4 h1:sjdARozcL5KJBvYQvLlZEmctRgW9xqIZc2ncN7PU0P8= modernc.org/sqlite v1.34.4/go.mod h1:3QQFCG2SEMtc2nv+Wq4cQCH7Hjcg+p/RMlS1XK+zwbk= -modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= -modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0= modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A= modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/internal/cmd/root.go b/internal/cmd/root.go index 48586c9f6..08db47bda 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -104,7 +104,8 @@ func initShiori(ctx context.Context, cmd *cobra.Command) (*config.Config, *depen } dependencies := dependencies.NewDependencies(logger, db, cfg) - dependencies.Domains.Auth = domains.NewAccountsDomain(dependencies) + dependencies.Domains.Auth = domains.NewAuthDomain(dependencies) + dependencies.Domains.Accounts = domains.NewAccountsDomain(dependencies) dependencies.Domains.Archiver = domains.NewArchiverDomain(dependencies) dependencies.Domains.Bookmarks = domains.NewBookmarksDomain(dependencies) dependencies.Domains.Storage = domains.NewStorageDomain(dependencies, afero.NewBasePathFs(afero.NewOsFs(), cfg.Storage.DataDir)) @@ -112,20 +113,20 @@ func initShiori(ctx context.Context, cmd *cobra.Command) (*config.Config, *depen // Workaround: Get accounts to make sure at least one is present in the database. // If there's no accounts in the database, create the shiori/gopher account the legacy api // hardcoded in the login handler. - accounts, err := db.GetAccounts(cmd.Context(), database.GetAccountsOptions{}) + accounts, err := db.ListAccounts(cmd.Context(), database.ListAccountsOptions{}) if err != nil { cError.Printf("Failed to get owner account: %v\n", err) os.Exit(1) } if len(accounts) == 0 { - account := model.Account{ + account := model.AccountDTO{ Username: "shiori", Password: "gopher", - Owner: true, + Owner: model.Ptr[bool](true), } - if err := db.SaveAccount(cmd.Context(), account); err != nil { + if _, err := dependencies.Domains.Accounts.CreateAccount(cmd.Context(), account); err != nil { logger.WithError(err).Fatal("error ensuring owner account") } } diff --git a/internal/database/database.go b/internal/database/database.go index 298fb81d2..acce5d3d6 100644 --- a/internal/database/database.go +++ b/internal/database/database.go @@ -12,6 +12,12 @@ import ( "github.com/pkg/errors" ) +// ErrNotFound is error returned when record is not found in database. +var ErrNotFound = errors.New("not found") + +// ErrAlreadyExists is error returned when record already exists in database. +var ErrAlreadyExists = errors.New("already exists") + // OrderMethod is the order method for getting bookmarks type OrderMethod int @@ -36,10 +42,16 @@ type GetBookmarksOptions struct { Offset int } -// GetAccountsOptions is options for fetching accounts from database. -type GetAccountsOptions struct { +// ListAccountsOptions is options for fetching accounts from database. +type ListAccountsOptions struct { + // Filter accounts by a keyword Keyword string - Owner bool + // Filter accounts by exact useranme + Username string + // Return owner accounts only + Owner bool + // Retrieve password content + WithPassword bool } // Connect connects to database based on submitted database URL. @@ -64,8 +76,11 @@ func Connect(ctx context.Context, dbURL string) (DB, error) { // DB is interface for accessing and manipulating data in database. type DB interface { - // DBx is the underlying sqlx.DB - DBx() *sqlx.DB + // WriterDB is the underlying sqlx.DB + WriterDB() *sqlx.DB + + // ReaderDB is the underlying sqlx.DB + ReaderDB() *sqlx.DB // Init initializes the database Init(ctx context.Context) error @@ -94,20 +109,20 @@ type DB interface { // GetBookmark fetches bookmark based on its ID or URL. GetBookmark(ctx context.Context, id int, url string) (model.BookmarkDTO, bool, error) - // SaveAccount saves new account in database - SaveAccount(ctx context.Context, a model.Account) error + // CreateAccount saves new account in database + CreateAccount(ctx context.Context, a model.Account) (*model.Account, error) - // SaveAccountSettings saves settings for specific user in database - SaveAccountSettings(ctx context.Context, a model.Account) error + // UpdateAccount updates account in database + UpdateAccount(ctx context.Context, a model.Account) error - // GetAccounts fetch list of account (without its password) with matching keyword. - GetAccounts(ctx context.Context, opts GetAccountsOptions) ([]model.Account, error) + // ListAccounts fetch list of account (without its password) with matching keyword. + ListAccounts(ctx context.Context, opts ListAccountsOptions) ([]model.Account, error) // GetAccount fetch account with matching username. - GetAccount(ctx context.Context, username string) (model.Account, bool, error) + GetAccount(ctx context.Context, id model.DBID) (*model.Account, bool, error) - // DeleteAccounts removes all record with matching usernames - DeleteAccounts(ctx context.Context, usernames ...string) error + // DeleteAccount removes account with matching id + DeleteAccount(ctx context.Context, id model.DBID) error // CreateTags creates new tags in database. CreateTags(ctx context.Context, tags ...model.Tag) error diff --git a/internal/database/database_test.go b/internal/database/database_test.go index 9be18841e..11a90611f 100644 --- a/internal/database/database_test.go +++ b/internal/database/database_test.go @@ -35,10 +35,15 @@ func testDatabase(t *testing.T, dbFactory testDatabaseFactory) { "testCreateTag": testCreateTag, "testCreateTags": testCreateTags, // Accounts - "testSaveAccount": testSaveAccount, - "testSaveAccountSetting": testSaveAccountSettings, - "testGetAccount": testGetAccount, - "testGetAccounts": testGetAccounts, + "testCreateAccount": testCreateAccount, + "testCreateDuplicateAccount": testCreateDuplicateAccount, + "testDeleteAccount": testDeleteAccount, + "testDeleteNonExistantAccount": testDeleteNonExistantAccount, + "testUpdateAccount": testUpdateAccount, + "testUpdateAccountDuplicateUser": testUpdateAccountDuplicateUser, + "testGetAccount": testGetAccount, + "testListAccounts": testListAccounts, + "testListAccountsWithPassword": testListAccountsWithPassword, } for testName, testCase := range tests { @@ -333,99 +338,217 @@ func testCreateTags(t *testing.T, db DB) { assert.NoError(t, err, "Save tag must not fail") } -func testSaveAccount(t *testing.T, db DB) { +// ----------------- ACCOUNTS ----------------- +func testCreateAccount(t *testing.T, db DB) { ctx := context.TODO() - t.Run("success", func(t *testing.T) { - acc := model.Account{ - Username: "testuser", - Config: model.UserConfig{}, - } + acc := model.Account{ + Username: "testuser", + Password: "testpass", + Owner: true, + } + insertedAccount, err := db.CreateAccount(ctx, acc) + assert.NoError(t, err, "Save account must not fail") + assert.Equal(t, acc.Username, insertedAccount.Username, "Saved account must have an username set") + assert.Equal(t, acc.Password, insertedAccount.Password, "Saved account must have a password set") + assert.Equal(t, acc.Owner, insertedAccount.Owner, "Saved account must have an owner set") + assert.NotEmpty(t, insertedAccount.ID, "Saved account must have an ID set") +} - err := db.SaveAccount(ctx, acc) - require.Nil(t, err) - }) +func testDeleteAccount(t *testing.T, db DB) { + ctx := context.TODO() + + acc := model.Account{ + Username: "testuser", + Password: "testpass", + Owner: true, + } + storedAccount, err := db.CreateAccount(ctx, acc) + assert.NoError(t, err, "Save account must not fail") + + err = db.DeleteAccount(ctx, storedAccount.ID) + assert.NoError(t, err, "Delete account must not fail") + + _, exists, err := db.GetAccount(ctx, storedAccount.ID) + assert.False(t, exists, "Account must not exist") + assert.ErrorIs(t, err, ErrNotFound, "Get account must return not found error") } -func testSaveAccountSettings(t *testing.T, db DB) { +func testDeleteNonExistantAccount(t *testing.T, db DB) { ctx := context.TODO() + err := db.DeleteAccount(ctx, model.DBID(99)) + assert.ErrorIs(t, err, ErrNotFound, "Delete account must fail") +} + +func testUpdateAccount(t *testing.T, db DB) { + ctx := context.TODO() + + acc := model.Account{ + Username: "testuser", + Password: "testpass", + Owner: true, + Config: model.UserConfig{ + ShowId: true, + }, + } + + account, err := db.CreateAccount(ctx, acc) + require.Nil(t, err) + require.NotNil(t, account) + require.NotEmpty(t, account.ID) + + account, _, err = db.GetAccount(ctx, account.ID) + require.Nil(t, err) - t.Run("success", func(t *testing.T) { + t.Run("update", func(t *testing.T) { acc := model.Account{ - Username: "test", - Config: model.UserConfig{}, + ID: account.ID, + Username: "asdlasd", + Owner: false, + Password: "another", + Config: model.UserConfig{ + ShowId: false, + }, } - err := db.SaveAccountSettings(ctx, acc) + err := db.UpdateAccount(ctx, acc) require.Nil(t, err) + + updatedAccount, exists, err := db.GetAccount(ctx, account.ID) + require.NoError(t, err) + require.True(t, exists) + require.Equal(t, acc.Username, updatedAccount.Username) + require.Equal(t, acc.Owner, updatedAccount.Owner) + require.Equal(t, acc.Config, updatedAccount.Config) + require.NotEqual(t, acc.Password, account.Password) }) } func testGetAccount(t *testing.T, db DB) { ctx := context.TODO() - t.Run("success", func(t *testing.T) { - // Insert test accounts - testAccounts := []model.Account{ - {Username: "foo", Password: "bar", Owner: false}, - {Username: "hello", Password: "world", Owner: false}, - {Username: "foo_bar", Password: "foobar", Owner: true}, - } - for _, acc := range testAccounts { - err := db.SaveAccount(ctx, acc) - assert.Nil(t, err) - - // Successful case - account, exists, err := db.GetAccount(ctx, acc.Username) - assert.Nil(t, err) - assert.True(t, exists, "Expected account to exist") - assert.Equal(t, acc.Username, account.Username) - } - // Falid case - account, exists, err := db.GetAccount(ctx, "foobar") - assert.NotNil(t, err) - assert.False(t, exists, "Expected account to exist") - assert.Empty(t, account.Username) - }) + // Insert test accounts + testAccounts := []model.Account{ + {Username: "foo", Password: "bar", Owner: false}, + {Username: "hello", Password: "world", Owner: false}, + {Username: "foo_bar", Password: "foobar", Owner: true}, + } + + for _, acc := range testAccounts { + storedAcc, err := db.CreateAccount(ctx, acc) + assert.Nil(t, err) + + // Successful case + account, exists, err := db.GetAccount(ctx, storedAcc.ID) + assert.Nil(t, err) + assert.True(t, exists, "Expected account to exist") + assert.Equal(t, storedAcc.Username, account.Username) + } + + // Failed case + account, exists, err := db.GetAccount(ctx, 99) + assert.NotNil(t, err) + assert.False(t, exists, "Expected account to exist") + assert.Empty(t, account.Username) } -func testGetAccounts(t *testing.T, db DB) { +func testListAccounts(t *testing.T, db DB) { ctx := context.TODO() - t.Run("success", func(t *testing.T) { - // Insert test accounts - testAccounts := []model.Account{ - {Username: "foo", Password: "bar", Owner: false}, - {Username: "hello", Password: "world", Owner: false}, - {Username: "foo_bar", Password: "foobar", Owner: true}, - } - for _, acc := range testAccounts { - err := db.SaveAccount(ctx, acc) - assert.Nil(t, err) - } + // prepare database + testAccounts := []model.Account{ + {Username: "foo", Password: "bar", Owner: false}, + {Username: "hello", Password: "world", Owner: false}, + {Username: "foo_bar", Password: "foobar", Owner: true}, + } + for _, acc := range testAccounts { + _, err := db.CreateAccount(ctx, acc) + assert.Nil(t, err) + } - // Successful case - // without opt - accounts, err := db.GetAccounts(ctx, GetAccountsOptions{}) - assert.NoError(t, err) - assert.Equal(t, 3, len(accounts)) - // with owner - accounts, err = db.GetAccounts(ctx, GetAccountsOptions{Owner: true}) - assert.NoError(t, err) - assert.Equal(t, 1, len(accounts)) - // with opt - accounts, err = db.GetAccounts(ctx, GetAccountsOptions{Keyword: "foo"}) - assert.NoError(t, err) - assert.Equal(t, 2, len(accounts)) - // with opt and owner - accounts, err = db.GetAccounts(ctx, GetAccountsOptions{Keyword: "hello", Owner: false}) - assert.NoError(t, err) - assert.Equal(t, 1, len(accounts)) - // with not result - accounts, err = db.GetAccounts(ctx, GetAccountsOptions{Keyword: "shiori"}) - assert.NoError(t, err) - assert.Equal(t, 0, len(accounts)) + tests := []struct { + name string + options ListAccountsOptions + expected int + }{ + {"default", ListAccountsOptions{}, 3}, + {"with owner", ListAccountsOptions{Owner: true}, 1}, + {"with keyword", ListAccountsOptions{Keyword: "foo"}, 2}, + {"with keyword and owner", ListAccountsOptions{Keyword: "hello", Owner: false}, 1}, + {"with no result", ListAccountsOptions{Keyword: "shiori"}, 0}, + {"with username", ListAccountsOptions{Username: "foo"}, 1}, + {"with non-existent username", ListAccountsOptions{Username: "non-existant"}, 0}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + accounts, err := db.ListAccounts(ctx, tt.options) + assert.NoError(t, err) + assert.Equal(t, tt.expected, len(accounts)) + }) + } +} + +func testCreateDuplicateAccount(t *testing.T, db DB) { + ctx := context.TODO() + + acc := model.Account{ + Username: "testuser", + Password: "testpass", + Owner: false, + } + + // Create first account + _, err := db.CreateAccount(ctx, acc) + assert.NoError(t, err, "First account creation must not fail") + + // Try to create account with same username + _, err = db.CreateAccount(ctx, acc) + assert.ErrorIs(t, err, ErrAlreadyExists, "Creating duplicate account must return ErrAlreadyExists") +} + +func testUpdateAccountDuplicateUser(t *testing.T, db DB) { + ctx := context.TODO() + + // Create first account + acc1 := model.Account{ + Username: "testuser1", + Password: "testpass", + Owner: false, + } + storedAcc1, err := db.CreateAccount(ctx, acc1) + assert.NoError(t, err, "First account creation must not fail") + + // Create second account + acc2 := model.Account{ + Username: "testuser2", + Password: "testpass", + Owner: false, + } + storedAcc2, err := db.CreateAccount(ctx, acc2) + assert.NoError(t, err, "Second account creation must not fail") + + // Try to update second account to have same username as first + storedAcc2.Username = storedAcc1.Username + err = db.UpdateAccount(ctx, *storedAcc2) + assert.ErrorIs(t, err, ErrAlreadyExists, "Updating to duplicate username must return ErrAlreadyExists") +} + +func testListAccountsWithPassword(t *testing.T, db DB) { + ctx := context.TODO() + _, err := db.CreateAccount(ctx, model.Account{ + Username: "gopher", + Password: "shiori", }) + assert.Nil(t, err) + + storedAccounts, err := db.ListAccounts(ctx, ListAccountsOptions{ + WithPassword: true, + }) + require.NoError(t, err) + for _, acc := range storedAccounts { + require.NotEmpty(t, acc.Password) + } } // TODO: Consider using `t.Parallel()` once we have automated database tests spawning databases using testcontainers. diff --git a/internal/database/migrations.go b/internal/database/migrations.go index 59ca443c4..7a95e3078 100644 --- a/internal/database/migrations.go +++ b/internal/database/migrations.go @@ -84,7 +84,7 @@ func runMigrations(ctx context.Context, db DB, migrations []migration) error { continue } - if err := migration.migrationFunc(db.DBx().DB); err != nil { + if err := migration.migrationFunc(db.WriterDB().DB); err != nil { return fmt.Errorf("failed to run migration from %s to %s: %w", migration.fromVersion, migration.toVersion, err) } diff --git a/internal/database/mysql.go b/internal/database/mysql.go index 668db7ae2..d4520b2a6 100644 --- a/internal/database/mysql.go +++ b/internal/database/mysql.go @@ -10,7 +10,6 @@ import ( "github.com/go-shiori/shiori/internal/model" "github.com/jmoiron/sqlx" "github.com/pkg/errors" - "golang.org/x/crypto/bcrypt" _ "github.com/go-sql-driver/mysql" ) @@ -90,8 +89,13 @@ func OpenMySQLDatabase(ctx context.Context, connString string) (mysqlDB *MySQLDa return mysqlDB, err } -// DBX returns the underlying sqlx.DB object -func (db *MySQLDatabase) DBx() *sqlx.DB { +// WriterDB returns the underlying sqlx.DB object +func (db *MySQLDatabase) WriterDB() *sqlx.DB { + return db.DB +} + +// ReaderDB returns the underlying sqlx.DB object +func (db *MySQLDatabase) ReaderDB() *sqlx.DB { return db.DB } @@ -593,53 +597,113 @@ func (db *MySQLDatabase) GetBookmark(ctx context.Context, id int, url string) (m return book, book.ID != 0, nil } -// SaveAccount saves new account to database. Returns error if any happened. -func (db *MySQLDatabase) SaveAccount(ctx context.Context, account model.Account) (err error) { - // Hash password with bcrypt - hashedPassword, err := bcrypt.GenerateFromPassword([]byte(account.Password), 10) - if err != nil { - return errors.WithStack(err) - } +// CreateAccount saves new account to database. Returns error if any happened. +func (db *MySQLDatabase) CreateAccount(ctx context.Context, account model.Account) (*model.Account, error) { + var accountID int64 + if err := db.withTx(ctx, func(tx *sqlx.Tx) error { + // Check for existing username + var exists bool + err := tx.QueryRowContext( + ctx, "SELECT EXISTS(SELECT 1 FROM account WHERE username = ?)", + account.Username, + ).Scan(&exists) + if err != nil { + return fmt.Errorf("error checking username: %w", err) + } + if exists { + return ErrAlreadyExists + } - // Insert account to database - _, err = db.ExecContext(ctx, `INSERT INTO account - (username, password, owner, config) VALUES (?, ?, ?, ?) - ON DUPLICATE KEY UPDATE - password = VALUES(password), - owner = VALUES(owner)`, - account.Username, hashedPassword, account.Owner, account.Config) + // Create the account + result, err := tx.ExecContext(ctx, `INSERT INTO account + (username, password, owner, config) VALUES (?, ?, ?, ?)`, + account.Username, account.Password, account.Owner, account.Config) + if err != nil { + return errors.WithStack(err) + } - return errors.WithStack(err) + id, err := result.LastInsertId() + if err != nil { + return errors.WithStack(err) + } + accountID = id + return nil + }); err != nil { + return nil, errors.WithStack(err) + } + + account.ID = model.DBID(accountID) + return &account, nil } -// SaveAccountSettings update settings for specific account in database. Returns error if any happened -func (db *MySQLDatabase) SaveAccountSettings(ctx context.Context, account model.Account) (err error) { - // Update account config in database for specific user - _, err = db.ExecContext(ctx, `UPDATE account - SET config = ? - WHERE username = ?`, - account.Config, account.Username) +// UpdateAccount update account in database +func (db *MySQLDatabase) UpdateAccount(ctx context.Context, account model.Account) error { + if account.ID == 0 { + return ErrNotFound + } - return errors.WithStack(err) + if err := db.withTx(ctx, func(tx *sqlx.Tx) error { + // Check for existing username + var exists bool + err := tx.QueryRowContext(ctx, + "SELECT EXISTS(SELECT 1 FROM account WHERE username = ? AND id != ?)", + account.Username, account.ID).Scan(&exists) + if err != nil { + return fmt.Errorf("error checking username: %w", err) + } + if exists { + return ErrAlreadyExists + } + + result, err := tx.ExecContext(ctx, `UPDATE account + SET username = ?, password = ?, owner = ?, config = ? + WHERE id = ?`, + account.Username, account.Password, account.Owner, account.Config, account.ID) + if err != nil { + return errors.WithStack(err) + } + + rows, err := result.RowsAffected() + if err != nil { + return errors.WithStack(err) + } + if rows == 0 { + return ErrNotFound + } + + return nil + }); err != nil { + return errors.WithStack(err) + } + + return nil } -// GetAccounts fetch list of account (without its password) based on submitted options. -func (db *MySQLDatabase) GetAccounts(ctx context.Context, opts GetAccountsOptions) ([]model.Account, error) { +// ListAccounts fetch list of account (without its password) based on submitted options. +func (db *MySQLDatabase) ListAccounts(ctx context.Context, opts ListAccountsOptions) ([]model.Account, error) { // Create query args := []interface{}{} - query := `SELECT id, username, owner, config FROM account WHERE 1` + fields := []string{"id", "username", "owner", "config"} + if opts.WithPassword { + fields = append(fields, "password") + } + + query := fmt.Sprintf(`SELECT %s FROM account WHERE 1`, strings.Join(fields, ", ")) if opts.Keyword != "" { query += " AND username LIKE ?" args = append(args, "%"+opts.Keyword+"%") } + if opts.Username != "" { + query += " AND username = ?" + args = append(args, opts.Username) + } + if opts.Owner { query += " AND owner = 1" } - query += ` ORDER BY username` - // Fetch list account accounts := []model.Account{} err := db.SelectContext(ctx, &accounts, query, args...) @@ -650,30 +714,41 @@ func (db *MySQLDatabase) GetAccounts(ctx context.Context, opts GetAccountsOption return accounts, nil } -// GetAccount fetch account with matching username. +// GetAccount fetch account with matching ID. // Returns the account and boolean whether it's exist or not. -func (db *MySQLDatabase) GetAccount(ctx context.Context, username string) (model.Account, bool, error) { +func (db *MySQLDatabase) GetAccount(ctx context.Context, id model.DBID) (*model.Account, bool, error) { account := model.Account{} - if err := db.GetContext(ctx, &account, `SELECT - id, username, password, owner, config FROM account WHERE username = ?`, - username, - ); err != nil { - return account, false, errors.WithStack(err) + err := db.GetContext(ctx, &account, `SELECT + id, username, password, owner, config FROM account WHERE id = ?`, + id, + ) + if err != nil && err != sql.ErrNoRows { + return &account, false, errors.WithStack(err) } - return account, account.ID != 0, nil + // Use custom not found error if that's the result of the query + if err == sql.ErrNoRows { + err = ErrNotFound + } + + return &account, account.ID != 0, err } -// DeleteAccounts removes all record with matching usernames. -func (db *MySQLDatabase) DeleteAccounts(ctx context.Context, usernames ...string) error { +// DeleteAccount removes record with matching ID. +func (db *MySQLDatabase) DeleteAccount(ctx context.Context, id model.DBID) error { if err := db.withTx(ctx, func(tx *sqlx.Tx) error { - // Delete account - stmtDelete, _ := tx.Preparex(`DELETE FROM account WHERE username = ?`) - for _, username := range usernames { - _, err := stmtDelete.ExecContext(ctx, username) - if err != nil { - return errors.WithStack(err) - } + result, err := tx.ExecContext(ctx, `DELETE FROM account WHERE id = ?`, id) + if err != nil { + return errors.WithStack(fmt.Errorf("error deleting account: %v", err)) + } + + rows, err := result.RowsAffected() + if err != nil && err != sql.ErrNoRows { + return errors.WithStack(fmt.Errorf("error getting rows affected: %v", err)) + } + + if rows == 0 { + return ErrNotFound } return nil diff --git a/internal/database/pg.go b/internal/database/pg.go index 05e1116c2..e6389412c 100644 --- a/internal/database/pg.go +++ b/internal/database/pg.go @@ -4,13 +4,13 @@ import ( "context" "database/sql" "fmt" + "strconv" "strings" "time" "github.com/go-shiori/shiori/internal/model" "github.com/jmoiron/sqlx" "github.com/pkg/errors" - "golang.org/x/crypto/bcrypt" "github.com/lib/pq" ) @@ -91,8 +91,13 @@ func OpenPGDatabase(ctx context.Context, connString string) (pgDB *PGDatabase, e return pgDB, err } -// DBX returns the underlying sqlx.DB object -func (db *PGDatabase) DBx() *sqlx.DB { +// WriterDB returns the underlying sqlx.DB object +func (db *PGDatabase) WriterDB() *sqlx.DB { + return db.DB +} + +// ReaderDB returns the underlying sqlx.DB object +func (db *PGDatabase) ReaderDB() *sqlx.DB { return db.DB } @@ -604,54 +609,114 @@ func (db *PGDatabase) GetBookmark(ctx context.Context, id int, url string) (mode return book, book.ID != 0, nil } -// SaveAccount saves new account to database. Returns error if any happened. -func (db *PGDatabase) SaveAccount(ctx context.Context, account model.Account) (err error) { - // Hash password with bcrypt - hashedPassword, err := bcrypt.GenerateFromPassword([]byte(account.Password), 10) - if err != nil { - return err +// CreateAccount saves new account to database. Returns error if any happened. +func (db *PGDatabase) CreateAccount(ctx context.Context, account model.Account) (*model.Account, error) { + var accountID int64 + if err := db.withTx(ctx, func(tx *sqlx.Tx) error { + // Check for existing username + var exists bool + err := tx.QueryRowContext(ctx, + "SELECT EXISTS(SELECT 1 FROM account WHERE username = $1)", + account.Username).Scan(&exists) + if err != nil { + return fmt.Errorf("error checking username: %w", err) + } + if exists { + return ErrAlreadyExists + } + + // Create the account + query, err := tx.PrepareContext(ctx, `INSERT INTO account + (username, password, owner, config) VALUES ($1, $2, $3, $4) + RETURNING id`) + if err != nil { + return fmt.Errorf("error preparing query: %w", err) + } + + err = query.QueryRowContext(ctx, + account.Username, account.Password, account.Owner, account.Config).Scan(&accountID) + if err != nil { + return fmt.Errorf("error executing query: %w", err) + } + + return nil + }); err != nil { + return nil, fmt.Errorf("error during transaction: %w", err) } - // Insert account to database - _, err = db.ExecContext(ctx, `INSERT INTO account - (username, password, owner, config) VALUES ($1, $2, $3, $4) - ON CONFLICT(username) DO UPDATE SET - password = $2, - owner = $3`, - account.Username, hashedPassword, account.Owner, account.Config) + account.ID = model.DBID(accountID) - return errors.WithStack(err) + return &account, nil } -// SaveAccountSettings update settings for specific account in database. Returns error if any happened -func (db *PGDatabase) SaveAccountSettings(ctx context.Context, account model.Account) (err error) { +// UpdateAccount updates account in database. +func (db *PGDatabase) UpdateAccount(ctx context.Context, account model.Account) error { + if account.ID == 0 { + return ErrNotFound + } - // Insert account to database - _, err = db.ExecContext(ctx, `UPDATE account - SET config = $1 - WHERE username = $2`, - account.Config, account.Username) + if err := db.withTx(ctx, func(tx *sqlx.Tx) error { + // Check for existing username + var exists bool + err := tx.QueryRowContext(ctx, + "SELECT EXISTS(SELECT 1 FROM account WHERE username = $1 AND id != $2)", + account.Username, account.ID).Scan(&exists) + if err != nil { + return fmt.Errorf("error checking username: %w", err) + } + if exists { + return ErrAlreadyExists + } + + result, err := tx.ExecContext(ctx, `UPDATE account + SET username = $1, password = $2, owner = $3, config = $4 + WHERE id = $5`, + account.Username, account.Password, account.Owner, account.Config, account.ID) + if err != nil { + return errors.WithStack(err) + } - return errors.WithStack(err) + rows, err := result.RowsAffected() + if err != nil { + return errors.WithStack(err) + } + if rows == 0 { + return ErrNotFound + } + + return nil + }); err != nil { + return errors.WithStack(err) + } + + return nil } -// GetAccounts fetch list of account (without its password) based on submitted options. -func (db *PGDatabase) GetAccounts(ctx context.Context, opts GetAccountsOptions) ([]model.Account, error) { +// ListAccounts fetch list of account (without its password) based on submitted options. +func (db *PGDatabase) ListAccounts(ctx context.Context, opts ListAccountsOptions) ([]model.Account, error) { // Create query args := []interface{}{} - query := `SELECT id, username, owner, config FROM account WHERE TRUE` + fields := []string{"id", "username", "owner", "config"} + if opts.WithPassword { + fields = append(fields, "password") + } + + query := fmt.Sprintf(`SELECT %s FROM account WHERE TRUE`, strings.Join(fields, ", ")) if opts.Keyword != "" { - query += " AND username LIKE $1" + query += " AND username LIKE $" + strconv.Itoa(len(args)+1) args = append(args, "%"+opts.Keyword+"%") } + if opts.Username != "" { + query += " AND username = $" + strconv.Itoa(len(args)+1) + args = append(args, opts.Username) + } + if opts.Owner { query += " AND owner = TRUE" } - query += ` ORDER BY username` - // Fetch list account accounts := []model.Account{} err := db.SelectContext(ctx, &accounts, query, args...) @@ -662,29 +727,41 @@ func (db *PGDatabase) GetAccounts(ctx context.Context, opts GetAccountsOptions) return accounts, nil } -// GetAccount fetch account with matching username. +// GetAccount fetch account with matching ID. // Returns the account and boolean whether it's exist or not. -func (db *PGDatabase) GetAccount(ctx context.Context, username string) (model.Account, bool, error) { +func (db *PGDatabase) GetAccount(ctx context.Context, id model.DBID) (*model.Account, bool, error) { account := model.Account{} - if err := db.GetContext(ctx, &account, `SELECT - id, username, password, owner, config FROM account WHERE username = $1`, - username, - ); err != nil { - return account, false, errors.WithStack(err) + err := db.GetContext(ctx, &account, `SELECT + id, username, password, owner, config FROM account WHERE id = $1`, + id, + ) + if err != nil && err != sql.ErrNoRows { + return &account, false, errors.WithStack(err) } - return account, account.ID != 0, nil + // Use custom not found error if that's the result of the query + if err == sql.ErrNoRows { + err = ErrNotFound + } + + return &account, account.ID != 0, err } -// DeleteAccounts removes all record with matching usernames. -func (db *PGDatabase) DeleteAccounts(ctx context.Context, usernames ...string) (err error) { +// DeleteAccount removes record with matching ID. +func (db *PGDatabase) DeleteAccount(ctx context.Context, id model.DBID) error { if err := db.withTx(ctx, func(tx *sqlx.Tx) error { - // Delete account - stmtDelete, _ := tx.Preparex(`DELETE FROM account WHERE username = $1`) - for _, username := range usernames { - if _, err := stmtDelete.ExecContext(ctx, username); err != nil { - return errors.WithStack(err) - } + result, err := tx.ExecContext(ctx, `DELETE FROM account WHERE id = $1`, id) + if err != nil { + return errors.WithStack(fmt.Errorf("error deleting account: %v", err)) + } + + rows, err := result.RowsAffected() + if err != nil && err != sql.ErrNoRows { + return errors.WithStack(fmt.Errorf("error getting rows affected: %v", err)) + } + + if rows == 0 { + return ErrNotFound } return nil diff --git a/internal/database/sqlite.go b/internal/database/sqlite.go index c9e663f37..1edd2756f 100644 --- a/internal/database/sqlite.go +++ b/internal/database/sqlite.go @@ -12,7 +12,6 @@ import ( "github.com/go-shiori/shiori/internal/model" "github.com/jmoiron/sqlx" "github.com/pkg/errors" - "golang.org/x/crypto/bcrypt" _ "modernc.org/sqlite" ) @@ -173,12 +172,12 @@ type tagContent struct { } // DBX returns the underlying sqlx.DB object for writes -func (db *SQLiteDatabase) DBx() *sqlx.DB { +func (db *SQLiteDatabase) WriterDB() *sqlx.DB { return db.writer.DB } // ReaderDBx returns the underlying sqlx.DB object for reading -func (db *SQLiteDatabase) ReaderDBx() *sqlx.DB { +func (db *SQLiteDatabase) ReaderDB() *sqlx.DB { return db.reader.DB } @@ -790,69 +789,119 @@ func (db *SQLiteDatabase) GetBookmark(ctx context.Context, id int, url string) ( return book, book.ID != 0, nil } -// SaveAccount saves new account to database. Returns error if any happened. -func (db *SQLiteDatabase) SaveAccount(ctx context.Context, account model.Account) error { +// CreateAccount saves new account to database. Returns error if any happened. +func (db *SQLiteDatabase) CreateAccount(ctx context.Context, account model.Account) (*model.Account, error) { + var accountID int64 if err := db.withTx(ctx, func(tx *sqlx.Tx) error { - // Hash password with bcrypt - hashedPassword, err := bcrypt.GenerateFromPassword([]byte(account.Password), 10) + // Check if username already exists + var exists bool + err := tx.GetContext(ctx, &exists, + "SELECT EXISTS(SELECT 1 FROM account WHERE username = ?)", + account.Username) if err != nil { - return err + return fmt.Errorf("error checking username existence: %w", err) + } + if exists { + return ErrAlreadyExists + } + + // Insert new account + query, err := tx.PrepareContext(ctx, `INSERT INTO account + (username, password, owner, config) VALUES (?, ?, ?, ?) + RETURNING id`) + if err != nil { + return fmt.Errorf("error preparing query: %w", err) } - // Insert account to database - _, err = tx.Exec(`INSERT INTO account - (username, password, owner, config) VALUES (?, ?, ?, ?) - ON CONFLICT(username) DO UPDATE SET - password = ?, owner = ?`, - account.Username, hashedPassword, account.Owner, account.Config, - hashedPassword, account.Owner, account.Config) + err = query.QueryRowContext(ctx, + account.Username, account.Password, account.Owner, account.Config).Scan(&accountID) if err != nil { - return fmt.Errorf("failed to hash password: %w", err) + return fmt.Errorf("error executing query: %w", err) } + return nil }); err != nil { - return fmt.Errorf("failed to insert/update account: %w", err) + return nil, fmt.Errorf("error running transaction: %w", err) } - return nil + account.ID = model.DBID(accountID) + + return &account, nil } -// SaveAccountSettings update settings for specific account in database. Returns error if any happened. -func (db *SQLiteDatabase) SaveAccountSettings(ctx context.Context, account model.Account) error { +// UpdateAccount updates account in database. +func (db *SQLiteDatabase) UpdateAccount(ctx context.Context, account model.Account) error { + if account.ID == 0 { + return ErrNotFound + } + if err := db.withTx(ctx, func(tx *sqlx.Tx) error { - // Update account config in database for specific user - _, err := tx.Exec(`UPDATE account - SET config = ? - WHERE username = ?`, - account.Config, account.Username) + // Check if username already exists for a different account + var exists bool + err := tx.GetContext(ctx, &exists, + "SELECT EXISTS(SELECT 1 FROM account WHERE username = ? AND id != ?)", + account.Username, account.ID) if err != nil { - return fmt.Errorf("failed to update account settings: %w", err) + return fmt.Errorf("error checking username existence: %w", err) } + if exists { + return ErrAlreadyExists + } + + // Update account + queryString := "UPDATE account SET username = ?, password = ?, owner = ?, config = ? WHERE id = ?" + updateQuery, err := tx.PrepareContext(ctx, queryString) + if err != nil { + return fmt.Errorf("error preparing query: %w", err) + } + + result, err := updateQuery.ExecContext(ctx, + account.Username, account.Password, account.Owner, account.Config, account.ID) + if err != nil { + return fmt.Errorf("error executing query: %w", err) + } + + rows, err := result.RowsAffected() + if err != nil { + return fmt.Errorf("error getting rows affected: %w", err) + } + if rows == 0 { + return ErrNotFound + } + return nil }); err != nil { - return fmt.Errorf("failed to prepare delete book tag statement: %w", err) + return fmt.Errorf("error running transaction: %w", err) } return nil } -// GetAccounts fetch list of account (without its password) based on submitted options. -func (db *SQLiteDatabase) GetAccounts(ctx context.Context, opts GetAccountsOptions) ([]model.Account, error) { +// ListAccounts fetch list of account (without its password) based on submitted options. +func (db *SQLiteDatabase) ListAccounts(ctx context.Context, opts ListAccountsOptions) ([]model.Account, error) { // Create query args := []interface{}{} - query := `SELECT id, username, owner, config FROM account WHERE 1` + fields := []string{"id", "username", "owner", "config"} + if opts.WithPassword { + fields = append(fields, "password") + } + + query := fmt.Sprintf(`SELECT %s FROM account WHERE 1`, strings.Join(fields, ", ")) if opts.Keyword != "" { query += " AND username LIKE ?" args = append(args, "%"+opts.Keyword+"%") } + if opts.Username != "" { + query += " AND username = ?" + args = append(args, opts.Username) + } + if opts.Owner { query += " AND owner = 1" } - query += ` ORDER BY username` - // Fetch list account accounts := []model.Account{} err := db.reader.SelectContext(ctx, &accounts, query, args...) @@ -863,37 +912,41 @@ func (db *SQLiteDatabase) GetAccounts(ctx context.Context, opts GetAccountsOptio return accounts, nil } -// GetAccount fetch account with matching username. +// GetAccount fetch account with matching ID. // Returns the account and boolean whether it's exist or not. -func (db *SQLiteDatabase) GetAccount(ctx context.Context, username string) (model.Account, bool, error) { +func (db *SQLiteDatabase) GetAccount(ctx context.Context, id model.DBID) (*model.Account, bool, error) { account := model.Account{} - if err := db.reader.GetContext(ctx, &account, `SELECT - id, username, password, owner, config FROM account WHERE username = ?`, - username, - ); err != nil { - if err != sql.ErrNoRows { - return account, false, fmt.Errorf("account does not exist %w", err) - } - return account, false, fmt.Errorf("failed to get account: %w", err) + err := db.reader.GetContext(ctx, &account, `SELECT + id, username, password, owner, config FROM account WHERE id = ?`, + id, + ) + if err != nil && err != sql.ErrNoRows { + return &account, false, errors.WithStack(err) + } + + // Use custom not found error if that's the result of the query + if err == sql.ErrNoRows { + err = ErrNotFound } - return account, account.ID != 0, nil + return &account, account.ID != 0, err } -// DeleteAccounts removes all record with matching usernames. -func (db *SQLiteDatabase) DeleteAccounts(ctx context.Context, usernames ...string) error { +// DeleteAccount removes record with matching ID. +func (db *SQLiteDatabase) DeleteAccount(ctx context.Context, id model.DBID) error { if err := db.withTx(ctx, func(tx *sqlx.Tx) error { - // Delete account - stmtDelete, err := tx.Preparex(`DELETE FROM account WHERE username = ?`) + result, err := tx.ExecContext(ctx, `DELETE FROM account WHERE id = ?`, id) if err != nil { - return fmt.Errorf("failed to insert tag: %w", err) + return errors.WithStack(fmt.Errorf("error deleting account: %v", err)) } - for _, username := range usernames { - _, err := stmtDelete.ExecContext(ctx, username) - if err != nil { - return fmt.Errorf("failed to delete bookmark tag: %w", err) - } + rows, err := result.RowsAffected() + if err != nil && err != sql.ErrNoRows { + return errors.WithStack(fmt.Errorf("error getting rows affected: %v", err)) + } + + if rows == 0 { + return ErrNotFound } return nil diff --git a/internal/database/sqlite_test.go b/internal/database/sqlite_test.go index 9590686ff..720d3ea3f 100644 --- a/internal/database/sqlite_test.go +++ b/internal/database/sqlite_test.go @@ -68,5 +68,4 @@ func testSqliteGetBookmarksWithDash(t *testing.T) { assert.NoError(t, err, "Get bookmarks should not fail") assert.Len(t, results, 1, "results should contain one item") assert.Equal(t, savedBookmark.ID, results[0].ID, "bookmark should be the one saved") - } diff --git a/internal/dependencies/dependencies.go b/internal/dependencies/dependencies.go index 644607515..b30138574 100644 --- a/internal/dependencies/dependencies.go +++ b/internal/dependencies/dependencies.go @@ -8,8 +8,9 @@ import ( ) type Domains struct { + Accounts model.AccountsDomain Archiver model.ArchiverDomain - Auth model.AccountsDomain + Auth model.AuthDomain Bookmarks model.BookmarksDomain Storage model.StorageDomain } diff --git a/internal/domains/accounts.go b/internal/domains/accounts.go index 5a77ed616..157a77fb9 100644 --- a/internal/domains/accounts.go +++ b/internal/domains/accounts.go @@ -2,13 +2,12 @@ package domains import ( "context" + "errors" "fmt" - "time" + "github.com/go-shiori/shiori/internal/database" "github.com/go-shiori/shiori/internal/dependencies" "github.com/go-shiori/shiori/internal/model" - "github.com/golang-jwt/jwt/v5" - "github.com/pkg/errors" "golang.org/x/crypto/bcrypt" ) @@ -16,71 +15,125 @@ type AccountsDomain struct { deps *dependencies.Dependencies } -func (d *AccountsDomain) ParseToken(userJWT string) (*model.JWTClaim, error) { - token, err := jwt.ParseWithClaims(userJWT, &model.JWTClaim{}, func(token *jwt.Token) (interface{}, error) { - // Validate algorithm - if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok { - return nil, fmt.Errorf("Unexpected signing method: %v", token.Header["alg"]) - } - return d.deps.Config.Http.SecretKey, nil - }) +func (d *AccountsDomain) ListAccounts(ctx context.Context) ([]model.AccountDTO, error) { + accounts, err := d.deps.Database.ListAccounts(ctx, database.ListAccountsOptions{}) if err != nil { - return nil, errors.Wrap(err, "error parsing token") + return nil, fmt.Errorf("error getting accounts: %v", err) } - if claims, ok := token.Claims.(*model.JWTClaim); ok && token.Valid { - return claims, nil + accountDTOs := []model.AccountDTO{} + for _, account := range accounts { + accountDTOs = append(accountDTOs, account.ToDTO()) } - return nil, fmt.Errorf("error obtaining user from JWT claims") + return accountDTOs, nil } -func (d *AccountsDomain) CheckToken(ctx context.Context, userJWT string) (*model.Account, error) { - claims, err := d.ParseToken(userJWT) +func (d *AccountsDomain) CreateAccount(ctx context.Context, account model.AccountDTO) (*model.AccountDTO, error) { + if err := account.IsValidCreate(); err != nil { + return nil, err + } + + hashedPassword, err := bcrypt.GenerateFromPassword([]byte(account.Password), bcrypt.DefaultCost) if err != nil { - return nil, fmt.Errorf("error parsing token: %w", err) + return nil, fmt.Errorf("error hashing provided password: %w", err) } - if claims.Account.ID > 0 { - return claims.Account, nil + acc := model.Account{ + Username: account.Username, + Password: string(hashedPassword), + } + if account.Owner != nil { + acc.Owner = *account.Owner + } + if account.Config != nil { + acc.Config = *account.Config + } + + storedAccount, err := d.deps.Database.CreateAccount(ctx, acc) + if errors.Is(err, database.ErrAlreadyExists) { + return nil, model.ErrAlreadyExists } - return nil, fmt.Errorf("error obtaining user from JWT claims: %w", err) -} -func (d *AccountsDomain) GetAccountFromCredentials(ctx context.Context, username, password string) (*model.Account, error) { - account, _, err := d.deps.Database.GetAccount(ctx, username) if err != nil { - return nil, fmt.Errorf("username and password do not match") + return nil, fmt.Errorf("error creating account: %v", err) } - if err := bcrypt.CompareHashAndPassword([]byte(account.Password), []byte(password)); err != nil { - return nil, fmt.Errorf("username and password do not match") + result := storedAccount.ToDTO() + + return &result, nil +} + +func (d *AccountsDomain) DeleteAccount(ctx context.Context, id int) error { + err := d.deps.Database.DeleteAccount(ctx, model.DBID(id)) + if errors.Is(err, database.ErrNotFound) { + return model.ErrNotFound } - return &account, nil + if err != nil { + return fmt.Errorf("error deleting account: %v", err) + } + + return nil } -func (d *AccountsDomain) CreateTokenForAccount(account *model.Account, expiration time.Time) (string, error) { - if account == nil { - return "", fmt.Errorf("account is nil") +func (d *AccountsDomain) UpdateAccount(ctx context.Context, account model.AccountDTO) (*model.AccountDTO, error) { + if err := account.IsValidUpdate(); err != nil { + return nil, err + } + + // Get account from database + storedAccount, _, err := d.deps.Database.GetAccount(ctx, account.ID) + if errors.Is(err, database.ErrNotFound) { + return nil, model.ErrNotFound + } + if err != nil { + return nil, fmt.Errorf("error getting account for update: %w", err) + } + + if account.Password != "" { + // Hash password with bcrypt + hashedPassword, err := bcrypt.GenerateFromPassword([]byte(account.Password), 10) + if err != nil { + return nil, fmt.Errorf("error hashing provided password: %w", err) + } + storedAccount.Password = string(hashedPassword) + } + + if account.Username != "" { + storedAccount.Username = account.Username } - claims := jwt.MapClaims{ - "account": account.ToDTO(), - "exp": expiration.UTC().Unix(), + if account.Owner != nil { + storedAccount.Owner = *account.Owner } - token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) + if account.Config != nil { + storedAccount.Config = *account.Config + } + + // Save updated account + err = d.deps.Database.UpdateAccount(ctx, *storedAccount) + if errors.Is(err, database.ErrAlreadyExists) { + return nil, model.ErrAlreadyExists + } + + if err != nil { + return nil, fmt.Errorf("error updating account: %w", err) + } - t, err := token.SignedString(d.deps.Config.Http.SecretKey) + // Get updated account from database + updatedAccount, _, err := d.deps.Database.GetAccount(ctx, account.ID) if err != nil { - d.deps.Log.WithError(err).Error("error signing token") + return nil, fmt.Errorf("error getting updated account: %w", err) } - return t, err + account = updatedAccount.ToDTO() + + return &account, nil } -func NewAccountsDomain(deps *dependencies.Dependencies) *AccountsDomain { +func NewAccountsDomain(deps *dependencies.Dependencies) model.AccountsDomain { return &AccountsDomain{ deps: deps, } diff --git a/internal/domains/accounts_test.go b/internal/domains/accounts_test.go index a32bde483..004e93644 100644 --- a/internal/domains/accounts_test.go +++ b/internal/domains/accounts_test.go @@ -2,118 +2,162 @@ package domains_test import ( "context" + "fmt" "testing" "time" - "github.com/go-shiori/shiori/internal/domains" "github.com/go-shiori/shiori/internal/model" "github.com/go-shiori/shiori/internal/testutil" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" ) -func TestAccountsDomainParseToken(t *testing.T) { - ctx := context.TODO() +func TestAccountDomainsListAccounts(t *testing.T) { logger := logrus.New() - _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) - domain := domains.NewAccountsDomain(deps) + _, deps := testutil.GetTestConfigurationAndDependencies(t, context.TODO(), logger) - t.Run("valid token", func(t *testing.T) { - // Create a valid token - token, err := domain.CreateTokenForAccount( - testutil.GetValidAccount(), - time.Now().Add(time.Hour*1), - ) + t.Run("empty", func(t *testing.T) { + accounts, err := deps.Domains.Accounts.ListAccounts(context.Background()) require.NoError(t, err) + require.Empty(t, accounts) + }) + + t.Run("some accounts", func(t *testing.T) { + for i := 0; i < 3; i++ { + _, err := deps.Domains.Accounts.CreateAccount(context.TODO(), model.AccountDTO{ + Username: fmt.Sprintf("user%d", i), + Password: fmt.Sprintf("password%d", i), + }) + require.NoError(t, err) + } - claims, err := domain.ParseToken(token) + accounts, err := deps.Domains.Accounts.ListAccounts(context.Background()) require.NoError(t, err) - require.NotNil(t, claims) - require.Equal(t, 99, claims.Account.ID) + require.Len(t, accounts, 3) + require.Equal(t, "", accounts[0].Password) }) +} - t.Run("invalid token", func(t *testing.T) { - claims, err := domain.ParseToken("invalid-token") +func TestAccountDomainCreateAccount(t *testing.T) { + logger := logrus.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, context.TODO(), logger) + + t.Run("create account", func(t *testing.T) { + acc, err := deps.Domains.Accounts.CreateAccount(context.TODO(), model.AccountDTO{ + Username: "user", + Password: "password", + Owner: model.Ptr(true), + Config: &model.UserConfig{ + Theme: "dark", + }, + }) + require.NoError(t, err) + require.NotZero(t, acc.ID) + require.Equal(t, "user", acc.Username) + require.Equal(t, "dark", acc.Config.Theme) + }) + + t.Run("create account with empty username", func(t *testing.T) { + _, err := deps.Domains.Accounts.CreateAccount(context.TODO(), model.AccountDTO{ + Username: "", + Password: "password", + }) + require.Error(t, err) + _, isValidationErr := err.(model.ValidationError) + require.True(t, isValidationErr) + }) + + t.Run("create account with empty password", func(t *testing.T) { + _, err := deps.Domains.Accounts.CreateAccount(context.TODO(), model.AccountDTO{ + Username: "user", + Password: "", + }) require.Error(t, err) - require.Nil(t, claims) + _, isValidationErr := err.(model.ValidationError) + require.True(t, isValidationErr) }) } -func TestAccountsDomainCheckToken(t *testing.T) { - ctx := context.TODO() +func TestAccountDomainUpdateAccount(t *testing.T) { logger := logrus.New() - _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) - domain := domains.NewAccountsDomain(deps) + _, deps := testutil.GetTestConfigurationAndDependencies(t, context.TODO(), logger) - t.Run("valid token", func(t *testing.T) { - // Create a valid token - token, err := domain.CreateTokenForAccount( - testutil.GetValidAccount(), - time.Now().Add(time.Hour*1), - ) + t.Run("update account", func(t *testing.T) { + acc, err := deps.Domains.Accounts.CreateAccount(context.TODO(), model.AccountDTO{ + Username: "user", + Password: "password", + }) require.NoError(t, err) - acc, err := domain.CheckToken(ctx, token) + acc, err = deps.Domains.Accounts.UpdateAccount(context.TODO(), model.AccountDTO{ + ID: acc.ID, + Username: "user2", + Password: "password2", + Owner: model.Ptr(true), + Config: &model.UserConfig{ + Theme: "light", + }, + }) require.NoError(t, err) - require.NotNil(t, acc) - require.Equal(t, 99, acc.ID) + require.Equal(t, "user2", acc.Username) + require.Equal(t, "light", acc.Config.Theme) }) - t.Run("expired token", func(t *testing.T) { - // Create an expired token - token, err := domain.CreateTokenForAccount( - testutil.GetValidAccount(), - time.Now().Add(time.Hour*-1), - ) + t.Run("update non-existing account", func(t *testing.T) { + _, err := deps.Domains.Accounts.UpdateAccount(context.TODO(), model.AccountDTO{ + ID: 999, + Username: "user", + Password: "password", + }) + require.Error(t, err) + require.ErrorIs(t, err, model.ErrNotFound) + }) + + t.Run("try to update with no changes", func(t *testing.T) { + acc, err := deps.Domains.Accounts.CreateAccount(context.TODO(), model.AccountDTO{ + Username: "user", + Password: "password", + }) require.NoError(t, err) - acc, err := domain.CheckToken(ctx, token) + _, err = deps.Domains.Accounts.UpdateAccount(context.TODO(), model.AccountDTO{ + ID: acc.ID, + }) require.Error(t, err) - require.Nil(t, acc) + _, isValidationErr := err.(model.ValidationError) + require.True(t, isValidationErr) }) } -func TestAccountsDomainGetAccountFromCredentials(t *testing.T) { - ctx := context.TODO() +func TestAccountDomainDeleteAccount(t *testing.T) { logger := logrus.New() - _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) - domain := domains.NewAccountsDomain(deps) + _, deps := testutil.GetTestConfigurationAndDependencies(t, context.TODO(), logger) - require.NoError(t, deps.Database.SaveAccount(ctx, model.Account{ - Username: "test", - Password: "test", - })) + t.Run("delete account", func(t *testing.T) { + acc, err := deps.Domains.Accounts.CreateAccount(context.TODO(), model.AccountDTO{ + Username: "user", + Password: "password", + }) + require.NoError(t, err) - t.Run("valid credentials", func(t *testing.T) { - acc, err := domain.GetAccountFromCredentials(ctx, "test", "test") + err = deps.Domains.Accounts.DeleteAccount(context.TODO(), int(acc.ID)) require.NoError(t, err) - require.NotNil(t, acc) - require.Equal(t, "test", acc.Username) - }) - t.Run("invalid credentials", func(t *testing.T) { - acc, err := domain.GetAccountFromCredentials(ctx, "test", "invalid") - require.Error(t, err) - require.Nil(t, acc) + accounts, err := deps.Domains.Accounts.ListAccounts(context.Background()) + require.NoError(t, err) + require.Empty(t, accounts) }) - t.Run("invalid username", func(t *testing.T) { - acc, err := domain.GetAccountFromCredentials(ctx, "nope", "invalid") + t.Run("delete non-existing account", func(t *testing.T) { + err := deps.Domains.Accounts.DeleteAccount(context.TODO(), 999) require.Error(t, err) - require.Nil(t, acc) + require.ErrorIs(t, err, model.ErrNotFound) }) -} - -func TestAccountsDomainCreateTokenForAccount(t *testing.T) { - ctx := context.TODO() - logger := logrus.New() - _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) - domain := domains.NewAccountsDomain(deps) - t.Run("valid account", func(t *testing.T) { - token, err := domain.CreateTokenForAccount( - testutil.GetValidAccount(), + account := testutil.GetValidAccount().ToDTO() + token, err := deps.Domains.Auth.CreateTokenForAccount( + &account, time.Now().Add(time.Hour*1), ) require.NoError(t, err) @@ -121,7 +165,7 @@ func TestAccountsDomainCreateTokenForAccount(t *testing.T) { }) t.Run("nil account", func(t *testing.T) { - token, err := domain.CreateTokenForAccount( + token, err := deps.Domains.Auth.CreateTokenForAccount( nil, time.Now().Add(time.Hour*1), ) @@ -130,16 +174,17 @@ func TestAccountsDomainCreateTokenForAccount(t *testing.T) { }) t.Run("token expiration is valid", func(t *testing.T) { + ctx := context.TODO() + account := testutil.GetValidAccount().ToDTO() expiration := time.Now().Add(time.Hour * 9) - token, err := domain.CreateTokenForAccount( - testutil.GetValidAccount(), + token, err := deps.Domains.Auth.CreateTokenForAccount( + &account, expiration, ) require.NoError(t, err) require.NotEmpty(t, token) - claims, err := domain.ParseToken(token) + tokenAccount, err := deps.Domains.Auth.CheckToken(ctx, token) require.NoError(t, err) - require.NotNil(t, claims) - require.Equal(t, expiration.Unix(), claims.ExpiresAt.Time.Unix()) + require.NotNil(t, tokenAccount) }) } diff --git a/internal/domains/auth.go b/internal/domains/auth.go new file mode 100644 index 000000000..5e3869af6 --- /dev/null +++ b/internal/domains/auth.go @@ -0,0 +1,94 @@ +package domains + +import ( + "context" + "fmt" + "time" + + "github.com/go-shiori/shiori/internal/database" + "github.com/go-shiori/shiori/internal/dependencies" + "github.com/go-shiori/shiori/internal/model" + "github.com/golang-jwt/jwt/v5" + "golang.org/x/crypto/bcrypt" +) + +type AuthDomain struct { + deps *dependencies.Dependencies +} + +type JWTClaim struct { + jwt.RegisteredClaims + + Account *model.AccountDTO +} + +func (d *AuthDomain) CheckToken(ctx context.Context, userJWT string) (*model.AccountDTO, error) { + token, err := jwt.ParseWithClaims(userJWT, &JWTClaim{}, func(token *jwt.Token) (interface{}, error) { + // Validate algorithm + if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok { + return nil, fmt.Errorf("Unexpected signing method: %v", token.Header["alg"]) + } + + return d.deps.Config.Http.SecretKey, nil + }) + if err != nil { + return nil, fmt.Errorf("error parsing token: %w", err) + } + + if claims, ok := token.Claims.(*JWTClaim); ok && token.Valid { + if claims.Account.ID > 0 { + return claims.Account, nil + } + + return claims.Account, nil + } + return nil, fmt.Errorf("error obtaining user from JWT claims") +} + +func (d *AuthDomain) GetAccountFromCredentials(ctx context.Context, username, password string) (*model.AccountDTO, error) { + accounts, err := d.deps.Database.ListAccounts(ctx, database.ListAccountsOptions{ + Username: username, + WithPassword: true, + }) + if err != nil { + return nil, fmt.Errorf("username or password do not match") + } + + if len(accounts) != 1 { + return nil, fmt.Errorf("username or password do not match") + } + + account := accounts[0] + + if err := bcrypt.CompareHashAndPassword([]byte(account.Password), []byte(password)); err != nil { + return nil, fmt.Errorf("username or password do not match") + } + + return model.Ptr(account.ToDTO()), nil +} + +func (d *AuthDomain) CreateTokenForAccount(account *model.AccountDTO, expiration time.Time) (string, error) { + if account == nil { + return "", fmt.Errorf("account is nil") + } + + claims := jwt.MapClaims{ + "account": account, + "exp": expiration.UTC().Unix(), + } + + token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) + + t, err := token.SignedString(d.deps.Config.Http.SecretKey) + if err != nil { + d.deps.Log.WithError(err).Error("error signing token") + } + + return t, err +} + +func NewAuthDomain(deps *dependencies.Dependencies) *AuthDomain { + return &AuthDomain{ + deps: deps, + } +} diff --git a/internal/domains/auth_test.go b/internal/domains/auth_test.go new file mode 100644 index 000000000..751ec03c2 --- /dev/null +++ b/internal/domains/auth_test.go @@ -0,0 +1,118 @@ +package domains_test + +import ( + "context" + "testing" + "time" + + "github.com/go-shiori/shiori/internal/domains" + "github.com/go-shiori/shiori/internal/model" + "github.com/go-shiori/shiori/internal/testutil" + "github.com/golang-jwt/jwt/v5" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" +) + +func TestAuthDomainCheckToken(t *testing.T) { + ctx := context.TODO() + logger := logrus.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + domain := domains.NewAuthDomain(deps) + + t.Run("valid token", func(t *testing.T) { + // Create a valid token + account := testutil.GetValidAccount().ToDTO() + token, err := domain.CreateTokenForAccount( + &account, + time.Now().Add(time.Hour*1), + ) + require.NoError(t, err) + + acc, err := domain.CheckToken(ctx, token) + require.NoError(t, err) + require.NotNil(t, acc) + require.Equal(t, model.DBID(99), acc.ID) + }) + + t.Run("expired token", func(t *testing.T) { + // Create an expired token + account := testutil.GetValidAccount().ToDTO() + token, err := domain.CreateTokenForAccount( + &account, + time.Now().Add(time.Hour*-1), + ) + require.NoError(t, err) + + acc, err := domain.CheckToken(ctx, token) + require.Error(t, err) + require.Nil(t, acc) + }) + + t.Run("invalid token", func(t *testing.T) { + claims, err := domain.CheckToken(ctx, "invalid-token") + require.Error(t, err) + require.Nil(t, claims) + }) + + t.Run("nil account", func(t *testing.T) { + token, err := domain.CreateTokenForAccount(nil, time.Now().Add(time.Hour)) + require.Error(t, err) + require.Empty(t, token) + require.Contains(t, err.Error(), "account is nil") + }) +} + +func TestAuthDomainCheckTokenInvalidMethod(t *testing.T) { + ctx := context.TODO() + logger := logrus.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + domain := domains.NewAuthDomain(deps) + + // Create a token with an unsupported signing method + account := testutil.GetValidAccount().ToDTO() + claims := jwt.MapClaims{ + "account": account, + "exp": time.Now().Add(time.Hour).UTC().Unix(), + } + token := jwt.NewWithClaims(jwt.SigningMethodNone, claims) + tokenString, err := token.SignedString(jwt.UnsafeAllowNoneSignatureType) + require.NoError(t, err) + + // Try to verify the token + acc, err := domain.CheckToken(ctx, tokenString) + require.Error(t, err) + require.Nil(t, acc) + require.Contains(t, err.Error(), "Unexpected signing method") +} + +func TestAuthDomainGetAccountFromCredentials(t *testing.T) { + ctx := context.TODO() + logger := logrus.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + domain := domains.NewAuthDomain(deps) + + _, err := deps.Domains.Accounts.CreateAccount(ctx, model.AccountDTO{ + Username: "test", + Password: "test", + }) + require.NoError(t, err) + + t.Run("valid credentials", func(t *testing.T) { + acc, err := domain.GetAccountFromCredentials(ctx, "test", "test") + require.NoError(t, err) + require.NotNil(t, acc) + require.Equal(t, "test", acc.Username) + }) + + t.Run("invalid credentials", func(t *testing.T) { + acc, err := domain.GetAccountFromCredentials(ctx, "test", "invalid") + require.Error(t, err) + require.Nil(t, acc) + }) + + t.Run("invalid username", func(t *testing.T) { + acc, err := domain.GetAccountFromCredentials(ctx, "nope", "invalid") + require.Error(t, err) + require.Nil(t, acc) + }) +} diff --git a/internal/http/context/auth.go b/internal/http/context/auth.go index d11e69e30..214ebcf49 100644 --- a/internal/http/context/auth.go +++ b/internal/http/context/auth.go @@ -8,9 +8,9 @@ func (c *Context) UserIsLogged() bool { return exists } -func (c *Context) GetAccount() *model.Account { +func (c *Context) GetAccount() *model.AccountDTO { if c.account == nil && c.UserIsLogged() { - c.account = c.MustGet(model.ContextAccountKey).(*model.Account) + c.account = c.MustGet(model.ContextAccountKey).(*model.AccountDTO) } return c.account diff --git a/internal/http/context/auth_test.go b/internal/http/context/auth_test.go index e7bc7e0e5..37bcfbf8e 100644 --- a/internal/http/context/auth_test.go +++ b/internal/http/context/auth_test.go @@ -22,7 +22,7 @@ func TestUserIsLogged(t *testing.T) { func TestGetAccount(t *testing.T) { t.Run("test get account (logged in)", func(t *testing.T) { - account := model.Account{ + account := model.AccountDTO{ Username: "shiori", } c := New() diff --git a/internal/http/context/context.go b/internal/http/context/context.go index d8219f259..1d0c84b01 100644 --- a/internal/http/context/context.go +++ b/internal/http/context/context.go @@ -9,7 +9,7 @@ import ( type Context struct { *gin.Context - account *model.Account + account *model.AccountDTO } // NewContextFromGin returns a new Context instance from gin.Context diff --git a/internal/http/middleware/auth.go b/internal/http/middleware/auth.go index ee646d59e..642317933 100644 --- a/internal/http/middleware/auth.go +++ b/internal/http/middleware/auth.go @@ -21,7 +21,7 @@ func AuthMiddleware(deps *dependencies.Dependencies) gin.HandlerFunc { token = getTokenFromCookie(c) } - account, err := deps.Domains.Auth.CheckToken(c, token) + account, err := deps.Domains.Auth.CheckToken(c.Request.Context(), token) if err != nil { deps.Log.WithError(err).Error("Failed to check token") return @@ -43,6 +43,19 @@ func AuthenticationRequired() gin.HandlerFunc { } } +// AdminRequired provides a middleware that checks if the user is logged in and is an admin, returning +// a 403 error if not. +func AdminRequired() gin.HandlerFunc { + return func(ctx *gin.Context) { + c := context.NewContextFromGin(ctx) + account := c.GetAccount() + if account == nil || !account.IsOwner() { + response.SendError(ctx, http.StatusForbidden, nil) + return + } + } +} + // getTokenFromHeader returns the token from the Authorization header, if any. func getTokenFromHeader(c *gin.Context) string { authorization := c.GetHeader(model.AuthorizationHeader) diff --git a/internal/http/middleware/auth_test.go b/internal/http/middleware/auth_test.go index fbc9a2e8e..de83e85eb 100644 --- a/internal/http/middleware/auth_test.go +++ b/internal/http/middleware/auth_test.go @@ -61,8 +61,8 @@ func TestAuthMiddleware(t *testing.T) { }) t.Run("test authorization header", func(t *testing.T) { - account := testutil.GetValidAccount() - token, err := deps.Domains.Auth.CreateTokenForAccount(account, time.Now().Add(time.Minute)) + account := testutil.GetValidAccount().ToDTO() + token, err := deps.Domains.Auth.CreateTokenForAccount(&account, time.Now().Add(time.Minute)) require.NoError(t, err) w := httptest.NewRecorder() c, _ := gin.CreateTestContext(w) @@ -74,8 +74,8 @@ func TestAuthMiddleware(t *testing.T) { }) t.Run("test authorization cookie", func(t *testing.T) { - account := testutil.GetValidAccount() - token, err := deps.Domains.Auth.CreateTokenForAccount(account, time.Now().Add(time.Minute)) + account := model.AccountDTO{Username: "shiori"} + token, err := deps.Domains.Auth.CreateTokenForAccount(&account, time.Now().Add(time.Minute)) require.NoError(t, err) w := httptest.NewRecorder() c, _ := gin.CreateTestContext(w) @@ -90,3 +90,49 @@ func TestAuthMiddleware(t *testing.T) { require.True(t, exists) }) } + +func TestAdminRequiredMiddleware(t *testing.T) { + t.Run("test unauthorized", func(t *testing.T) { + g := testutil.NewGin() + g.Use(AdminRequired()) + g.Handle("GET", "/", func(c *gin.Context) { + response.Send(c, http.StatusOK, nil) + }) + w := testutil.PerformRequest(g, "GET", "/") + require.Equal(t, http.StatusForbidden, w.Code) + // This ensures we are aborting the request and not sending more data + require.Equal(t, `{"ok":false,"message":null}`, w.Body.String()) + }) + + t.Run("test user but not admin", func(t *testing.T) { + g := testutil.NewGin() + // Fake a logged in admin in the context, which is the way the AuthMiddleware works. + g.Use(func(ctx *gin.Context) { + ctx.Set(model.ContextAccountKey, &model.AccountDTO{ + Owner: model.Ptr(false), + }) + }) + g.Use(AdminRequired()) + g.GET("/", func(c *gin.Context) { + c.Status(http.StatusOK) + }) + w := testutil.PerformRequest(g, "GET", "/") + require.Equal(t, http.StatusForbidden, w.Code) + }) + + t.Run("test authorized", func(t *testing.T) { + g := testutil.NewGin() + // Fake a logged in admin in the context, which is the way the AuthMiddleware works. + g.Use(func(ctx *gin.Context) { + ctx.Set(model.ContextAccountKey, &model.AccountDTO{ + Owner: model.Ptr(true), + }) + }) + g.Use(AdminRequired()) + g.GET("/", func(c *gin.Context) { + c.Status(http.StatusOK) + }) + w := testutil.PerformRequest(g, "GET", "/") + require.Equal(t, http.StatusOK, w.Code) + }) +} diff --git a/internal/http/routes/api/v1/accounts.go b/internal/http/routes/api/v1/accounts.go new file mode 100644 index 000000000..efbebb0da --- /dev/null +++ b/internal/http/routes/api/v1/accounts.go @@ -0,0 +1,192 @@ +package api_v1 + +import ( + "errors" + "net/http" + "strconv" + + "github.com/gin-gonic/gin" + "github.com/go-shiori/shiori/internal/dependencies" + "github.com/go-shiori/shiori/internal/http/middleware" + "github.com/go-shiori/shiori/internal/http/response" + "github.com/go-shiori/shiori/internal/model" + "github.com/sirupsen/logrus" +) + +type AccountsAPIRoutes struct { + logger *logrus.Logger + deps *dependencies.Dependencies +} + +func (r *AccountsAPIRoutes) Setup(g *gin.RouterGroup) model.Routes { + g.Use(middleware.AdminRequired()) + g.GET("/", r.listHandler) + g.POST("/", r.createHandler) + g.DELETE("/:id", r.deleteHandler) + g.PATCH("/:id", r.updateHandler) + + return r +} + +func NewAccountsAPIRoutes(logger *logrus.Logger, deps *dependencies.Dependencies) *AccountsAPIRoutes { + return &AccountsAPIRoutes{ + logger: logger, + deps: deps, + } +} + +// listHandler godoc +// +// @Summary List accounts +// @Description List accounts +// @Tags accounts +// @Produce json +// @Success 200 {array} model.AccountDTO +// @Failure 500 {string} string "Internal Server Error" +// @Router /api/v1/accounts [get] +func (r *AccountsAPIRoutes) listHandler(c *gin.Context) { + accounts, err := r.deps.Domains.Accounts.ListAccounts(c.Request.Context()) + if err != nil { + r.logger.WithError(err).Error("error getting accounts") + c.AbortWithStatus(http.StatusInternalServerError) + return + } + + response.Send(c, http.StatusOK, accounts) +} + +type createAccountPayload struct { + Username string `json:"username"` + Password string `json:"password"` + Owner bool `json:"owner"` +} + +func (p *createAccountPayload) ToAccountDTO() model.AccountDTO { + return model.AccountDTO{ + Username: p.Username, + Password: p.Password, + Owner: &p.Owner, + } +} + +// createHandler godoc +// +// @Summary Create an account +// @Tags accounts +// @Produce json +// @Success 201 {array} model.AccountDTO +// @Failure 400 {string} string "Bad Request" +// @Failure 500 {string} string "Internal Server Error" +// @Router /api/v1/accounts [post] +func (r *AccountsAPIRoutes) createHandler(c *gin.Context) { + var payload createAccountPayload + if err := c.ShouldBindJSON(&payload); err != nil { + r.logger.WithError(err).Error("error parsing json") + response.SendError(c, http.StatusBadRequest, "invalid json") + return + } + + account, err := r.deps.Domains.Accounts.CreateAccount(c.Request.Context(), payload.ToAccountDTO()) + if err, isValidationErr := err.(model.ValidationError); isValidationErr { + response.SendError(c, http.StatusBadRequest, err.Error()) + return + } + + if errors.Is(err, model.ErrAlreadyExists) { + response.SendError(c, http.StatusConflict, "account already exists") + return + } + + if err != nil { + r.logger.WithError(err).Error("error creating account") + c.AbortWithStatus(http.StatusInternalServerError) + return + } + + response.Send(c, http.StatusCreated, account) +} + +// deleteHandler godoc +// +// @Summary Delete an account +// @Tags accounts +// @Produce json +// @Success 204 {string} string "No content" +// @Failure 500 {string} string "Internal Server Error" +// @Router /api/v1/accounts/{id} [delete] +func (r *AccountsAPIRoutes) deleteHandler(c *gin.Context) { + idParam := c.Param("id") + + id, err := strconv.Atoi(idParam) + if err != nil { + r.logger.WithError(err).Error("error parsing id") + response.SendError(c, http.StatusBadRequest, "invalid id") + return + } + + err = r.deps.Domains.Accounts.DeleteAccount(c.Request.Context(), id) + if errors.Is(err, model.ErrNotFound) { + response.SendError(c, http.StatusNotFound, "account not found") + return + } + + if err != nil { + r.logger.WithError(err).Error("error deleting account") + c.AbortWithStatus(http.StatusInternalServerError) + return + } + + response.Send(c, http.StatusNoContent, nil) +} + +// updateHandler godoc +// +// @Summary Update an account +// @Tags accounts +// @Produce json +// @Success 200 {array} updateAccountPayload +// @Failure 400 {string} string "Bad Request" +// @Failure 500 {string} string "Internal Server Error" +// @Router /api/v1/accounts/{id} [patch] +func (r *AccountsAPIRoutes) updateHandler(c *gin.Context) { + accountID, err := strconv.Atoi(c.Param("id")) + if err != nil { + r.logger.WithError(err).Error("error parsing id") + response.SendError(c, http.StatusBadRequest, "invalid id") + return + } + + var payload updateAccountPayload + if err := c.ShouldBindJSON(&payload); err != nil { + r.logger.WithError(err).Error("error binding json") + c.AbortWithStatus(http.StatusBadRequest) + return + } + + // Not checking the old password since admins/owners can update any account + updatedAccount := payload.ToAccountDTO() + updatedAccount.ID = model.DBID(accountID) + + account, err := r.deps.Domains.Accounts.UpdateAccount(c.Request.Context(), updatedAccount) + if errors.Is(err, model.ErrNotFound) { + response.SendError(c, http.StatusNotFound, "account not found") + return + } + if errors.Is(err, model.ErrAlreadyExists) { + response.SendError(c, http.StatusConflict, "account already exists") + return + } + + if err, isValidationErr := err.(model.ValidationError); isValidationErr { + response.SendError(c, http.StatusBadRequest, err.Error()) + return + } + + if err != nil { + r.logger.WithError(err).Error("error updating account") + c.AbortWithStatus(http.StatusInternalServerError) + return + } + + response.Send(c, http.StatusOK, account) +} diff --git a/internal/http/routes/api/v1/accounts_test.go b/internal/http/routes/api/v1/accounts_test.go new file mode 100644 index 000000000..a928f1eb7 --- /dev/null +++ b/internal/http/routes/api/v1/accounts_test.go @@ -0,0 +1,609 @@ +package api_v1 + +import ( + "context" + "encoding/json" + "net/http" + "strconv" + "testing" + "time" + + "github.com/gin-gonic/gin" + "github.com/go-shiori/shiori/internal/http/middleware" + "github.com/go-shiori/shiori/internal/model" + "github.com/go-shiori/shiori/internal/testutil" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" +) + +func TestAccountRouteAuthorization(t *testing.T) { + logger := logrus.New() + ctx := context.TODO() + + t.Run("require authentication", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + + w := testutil.PerformRequest(g, "GET", "/") + require.Equal(t, http.StatusForbidden, w.Code) + + response, err := testutil.NewTestResponseFromReader(w.Body) + require.NoError(t, err) + + response.AssertNotOk(t) + }) + + t.Run("require admin user", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + + account, err := deps.Domains.Accounts.CreateAccount(ctx, model.AccountDTO{ + Username: "gopher", + Password: "shiori", + }) + require.NoError(t, err) + + token, err := deps.Domains.Auth.CreateTokenForAccount(account, time.Now().Add(time.Hour)) + require.NoError(t, err) + + w := testutil.PerformRequest(g, "GET", "/", testutil.WithAuthToken(token)) + require.Equal(t, http.StatusForbidden, w.Code) + + response, err := testutil.NewTestResponseFromReader(w.Body) + require.NoError(t, err) + + response.AssertNotOk(t) + }) +} + +func TestAccountList(t *testing.T) { + logger := logrus.New() + ctx := context.TODO() + + t.Run("database error", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + + // Force DB error by clearing the deps + deps.Database.ReaderDB().Close() + + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + w := testutil.PerformRequest(g, "GET", "/", testutil.WithAuthToken(token)) + require.Equal(t, http.StatusInternalServerError, w.Code) + }) + t.Run("return account", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + w := testutil.PerformRequest(g, "GET", "/", testutil.WithAuthToken(token)) + require.Equal(t, http.StatusOK, w.Code) + + response, err := testutil.NewTestResponseFromReader(w.Body) + require.NoError(t, err) + + response.AssertOk(t) + require.Len(t, response.Response.Message, 1) + }) + + t.Run("return accounts", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + + _, err = deps.Domains.Accounts.CreateAccount(ctx, model.AccountDTO{ + Username: "gopher", + Password: "shiori", + }) + require.NoError(t, err) + + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + w := testutil.PerformRequest(g, "GET", "/", testutil.WithAuthToken(token)) + require.Equal(t, http.StatusOK, w.Code) + + response, err := testutil.NewTestResponseFromReader(w.Body) + require.NoError(t, err) + + response.AssertOk(t) + require.Len(t, response.Response.Message, 2) + }) + +} + +func TestAccountCreate(t *testing.T) { + logger := logrus.New() + ctx := context.TODO() + + t.Run("database error", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + + // Force DB error by clearing the deps + deps.Database.WriterDB().Close() + + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + + w := testutil.PerformRequest(g, "POST", "/", testutil.WithBody(`{ + "username": "gopher", + "password": "shiori" + }`), testutil.WithAuthToken(token)) + require.Equal(t, http.StatusInternalServerError, w.Code) + }) + + t.Run("duplicate username", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + + // Create first account + _, err = deps.Domains.Accounts.CreateAccount(ctx, model.AccountDTO{ + Username: "gopher", + Password: "shiori", + }) + require.NoError(t, err) + + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + + // Try to create account with same username + w := testutil.PerformRequest(g, "POST", "/", testutil.WithBody(`{ + "username": "gopher", + "password": "shiori" + }`), testutil.WithAuthToken(token)) + require.Equal(t, http.StatusConflict, w.Code) + + response, err := testutil.NewTestResponseFromReader(w.Body) + require.NoError(t, err) + response.AssertNotOk(t) + }) + + t.Run("create owner account", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + + w := testutil.PerformRequest(g, "POST", "/", testutil.WithBody(`{ + "username": "gopher", + "password": "shiori", + "owner": true + }`), testutil.WithAuthToken(token)) + require.Equal(t, http.StatusCreated, w.Code) + + response, err := testutil.NewTestResponseFromReader(w.Body) + require.NoError(t, err) + response.AssertOk(t) + + require.NoError(t, err) + require.True(t, response.Response.Message.(map[string]interface{})["owner"].(bool)) + }) + + t.Run("invalid payload", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + + w := testutil.PerformRequest(g, "POST", "/", testutil.WithBody(`invalid`), testutil.WithAuthToken(token)) + require.Equal(t, http.StatusBadRequest, w.Code) + + response, err := testutil.NewTestResponseFromReader(w.Body) + require.NoError(t, err) + + response.AssertNotOk(t) + }) + + t.Run("create account ok", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + + w := testutil.PerformRequest(g, "POST", "/", testutil.WithBody(`{ + "username": "gopher", + "password": "shiori" + }`), testutil.WithAuthToken(token)) + require.Equal(t, http.StatusCreated, w.Code) + + response, err := testutil.NewTestResponseFromReader(w.Body) + require.NoError(t, err) + + response.AssertOk(t) + + }) + + t.Run("empty username", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + + w := testutil.PerformRequest(g, "POST", "/", testutil.WithBody(`{ + "username": "", + "password": "shiori" + }`), testutil.WithAuthToken(token)) + require.Equal(t, http.StatusBadRequest, w.Code) + + response, err := testutil.NewTestResponseFromReader(w.Body) + require.NoError(t, err) + + response.AssertNotOk(t) + }) + + t.Run("empty password", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + + w := testutil.PerformRequest(g, "POST", "/", testutil.WithBody(`{ + "username": "gopher", + "password": "" + }`), testutil.WithAuthToken(token)) + require.Equal(t, http.StatusBadRequest, w.Code) + + response, err := testutil.NewTestResponseFromReader(w.Body) + require.NoError(t, err) + + response.AssertNotOk(t) + }) +} + +func TestAccountDelete(t *testing.T) { + logger := logrus.New() + ctx := context.TODO() + + t.Run("database error", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + + account, err := deps.Domains.Accounts.CreateAccount(ctx, model.AccountDTO{ + Username: "gopher", + Password: "shiori", + }) + require.NoError(t, err) + + // Force DB error by clearing the deps + deps.Database.WriterDB().Close() + + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + w := testutil.PerformRequest(g, "DELETE", "/"+strconv.Itoa(int(account.ID)), testutil.WithAuthToken(token)) + require.Equal(t, http.StatusInternalServerError, w.Code) + }) + + t.Run("delete owner account", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + + owner := true + account, err := deps.Domains.Accounts.CreateAccount(ctx, model.AccountDTO{ + Username: "gopher", + Password: "shiori", + Owner: &owner, + }) + require.NoError(t, err) + + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + w := testutil.PerformRequest(g, "DELETE", "/"+strconv.Itoa(int(account.ID)), testutil.WithAuthToken(token)) + require.Equal(t, http.StatusNoContent, w.Code) + }) + + t.Run("success", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + + account, err := deps.Domains.Accounts.CreateAccount(ctx, model.AccountDTO{ + Username: "gopher", + Password: "shiori", + }) + require.NoError(t, err) + + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + w := testutil.PerformRequest(g, "DELETE", "/"+strconv.Itoa(int(account.ID)), testutil.WithAuthToken(token)) + require.Equal(t, http.StatusNoContent, w.Code) + }) + + t.Run("account not found", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + w := testutil.PerformRequest(g, "DELETE", "/99", testutil.WithAuthToken(token)) + require.Equal(t, http.StatusNotFound, w.Code) + }) + + t.Run("invalid id", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + w := testutil.PerformRequest(g, "DELETE", "/invalid", testutil.WithAuthToken(token)) + require.Equal(t, http.StatusBadRequest, w.Code) + }) +} + +func TestAccountUpdate(t *testing.T) { + logger := logrus.New() + ctx := context.TODO() + + t.Run("database error", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + + account, err := deps.Domains.Accounts.CreateAccount(ctx, model.AccountDTO{ + Username: "gopher", + Password: "shiori", + }) + require.NoError(t, err) + + // Close dataase connection to force error + deps.Database.ReaderDB().Close() + + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + + w := testutil.PerformRequest(g, "PATCH", "/"+strconv.Itoa(int(account.ID)), + testutil.WithBody(`{"username":"newname"}`), + testutil.WithAuthToken(token)) + require.Equal(t, http.StatusInternalServerError, w.Code) + }) + + t.Run("update to existing username", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + + // Create first account + _, err = deps.Domains.Accounts.CreateAccount(ctx, model.AccountDTO{ + Username: "gopher1", + Password: "shiori", + }) + require.NoError(t, err) + + // Create second account + account2, err := deps.Domains.Accounts.CreateAccount(ctx, model.AccountDTO{ + Username: "gopher2", + Password: "shiori", + }) + require.NoError(t, err) + + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + + // Try to update second account to first account's username + w := testutil.PerformRequest(g, "PATCH", "/"+strconv.Itoa(int(account2.ID)), + testutil.WithBody(`{"username":"gopher1"}`), + testutil.WithAuthToken(token)) + require.Equal(t, http.StatusConflict, w.Code) + }) + + t.Run("update with empty changes", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + + account, err := deps.Domains.Accounts.CreateAccount(ctx, model.AccountDTO{ + Username: "gopher", + Password: "shiori", + }) + require.NoError(t, err) + + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + + w := testutil.PerformRequest(g, "PATCH", "/"+strconv.Itoa(int(account.ID)), + testutil.WithBody(`{}`), + testutil.WithAuthToken(token)) + require.Equal(t, http.StatusBadRequest, w.Code) + }) + for _, tc := range []struct { + name string + payload updateAccountPayload + code int + cmp func(t *testing.T, initial *model.AccountDTO, payload updateAccountPayload, storedAccount model.Account) + }{ + { + name: "success change username", + payload: updateAccountPayload{ + Username: "gopher2", + }, + code: http.StatusOK, + cmp: func(t *testing.T, initial *model.AccountDTO, payload updateAccountPayload, storedAccount model.Account) { + require.Equal(t, payload.Username, storedAccount.Username) + }, + }, + { + name: "success change password", + payload: updateAccountPayload{ + OldPassword: "gopher", + NewPassword: "gopher2", + }, + code: http.StatusOK, + cmp: func(t *testing.T, initial *model.AccountDTO, payload updateAccountPayload, storedAccount model.Account) { + require.NotEqual(t, initial.Password, storedAccount.Password) + }, + }, + { + name: "success change owner", + payload: updateAccountPayload{ + Owner: model.Ptr(true), + }, + code: http.StatusOK, + cmp: func(t *testing.T, initial *model.AccountDTO, payload updateAccountPayload, storedAccount model.Account) { + require.Equal(t, *payload.Owner, storedAccount.Owner) + }, + }, + { + name: "change entire account", + payload: updateAccountPayload{ + Username: "gopher2", + NewPassword: "gopher2", + Owner: model.Ptr(true), + }, + code: http.StatusOK, + cmp: func(t *testing.T, initial *model.AccountDTO, payload updateAccountPayload, storedAccount model.Account) { + require.Equal(t, payload.Username, storedAccount.Username) + require.NotEqual(t, initial.Password, storedAccount.Password) + require.Equal(t, *payload.Owner, storedAccount.Owner) + }, + }, + { + name: "invalid update", + payload: updateAccountPayload{}, + code: http.StatusBadRequest, + cmp: func(t *testing.T, initial *model.AccountDTO, payload updateAccountPayload, storedAccount model.Account) { + }, + }, + } { + t.Run(tc.name, func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + + account, err := deps.Domains.Accounts.CreateAccount(ctx, model.AccountDTO{ + Username: "gopher", + Password: "shiori", + }) + require.NoError(t, err) + + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + + body, err := json.Marshal(tc.payload) + require.NoError(t, err) + + w := testutil.PerformRequest(g, "PATCH", "/"+strconv.Itoa(int(account.ID)), testutil.WithBody(string(body)), testutil.WithAuthToken(token)) + require.Equal(t, tc.code, w.Code) + + storedAccount, _, err := deps.Database.GetAccount(ctx, account.ID) + require.NoError(t, err) + + tc.cmp(t, account, tc.payload, *storedAccount) + }) + } + + t.Run("invalid payload", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + + account, err := deps.Domains.Accounts.CreateAccount(ctx, model.AccountDTO{ + Username: "gopher", + Password: "shiori", + }) + require.NoError(t, err) + + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + + w := testutil.PerformRequest(g, "PATCH", "/"+strconv.Itoa(int(account.ID)), testutil.WithBody(`invalid`), testutil.WithAuthToken(token)) + require.Equal(t, http.StatusBadRequest, w.Code) + }) + + t.Run("account not found", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + w := testutil.PerformRequest(g, "PATCH", "/99", testutil.WithAuthToken(token), testutil.WithBody(`{"username":"gopher"}`)) + require.Equal(t, http.StatusNotFound, w.Code) + }) + + t.Run("invalid id", func(t *testing.T) { + g := gin.New() + _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) + g.Use(middleware.AuthMiddleware(deps)) + _, token, err := testutil.NewAdminUser(deps) + require.NoError(t, err) + router := NewAccountsAPIRoutes(logger, deps) + router.Setup(g.Group("/")) + w := testutil.PerformRequest(g, "PATCH", "/invalid", testutil.WithAuthToken(token)) + require.Equal(t, http.StatusBadRequest, w.Code) + }) +} diff --git a/internal/http/routes/api/v1/api.go b/internal/http/routes/api/v1/api.go index c2c98e820..149f67dca 100644 --- a/internal/http/routes/api/v1/api.go +++ b/internal/http/routes/api/v1/api.go @@ -18,6 +18,7 @@ func (r *APIRoutes) Setup(g *gin.RouterGroup) model.Routes { r.handle(g, "/auth", NewAuthAPIRoutes(r.logger, r.deps, r.loginHandler)) r.handle(g, "/bookmarks", NewBookmarksAPIRoutes(r.logger, r.deps)) r.handle(g, "/tags", NewTagsPIRoutes(r.logger, r.deps)) + r.handle(g, "/accounts", NewAccountsAPIRoutes(r.logger, r.deps)) r.handle(g, "/system", NewSystemAPIRoutes(r.logger, r.deps)) return r diff --git a/internal/http/routes/api/v1/auth.go b/internal/http/routes/api/v1/auth.go index 3cfd57493..0bfeaf423 100644 --- a/internal/http/routes/api/v1/auth.go +++ b/internal/http/routes/api/v1/auth.go @@ -8,6 +8,7 @@ import ( "github.com/gin-gonic/gin" "github.com/go-shiori/shiori/internal/dependencies" "github.com/go-shiori/shiori/internal/http/context" + "github.com/go-shiori/shiori/internal/http/middleware" "github.com/go-shiori/shiori/internal/http/response" "github.com/go-shiori/shiori/internal/model" "github.com/sirupsen/logrus" @@ -20,10 +21,12 @@ type AuthAPIRoutes struct { } func (r *AuthAPIRoutes) Setup(group *gin.RouterGroup) model.Routes { - group.GET("/me", r.meHandler) group.POST("/login", r.loginHandler) + group.Use(middleware.AuthenticationRequired()) + group.GET("/me", r.meHandler) group.POST("/refresh", r.refreshHandler) group.PATCH("/account", r.updateHandler) + group.POST("/logout", r.logoutHandler) return r } @@ -49,10 +52,6 @@ type loginResponseMessage struct { Expiration int64 `json:"expires"` // Deprecated, used only for legacy APIs } -type settingRequestPayload struct { - Config model.UserConfig `json:"config"` -} - // loginHandler godoc // // @Summary Login to an account using username and password @@ -94,7 +93,7 @@ func (r *AuthAPIRoutes) loginHandler(c *gin.Context) { return } - sessionID, err := r.legacyLoginHandler(*account, expiration) + sessionID, err := r.legacyLoginHandler(account, expiration) if err != nil { r.logger.WithError(err).Error("failed execute legacy login handler") response.SendInternalServerError(c) @@ -119,14 +118,10 @@ func (r *AuthAPIRoutes) loginHandler(c *gin.Context) { // @Router /api/v1/auth/refresh [post] func (r *AuthAPIRoutes) refreshHandler(c *gin.Context) { ctx := context.NewContextFromGin(c) - if !ctx.UserIsLogged() { - response.SendError(c, http.StatusForbidden, nil) - return - } expiration := time.Now().Add(time.Hour * 72) - account, _ := c.Get(model.ContextAccountKey) - token, err := r.deps.Domains.Auth.CreateTokenForAccount(account.(*model.Account), expiration) + account := ctx.GetAccount() + token, err := r.deps.Domains.Auth.CreateTokenForAccount(account, expiration) if err != nil { response.SendInternalServerError(c) return @@ -148,47 +143,107 @@ func (r *AuthAPIRoutes) refreshHandler(c *gin.Context) { // @Router /api/v1/auth/me [get] func (r *AuthAPIRoutes) meHandler(c *gin.Context) { ctx := context.NewContextFromGin(c) - if !ctx.UserIsLogged() { - response.SendError(c, http.StatusForbidden, nil) - return + response.Send(c, http.StatusOK, ctx.GetAccount()) +} + +type updateAccountPayload struct { + OldPassword string `json:"old_password"` + NewPassword string `json:"new_password"` + Username string `json:"username"` + Owner *bool `json:"owner"` + Config *model.UserConfig `json:"config"` +} + +func (p *updateAccountPayload) IsValid() error { + if p.NewPassword != "" && p.OldPassword == "" { + return fmt.Errorf("To update the password the old one must be provided") } - response.Send(c, http.StatusOK, ctx.GetAccount()) + return nil +} + +func (p *updateAccountPayload) ToAccountDTO() model.AccountDTO { + account := model.AccountDTO{} + + if p.NewPassword != "" { + account.Password = p.NewPassword + } + + if p.Owner != nil { + account.Owner = p.Owner + } + + if p.Config != nil { + account.Config = p.Config + } + + if p.Username != "" { + account.Username = p.Username + } + + return account } // updateHandler godoc // -// @Summary Perform actions on the currently logged-in user. +// @Summary Update account information // @Tags Auth // @securityDefinitions.apikey ApiKeyAuth -// @Param payload body settingRequestPayload false "Config data" +// @Param payload body updateAccountPayload false "Account data" // @Produce json // @Success 200 {object} model.Account // @Failure 403 {object} nil "Token not provided/invalid" // @Router /api/v1/auth/account [patch] func (r *AuthAPIRoutes) updateHandler(c *gin.Context) { ctx := context.NewContextFromGin(c) - if !ctx.UserIsLogged() { - response.SendError(c, http.StatusForbidden, nil) - } - var payload settingRequestPayload + + var payload updateAccountPayload if err := c.ShouldBindJSON(&payload); err != nil { response.SendInternalServerError(c) } - account := ctx.GetAccount() - if account == nil { - response.SendError(c, http.StatusUnauthorized, nil) + if err := payload.IsValid(); err != nil { + response.SendError(c, http.StatusBadRequest, err.Error()) return } - account.Config = payload.Config - err := r.deps.Database.SaveAccountSettings(c, *account) + account := ctx.GetAccount() + + // If trying to update password, check if old password is correct + if payload.NewPassword != "" { + _, err := r.deps.Domains.Auth.GetAccountFromCredentials(c.Request.Context(), account.Username, payload.OldPassword) + if err != nil { + response.SendError(c, http.StatusBadRequest, "Old password is incorrect") + return + } + } + + updatedAccount := payload.ToAccountDTO() + updatedAccount.ID = account.ID + + account, err := r.deps.Domains.Accounts.UpdateAccount(c.Request.Context(), updatedAccount) if err != nil { + r.deps.Log.WithError(err).Error("failed to update account") response.SendInternalServerError(c) + return } - response.Send(c, http.StatusOK, ctx.GetAccount()) + response.Send(c, http.StatusOK, account) +} + +// logoutHandler godoc +// +// @Summary Logout from the current session +// @Tags Auth +// @securityDefinitions.apikey ApiKeyAuth +// @Produce json +// @Success 200 {object} nil "Logout successful" +// @Failure 403 {object} nil "Token not provided/invalid" +// @Router /api/v1/auth/logout [post] +func (r *AuthAPIRoutes) logoutHandler(c *gin.Context) { + // Since the token is stateless JWT, we just return success + // The client should remove the token from their storage + response.Send(c, http.StatusOK, nil) } func NewAuthAPIRoutes(logger *logrus.Logger, deps *dependencies.Dependencies, loginHandler model.LegacyLoginHandler) *AuthAPIRoutes { diff --git a/internal/http/routes/api/v1/auth_test.go b/internal/http/routes/api/v1/auth_test.go index 49686af84..c2ff2a377 100644 --- a/internal/http/routes/api/v1/auth_test.go +++ b/internal/http/routes/api/v1/auth_test.go @@ -1,11 +1,8 @@ package api_v1 import ( - "bytes" "context" - "encoding/json" "net/http" - "net/http/httptest" "testing" "time" @@ -16,7 +13,7 @@ import ( "github.com/stretchr/testify/require" ) -func noopLegacyLoginHandler(_ model.Account, _ time.Duration) (string, error) { +func noopLegacyLoginHandler(_ *model.AccountDTO, _ time.Duration) (string, error) { return "", nil } @@ -29,10 +26,8 @@ func TestAccountsRoute(t *testing.T) { _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) router := NewAuthAPIRoutes(logger, deps, noopLegacyLoginHandler) router.Setup(g.Group("/")) - w := httptest.NewRecorder() - body := []byte(`{"username": "gopher"}`) - req := httptest.NewRequest("POST", "/login", bytes.NewBuffer(body)) - g.ServeHTTP(w, req) + body := `{"username": "gopher"}` + w := testutil.PerformRequest(g, "POST", "/login", testutil.WithBody(body)) require.Equal(t, 400, w.Code) }) @@ -42,11 +37,8 @@ func TestAccountsRoute(t *testing.T) { _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) router := NewAuthAPIRoutes(logger, deps, noopLegacyLoginHandler) router.Setup(g.Group("/")) - w := httptest.NewRecorder() - body := []byte(`{"username": "gopher", "password": "shiori"}`) - req := httptest.NewRequest("POST", "/login", bytes.NewBuffer(body)) - g.ServeHTTP(w, req) - + body := `{"username": "gopher", "password": "shiori"}` + w := testutil.PerformRequest(g, "POST", "/login", testutil.WithBody(body)) require.Equal(t, 400, w.Code) }) @@ -57,17 +49,16 @@ func TestAccountsRoute(t *testing.T) { router.Setup(g.Group("/")) // Create an account manually to test - account := model.Account{ + account := model.AccountDTO{ Username: "shiori", Password: "gopher", - Owner: true, + Owner: model.Ptr(true), } - require.NoError(t, deps.Database.SaveAccount(ctx, account)) - w := httptest.NewRecorder() - body := []byte(`{"username": "shiori", "password": "gopher"}`) - req := httptest.NewRequest("POST", "/login", bytes.NewBuffer(body)) - g.ServeHTTP(w, req) + _, accountInsertErr := deps.Domains.Accounts.CreateAccount(ctx, account) + require.NoError(t, accountInsertErr) + + w := testutil.PerformRequest(g, "POST", "/login", testutil.WithBody(`{"username": "shiori", "password": "gopher"}`)) require.Equal(t, 200, w.Code) }) @@ -82,19 +73,19 @@ func TestAccountsRoute(t *testing.T) { router.Setup(g.Group("/")) // Create an account manually to test - account := testutil.GetValidAccount() - account.Owner = true - require.NoError(t, deps.Database.SaveAccount(ctx, *account)) + account := model.Account{ + Username: "shiori", + Password: "gopher", + Owner: true, + } + _, accountInsertErr := deps.Database.CreateAccount(ctx, account) + require.NoError(t, accountInsertErr) - token, err := deps.Domains.Auth.CreateTokenForAccount(account, time.Now().Add(time.Minute)) + token, err := deps.Domains.Auth.CreateTokenForAccount(model.Ptr(account.ToDTO()), time.Now().Add(time.Minute)) require.NoError(t, err) - req := httptest.NewRequest("GET", "/me", nil) - req.Header.Add("Authorization", "Bearer "+token) - w := httptest.NewRecorder() - g.ServeHTTP(w, req) - - require.Equal(t, 200, w.Code) + w := testutil.PerformRequest(g, "GET", "/me", testutil.WithAuthToken(token)) + require.Equal(t, http.StatusOK, w.Code) }) t.Run("check /me (incorrect token)", func(t *testing.T) { @@ -106,11 +97,9 @@ func TestAccountsRoute(t *testing.T) { router := NewAuthAPIRoutes(logger, deps, noopLegacyLoginHandler) router.Setup(g.Group("/")) - req := httptest.NewRequest("GET", "/me", nil) - w := httptest.NewRecorder() - g.ServeHTTP(w, req) + w := testutil.PerformRequest(g, "POST", "/refresh", testutil.WithAuthToken("nometokens")) - require.Equal(t, 403, w.Code) + require.Equal(t, http.StatusUnauthorized, w.Code) }) } @@ -163,19 +152,19 @@ func TestRefreshHandler(t *testing.T) { t.Run("empty headers", func(t *testing.T) { w := testutil.PerformRequest(g, "POST", "/refresh") - require.Equal(t, http.StatusForbidden, w.Code) + require.Equal(t, http.StatusUnauthorized, w.Code) }) t.Run("token invalid", func(t *testing.T) { - w := testutil.PerformRequest(g, "POST", "/refresh") - require.Equal(t, http.StatusForbidden, w.Code) + w := testutil.PerformRequest(g, "POST", "/refresh", testutil.WithAuthToken("nometokens")) + require.Equal(t, http.StatusUnauthorized, w.Code) }) t.Run("token valid", func(t *testing.T) { - token, err := deps.Domains.Auth.CreateTokenForAccount(testutil.GetValidAccount(), time.Now().Add(time.Minute)) + _, token, err := testutil.NewAdminUser(deps) require.NoError(t, err) - w := testutil.PerformRequest(g, "POST", "/refresh", testutil.WithHeader(model.AuthorizationHeader, model.AuthorizationTokenType+" "+token)) + w := testutil.PerformRequest(g, "POST", "/refresh", testutil.WithAuthToken(token)) require.Equal(t, http.StatusAccepted, w.Code) }) @@ -191,85 +180,78 @@ func TestUpdateHandler(t *testing.T) { g.Use(middleware.AuthMiddleware(deps)) router.Setup(g.Group("/")) - require.NoError(t, deps.Database.SaveAccount(ctx, model.Account{ + account, err := deps.Domains.Accounts.CreateAccount(ctx, model.AccountDTO{ Username: "shiori", Password: "gopher", - })) + Owner: model.Ptr(true), + Config: model.Ptr(model.UserConfig{ + ShowId: true, + ListMode: true, + HideThumbnail: true, + HideExcerpt: true, + KeepMetadata: true, + UseArchive: true, + CreateEbook: true, + MakePublic: true, + }), + }) + require.NoError(t, err) - t.Run("invalid token", func(t *testing.T) { + t.Run("require authentication", func(t *testing.T) { w := testutil.PerformRequest(g, "PATCH", "/account") - require.Equal(t, http.StatusForbidden, w.Code) + require.Equal(t, http.StatusUnauthorized, w.Code) }) - t.Run("token valid", func(t *testing.T) { - token, err := deps.Domains.Auth.CreateTokenForAccount(testutil.GetValidAccount(), time.Now().Add(time.Minute)) + t.Run("config not valid", func(t *testing.T) { + token, err := deps.Domains.Auth.CreateTokenForAccount(account, time.Now().Add(time.Minute)) require.NoError(t, err) - type settingRequestPayload struct { - Config model.UserConfig `json:"config"` - } - payload := settingRequestPayload{ - Config: model.UserConfig{ - // add your configuration data here - }, - } - payloadJSON, err := json.Marshal(payload) - if err != nil { - logrus.Printf("problem") - } + w := testutil.PerformRequest(g, "PATCH", "/account", testutil.WithBody("notValidConfig"), testutil.WithAuthToken(token)) - w := testutil.PerformRequest(g, "PATCH", "/account", testutil.WithBody(string(payloadJSON)), testutil.WithHeader(model.AuthorizationHeader, model.AuthorizationTokenType+" "+token)) + require.Equal(t, http.StatusInternalServerError, w.Code) + }) - require.Equal(t, http.StatusOK, w.Code) + t.Run("password update with invalid old password", func(t *testing.T) { + token, err := deps.Domains.Auth.CreateTokenForAccount(account, time.Now().Add(time.Minute)) + require.NoError(t, err) + + payloadJSON := `{ + "old_password": "wrongpassword", + "new_password": "newpassword" + }` + w := testutil.PerformRequest(g, "PATCH", "/account", testutil.WithBody(payloadJSON), testutil.WithAuthToken(token)) + require.Equal(t, http.StatusBadRequest, w.Code) }) - t.Run("config not valid", func(t *testing.T) { - token, err := deps.Domains.Auth.CreateTokenForAccount(testutil.GetValidAccount(), time.Now().Add(time.Minute)) + t.Run("password update with correct old password", func(t *testing.T) { + token, err := deps.Domains.Auth.CreateTokenForAccount(account, time.Now().Add(time.Minute)) require.NoError(t, err) - w := testutil.PerformRequest(g, "PATCH", "/account", testutil.WithBody("notValidConfig"), testutil.WithHeader(model.AuthorizationHeader, model.AuthorizationTokenType+" "+token)) + payloadJSON := `{ + "old_password": "gopher", + "new_password": "newpassword" + }` - require.Equal(t, http.StatusInternalServerError, w.Code) + w := testutil.PerformRequest(g, "PATCH", "/account", testutil.WithBody(payloadJSON), testutil.WithAuthToken(token)) + require.Equal(t, http.StatusOK, w.Code) + // Verify we can login with new password + loginW := testutil.PerformRequest(g, "POST", "/login", testutil.WithBody(`{"username": "shiori", "password": "newpassword"}`)) + require.Equal(t, http.StatusOK, loginW.Code) }) - t.Run("Test configure change in database", func(t *testing.T) { - // Create a tmp database - g := testutil.NewGin() - _, deps := testutil.GetTestConfigurationAndDependencies(t, ctx, logger) - router := NewAuthAPIRoutes(logger, deps, noopLegacyLoginHandler) - g.Use(middleware.AuthMiddleware(deps)) - router.Setup(g.Group("/")) - - // Create an account manually to test - account := model.Account{ - Username: "shiori", - Password: "gopher", - Owner: true, - Config: model.UserConfig{ - ShowId: true, - ListMode: true, - HideThumbnail: true, - HideExcerpt: true, - Theme: "follow", - KeepMetadata: true, - UseArchive: true, - CreateEbook: true, - MakePublic: true, - }, - } - require.NoError(t, deps.Database.SaveAccount(ctx, account)) + t.Run("Test configure change in database", func(t *testing.T) { // Get current user config - user, _, err := deps.Database.GetAccount(ctx, "shiori") + user, _, err := deps.Database.GetAccount(ctx, account.ID) require.NoError(t, err) - require.Equal(t, user.Config, account.Config) + require.Equal(t, user.ToDTO().Config, account.Config) // Send Request to update config for user - token, err := deps.Domains.Auth.CreateTokenForAccount(&user, time.Now().Add(time.Minute)) + token, err := deps.Domains.Auth.CreateTokenForAccount(model.Ptr(user.ToDTO()), time.Now().Add(time.Minute)) require.NoError(t, err) - payloadJSON := []byte(`{ + payloadJSON := `{ "config": { "ShowId": false, "ListMode": false, @@ -280,20 +262,14 @@ func TestUpdateHandler(t *testing.T) { "UseArchive": false, "CreateEbook": false, "MakePublic": false - } - }`) + }}` - w := httptest.NewRecorder() - req := httptest.NewRequest(http.MethodPatch, "/account", bytes.NewBuffer(payloadJSON)) - req.Header.Set("Content-Type", "application/json") - req.Header.Add("Authorization", "Bearer "+token) - g.ServeHTTP(w, req) - - require.Equal(t, 200, w.Code) - user, _, err = deps.Database.GetAccount(ctx, "shiori") + w := testutil.PerformRequest(g, "PATCH", "/account", testutil.WithBody(payloadJSON), testutil.WithAuthToken(token)) + require.Equal(t, http.StatusOK, w.Code) + user, _, err = deps.Database.GetAccount(ctx, account.ID) require.NoError(t, err) - require.NotEqual(t, user.Config, account.Config) + require.NotEqualValues(t, user.ToDTO().Config, account.Config) }) } diff --git a/internal/http/routes/api/v1/bookmarks.go b/internal/http/routes/api/v1/bookmarks.go index a95ec538b..6448b3833 100644 --- a/internal/http/routes/api/v1/bookmarks.go +++ b/internal/http/routes/api/v1/bookmarks.go @@ -64,7 +64,6 @@ func (r *BookmarksAPIRoutes) getBookmark(c *context.Context) (*model.BookmarkDTO response.SendError(c.Context, http.StatusBadRequest, "Invalid bookmark ID") return nil, model.ErrBookmarkInvalidID } - bookmarkID, err := strconv.Atoi(bookmarkIDParam) if err != nil { r.logger.WithError(err).Error("error parsing bookmark ID parameter") @@ -126,7 +125,8 @@ func (r *BookmarksAPIRoutes) bookmarkReadable(c *gin.Context) { // @Router /api/v1/bookmarks/cache [put] func (r *BookmarksAPIRoutes) updateCache(c *gin.Context) { ctx := context.NewContextFromGin(c) - if !ctx.GetAccount().Owner { + account := ctx.GetAccount() + if account != nil && !account.IsOwner() { response.SendError(c, http.StatusForbidden, nil) return } diff --git a/internal/http/routes/api/v1/bookmarks_test.go b/internal/http/routes/api/v1/bookmarks_test.go index 5a1ffa74d..31d4ace36 100644 --- a/internal/http/routes/api/v1/bookmarks_test.go +++ b/internal/http/routes/api/v1/bookmarks_test.go @@ -27,8 +27,9 @@ func TestUpdateBookmarkCache(t *testing.T) { router.Setup(g.Group("/")) account := testutil.GetValidAccount() - require.NoError(t, deps.Database.SaveAccount(ctx, *account)) - token, err := deps.Domains.Auth.CreateTokenForAccount(account, time.Now().Add(time.Minute)) + _, err := deps.Database.CreateAccount(ctx, *account) + require.NoError(t, err) + token, err := deps.Domains.Auth.CreateTokenForAccount(model.Ptr(account.ToDTO()), time.Now().Add(time.Minute)) require.NoError(t, err) t.Run("require authentication", func(t *testing.T) { @@ -37,7 +38,13 @@ func TestUpdateBookmarkCache(t *testing.T) { }) t.Run("require owner", func(t *testing.T) { - w := testutil.PerformRequest(g, "PUT", "/cache", testutil.WithHeader(model.AuthorizationHeader, model.AuthorizationTokenType+" "+token)) + w := testutil.PerformRequest( + g, + "PUT", + "/cache", + testutil.WithAuthToken(token), + testutil.WithBody(`{"ids":[1]}`), + ) require.Equal(t, http.StatusForbidden, w.Code) }) } @@ -55,8 +62,9 @@ func TestReadableeBookmarkContent(t *testing.T) { router.Setup(g.Group("/")) account := testutil.GetValidAccount() - require.NoError(t, deps.Database.SaveAccount(ctx, *account)) - token, err := deps.Domains.Auth.CreateTokenForAccount(account, time.Now().Add(time.Minute)) + _, err := deps.Database.CreateAccount(ctx, *account) + require.NoError(t, err) + token, err := deps.Domains.Auth.CreateTokenForAccount(model.Ptr(account.ToDTO()), time.Now().Add(time.Minute)) require.NoError(t, err) bookmark := testutil.GetValidBookmark() diff --git a/internal/http/routes/api/v1/system.go b/internal/http/routes/api/v1/system.go index f68aaf70a..bf003c92c 100644 --- a/internal/http/routes/api/v1/system.go +++ b/internal/http/routes/api/v1/system.go @@ -46,7 +46,8 @@ type infoResponse struct { // @Router /api/v1/system/info [get] func (r *SystemAPIRoutes) infoHandler(c *gin.Context) { ctx := context.NewContextFromGin(c) - if !ctx.GetAccount().Owner { + account := ctx.GetAccount() + if account == nil || !account.IsOwner() { response.SendError(c, http.StatusForbidden, "Only owners can access this endpoint") return } @@ -61,7 +62,7 @@ func (r *SystemAPIRoutes) infoHandler(c *gin.Context) { Commit: model.BuildCommit, Date: model.BuildDate, }, - Database: r.deps.Database.DBx().DriverName(), + Database: r.deps.Database.ReaderDB().DriverName(), OS: runtime.GOOS + " (" + runtime.GOARCH + ")", }) } diff --git a/internal/http/routes/api/v1/tags.go b/internal/http/routes/api/v1/tags.go index 290e8ed69..01a21fdc2 100644 --- a/internal/http/routes/api/v1/tags.go +++ b/internal/http/routes/api/v1/tags.go @@ -51,7 +51,8 @@ func (r *TagsAPIRoutes) listHandler(c *gin.Context) { // @Router /api/v1/tags [post] func (r *TagsAPIRoutes) createHandler(c *gin.Context) { ctx := context.NewContextFromGin(c) - if !ctx.GetAccount().Owner { + account := ctx.GetAccount() + if account != nil && !account.IsOwner() { response.SendError(c, http.StatusForbidden, nil) return } diff --git a/internal/http/routes/api/v1/tags_test.go b/internal/http/routes/api/v1/tags_test.go index 7f3ed6834..63f97e15d 100644 --- a/internal/http/routes/api/v1/tags_test.go +++ b/internal/http/routes/api/v1/tags_test.go @@ -24,9 +24,9 @@ func TestTagList(t *testing.T) { g.Use(middleware.AuthMiddleware(deps)) account := testutil.GetValidAccount() - account.Owner = true - require.NoError(t, deps.Database.SaveAccount(ctx, *account)) - token, err := deps.Domains.Auth.CreateTokenForAccount(account, time.Now().Add(time.Minute)) + _, err := deps.Database.CreateAccount(ctx, *account) + require.NoError(t, err) + token, err := deps.Domains.Auth.CreateTokenForAccount(model.Ptr(account.ToDTO()), time.Now().Add(time.Minute)) require.NoError(t, err) bookmark := testutil.GetValidBookmark() @@ -71,8 +71,8 @@ func TestTagCreate(t *testing.T) { g.Use(middleware.AuthMiddleware(deps)) account := testutil.GetValidAccount() - account.Owner = true - require.NoError(t, deps.Database.SaveAccount(ctx, *account)) + _, err := deps.Database.CreateAccount(ctx, *account) + require.NoError(t, err) // token, err := deps.Domains.Auth.CreateTokenForAccount(&account, time.Now().Add(time.Minute)) // require.NoError(t, err) diff --git a/internal/http/routes/legacy.go b/internal/http/routes/legacy.go index 36f74826d..6a6d07474 100644 --- a/internal/http/routes/legacy.go +++ b/internal/http/routes/legacy.go @@ -39,7 +39,7 @@ func (r *LegacyAPIRoutes) handle(handler func(w http.ResponseWriter, r *http.Req } } -func (r *LegacyAPIRoutes) HandleLogin(account model.Account, expTime time.Duration) (string, error) { +func (r *LegacyAPIRoutes) HandleLogin(account *model.AccountDTO, expTime time.Duration) (string, error) { // Create session ID sessionID, err := uuid.NewV4() if err != nil { @@ -67,7 +67,6 @@ func (r *LegacyAPIRoutes) Setup(g *gin.Engine) { Log: false, // Already done by gin }, r.deps) r.legacyHandler.PrepareSessionCache() - r.legacyHandler.PrepareTemplates() legacyGroup := g.Group("/") @@ -78,8 +77,6 @@ func (r *LegacyAPIRoutes) Setup(g *gin.Engine) { c.Data(http.StatusInternalServerError, "text/plain", []byte(err.(error).Error())) })) - legacyGroup.POST("/api/logout", r.handle(r.legacyHandler.ApiLogout)) - // router.GET(jp("/api/tags"), withLogging(hdl.apiGetTags)) legacyGroup.GET("/api/tags", r.handle(r.legacyHandler.ApiGetTags)) // router.PUT(jp("/api/tag"), withLogging(hdl.apiRenameTag)) @@ -98,15 +95,6 @@ func (r *LegacyAPIRoutes) Setup(g *gin.Engine) { legacyGroup.POST("/api/bookmarks/ext", r.handle(r.legacyHandler.ApiInsertViaExtension)) // router.DELETE(jp("/api/bookmarks/ext"), withLogging(hdl.apiDeleteViaExtension)) legacyGroup.DELETE("/api/bookmarks/ext", r.handle(r.legacyHandler.ApiDeleteViaExtension)) - - // router.GET(jp("/api/accounts"), withLogging(hdl.apiGetAccounts)) - legacyGroup.GET("/api/accounts", r.handle(r.legacyHandler.ApiGetAccounts)) - // router.PUT(jp("/api/accounts"), withLogging(hdl.apiUpdateAccount)) - legacyGroup.PUT("/api/accounts", r.handle(r.legacyHandler.ApiUpdateAccount)) - // router.POST(jp("/api/accounts"), withLogging(hdl.apiInsertAccount)) - legacyGroup.POST("/api/accounts", r.handle(r.legacyHandler.ApiInsertAccount)) - // router.DELETE(jp("/api/accounts"), withLogging(hdl.apiDeleteAccount)) - legacyGroup.DELETE("/api/accounts", r.handle(r.legacyHandler.ApiDeleteAccount)) } func NewLegacyAPIRoutes(logger *logrus.Logger, deps *dependencies.Dependencies, cfg *config.Config) *LegacyAPIRoutes { diff --git a/internal/model/account.go b/internal/model/account.go index 5c58fca5f..12d776173 100644 --- a/internal/model/account.go +++ b/internal/model/account.go @@ -8,9 +8,9 @@ import ( "github.com/golang-jwt/jwt/v5" ) -// Account is the database model for account. +// Account is the database representation for account. type Account struct { - ID int `db:"id" json:"id"` + ID DBID `db:"id" json:"id"` Username string `db:"username" json:"username"` Password string `db:"password" json:"password,omitempty"` Owner bool `db:"owner" json:"owner"` @@ -48,20 +48,48 @@ func (c UserConfig) Value() (driver.Value, error) { // ToDTO converts Account to AccountDTO. func (a Account) ToDTO() AccountDTO { + owner := a.Owner + config := a.Config + return AccountDTO{ ID: a.ID, Username: a.Username, - Owner: a.Owner, - Config: a.Config, + Owner: &owner, + Config: &config, } } // AccountDTO is data transfer object for Account. type AccountDTO struct { - ID int `json:"id"` - Username string `json:"username"` - Owner bool `json:"owner"` - Config UserConfig `json:"config"` + ID DBID `json:"id"` + Username string `json:"username"` + Password string `json:"passowrd,omitempty"` // Used only to store, not to retrieve + Owner *bool `json:"owner"` + Config *UserConfig `json:"config"` +} + +func (adto *AccountDTO) IsOwner() bool { + return adto.Owner != nil && *adto.Owner +} + +func (adto *AccountDTO) IsValidCreate() error { + if adto.Username == "" { + return NewValidationError("username", "username should not be empty") + } + + if adto.Password == "" { + return NewValidationError("password", "password should not be empty") + } + + return nil +} + +func (adto *AccountDTO) IsValidUpdate() error { + if adto.Username == "" && adto.Password == "" && adto.Owner == nil && adto.Config == nil { + return NewValidationError("account", "no fields to update") + } + + return nil } type JWTClaim struct { diff --git a/internal/model/domains.go b/internal/model/domains.go index 8b8fefa2c..b656769b3 100644 --- a/internal/model/domains.go +++ b/internal/model/domains.go @@ -17,11 +17,17 @@ type BookmarksDomain interface { GetBookmark(ctx context.Context, id DBID) (*BookmarkDTO, error) } +type AuthDomain interface { + CheckToken(ctx context.Context, userJWT string) (*AccountDTO, error) + GetAccountFromCredentials(ctx context.Context, username, password string) (*AccountDTO, error) + CreateTokenForAccount(account *AccountDTO, expiration time.Time) (string, error) +} + type AccountsDomain interface { - ParseToken(userJWT string) (*JWTClaim, error) - CheckToken(ctx context.Context, userJWT string) (*Account, error) - GetAccountFromCredentials(ctx context.Context, username, password string) (*Account, error) - CreateTokenForAccount(account *Account, expiration time.Time) (string, error) + ListAccounts(ctx context.Context) ([]AccountDTO, error) + CreateAccount(ctx context.Context, account AccountDTO) (*AccountDTO, error) + UpdateAccount(ctx context.Context, account AccountDTO) (*AccountDTO, error) + DeleteAccount(ctx context.Context, id int) error } type ArchiverDomain interface { diff --git a/internal/model/errors.go b/internal/model/errors.go index 75c4b9111..72ab34fbd 100644 --- a/internal/model/errors.go +++ b/internal/model/errors.go @@ -6,4 +6,6 @@ var ( ErrBookmarkNotFound = errors.New("bookmark not found") ErrBookmarkInvalidID = errors.New("invalid bookmark ID") ErrUnauthorized = errors.New("unauthorized user") + ErrNotFound = errors.New("not found") + ErrAlreadyExists = errors.New("already exists") ) diff --git a/internal/model/legacy.go b/internal/model/legacy.go index 4042537cd..0db8fc3cc 100644 --- a/internal/model/legacy.go +++ b/internal/model/legacy.go @@ -2,4 +2,4 @@ package model import "time" -type LegacyLoginHandler func(account Account, expTime time.Duration) (string, error) +type LegacyLoginHandler func(account *AccountDTO, expTime time.Duration) (string, error) diff --git a/internal/model/ptr.go b/internal/model/ptr.go new file mode 100644 index 000000000..0fbecd672 --- /dev/null +++ b/internal/model/ptr.go @@ -0,0 +1,6 @@ +package model + +// Ptr returns a pointer to the value passed as argument. +func Ptr[t any](a t) *t { + return &a +} diff --git a/internal/model/validation.go b/internal/model/validation.go new file mode 100644 index 000000000..3a7ed7967 --- /dev/null +++ b/internal/model/validation.go @@ -0,0 +1,20 @@ +package model + +// ValidationError represents a validation error. +// This errors are used in the domain layer to indicate an error that is caused generally +// by the user and has to be sent back via the API or appropriate channel. +type ValidationError struct { + Field string `json:"field"` + Message string `json:"message"` +} + +func (v ValidationError) Error() string { + return v.Message +} + +func NewValidationError(field, message string) ValidationError { + return ValidationError{ + Field: field, + Message: message, + } +} diff --git a/internal/testutil/accounts.go b/internal/testutil/accounts.go new file mode 100644 index 000000000..7e767241c --- /dev/null +++ b/internal/testutil/accounts.go @@ -0,0 +1,31 @@ +package testutil + +import ( + "context" + "time" + + "github.com/go-shiori/shiori/internal/dependencies" + "github.com/go-shiori/shiori/internal/model" +) + +// NewAdminUser creates a new admin user and returns its account and token. +// Use this when testing the API endpoints that require admin authentication to +// generate the user and obtain a token that can be easily added as `WithAuthToken()` +// option in the request. +func NewAdminUser(deps *dependencies.Dependencies) (*model.AccountDTO, string, error) { + account, err := deps.Domains.Accounts.CreateAccount(context.TODO(), model.AccountDTO{ + Username: "admin", + Password: "admin", + Owner: model.Ptr(true), + }) + if err != nil { + return nil, "", err + } + + token, err := deps.Domains.Auth.CreateTokenForAccount(account, time.Now().Add(time.Hour*24*365)) + if err != nil { + return nil, "", err + } + + return account, token, nil +} diff --git a/internal/testutil/http.go b/internal/testutil/http.go index 92f9d6b4a..64395a361 100644 --- a/internal/testutil/http.go +++ b/internal/testutil/http.go @@ -31,6 +31,12 @@ func WithHeader(name, value string) Option { } } +func WithAuthToken(token string) Option { + return func(request *http.Request) { + request.Header.Add(model.AuthorizationHeader, model.AuthorizationTokenType+" "+token) + } +} + func PerformRequest(handler http.Handler, method, path string, options ...Option) *httptest.ResponseRecorder { recorder := httptest.NewRecorder() return PerformRequestWithRecorder(recorder, handler, method, path, options...) @@ -52,10 +58,10 @@ func PerformRequestWithRecorder(recorder *httptest.ResponseRecorder, r http.Hand // Keep in mind that this users is not saved in database so any tests that use this middleware // should not rely on database. func FakeUserLoggedInMiddlewware(ctx *gin.Context) { - ctx.Set("account", &model.Account{ + ctx.Set("account", &model.AccountDTO{ ID: 1, Username: "user", - Owner: false, + Owner: model.Ptr(false), }) } @@ -63,10 +69,10 @@ func FakeUserLoggedInMiddlewware(ctx *gin.Context) { // Keep in mind that this users is not saved in database so any tests that use this middleware // should not rely on database. func FakeAdminLoggedInMiddlewware(ctx *gin.Context) { - ctx.Set("account", &model.Account{ + ctx.Set("account", &model.AccountDTO{ ID: 1, - Username: "admin", - Owner: true, + Username: "user", + Owner: model.Ptr(true), }) } diff --git a/internal/testutil/shiori.go b/internal/testutil/shiori.go index 737266dc4..944ff0acd 100644 --- a/internal/testutil/shiori.go +++ b/internal/testutil/shiori.go @@ -39,8 +39,9 @@ func GetTestConfigurationAndDependencies(t *testing.T, ctx context.Context, logg deps := dependencies.NewDependencies(logger, db, cfg) deps.Database = db - deps.Domains.Auth = domains.NewAccountsDomain(deps) + deps.Domains.Accounts = domains.NewAccountsDomain(deps) deps.Domains.Archiver = domains.NewArchiverDomain(deps) + deps.Domains.Auth = domains.NewAuthDomain(deps) deps.Domains.Bookmarks = domains.NewBookmarksDomain(deps) deps.Domains.Storage = domains.NewStorageDomain(deps, afero.NewBasePathFs(afero.NewOsFs(), cfg.Storage.DataDir)) diff --git a/internal/view/assets/css/style.css b/internal/view/assets/css/style.css index 010af4e9c..7bb7a903b 100644 --- a/internal/view/assets/css/style.css +++ b/internal/view/assets/css/style.css @@ -1 +1 @@ -@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:200;src:local('Source Sans Pro ExtraLight'),local('SourceSansPro-ExtraLight'),url(libs/fonts/source-sans-pro-v13-latin-200.woff2) format('woff2'),url(libs/fonts/source-sans-pro-v13-latin-200.woff) format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:400;src:local('Source Sans Pro Regular'),local('SourceSansPro-Regular'),url(libs/fonts/source-sans-pro-v13-latin-regular.woff2) format('woff2'),url(libs/fonts/source-sans-pro-v13-latin-regular.woff) format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:600;src:local('Source Sans Pro SemiBold'),local('SourceSansPro-SemiBold'),url(libs/fonts/source-sans-pro-v13-latin-600.woff2) format('woff2'),url(libs/fonts/source-sans-pro-v13-latin-600.woff) format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:700;src:local('Source Sans Pro Bold'),local('SourceSansPro-Bold'),url(libs/fonts/source-sans-pro-v13-latin-700.woff2) format('woff2'),url(libs/fonts/source-sans-pro-v13-latin-700.woff) format('woff')}.fa,.fab,.fal,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{animation:fa-spin 2s infinite linear}.fa-pulse{animation:fa-spin 1s infinite steps(8)}@keyframes fa-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.fa-rotate-90{transform:rotate(90deg)}.fa-rotate-180{transform:rotate(180deg)}.fa-rotate-270{transform:rotate(270deg)}.fa-flip-horizontal{transform:scaleX(-1)}.fa-flip-vertical{transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{transform:scale(-1)}:root .fa-flip-both,:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{filter:none}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-acquisitions-incorporated:before{content:"\f6af"}.fa-ad:before{content:"\f641"}.fa-address-book:before{content:"\f2b9"}.fa-address-card:before{content:"\f2bb"}.fa-adjust:before{content:"\f042"}.fa-adn:before{content:"\f170"}.fa-adobe:before{content:"\f778"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-air-freshener:before{content:"\f5d0"}.fa-algolia:before{content:"\f36c"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-alipay:before{content:"\f642"}.fa-allergies:before{content:"\f461"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-ambulance:before{content:"\f0f9"}.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-amilia:before{content:"\f36d"}.fa-anchor:before{content:"\f13d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angry:before{content:"\f556"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-ankh:before{content:"\f644"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-alt:before{content:"\f5d1"}.fa-apple-pay:before{content:"\f415"}.fa-archive:before{content:"\f187"}.fa-archway:before{content:"\f557"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-left:before{content:"\f359"}.fa-arrow-alt-circle-right:before{content:"\f35a"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrows-alt:before{content:"\f0b2"}.fa-arrows-alt-h:before{content:"\f337"}.fa-arrows-alt-v:before{content:"\f338"}.fa-artstation:before{content:"\f77a"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asterisk:before{content:"\f069"}.fa-asymmetrik:before{content:"\f372"}.fa-at:before{content:"\f1fa"}.fa-atlas:before{content:"\f558"}.fa-atlassian:before{content:"\f77b"}.fa-atom:before{content:"\f5d2"}.fa-audible:before{content:"\f373"}.fa-audio-description:before{content:"\f29e"}.fa-autoprefixer:before{content:"\f41c"}.fa-avianex:before{content:"\f374"}.fa-aviato:before{content:"\f421"}.fa-award:before{content:"\f559"}.fa-aws:before{content:"\f375"}.fa-baby:before{content:"\f77c"}.fa-baby-carriage:before{content:"\f77d"}.fa-backspace:before{content:"\f55a"}.fa-backward:before{content:"\f04a"}.fa-bacon:before{content:"\f7e5"}.fa-balance-scale:before{content:"\f24e"}.fa-ban:before{content:"\f05e"}.fa-band-aid:before{content:"\f462"}.fa-bandcamp:before{content:"\f2d5"}.fa-barcode:before{content:"\f02a"}.fa-bars:before{content:"\f0c9"}.fa-baseball-ball:before{content:"\f433"}.fa-basketball-ball:before{content:"\f434"}.fa-bath:before{content:"\f2cd"}.fa-battery-empty:before{content:"\f244"}.fa-battery-full:before{content:"\f240"}.fa-battery-half:before{content:"\f242"}.fa-battery-quarter:before{content:"\f243"}.fa-battery-three-quarters:before{content:"\f241"}.fa-bed:before{content:"\f236"}.fa-beer:before{content:"\f0fc"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-bell:before{content:"\f0f3"}.fa-bell-slash:before{content:"\f1f6"}.fa-bezier-curve:before{content:"\f55b"}.fa-bible:before{content:"\f647"}.fa-bicycle:before{content:"\f206"}.fa-bimobject:before{content:"\f378"}.fa-binoculars:before{content:"\f1e5"}.fa-biohazard:before{content:"\f780"}.fa-birthday-cake:before{content:"\f1fd"}.fa-bitbucket:before{content:"\f171"}.fa-bitcoin:before{content:"\f379"}.fa-bity:before{content:"\f37a"}.fa-black-tie:before{content:"\f27e"}.fa-blackberry:before{content:"\f37b"}.fa-blender:before{content:"\f517"}.fa-blender-phone:before{content:"\f6b6"}.fa-blind:before{content:"\f29d"}.fa-blog:before{content:"\f781"}.fa-blogger:before{content:"\f37c"}.fa-blogger-b:before{content:"\f37d"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-bold:before{content:"\f032"}.fa-bolt:before{content:"\f0e7"}.fa-bomb:before{content:"\f1e2"}.fa-bone:before{content:"\f5d7"}.fa-bong:before{content:"\f55c"}.fa-book:before{content:"\f02d"}.fa-book-dead:before{content:"\f6b7"}.fa-book-medical:before{content:"\f7e6"}.fa-book-open:before{content:"\f518"}.fa-book-reader:before{content:"\f5da"}.fa-bookmark:before{content:"\f02e"}.fa-bowling-ball:before{content:"\f436"}.fa-box:before{content:"\f466"}.fa-box-open:before{content:"\f49e"}.fa-boxes:before{content:"\f468"}.fa-braille:before{content:"\f2a1"}.fa-brain:before{content:"\f5dc"}.fa-bread-slice:before{content:"\f7ec"}.fa-briefcase:before{content:"\f0b1"}.fa-briefcase-medical:before{content:"\f469"}.fa-broadcast-tower:before{content:"\f519"}.fa-broom:before{content:"\f51a"}.fa-brush:before{content:"\f55d"}.fa-btc:before{content:"\f15a"}.fa-bug:before{content:"\f188"}.fa-building:before{content:"\f1ad"}.fa-bullhorn:before{content:"\f0a1"}.fa-bullseye:before{content:"\f140"}.fa-burn:before{content:"\f46a"}.fa-buromobelexperte:before{content:"\f37f"}.fa-bus:before{content:"\f207"}.fa-bus-alt:before{content:"\f55e"}.fa-business-time:before{content:"\f64a"}.fa-buysellads:before{content:"\f20d"}.fa-calculator:before{content:"\f1ec"}.fa-calendar:before{content:"\f133"}.fa-calendar-alt:before{content:"\f073"}.fa-calendar-check:before{content:"\f274"}.fa-calendar-day:before{content:"\f783"}.fa-calendar-minus:before{content:"\f272"}.fa-calendar-plus:before{content:"\f271"}.fa-calendar-times:before{content:"\f273"}.fa-calendar-week:before{content:"\f784"}.fa-camera:before{content:"\f030"}.fa-camera-retro:before{content:"\f083"}.fa-campground:before{content:"\f6bb"}.fa-canadian-maple-leaf:before{content:"\f785"}.fa-candy-cane:before{content:"\f786"}.fa-cannabis:before{content:"\f55f"}.fa-capsules:before{content:"\f46b"}.fa-car:before{content:"\f1b9"}.fa-car-alt:before{content:"\f5de"}.fa-car-battery:before{content:"\f5df"}.fa-car-crash:before{content:"\f5e1"}.fa-car-side:before{content:"\f5e4"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-caret-square-down:before{content:"\f150"}.fa-caret-square-left:before{content:"\f191"}.fa-caret-square-right:before{content:"\f152"}.fa-caret-square-up:before{content:"\f151"}.fa-caret-up:before{content:"\f0d8"}.fa-carrot:before{content:"\f787"}.fa-cart-arrow-down:before{content:"\f218"}.fa-cart-plus:before{content:"\f217"}.fa-cash-register:before{content:"\f788"}.fa-cat:before{content:"\f6be"}.fa-cc-amazon-pay:before{content:"\f42d"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-apple-pay:before{content:"\f416"}.fa-cc-diners-club:before{content:"\f24c"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-cc-visa:before{content:"\f1f0"}.fa-centercode:before{content:"\f380"}.fa-centos:before{content:"\f789"}.fa-certificate:before{content:"\f0a3"}.fa-chair:before{content:"\f6c0"}.fa-chalkboard:before{content:"\f51b"}.fa-chalkboard-teacher:before{content:"\f51c"}.fa-charging-station:before{content:"\f5e7"}.fa-chart-area:before{content:"\f1fe"}.fa-chart-bar:before{content:"\f080"}.fa-chart-line:before{content:"\f201"}.fa-chart-pie:before{content:"\f200"}.fa-check:before{content:"\f00c"}.fa-check-circle:before{content:"\f058"}.fa-check-double:before{content:"\f560"}.fa-check-square:before{content:"\f14a"}.fa-cheese:before{content:"\f7ef"}.fa-chess:before{content:"\f439"}.fa-chess-bishop:before{content:"\f43a"}.fa-chess-board:before{content:"\f43c"}.fa-chess-king:before{content:"\f43f"}.fa-chess-knight:before{content:"\f441"}.fa-chess-pawn:before{content:"\f443"}.fa-chess-queen:before{content:"\f445"}.fa-chess-rook:before{content:"\f447"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-down:before{content:"\f078"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-chevron-up:before{content:"\f077"}.fa-child:before{content:"\f1ae"}.fa-chrome:before{content:"\f268"}.fa-church:before{content:"\f51d"}.fa-circle:before{content:"\f111"}.fa-circle-notch:before{content:"\f1ce"}.fa-city:before{content:"\f64f"}.fa-clinic-medical:before{content:"\f7f2"}.fa-clipboard:before{content:"\f328"}.fa-clipboard-check:before{content:"\f46c"}.fa-clipboard-list:before{content:"\f46d"}.fa-clock:before{content:"\f017"}.fa-clone:before{content:"\f24d"}.fa-closed-captioning:before{content:"\f20a"}.fa-cloud:before{content:"\f0c2"}.fa-cloud-download-alt:before{content:"\f381"}.fa-cloud-meatball:before{content:"\f73b"}.fa-cloud-moon:before{content:"\f6c3"}.fa-cloud-moon-rain:before{content:"\f73c"}.fa-cloud-rain:before{content:"\f73d"}.fa-cloud-showers-heavy:before{content:"\f740"}.fa-cloud-sun:before{content:"\f6c4"}.fa-cloud-sun-rain:before{content:"\f743"}.fa-cloud-upload-alt:before{content:"\f382"}.fa-cloudscale:before{content:"\f383"}.fa-cloudsmith:before{content:"\f384"}.fa-cloudversify:before{content:"\f385"}.fa-cocktail:before{content:"\f561"}.fa-code:before{content:"\f121"}.fa-code-branch:before{content:"\f126"}.fa-codepen:before{content:"\f1cb"}.fa-codiepie:before{content:"\f284"}.fa-coffee:before{content:"\f0f4"}.fa-cog:before{content:"\f013"}.fa-cogs:before{content:"\f085"}.fa-coins:before{content:"\f51e"}.fa-columns:before{content:"\f0db"}.fa-comment:before{content:"\f075"}.fa-comment-alt:before{content:"\f27a"}.fa-comment-dollar:before{content:"\f651"}.fa-comment-dots:before{content:"\f4ad"}.fa-comment-medical:before{content:"\f7f5"}.fa-comment-slash:before{content:"\f4b3"}.fa-comments:before{content:"\f086"}.fa-comments-dollar:before{content:"\f653"}.fa-compact-disc:before{content:"\f51f"}.fa-compass:before{content:"\f14e"}.fa-compress:before{content:"\f066"}.fa-compress-arrows-alt:before{content:"\f78c"}.fa-concierge-bell:before{content:"\f562"}.fa-confluence:before{content:"\f78d"}.fa-connectdevelop:before{content:"\f20e"}.fa-contao:before{content:"\f26d"}.fa-cookie:before{content:"\f563"}.fa-cookie-bite:before{content:"\f564"}.fa-copy:before{content:"\f0c5"}.fa-copyright:before{content:"\f1f9"}.fa-couch:before{content:"\f4b8"}.fa-cpanel:before{content:"\f388"}.fa-creative-commons:before{content:"\f25e"}.fa-creative-commons-by:before{content:"\f4e7"}.fa-creative-commons-nc:before{content:"\f4e8"}.fa-creative-commons-nc-eu:before{content:"\f4e9"}.fa-creative-commons-nc-jp:before{content:"\f4ea"}.fa-creative-commons-nd:before{content:"\f4eb"}.fa-creative-commons-pd:before{content:"\f4ec"}.fa-creative-commons-pd-alt:before{content:"\f4ed"}.fa-creative-commons-remix:before{content:"\f4ee"}.fa-creative-commons-sa:before{content:"\f4ef"}.fa-creative-commons-sampling:before{content:"\f4f0"}.fa-creative-commons-sampling-plus:before{content:"\f4f1"}.fa-creative-commons-share:before{content:"\f4f2"}.fa-creative-commons-zero:before{content:"\f4f3"}.fa-credit-card:before{content:"\f09d"}.fa-critical-role:before{content:"\f6c9"}.fa-crop:before{content:"\f125"}.fa-crop-alt:before{content:"\f565"}.fa-cross:before{content:"\f654"}.fa-crosshairs:before{content:"\f05b"}.fa-crow:before{content:"\f520"}.fa-crown:before{content:"\f521"}.fa-crutch:before{content:"\f7f7"}.fa-css3:before{content:"\f13c"}.fa-css3-alt:before{content:"\f38b"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-cut:before{content:"\f0c4"}.fa-cuttlefish:before{content:"\f38c"}.fa-d-and-d:before{content:"\f38d"}.fa-d-and-d-beyond:before{content:"\f6ca"}.fa-dashcube:before{content:"\f210"}.fa-database:before{content:"\f1c0"}.fa-deaf:before{content:"\f2a4"}.fa-delicious:before{content:"\f1a5"}.fa-democrat:before{content:"\f747"}.fa-deploydog:before{content:"\f38e"}.fa-deskpro:before{content:"\f38f"}.fa-desktop:before{content:"\f108"}.fa-dev:before{content:"\f6cc"}.fa-deviantart:before{content:"\f1bd"}.fa-dharmachakra:before{content:"\f655"}.fa-dhl:before{content:"\f790"}.fa-diagnoses:before{content:"\f470"}.fa-diaspora:before{content:"\f791"}.fa-dice:before{content:"\f522"}.fa-dice-d20:before{content:"\f6cf"}.fa-dice-d6:before{content:"\f6d1"}.fa-dice-five:before{content:"\f523"}.fa-dice-four:before{content:"\f524"}.fa-dice-one:before{content:"\f525"}.fa-dice-six:before{content:"\f526"}.fa-dice-three:before{content:"\f527"}.fa-dice-two:before{content:"\f528"}.fa-digg:before{content:"\f1a6"}.fa-digital-ocean:before{content:"\f391"}.fa-digital-tachograph:before{content:"\f566"}.fa-directions:before{content:"\f5eb"}.fa-discord:before{content:"\f392"}.fa-discourse:before{content:"\f393"}.fa-divide:before{content:"\f529"}.fa-dizzy:before{content:"\f567"}.fa-dna:before{content:"\f471"}.fa-dochub:before{content:"\f394"}.fa-docker:before{content:"\f395"}.fa-dog:before{content:"\f6d3"}.fa-dollar-sign:before{content:"\f155"}.fa-dolly:before{content:"\f472"}.fa-dolly-flatbed:before{content:"\f474"}.fa-donate:before{content:"\f4b9"}.fa-door-closed:before{content:"\f52a"}.fa-door-open:before{content:"\f52b"}.fa-dot-circle:before{content:"\f192"}.fa-dove:before{content:"\f4ba"}.fa-download:before{content:"\f019"}.fa-draft2digital:before{content:"\f396"}.fa-drafting-compass:before{content:"\f568"}.fa-dragon:before{content:"\f6d5"}.fa-draw-polygon:before{content:"\f5ee"}.fa-dribbble:before{content:"\f17d"}.fa-dribbble-square:before{content:"\f397"}.fa-dropbox:before{content:"\f16b"}.fa-drum:before{content:"\f569"}.fa-drum-steelpan:before{content:"\f56a"}.fa-drumstick-bite:before{content:"\f6d7"}.fa-drupal:before{content:"\f1a9"}.fa-dumbbell:before{content:"\f44b"}.fa-dumpster:before{content:"\f793"}.fa-dumpster-fire:before{content:"\f794"}.fa-dungeon:before{content:"\f6d9"}.fa-dyalog:before{content:"\f399"}.fa-earlybirds:before{content:"\f39a"}.fa-ebay:before{content:"\f4f4"}.fa-edge:before{content:"\f282"}.fa-edit:before{content:"\f044"}.fa-egg:before{content:"\f7fb"}.fa-eject:before{content:"\f052"}.fa-elementor:before{content:"\f430"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-ello:before{content:"\f5f1"}.fa-ember:before{content:"\f423"}.fa-empire:before{content:"\f1d1"}.fa-envelope:before{content:"\f0e0"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-text:before{content:"\f658"}.fa-envelope-square:before{content:"\f199"}.fa-envira:before{content:"\f299"}.fa-equals:before{content:"\f52c"}.fa-eraser:before{content:"\f12d"}.fa-erlang:before{content:"\f39d"}.fa-ethereum:before{content:"\f42e"}.fa-ethernet:before{content:"\f796"}.fa-etsy:before{content:"\f2d7"}.fa-euro-sign:before{content:"\f153"}.fa-exchange-alt:before{content:"\f362"}.fa-exclamation:before{content:"\f12a"}.fa-exclamation-circle:before{content:"\f06a"}.fa-exclamation-triangle:before{content:"\f071"}.fa-expand:before{content:"\f065"}.fa-expand-arrows-alt:before{content:"\f31e"}.fa-expeditedssl:before{content:"\f23e"}.fa-external-link-alt:before{content:"\f35d"}.fa-external-link-square-alt:before{content:"\f360"}.fa-eye:before{content:"\f06e"}.fa-eye-dropper:before{content:"\f1fb"}.fa-eye-slash:before{content:"\f070"}.fa-facebook:before{content:"\f09a"}.fa-facebook-f:before{content:"\f39e"}.fa-facebook-messenger:before{content:"\f39f"}.fa-facebook-square:before{content:"\f082"}.fa-fantasy-flight-games:before{content:"\f6dc"}.fa-fast-backward:before{content:"\f049"}.fa-fast-forward:before{content:"\f050"}.fa-fax:before{content:"\f1ac"}.fa-feather:before{content:"\f52d"}.fa-feather-alt:before{content:"\f56b"}.fa-fedex:before{content:"\f797"}.fa-fedora:before{content:"\f798"}.fa-female:before{content:"\f182"}.fa-fighter-jet:before{content:"\f0fb"}.fa-figma:before{content:"\f799"}.fa-file:before{content:"\f15b"}.fa-file-alt:before{content:"\f15c"}.fa-file-archive:before{content:"\f1c6"}.fa-file-audio:before{content:"\f1c7"}.fa-file-code:before{content:"\f1c9"}.fa-file-contract:before{content:"\f56c"}.fa-file-csv:before{content:"\f6dd"}.fa-file-download:before{content:"\f56d"}.fa-file-excel:before{content:"\f1c3"}.fa-file-export:before{content:"\f56e"}.fa-file-image:before{content:"\f1c5"}.fa-file-import:before{content:"\f56f"}.fa-file-invoice:before{content:"\f570"}.fa-file-invoice-dollar:before{content:"\f571"}.fa-file-medical:before{content:"\f477"}.fa-file-medical-alt:before{content:"\f478"}.fa-file-pdf:before{content:"\f1c1"}.fa-file-powerpoint:before{content:"\f1c4"}.fa-file-prescription:before{content:"\f572"}.fa-file-signature:before{content:"\f573"}.fa-file-upload:before{content:"\f574"}.fa-file-video:before{content:"\f1c8"}.fa-file-word:before{content:"\f1c2"}.fa-fill:before{content:"\f575"}.fa-fill-drip:before{content:"\f576"}.fa-film:before{content:"\f008"}.fa-filter:before{content:"\f0b0"}.fa-fingerprint:before{content:"\f577"}.fa-fire:before{content:"\f06d"}.fa-fire-alt:before{content:"\f7e4"}.fa-fire-extinguisher:before{content:"\f134"}.fa-firefox:before{content:"\f269"}.fa-first-aid:before{content:"\f479"}.fa-first-order:before{content:"\f2b0"}.fa-first-order-alt:before{content:"\f50a"}.fa-firstdraft:before{content:"\f3a1"}.fa-fish:before{content:"\f578"}.fa-fist-raised:before{content:"\f6de"}.fa-flag:before{content:"\f024"}.fa-flag-checkered:before{content:"\f11e"}.fa-flag-usa:before{content:"\f74d"}.fa-flask:before{content:"\f0c3"}.fa-flickr:before{content:"\f16e"}.fa-flipboard:before{content:"\f44d"}.fa-flushed:before{content:"\f579"}.fa-fly:before{content:"\f417"}.fa-folder:before{content:"\f07b"}.fa-folder-minus:before{content:"\f65d"}.fa-folder-open:before{content:"\f07c"}.fa-folder-plus:before{content:"\f65e"}.fa-font:before{content:"\f031"}.fa-font-awesome:before{content:"\f2b4"}.fa-font-awesome-alt:before{content:"\f35c"}.fa-font-awesome-flag:before{content:"\f425"}.fa-font-awesome-logo-full:before{content:"\f4e6"}.fa-fonticons:before{content:"\f280"}.fa-fonticons-fi:before{content:"\f3a2"}.fa-football-ball:before{content:"\f44e"}.fa-fort-awesome:before{content:"\f286"}.fa-fort-awesome-alt:before{content:"\f3a3"}.fa-forumbee:before{content:"\f211"}.fa-forward:before{content:"\f04e"}.fa-foursquare:before{content:"\f180"}.fa-free-code-camp:before{content:"\f2c5"}.fa-freebsd:before{content:"\f3a4"}.fa-frog:before{content:"\f52e"}.fa-frown:before{content:"\f119"}.fa-frown-open:before{content:"\f57a"}.fa-fulcrum:before{content:"\f50b"}.fa-funnel-dollar:before{content:"\f662"}.fa-futbol:before{content:"\f1e3"}.fa-galactic-republic:before{content:"\f50c"}.fa-galactic-senate:before{content:"\f50d"}.fa-gamepad:before{content:"\f11b"}.fa-gas-pump:before{content:"\f52f"}.fa-gavel:before{content:"\f0e3"}.fa-gem:before{content:"\f3a5"}.fa-genderless:before{content:"\f22d"}.fa-get-pocket:before{content:"\f265"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-ghost:before{content:"\f6e2"}.fa-gift:before{content:"\f06b"}.fa-gifts:before{content:"\f79c"}.fa-git:before{content:"\f1d3"}.fa-git-square:before{content:"\f1d2"}.fa-github:before{content:"\f09b"}.fa-github-alt:before{content:"\f113"}.fa-github-square:before{content:"\f092"}.fa-gitkraken:before{content:"\f3a6"}.fa-gitlab:before{content:"\f296"}.fa-gitter:before{content:"\f426"}.fa-glass-cheers:before{content:"\f79f"}.fa-glass-martini:before{content:"\f000"}.fa-glass-martini-alt:before{content:"\f57b"}.fa-glass-whiskey:before{content:"\f7a0"}.fa-glasses:before{content:"\f530"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-globe:before{content:"\f0ac"}.fa-globe-africa:before{content:"\f57c"}.fa-globe-americas:before{content:"\f57d"}.fa-globe-asia:before{content:"\f57e"}.fa-globe-europe:before{content:"\f7a2"}.fa-gofore:before{content:"\f3a7"}.fa-golf-ball:before{content:"\f450"}.fa-goodreads:before{content:"\f3a8"}.fa-goodreads-g:before{content:"\f3a9"}.fa-google:before{content:"\f1a0"}.fa-google-drive:before{content:"\f3aa"}.fa-google-play:before{content:"\f3ab"}.fa-google-plus:before{content:"\f2b3"}.fa-google-plus-g:before{content:"\f0d5"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-wallet:before{content:"\f1ee"}.fa-gopuram:before{content:"\f664"}.fa-graduation-cap:before{content:"\f19d"}.fa-gratipay:before{content:"\f184"}.fa-grav:before{content:"\f2d6"}.fa-greater-than:before{content:"\f531"}.fa-greater-than-equal:before{content:"\f532"}.fa-grimace:before{content:"\f57f"}.fa-grin:before{content:"\f580"}.fa-grin-alt:before{content:"\f581"}.fa-grin-beam:before{content:"\f582"}.fa-grin-beam-sweat:before{content:"\f583"}.fa-grin-hearts:before{content:"\f584"}.fa-grin-squint:before{content:"\f585"}.fa-grin-squint-tears:before{content:"\f586"}.fa-grin-stars:before{content:"\f587"}.fa-grin-tears:before{content:"\f588"}.fa-grin-tongue:before{content:"\f589"}.fa-grin-tongue-squint:before{content:"\f58a"}.fa-grin-tongue-wink:before{content:"\f58b"}.fa-grin-wink:before{content:"\f58c"}.fa-grip-horizontal:before{content:"\f58d"}.fa-grip-lines:before{content:"\f7a4"}.fa-grip-lines-vertical:before{content:"\f7a5"}.fa-grip-vertical:before{content:"\f58e"}.fa-gripfire:before{content:"\f3ac"}.fa-grunt:before{content:"\f3ad"}.fa-guitar:before{content:"\f7a6"}.fa-gulp:before{content:"\f3ae"}.fa-h-square:before{content:"\f0fd"}.fa-hacker-news:before{content:"\f1d4"}.fa-hacker-news-square:before{content:"\f3af"}.fa-hackerrank:before{content:"\f5f7"}.fa-hamburger:before{content:"\f805"}.fa-hammer:before{content:"\f6e3"}.fa-hamsa:before{content:"\f665"}.fa-hand-holding:before{content:"\f4bd"}.fa-hand-holding-heart:before{content:"\f4be"}.fa-hand-holding-usd:before{content:"\f4c0"}.fa-hand-lizard:before{content:"\f258"}.fa-hand-middle-finger:before{content:"\f806"}.fa-hand-paper:before{content:"\f256"}.fa-hand-peace:before{content:"\f25b"}.fa-hand-point-down:before{content:"\f0a7"}.fa-hand-point-left:before{content:"\f0a5"}.fa-hand-point-right:before{content:"\f0a4"}.fa-hand-point-up:before{content:"\f0a6"}.fa-hand-pointer:before{content:"\f25a"}.fa-hand-rock:before{content:"\f255"}.fa-hand-scissors:before{content:"\f257"}.fa-hand-spock:before{content:"\f259"}.fa-hands:before{content:"\f4c2"}.fa-hands-helping:before{content:"\f4c4"}.fa-handshake:before{content:"\f2b5"}.fa-hanukiah:before{content:"\f6e6"}.fa-hard-hat:before{content:"\f807"}.fa-hashtag:before{content:"\f292"}.fa-hat-wizard:before{content:"\f6e8"}.fa-haykal:before{content:"\f666"}.fa-hdd:before{content:"\f0a0"}.fa-heading:before{content:"\f1dc"}.fa-headphones:before{content:"\f025"}.fa-headphones-alt:before{content:"\f58f"}.fa-headset:before{content:"\f590"}.fa-heart:before{content:"\f004"}.fa-heart-broken:before{content:"\f7a9"}.fa-heartbeat:before{content:"\f21e"}.fa-helicopter:before{content:"\f533"}.fa-highlighter:before{content:"\f591"}.fa-hiking:before{content:"\f6ec"}.fa-hippo:before{content:"\f6ed"}.fa-hips:before{content:"\f452"}.fa-hire-a-helper:before{content:"\f3b0"}.fa-history:before{content:"\f1da"}.fa-hockey-puck:before{content:"\f453"}.fa-holly-berry:before{content:"\f7aa"}.fa-home:before{content:"\f015"}.fa-hooli:before{content:"\f427"}.fa-hornbill:before{content:"\f592"}.fa-horse:before{content:"\f6f0"}.fa-horse-head:before{content:"\f7ab"}.fa-hospital:before{content:"\f0f8"}.fa-hospital-alt:before{content:"\f47d"}.fa-hospital-symbol:before{content:"\f47e"}.fa-hot-tub:before{content:"\f593"}.fa-hotdog:before{content:"\f80f"}.fa-hotel:before{content:"\f594"}.fa-hotjar:before{content:"\f3b1"}.fa-hourglass:before{content:"\f254"}.fa-hourglass-end:before{content:"\f253"}.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-start:before{content:"\f251"}.fa-house-damage:before{content:"\f6f1"}.fa-houzz:before{content:"\f27c"}.fa-hryvnia:before{content:"\f6f2"}.fa-html5:before{content:"\f13b"}.fa-hubspot:before{content:"\f3b2"}.fa-i-cursor:before{content:"\f246"}.fa-ice-cream:before{content:"\f810"}.fa-icicles:before{content:"\f7ad"}.fa-id-badge:before{content:"\f2c1"}.fa-id-card:before{content:"\f2c2"}.fa-id-card-alt:before{content:"\f47f"}.fa-igloo:before{content:"\f7ae"}.fa-image:before{content:"\f03e"}.fa-images:before{content:"\f302"}.fa-imdb:before{content:"\f2d8"}.fa-inbox:before{content:"\f01c"}.fa-indent:before{content:"\f03c"}.fa-industry:before{content:"\f275"}.fa-infinity:before{content:"\f534"}.fa-info:before{content:"\f129"}.fa-info-circle:before{content:"\f05a"}.fa-instagram:before{content:"\f16d"}.fa-intercom:before{content:"\f7af"}.fa-internet-explorer:before{content:"\f26b"}.fa-invision:before{content:"\f7b0"}.fa-ioxhost:before{content:"\f208"}.fa-italic:before{content:"\f033"}.fa-itunes:before{content:"\f3b4"}.fa-itunes-note:before{content:"\f3b5"}.fa-java:before{content:"\f4e4"}.fa-jedi:before{content:"\f669"}.fa-jedi-order:before{content:"\f50e"}.fa-jenkins:before{content:"\f3b6"}.fa-jira:before{content:"\f7b1"}.fa-joget:before{content:"\f3b7"}.fa-joint:before{content:"\f595"}.fa-joomla:before{content:"\f1aa"}.fa-journal-whills:before{content:"\f66a"}.fa-js:before{content:"\f3b8"}.fa-js-square:before{content:"\f3b9"}.fa-jsfiddle:before{content:"\f1cc"}.fa-kaaba:before{content:"\f66b"}.fa-kaggle:before{content:"\f5fa"}.fa-key:before{content:"\f084"}.fa-keybase:before{content:"\f4f5"}.fa-keyboard:before{content:"\f11c"}.fa-keycdn:before{content:"\f3ba"}.fa-khanda:before{content:"\f66d"}.fa-kickstarter:before{content:"\f3bb"}.fa-kickstarter-k:before{content:"\f3bc"}.fa-kiss:before{content:"\f596"}.fa-kiss-beam:before{content:"\f597"}.fa-kiss-wink-heart:before{content:"\f598"}.fa-kiwi-bird:before{content:"\f535"}.fa-korvue:before{content:"\f42f"}.fa-landmark:before{content:"\f66f"}.fa-language:before{content:"\f1ab"}.fa-laptop:before{content:"\f109"}.fa-laptop-code:before{content:"\f5fc"}.fa-laptop-medical:before{content:"\f812"}.fa-laravel:before{content:"\f3bd"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-laugh:before{content:"\f599"}.fa-laugh-beam:before{content:"\f59a"}.fa-laugh-squint:before{content:"\f59b"}.fa-laugh-wink:before{content:"\f59c"}.fa-layer-group:before{content:"\f5fd"}.fa-leaf:before{content:"\f06c"}.fa-leanpub:before{content:"\f212"}.fa-lemon:before{content:"\f094"}.fa-less:before{content:"\f41d"}.fa-less-than:before{content:"\f536"}.fa-less-than-equal:before{content:"\f537"}.fa-level-down-alt:before{content:"\f3be"}.fa-level-up-alt:before{content:"\f3bf"}.fa-life-ring:before{content:"\f1cd"}.fa-lightbulb:before{content:"\f0eb"}.fa-line:before{content:"\f3c0"}.fa-link:before{content:"\f0c1"}.fa-linkedin:before{content:"\f08c"}.fa-linkedin-in:before{content:"\f0e1"}.fa-linode:before{content:"\f2b8"}.fa-linux:before{content:"\f17c"}.fa-lira-sign:before{content:"\f195"}.fa-list:before{content:"\f03a"}.fa-list-alt:before{content:"\f022"}.fa-list-ol:before{content:"\f0cb"}.fa-list-ul:before{content:"\f0ca"}.fa-location-arrow:before{content:"\f124"}.fa-lock:before{content:"\f023"}.fa-lock-open:before{content:"\f3c1"}.fa-long-arrow-alt-down:before{content:"\f309"}.fa-long-arrow-alt-left:before{content:"\f30a"}.fa-long-arrow-alt-right:before{content:"\f30b"}.fa-long-arrow-alt-up:before{content:"\f30c"}.fa-low-vision:before{content:"\f2a8"}.fa-luggage-cart:before{content:"\f59d"}.fa-lyft:before{content:"\f3c3"}.fa-magento:before{content:"\f3c4"}.fa-magic:before{content:"\f0d0"}.fa-magnet:before{content:"\f076"}.fa-mail-bulk:before{content:"\f674"}.fa-mailchimp:before{content:"\f59e"}.fa-male:before{content:"\f183"}.fa-mandalorian:before{content:"\f50f"}.fa-map:before{content:"\f279"}.fa-map-marked:before{content:"\f59f"}.fa-map-marked-alt:before{content:"\f5a0"}.fa-map-marker:before{content:"\f041"}.fa-map-marker-alt:before{content:"\f3c5"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-markdown:before{content:"\f60f"}.fa-marker:before{content:"\f5a1"}.fa-mars:before{content:"\f222"}.fa-mars-double:before{content:"\f227"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mask:before{content:"\f6fa"}.fa-mastodon:before{content:"\f4f6"}.fa-maxcdn:before{content:"\f136"}.fa-medal:before{content:"\f5a2"}.fa-medapps:before{content:"\f3c6"}.fa-medium:before{content:"\f23a"}.fa-medium-m:before{content:"\f3c7"}.fa-medkit:before{content:"\f0fa"}.fa-medrt:before{content:"\f3c8"}.fa-meetup:before{content:"\f2e0"}.fa-megaport:before{content:"\f5a3"}.fa-meh:before{content:"\f11a"}.fa-meh-blank:before{content:"\f5a4"}.fa-meh-rolling-eyes:before{content:"\f5a5"}.fa-memory:before{content:"\f538"}.fa-mendeley:before{content:"\f7b3"}.fa-menorah:before{content:"\f676"}.fa-mercury:before{content:"\f223"}.fa-meteor:before{content:"\f753"}.fa-microchip:before{content:"\f2db"}.fa-microphone:before{content:"\f130"}.fa-microphone-alt:before{content:"\f3c9"}.fa-microphone-alt-slash:before{content:"\f539"}.fa-microphone-slash:before{content:"\f131"}.fa-microscope:before{content:"\f610"}.fa-microsoft:before{content:"\f3ca"}.fa-minus:before{content:"\f068"}.fa-minus-circle:before{content:"\f056"}.fa-minus-square:before{content:"\f146"}.fa-mitten:before{content:"\f7b5"}.fa-mix:before{content:"\f3cb"}.fa-mixcloud:before{content:"\f289"}.fa-mizuni:before{content:"\f3cc"}.fa-mobile:before{content:"\f10b"}.fa-mobile-alt:before{content:"\f3cd"}.fa-modx:before{content:"\f285"}.fa-monero:before{content:"\f3d0"}.fa-money-bill:before{content:"\f0d6"}.fa-money-bill-alt:before{content:"\f3d1"}.fa-money-bill-wave:before{content:"\f53a"}.fa-money-bill-wave-alt:before{content:"\f53b"}.fa-money-check:before{content:"\f53c"}.fa-money-check-alt:before{content:"\f53d"}.fa-monument:before{content:"\f5a6"}.fa-moon:before{content:"\f186"}.fa-mortar-pestle:before{content:"\f5a7"}.fa-mosque:before{content:"\f678"}.fa-motorcycle:before{content:"\f21c"}.fa-mountain:before{content:"\f6fc"}.fa-mouse-pointer:before{content:"\f245"}.fa-mug-hot:before{content:"\f7b6"}.fa-music:before{content:"\f001"}.fa-napster:before{content:"\f3d2"}.fa-neos:before{content:"\f612"}.fa-network-wired:before{content:"\f6ff"}.fa-neuter:before{content:"\f22c"}.fa-newspaper:before{content:"\f1ea"}.fa-nimblr:before{content:"\f5a8"}.fa-nintendo-switch:before{content:"\f418"}.fa-node:before{content:"\f419"}.fa-node-js:before{content:"\f3d3"}.fa-not-equal:before{content:"\f53e"}.fa-notes-medical:before{content:"\f481"}.fa-npm:before{content:"\f3d4"}.fa-ns8:before{content:"\f3d5"}.fa-nutritionix:before{content:"\f3d6"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-oil-can:before{content:"\f613"}.fa-old-republic:before{content:"\f510"}.fa-om:before{content:"\f679"}.fa-opencart:before{content:"\f23d"}.fa-openid:before{content:"\f19b"}.fa-opera:before{content:"\f26a"}.fa-optin-monster:before{content:"\f23c"}.fa-osi:before{content:"\f41a"}.fa-otter:before{content:"\f700"}.fa-outdent:before{content:"\f03b"}.fa-page4:before{content:"\f3d7"}.fa-pagelines:before{content:"\f18c"}.fa-pager:before{content:"\f815"}.fa-paint-brush:before{content:"\f1fc"}.fa-paint-roller:before{content:"\f5aa"}.fa-palette:before{content:"\f53f"}.fa-palfed:before{content:"\f3d8"}.fa-pallet:before{content:"\f482"}.fa-paper-plane:before{content:"\f1d8"}.fa-paperclip:before{content:"\f0c6"}.fa-parachute-box:before{content:"\f4cd"}.fa-paragraph:before{content:"\f1dd"}.fa-parking:before{content:"\f540"}.fa-passport:before{content:"\f5ab"}.fa-pastafarianism:before{content:"\f67b"}.fa-paste:before{content:"\f0ea"}.fa-patreon:before{content:"\f3d9"}.fa-pause:before{content:"\f04c"}.fa-pause-circle:before{content:"\f28b"}.fa-paw:before{content:"\f1b0"}.fa-paypal:before{content:"\f1ed"}.fa-peace:before{content:"\f67c"}.fa-pen:before{content:"\f304"}.fa-pen-alt:before{content:"\f305"}.fa-pen-fancy:before{content:"\f5ac"}.fa-pen-nib:before{content:"\f5ad"}.fa-pen-square:before{content:"\f14b"}.fa-pencil-alt:before{content:"\f303"}.fa-pencil-ruler:before{content:"\f5ae"}.fa-penny-arcade:before{content:"\f704"}.fa-people-carry:before{content:"\f4ce"}.fa-pepper-hot:before{content:"\f816"}.fa-percent:before{content:"\f295"}.fa-percentage:before{content:"\f541"}.fa-periscope:before{content:"\f3da"}.fa-person-booth:before{content:"\f756"}.fa-phabricator:before{content:"\f3db"}.fa-phoenix-framework:before{content:"\f3dc"}.fa-phoenix-squadron:before{content:"\f511"}.fa-phone:before{content:"\f095"}.fa-phone-slash:before{content:"\f3dd"}.fa-phone-square:before{content:"\f098"}.fa-phone-volume:before{content:"\f2a0"}.fa-php:before{content:"\f457"}.fa-pied-piper:before{content:"\f2ae"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-pied-piper-hat:before{content:"\f4e5"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-piggy-bank:before{content:"\f4d3"}.fa-pills:before{content:"\f484"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-p:before{content:"\f231"}.fa-pinterest-square:before{content:"\f0d3"}.fa-pizza-slice:before{content:"\f818"}.fa-place-of-worship:before{content:"\f67f"}.fa-plane:before{content:"\f072"}.fa-plane-arrival:before{content:"\f5af"}.fa-plane-departure:before{content:"\f5b0"}.fa-play:before{content:"\f04b"}.fa-play-circle:before{content:"\f144"}.fa-playstation:before{content:"\f3df"}.fa-plug:before{content:"\f1e6"}.fa-plus:before{content:"\f067"}.fa-plus-circle:before{content:"\f055"}.fa-plus-square:before{content:"\f0fe"}.fa-podcast:before{content:"\f2ce"}.fa-poll:before{content:"\f681"}.fa-poll-h:before{content:"\f682"}.fa-poo:before{content:"\f2fe"}.fa-poo-storm:before{content:"\f75a"}.fa-poop:before{content:"\f619"}.fa-portrait:before{content:"\f3e0"}.fa-pound-sign:before{content:"\f154"}.fa-power-off:before{content:"\f011"}.fa-pray:before{content:"\f683"}.fa-praying-hands:before{content:"\f684"}.fa-prescription:before{content:"\f5b1"}.fa-prescription-bottle:before{content:"\f485"}.fa-prescription-bottle-alt:before{content:"\f486"}.fa-print:before{content:"\f02f"}.fa-procedures:before{content:"\f487"}.fa-product-hunt:before{content:"\f288"}.fa-project-diagram:before{content:"\f542"}.fa-pushed:before{content:"\f3e1"}.fa-puzzle-piece:before{content:"\f12e"}.fa-python:before{content:"\f3e2"}.fa-qq:before{content:"\f1d6"}.fa-qrcode:before{content:"\f029"}.fa-question:before{content:"\f128"}.fa-question-circle:before{content:"\f059"}.fa-quidditch:before{content:"\f458"}.fa-quinscape:before{content:"\f459"}.fa-quora:before{content:"\f2c4"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-quran:before{content:"\f687"}.fa-r-project:before{content:"\f4f7"}.fa-radiation:before{content:"\f7b9"}.fa-radiation-alt:before{content:"\f7ba"}.fa-rainbow:before{content:"\f75b"}.fa-random:before{content:"\f074"}.fa-raspberry-pi:before{content:"\f7bb"}.fa-ravelry:before{content:"\f2d9"}.fa-react:before{content:"\f41b"}.fa-reacteurope:before{content:"\f75d"}.fa-readme:before{content:"\f4d5"}.fa-rebel:before{content:"\f1d0"}.fa-receipt:before{content:"\f543"}.fa-recycle:before{content:"\f1b8"}.fa-red-river:before{content:"\f3e3"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-alien:before{content:"\f281"}.fa-reddit-square:before{content:"\f1a2"}.fa-redhat:before{content:"\f7bc"}.fa-redo:before{content:"\f01e"}.fa-redo-alt:before{content:"\f2f9"}.fa-registered:before{content:"\f25d"}.fa-renren:before{content:"\f18b"}.fa-reply:before{content:"\f3e5"}.fa-reply-all:before{content:"\f122"}.fa-replyd:before{content:"\f3e6"}.fa-republican:before{content:"\f75e"}.fa-researchgate:before{content:"\f4f8"}.fa-resolving:before{content:"\f3e7"}.fa-restroom:before{content:"\f7bd"}.fa-retweet:before{content:"\f079"}.fa-rev:before{content:"\f5b2"}.fa-ribbon:before{content:"\f4d6"}.fa-ring:before{content:"\f70b"}.fa-road:before{content:"\f018"}.fa-robot:before{content:"\f544"}.fa-rocket:before{content:"\f135"}.fa-rocketchat:before{content:"\f3e8"}.fa-rockrms:before{content:"\f3e9"}.fa-route:before{content:"\f4d7"}.fa-rss:before{content:"\f09e"}.fa-rss-square:before{content:"\f143"}.fa-ruble-sign:before{content:"\f158"}.fa-ruler:before{content:"\f545"}.fa-ruler-combined:before{content:"\f546"}.fa-ruler-horizontal:before{content:"\f547"}.fa-ruler-vertical:before{content:"\f548"}.fa-running:before{content:"\f70c"}.fa-rupee-sign:before{content:"\f156"}.fa-sad-cry:before{content:"\f5b3"}.fa-sad-tear:before{content:"\f5b4"}.fa-safari:before{content:"\f267"}.fa-sass:before{content:"\f41e"}.fa-satellite:before{content:"\f7bf"}.fa-satellite-dish:before{content:"\f7c0"}.fa-save:before{content:"\f0c7"}.fa-schlix:before{content:"\f3ea"}.fa-school:before{content:"\f549"}.fa-screwdriver:before{content:"\f54a"}.fa-scribd:before{content:"\f28a"}.fa-scroll:before{content:"\f70e"}.fa-sd-card:before{content:"\f7c2"}.fa-search:before{content:"\f002"}.fa-search-dollar:before{content:"\f688"}.fa-search-location:before{content:"\f689"}.fa-search-minus:before{content:"\f010"}.fa-search-plus:before{content:"\f00e"}.fa-searchengin:before{content:"\f3eb"}.fa-seedling:before{content:"\f4d8"}.fa-sellcast:before{content:"\f2da"}.fa-sellsy:before{content:"\f213"}.fa-server:before{content:"\f233"}.fa-servicestack:before{content:"\f3ec"}.fa-shapes:before{content:"\f61f"}.fa-share:before{content:"\f064"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-share-square:before{content:"\f14d"}.fa-shekel-sign:before{content:"\f20b"}.fa-shield-alt:before{content:"\f3ed"}.fa-ship:before{content:"\f21a"}.fa-shipping-fast:before{content:"\f48b"}.fa-shirtsinbulk:before{content:"\f214"}.fa-shoe-prints:before{content:"\f54b"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-shopping-cart:before{content:"\f07a"}.fa-shopware:before{content:"\f5b5"}.fa-shower:before{content:"\f2cc"}.fa-shuttle-van:before{content:"\f5b6"}.fa-sign:before{content:"\f4d9"}.fa-sign-in-alt:before{content:"\f2f6"}.fa-sign-language:before{content:"\f2a7"}.fa-sign-out-alt:before{content:"\f2f5"}.fa-signal:before{content:"\f012"}.fa-signature:before{content:"\f5b7"}.fa-sim-card:before{content:"\f7c4"}.fa-simplybuilt:before{content:"\f215"}.fa-sistrix:before{content:"\f3ee"}.fa-sitemap:before{content:"\f0e8"}.fa-sith:before{content:"\f512"}.fa-skating:before{content:"\f7c5"}.fa-sketch:before{content:"\f7c6"}.fa-skiing:before{content:"\f7c9"}.fa-skiing-nordic:before{content:"\f7ca"}.fa-skull:before{content:"\f54c"}.fa-skull-crossbones:before{content:"\f714"}.fa-skyatlas:before{content:"\f216"}.fa-skype:before{content:"\f17e"}.fa-slack:before{content:"\f198"}.fa-slack-hash:before{content:"\f3ef"}.fa-slash:before{content:"\f715"}.fa-sleigh:before{content:"\f7cc"}.fa-sliders-h:before{content:"\f1de"}.fa-slideshare:before{content:"\f1e7"}.fa-smile:before{content:"\f118"}.fa-smile-beam:before{content:"\f5b8"}.fa-smile-wink:before{content:"\f4da"}.fa-smog:before{content:"\f75f"}.fa-smoking:before{content:"\f48d"}.fa-smoking-ban:before{content:"\f54d"}.fa-sms:before{content:"\f7cd"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-snowboarding:before{content:"\f7ce"}.fa-snowflake:before{content:"\f2dc"}.fa-snowman:before{content:"\f7d0"}.fa-snowplow:before{content:"\f7d2"}.fa-socks:before{content:"\f696"}.fa-solar-panel:before{content:"\f5ba"}.fa-sort:before{content:"\f0dc"}.fa-sort-alpha-down:before{content:"\f15d"}.fa-sort-alpha-up:before{content:"\f15e"}.fa-sort-amount-down:before{content:"\f160"}.fa-sort-amount-up:before{content:"\f161"}.fa-sort-down:before{content:"\f0dd"}.fa-sort-numeric-down:before{content:"\f162"}.fa-sort-numeric-up:before{content:"\f163"}.fa-sort-up:before{content:"\f0de"}.fa-soundcloud:before{content:"\f1be"}.fa-sourcetree:before{content:"\f7d3"}.fa-spa:before{content:"\f5bb"}.fa-space-shuttle:before{content:"\f197"}.fa-speakap:before{content:"\f3f3"}.fa-spider:before{content:"\f717"}.fa-spinner:before{content:"\f110"}.fa-splotch:before{content:"\f5bc"}.fa-spotify:before{content:"\f1bc"}.fa-spray-can:before{content:"\f5bd"}.fa-square:before{content:"\f0c8"}.fa-square-full:before{content:"\f45c"}.fa-square-root-alt:before{content:"\f698"}.fa-squarespace:before{content:"\f5be"}.fa-stack-exchange:before{content:"\f18d"}.fa-stack-overflow:before{content:"\f16c"}.fa-stamp:before{content:"\f5bf"}.fa-star:before{content:"\f005"}.fa-star-and-crescent:before{content:"\f699"}.fa-star-half:before{content:"\f089"}.fa-star-half-alt:before{content:"\f5c0"}.fa-star-of-david:before{content:"\f69a"}.fa-star-of-life:before{content:"\f621"}.fa-staylinked:before{content:"\f3f5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-steam-symbol:before{content:"\f3f6"}.fa-step-backward:before{content:"\f048"}.fa-step-forward:before{content:"\f051"}.fa-stethoscope:before{content:"\f0f1"}.fa-sticker-mule:before{content:"\f3f7"}.fa-sticky-note:before{content:"\f249"}.fa-stop:before{content:"\f04d"}.fa-stop-circle:before{content:"\f28d"}.fa-stopwatch:before{content:"\f2f2"}.fa-store:before{content:"\f54e"}.fa-store-alt:before{content:"\f54f"}.fa-strava:before{content:"\f428"}.fa-stream:before{content:"\f550"}.fa-street-view:before{content:"\f21d"}.fa-strikethrough:before{content:"\f0cc"}.fa-stripe:before{content:"\f429"}.fa-stripe-s:before{content:"\f42a"}.fa-stroopwafel:before{content:"\f551"}.fa-studiovinari:before{content:"\f3f8"}.fa-stumbleupon:before{content:"\f1a4"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-subscript:before{content:"\f12c"}.fa-subway:before{content:"\f239"}.fa-suitcase:before{content:"\f0f2"}.fa-suitcase-rolling:before{content:"\f5c1"}.fa-sun:before{content:"\f185"}.fa-superpowers:before{content:"\f2dd"}.fa-superscript:before{content:"\f12b"}.fa-supple:before{content:"\f3f9"}.fa-surprise:before{content:"\f5c2"}.fa-suse:before{content:"\f7d6"}.fa-swatchbook:before{content:"\f5c3"}.fa-swimmer:before{content:"\f5c4"}.fa-swimming-pool:before{content:"\f5c5"}.fa-synagogue:before{content:"\f69b"}.fa-sync:before{content:"\f021"}.fa-sync-alt:before{content:"\f2f1"}.fa-syringe:before{content:"\f48e"}.fa-table:before{content:"\f0ce"}.fa-table-tennis:before{content:"\f45d"}.fa-tablet:before{content:"\f10a"}.fa-tablet-alt:before{content:"\f3fa"}.fa-tablets:before{content:"\f490"}.fa-tachometer-alt:before{content:"\f3fd"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-tape:before{content:"\f4db"}.fa-tasks:before{content:"\f0ae"}.fa-taxi:before{content:"\f1ba"}.fa-teamspeak:before{content:"\f4f9"}.fa-teeth:before{content:"\f62e"}.fa-teeth-open:before{content:"\f62f"}.fa-telegram:before{content:"\f2c6"}.fa-telegram-plane:before{content:"\f3fe"}.fa-temperature-high:before{content:"\f769"}.fa-temperature-low:before{content:"\f76b"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-tenge:before{content:"\f7d7"}.fa-terminal:before{content:"\f120"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-th:before{content:"\f00a"}.fa-th-large:before{content:"\f009"}.fa-th-list:before{content:"\f00b"}.fa-the-red-yeti:before{content:"\f69d"}.fa-theater-masks:before{content:"\f630"}.fa-themeco:before{content:"\f5c6"}.fa-themeisle:before{content:"\f2b2"}.fa-thermometer:before{content:"\f491"}.fa-thermometer-empty:before{content:"\f2cb"}.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-think-peaks:before{content:"\f731"}.fa-thumbs-down:before{content:"\f165"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbtack:before{content:"\f08d"}.fa-ticket-alt:before{content:"\f3ff"}.fa-times:before{content:"\f00d"}.fa-times-circle:before{content:"\f057"}.fa-tint:before{content:"\f043"}.fa-tint-slash:before{content:"\f5c7"}.fa-tired:before{content:"\f5c8"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-toilet:before{content:"\f7d8"}.fa-toilet-paper:before{content:"\f71e"}.fa-toolbox:before{content:"\f552"}.fa-tools:before{content:"\f7d9"}.fa-tooth:before{content:"\f5c9"}.fa-torah:before{content:"\f6a0"}.fa-torii-gate:before{content:"\f6a1"}.fa-tractor:before{content:"\f722"}.fa-trade-federation:before{content:"\f513"}.fa-trademark:before{content:"\f25c"}.fa-traffic-light:before{content:"\f637"}.fa-train:before{content:"\f238"}.fa-tram:before{content:"\f7da"}.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-trash:before{content:"\f1f8"}.fa-trash-alt:before{content:"\f2ed"}.fa-trash-restore:before{content:"\f829"}.fa-trash-restore-alt:before{content:"\f82a"}.fa-tree:before{content:"\f1bb"}.fa-trello:before{content:"\f181"}.fa-tripadvisor:before{content:"\f262"}.fa-trophy:before{content:"\f091"}.fa-truck:before{content:"\f0d1"}.fa-truck-loading:before{content:"\f4de"}.fa-truck-monster:before{content:"\f63b"}.fa-truck-moving:before{content:"\f4df"}.fa-truck-pickup:before{content:"\f63c"}.fa-tshirt:before{content:"\f553"}.fa-tty:before{content:"\f1e4"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-tv:before{content:"\f26c"}.fa-twitch:before{content:"\f1e8"}.fa-twitter:before{content:"\f099"}.fa-twitter-square:before{content:"\f081"}.fa-typo3:before{content:"\f42b"}.fa-uber:before{content:"\f402"}.fa-ubuntu:before{content:"\f7df"}.fa-uikit:before{content:"\f403"}.fa-umbrella:before{content:"\f0e9"}.fa-umbrella-beach:before{content:"\f5ca"}.fa-underline:before{content:"\f0cd"}.fa-undo:before{content:"\f0e2"}.fa-undo-alt:before{content:"\f2ea"}.fa-uniregistry:before{content:"\f404"}.fa-universal-access:before{content:"\f29a"}.fa-university:before{content:"\f19c"}.fa-unlink:before{content:"\f127"}.fa-unlock:before{content:"\f09c"}.fa-unlock-alt:before{content:"\f13e"}.fa-untappd:before{content:"\f405"}.fa-upload:before{content:"\f093"}.fa-ups:before{content:"\f7e0"}.fa-usb:before{content:"\f287"}.fa-user:before{content:"\f007"}.fa-user-alt:before{content:"\f406"}.fa-user-alt-slash:before{content:"\f4fa"}.fa-user-astronaut:before{content:"\f4fb"}.fa-user-check:before{content:"\f4fc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-clock:before{content:"\f4fd"}.fa-user-cog:before{content:"\f4fe"}.fa-user-edit:before{content:"\f4ff"}.fa-user-friends:before{content:"\f500"}.fa-user-graduate:before{content:"\f501"}.fa-user-injured:before{content:"\f728"}.fa-user-lock:before{content:"\f502"}.fa-user-md:before{content:"\f0f0"}.fa-user-minus:before{content:"\f503"}.fa-user-ninja:before{content:"\f504"}.fa-user-nurse:before{content:"\f82f"}.fa-user-plus:before{content:"\f234"}.fa-user-secret:before{content:"\f21b"}.fa-user-shield:before{content:"\f505"}.fa-user-slash:before{content:"\f506"}.fa-user-tag:before{content:"\f507"}.fa-user-tie:before{content:"\f508"}.fa-user-times:before{content:"\f235"}.fa-users:before{content:"\f0c0"}.fa-users-cog:before{content:"\f509"}.fa-usps:before{content:"\f7e1"}.fa-ussunnah:before{content:"\f407"}.fa-utensil-spoon:before{content:"\f2e5"}.fa-utensils:before{content:"\f2e7"}.fa-vaadin:before{content:"\f408"}.fa-vector-square:before{content:"\f5cb"}.fa-venus:before{content:"\f221"}.fa-venus-double:before{content:"\f226"}.fa-venus-mars:before{content:"\f228"}.fa-viacoin:before{content:"\f237"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-vial:before{content:"\f492"}.fa-vials:before{content:"\f493"}.fa-viber:before{content:"\f409"}.fa-video:before{content:"\f03d"}.fa-video-slash:before{content:"\f4e2"}.fa-vihara:before{content:"\f6a7"}.fa-vimeo:before{content:"\f40a"}.fa-vimeo-square:before{content:"\f194"}.fa-vimeo-v:before{content:"\f27d"}.fa-vine:before{content:"\f1ca"}.fa-vk:before{content:"\f189"}.fa-vnv:before{content:"\f40b"}.fa-volleyball-ball:before{content:"\f45f"}.fa-volume-down:before{content:"\f027"}.fa-volume-mute:before{content:"\f6a9"}.fa-volume-off:before{content:"\f026"}.fa-volume-up:before{content:"\f028"}.fa-vote-yea:before{content:"\f772"}.fa-vr-cardboard:before{content:"\f729"}.fa-vuejs:before{content:"\f41f"}.fa-walking:before{content:"\f554"}.fa-wallet:before{content:"\f555"}.fa-warehouse:before{content:"\f494"}.fa-water:before{content:"\f773"}.fa-weebly:before{content:"\f5cc"}.fa-weibo:before{content:"\f18a"}.fa-weight:before{content:"\f496"}.fa-weight-hanging:before{content:"\f5cd"}.fa-weixin:before{content:"\f1d7"}.fa-whatsapp:before{content:"\f232"}.fa-whatsapp-square:before{content:"\f40c"}.fa-wheelchair:before{content:"\f193"}.fa-whmcs:before{content:"\f40d"}.fa-wifi:before{content:"\f1eb"}.fa-wikipedia-w:before{content:"\f266"}.fa-wind:before{content:"\f72e"}.fa-window-close:before{content:"\f410"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-windows:before{content:"\f17a"}.fa-wine-bottle:before{content:"\f72f"}.fa-wine-glass:before{content:"\f4e3"}.fa-wine-glass-alt:before{content:"\f5ce"}.fa-wix:before{content:"\f5cf"}.fa-wizards-of-the-coast:before{content:"\f730"}.fa-wolf-pack-battalion:before{content:"\f514"}.fa-won-sign:before{content:"\f159"}.fa-wordpress:before{content:"\f19a"}.fa-wordpress-simple:before{content:"\f411"}.fa-wpbeginner:before{content:"\f297"}.fa-wpexplorer:before{content:"\f2de"}.fa-wpforms:before{content:"\f298"}.fa-wpressr:before{content:"\f3e4"}.fa-wrench:before{content:"\f0ad"}.fa-x-ray:before{content:"\f497"}.fa-xbox:before{content:"\f412"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-y-combinator:before{content:"\f23b"}.fa-yahoo:before{content:"\f19e"}.fa-yandex:before{content:"\f413"}.fa-yandex-international:before{content:"\f414"}.fa-yarn:before{content:"\f7e3"}.fa-yelp:before{content:"\f1e9"}.fa-yen-sign:before{content:"\f157"}.fa-yin-yang:before{content:"\f6ad"}.fa-yoast:before{content:"\f2b1"}.fa-youtube:before{content:"\f167"}.fa-youtube-square:before{content:"\f431"}.fa-zhihu:before{content:"\f63f"}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}@font-face{font-family:"Font Awesome 5 Brands";font-style:normal;font-weight:400;font-display:auto;src:url(libs/fonts/fa-brands-400.eot);src:url(libs/fonts/fa-brands-400.eot?#iefix) format("embedded-opentype"),url(libs/fonts/fa-brands-400.woff2) format("woff2"),url(libs/fonts/fa-brands-400.woff) format("woff"),url(libs/fonts/fa-brands-400.ttf) format("truetype"),url(libs/fonts/fa-brands-400.svg#fontawesome) format("svg")}.fab{font-family:"Font Awesome 5 Brands"}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:400;font-display:auto;src:url(libs/fonts/fa-regular-400.eot);src:url(libs/fonts/fa-regular-400.eot?#iefix) format("embedded-opentype"),url(libs/fonts/fa-regular-400.woff2) format("woff2"),url(libs/fonts/fa-regular-400.woff) format("woff"),url(libs/fonts/fa-regular-400.ttf) format("truetype"),url(libs/fonts/fa-regular-400.svg#fontawesome) format("svg")}.far{font-weight:400}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;font-display:auto;src:url(libs/fonts/fa-solid-900.eot);src:url(libs/fonts/fa-solid-900.eot?#iefix) format("embedded-opentype"),url(libs/fonts/fa-solid-900.woff2) format("woff2"),url(libs/fonts/fa-solid-900.woff) format("woff"),url(libs/fonts/fa-solid-900.ttf) format("truetype"),url(libs/fonts/fa-solid-900.svg#fontawesome) format("svg")}.fa,.far,.fas{font-family:"Font Awesome 5 Free"}.fa,.fas{font-weight:900}:root{--colorLink:#999;--colorSidebar:#fff;--errorColor:#f44336;--main:#f44336;--sidebarBg:#292929;--sidebarHoverBg:#232323;--bg:#eee;--border:#e5e5e5;--color:#232323;--contentBg:#fff;--headerBg:#fff;--selectedBg:#ffe7e5;--bgqoute:#eee}.night-colors{--bg:#1f1f1f;--border:#191919;--color:#fff;--contentBg:#292929;--headerBg:#292929;--selectedBg:#261918;--bgqoute:#1f1f1f5e}.light-colors{--bg:#eee;--border:#e5e5e5;--color:#232323;--contentBg:#fff;--headerBg:#fff;--selectedBg:#ffe7e5;--bgqoute:#eee}body.dark{--bg:#1f1f1f;--border:#191919;--color:#fff;--contentBg:#292929;--headerBg:#292929;--selectedBg:#261918;--bgqoute:#1f1f1f5e}body.light{--bg:#eee;--border:#e5e5e5;--color:#232323;--contentBg:#fff;--headerBg:#fff;--selectedBg:#ffe7e5;--bgqoute:#eee}@media (prefers-color-scheme:dark){:root{--bg:#1f1f1f;--border:#191919;--color:#fff;--contentBg:#292929;--headerBg:#292929;--selectedBg:#261918;--bgqoute:#1f1f1f5e}}@media (prefers-color-scheme:light){:root{--bg:#eee;--border:#e5e5e5;--color:#232323;--contentBg:#fff;--headerBg:#fff;--selectedBg:#ffe7e5;--bgqoute:#eee}}select{background:var(--contentBg);border:1px solid var(--border);border-radius:4px;color:var(--color)}.login-footer{color:var(--color)}.content-footer{width:100%;padding:20px;max-width:840px;margin-bottom:16px;background-color:var(--contentBg);border:1px solid var(--border);display:flex;flex-flow:column;align-items:center}.metadata{display:flex;flex-flow:row wrap;text-align:center;font-size:16px;color:var(--colorLink)}.metadata:first-child{justify-content:flex-start}.metadata:nth-child(2){justify-content:flex-end}.metadata[v-cloak]{visibility:hidden}.links{display:flex;flex-flow:row wrap}.links a{padding:0 4px;color:var(--color);text-decoration:underline}.links a:focus,.links a:hover{color:var(--main)}*{border-width:0;box-sizing:border-box;font-family:"Source Sans Pro",sans-serif;margin:0;padding:0;text-decoration:none}body{background-color:var(--bg)}a{cursor:pointer}.spacer{flex:1}#login-scene{height:100%;height:100dvh;padding:16px;overflow:auto;display:flex;align-items:center;flex-flow:column nowrap;background-color:var(--bg)}#login-scene>.error-message{width:100%;max-width:400px;font-size:1em;background-color:var(--contentBg);border:1px solid var(--border);padding:16px;margin-top:auto;margin-bottom:16px;text-align:center;color:var(--errorColor)}#login-scene #login-box{width:100%;max-width:400px;margin-bottom:auto;background-color:var(--contentBg);display:flex;flex-flow:column nowrap;border:1px solid var(--border);flex-shrink:0}#login-scene #login-box:first-child{margin-top:auto}#login-scene #login-box #logo-area{display:flex;align-items:center;flex-flow:column nowrap;padding:16px;background-color:var(--main);border-bottom:1px solid var(--border);flex-shrink:0}#login-scene #login-box #logo-area #logo{font-size:3em;font-weight:100;color:var(--contentBg)}#login-scene #login-box #logo-area #logo span{margin-right:8px}#login-scene #login-box #logo-area #tagline{font-weight:500;margin-top:4px;color:var(--contentBg);text-align:center}#login-scene #login-box #input-area{padding:16px;display:grid;grid-gap:16px;grid-template-columns:auto 1fr;justify-content:baseline;align-items:center;border-bottom:1px solid var(--border)}#login-scene #login-box #input-area>label{color:var(--color)}#login-scene #login-box #input-area>input{color:var(--color);padding:8px;background-color:var(--contentBg);border:1px solid var(--border);min-width:0;font-size:1em}#login-scene #login-box #input-area .checkbox-field{grid-column:1/span 2;display:flex;flex-flow:row nowrap;align-items:center;justify-content:center;cursor:pointer}#login-scene #login-box #input-area .checkbox-field:focus,#login-scene #login-box #input-area .checkbox-field:hover{text-decoration:underline;text-decoration-color:var(--main)}#login-scene #login-box #input-area .checkbox-field>input[type=checkbox]{margin-right:8px}#login-scene #login-box #button-area{display:flex;flex-flow:row nowrap;padding:16px;justify-content:center}#login-scene #login-box #button-area a{color:var(--color);text-transform:uppercase;text-align:center;font-weight:600;cursor:default}#login-scene #login-box #button-area a.button{cursor:pointer}#login-scene #login-box #button-area a.button:focus,#login-scene #login-box #button-area a.button:hover{color:var(--main)}#main-scene{min-height:100%;min-height:100dvh;padding-top:60px;padding-left:60px;background-color:var(--bg)}#main-scene #main-sidebar{top:0;left:0;width:60px;height:100%;height:100dvh;position:fixed;display:flex;flex-flow:column nowrap;background-color:var(--sidebarBg);z-index:1}#main-scene #main-sidebar a{flex-shrink:0;display:block;width:60px;line-height:60px;text-align:center;font-size:1em;color:var(--colorSidebar)}#main-scene #main-sidebar a.active{cursor:default;color:var(--colorSidebar);background-color:var(--main)}#main-scene #main-sidebar a:focus,#main-scene #main-sidebar a:hover{color:var(--main);background-color:var(--sidebarHoverBg)}#main-scene .page-header{top:0;left:60px;right:0;height:60px;position:fixed;color:var(--color);background-color:var(--headerBg);border-bottom:1px solid var(--border);padding:0 16px;z-index:10}#main-scene h1.page-header{line-height:60px;font-size:1.3em;font-weight:600}#main-scene div.page-header{display:flex;flex-flow:row nowrap;align-items:center}#main-scene div.page-header p{flex:1 0;font-size:1.3em;font-weight:600;line-height:60px;color:var(--color)}#main-scene div.page-header input[type=text]{flex:1 0;min-width:0;margin-right:8px;font-size:1.1em;font-weight:500;line-height:59px;color:var(--color);background-color:var(--contentBg)}#main-scene div.page-header input[type=text]::placeholder{color:var(--colorLink)}#main-scene div.page-header a{display:block;width:24px;line-height:24px;color:var(--colorLink);text-align:center}#main-scene div.page-header a:not(:last-child){margin-right:8px}#main-scene div.page-header a:hover{color:var(--main)}#main-scene .loading-overlay{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;overflow:hidden;position:fixed;top:0;left:0;width:100%;width:100dvw;height:100%;height:100dvh;z-index:10001;background-color:rgba(0,0,0,.6)}#main-scene .loading-overlay i{color:var(--colorSidebar);font-size:4em;text-align:center;width:80px;line-height:80px;position:absolute}@media (max-width:600px){#main-scene{padding-top:50px;padding-left:0;padding-bottom:50px}#main-scene #main-sidebar{top:auto;right:0;bottom:0;width:100%;width:100dvw;height:50px;flex-flow:row nowrap;border-top:1px solid var(--border)}#main-scene #main-sidebar .spacer{display:none}#main-scene #main-sidebar a{width:auto;flex:1 0;line-height:50px}#main-scene #main-sidebar a:focus,#main-scene #main-sidebar a:hover{color:var(--colorSidebar);background-color:var(--main)}#main-scene .page-header{left:0;height:50px}#main-scene h1.page-header{text-align:center;font-size:1em;line-height:50px;text-transform:uppercase}#main-scene div.page-header{flex-flow:row wrap}#main-scene div.page-header p{flex:1 0;font-size:1em;font-weight:500;line-height:3em;padding:0}#main-scene div.page-header input[type=text]{flex:1 0;font-size:1em;font-weight:500;line-height:3em}#main-scene div.page-header a{display:block;width:24px;line-height:100%}}#content-scene{padding:20px;display:flex;color:var(--color);background-color:var(--bg);flex-flow:column nowrap;align-items:center}#content-scene #header{width:100%;padding:20px;max-width:840px;margin-bottom:16px;background-color:var(--contentBg);border:1px solid var(--border);display:flex;flex-flow:column;align-items:center}#content-scene #header #title{padding:8px 0;grid-column-start:1;grid-column-end:-1;font-size:36px;font-weight:700;word-break:break-word;hyphens:none;text-align:center}#content-scene #content{width:100%;padding:20px;max-width:840px;background-color:var(--contentBg);border:1px solid var(--border)}#content-scene #content *{font-size:18px;line-height:180%}#content-scene #content :not(:last-child){margin-bottom:20px}#content-scene #content a{color:var(--color);text-decoration:underline}#content-scene #content a:focus,#content-scene #content a:hover{color:var(--main)}#content-scene #content code,#content-scene #content pre{overflow:auto;border:1px solid var(--border);font-family:"Ubuntu Mono","Courier New",Courier,monospace;font-size:16px}#content-scene #content pre{padding:8px}#content-scene #content pre>code{border:0}#content-scene #content ol,#content-scene #content ul{padding-left:16px}#content-scene #content img{height:auto;max-width:100%}#content-scene #content table{border:1px solid var(--border);border-collapse:collapse}#content-scene #content table td,#content-scene #content table th,#content-scene #content table tr{border:1px solid var(--border)}#content-scene #content blockquote{margin:15px;padding:15px;font-style:italic;background:var(--bgqoute)}#page-home>.empty-message{max-width:400px;font-size:1em;background-color:var(--contentBg);border:1px solid var(--border);padding:16px;margin:16px;color:var(--errorColor)}#page-home #edit-box{background-color:var(--selectedBg);border-bottom:1px solid var(--main)}#page-home #bookmarks-grid{display:grid;grid-template-rows:min-content;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));grid-gap:16px;padding:16px;overflow:auto}#page-home #bookmarks-grid .bookmark{align-self:start}#page-home #bookmarks-grid .pagination-box{grid-column-end:-1;grid-column-start:1;display:flex;flex-flow:row nowrap;align-self:start}#page-home #bookmarks-grid .pagination-box a{padding:8px;color:var(--colorLink)}#page-home #bookmarks-grid .pagination-box a:focus,#page-home #bookmarks-grid .pagination-box a:hover{color:var(--main)}#page-home #bookmarks-grid .pagination-box input{width:40px;padding:8px;text-align:center;font-size:.9em;color:var(--color);border:1px solid var(--border);background-color:var(--contentBg);margin:0 8px}#page-home #bookmarks-grid .pagination-box p{font-size:.9em;color:var(--colorLink);line-height:37px;font-weight:600}#page-home #bookmarks-grid .pagination-box p:last-of-type::before{content:"/";margin-right:8px}#page-home #bookmarks-grid.list{grid-gap:0;padding-bottom:0;grid-template-columns:auto}#page-home #bookmarks-grid.list .pagination-box{padding:16px 0}#page-home #bookmarks-grid.list .pagination-box:first-child{padding-top:0}@media (max-width:600px){#page-home #bookmarks-grid.list{padding:16px 0 0}#page-home #bookmarks-grid.list .pagination-box{padding:16px}}#page-home #dialog-tags .custom-dialog-body{grid-template-columns:repeat(2,minmax(0,1fr))}@media (max-width:600px){#page-home #dialog-tags .custom-dialog-body{grid-template-columns:minmax(0,1fr)}}#page-home #dialog-tags .custom-dialog-body a{font-size:1em;color:var(--color)}#page-home #dialog-tags .custom-dialog-body a span:last-child{font-size:1em;color:var(--colorLink);margin-left:4px}#page-home #dialog-tags .custom-dialog-body a span:last-child::before{content:"(";margin-right:2px}#page-home #dialog-tags .custom-dialog-body a span:last-child::after{content:")";margin-left:2px}#page-home #dialog-tags .custom-dialog-body a:focus,#page-home #dialog-tags .custom-dialog-body a:hover{color:var(--main)}#page-setting{min-height:0;max-height:100%;display:flex;flex-flow:column nowrap}#page-setting .setting-container{padding:8px;display:flex;overflow:auto;flex-flow:column nowrap;flex:1 0}#page-setting .setting-container::after{content:"";display:block;min-height:1px}#page-setting .setting-container details.setting-group{margin:8px;display:block;max-width:350px;color:var(--color);background-color:var(--contentBg);border:1px solid var(--border)}@media (max-width:600px){#page-setting .setting-container details.setting-group{max-width:100%}}#page-setting .setting-container details.setting-group summary{list-style:none;font-weight:600;width:100%;padding:12px 8px;font-size:1.1em;cursor:pointer}#page-setting .setting-container details.setting-group summary:hover{color:var(--main)}#page-setting .setting-container details.setting-group summary::-webkit-details-marker{display:none}#page-setting .setting-container details.setting-group summary::after{content:"+";margin-left:8px;font-weight:600}#page-setting .setting-container details.setting-group[open] summary{border-bottom:1px solid var(--border)}#page-setting .setting-container details.setting-group[open] summary::after{content:"-"!important}#page-setting .setting-container details.setting-group ul{list-style:none}#page-setting .setting-container details.setting-group ul li{padding:4px 8px;color:var(--color);display:flex;flex-flow:row nowrap;align-items:center}#page-setting .setting-container details.setting-group div.setting-group-footer{padding:4px 8px;display:flex;flex-flow:column nowrap;align-items:flex-end;border-top:1px solid var(--border)}#page-setting .setting-container details.setting-group div.setting-group-footer>a{text-transform:uppercase;padding:8px 4px;font-size:.9em;font-weight:600}#page-setting .setting-container details.setting-group div.setting-group-footer>a:hover{color:var(--main)}#page-setting .setting-container details.setting-group div.setting-group-footer>a:focus{outline:0;color:var(--main);border-bottom:1px dashed var(--main)}#page-setting #setting-bookmarks,#page-setting #setting-display{display:flex;flex-flow:column nowrap}#page-setting #setting-bookmarks[open],#page-setting #setting-display[open]{padding-bottom:8px}#page-setting #setting-bookmarks[open] summary,#page-setting #setting-display[open] summary{margin-bottom:8px}#page-setting #setting-bookmarks label,#page-setting #setting-display label{padding:4px 8px;color:var(--color);display:flex;flex-flow:row nowrap;align-items:center;cursor:pointer}#page-setting #setting-bookmarks label:focus,#page-setting #setting-bookmarks label:hover,#page-setting #setting-display label:focus,#page-setting #setting-display label:hover{text-decoration:underline;text-decoration-color:var(--main)}#page-setting #setting-bookmarks label>input[type=checkbox],#page-setting #setting-display label>input[type=checkbox]{margin-right:8px}#page-setting #setting-accounts summary{margin-bottom:0}#page-setting #setting-accounts ul{list-style:none}#page-setting #setting-accounts ul li{padding:8px;display:flex;flex-flow:row nowrap;align-items:center}#page-setting #setting-accounts ul li:not(:last-child){border-bottom:1px solid var(--border)}#page-setting #setting-accounts ul li p{font-size:1em;color:var(--color);flex:1 0}#page-setting #setting-accounts ul li p span{color:var(--colorLink)}#page-setting #setting-accounts ul li a{margin-left:8px;color:var(--colorLink)}#page-setting #setting-accounts ul li a:hover{color:var(--main)}#page-setting #setting-system-info ul{padding-top:4px;padding-bottom:4px}#page-setting #setting-system-info ul li span{margin-left:8px}:root{--dialogHeaderBg:#292929;--colorDialogHeader:#fff}.custom-dialog-overlay{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;min-width:0;min-height:0;overflow:hidden;position:fixed;top:0;left:0;width:100%;width:100dvw;height:100%;height:100dvh;z-index:10001;background-color:rgba(0,0,0,.6);padding:32px}.custom-dialog-overlay .custom-dialog{display:flex;flex-flow:column nowrap;min-height:0;max-height:100%;max-width:100%;width:400px;overflow:auto;background-color:var(--contentBg);font-size:16px;resize:both}.custom-dialog-overlay .custom-dialog .custom-dialog-header{padding:16px;color:var(--colorDialogHeader);background-color:var(--dialogHeaderBg);font-weight:600;font-size:1em;text-transform:uppercase;border-bottom:1px solid var(--border)}.custom-dialog-overlay .custom-dialog .custom-dialog-body{padding:16px 16px 0;display:grid;max-height:100%;min-height:80px;min-width:0;overflow:auto;font-size:1em;grid-template-columns:max-content 1fr;align-content:start;align-items:baseline;grid-gap:16px;flex-grow:1}.custom-dialog-overlay .custom-dialog .custom-dialog-body::after{content:"";display:block;min-height:1px;grid-column-end:-1;grid-column-start:1}.custom-dialog-overlay .custom-dialog .custom-dialog-body .custom-dialog-content{grid-column-end:-1;grid-column-start:1;color:var(--color);align-self:baseline}.custom-dialog-overlay .custom-dialog .custom-dialog-body>label{color:var(--color);padding:8px 0;font-size:1em}.custom-dialog-overlay .custom-dialog .custom-dialog-body>input[type=password],.custom-dialog-overlay .custom-dialog .custom-dialog-body>input[type=text],.custom-dialog-overlay .custom-dialog .custom-dialog-body>textarea{color:var(--color);padding:8px;font-size:1em;border:1px solid var(--border);background-color:var(--contentBg);min-width:0}.custom-dialog-overlay .custom-dialog .custom-dialog-body .checkbox-field{color:var(--color);font-size:1em;display:flex;flex-flow:row nowrap;padding:0;grid-column-start:1;grid-column-end:-1;cursor:pointer}.custom-dialog-overlay .custom-dialog .custom-dialog-body .checkbox-field:focus,.custom-dialog-overlay .custom-dialog .custom-dialog-body .checkbox-field:hover{text-decoration:underline;text-decoration-color:var(--main)}.custom-dialog-overlay .custom-dialog .custom-dialog-body .checkbox-field>input[type=checkbox]{margin-right:8px}.custom-dialog-overlay .custom-dialog .custom-dialog-body>textarea{height:6em;min-height:37px;resize:vertical}.custom-dialog-overlay .custom-dialog .custom-dialog-body>.suggestion{position:absolute;display:block;padding:8px;background-color:var(--contentBg);border:1px solid var(--border);color:var(--color);font-size:.9em}.custom-dialog-overlay .custom-dialog .custom-dialog-footer{padding:16px;display:flex;flex-flow:row wrap;justify-content:flex-end;border-top:1px solid var(--border)}.custom-dialog-overlay .custom-dialog .custom-dialog-footer>a{padding:0 8px;font-size:.9em;font-weight:600;color:var(--color);text-transform:uppercase}.custom-dialog-overlay .custom-dialog .custom-dialog-footer>a:focus,.custom-dialog-overlay .custom-dialog .custom-dialog-footer>a:hover{outline:0;color:var(--main)}.custom-dialog-overlay .custom-dialog .custom-dialog-footer>i.fa-spinner.fa-spin{width:19px;line-height:19px;text-align:center;color:var(--color)}@media only screen and (max-width:768px){.custom-dialog-overlay{padding:0}.custom-dialog{width:100%!important;height:100%!important;resize:none!important}}.bookmark{display:flex;flex-flow:column nowrap;min-width:0;border:1px solid var(--border);background-color:var(--contentBg);height:100%;position:relative}.bookmark:focus .bookmark-menu>a,.bookmark:hover .bookmark-menu>a{display:block}.bookmark.selected{background-color:var(--selectedBg)}.bookmark .bookmark-selector{position:absolute;top:0;left:0;width:100%;height:100%;z-index:9}.bookmark .bookmark-link{display:block;cursor:default}.bookmark .bookmark-link[href]{cursor:pointer}.bookmark .bookmark-link[href]:focus .title,.bookmark .bookmark-link[href]:hover .title{color:var(--main)}.bookmark .bookmark-link span.thumbnail{width:100%;height:200px;display:block;background-size:cover;background-repeat:no-repeat;background-position:center center;margin-bottom:8px;border-bottom:1px solid var(--border)}.bookmark .bookmark-link .id{color:var(--color);border:1px solid var(--border);background-color:var(--contentBg);font-size:.7em;font-weight:700;left:-1px;top:-1px;position:absolute;padding:0 .3em;opacity:.7}.bookmark .bookmark-link .title{text-overflow:ellipsis;word-wrap:break-word;overflow:hidden;font-size:1.2em;line-height:1.3em;max-height:5.2em;font-weight:600;padding:0 16px;color:var(--color)}.bookmark .bookmark-link .title:first-child{margin-top:16px}.bookmark .bookmark-link .title i{color:var(--colorLink);margin-left:4px;font-size:14px}.bookmark .bookmark-link .excerpt{color:var(--color);margin-top:8px;padding:0 16px;text-overflow:ellipsis;word-wrap:break-word;overflow:hidden;font-size:.9em;line-height:1.5em;max-height:10.5em}.bookmark .bookmark-tags{display:flex;flex-flow:row wrap;margin:8px 0 -4px;padding:0 8px}.bookmark .bookmark-tags a{margin:4px;padding:4px 8px;font-size:.8em;font-weight:600;border:1px solid var(--border);border-radius:4px;color:var(--colorLink);background-color:var(--contentBg)}.bookmark .bookmark-tags a:focus,.bookmark .bookmark-tags a:hover{color:var(--main)}.bookmark .bookmark-menu{padding:8px 16px 16px;display:flex;flex-flow:row nowrap;min-width:0;min-height:0;align-items:center}.bookmark .bookmark-menu a{color:var(--colorLink);flex-shrink:0;opacity:.8;display:none;font-size:.9em}.bookmark .bookmark-menu a:not(:last-child){margin-right:12px}.bookmark .bookmark-menu a:focus,.bookmark .bookmark-menu a:hover{color:var(--main);opacity:1}.bookmark .bookmark-menu .url{flex:1 0;opacity:1;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:21px}.bookmark .bookmark-menu .url:not([href]){cursor:default;color:var(--colorLink)}@media (max-width:1024px){.bookmark .bookmark-menu a{display:block}}.bookmark.list{border-top-width:0;border-bottom-width:1px;padding:16px 24px 16px 100px}.bookmark.list:first-child{border-top-width:1px}.bookmark.list .bookmark-link span.thumbnail{position:absolute;top:0;left:0;width:100px;height:100%;margin-bottom:0;border-bottom:0;border-right:1px solid var(--border)}.bookmark.list .bookmark-link .title{margin:0;padding-left:24px}.bookmark.list .excerpt,.bookmark.list>.spacer{display:none}.bookmark.list .bookmark-tags{padding-left:16px;padding-right:0}.bookmark.list .bookmark-menu{padding:8px 0 0 24px;align-items:flex-end}.bookmark.list.no-thumbnail{padding-left:16px;padding-right:16px}.bookmark.list.no-thumbnail .bookmark-link .title{padding:0;margin-bottom:4px}.bookmark.list.no-thumbnail .excerpt{margin-top:0;margin-bottom:4px;padding:0;display:block}.bookmark.list.no-thumbnail .bookmark-tags{padding-left:0;margin:0 -4px 0}.bookmark.list.no-thumbnail .bookmark-menu{padding-top:0;padding-left:0}@media (max-width:600px){.bookmark.list{padding:8px 16px 8px 70px;border-width:0!important;border-bottom-width:1px!important}.bookmark.list .bookmark-link span.thumbnail{width:70px}.bookmark.list .bookmark-link .title{font-size:1.1em;font-weight:500;padding-left:16px}.bookmark.list .bookmark-tags{padding-left:8px}.bookmark.list .bookmark-menu{padding-left:16px}} \ No newline at end of file +@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:200;src:local('Source Sans Pro ExtraLight'),local('SourceSansPro-ExtraLight'),url(libs/fonts/source-sans-pro-v13-latin-200.woff2) format('woff2'),url(libs/fonts/source-sans-pro-v13-latin-200.woff) format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:400;src:local('Source Sans Pro Regular'),local('SourceSansPro-Regular'),url(libs/fonts/source-sans-pro-v13-latin-regular.woff2) format('woff2'),url(libs/fonts/source-sans-pro-v13-latin-regular.woff) format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:600;src:local('Source Sans Pro SemiBold'),local('SourceSansPro-SemiBold'),url(libs/fonts/source-sans-pro-v13-latin-600.woff2) format('woff2'),url(libs/fonts/source-sans-pro-v13-latin-600.woff) format('woff')}@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:700;src:local('Source Sans Pro Bold'),local('SourceSansPro-Bold'),url(libs/fonts/source-sans-pro-v13-latin-700.woff2) format('woff2'),url(libs/fonts/source-sans-pro-v13-latin-700.woff) format('woff')}.fa,.fab,.fal,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{animation:fa-spin 2s infinite linear}.fa-pulse{animation:fa-spin 1s infinite steps(8)}@keyframes fa-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.fa-rotate-90{transform:rotate(90deg)}.fa-rotate-180{transform:rotate(180deg)}.fa-rotate-270{transform:rotate(270deg)}.fa-flip-horizontal{transform:scaleX(-1)}.fa-flip-vertical{transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{transform:scale(-1)}:root .fa-flip-both,:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{filter:none}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-acquisitions-incorporated:before{content:"\f6af"}.fa-ad:before{content:"\f641"}.fa-address-book:before{content:"\f2b9"}.fa-address-card:before{content:"\f2bb"}.fa-adjust:before{content:"\f042"}.fa-adn:before{content:"\f170"}.fa-adobe:before{content:"\f778"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-air-freshener:before{content:"\f5d0"}.fa-algolia:before{content:"\f36c"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-alipay:before{content:"\f642"}.fa-allergies:before{content:"\f461"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-ambulance:before{content:"\f0f9"}.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-amilia:before{content:"\f36d"}.fa-anchor:before{content:"\f13d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angry:before{content:"\f556"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-ankh:before{content:"\f644"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-alt:before{content:"\f5d1"}.fa-apple-pay:before{content:"\f415"}.fa-archive:before{content:"\f187"}.fa-archway:before{content:"\f557"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-left:before{content:"\f359"}.fa-arrow-alt-circle-right:before{content:"\f35a"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrows-alt:before{content:"\f0b2"}.fa-arrows-alt-h:before{content:"\f337"}.fa-arrows-alt-v:before{content:"\f338"}.fa-artstation:before{content:"\f77a"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asterisk:before{content:"\f069"}.fa-asymmetrik:before{content:"\f372"}.fa-at:before{content:"\f1fa"}.fa-atlas:before{content:"\f558"}.fa-atlassian:before{content:"\f77b"}.fa-atom:before{content:"\f5d2"}.fa-audible:before{content:"\f373"}.fa-audio-description:before{content:"\f29e"}.fa-autoprefixer:before{content:"\f41c"}.fa-avianex:before{content:"\f374"}.fa-aviato:before{content:"\f421"}.fa-award:before{content:"\f559"}.fa-aws:before{content:"\f375"}.fa-baby:before{content:"\f77c"}.fa-baby-carriage:before{content:"\f77d"}.fa-backspace:before{content:"\f55a"}.fa-backward:before{content:"\f04a"}.fa-bacon:before{content:"\f7e5"}.fa-balance-scale:before{content:"\f24e"}.fa-ban:before{content:"\f05e"}.fa-band-aid:before{content:"\f462"}.fa-bandcamp:before{content:"\f2d5"}.fa-barcode:before{content:"\f02a"}.fa-bars:before{content:"\f0c9"}.fa-baseball-ball:before{content:"\f433"}.fa-basketball-ball:before{content:"\f434"}.fa-bath:before{content:"\f2cd"}.fa-battery-empty:before{content:"\f244"}.fa-battery-full:before{content:"\f240"}.fa-battery-half:before{content:"\f242"}.fa-battery-quarter:before{content:"\f243"}.fa-battery-three-quarters:before{content:"\f241"}.fa-bed:before{content:"\f236"}.fa-beer:before{content:"\f0fc"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-bell:before{content:"\f0f3"}.fa-bell-slash:before{content:"\f1f6"}.fa-bezier-curve:before{content:"\f55b"}.fa-bible:before{content:"\f647"}.fa-bicycle:before{content:"\f206"}.fa-bimobject:before{content:"\f378"}.fa-binoculars:before{content:"\f1e5"}.fa-biohazard:before{content:"\f780"}.fa-birthday-cake:before{content:"\f1fd"}.fa-bitbucket:before{content:"\f171"}.fa-bitcoin:before{content:"\f379"}.fa-bity:before{content:"\f37a"}.fa-black-tie:before{content:"\f27e"}.fa-blackberry:before{content:"\f37b"}.fa-blender:before{content:"\f517"}.fa-blender-phone:before{content:"\f6b6"}.fa-blind:before{content:"\f29d"}.fa-blog:before{content:"\f781"}.fa-blogger:before{content:"\f37c"}.fa-blogger-b:before{content:"\f37d"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-bold:before{content:"\f032"}.fa-bolt:before{content:"\f0e7"}.fa-bomb:before{content:"\f1e2"}.fa-bone:before{content:"\f5d7"}.fa-bong:before{content:"\f55c"}.fa-book:before{content:"\f02d"}.fa-book-dead:before{content:"\f6b7"}.fa-book-medical:before{content:"\f7e6"}.fa-book-open:before{content:"\f518"}.fa-book-reader:before{content:"\f5da"}.fa-bookmark:before{content:"\f02e"}.fa-bowling-ball:before{content:"\f436"}.fa-box:before{content:"\f466"}.fa-box-open:before{content:"\f49e"}.fa-boxes:before{content:"\f468"}.fa-braille:before{content:"\f2a1"}.fa-brain:before{content:"\f5dc"}.fa-bread-slice:before{content:"\f7ec"}.fa-briefcase:before{content:"\f0b1"}.fa-briefcase-medical:before{content:"\f469"}.fa-broadcast-tower:before{content:"\f519"}.fa-broom:before{content:"\f51a"}.fa-brush:before{content:"\f55d"}.fa-btc:before{content:"\f15a"}.fa-bug:before{content:"\f188"}.fa-building:before{content:"\f1ad"}.fa-bullhorn:before{content:"\f0a1"}.fa-bullseye:before{content:"\f140"}.fa-burn:before{content:"\f46a"}.fa-buromobelexperte:before{content:"\f37f"}.fa-bus:before{content:"\f207"}.fa-bus-alt:before{content:"\f55e"}.fa-business-time:before{content:"\f64a"}.fa-buysellads:before{content:"\f20d"}.fa-calculator:before{content:"\f1ec"}.fa-calendar:before{content:"\f133"}.fa-calendar-alt:before{content:"\f073"}.fa-calendar-check:before{content:"\f274"}.fa-calendar-day:before{content:"\f783"}.fa-calendar-minus:before{content:"\f272"}.fa-calendar-plus:before{content:"\f271"}.fa-calendar-times:before{content:"\f273"}.fa-calendar-week:before{content:"\f784"}.fa-camera:before{content:"\f030"}.fa-camera-retro:before{content:"\f083"}.fa-campground:before{content:"\f6bb"}.fa-canadian-maple-leaf:before{content:"\f785"}.fa-candy-cane:before{content:"\f786"}.fa-cannabis:before{content:"\f55f"}.fa-capsules:before{content:"\f46b"}.fa-car:before{content:"\f1b9"}.fa-car-alt:before{content:"\f5de"}.fa-car-battery:before{content:"\f5df"}.fa-car-crash:before{content:"\f5e1"}.fa-car-side:before{content:"\f5e4"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-caret-square-down:before{content:"\f150"}.fa-caret-square-left:before{content:"\f191"}.fa-caret-square-right:before{content:"\f152"}.fa-caret-square-up:before{content:"\f151"}.fa-caret-up:before{content:"\f0d8"}.fa-carrot:before{content:"\f787"}.fa-cart-arrow-down:before{content:"\f218"}.fa-cart-plus:before{content:"\f217"}.fa-cash-register:before{content:"\f788"}.fa-cat:before{content:"\f6be"}.fa-cc-amazon-pay:before{content:"\f42d"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-apple-pay:before{content:"\f416"}.fa-cc-diners-club:before{content:"\f24c"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-cc-visa:before{content:"\f1f0"}.fa-centercode:before{content:"\f380"}.fa-centos:before{content:"\f789"}.fa-certificate:before{content:"\f0a3"}.fa-chair:before{content:"\f6c0"}.fa-chalkboard:before{content:"\f51b"}.fa-chalkboard-teacher:before{content:"\f51c"}.fa-charging-station:before{content:"\f5e7"}.fa-chart-area:before{content:"\f1fe"}.fa-chart-bar:before{content:"\f080"}.fa-chart-line:before{content:"\f201"}.fa-chart-pie:before{content:"\f200"}.fa-check:before{content:"\f00c"}.fa-check-circle:before{content:"\f058"}.fa-check-double:before{content:"\f560"}.fa-check-square:before{content:"\f14a"}.fa-cheese:before{content:"\f7ef"}.fa-chess:before{content:"\f439"}.fa-chess-bishop:before{content:"\f43a"}.fa-chess-board:before{content:"\f43c"}.fa-chess-king:before{content:"\f43f"}.fa-chess-knight:before{content:"\f441"}.fa-chess-pawn:before{content:"\f443"}.fa-chess-queen:before{content:"\f445"}.fa-chess-rook:before{content:"\f447"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-down:before{content:"\f078"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-chevron-up:before{content:"\f077"}.fa-child:before{content:"\f1ae"}.fa-chrome:before{content:"\f268"}.fa-church:before{content:"\f51d"}.fa-circle:before{content:"\f111"}.fa-circle-notch:before{content:"\f1ce"}.fa-city:before{content:"\f64f"}.fa-clinic-medical:before{content:"\f7f2"}.fa-clipboard:before{content:"\f328"}.fa-clipboard-check:before{content:"\f46c"}.fa-clipboard-list:before{content:"\f46d"}.fa-clock:before{content:"\f017"}.fa-clone:before{content:"\f24d"}.fa-closed-captioning:before{content:"\f20a"}.fa-cloud:before{content:"\f0c2"}.fa-cloud-download-alt:before{content:"\f381"}.fa-cloud-meatball:before{content:"\f73b"}.fa-cloud-moon:before{content:"\f6c3"}.fa-cloud-moon-rain:before{content:"\f73c"}.fa-cloud-rain:before{content:"\f73d"}.fa-cloud-showers-heavy:before{content:"\f740"}.fa-cloud-sun:before{content:"\f6c4"}.fa-cloud-sun-rain:before{content:"\f743"}.fa-cloud-upload-alt:before{content:"\f382"}.fa-cloudscale:before{content:"\f383"}.fa-cloudsmith:before{content:"\f384"}.fa-cloudversify:before{content:"\f385"}.fa-cocktail:before{content:"\f561"}.fa-code:before{content:"\f121"}.fa-code-branch:before{content:"\f126"}.fa-codepen:before{content:"\f1cb"}.fa-codiepie:before{content:"\f284"}.fa-coffee:before{content:"\f0f4"}.fa-cog:before{content:"\f013"}.fa-cogs:before{content:"\f085"}.fa-coins:before{content:"\f51e"}.fa-columns:before{content:"\f0db"}.fa-comment:before{content:"\f075"}.fa-comment-alt:before{content:"\f27a"}.fa-comment-dollar:before{content:"\f651"}.fa-comment-dots:before{content:"\f4ad"}.fa-comment-medical:before{content:"\f7f5"}.fa-comment-slash:before{content:"\f4b3"}.fa-comments:before{content:"\f086"}.fa-comments-dollar:before{content:"\f653"}.fa-compact-disc:before{content:"\f51f"}.fa-compass:before{content:"\f14e"}.fa-compress:before{content:"\f066"}.fa-compress-arrows-alt:before{content:"\f78c"}.fa-concierge-bell:before{content:"\f562"}.fa-confluence:before{content:"\f78d"}.fa-connectdevelop:before{content:"\f20e"}.fa-contao:before{content:"\f26d"}.fa-cookie:before{content:"\f563"}.fa-cookie-bite:before{content:"\f564"}.fa-copy:before{content:"\f0c5"}.fa-copyright:before{content:"\f1f9"}.fa-couch:before{content:"\f4b8"}.fa-cpanel:before{content:"\f388"}.fa-creative-commons:before{content:"\f25e"}.fa-creative-commons-by:before{content:"\f4e7"}.fa-creative-commons-nc:before{content:"\f4e8"}.fa-creative-commons-nc-eu:before{content:"\f4e9"}.fa-creative-commons-nc-jp:before{content:"\f4ea"}.fa-creative-commons-nd:before{content:"\f4eb"}.fa-creative-commons-pd:before{content:"\f4ec"}.fa-creative-commons-pd-alt:before{content:"\f4ed"}.fa-creative-commons-remix:before{content:"\f4ee"}.fa-creative-commons-sa:before{content:"\f4ef"}.fa-creative-commons-sampling:before{content:"\f4f0"}.fa-creative-commons-sampling-plus:before{content:"\f4f1"}.fa-creative-commons-share:before{content:"\f4f2"}.fa-creative-commons-zero:before{content:"\f4f3"}.fa-credit-card:before{content:"\f09d"}.fa-critical-role:before{content:"\f6c9"}.fa-crop:before{content:"\f125"}.fa-crop-alt:before{content:"\f565"}.fa-cross:before{content:"\f654"}.fa-crosshairs:before{content:"\f05b"}.fa-crow:before{content:"\f520"}.fa-crown:before{content:"\f521"}.fa-crutch:before{content:"\f7f7"}.fa-css3:before{content:"\f13c"}.fa-css3-alt:before{content:"\f38b"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-cut:before{content:"\f0c4"}.fa-cuttlefish:before{content:"\f38c"}.fa-d-and-d:before{content:"\f38d"}.fa-d-and-d-beyond:before{content:"\f6ca"}.fa-dashcube:before{content:"\f210"}.fa-database:before{content:"\f1c0"}.fa-deaf:before{content:"\f2a4"}.fa-delicious:before{content:"\f1a5"}.fa-democrat:before{content:"\f747"}.fa-deploydog:before{content:"\f38e"}.fa-deskpro:before{content:"\f38f"}.fa-desktop:before{content:"\f108"}.fa-dev:before{content:"\f6cc"}.fa-deviantart:before{content:"\f1bd"}.fa-dharmachakra:before{content:"\f655"}.fa-dhl:before{content:"\f790"}.fa-diagnoses:before{content:"\f470"}.fa-diaspora:before{content:"\f791"}.fa-dice:before{content:"\f522"}.fa-dice-d20:before{content:"\f6cf"}.fa-dice-d6:before{content:"\f6d1"}.fa-dice-five:before{content:"\f523"}.fa-dice-four:before{content:"\f524"}.fa-dice-one:before{content:"\f525"}.fa-dice-six:before{content:"\f526"}.fa-dice-three:before{content:"\f527"}.fa-dice-two:before{content:"\f528"}.fa-digg:before{content:"\f1a6"}.fa-digital-ocean:before{content:"\f391"}.fa-digital-tachograph:before{content:"\f566"}.fa-directions:before{content:"\f5eb"}.fa-discord:before{content:"\f392"}.fa-discourse:before{content:"\f393"}.fa-divide:before{content:"\f529"}.fa-dizzy:before{content:"\f567"}.fa-dna:before{content:"\f471"}.fa-dochub:before{content:"\f394"}.fa-docker:before{content:"\f395"}.fa-dog:before{content:"\f6d3"}.fa-dollar-sign:before{content:"\f155"}.fa-dolly:before{content:"\f472"}.fa-dolly-flatbed:before{content:"\f474"}.fa-donate:before{content:"\f4b9"}.fa-door-closed:before{content:"\f52a"}.fa-door-open:before{content:"\f52b"}.fa-dot-circle:before{content:"\f192"}.fa-dove:before{content:"\f4ba"}.fa-download:before{content:"\f019"}.fa-draft2digital:before{content:"\f396"}.fa-drafting-compass:before{content:"\f568"}.fa-dragon:before{content:"\f6d5"}.fa-draw-polygon:before{content:"\f5ee"}.fa-dribbble:before{content:"\f17d"}.fa-dribbble-square:before{content:"\f397"}.fa-dropbox:before{content:"\f16b"}.fa-drum:before{content:"\f569"}.fa-drum-steelpan:before{content:"\f56a"}.fa-drumstick-bite:before{content:"\f6d7"}.fa-drupal:before{content:"\f1a9"}.fa-dumbbell:before{content:"\f44b"}.fa-dumpster:before{content:"\f793"}.fa-dumpster-fire:before{content:"\f794"}.fa-dungeon:before{content:"\f6d9"}.fa-dyalog:before{content:"\f399"}.fa-earlybirds:before{content:"\f39a"}.fa-ebay:before{content:"\f4f4"}.fa-edge:before{content:"\f282"}.fa-edit:before{content:"\f044"}.fa-egg:before{content:"\f7fb"}.fa-eject:before{content:"\f052"}.fa-elementor:before{content:"\f430"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-ello:before{content:"\f5f1"}.fa-ember:before{content:"\f423"}.fa-empire:before{content:"\f1d1"}.fa-envelope:before{content:"\f0e0"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-text:before{content:"\f658"}.fa-envelope-square:before{content:"\f199"}.fa-envira:before{content:"\f299"}.fa-equals:before{content:"\f52c"}.fa-eraser:before{content:"\f12d"}.fa-erlang:before{content:"\f39d"}.fa-ethereum:before{content:"\f42e"}.fa-ethernet:before{content:"\f796"}.fa-etsy:before{content:"\f2d7"}.fa-euro-sign:before{content:"\f153"}.fa-exchange-alt:before{content:"\f362"}.fa-exclamation:before{content:"\f12a"}.fa-exclamation-circle:before{content:"\f06a"}.fa-exclamation-triangle:before{content:"\f071"}.fa-expand:before{content:"\f065"}.fa-expand-arrows-alt:before{content:"\f31e"}.fa-expeditedssl:before{content:"\f23e"}.fa-external-link-alt:before{content:"\f35d"}.fa-external-link-square-alt:before{content:"\f360"}.fa-eye:before{content:"\f06e"}.fa-eye-dropper:before{content:"\f1fb"}.fa-eye-slash:before{content:"\f070"}.fa-facebook:before{content:"\f09a"}.fa-facebook-f:before{content:"\f39e"}.fa-facebook-messenger:before{content:"\f39f"}.fa-facebook-square:before{content:"\f082"}.fa-fantasy-flight-games:before{content:"\f6dc"}.fa-fast-backward:before{content:"\f049"}.fa-fast-forward:before{content:"\f050"}.fa-fax:before{content:"\f1ac"}.fa-feather:before{content:"\f52d"}.fa-feather-alt:before{content:"\f56b"}.fa-fedex:before{content:"\f797"}.fa-fedora:before{content:"\f798"}.fa-female:before{content:"\f182"}.fa-fighter-jet:before{content:"\f0fb"}.fa-figma:before{content:"\f799"}.fa-file:before{content:"\f15b"}.fa-file-alt:before{content:"\f15c"}.fa-file-archive:before{content:"\f1c6"}.fa-file-audio:before{content:"\f1c7"}.fa-file-code:before{content:"\f1c9"}.fa-file-contract:before{content:"\f56c"}.fa-file-csv:before{content:"\f6dd"}.fa-file-download:before{content:"\f56d"}.fa-file-excel:before{content:"\f1c3"}.fa-file-export:before{content:"\f56e"}.fa-file-image:before{content:"\f1c5"}.fa-file-import:before{content:"\f56f"}.fa-file-invoice:before{content:"\f570"}.fa-file-invoice-dollar:before{content:"\f571"}.fa-file-medical:before{content:"\f477"}.fa-file-medical-alt:before{content:"\f478"}.fa-file-pdf:before{content:"\f1c1"}.fa-file-powerpoint:before{content:"\f1c4"}.fa-file-prescription:before{content:"\f572"}.fa-file-signature:before{content:"\f573"}.fa-file-upload:before{content:"\f574"}.fa-file-video:before{content:"\f1c8"}.fa-file-word:before{content:"\f1c2"}.fa-fill:before{content:"\f575"}.fa-fill-drip:before{content:"\f576"}.fa-film:before{content:"\f008"}.fa-filter:before{content:"\f0b0"}.fa-fingerprint:before{content:"\f577"}.fa-fire:before{content:"\f06d"}.fa-fire-alt:before{content:"\f7e4"}.fa-fire-extinguisher:before{content:"\f134"}.fa-firefox:before{content:"\f269"}.fa-first-aid:before{content:"\f479"}.fa-first-order:before{content:"\f2b0"}.fa-first-order-alt:before{content:"\f50a"}.fa-firstdraft:before{content:"\f3a1"}.fa-fish:before{content:"\f578"}.fa-fist-raised:before{content:"\f6de"}.fa-flag:before{content:"\f024"}.fa-flag-checkered:before{content:"\f11e"}.fa-flag-usa:before{content:"\f74d"}.fa-flask:before{content:"\f0c3"}.fa-flickr:before{content:"\f16e"}.fa-flipboard:before{content:"\f44d"}.fa-flushed:before{content:"\f579"}.fa-fly:before{content:"\f417"}.fa-folder:before{content:"\f07b"}.fa-folder-minus:before{content:"\f65d"}.fa-folder-open:before{content:"\f07c"}.fa-folder-plus:before{content:"\f65e"}.fa-font:before{content:"\f031"}.fa-font-awesome:before{content:"\f2b4"}.fa-font-awesome-alt:before{content:"\f35c"}.fa-font-awesome-flag:before{content:"\f425"}.fa-font-awesome-logo-full:before{content:"\f4e6"}.fa-fonticons:before{content:"\f280"}.fa-fonticons-fi:before{content:"\f3a2"}.fa-football-ball:before{content:"\f44e"}.fa-fort-awesome:before{content:"\f286"}.fa-fort-awesome-alt:before{content:"\f3a3"}.fa-forumbee:before{content:"\f211"}.fa-forward:before{content:"\f04e"}.fa-foursquare:before{content:"\f180"}.fa-free-code-camp:before{content:"\f2c5"}.fa-freebsd:before{content:"\f3a4"}.fa-frog:before{content:"\f52e"}.fa-frown:before{content:"\f119"}.fa-frown-open:before{content:"\f57a"}.fa-fulcrum:before{content:"\f50b"}.fa-funnel-dollar:before{content:"\f662"}.fa-futbol:before{content:"\f1e3"}.fa-galactic-republic:before{content:"\f50c"}.fa-galactic-senate:before{content:"\f50d"}.fa-gamepad:before{content:"\f11b"}.fa-gas-pump:before{content:"\f52f"}.fa-gavel:before{content:"\f0e3"}.fa-gem:before{content:"\f3a5"}.fa-genderless:before{content:"\f22d"}.fa-get-pocket:before{content:"\f265"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-ghost:before{content:"\f6e2"}.fa-gift:before{content:"\f06b"}.fa-gifts:before{content:"\f79c"}.fa-git:before{content:"\f1d3"}.fa-git-square:before{content:"\f1d2"}.fa-github:before{content:"\f09b"}.fa-github-alt:before{content:"\f113"}.fa-github-square:before{content:"\f092"}.fa-gitkraken:before{content:"\f3a6"}.fa-gitlab:before{content:"\f296"}.fa-gitter:before{content:"\f426"}.fa-glass-cheers:before{content:"\f79f"}.fa-glass-martini:before{content:"\f000"}.fa-glass-martini-alt:before{content:"\f57b"}.fa-glass-whiskey:before{content:"\f7a0"}.fa-glasses:before{content:"\f530"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-globe:before{content:"\f0ac"}.fa-globe-africa:before{content:"\f57c"}.fa-globe-americas:before{content:"\f57d"}.fa-globe-asia:before{content:"\f57e"}.fa-globe-europe:before{content:"\f7a2"}.fa-gofore:before{content:"\f3a7"}.fa-golf-ball:before{content:"\f450"}.fa-goodreads:before{content:"\f3a8"}.fa-goodreads-g:before{content:"\f3a9"}.fa-google:before{content:"\f1a0"}.fa-google-drive:before{content:"\f3aa"}.fa-google-play:before{content:"\f3ab"}.fa-google-plus:before{content:"\f2b3"}.fa-google-plus-g:before{content:"\f0d5"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-wallet:before{content:"\f1ee"}.fa-gopuram:before{content:"\f664"}.fa-graduation-cap:before{content:"\f19d"}.fa-gratipay:before{content:"\f184"}.fa-grav:before{content:"\f2d6"}.fa-greater-than:before{content:"\f531"}.fa-greater-than-equal:before{content:"\f532"}.fa-grimace:before{content:"\f57f"}.fa-grin:before{content:"\f580"}.fa-grin-alt:before{content:"\f581"}.fa-grin-beam:before{content:"\f582"}.fa-grin-beam-sweat:before{content:"\f583"}.fa-grin-hearts:before{content:"\f584"}.fa-grin-squint:before{content:"\f585"}.fa-grin-squint-tears:before{content:"\f586"}.fa-grin-stars:before{content:"\f587"}.fa-grin-tears:before{content:"\f588"}.fa-grin-tongue:before{content:"\f589"}.fa-grin-tongue-squint:before{content:"\f58a"}.fa-grin-tongue-wink:before{content:"\f58b"}.fa-grin-wink:before{content:"\f58c"}.fa-grip-horizontal:before{content:"\f58d"}.fa-grip-lines:before{content:"\f7a4"}.fa-grip-lines-vertical:before{content:"\f7a5"}.fa-grip-vertical:before{content:"\f58e"}.fa-gripfire:before{content:"\f3ac"}.fa-grunt:before{content:"\f3ad"}.fa-guitar:before{content:"\f7a6"}.fa-gulp:before{content:"\f3ae"}.fa-h-square:before{content:"\f0fd"}.fa-hacker-news:before{content:"\f1d4"}.fa-hacker-news-square:before{content:"\f3af"}.fa-hackerrank:before{content:"\f5f7"}.fa-hamburger:before{content:"\f805"}.fa-hammer:before{content:"\f6e3"}.fa-hamsa:before{content:"\f665"}.fa-hand-holding:before{content:"\f4bd"}.fa-hand-holding-heart:before{content:"\f4be"}.fa-hand-holding-usd:before{content:"\f4c0"}.fa-hand-lizard:before{content:"\f258"}.fa-hand-middle-finger:before{content:"\f806"}.fa-hand-paper:before{content:"\f256"}.fa-hand-peace:before{content:"\f25b"}.fa-hand-point-down:before{content:"\f0a7"}.fa-hand-point-left:before{content:"\f0a5"}.fa-hand-point-right:before{content:"\f0a4"}.fa-hand-point-up:before{content:"\f0a6"}.fa-hand-pointer:before{content:"\f25a"}.fa-hand-rock:before{content:"\f255"}.fa-hand-scissors:before{content:"\f257"}.fa-hand-spock:before{content:"\f259"}.fa-hands:before{content:"\f4c2"}.fa-hands-helping:before{content:"\f4c4"}.fa-handshake:before{content:"\f2b5"}.fa-hanukiah:before{content:"\f6e6"}.fa-hard-hat:before{content:"\f807"}.fa-hashtag:before{content:"\f292"}.fa-hat-wizard:before{content:"\f6e8"}.fa-haykal:before{content:"\f666"}.fa-hdd:before{content:"\f0a0"}.fa-heading:before{content:"\f1dc"}.fa-headphones:before{content:"\f025"}.fa-headphones-alt:before{content:"\f58f"}.fa-headset:before{content:"\f590"}.fa-heart:before{content:"\f004"}.fa-heart-broken:before{content:"\f7a9"}.fa-heartbeat:before{content:"\f21e"}.fa-helicopter:before{content:"\f533"}.fa-highlighter:before{content:"\f591"}.fa-hiking:before{content:"\f6ec"}.fa-hippo:before{content:"\f6ed"}.fa-hips:before{content:"\f452"}.fa-hire-a-helper:before{content:"\f3b0"}.fa-history:before{content:"\f1da"}.fa-hockey-puck:before{content:"\f453"}.fa-holly-berry:before{content:"\f7aa"}.fa-home:before{content:"\f015"}.fa-hooli:before{content:"\f427"}.fa-hornbill:before{content:"\f592"}.fa-horse:before{content:"\f6f0"}.fa-horse-head:before{content:"\f7ab"}.fa-hospital:before{content:"\f0f8"}.fa-hospital-alt:before{content:"\f47d"}.fa-hospital-symbol:before{content:"\f47e"}.fa-hot-tub:before{content:"\f593"}.fa-hotdog:before{content:"\f80f"}.fa-hotel:before{content:"\f594"}.fa-hotjar:before{content:"\f3b1"}.fa-hourglass:before{content:"\f254"}.fa-hourglass-end:before{content:"\f253"}.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-start:before{content:"\f251"}.fa-house-damage:before{content:"\f6f1"}.fa-houzz:before{content:"\f27c"}.fa-hryvnia:before{content:"\f6f2"}.fa-html5:before{content:"\f13b"}.fa-hubspot:before{content:"\f3b2"}.fa-i-cursor:before{content:"\f246"}.fa-ice-cream:before{content:"\f810"}.fa-icicles:before{content:"\f7ad"}.fa-id-badge:before{content:"\f2c1"}.fa-id-card:before{content:"\f2c2"}.fa-id-card-alt:before{content:"\f47f"}.fa-igloo:before{content:"\f7ae"}.fa-image:before{content:"\f03e"}.fa-images:before{content:"\f302"}.fa-imdb:before{content:"\f2d8"}.fa-inbox:before{content:"\f01c"}.fa-indent:before{content:"\f03c"}.fa-industry:before{content:"\f275"}.fa-infinity:before{content:"\f534"}.fa-info:before{content:"\f129"}.fa-info-circle:before{content:"\f05a"}.fa-instagram:before{content:"\f16d"}.fa-intercom:before{content:"\f7af"}.fa-internet-explorer:before{content:"\f26b"}.fa-invision:before{content:"\f7b0"}.fa-ioxhost:before{content:"\f208"}.fa-italic:before{content:"\f033"}.fa-itunes:before{content:"\f3b4"}.fa-itunes-note:before{content:"\f3b5"}.fa-java:before{content:"\f4e4"}.fa-jedi:before{content:"\f669"}.fa-jedi-order:before{content:"\f50e"}.fa-jenkins:before{content:"\f3b6"}.fa-jira:before{content:"\f7b1"}.fa-joget:before{content:"\f3b7"}.fa-joint:before{content:"\f595"}.fa-joomla:before{content:"\f1aa"}.fa-journal-whills:before{content:"\f66a"}.fa-js:before{content:"\f3b8"}.fa-js-square:before{content:"\f3b9"}.fa-jsfiddle:before{content:"\f1cc"}.fa-kaaba:before{content:"\f66b"}.fa-kaggle:before{content:"\f5fa"}.fa-key:before{content:"\f084"}.fa-keybase:before{content:"\f4f5"}.fa-keyboard:before{content:"\f11c"}.fa-keycdn:before{content:"\f3ba"}.fa-khanda:before{content:"\f66d"}.fa-kickstarter:before{content:"\f3bb"}.fa-kickstarter-k:before{content:"\f3bc"}.fa-kiss:before{content:"\f596"}.fa-kiss-beam:before{content:"\f597"}.fa-kiss-wink-heart:before{content:"\f598"}.fa-kiwi-bird:before{content:"\f535"}.fa-korvue:before{content:"\f42f"}.fa-landmark:before{content:"\f66f"}.fa-language:before{content:"\f1ab"}.fa-laptop:before{content:"\f109"}.fa-laptop-code:before{content:"\f5fc"}.fa-laptop-medical:before{content:"\f812"}.fa-laravel:before{content:"\f3bd"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-laugh:before{content:"\f599"}.fa-laugh-beam:before{content:"\f59a"}.fa-laugh-squint:before{content:"\f59b"}.fa-laugh-wink:before{content:"\f59c"}.fa-layer-group:before{content:"\f5fd"}.fa-leaf:before{content:"\f06c"}.fa-leanpub:before{content:"\f212"}.fa-lemon:before{content:"\f094"}.fa-less:before{content:"\f41d"}.fa-less-than:before{content:"\f536"}.fa-less-than-equal:before{content:"\f537"}.fa-level-down-alt:before{content:"\f3be"}.fa-level-up-alt:before{content:"\f3bf"}.fa-life-ring:before{content:"\f1cd"}.fa-lightbulb:before{content:"\f0eb"}.fa-line:before{content:"\f3c0"}.fa-link:before{content:"\f0c1"}.fa-linkedin:before{content:"\f08c"}.fa-linkedin-in:before{content:"\f0e1"}.fa-linode:before{content:"\f2b8"}.fa-linux:before{content:"\f17c"}.fa-lira-sign:before{content:"\f195"}.fa-list:before{content:"\f03a"}.fa-list-alt:before{content:"\f022"}.fa-list-ol:before{content:"\f0cb"}.fa-list-ul:before{content:"\f0ca"}.fa-location-arrow:before{content:"\f124"}.fa-lock:before{content:"\f023"}.fa-lock-open:before{content:"\f3c1"}.fa-long-arrow-alt-down:before{content:"\f309"}.fa-long-arrow-alt-left:before{content:"\f30a"}.fa-long-arrow-alt-right:before{content:"\f30b"}.fa-long-arrow-alt-up:before{content:"\f30c"}.fa-low-vision:before{content:"\f2a8"}.fa-luggage-cart:before{content:"\f59d"}.fa-lyft:before{content:"\f3c3"}.fa-magento:before{content:"\f3c4"}.fa-magic:before{content:"\f0d0"}.fa-magnet:before{content:"\f076"}.fa-mail-bulk:before{content:"\f674"}.fa-mailchimp:before{content:"\f59e"}.fa-male:before{content:"\f183"}.fa-mandalorian:before{content:"\f50f"}.fa-map:before{content:"\f279"}.fa-map-marked:before{content:"\f59f"}.fa-map-marked-alt:before{content:"\f5a0"}.fa-map-marker:before{content:"\f041"}.fa-map-marker-alt:before{content:"\f3c5"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-markdown:before{content:"\f60f"}.fa-marker:before{content:"\f5a1"}.fa-mars:before{content:"\f222"}.fa-mars-double:before{content:"\f227"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mask:before{content:"\f6fa"}.fa-mastodon:before{content:"\f4f6"}.fa-maxcdn:before{content:"\f136"}.fa-medal:before{content:"\f5a2"}.fa-medapps:before{content:"\f3c6"}.fa-medium:before{content:"\f23a"}.fa-medium-m:before{content:"\f3c7"}.fa-medkit:before{content:"\f0fa"}.fa-medrt:before{content:"\f3c8"}.fa-meetup:before{content:"\f2e0"}.fa-megaport:before{content:"\f5a3"}.fa-meh:before{content:"\f11a"}.fa-meh-blank:before{content:"\f5a4"}.fa-meh-rolling-eyes:before{content:"\f5a5"}.fa-memory:before{content:"\f538"}.fa-mendeley:before{content:"\f7b3"}.fa-menorah:before{content:"\f676"}.fa-mercury:before{content:"\f223"}.fa-meteor:before{content:"\f753"}.fa-microchip:before{content:"\f2db"}.fa-microphone:before{content:"\f130"}.fa-microphone-alt:before{content:"\f3c9"}.fa-microphone-alt-slash:before{content:"\f539"}.fa-microphone-slash:before{content:"\f131"}.fa-microscope:before{content:"\f610"}.fa-microsoft:before{content:"\f3ca"}.fa-minus:before{content:"\f068"}.fa-minus-circle:before{content:"\f056"}.fa-minus-square:before{content:"\f146"}.fa-mitten:before{content:"\f7b5"}.fa-mix:before{content:"\f3cb"}.fa-mixcloud:before{content:"\f289"}.fa-mizuni:before{content:"\f3cc"}.fa-mobile:before{content:"\f10b"}.fa-mobile-alt:before{content:"\f3cd"}.fa-modx:before{content:"\f285"}.fa-monero:before{content:"\f3d0"}.fa-money-bill:before{content:"\f0d6"}.fa-money-bill-alt:before{content:"\f3d1"}.fa-money-bill-wave:before{content:"\f53a"}.fa-money-bill-wave-alt:before{content:"\f53b"}.fa-money-check:before{content:"\f53c"}.fa-money-check-alt:before{content:"\f53d"}.fa-monument:before{content:"\f5a6"}.fa-moon:before{content:"\f186"}.fa-mortar-pestle:before{content:"\f5a7"}.fa-mosque:before{content:"\f678"}.fa-motorcycle:before{content:"\f21c"}.fa-mountain:before{content:"\f6fc"}.fa-mouse-pointer:before{content:"\f245"}.fa-mug-hot:before{content:"\f7b6"}.fa-music:before{content:"\f001"}.fa-napster:before{content:"\f3d2"}.fa-neos:before{content:"\f612"}.fa-network-wired:before{content:"\f6ff"}.fa-neuter:before{content:"\f22c"}.fa-newspaper:before{content:"\f1ea"}.fa-nimblr:before{content:"\f5a8"}.fa-nintendo-switch:before{content:"\f418"}.fa-node:before{content:"\f419"}.fa-node-js:before{content:"\f3d3"}.fa-not-equal:before{content:"\f53e"}.fa-notes-medical:before{content:"\f481"}.fa-npm:before{content:"\f3d4"}.fa-ns8:before{content:"\f3d5"}.fa-nutritionix:before{content:"\f3d6"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-oil-can:before{content:"\f613"}.fa-old-republic:before{content:"\f510"}.fa-om:before{content:"\f679"}.fa-opencart:before{content:"\f23d"}.fa-openid:before{content:"\f19b"}.fa-opera:before{content:"\f26a"}.fa-optin-monster:before{content:"\f23c"}.fa-osi:before{content:"\f41a"}.fa-otter:before{content:"\f700"}.fa-outdent:before{content:"\f03b"}.fa-page4:before{content:"\f3d7"}.fa-pagelines:before{content:"\f18c"}.fa-pager:before{content:"\f815"}.fa-paint-brush:before{content:"\f1fc"}.fa-paint-roller:before{content:"\f5aa"}.fa-palette:before{content:"\f53f"}.fa-palfed:before{content:"\f3d8"}.fa-pallet:before{content:"\f482"}.fa-paper-plane:before{content:"\f1d8"}.fa-paperclip:before{content:"\f0c6"}.fa-parachute-box:before{content:"\f4cd"}.fa-paragraph:before{content:"\f1dd"}.fa-parking:before{content:"\f540"}.fa-passport:before{content:"\f5ab"}.fa-pastafarianism:before{content:"\f67b"}.fa-paste:before{content:"\f0ea"}.fa-patreon:before{content:"\f3d9"}.fa-pause:before{content:"\f04c"}.fa-pause-circle:before{content:"\f28b"}.fa-paw:before{content:"\f1b0"}.fa-paypal:before{content:"\f1ed"}.fa-peace:before{content:"\f67c"}.fa-pen:before{content:"\f304"}.fa-pen-alt:before{content:"\f305"}.fa-pen-fancy:before{content:"\f5ac"}.fa-pen-nib:before{content:"\f5ad"}.fa-pen-square:before{content:"\f14b"}.fa-pencil-alt:before{content:"\f303"}.fa-pencil-ruler:before{content:"\f5ae"}.fa-penny-arcade:before{content:"\f704"}.fa-people-carry:before{content:"\f4ce"}.fa-pepper-hot:before{content:"\f816"}.fa-percent:before{content:"\f295"}.fa-percentage:before{content:"\f541"}.fa-periscope:before{content:"\f3da"}.fa-person-booth:before{content:"\f756"}.fa-phabricator:before{content:"\f3db"}.fa-phoenix-framework:before{content:"\f3dc"}.fa-phoenix-squadron:before{content:"\f511"}.fa-phone:before{content:"\f095"}.fa-phone-slash:before{content:"\f3dd"}.fa-phone-square:before{content:"\f098"}.fa-phone-volume:before{content:"\f2a0"}.fa-php:before{content:"\f457"}.fa-pied-piper:before{content:"\f2ae"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-pied-piper-hat:before{content:"\f4e5"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-piggy-bank:before{content:"\f4d3"}.fa-pills:before{content:"\f484"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-p:before{content:"\f231"}.fa-pinterest-square:before{content:"\f0d3"}.fa-pizza-slice:before{content:"\f818"}.fa-place-of-worship:before{content:"\f67f"}.fa-plane:before{content:"\f072"}.fa-plane-arrival:before{content:"\f5af"}.fa-plane-departure:before{content:"\f5b0"}.fa-play:before{content:"\f04b"}.fa-play-circle:before{content:"\f144"}.fa-playstation:before{content:"\f3df"}.fa-plug:before{content:"\f1e6"}.fa-plus:before{content:"\f067"}.fa-plus-circle:before{content:"\f055"}.fa-plus-square:before{content:"\f0fe"}.fa-podcast:before{content:"\f2ce"}.fa-poll:before{content:"\f681"}.fa-poll-h:before{content:"\f682"}.fa-poo:before{content:"\f2fe"}.fa-poo-storm:before{content:"\f75a"}.fa-poop:before{content:"\f619"}.fa-portrait:before{content:"\f3e0"}.fa-pound-sign:before{content:"\f154"}.fa-power-off:before{content:"\f011"}.fa-pray:before{content:"\f683"}.fa-praying-hands:before{content:"\f684"}.fa-prescription:before{content:"\f5b1"}.fa-prescription-bottle:before{content:"\f485"}.fa-prescription-bottle-alt:before{content:"\f486"}.fa-print:before{content:"\f02f"}.fa-procedures:before{content:"\f487"}.fa-product-hunt:before{content:"\f288"}.fa-project-diagram:before{content:"\f542"}.fa-pushed:before{content:"\f3e1"}.fa-puzzle-piece:before{content:"\f12e"}.fa-python:before{content:"\f3e2"}.fa-qq:before{content:"\f1d6"}.fa-qrcode:before{content:"\f029"}.fa-question:before{content:"\f128"}.fa-question-circle:before{content:"\f059"}.fa-quidditch:before{content:"\f458"}.fa-quinscape:before{content:"\f459"}.fa-quora:before{content:"\f2c4"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-quran:before{content:"\f687"}.fa-r-project:before{content:"\f4f7"}.fa-radiation:before{content:"\f7b9"}.fa-radiation-alt:before{content:"\f7ba"}.fa-rainbow:before{content:"\f75b"}.fa-random:before{content:"\f074"}.fa-raspberry-pi:before{content:"\f7bb"}.fa-ravelry:before{content:"\f2d9"}.fa-react:before{content:"\f41b"}.fa-reacteurope:before{content:"\f75d"}.fa-readme:before{content:"\f4d5"}.fa-rebel:before{content:"\f1d0"}.fa-receipt:before{content:"\f543"}.fa-recycle:before{content:"\f1b8"}.fa-red-river:before{content:"\f3e3"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-alien:before{content:"\f281"}.fa-reddit-square:before{content:"\f1a2"}.fa-redhat:before{content:"\f7bc"}.fa-redo:before{content:"\f01e"}.fa-redo-alt:before{content:"\f2f9"}.fa-registered:before{content:"\f25d"}.fa-renren:before{content:"\f18b"}.fa-reply:before{content:"\f3e5"}.fa-reply-all:before{content:"\f122"}.fa-replyd:before{content:"\f3e6"}.fa-republican:before{content:"\f75e"}.fa-researchgate:before{content:"\f4f8"}.fa-resolving:before{content:"\f3e7"}.fa-restroom:before{content:"\f7bd"}.fa-retweet:before{content:"\f079"}.fa-rev:before{content:"\f5b2"}.fa-ribbon:before{content:"\f4d6"}.fa-ring:before{content:"\f70b"}.fa-road:before{content:"\f018"}.fa-robot:before{content:"\f544"}.fa-rocket:before{content:"\f135"}.fa-rocketchat:before{content:"\f3e8"}.fa-rockrms:before{content:"\f3e9"}.fa-route:before{content:"\f4d7"}.fa-rss:before{content:"\f09e"}.fa-rss-square:before{content:"\f143"}.fa-ruble-sign:before{content:"\f158"}.fa-ruler:before{content:"\f545"}.fa-ruler-combined:before{content:"\f546"}.fa-ruler-horizontal:before{content:"\f547"}.fa-ruler-vertical:before{content:"\f548"}.fa-running:before{content:"\f70c"}.fa-rupee-sign:before{content:"\f156"}.fa-sad-cry:before{content:"\f5b3"}.fa-sad-tear:before{content:"\f5b4"}.fa-safari:before{content:"\f267"}.fa-sass:before{content:"\f41e"}.fa-satellite:before{content:"\f7bf"}.fa-satellite-dish:before{content:"\f7c0"}.fa-save:before{content:"\f0c7"}.fa-schlix:before{content:"\f3ea"}.fa-school:before{content:"\f549"}.fa-screwdriver:before{content:"\f54a"}.fa-scribd:before{content:"\f28a"}.fa-scroll:before{content:"\f70e"}.fa-sd-card:before{content:"\f7c2"}.fa-search:before{content:"\f002"}.fa-search-dollar:before{content:"\f688"}.fa-search-location:before{content:"\f689"}.fa-search-minus:before{content:"\f010"}.fa-search-plus:before{content:"\f00e"}.fa-searchengin:before{content:"\f3eb"}.fa-seedling:before{content:"\f4d8"}.fa-sellcast:before{content:"\f2da"}.fa-sellsy:before{content:"\f213"}.fa-server:before{content:"\f233"}.fa-servicestack:before{content:"\f3ec"}.fa-shapes:before{content:"\f61f"}.fa-share:before{content:"\f064"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-share-square:before{content:"\f14d"}.fa-shekel-sign:before{content:"\f20b"}.fa-shield-alt:before{content:"\f3ed"}.fa-ship:before{content:"\f21a"}.fa-shipping-fast:before{content:"\f48b"}.fa-shirtsinbulk:before{content:"\f214"}.fa-shoe-prints:before{content:"\f54b"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-shopping-cart:before{content:"\f07a"}.fa-shopware:before{content:"\f5b5"}.fa-shower:before{content:"\f2cc"}.fa-shuttle-van:before{content:"\f5b6"}.fa-sign:before{content:"\f4d9"}.fa-sign-in-alt:before{content:"\f2f6"}.fa-sign-language:before{content:"\f2a7"}.fa-sign-out-alt:before{content:"\f2f5"}.fa-signal:before{content:"\f012"}.fa-signature:before{content:"\f5b7"}.fa-sim-card:before{content:"\f7c4"}.fa-simplybuilt:before{content:"\f215"}.fa-sistrix:before{content:"\f3ee"}.fa-sitemap:before{content:"\f0e8"}.fa-sith:before{content:"\f512"}.fa-skating:before{content:"\f7c5"}.fa-sketch:before{content:"\f7c6"}.fa-skiing:before{content:"\f7c9"}.fa-skiing-nordic:before{content:"\f7ca"}.fa-skull:before{content:"\f54c"}.fa-skull-crossbones:before{content:"\f714"}.fa-skyatlas:before{content:"\f216"}.fa-skype:before{content:"\f17e"}.fa-slack:before{content:"\f198"}.fa-slack-hash:before{content:"\f3ef"}.fa-slash:before{content:"\f715"}.fa-sleigh:before{content:"\f7cc"}.fa-sliders-h:before{content:"\f1de"}.fa-slideshare:before{content:"\f1e7"}.fa-smile:before{content:"\f118"}.fa-smile-beam:before{content:"\f5b8"}.fa-smile-wink:before{content:"\f4da"}.fa-smog:before{content:"\f75f"}.fa-smoking:before{content:"\f48d"}.fa-smoking-ban:before{content:"\f54d"}.fa-sms:before{content:"\f7cd"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-snowboarding:before{content:"\f7ce"}.fa-snowflake:before{content:"\f2dc"}.fa-snowman:before{content:"\f7d0"}.fa-snowplow:before{content:"\f7d2"}.fa-socks:before{content:"\f696"}.fa-solar-panel:before{content:"\f5ba"}.fa-sort:before{content:"\f0dc"}.fa-sort-alpha-down:before{content:"\f15d"}.fa-sort-alpha-up:before{content:"\f15e"}.fa-sort-amount-down:before{content:"\f160"}.fa-sort-amount-up:before{content:"\f161"}.fa-sort-down:before{content:"\f0dd"}.fa-sort-numeric-down:before{content:"\f162"}.fa-sort-numeric-up:before{content:"\f163"}.fa-sort-up:before{content:"\f0de"}.fa-soundcloud:before{content:"\f1be"}.fa-sourcetree:before{content:"\f7d3"}.fa-spa:before{content:"\f5bb"}.fa-space-shuttle:before{content:"\f197"}.fa-speakap:before{content:"\f3f3"}.fa-spider:before{content:"\f717"}.fa-spinner:before{content:"\f110"}.fa-splotch:before{content:"\f5bc"}.fa-spotify:before{content:"\f1bc"}.fa-spray-can:before{content:"\f5bd"}.fa-square:before{content:"\f0c8"}.fa-square-full:before{content:"\f45c"}.fa-square-root-alt:before{content:"\f698"}.fa-squarespace:before{content:"\f5be"}.fa-stack-exchange:before{content:"\f18d"}.fa-stack-overflow:before{content:"\f16c"}.fa-stamp:before{content:"\f5bf"}.fa-star:before{content:"\f005"}.fa-star-and-crescent:before{content:"\f699"}.fa-star-half:before{content:"\f089"}.fa-star-half-alt:before{content:"\f5c0"}.fa-star-of-david:before{content:"\f69a"}.fa-star-of-life:before{content:"\f621"}.fa-staylinked:before{content:"\f3f5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-steam-symbol:before{content:"\f3f6"}.fa-step-backward:before{content:"\f048"}.fa-step-forward:before{content:"\f051"}.fa-stethoscope:before{content:"\f0f1"}.fa-sticker-mule:before{content:"\f3f7"}.fa-sticky-note:before{content:"\f249"}.fa-stop:before{content:"\f04d"}.fa-stop-circle:before{content:"\f28d"}.fa-stopwatch:before{content:"\f2f2"}.fa-store:before{content:"\f54e"}.fa-store-alt:before{content:"\f54f"}.fa-strava:before{content:"\f428"}.fa-stream:before{content:"\f550"}.fa-street-view:before{content:"\f21d"}.fa-strikethrough:before{content:"\f0cc"}.fa-stripe:before{content:"\f429"}.fa-stripe-s:before{content:"\f42a"}.fa-stroopwafel:before{content:"\f551"}.fa-studiovinari:before{content:"\f3f8"}.fa-stumbleupon:before{content:"\f1a4"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-subscript:before{content:"\f12c"}.fa-subway:before{content:"\f239"}.fa-suitcase:before{content:"\f0f2"}.fa-suitcase-rolling:before{content:"\f5c1"}.fa-sun:before{content:"\f185"}.fa-superpowers:before{content:"\f2dd"}.fa-superscript:before{content:"\f12b"}.fa-supple:before{content:"\f3f9"}.fa-surprise:before{content:"\f5c2"}.fa-suse:before{content:"\f7d6"}.fa-swatchbook:before{content:"\f5c3"}.fa-swimmer:before{content:"\f5c4"}.fa-swimming-pool:before{content:"\f5c5"}.fa-synagogue:before{content:"\f69b"}.fa-sync:before{content:"\f021"}.fa-sync-alt:before{content:"\f2f1"}.fa-syringe:before{content:"\f48e"}.fa-table:before{content:"\f0ce"}.fa-table-tennis:before{content:"\f45d"}.fa-tablet:before{content:"\f10a"}.fa-tablet-alt:before{content:"\f3fa"}.fa-tablets:before{content:"\f490"}.fa-tachometer-alt:before{content:"\f3fd"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-tape:before{content:"\f4db"}.fa-tasks:before{content:"\f0ae"}.fa-taxi:before{content:"\f1ba"}.fa-teamspeak:before{content:"\f4f9"}.fa-teeth:before{content:"\f62e"}.fa-teeth-open:before{content:"\f62f"}.fa-telegram:before{content:"\f2c6"}.fa-telegram-plane:before{content:"\f3fe"}.fa-temperature-high:before{content:"\f769"}.fa-temperature-low:before{content:"\f76b"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-tenge:before{content:"\f7d7"}.fa-terminal:before{content:"\f120"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-th:before{content:"\f00a"}.fa-th-large:before{content:"\f009"}.fa-th-list:before{content:"\f00b"}.fa-the-red-yeti:before{content:"\f69d"}.fa-theater-masks:before{content:"\f630"}.fa-themeco:before{content:"\f5c6"}.fa-themeisle:before{content:"\f2b2"}.fa-thermometer:before{content:"\f491"}.fa-thermometer-empty:before{content:"\f2cb"}.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-think-peaks:before{content:"\f731"}.fa-thumbs-down:before{content:"\f165"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbtack:before{content:"\f08d"}.fa-ticket-alt:before{content:"\f3ff"}.fa-times:before{content:"\f00d"}.fa-times-circle:before{content:"\f057"}.fa-tint:before{content:"\f043"}.fa-tint-slash:before{content:"\f5c7"}.fa-tired:before{content:"\f5c8"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-toilet:before{content:"\f7d8"}.fa-toilet-paper:before{content:"\f71e"}.fa-toolbox:before{content:"\f552"}.fa-tools:before{content:"\f7d9"}.fa-tooth:before{content:"\f5c9"}.fa-torah:before{content:"\f6a0"}.fa-torii-gate:before{content:"\f6a1"}.fa-tractor:before{content:"\f722"}.fa-trade-federation:before{content:"\f513"}.fa-trademark:before{content:"\f25c"}.fa-traffic-light:before{content:"\f637"}.fa-train:before{content:"\f238"}.fa-tram:before{content:"\f7da"}.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-trash:before{content:"\f1f8"}.fa-trash-alt:before{content:"\f2ed"}.fa-trash-restore:before{content:"\f829"}.fa-trash-restore-alt:before{content:"\f82a"}.fa-tree:before{content:"\f1bb"}.fa-trello:before{content:"\f181"}.fa-tripadvisor:before{content:"\f262"}.fa-trophy:before{content:"\f091"}.fa-truck:before{content:"\f0d1"}.fa-truck-loading:before{content:"\f4de"}.fa-truck-monster:before{content:"\f63b"}.fa-truck-moving:before{content:"\f4df"}.fa-truck-pickup:before{content:"\f63c"}.fa-tshirt:before{content:"\f553"}.fa-tty:before{content:"\f1e4"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-tv:before{content:"\f26c"}.fa-twitch:before{content:"\f1e8"}.fa-twitter:before{content:"\f099"}.fa-twitter-square:before{content:"\f081"}.fa-typo3:before{content:"\f42b"}.fa-uber:before{content:"\f402"}.fa-ubuntu:before{content:"\f7df"}.fa-uikit:before{content:"\f403"}.fa-umbrella:before{content:"\f0e9"}.fa-umbrella-beach:before{content:"\f5ca"}.fa-underline:before{content:"\f0cd"}.fa-undo:before{content:"\f0e2"}.fa-undo-alt:before{content:"\f2ea"}.fa-uniregistry:before{content:"\f404"}.fa-universal-access:before{content:"\f29a"}.fa-university:before{content:"\f19c"}.fa-unlink:before{content:"\f127"}.fa-unlock:before{content:"\f09c"}.fa-unlock-alt:before{content:"\f13e"}.fa-untappd:before{content:"\f405"}.fa-upload:before{content:"\f093"}.fa-ups:before{content:"\f7e0"}.fa-usb:before{content:"\f287"}.fa-user:before{content:"\f007"}.fa-user-alt:before{content:"\f406"}.fa-user-alt-slash:before{content:"\f4fa"}.fa-user-astronaut:before{content:"\f4fb"}.fa-user-check:before{content:"\f4fc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-clock:before{content:"\f4fd"}.fa-user-cog:before{content:"\f4fe"}.fa-user-edit:before{content:"\f4ff"}.fa-user-friends:before{content:"\f500"}.fa-user-graduate:before{content:"\f501"}.fa-user-injured:before{content:"\f728"}.fa-user-lock:before{content:"\f502"}.fa-user-md:before{content:"\f0f0"}.fa-user-minus:before{content:"\f503"}.fa-user-ninja:before{content:"\f504"}.fa-user-nurse:before{content:"\f82f"}.fa-user-plus:before{content:"\f234"}.fa-user-secret:before{content:"\f21b"}.fa-user-shield:before{content:"\f505"}.fa-user-slash:before{content:"\f506"}.fa-user-tag:before{content:"\f507"}.fa-user-tie:before{content:"\f508"}.fa-user-times:before{content:"\f235"}.fa-users:before{content:"\f0c0"}.fa-users-cog:before{content:"\f509"}.fa-usps:before{content:"\f7e1"}.fa-ussunnah:before{content:"\f407"}.fa-utensil-spoon:before{content:"\f2e5"}.fa-utensils:before{content:"\f2e7"}.fa-vaadin:before{content:"\f408"}.fa-vector-square:before{content:"\f5cb"}.fa-venus:before{content:"\f221"}.fa-venus-double:before{content:"\f226"}.fa-venus-mars:before{content:"\f228"}.fa-viacoin:before{content:"\f237"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-vial:before{content:"\f492"}.fa-vials:before{content:"\f493"}.fa-viber:before{content:"\f409"}.fa-video:before{content:"\f03d"}.fa-video-slash:before{content:"\f4e2"}.fa-vihara:before{content:"\f6a7"}.fa-vimeo:before{content:"\f40a"}.fa-vimeo-square:before{content:"\f194"}.fa-vimeo-v:before{content:"\f27d"}.fa-vine:before{content:"\f1ca"}.fa-vk:before{content:"\f189"}.fa-vnv:before{content:"\f40b"}.fa-volleyball-ball:before{content:"\f45f"}.fa-volume-down:before{content:"\f027"}.fa-volume-mute:before{content:"\f6a9"}.fa-volume-off:before{content:"\f026"}.fa-volume-up:before{content:"\f028"}.fa-vote-yea:before{content:"\f772"}.fa-vr-cardboard:before{content:"\f729"}.fa-vuejs:before{content:"\f41f"}.fa-walking:before{content:"\f554"}.fa-wallet:before{content:"\f555"}.fa-warehouse:before{content:"\f494"}.fa-water:before{content:"\f773"}.fa-weebly:before{content:"\f5cc"}.fa-weibo:before{content:"\f18a"}.fa-weight:before{content:"\f496"}.fa-weight-hanging:before{content:"\f5cd"}.fa-weixin:before{content:"\f1d7"}.fa-whatsapp:before{content:"\f232"}.fa-whatsapp-square:before{content:"\f40c"}.fa-wheelchair:before{content:"\f193"}.fa-whmcs:before{content:"\f40d"}.fa-wifi:before{content:"\f1eb"}.fa-wikipedia-w:before{content:"\f266"}.fa-wind:before{content:"\f72e"}.fa-window-close:before{content:"\f410"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-windows:before{content:"\f17a"}.fa-wine-bottle:before{content:"\f72f"}.fa-wine-glass:before{content:"\f4e3"}.fa-wine-glass-alt:before{content:"\f5ce"}.fa-wix:before{content:"\f5cf"}.fa-wizards-of-the-coast:before{content:"\f730"}.fa-wolf-pack-battalion:before{content:"\f514"}.fa-won-sign:before{content:"\f159"}.fa-wordpress:before{content:"\f19a"}.fa-wordpress-simple:before{content:"\f411"}.fa-wpbeginner:before{content:"\f297"}.fa-wpexplorer:before{content:"\f2de"}.fa-wpforms:before{content:"\f298"}.fa-wpressr:before{content:"\f3e4"}.fa-wrench:before{content:"\f0ad"}.fa-x-ray:before{content:"\f497"}.fa-xbox:before{content:"\f412"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-y-combinator:before{content:"\f23b"}.fa-yahoo:before{content:"\f19e"}.fa-yandex:before{content:"\f413"}.fa-yandex-international:before{content:"\f414"}.fa-yarn:before{content:"\f7e3"}.fa-yelp:before{content:"\f1e9"}.fa-yen-sign:before{content:"\f157"}.fa-yin-yang:before{content:"\f6ad"}.fa-yoast:before{content:"\f2b1"}.fa-youtube:before{content:"\f167"}.fa-youtube-square:before{content:"\f431"}.fa-zhihu:before{content:"\f63f"}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}@font-face{font-family:"Font Awesome 5 Brands";font-style:normal;font-weight:400;font-display:auto;src:url(libs/fonts/fa-brands-400.eot);src:url(libs/fonts/fa-brands-400.eot?#iefix) format("embedded-opentype"),url(libs/fonts/fa-brands-400.woff2) format("woff2"),url(libs/fonts/fa-brands-400.woff) format("woff"),url(libs/fonts/fa-brands-400.ttf) format("truetype"),url(libs/fonts/fa-brands-400.svg#fontawesome) format("svg")}.fab{font-family:"Font Awesome 5 Brands"}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:400;font-display:auto;src:url(libs/fonts/fa-regular-400.eot);src:url(libs/fonts/fa-regular-400.eot?#iefix) format("embedded-opentype"),url(libs/fonts/fa-regular-400.woff2) format("woff2"),url(libs/fonts/fa-regular-400.woff) format("woff"),url(libs/fonts/fa-regular-400.ttf) format("truetype"),url(libs/fonts/fa-regular-400.svg#fontawesome) format("svg")}.far{font-weight:400}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;font-display:auto;src:url(libs/fonts/fa-solid-900.eot);src:url(libs/fonts/fa-solid-900.eot?#iefix) format("embedded-opentype"),url(libs/fonts/fa-solid-900.woff2) format("woff2"),url(libs/fonts/fa-solid-900.woff) format("woff"),url(libs/fonts/fa-solid-900.ttf) format("truetype"),url(libs/fonts/fa-solid-900.svg#fontawesome) format("svg")}.fa,.far,.fas{font-family:"Font Awesome 5 Free"}.fa,.fas{font-weight:900}:root{--colorLink:#999;--colorSidebar:#fff;--errorColor:#f44336;--main:#f44336;--sidebarBg:#292929;--sidebarHoverBg:#232323;--bg:#eee;--border:#e5e5e5;--color:#232323;--contentBg:#fff;--headerBg:#fff;--selectedBg:#ffe7e5;--bgqoute:#eee}.night-colors{--bg:#1f1f1f;--border:#191919;--color:#fff;--contentBg:#292929;--headerBg:#292929;--selectedBg:#261918;--bgqoute:#1f1f1f5e}.light-colors{--bg:#eee;--border:#e5e5e5;--color:#232323;--contentBg:#fff;--headerBg:#fff;--selectedBg:#ffe7e5;--bgqoute:#eee}body.dark{--bg:#1f1f1f;--border:#191919;--color:#fff;--contentBg:#292929;--headerBg:#292929;--selectedBg:#261918;--bgqoute:#1f1f1f5e}body.light{--bg:#eee;--border:#e5e5e5;--color:#232323;--contentBg:#fff;--headerBg:#fff;--selectedBg:#ffe7e5;--bgqoute:#eee}@media (prefers-color-scheme:dark){:root{--bg:#1f1f1f;--border:#191919;--color:#fff;--contentBg:#292929;--headerBg:#292929;--selectedBg:#261918;--bgqoute:#1f1f1f5e}}@media (prefers-color-scheme:light){:root{--bg:#eee;--border:#e5e5e5;--color:#232323;--contentBg:#fff;--headerBg:#fff;--selectedBg:#ffe7e5;--bgqoute:#eee}}select{background:var(--contentBg);border:1px solid var(--border);border-radius:4px;color:var(--color)}.login-footer{color:var(--color)}.content-footer{width:100%;padding:20px;max-width:840px;margin-bottom:16px;background-color:var(--contentBg);border:1px solid var(--border);display:flex;flex-flow:column;align-items:center}.metadata{display:flex;flex-flow:row wrap;text-align:center;font-size:16px;color:var(--colorLink)}.metadata:first-child{justify-content:flex-start}.metadata:nth-child(2){justify-content:flex-end}.metadata[v-cloak]{visibility:hidden}.links{display:flex;flex-flow:row wrap}.links a{padding:0 4px;color:var(--color);text-decoration:underline}.links a:focus,.links a:hover{color:var(--main)}*{border-width:0;box-sizing:border-box;font-family:"Source Sans Pro",sans-serif;margin:0;padding:0;text-decoration:none}body{background-color:var(--bg)}a{cursor:pointer}.spacer{flex:1}#login-scene{height:100%;height:100dvh;padding:16px;overflow:auto;display:flex;align-items:center;flex-flow:column nowrap;background-color:var(--bg)}#login-scene>.error-message{width:100%;max-width:400px;font-size:1em;background-color:var(--contentBg);border:1px solid var(--border);padding:16px;margin-top:auto;margin-bottom:16px;text-align:center;color:var(--errorColor)}#login-scene #login-box{width:100%;max-width:400px;margin-bottom:auto;background-color:var(--contentBg);display:flex;flex-flow:column nowrap;border:1px solid var(--border);flex-shrink:0}#login-scene #login-box:first-child{margin-top:auto}#login-scene #login-box #logo-area{display:flex;align-items:center;flex-flow:column nowrap;padding:16px;background-color:var(--main);border-bottom:1px solid var(--border);flex-shrink:0}#login-scene #login-box #logo-area #logo{font-size:3em;font-weight:100;color:var(--contentBg)}#login-scene #login-box #logo-area #logo span{margin-right:8px}#login-scene #login-box #logo-area #tagline{font-weight:500;margin-top:4px;color:var(--contentBg);text-align:center}#login-scene #login-box #input-area{padding:16px;display:grid;grid-gap:16px;grid-template-columns:auto 1fr;justify-content:baseline;align-items:center;border-bottom:1px solid var(--border)}#login-scene #login-box #input-area>label{color:var(--color)}#login-scene #login-box #input-area>input{color:var(--color);padding:8px;background-color:var(--contentBg);border:1px solid var(--border);min-width:0;font-size:1em}#login-scene #login-box #input-area .checkbox-field{grid-column:1/span 2;display:flex;flex-flow:row nowrap;align-items:center;justify-content:center;cursor:pointer}#login-scene #login-box #input-area .checkbox-field:focus,#login-scene #login-box #input-area .checkbox-field:hover{text-decoration:underline;text-decoration-color:var(--main)}#login-scene #login-box #input-area .checkbox-field>input[type=checkbox]{margin-right:8px}#login-scene #login-box #button-area{display:flex;flex-flow:row nowrap;padding:16px;justify-content:center}#login-scene #login-box #button-area a{color:var(--color);text-transform:uppercase;text-align:center;font-weight:600;cursor:default}#login-scene #login-box #button-area a.button{cursor:pointer}#login-scene #login-box #button-area a.button:focus,#login-scene #login-box #button-area a.button:hover{color:var(--main)}#main-scene{min-height:100%;min-height:100dvh;padding-top:60px;padding-left:60px;background-color:var(--bg)}#main-scene #main-sidebar{top:0;left:0;width:60px;height:100%;height:100dvh;position:fixed;display:flex;flex-flow:column nowrap;background-color:var(--sidebarBg);z-index:1}#main-scene #main-sidebar a{flex-shrink:0;display:block;width:60px;line-height:60px;text-align:center;font-size:1em;color:var(--colorSidebar)}#main-scene #main-sidebar a.active{cursor:default;color:var(--colorSidebar);background-color:var(--main)}#main-scene #main-sidebar a:focus,#main-scene #main-sidebar a:hover{color:var(--main);background-color:var(--sidebarHoverBg)}#main-scene .page-header{top:0;left:60px;right:0;height:60px;position:fixed;color:var(--color);background-color:var(--headerBg);border-bottom:1px solid var(--border);padding:0 16px;z-index:10}#main-scene h1.page-header{line-height:60px;font-size:1.3em;font-weight:600}#main-scene div.page-header{display:flex;flex-flow:row nowrap;align-items:center}#main-scene div.page-header p{flex:1 0;font-size:1.3em;font-weight:600;line-height:60px;color:var(--color)}#main-scene div.page-header input[type=text]{flex:1 0;min-width:0;margin-right:8px;font-size:1.1em;font-weight:500;line-height:59px;color:var(--color);background-color:var(--contentBg)}#main-scene div.page-header input[type=text]::placeholder{color:var(--colorLink)}#main-scene div.page-header a{display:block;width:24px;line-height:24px;color:var(--colorLink);text-align:center}#main-scene div.page-header a:not(:last-child){margin-right:8px}#main-scene div.page-header a:hover{color:var(--main)}#main-scene .loading-overlay{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;overflow:hidden;position:fixed;top:0;left:0;width:100%;width:100dvw;height:100%;height:100dvh;z-index:10001;background-color:rgba(0,0,0,.6)}#main-scene .loading-overlay i{color:var(--colorSidebar);font-size:4em;text-align:center;width:80px;line-height:80px;position:absolute}@media (max-width:600px){#main-scene{padding-top:50px;padding-left:0;padding-bottom:50px}#main-scene #main-sidebar{top:auto;right:0;bottom:0;width:100%;width:100dvw;height:50px;flex-flow:row nowrap;border-top:1px solid var(--border)}#main-scene #main-sidebar .spacer{display:none}#main-scene #main-sidebar a{width:auto;flex:1 0;line-height:50px}#main-scene #main-sidebar a:focus,#main-scene #main-sidebar a:hover{color:var(--colorSidebar);background-color:var(--main)}#main-scene .page-header{left:0;height:50px}#main-scene h1.page-header{text-align:center;font-size:1em;line-height:50px;text-transform:uppercase}#main-scene div.page-header{flex-flow:row wrap}#main-scene div.page-header p{flex:1 0;font-size:1em;font-weight:500;line-height:3em;padding:0}#main-scene div.page-header input[type=text]{flex:1 0;font-size:1em;font-weight:500;line-height:3em}#main-scene div.page-header a{display:block;width:24px;line-height:100%}}#content-scene{padding:20px;display:flex;color:var(--color);background-color:var(--bg);flex-flow:column nowrap;align-items:center}#content-scene #header{width:100%;padding:20px;max-width:840px;margin-bottom:16px;background-color:var(--contentBg);border:1px solid var(--border);display:flex;flex-flow:column;align-items:center}#content-scene #header #title{padding:8px 0;grid-column-start:1;grid-column-end:-1;font-size:36px;font-weight:700;word-break:break-word;hyphens:none;text-align:center}#content-scene #content{width:100%;padding:20px;max-width:840px;background-color:var(--contentBg);border:1px solid var(--border)}#content-scene #content *{font-size:18px;line-height:180%}#content-scene #content :not(:last-child){margin-bottom:20px}#content-scene #content a{color:var(--color);text-decoration:underline}#content-scene #content a:focus,#content-scene #content a:hover{color:var(--main)}#content-scene #content code,#content-scene #content pre{overflow:auto;border:1px solid var(--border);font-family:"Ubuntu Mono","Courier New",Courier,monospace;font-size:16px}#content-scene #content pre{padding:8px}#content-scene #content pre>code{border:0}#content-scene #content ol,#content-scene #content ul{padding-left:16px}#content-scene #content img{height:auto;max-width:100%}#content-scene #content table{border:1px solid var(--border);border-collapse:collapse}#content-scene #content table td,#content-scene #content table th,#content-scene #content table tr{border:1px solid var(--border)}#content-scene #content blockquote{margin:15px;padding:15px;font-style:italic;background:var(--bgqoute)}#page-home>.empty-message{max-width:400px;font-size:1em;background-color:var(--contentBg);border:1px solid var(--border);padding:16px;margin:16px;color:var(--errorColor)}#page-home #edit-box{background-color:var(--selectedBg);border-bottom:1px solid var(--main)}#page-home #bookmarks-grid{display:grid;grid-template-rows:min-content;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));grid-gap:16px;padding:16px;overflow:auto}#page-home #bookmarks-grid .bookmark{align-self:start}#page-home #bookmarks-grid .pagination-box{grid-column-end:-1;grid-column-start:1;display:flex;flex-flow:row nowrap;align-self:start}#page-home #bookmarks-grid .pagination-box a{padding:8px;color:var(--colorLink)}#page-home #bookmarks-grid .pagination-box a:focus,#page-home #bookmarks-grid .pagination-box a:hover{color:var(--main)}#page-home #bookmarks-grid .pagination-box input{width:40px;padding:8px;text-align:center;font-size:.9em;color:var(--color);border:1px solid var(--border);background-color:var(--contentBg);margin:0 8px}#page-home #bookmarks-grid .pagination-box p{font-size:.9em;color:var(--colorLink);line-height:37px;font-weight:600}#page-home #bookmarks-grid .pagination-box p:last-of-type::before{content:"/";margin-right:8px}#page-home #bookmarks-grid.list{grid-gap:0;padding-bottom:0;grid-template-columns:auto}#page-home #bookmarks-grid.list .pagination-box{padding:16px 0}#page-home #bookmarks-grid.list .pagination-box:first-child{padding-top:0}@media (max-width:600px){#page-home #bookmarks-grid.list{padding:16px 0 0}#page-home #bookmarks-grid.list .pagination-box{padding:16px}}#page-home #dialog-tags .custom-dialog-body{grid-template-columns:repeat(2,minmax(0,1fr))}@media (max-width:600px){#page-home #dialog-tags .custom-dialog-body{grid-template-columns:minmax(0,1fr)}}#page-home #dialog-tags .custom-dialog-body a{font-size:1em;color:var(--color)}#page-home #dialog-tags .custom-dialog-body a span:last-child{font-size:1em;color:var(--colorLink);margin-left:4px}#page-home #dialog-tags .custom-dialog-body a span:last-child::before{content:"(";margin-right:2px}#page-home #dialog-tags .custom-dialog-body a span:last-child::after{content:")";margin-left:2px}#page-home #dialog-tags .custom-dialog-body a:focus,#page-home #dialog-tags .custom-dialog-body a:hover{color:var(--main)}#page-setting{min-height:0;max-height:100%;display:flex;flex-flow:column nowrap}#page-setting .setting-container{padding:8px;display:flex;overflow:auto;flex-flow:column nowrap;flex:1 0}#page-setting .setting-container::after{content:"";display:block;min-height:1px}#page-setting .setting-container details.setting-group{margin:8px;display:block;max-width:350px;color:var(--color);background-color:var(--contentBg);border:1px solid var(--border)}@media (max-width:600px){#page-setting .setting-container details.setting-group{max-width:100%}}#page-setting .setting-container details.setting-group summary{list-style:none;font-weight:600;width:100%;padding:12px 8px;font-size:1.1em;cursor:pointer}#page-setting .setting-container details.setting-group summary:hover{color:var(--main)}#page-setting .setting-container details.setting-group summary::-webkit-details-marker{display:none}#page-setting .setting-container details.setting-group summary::after{content:"+";margin-left:8px;font-weight:600}#page-setting .setting-container details.setting-group[open] summary{border-bottom:1px solid var(--border)}#page-setting .setting-container details.setting-group[open] summary::after{content:"-"!important}#page-setting .setting-container details.setting-group ul{list-style:none}#page-setting .setting-container details.setting-group ul li{padding:4px 8px;color:var(--color);display:flex;flex-flow:row nowrap;align-items:center}#page-setting .setting-container details.setting-group div.setting-group-footer{padding:4px 8px;display:flex;flex-flow:column nowrap;align-items:flex-end;border-top:1px solid var(--border)}#page-setting .setting-container details.setting-group div.setting-group-footer>a{text-transform:uppercase;padding:8px 4px;font-size:.9em;font-weight:600}#page-setting .setting-container details.setting-group div.setting-group-footer>a:hover{color:var(--main)}#page-setting .setting-container details.setting-group div.setting-group-footer>a:focus{outline:0;color:var(--main);border-bottom:1px dashed var(--main)}#page-setting #setting-bookmarks,#page-setting #setting-display{display:flex;flex-flow:column nowrap}#page-setting #setting-bookmarks[open],#page-setting #setting-display[open]{padding-bottom:8px}#page-setting #setting-bookmarks[open] summary,#page-setting #setting-display[open] summary{margin-bottom:8px}#page-setting #setting-bookmarks label,#page-setting #setting-display label{padding:4px 8px;color:var(--color);display:flex;flex-flow:row nowrap;align-items:center;cursor:pointer}#page-setting #setting-bookmarks label:focus,#page-setting #setting-bookmarks label:hover,#page-setting #setting-display label:focus,#page-setting #setting-display label:hover{text-decoration:underline;text-decoration-color:var(--main)}#page-setting #setting-bookmarks label>input[type=checkbox],#page-setting #setting-display label>input[type=checkbox]{margin-right:8px}#page-setting .setting-accounts summary{margin-bottom:0}#page-setting .setting-accounts ul{list-style:none}#page-setting .setting-accounts ul li{padding:8px;display:flex;flex-flow:row nowrap;align-items:center}#page-setting .setting-accounts ul li:not(:last-child){border-bottom:1px solid var(--border)}#page-setting .setting-accounts ul li p{font-size:1em;color:var(--color);flex:1 0}#page-setting .setting-accounts ul li p span{color:var(--colorLink)}#page-setting .setting-accounts ul li a{margin-left:8px;color:var(--colorLink)}#page-setting .setting-accounts ul li a:hover{color:var(--main)}#page-setting #setting-system-info ul{padding-top:4px;padding-bottom:4px}#page-setting #setting-system-info ul li span{margin-left:8px}:root{--dialogHeaderBg:#292929;--colorDialogHeader:#fff}.custom-dialog-overlay{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;min-width:0;min-height:0;overflow:hidden;position:fixed;top:0;left:0;width:100%;width:100dvw;height:100%;height:100dvh;z-index:10001;background-color:rgba(0,0,0,.6);padding:32px}.custom-dialog-overlay .custom-dialog{display:flex;flex-flow:column nowrap;min-height:0;max-height:100%;max-width:100%;width:400px;overflow:auto;background-color:var(--contentBg);font-size:16px;resize:both}.custom-dialog-overlay .custom-dialog .custom-dialog-header{padding:16px;color:var(--colorDialogHeader);background-color:var(--dialogHeaderBg);font-weight:600;font-size:1em;text-transform:uppercase;border-bottom:1px solid var(--border)}.custom-dialog-overlay .custom-dialog .custom-dialog-body{padding:16px 16px 0;display:grid;max-height:100%;min-height:80px;min-width:0;overflow:auto;font-size:1em;grid-template-columns:max-content 1fr;align-content:start;align-items:baseline;grid-gap:16px;flex-grow:1}.custom-dialog-overlay .custom-dialog .custom-dialog-body::after{content:"";display:block;min-height:1px;grid-column-end:-1;grid-column-start:1}.custom-dialog-overlay .custom-dialog .custom-dialog-body .custom-dialog-content{grid-column-end:-1;grid-column-start:1;color:var(--color);align-self:baseline}.custom-dialog-overlay .custom-dialog .custom-dialog-body>label{color:var(--color);padding:8px 0;font-size:1em}.custom-dialog-overlay .custom-dialog .custom-dialog-body>input[type=password],.custom-dialog-overlay .custom-dialog .custom-dialog-body>input[type=text],.custom-dialog-overlay .custom-dialog .custom-dialog-body>textarea{color:var(--color);padding:8px;font-size:1em;border:1px solid var(--border);background-color:var(--contentBg);min-width:0}.custom-dialog-overlay .custom-dialog .custom-dialog-body .checkbox-field{color:var(--color);font-size:1em;display:flex;flex-flow:row nowrap;padding:0;grid-column-start:1;grid-column-end:-1;cursor:pointer}.custom-dialog-overlay .custom-dialog .custom-dialog-body .checkbox-field:focus,.custom-dialog-overlay .custom-dialog .custom-dialog-body .checkbox-field:hover{text-decoration:underline;text-decoration-color:var(--main)}.custom-dialog-overlay .custom-dialog .custom-dialog-body .checkbox-field>input[type=checkbox]{margin-right:8px}.custom-dialog-overlay .custom-dialog .custom-dialog-body>textarea{height:6em;min-height:37px;resize:vertical}.custom-dialog-overlay .custom-dialog .custom-dialog-body>.suggestion{position:absolute;display:block;padding:8px;background-color:var(--contentBg);border:1px solid var(--border);color:var(--color);font-size:.9em}.custom-dialog-overlay .custom-dialog .custom-dialog-footer{padding:16px;display:flex;flex-flow:row wrap;justify-content:flex-end;border-top:1px solid var(--border)}.custom-dialog-overlay .custom-dialog .custom-dialog-footer>a{padding:0 8px;font-size:.9em;font-weight:600;color:var(--color);text-transform:uppercase}.custom-dialog-overlay .custom-dialog .custom-dialog-footer>a:focus,.custom-dialog-overlay .custom-dialog .custom-dialog-footer>a:hover{outline:0;color:var(--main)}.custom-dialog-overlay .custom-dialog .custom-dialog-footer>i.fa-spinner.fa-spin{width:19px;line-height:19px;text-align:center;color:var(--color)}@media only screen and (max-width:768px){.custom-dialog-overlay{padding:0}.custom-dialog{width:100%!important;height:100%!important;resize:none!important}}.bookmark{display:flex;flex-flow:column nowrap;min-width:0;border:1px solid var(--border);background-color:var(--contentBg);height:100%;position:relative}.bookmark:focus .bookmark-menu>a,.bookmark:hover .bookmark-menu>a{display:block}.bookmark.selected{background-color:var(--selectedBg)}.bookmark .bookmark-selector{position:absolute;top:0;left:0;width:100%;height:100%;z-index:9}.bookmark .bookmark-link{display:block;cursor:default}.bookmark .bookmark-link[href]{cursor:pointer}.bookmark .bookmark-link[href]:focus .title,.bookmark .bookmark-link[href]:hover .title{color:var(--main)}.bookmark .bookmark-link span.thumbnail{width:100%;height:200px;display:block;background-size:cover;background-repeat:no-repeat;background-position:center center;margin-bottom:8px;border-bottom:1px solid var(--border)}.bookmark .bookmark-link .id{color:var(--color);border:1px solid var(--border);background-color:var(--contentBg);font-size:.7em;font-weight:700;left:-1px;top:-1px;position:absolute;padding:0 .3em;opacity:.7}.bookmark .bookmark-link .title{text-overflow:ellipsis;word-wrap:break-word;overflow:hidden;font-size:1.2em;line-height:1.3em;max-height:5.2em;font-weight:600;padding:0 16px;color:var(--color)}.bookmark .bookmark-link .title:first-child{margin-top:16px}.bookmark .bookmark-link .title i{color:var(--colorLink);margin-left:4px;font-size:14px}.bookmark .bookmark-link .excerpt{color:var(--color);margin-top:8px;padding:0 16px;text-overflow:ellipsis;word-wrap:break-word;overflow:hidden;font-size:.9em;line-height:1.5em;max-height:10.5em}.bookmark .bookmark-tags{display:flex;flex-flow:row wrap;margin:8px 0 -4px;padding:0 8px}.bookmark .bookmark-tags a{margin:4px;padding:4px 8px;font-size:.8em;font-weight:600;border:1px solid var(--border);border-radius:4px;color:var(--colorLink);background-color:var(--contentBg)}.bookmark .bookmark-tags a:focus,.bookmark .bookmark-tags a:hover{color:var(--main)}.bookmark .bookmark-menu{padding:8px 16px 16px;display:flex;flex-flow:row nowrap;min-width:0;min-height:0;align-items:center}.bookmark .bookmark-menu a{color:var(--colorLink);flex-shrink:0;opacity:.8;display:none;font-size:.9em}.bookmark .bookmark-menu a:not(:last-child){margin-right:12px}.bookmark .bookmark-menu a:focus,.bookmark .bookmark-menu a:hover{color:var(--main);opacity:1}.bookmark .bookmark-menu .url{flex:1 0;opacity:1;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:21px}.bookmark .bookmark-menu .url:not([href]){cursor:default;color:var(--colorLink)}@media (max-width:1024px){.bookmark .bookmark-menu a{display:block}}.bookmark.list{border-top-width:0;border-bottom-width:1px;padding:16px 24px 16px 100px}.bookmark.list:first-child{border-top-width:1px}.bookmark.list .bookmark-link span.thumbnail{position:absolute;top:0;left:0;width:100px;height:100%;margin-bottom:0;border-bottom:0;border-right:1px solid var(--border)}.bookmark.list .bookmark-link .title{margin:0;padding-left:24px}.bookmark.list .excerpt,.bookmark.list>.spacer{display:none}.bookmark.list .bookmark-tags{padding-left:16px;padding-right:0}.bookmark.list .bookmark-menu{padding:8px 0 0 24px;align-items:flex-end}.bookmark.list.no-thumbnail{padding-left:16px;padding-right:16px}.bookmark.list.no-thumbnail .bookmark-link .title{padding:0;margin-bottom:4px}.bookmark.list.no-thumbnail .excerpt{margin-top:0;margin-bottom:4px;padding:0;display:block}.bookmark.list.no-thumbnail .bookmark-tags{padding-left:0;margin:0 -4px 0}.bookmark.list.no-thumbnail .bookmark-menu{padding-top:0;padding-left:0}@media (max-width:600px){.bookmark.list{padding:8px 16px 8px 70px;border-width:0!important;border-bottom-width:1px!important}.bookmark.list .bookmark-link span.thumbnail{width:70px}.bookmark.list .bookmark-link .title{font-size:1.1em;font-weight:500;padding-left:16px}.bookmark.list .bookmark-tags{padding-left:8px}.bookmark.list .bookmark-menu{padding-left:16px}} \ No newline at end of file diff --git a/internal/view/assets/js/component/dialog.js b/internal/view/assets/js/component/dialog.js index 8d4fdf415..944e7f222 100644 --- a/internal/view/assets/js/component/dialog.js +++ b/internal/view/assets/js/component/dialog.js @@ -8,26 +8,29 @@ var template = `