Commit Graph

80 Commits

Author SHA1 Message Date
Vitalii
37d7c0efbf web/satellite: migrate VChart component to use SFC composition API
Upgraded chart.js dependency to V4.
Removed vue-chart and types/chart.js dependencies.
Refactored VChart component to rely only on chart.js dep without any additional wrappers.
Refactored VChart component to use SFC composition API.

Change-Id: Ic5e0131bff413f3205d4449db930644d113fe36d
2023-03-15 14:31:52 +00:00
Vitalii
52f142e3fc web/satellite: resolve some build warnings
Resolved some of the build warnings which are code-related.

Change-Id: I05f7981eacbaa61280ac111046fcc78025560a34
2023-03-07 17:13:42 +02:00
Vitalii
f834622a01 web: remove sanitizing dependency and restrict v-html
We decided to remove sanitizing dependency and restrict v-html with 2 exceptions for web/satellite (we control the content in those cases)

Issue:
https://github.com/storj/storj-private/issues/148

Change-Id: Ic6b2e894d20e7f0553f759ede51845a10831e890
2023-03-06 19:58:27 +00:00
Vitalii
17db59e27a web/satellite: update apollo-client dependency to remove CSP error
This is insane but the problem was caused by the old apollo-client dependency which is 3 years old.
The error was coming from ts-invariant code here
https://github.com/apollographql/invariant-packages/blob/master/packages/ts-invariant/src/invariant.ts#L64

By this change I updated our app to use new @apollo/client dependency but there is one pretty big concern.
This lib has react as a peer dependency (what?!) so to avoid adding react to our vue project I had to import needed functionality from @apollo/client/core instead of just @apollo/client.

There is a discussion here https://github.com/apollographql/apollo-client/issues/7318
According to this ^ apollo team are going to remove react from their peer dependecies list when apollo V4 will be launched.
See https://github.com/apollographql/apollo-client/issues/8190

That's another point why we should move away from using graphql entirely or at least stop using apollo.

Issue:
https://github.com/storj/storj/issues/5371

Change-Id: Ifd484efbcd9e99d8c2e21d0dab93670c9358e25c
2022-12-13 16:04:50 +00:00
NickolaiYurchenko
3c8f68fed9 web/satellite: pinia package added
added to replace vuex in future
buckets, projects and users modules pinia analogues created
have no pretty and straight-forward ways to work with option api + ts files so it is better to use with composition api components

Change-Id: Ia8acc491c0e76e01bf6d533747d186257680e5c9
2022-11-08 11:22:58 +00:00
Vitalii
8422c395d6 web/satellite: don't download the whole object for preview
Basically, I reverted this change with some modifications.
https://review.dev.storj.io/c/storj/storj/+/6731
We don't use signed requests anymore because its usage was not really affective and caused some UX problems like too long video loading/buffering.
We don't use presigned URLs as well because they are not really compatible (I think) with video streaming. So long videos (> 1 min long) constantly failed to buffer.
Instead of presigned URLs we just use STORJ linksharing. We generate new access grant which is valid for one day to render preview and object map.

Issue:
https://github.com/storj/storj/issues/5025

Change-Id: I0313f2c6b78811f1058c25fdf5b94dc5d563c15d
2022-09-20 17:32:54 +00:00
Vitalii
c5bca894fd web/satellite: fix linter
Added imports linting, trailing commas, trailing semicolons, single quotes and spaces between curly braces.

Change-Id: I5de5d3eea48753dfe2737983b230bafaffe898c8
2022-09-09 11:02:04 +00:00
Moby von Briesen
0ab0cef06c web/satellite: Upgrade to Vue 2.7
2.7 natively supports the Composition API, which makes transitioning to
Vue 3 easier to do step-by-step.

Converted ::v-deep selectors to :deep() to fix new build warnings.

Change-Id: I21b34e10f55eaf9dcdad87729f02f3b0d723b6b1
2022-09-01 10:41:59 -04:00
Lizzy Thomson
b7e9d04af7 web/satellite: common table component applied to file browser
Fixes https://github.com/storj/storj/issues/4991

Change-Id: I7731c0425e16aa6ef75d06be83fc74aaafd1f2ab
2022-08-10 10:17:24 -06:00
Márton Elek
bed2af3e87 web: use fixed version from eslint-storj
eslint-plugin-storj is uploaded to the main npm registry.

While we have no clear proof that it causes the random freeze of npm install, it can be fater anyway as fixed version can be cached safely.

