Commit Graph

7718 Commits

Author SHA1 Message Date
Jeremy Wharton
73ff35f160 satellite/payments: add partnered field to coupon struct
A field has been added to the coupon struct indicating whether it is
associated with a partner's pricing package. This is required to
alter the appearance of partner coupons in the satellite frontend.

References storj/storj-private#172

Change-Id: Ie48ae3902aaa108abf9a399242a0cd98cb53d1c3
2023-03-13 02:54:26 -05:00
Wilfred Asomani
0177ef79da satellite/{console,analytics,accountfreeze}: send unfreeze event
This change sends an event to segment for when a user is unfrozen.
It also moves freeze and warning event triggers from the autofreeze
chore to the account freeze service.

Change-Id: I5c0522b921b7baf52d6db5eb7ef841c08644a461
2023-03-10 23:21:20 +00:00
Jeremy Wharton
c4f8695e8a web/satellite: generate TypeScript for frontend config
A package has been written to generate a TypeScript file containing
classes corresponding to the frontend config. These classes will be
used across the frontend once we no longer reference meta tag values
for configuration.

References #5494

Change-Id: If425035892773167ac6d9fbfae8140cab79fbb70
2023-03-10 22:33:24 +00:00
Jeremy Wharton
4d823e8166 private/apigen: isolate TypeScript class generation
The code responsible for generating TypeScript classes has been
separated from the rest of the TypeScript generation code so that other
packages may take advantage of this functionality.

References #5494

Change-Id: I97eabd430bd6a5f748eafaf8b1d783977e75e660
2023-03-10 21:52:30 +00:00
Cameron
4e94e6188c satellite/admin: restrict api access based on user groups
This change reworks the allowedAuthorization function to check what
groups the user is a part of to determine if authorization should be
granted. By wrapping each handler with withAuth, we can specify the
allowed groups for each api method individually.

github issue: https://github.com/storj/storj/issues/5565

Change-Id: I1804dda04d5b16d19e93bd7199fb3fc89fca1294
2023-03-10 16:16:04 -05:00
Wilfred Asomani
fafa6658a9 web/satellite: fix file dropdown
This changes the icon, and text of the "Details" dropdown item to
"Preview". It also fixes text alignment in the dropdown menu.

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

Change-Id: Ib7ab3bc6fd98b9319ec3c3af5644aee6d1942335
2023-03-10 19:13:33 +00:00
Lizzy Thomson
7e2d98988b cmd/tools: remove migration tool code for generating missing salt
Remove generate-missing-project-salt migration tool code and related
tests. This migration has already been run and this code is no longer
needed.

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

Change-Id: I4e36dcd95a07c5305c597113a7fd08148e100ccc
2023-03-10 16:38:54 +00:00
Lizzy Thomson
0559d19db5 web/satellite: fix accessibility issues with sidebar navigation
Fixes https://github.com/storj/storj/issues/5449

Change-Id: I095c6a70899cd9f5939ef8c802d0faa8322d441d
2023-03-10 08:56:31 -07:00
Michal Niewrzal
0696256769 satellite/accounting: fix project limit cache usage
It looks that at some point we broke how project limits cache is used
and we were missing cache in most critical paths (upload/download).
This is fix for this issue.

I also adjusted cache methods naming.

Change-Id: Ic98372779a39365d0920fe3943f1f7a68b064173
2023-03-10 14:42:38 +00:00
Egon Elbre
0d981a6485 ci: check licenses
Change-Id: Ibe67bdb865fdb7c1059fe4bfb349299df86e2b62
2023-03-10 13:38:40 +00:00
Wilfred Asomani
b1d4763086 satellite/{web,payments}: show STORJ balance
This change adds a card to the billing overview page, which shows the
user's token balance from coinpayments.

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

Change-Id: I11e295b48791b32b745cb7a11c5b4aad6b56618e
2023-03-10 13:01:15 +00:00
paul cannon
b98a09fa58 satellite/geoip: skip test on macOS
This is how we deal with the other tests that expect all 127.* addresses
to work locally.

Change-Id: Id62bb07a56044dfadcc87089f0f13684eeb07f3c
2023-03-10 03:08:17 +00:00
paul cannon
fd6ce6b9a5 scripts/tests: fix test-sim-rolling-upgrade.sh
This test involves a satellite with dev defaults (DistinctIP=no) being
upgraded past commit 2522ff09b6, which
means we need to run the dev-defaults-satellite-upgrade migration SQL
to avoid getting DistinctIP=yes behavior (which breaks the tests).

Change-Id: I29fb596d1ffa568dad635d98cfe9abacd3aaa48f
2023-03-09 23:35:36 +00:00
Jeremy Wharton
1d1739e187 web/satellite: update styling of pricing plan components
The styling of pricing plan components has been updated to match our
designs.

