From 02e5c1798be69f1e15fbc4f25a3ab7085c5d7dc6 Mon Sep 17 00:00:00 2001 From: Felipe Morato Date: Wed, 22 Feb 2023 17:08:02 +0200 Subject: [PATCH 01/11] Add pre-commit --- .github/config/.spellcheck.yml | 4 +- .github/config/.wordlist.txt | 1 + .pre-commit-config.yaml | 83 ++++++++++++++++++++++++++++++++++ README.md | 1 + pyproject.toml | 40 ++++++++++++++++ scripts/eslint.sh | 14 ++++++ 6 files changed, 141 insertions(+), 2 deletions(-) create mode 100644 .pre-commit-config.yaml create mode 100755 scripts/eslint.sh diff --git a/.github/config/.spellcheck.yml b/.github/config/.spellcheck.yml index 085e065cc..e595d3b8c 100644 --- a/.github/config/.spellcheck.yml +++ b/.github/config/.spellcheck.yml @@ -1,5 +1,5 @@ matrix: -- name: Markdown +- name: markdown aspell: lang: en ignore-case: true @@ -23,7 +23,7 @@ matrix: - 'docs/source/*.rst' - '**/*.md' default_encoding: utf-8 -- name: English Language spellcheck +- name: frontend aspell: lang: en ignore-case: true diff --git a/.github/config/.wordlist.txt b/.github/config/.wordlist.txt index 13eaa683b..f1492deab 100644 --- a/.github/config/.wordlist.txt +++ b/.github/config/.wordlist.txt @@ -21,6 +21,7 @@ cp cryptfiles csc cscfi +dev devel devenv Dockerfile diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..8908694fe --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,83 @@ +repos: + - repo: meta + hooks: + - id: check-hooks-apply + - id: check-useless-excludes + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: no-commit-to-branch + args: [--branch, devel, --branch, master] + - id: check-toml + - id: check-yaml + - id: check-ast + - id: check-docstring-first + - id: check-case-conflict + - id: check-merge-conflict + - id: end-of-file-fixer + - id: trailing-whitespace + + - repo: https://github.com/charliermarsh/ruff-pre-commit + rev: v0.0.252 + hooks: + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + files: ^swift_browser_ui/ + + - repo: https://github.com/psf/black + rev: 23.1.0 + hooks: + - id: black + args: [-l, "90"] + + - repo: https://github.com/PyCQA/bandit + rev: 1.7.4 + hooks: + - id: bandit + files: ^swift_browser_ui/ + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.0.1 + hooks: + - id: mypy + args: [--ignore-missing-imports, --no-namespace-packages, swift_browser_ui/] + pass_filenames: false + additional_dependencies: + - types-certifi + - types-requests + + - repo: local + hooks: + - id: eslit + name: Lint frontend + entry: ./scripts/eslint.sh + args: [--prefix, swift_browser_ui_frontend, run, lint] + files: ^swift_browser_ui_frontend + language: system + pass_filenames: false + + - id: sort + name: sort dictionaries + entry: ./scripts/sort.sh + language: script + files: ^.github/config/.*.txt + require_serial: true + pass_filenames: false + + - id: pyspelling-docs + name: spellcheck markdown and documentation + entry: ./scripts/pyspelling.sh + language: script + args: [markdown] + types_or: [markdown, rst] + require_serial: true + + - id: pyspelling-frontend + name: spellcheck frontend strings + entry: ./scripts/pyspelling.sh + language: script + args: [frontend] + types: [javascript] + files: swift_browser_ui_frontend/src/common/lang.js + require_serial: true diff --git a/README.md b/README.md index 6f068c05f..ca6db7f07 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,7 @@ Install python dependencies, optionally in a virtual environment. python3 -m venv venv --prompt swiftui # Optional step, creates python virtual environment source venv/bin/activate # activates virtual environment pip install -Ue .[docs,test,dev] +pre-commit install ``` Set up the environment variables diff --git a/pyproject.toml b/pyproject.toml index 6ff4b2f9b..304d0f377 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,7 @@ test = [ "pytest-cov==4.0.0", "pytest-xdist==3.1.0", "pytest==7.2.1", + "ruff==0.0.251", "tox==4.4.4", ] ui_test = [ @@ -56,6 +57,7 @@ ui_test = [ ] dev = [ "honcho==1.1.0", + "pre-commit==3.0.4", "pyspelling==2.8.2", ] @@ -70,3 +72,41 @@ Source = "https://github.com/CSCfi/swift-browser-ui" [tool.hatch.version] path = "swift_browser_ui/__init__.py" + +[tool.black] +line-length = 90 +target-version = ['py310'] + +[tool.isort] +atomic = true +profile = "black" +line_length = 90 +py_version=310 + +[tool.ruff] +line-length = 90 +target-version = "py310" + +# https://beta.ruff.rs/docs/rules/ +select = [ + "E", # pycodestyle errors + "W", # pycodestyle warnings + "F", # pyflakes + "I", # isort + # "ANN", # flake8-annotations + "C", # flake8-comprehensions + "B", # flake8-bugbear + "D", # pydocstyle +# "UP", # pyupgrade + "S", # Bandit +] + +ignore = [ + "ANN101", # Missing type annotation for `self` in method + "E501", # line too long, handled by black + "B904", # do not perform function calls in argument defaults + "PLR2004", # magic value used in comparison + "S113", # Probable use of requests call without timeout + "D203", # one-blank-line-before-class + "D213", # multi-line-summary-second-line +] diff --git a/scripts/eslint.sh b/scripts/eslint.sh new file mode 100755 index 000000000..ed3700cf0 --- /dev/null +++ b/scripts/eslint.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# eslint for pre-commit. Skips run if `pnpm` or eslint are not installed + +if ! command -v pnpm > /dev/null 2>&1; then + echo "pnpm not installed, not running eslint as pre-commit hook" + exit 0 +fi + +if ! test -f swift_browser_ui_frontend/node_modules/.bin/eslint; then + echo "eslint is not installed, not running eslint as pre-commit hook" + exit 0 +fi + +pnpm --prefix swift_browser_ui_frontend run lint From 061f359d6eb66f8928bba256ea6d7ff701d69d35 Mon Sep 17 00:00:00 2001 From: Felipe Morato Date: Thu, 23 Feb 2023 16:01:14 +0200 Subject: [PATCH 02/11] pre-commit: fix end of file --- .github/config/.spellcheck.yml | 2 +- .github/workflows/eslint.yml | 1 - docs/_static/api.yml | 81 +++++++++---------- docs/source/tech.rst | 1 - .../src/common/globalFunctions.js | 3 - .../src/common/upload.js | 10 +-- .../src/components/BrowserMainNavbar.vue | 2 +- .../src/components/SearchBox.vue | 2 +- .../src/components/SharedOutTable.vue | 1 - tests/cypress/integration/browser.cy.js | 2 - tests/cypress/integration/userInfo.cy.js | 2 +- tests/cypress/support/commands.js | 2 +- 12 files changed, 50 insertions(+), 59 deletions(-) diff --git a/.github/config/.spellcheck.yml b/.github/config/.spellcheck.yml index e595d3b8c..f09f296d6 100644 --- a/.github/config/.spellcheck.yml +++ b/.github/config/.spellcheck.yml @@ -39,4 +39,4 @@ matrix: strings: true decode_escapes: false sources: - - swift_browser_ui_frontend/src/common/lang.js \ No newline at end of file + - swift_browser_ui_frontend/src/common/lang.js diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 11cb9f84e..5b4913a3b 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -29,4 +29,3 @@ jobs: run: | pushd swift_browser_ui_frontend pnpm run lint - \ No newline at end of file diff --git a/docs/_static/api.yml b/docs/_static/api.yml index d95e08f32..107be6162 100644 --- a/docs/_static/api.yml +++ b/docs/_static/api.yml @@ -6,15 +6,15 @@ info: license: name: MIT tags: - - name: Frontend + - name: Frontend description: Endpoints for sharing request "Filtered proxied API from Openstack Swift used for a browser application" - - name: Sharing Request + - name: Sharing Request description: Endpoints for sharing request "Database and API for storing / querying Openstack Swift ACL share action request information." - - name: Sharing Account + - name: Sharing Account description: Endpoints for sharing request "Database and API for storing / querying Openstack Swift ACL information" - - name: Upload/Download + - name: Upload/Download description: Endpoints for uploading and downloading containers/objects - + paths: /health: get: @@ -33,7 +33,7 @@ paths: /request/user/{user}/{container}: post: tags: - - Sharing Request + - Sharing Request summary: Publish a new request for access to a container parameters: - name: user @@ -65,7 +65,7 @@ paths: $ref: "#/components/schemas/NewRequest" delete: tags: - - Sharing Request + - Sharing Request summary: Delete an existing request for access parameters: - name: user @@ -98,7 +98,7 @@ paths: example: OK options: tags: - - Sharing Request + - Sharing Request summary: Handle preflight for existing request for access parameters: - name: user @@ -136,7 +136,7 @@ paths: /request/user/{user}: get: tags: - - Sharing Request + - Sharing Request summary: List container share requests made by a user. parameters: - name: user @@ -156,7 +156,7 @@ paths: /request/owner/{user}: get: tags: - - Sharing Request + - Sharing Request summary: List the requests owned by the user (made for the user). parameters: - name: user @@ -176,7 +176,7 @@ paths: /request/container/{container}: get: tags: - - Sharing Request + - Sharing Request summary: List share requests made for a container. parameters: - name: container @@ -193,11 +193,11 @@ paths: application/json: schema: $ref: "#/components/schemas/ContainerRequests" - + /access/{user}: get: tags: - - Sharing Account + - Sharing Account summary: List container names that have been shared to the user. parameters: - name: user @@ -219,7 +219,7 @@ paths: /access/{user}/{container}: get: tags: - - Sharing Account + - Sharing Account summary: Get details of a container that has been shared to the user. parameters: - name: container @@ -255,7 +255,7 @@ paths: /share/{owner}: get: tags: - - Sharing Account + - Sharing Account summary: List container names that the user has shared to someone else. parameters: - name: owner @@ -277,7 +277,7 @@ paths: /share/{owner}/{container}: get: tags: - - Sharing Account + - Sharing Account summary: Get details of a container that the user has shared. parameters: - name: container @@ -305,7 +305,7 @@ paths: description: Client Error post: tags: - - Sharing Account + - Sharing Account summary: Give user / users access rights on a specified container. parameters: - name: container @@ -354,7 +354,7 @@ paths: description: Client Error patch: tags: - - Sharing Account + - Sharing Account summary: Edit specified user's access rights on a specified container. parameters: - name: container @@ -396,7 +396,7 @@ paths: description: Client Error delete: tags: - - Sharing Account + - Sharing Account summary: Revoke specified access to container from the user/users specified in the query. parameters: - name: container @@ -429,7 +429,7 @@ paths: description: Client Error options: tags: - - Sharing Account + - Sharing Account summary: Serve correct response headers to allowed DELETE preflight query. parameters: - name: container @@ -465,7 +465,7 @@ paths: schema: type: string example: 84600 - + /token/{project}/{id}: post: tags: @@ -572,7 +572,7 @@ paths: /api/username: get: tags: - - Frontend + - Frontend summary: Get Openstack username for the authenticated user. responses: 200: @@ -586,7 +586,7 @@ paths: /api/projects: get: tags: - - Frontend + - Frontend summary: Get Openstack projects available for the authenticated user. responses: 200: @@ -600,7 +600,7 @@ paths: /api/{project}/acl: get: tags: - - Frontend + - Frontend summary: Fetch a compilation of ACL information for sharing discovery. parameters: - name: project @@ -622,7 +622,7 @@ paths: /api/{project}/address: get: tags: - - Frontend + - Frontend summary: Get the project specific object storage address. parameters: - name: project @@ -645,7 +645,7 @@ paths: /api/meta/{project}: get: tags: - - Frontend + - Frontend summary: Get the filtered project metadata for the currently active project. parameters: - name: project @@ -669,7 +669,7 @@ paths: /api/{project}: get: tags: - - Frontend + - Frontend summary: Get the listing for containers for specified project parameters: - name: project @@ -702,7 +702,7 @@ paths: /api/{project}/{container}: get: tags: - - Frontend + - Frontend summary: Get the listing for objects in a given container. parameters: - name: project @@ -815,7 +815,7 @@ paths: /api/meta/{project}/{container}: get: tags: - - Frontend + - Frontend summary: Get container metadata. parameters: - name: project @@ -902,7 +902,7 @@ paths: /api/{project}/{container}/{object}: get: tags: - - Frontend + - Frontend summary: Download the object specified in the download link. parameters: - name: project @@ -1153,7 +1153,7 @@ paths: schema: type: string format: binary - + /{project}/{container}: post: tags: @@ -1289,7 +1289,7 @@ components: type: array items: $ref: "#/components/schemas/ListedRequest" - + ListedContainer: type: object properties: @@ -1344,7 +1344,7 @@ components: type: array items: $ref: "#/components/schemas/DetailedContainer" - + Username: type: string example: test_user_name @@ -1386,24 +1386,24 @@ components: type: integer example: 4294967296 description: The total amount of storage usage in bytes for the currently active project. - + ProjectAcl: type: object properties: - address: + address: type: string example: host access: type: object example: - containerName1: - ownerID1: + containerName1: + ownerID1: read: "*" write: "*" containerName2: - ownerID2: + ownerID2: read: "*" - + Container: type: object properties: @@ -1483,7 +1483,7 @@ components: type: array items: $ref: '#/components/schemas/MetaItem' - + Health: type: object required: @@ -1523,4 +1523,3 @@ components: items: type: string example: database - diff --git a/docs/source/tech.rst b/docs/source/tech.rst index 0104b0886..3958d5011 100644 --- a/docs/source/tech.rst +++ b/docs/source/tech.rst @@ -56,4 +56,3 @@ the API during normal usage. The api is documented in the api.yml file, that conforms to the OpenAPI specification (the file can be rendered with the `swagger editor `_): - diff --git a/swift_browser_ui_frontend/src/common/globalFunctions.js b/swift_browser_ui_frontend/src/common/globalFunctions.js index b4788ecc1..b33ecfb31 100644 --- a/swift_browser_ui_frontend/src/common/globalFunctions.js +++ b/swift_browser_ui_frontend/src/common/globalFunctions.js @@ -67,6 +67,3 @@ export async function getAccessDetails ( sourceProjectId) : []; } - - - diff --git a/swift_browser_ui_frontend/src/common/upload.js b/swift_browser_ui_frontend/src/common/upload.js index ca3e3a1c4..06a305320 100644 --- a/swift_browser_ui_frontend/src/common/upload.js +++ b/swift_browser_ui_frontend/src/common/upload.js @@ -83,7 +83,7 @@ export default class EncryptedUploadSession { this.pkey = pkey; this.passphrase = passphrase; this.signal = store.state.uploadAbort.signal; - + this.totalFiles = this.files.length; this.finished = false; this.currentFile = ""; @@ -208,7 +208,7 @@ export default class EncryptedUploadSession { "updateEncryptedProgress", (this.totalFiles - this.files.length) / this.totalFiles, ); - + // Cache the succeeded file metadata to IndexedDB this.$store.state.db.containers.get({ projectID: this.project, @@ -220,7 +220,7 @@ export default class EncryptedUploadSession { signal: undefined, }); }).catch(() => {}); - + if (this.files.length > 0) { this.currentFile = undefined; this.initFileSystem(); @@ -275,7 +275,7 @@ export default class EncryptedUploadSession { }); }); } - + // Initialize filesystem for encrypting a file initFileSystem() { this.currentFile = this.files.pop(); @@ -323,4 +323,4 @@ export default class EncryptedUploadSession { this.handleMessage, {signal: this.signal}, ); } -} \ No newline at end of file +} diff --git a/swift_browser_ui_frontend/src/components/BrowserMainNavbar.vue b/swift_browser_ui_frontend/src/components/BrowserMainNavbar.vue index f6fec5e37..ccd4bfbe2 100644 --- a/swift_browser_ui_frontend/src/components/BrowserMainNavbar.vue +++ b/swift_browser_ui_frontend/src/components/BrowserMainNavbar.vue @@ -268,4 +268,4 @@ export default { } } - \ No newline at end of file + diff --git a/swift_browser_ui_frontend/src/components/SearchBox.vue b/swift_browser_ui_frontend/src/components/SearchBox.vue index e8387fe09..aa7ba7253 100644 --- a/swift_browser_ui_frontend/src/components/SearchBox.vue +++ b/swift_browser_ui_frontend/src/components/SearchBox.vue @@ -219,4 +219,4 @@ export default { .empty-search { height: 2rem; } - \ No newline at end of file + diff --git a/swift_browser_ui_frontend/src/components/SharedOutTable.vue b/swift_browser_ui_frontend/src/components/SharedOutTable.vue index 00f704552..14db822a3 100644 --- a/swift_browser_ui_frontend/src/components/SharedOutTable.vue +++ b/swift_browser_ui_frontend/src/components/SharedOutTable.vue @@ -10,4 +10,3 @@ export default { components: { Containers }, }; - diff --git a/tests/cypress/integration/browser.cy.js b/tests/cypress/integration/browser.cy.js index f3641c60f..137440bc9 100644 --- a/tests/cypress/integration/browser.cy.js +++ b/tests/cypress/integration/browser.cy.js @@ -185,5 +185,3 @@ describe("Browse containers and test operations", function () { }); }); }) - - diff --git a/tests/cypress/integration/userInfo.cy.js b/tests/cypress/integration/userInfo.cy.js index 089544202..fcba3a2b9 100644 --- a/tests/cypress/integration/userInfo.cy.js +++ b/tests/cypress/integration/userInfo.cy.js @@ -84,4 +84,4 @@ describe("Display mobile navigation on small resolution", function () { .find("label") .contains("Valitse projekti"); }) -}); \ No newline at end of file +}); diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 75ad6ed6f..6787c5732 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -73,4 +73,4 @@ Cypress.Commands.add("navigateTableRowMenu", (index, menuItem) => { cy.get("c-menu").click() cy.get("c-menu").find("li").contains(menuItem).click() }) -}) \ No newline at end of file +}) From 8f0ca64272389df0e19d45e3e1328262c46f8275 Mon Sep 17 00:00:00 2001 From: Felipe Morato Date: Thu, 23 Feb 2023 16:01:42 +0200 Subject: [PATCH 03/11] pre-commit: fix trailing spaces --- .github/ISSUE_TEMPLATE/user_story.md | 8 ++++---- .github/workflows/docs.yml | 2 +- .github/workflows/publish.yml | 4 ++-- .github/workflows/spellcheck.yml | 2 +- .github/workflows/style.yml | 2 +- .github/workflows/unit.yml | 2 +- README.md | 6 +++--- devproxy/nginx.conf | 2 +- docs/source/_static/style.css | 3 +-- docs/source/deploy.rst | 4 ++-- docs/source/instructions.rst | 4 ++-- docs/source/testing.rst | 2 +- swift_browser_ui_frontend/src/common/db.js | 2 +- swift_browser_ui_frontend/src/common/lang.js | 2 +- .../src/common/swift_sharing_request_bind.js | 2 +- .../src/components/BrowserSecondaryNavbar.vue | 2 +- .../src/components/CFooter.vue | 20 +++++++++---------- .../src/components/CObjectTable.vue | 2 +- .../src/components/ContainerTable.vue | 8 ++++---- .../src/components/CopyFolderModal.vue | 2 +- .../src/components/RequestSharing.vue | 2 +- .../src/components/SearchResultItem.vue | 6 +++--- .../src/components/ShareModal.vue | 2 +- .../src/components/ShareRequestsTable.vue | 2 +- .../src/components/UploadNotification.vue | 4 ++-- swift_browser_ui_frontend/src/css/dark.scss | 2 +- swift_browser_ui_frontend/src/css/light.scss | 2 +- .../src/entries/badrequest.js | 2 +- .../src/entries/forbid.js | 2 +- .../src/entries/login.js | 4 ++-- .../src/entries/notfound.js | 2 +- .../src/entries/uidown.js | 2 +- .../src/entries/unauth.js | 4 ++-- .../src/pages/IndexPage.vue | 6 +++--- .../src/views/Dashboard.vue | 2 +- .../src/views/DirectRequest.vue | 2 +- .../src/views/DirectShare.vue | 2 +- .../src/views/ShareRequests.vue | 2 +- .../src/views/SharedFrom.vue | 2 +- .../src/views/Tokens.vue | 2 +- .../wasm/src/streamingupload.c | 2 +- swift_browser_ui_frontend/wasm/src/upinit.c | 2 +- 42 files changed, 69 insertions(+), 70 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/user_story.md b/.github/ISSUE_TEMPLATE/user_story.md index 793b33e59..50c14e0aa 100644 --- a/.github/ISSUE_TEMPLATE/user_story.md +++ b/.github/ISSUE_TEMPLATE/user_story.md @@ -9,14 +9,14 @@ assignees: '' #### Describe the user story -List of tasks needed for this user story. Technical description is in the tasks. Additional information, for example a prototype, Figma files, pictures are linked here. +List of tasks needed for this user story. Technical description is in the tasks. Additional information, for example a prototype, Figma files, pictures are linked here. #### Tasks: -- [ ] +- [ ] -#### Testing -Description how the testing will be done. +#### Testing +Description how the testing will be done. #Definition of Done diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ca8e2738c..54eb4ed57 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -9,7 +9,7 @@ jobs: matrix: os: [ubuntu-latest] python-version: ['3.10'] - + runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 62fe39ec8..7f95eab73 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - + - name: Login to DockerHub if: github.event_name != 'pull_request' uses: docker/login-action@v2 @@ -35,7 +35,7 @@ jobs: type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} type=raw,value=stage,enable=${{ github.ref == format('refs/heads/{0}', 'devel') }} type=ref,event=tag - + - name: Build and push uses: docker/build-push-action@v4 with: diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index 1a726a8ec..fd40473df 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -8,7 +8,7 @@ jobs: max-parallel: 4 matrix: os: [ubuntu-latest] - + runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 9e83d5f91..b55f4ae59 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -9,7 +9,7 @@ jobs: matrix: os: [ubuntu-latest] python-version: ['3.10'] - + runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 6e5a94562..87145ffb8 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -10,7 +10,7 @@ jobs: os: [ubuntu-latest] python-version: ['3.10'] node: ['18'] - + runs-on: ${{ matrix.os }} steps: diff --git a/README.md b/README.md index ca6db7f07..867ca02cb 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ The current frontend can be found at: `127.0.0.1:8080`. ### Development swift-browser-ui is composed of 4 components: `request`, `sharing`, `ui`, and `upload`. All of them must be run to have access to all features. -They depend on a Redis instance for session cache, Postgres database for the sharing and +They depend on a Redis instance for session cache, Postgres database for the sharing and request functionality, and the object storage backend. You will also need docker with Buildkit to build the keystone-swift docker image. @@ -155,7 +155,7 @@ This guide assumes you're using `devenv` as the domain name. Replace this with the domain you're certificate sings, and if necessary, add it to `/etc/hosts` so it's resolvable both in docker, and locally. -Additional setup is required in your environment file. You'll need to +Additional setup is required in your environment file. You'll need to configure the following keys to point to whatever hostname will be used to access the service. Additionally you should allow all hosts, assuming your machine is in a secure network when developing. In case you trust @@ -294,7 +294,7 @@ After following the development steps above, `cypress` should already be install cd swift_browser_ui_frontend You can run the tests in headless mode - + npx cypress run Or you can use the interactive version diff --git a/devproxy/nginx.conf b/devproxy/nginx.conf index df94383bb..18644974d 100644 --- a/devproxy/nginx.conf +++ b/devproxy/nginx.conf @@ -23,7 +23,7 @@ http { } client_max_body_size 0; - + server { listen 9443 ssl; ssl_certificate /etc/ssl/swiftui-proxy.crt; diff --git a/docs/source/_static/style.css b/docs/source/_static/style.css index 674649fc8..aba37f9bd 100644 --- a/docs/source/_static/style.css +++ b/docs/source/_static/style.css @@ -8,9 +8,8 @@ this as on RTD they are loaded after this stylesheet */ white-space: normal !important; } - + .wy-table-responsive { overflow: visible !important; } } - diff --git a/docs/source/deploy.rst b/docs/source/deploy.rst index 77718c6c3..84d28fb2b 100644 --- a/docs/source/deploy.rst +++ b/docs/source/deploy.rst @@ -35,7 +35,7 @@ for the database) Sharing functionality back-end ------------------------------ Sharing functionality should be run by running it in a container. Easiest -way to do this is to use the docker-compose fields provided in the +way to do this is to use the docker-compose fields provided in the `deployment example repository. `_ The sharing functionality requires the following environment variables to be present in order to work: @@ -87,7 +87,7 @@ to be present in order to work: Upload runner back-end ---------------------- SwiftUI upload runner should be run by running it in a container. Easiest way -to do this is to use the docker-compose files provided in the +to do this is to use the docker-compose files provided in the `deployment example repository. `_ The upload runner requires the following environment variables to be present in order to work: diff --git a/docs/source/instructions.rst b/docs/source/instructions.rst index e5c8885ea..9d3aede8c 100644 --- a/docs/source/instructions.rst +++ b/docs/source/instructions.rst @@ -19,7 +19,7 @@ The program can be installed with pip from the git repository: can be found from the git repositories. The instructions for getting the services up and running can be found in their respective repositories, and partly under the *Deployment* section. - + * https://github.com/cscfi/swift-x-account-sharing * https://github.com/cscfi/swift-sharing-request * https://github.com/cscfi/swiftui-upload-runner @@ -82,7 +82,7 @@ For the Pouta test environment with NGINX TLS termination proxy in use:: For the Pouta production environment for testing unsecurely without trust:: export BROWSER_START_AUTH_ENDPOINT_URL="https://pouta.csc.fi:5001/v3" - + Setting up TLS termination proxy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/source/testing.rst b/docs/source/testing.rst index 7bc7e14e9..f52d630e4 100644 --- a/docs/source/testing.rst +++ b/docs/source/testing.rst @@ -39,7 +39,7 @@ and the tests are developed for both Firefox and Chrome web browsers. $ cd swift_browser_ui_frontend/ $ npm install -g pnpm@7 - $ pnpm install + $ pnpm install $ pnpm run build $ cd .. $ pnpm install cypress diff --git a/swift_browser_ui_frontend/src/common/db.js b/swift_browser_ui_frontend/src/common/db.js index fee7a8262..b5dc75fe8 100644 --- a/swift_browser_ui_frontend/src/common/db.js +++ b/swift_browser_ui_frontend/src/common/db.js @@ -13,6 +13,6 @@ export function initDB() { db.preferences.add({id: 1}); } }); - + return db; } diff --git a/swift_browser_ui_frontend/src/common/lang.js b/swift_browser_ui_frontend/src/common/lang.js index b4df09e81..90fdda633 100644 --- a/swift_browser_ui_frontend/src/common/lang.js +++ b/swift_browser_ui_frontend/src/common/lang.js @@ -322,7 +322,7 @@ let default_translations = { "Created folder will be shared with all project members in ", viewProjectMembers: "View project members", deleteConfirm: "Delete Bucket", - deleteNote: "Deleting a container requires "+ + deleteNote: "Deleting a container requires "+ "deleting all objects first.", deleteConfirmMessage: "Are you sure you want to delete this " + "bucket?", diff --git a/swift_browser_ui_frontend/src/common/swift_sharing_request_bind.js b/swift_browser_ui_frontend/src/common/swift_sharing_request_bind.js index 20cb0e05c..98fa280d2 100644 --- a/swift_browser_ui_frontend/src/common/swift_sharing_request_bind.js +++ b/swift_browser_ui_frontend/src/common/swift_sharing_request_bind.js @@ -1,7 +1,7 @@ // Swift cross account container sharing API JavaScript bindings module. -import { +import { GET, } from "@/common/api"; diff --git a/swift_browser_ui_frontend/src/components/BrowserSecondaryNavbar.vue b/swift_browser_ui_frontend/src/components/BrowserSecondaryNavbar.vue index 1bdbeb7dc..3648a8fc3 100644 --- a/swift_browser_ui_frontend/src/components/BrowserSecondaryNavbar.vue +++ b/swift_browser_ui_frontend/src/components/BrowserSecondaryNavbar.vue @@ -48,7 +48,7 @@ - diff --git a/swift_browser_ui_frontend/src/components/CFooter.vue b/swift_browser_ui_frontend/src/components/CFooter.vue index 92c556dd9..27dde1011 100644 --- a/swift_browser_ui_frontend/src/components/CFooter.vue +++ b/swift_browser_ui_frontend/src/components/CFooter.vue @@ -19,8 +19,8 @@ {{ $t("message.footerMenu.serviceProvider") }} - - + - +