Change-Id: Ie74d93c7c4863e46121a9ab6c4e6b787fa3899b3
2022-08-03 12:32:01 +00:00
NickolaiYurchenko
ba009b846f web/satellite: register page made configurable
we want sign up page to be more configurable since we have to add partner branding to it.
added ability to add logo, different title and decpription and even html after common markup.
v-html rule disabled and sanitize plusin added to avoid xss injections.
tsconfig changed to be able to load modules from json files.

Change-Id: I9ff2cf6e5cf977b8c41ca48953b491bd361f26a1
2022-07-20 18:57:47 +03:00
Vitalii
b3f909051a web/satellite: fix for dev build
Fixed dev build to do only one build at a time.
Basically, it will do only one legacy type of build and ignore modern build.

Issue:
https://github.com/storj/storj/issues/4908

Change-Id: Ia90deac1f8bf4f609ec776a3580ab0dc8f22a84e
2022-07-19 19:03:04 +03:00
Moby von Briesen
763bfc0913 satellite/console,web/satellite: Implement hCaptcha
Adds a new configuration for hcaptcha enabled, secretkey, and sitekey.
If both reCAPTCHA and hCaptcha are configured as "enabled", reCAPTCHA
will be used.

Change-Id: I73cc6e133d8da3555e0ed8b2b377cf9eb263e6dc
2022-05-13 14:57:45 +00:00
Moby von Briesen
7d35f3e977 Revert "web/satellite: use aws-sdk v3"
This reverts commit 2e3e5547e2.

The S3 client is returning an error related to region with the new
changes.

Change-Id: I989b8a46c0e97c1278517e1de07fe42d5950cf54
2022-05-13 09:31:12 +00:00
Egon Elbre
2e3e5547e2 web/satellite: use aws-sdk v3
While there isn't a significant win neither the prod javascript size nor
the number of dependencies, it does reduce the number of deprecated
packages.

Change-Id: Ib8edeb6916844500d74ae067464be9f28f542605
2022-05-12 09:17:26 +03:00
Egon Elbre
98e12f5671 web/satellite: bump aws-sdk
Change-Id: I9d964998f4a4157a87ea9314cb8b7e13cd74dc38
2022-05-05 18:35:36 +00:00
Egon Elbre
0ba454da55 web/: bump eslint dependencies
Change-Id: Icf7a48f732c73b4b954de05e0bb9955ad4d9a609
2022-05-05 18:35:31 +00:00
Egon Elbre
ff64e9ffb3 web/{multinode,storagenode,satellite}: update stylelint
Also reset package-lock.json files to workaround issue
of npm auto-updating storj eslint plugin dependency to ssh.

Change-Id: Iaba102d713dc596d5814bdc4cc54c9b911398d64
2022-05-05 15:47:44 +03:00
Egon Elbre
8620532a05 web/satellite: bump dependencies
This contains also multiple fixes to make it work.
The following is a non-exhaustive list.

When @Prop default value is a callback, then it is called
instead of set verbatim. This means, when you want a default
value to be a callback, then it needs to be `default: () => () => X`.

jest does not yet properly support WebWorkers, hence the code introduces
an indirection to provide the worker URL.

This in turn required removing the global "store" dependency from
the tests. As a consequence the new NotificatorPlugin takes store
as a dependency. And many of the tests are adjusted to not import
store directly.

Moved StoreModule definition to avoid initializing the global store.

Some of the router code was moved into store. We can later figure out
how to structure it better and move it back.

bip39 needs explicit fallbacks for some of the dependencies.

Fixes to timer mocking. jest supports it natively.

Remove sinon dependency. jest provides all the functionality we need.

Change-Id: I7af3599390c63ce9f99dbd0b1e0870e9f8ca994d
2022-05-04 15:02:01 +00:00
Monty Anderson
2c83503712 web/satellite: type + lint files store
This change makes the files store fully type-safe. It builds with `npm run build` and lints with `npm run lint`, displaying no errors or warnings.

There was an issue where I was unable to use the newer web APIs for filesystem operations, I think TypesScript (and Vue?) may need to be updated - I already tried updating `@types/web`. To mitigate this, I added slim type definitions for only the parts we use. The definitions are exactly as they appear on MDN and even include links to the relevant documentation. In future they can be removed with no compatibility issues.

Change-Id: I7b8b4a5f95caabdb546157c65e9f2f42c5132a6f
2022-03-29 12:23:16 +00:00
Vitalii Shpital
b3e1be37ff satellite/projectaccounting: query to get daily project usage by date range
Finished implementing queries for both bandwidth and storage using pgx.Batch.
Fixed CSP styling issue.

Change-Id: I5f9e10abe8096be3115b4e1f6ed3b13f1e7232df
2022-02-04 22:32:37 +00:00
Vitalii Shpital
3c8e41e665 web/satellite: get object map and preview by signed request.
There is a sev-2 issue to add more browser caching.
In this PR I made object map and object preview to be fetched by signed request with non-public credentials using AWS SignatureV4 package.