References storj/storj-private#172

Change-Id: I61a2536267c41292abd9e4860b5bd45fafb61408
2023-03-09 22:03:46 +00:00
Wilfred Asomani
31e386c607 web/satellite: add new settings page
This change implements a new account settings page for the all projects
dashboard.

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

Change-Id: Id777cd5c1efe3fa4b40234771ae2a99cc5cb9dd3
2023-03-09 20:30:49 +00:00
Wilfred Asomani
52abe8ddb4 web/satellite: add all projects onboarding
This change implements onboarding for the all projects dashboard.

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

Change-Id: If8a48c21e6df264c84d362d17bf01d770d9ca768
2023-03-09 19:55:34 +00:00
Vitalii
d6b661a412 web/satellite: fix for long names in tables
Added truncating for long names in access grant and project member tables.
Added title to all table items so that full value is displayed on hover.

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

Change-Id: I7f81d88c8ff4db606bdfeb15406ba3ee3fcec968
2023-03-09 17:58:14 +00:00
Antonio Franco (He/Him)
3613bfe1af
testsuite/playwright: copys files to storj repo (#5648)
* testsuite/playwright: copys files to storj repo
This PR copies all the playwright ui tests to the storj repository.

* CI: Jenkinsfile.ui
Jenkinsfile.ui builds all necessary items for running storj binaries, installs all items for playwright ui tests and executes the test. Note that we aren't running regular unit tests and we are not linting the code as this is occuring in the public instance. Furthermore, we still need to implement the starting of storj services as well as typescript linters for the playwright tests.

* testsuite: playwright ui tests
This PR copies all playwright ui tests files from the qa repo.

* testsuite: playwright ui tests
This PR copies all playwright ui tests files from the qa repo.
2023-03-09 11:59:45 -05:00
Michal Niewrzal
0c177ef91f satellite: cleanup orders dependencies
Only API peer needs access to order DB (and rollups cache) because it's
only place where we are creating orders for PUT and GET operations. For
other peers like auditor and repairer we can set noop implementation to
reduce number of dependencies needed for them.

Change-Id: Ic32d1879f0b97ffc4516f401898e31e95ae892e4
2023-03-09 13:34:21 +00:00
Márton Elek
ffaf15a3b0 satellite/overlay: remove unused mail service from overlay
It was surprising that `satellite auditor` complained about SMTP mail settings, even if it's not supposed to sending any mail.

Looks like we can remove the mail service dependency, as it's not a hard requirement for overlay.Service.

Change-Id: I29a52eeff3f967ddb2d74a09458dc0ee2f051bd7
2023-03-09 12:17:35 +00:00
Márton Elek
788f5fde01 satellite/peer: better error handling for SMTP parameters
I tried to configure a satellite service and got this error:

```
DEBUG   process/exec_conf.go:408        Unrecoverable error     {"error": "missing port in address"}
```

It took some time to realize that I forgot to set the SMTPServerAddress.

This patch makes it easier to detect similar problem (detailed error message), and makes SMTP parameters optional if no real mail sending is used (simulated or nomail)

Change-Id: I32535a7c8d6529e19e4d919806f42ba430d074a5
2023-03-09 11:29:07 +00:00
Stefan Benten
4788b9ea3b
scripts/draft-release.sh: update to python3
Change-Id: Iabdf9283f77c1a8518f2373d39157d10e1daab6d
2023-03-09 10:59:31 +01:00
paul cannon
2522ff09b6 satellite/overlay: configurable meaning of last_net
Up to now, we have been implementing the DistinctIP preference with code
in two places:

 1. On check-in, the last_net is determined by taking the /24 or /64
    (in ResolveIPAndNetwork()) and we store it with the node record.
 2. On node selection, a preference parameter defines whether to return
    results that are distinct on last_net.

It can be observed that we have never yet had the need to switch from
DistinctIP to !DistinctIP, or from !DistinctIP to DistinctIP, on the
same satellite, and we will probably never need to do so in an automated
way. It can also be observed that this arrangement makes tests more
complicated, because we often have to arrange for test nodes to have IP
addresses in different /24 networks (a particular pain on macOS).

Those two considerations, plus some pending work on the repair framework
that will make repair take last_net into consideration, motivate this
change.

With this change, in the #2 place, we will _always_ return results that
are distinct on last_net. We implement the DistinctIP preference, then,
by making the #1 place (ResolveIPAndNetwork()) more flexible. When
DistinctIP is enabled, last_net will be calculated as it was before. But
when DistinctIP is _off_, last_net can be the same as address (IP and
port). That will effectively implement !DistinctIP because every
record will have a distinct last_net already.

As a side effect, this flexibility will allow us to change the rules
about last_net construction arbitrarily. We can do tests where last_net
is set to the source IP, or to a /30 prefix, or a /16 prefix, etc., and
be able to exercise the production logic without requiring a virtual
network bridge.

This change should be safe to make without any migration code, because
all known production satellite deployments use DistinctIP, and the
associated last_net values will not change for them. They will only
change for satellites with !DistinctIP, which are mostly test
deployments that can be recreated trivially. For those satellites which
are both permanent and !DistinctIP, node selection will suddenly start
acting as though DistinctIP is enabled, until the operator runs a single
SQL update "UPDATE nodes SET last_net = last_ip_port". That can be done
either before or after deploying software with this change.

I also assert that this will not hurt performance for production
deployments. It's true that adding the distinct requirement to node
selection makes things a little slower, but the distinct requirement is
already present for all production deployments, and they will see no
change.

Refs: https://github.com/storj/storj/issues/5391
Change-Id: I0e7e92498c3da768df5b4d5fb213dcd2d4862924
2023-03-09 02:20:12 +00:00
Michal Niewrzal
67ad792d1a satellite/rangedloop: migrate segments verification from segment loop
Segments loop have build-in sanity check to verify if number of segments
processed by loop is roughly fine. We want to have the same verification
for ranged loop.

https://github.com/storj/storj/issues/5544

Change-Id: Ia19edc0fb4aa8dc45993498a8e6a4eb5928485e9
2023-03-08 17:00:11 +00:00
Cameron
f4ea730e69 satellite/console: use custom session duration
If the session_minutes column in user_settings is not null, use this
value to determine the expiration when creating or refreshing a session.

github issue: https://github.com/storj/storj/issues/5487

Change-Id: I1f777f7ffcd4018b0c40f0b26c8a50de85a31909
2023-03-08 14:55:02 +00:00
Erik van Velzen
464ceb1c0e satellite/gc: improve comments
Change-Id: I9e71c9bee3447f78365ba1593e4a4ef55b28356f
2023-03-08 13:15:13 +00:00
Sembeth
0408997e6c
cmd/multinode: Removes dependency on deprecated identity-dir flag, code and documentation. (#5646)
* The Multinode Dashboard no longer requires the identity files.

* Removed deprecated code that used the identity-dir.
2023-03-08 13:56:15 +01:00
Vitalii
e3cbbd4d80 web/satellite: migrated StorageChart to use composition API
Migrated component to use SFC composition API.

Change-Id: I7328b76ce6e3b038877232e2c76814d7583bbf66
2023-03-07 15:20:36 +00:00
Vitalii
28f08405f4 web/satellite: migrate BandwidthChart to use composition API
Migrated component to use SFC composition API.

Change-Id: I987781a2b6741a903800a21964bdfd992f4221b5
2023-03-07 15:19:43 +00:00
Vitalii
0b58657914 web/satellite: migrated dashboard InfoContainer component to use composition API
Migrated component to use SFC composition API.

Change-Id: Ibc985f8e81d941dd83fecd065873be1610f40767
2023-03-07 15:18:51 +00:00
Vitalii
43da70556a web/satellite: migrated DateRangeSelection component to use composition API
Migrated component to use SFC composition API.

Change-Id: I224fffc827f8be53aa8e0389334224b367b7ee71
2023-03-07 15:17:58 +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
a01d47b3ed satellite:{console, web}: remove old project dashboard
Removed old project dashboard along with a feature flag.

Change-Id: I9292b19caf101a84042d8c3006c27bc44db8d6b5
2023-03-07 13:34:59 +02:00
Vitalii
b6721633f1 satellite/payments: return public project ID for project charges
We should return public project id instead of regular one when quering project charges so that it is consistent on a client side.
This is a fix for an issue with displaying project name on a Billing screen.

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

Change-Id: Ic0c544dbe7369aa88f3a7c97a2f5de5bc854e1fd
2023-03-06 22:50:21 +00:00
JT Olio
d0408ee89b cmd/uplink: stop using transport.SetConnector
quic is still configurable based on the quic rollout
environment variables in storj.io/common. this stops
using a method removed in:
https://review.dev.storj.io/c/storj/uplink/+/9815

Change-Id: Ibfe28cfb19e5672630970b9e2c8c6ac0c98d4822
2023-03-06 21:48:26 +00:00
JT Olio
5b0cada4b3 repairer: monitor non-nil limit amount
Change-Id: I1a7b7a4a6716783449704cd8a7823090109a14de
2023-03-06 20:39:45 +00: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
d843666606 web/satellite: divide file browser error tracking into 2 separate events
Divide single error event into 2 separate events.
Those are list objects event and change route event.

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

Change-Id: I3efe0f2d14fceb5841b6d0ff6db685540351281a
2023-03-06 18:53:25 +00:00
JT Olio
ade808375c storagenode/piecestore: be more flexible with bandwidth usage max
this is to prepare for https://review.dev.storj.io/c/storj/uplink/+/9814

Change-Id: Ib74fd63a352a0ae4cc1f8b66fb70df649844c33a
2023-03-06 18:00:17 +00:00
Vitalii
41efebeebd web/satellite: migrated AddCouponCodeInput to use SFC composition api
Migrated component to use composition API.

Change-Id: Ia39ef0f7c2226821f055856db1adcccc8b70e7e6
2023-03-06 16:57:51 +00:00
Michal Niewrzal
bc8f8f62b5 satellite/orders: cleanup after altering primary key
We changed primary key for bucket_bandwidth_rollups table. Now we
need to do some cleanup in places like structs, sorting methods or SQL
queries.

Change-Id: Ida4f874f161356df193379a53507602e04db1668
2023-03-06 16:03:11 +00:00
Vitalii
45a47f654e web/satellite: disable buckets checkbox if all buckets are selected
Disable buckets checkbox if all buckets option is selected for new access grant flow.
This would disallow unchecking all buckets checkbox if none of the specific buckets is selected.

Change-Id: I81a9f03d49d2cde862fd0afbc2fde0abeb0b31ce
2023-03-06 14:45:55 +02:00
Márton Elek
6737d427e4
cmd/uplink: better usability for date specification
I use `uplink share` command but I always fail to set the --not-before parameter.

 * Usually I try +2d when I see in the help that +2h is possible --> fail
 * When it fails, I try to set explicit date, like 2012-12-23 --> fail

This patch makes it possible to use:

 * day duration (like +3d)
 * shorter date definition (like `2023-12-12` or `2023-12-12T12:40`)

Change-Id: I2243b36f59c8929eb0473c4bb4fed19220890c71
2023-03-06 13:07:27 +01:00
Egon Elbre
63fa386b0a satellite/payments/stripecoinpayments: avoid mock cross-talk in tests
The tests were using global variables for keeping the mock state, which
was indexed by the satellite ID. However, the satellite ID-s are
deterministic and it's possible for two tests end up using the same
mocks.

Instead make the mock creation not depend on the satellite ID and
instead require it being configured via paymentsconfig.

This fixes TestAutoFreezeChore failure.

Change-Id: I531d3550a934fbb36cff2973be96fd43b7edc44a
2023-03-03 20:20:48 +02:00
Michal Niewrzal
d54ccfa92b satellite/satellitedb: change bucket_bandwidth_rollups primary key
In the past we set incorrect primary key for bucket_bandwidth_rollups
table and bucket name was first column of key instead of project id.
This change fixes this problem.

We will alter primary key manually for production satellites. That's
why migration code is checking if change was already applied.

https://github.com/storj/storj/issues/5332

Change-Id: I7dd555eb0c2f6fda1c90eaed08fa847b7f273bc7
2023-03-03 16:25:35 +00:00
Moby von Briesen
e9628c133d satellite/console: Add comments to generated api
Clarify that this functionality is not currently implemented within the
Satellite UI

Change-Id: I94096ab9b4d8f00195b55f5e875d76930de848e4
2023-03-03 09:29:11 -05:00
Michal Niewrzal
5a9577bb43 satellite/metabase/rangedloop: test loop boundaries
Fixes https://github.com/storj/storj/issues/5620

Change-Id: Ibf23e8866c1a8a8e78281c3d07e81ffc7db30fcf
2023-03-03 09:56:01 +00:00
Jeremy Wharton
662e916194 web/satellite: skip pricing plan step if no available packages
The pricing plan selection step of the onboarding tour is skipped if
there are no pricing packages configured for a user's partner.

Change-Id: I14bacbfaa10acf4cb97db04724749111a73e3928
2023-03-03 09:09:15 +00:00
Wilfred Asomani
0676a4ca89 web/satellite: use correct table icons
This change uses the corresponding icons for different types of files
in the file browser.

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

Change-Id: I8b10ac4ece03563a465c7823a1e7482244a324b9
2023-03-03 08:14:51 +00:00
Jeremy Wharton
3b37a23d7b satellite/console/consoleweb: add pricing package availability endpoint
An endpoint has been added that returns whether a pricing package is
available for a user to purchase. This will be used to conditionally
skip the pricing plan selection step of the onboarding tour.

Change-Id: I8c02a4e474e5f0f80778453b7daf674c8da64306
2023-03-02 23:51:09 +00:00