Change-Id: Ib5013fa6d6af3faa97eed5168c11a13f9629cd87
2022-02-03 11:31:09 +00:00
Egon Elbre
04d04c0306 web/satellite: remove old object browser
Change-Id: Ief16a3887444df093c644831d86a9b3e865e5867
2022-01-05 16:29:19 +02:00
Vitalii Shpital
be10ce84f8 web/satellite: implemented charts UI for new project dashboard
Added bandwidth/storage charts (with test data) to new project dashboard.
Added functional buttons to new project dashboard.
Fixed this issue https://github.com/storj/storj/issues/4262.

Change-Id: Ie87370b8f7b6015bc84022a6086ef1db40e16535
2021-12-01 15:55:20 +00:00
Egon Elbre
fe3856ff91 web/satellite: remove ramda dependency
The package was barely used and the amount of code needed to remove it
is minor.

Also remove top-level package-lock, because it's not being used.

Change-Id: Ifb4ec4fe7f4fa36ce6e707a33d47f04c583cbe6c
2021-11-09 13:19:58 +00:00
Monty Anderson
ea8782fcfa web/satellite: move browser from storj/browser
Change-Id: I1ee976ca117307dd1464dd78295b17c790fe8483
2021-11-01 16:48:06 +02:00
Egon Elbre
bc6d8c06e3 web: optimize builds
Stylelint and eslint should be run separately and not part of the build
process.

Add a flag STORJ_DEBUG_BUNDLE_SIZE to debug compiled bundle size.

Reduce the number of chunks, it's far from ideal. Once we reduce the
images and browser size, we probably can drop chunking altogether.

Change-Id: I5bdf35ceb140e2c47a30df8d319606d05bfb30dd
2021-10-12 11:29:37 +00:00
Egon Elbre
9fd091831d ci: optimize benchmarks
We are not using the benchmark results for anything, they are mostly
there to ensure that we don't break the benchmarks. So we can disable
CockroachDB for them.

Similarly add short versions of other tests.

Also try to precompile test/benchmark code.

Change-Id: I60b501789f70c289af68c37a052778dc75ae2b69
2021-10-08 19:42:40 +03:00
Egon Elbre
bb55c30594 web: move eslint-storj to separate repo
For some reason our build process cannot handle relative path packages,
it's easier to create a new repository than to figure out,
why npm/docker etc. don't like it.

Change-Id: I94b7cb9611f453246b596f97114fe5c54d9a4008
2021-10-05 12:08:44 +00:00
Egon Elbre
e5977ec849 web/: add custom linter for requiring @vue/component
Also ignore coverage folder for linting. I had to add a new
.stylelintignore file, because ignoreFiles property was not properly
working.

Change-Id: Iadd99b64eadd9c4103f750519263113ae8780ce1
2021-09-01 13:56:37 +00:00
Egon Elbre
e43af5eb3d web/: enable more vue eslint rules
Fixes two things:

All button tags must have type field specified, otherwise it defaults to
submit, which is mostly not correct for our site.

Disallows unused refs.

Change-Id: I28bb44aab9c153f83fec16fc4023a453444c3926
2021-08-12 16:56:37 +03:00
Egon Elbre
6b153192a3 web/satellite: fix lint issues
After migrating to eslint some errors were disabled to make it easier to
migrate.

This enables all the lint rules and treats all warnings as a build
failure. Similarly, CI won't automatically try to fix mistakes.

Change-Id: I80f808af026fc51bed90421b3b24737994a52094
2021-08-10 09:22:19 +00:00
NickolaiYurchenko
cc590343c2 web/satellite: server side encryption acknowledge checkbox added
Change-Id: If57ab6e8fddc34c142d19f754caf1338dfdb0bf6
2021-08-04 16:16:26 +00:00
Egon Elbre
f5ac00f909 web/satellite: switch to eslint, sass, bump deps
tslint has been deprecated so it's nice to switch to eslint.
Currently this uses a minimal eslint, to get things up and running.

node-sass requires C which does not work nicely on all platforms.

Change-Id: I3ca9adf2971475c009e541652b7637c18ad960f4
2021-08-03 15:56:33 +00:00
Vitalii Shpital
c6c2a1daf9 web/satellite: added MFA login step
Added Enter MFA passcode step to login after first attempt.
Connected client-side and server-side.

Change-Id: I4482afde50172bbf2c598aa01bbd220763b4f6d1
2021-07-30 08:50:19 +00:00
Vitalii Shpital
2489b78d22 web/satellite: move user MFA secret generation to server-side
It was decided to move user MFA secret generation to server-side and be fetched by http request

Change-Id: I5e31d35fb78d1d9f3280518fe3eb543bb8ed4377
2021-07-19 13:48:09 +00:00
Vitalii Shpital
e463eb17ac web/satellite: added enabling user MFA functionality to account settings
Added feature flagged functionality for enabling user MFA.
Added new Popup where user will scan qr code and confirm enabling
by entering passcode from MFA app. Also recovery codes will be visible afterwords

Change-Id: Ie8d1bc83c941a08fd8701442601a2d20126c8892
2021-07-14 15:13:59 +03:00
Jeremy Wharton
a5f6bb9cc0 satellite/console: Add reCAPTCHA verification step to registration
The user must complete a reCAPTCHA in order to register.
ReCAPTCHA verification failure results in rejection of the
registration attempt.

Change-Id: I34ba7db414d756fd1aaebdc3d19cccbfc7fc1ea3
2021-07-07 21:34:07 +00:00
Vitalii Shpital
bab43af6ce web/satellite: added Upgrade to Paid Tier banner
Added new info banner to show user their used and total storage values with a button to upgrade to Paid Tier with auto limit increase

Change-Id: I827818dcb5179358df246218a47feb61bc1a1bac
2021-07-01 15:05:03 +00:00
Vitalii Shpital
a9fcbf7284 web/satellite: bump object browser version
WHAT:
use new object browser version

Change-Id: Ieb473b8f4b1beff81a5c2661f55e8e3f946daa2e
2021-05-19 16:01:15 +00:00
Vitalii Shpital
222d9b7f0d web/satellite: add script to compile and compress wasm module
WHAT:
compile, compress and place wasm module into the correct place

WHY:
easier usage/testing

Change-Id: I06e83ef1bed9fc62366e1400ce5ed8942bd96633
2021-04-30 15:48:56 +00:00
Vitalii Shpital
75ba99b881 web/satellite: bump object browser component version with part size fix 2.0
WHAT:
another try to fix object browser part size issue
updated package-lock.json

WHY:
bug fix

Change-Id: I8104f3f84223f2e898fad6de63596a9841667ebc
2021-04-28 14:19:33 +03:00
Vitalii Shpital
f8aaf5c5f3 web/satellite: bump object browser version with part size fix
WHAT:
this version includes a fix for part size to be 64MB

WHY:
post-launch fix

Change-Id: Ie50adddef0340e679604995bab5aaa8317496728
2021-04-20 16:26:34 +00:00
Vitalii Shpital
d7488924cc web/satellite: bump file browser component version
WHAT:
bump file browser component version

WHY:
bakeoff

Change-Id: I857a130735feca438ca4bd44684e8408d47856bb
2021-04-15 23:22:22 +03:00
Moby von Briesen
c4a950a40c web/satellite: Remove client-side Segment analytics
We can be more precise and conservative by using the backend
satellite/analytics service. We also no longer need client-side Segment
scripts.

Change-Id: Ic5fb18bea2d388b586ad773e26027d69bde87294
2021-04-08 17:36:06 +00:00
Vitalii Shpital
6ae2351389 web/satellite: import file browser component
WHAT:
import and instantiate file browser component

WHY:
to operate over folders and objects

Change-Id: Ib6fb4fdc2668d2f274df3d1b23f8cc0bb6a361ea
2021-04-07 22:53:20 +03:00
Vitalii Shpital
ebf6bee0d4 web/satellite: import and setup AWS s3 client
WHAT:
import and setup S3 client that will be used to manage buckets

WHY:
to manage buckets

Change-Id: I27f5c03082e687aab32346eedd889a2218407238
2021-03-25 13:50:18 +00:00
Vitalii Shpital
cff1052bca web/satellite: save passphrase hash in local storage
WHAT:
store passphrase's hash in browser local storage

WHY:
to make user use the same passphrase

Change-Id: I3d5e601a0257a7c900e8a0ce3cdce953f1174830
2021-03-17 19:50:53 +02:00
VitaliiShpital
fd095e604f web/satellite: fix for access grants creation datepicker
WHAT:
when user chooses the same date in datepicker it sets grant's NotBefore and NotAfter restrictions as the same date which makes access grant unusable

WHY:
bug fix

Change-Id: I416606610ebddfd1fa881cce89d2beeded48457f
2021-02-08 17:37:20 +00:00
VitaliiShpital
50dd9fb11a web/satellite: move access grant web worker initialization to onlogin loading state
WHAT:
web worker is initialized during onlogin loading screen now

WHY:
removed unnecessary initializations and increased UX experience

Change-Id: I734f194f862c15b3fb08e436a161da32d8d4a8ac
2020-12-17 19:23:36 +00:00