Commit Graph

6432 Commits

Author SHA1 Message Date
Cameron
48fb3e947c cmd/satellite/reports: sum attribution data by user agent
Attribution is attached to bucket usage, but that's more granular than
necessary for the attribution report. This change iterates over the
bucket attributions, parses the user agent, converts the first entry
to lower case, and uses that as the key to a map which holds the
attribution totals for each unique user agent.

Change-Id: Ib2962ba0f57daa8a7298f11fcb1ac44a8bb97875
2022-04-18 13:23:37 +00:00
Egon Elbre
d7cd3a0ff8 Jenkinsfile: mod-tidy doesn't need the initial file
Change-Id: I7f35157b5f5306a84817019e3b9613e40ac45f3f
2022-04-17 17:39:03 +00:00
NickolaiYurchenko
c32ca6e67f apigen: endpint to update project
Implemented new endpoint for project update using apigen.
Implemented new service method compatible with new generated api.

Change-Id: Ic0a7e0bbf3ea942275bd927d6e30cfb7e721e9c1
2022-04-14 22:21:08 +00:00
NickolaiYurchenko
c944c3f289 web/satellite: error while adding invalid card handled
Change-Id: I9773503baef91b176a080c3081f8ac63e5ca27e8
2022-04-14 21:52:58 +00:00
Michał Niewrzał
6188c4c0dd satellite/metainfo: enable segment limit by default
Change-Id: I26cc0bbd97d6cc2ffc96213788f261efb749d028
2022-04-14 06:12:09 +00:00
Vitalii
513ad99756 satellite/satellitedb: migrate wrongly affected users to have default limits
Migrate free tier users to have default limits if their limits were set to 0.
They were affected by incorrect working of Update user query.

Change-Id: I4c49c8d99b12dba2b9b0ab61b2175085976dcc95
2022-04-13 13:33:03 +00:00
Qweder93
8e0196a6cc satellite/accounting: test accounting/tally with object copies
We implemented server-side copy feature and we would like to
confirm that it is not affecting accounting/tally service.

Resolves https://github.com/storj/storj/issues/4697

Change-Id: I3944ea52c0acc68107ec15c1911750dc7d947501
2022-04-13 09:16:43 +00:00
Yaroslav Vorobiov
a401450e3d cmd/storagenode-updater: add should-update cmd
This change add Separate CMD to check if a binary needs to be updated

Change-Id: I87f4214f84105464d283f1622dcb4ca9e796e771
2022-04-12 17:55:54 +00:00
Clement Sam
e9611801ad cmd/{storagenode,storagenode-updater}: add Process name to logs
Now that we have both the storagenode and updater processes running
in a single docker container, we need a way to know which log entry
is logged by any of the processes.

This change includes a Process field in the log entries.

Resolves https://github.com/storj/storj/issues/4648

Change-Id: I167b9ab65728a41136d264b5fe2c41bb64ed1785
2022-04-12 16:49:56 +00:00
Michał Niewrzał
623cb16b6e satellite/gracefulexit: test GE with copies
Test case to verify if server-side copy doesn't affect
GE in any negative way.

Fixes https://github.com/storj/storj/issues/4699

Change-Id: I8c385767cca61499d46d9cb8de7318c56e5d7397
2022-04-12 15:59:14 +00:00
Erik van Velzen
86d742f7c6 satellite/audit: verify auditing of copies
Check that audit works in the face of copies.

Closes https://github.com/storj/storj/issues/4695

Change-Id: I1ee79a73c28e3f4842eebe8c4e4cd9ecf2e51e57
2022-04-12 15:24:54 +00:00
Michał Niewrzał
61a76f35ef Jenkinsfile: enable 'Cockroach Backwards Compatibility' tests
We had an issue with CRDB where newer version forbid type
of SQL query we were using. We disabled CRDB bc tests until we
will have release without problematic query. Now we can enable
tests.

Change-Id: I275cbecebdcbfef587281f2daaf677d01860b23d
2022-04-12 13:15:43 +00:00
Clement Sam
583d48c432 mod: bump storj/private
Change-Id: Ia8299a082347b8f4ecc2f36988387b3a48701da5
2022-04-12 11:09:10 +00:00
Vitalii Shpital
b4cec4fd0b satellite/satellitedb: add columns to users table to control failed login attempts
Added failed_login_count and login_lockout_expiration columns to users table to control users failed login attempts.
We want to prevent brute forcing of user login so this is the first step.

Change-Id: I06b0b9f5415a1922e08cd9908893b2fd3c26bca0
2022-04-12 08:37:07 +00:00
Vitalii
36bef42e0a web/satellite: add missing copy buttons for onboarding flow
Added missing copy buttons for commands on Install Uplink CLI screen of onboarding flow.

Change-Id: I34c4e7b56e955d8571aea2d570e31cb7bfb011c5
2022-04-12 08:09:42 +00:00
Vitalii
fc074b693b web/satellite: fix demo-bucket creation issue
Store demo-bucket creation status in browser local store so that it's not created every time when user enters buckets screen.
It will start working after first usage in new browser.
So if user removes bucket in Chrome and opens Buckets screen in Firefox demo-bucket will be created but only once.

Change-Id: I9f5811d97ab6208c5f757ededcd7c36cd864795c
2022-04-12 07:42:43 +00:00
Erik van Velzen
16480c97da satellite/metabase: deduplicate delete query
Use the same query when deleting a single object or multiple.
I have chosen not to deduplicate the row "scan" logic because
it is less complicated code and this change would expand to other
parts of the codebase.

Part of https://github.com/storj/storj/issues/4700

Change-Id: I7a958c78c903b2bddd72ca217971f7e8e02a0d0c
2022-04-11 14:12:18 +00:00
Kaloyan Raev
de6852510f private/testplanet: configurable timeout
Testplanet limits the execution of a single test case to 3 minutes.

This change adds a Timeout field to the Testplanet's config, so test
cases can configure their timeout. This is helpful when executing larger
3rd party test suite on top of Testplanet.

Change-Id: Ibbf7c5ffdc0a9e723e7e28b885eac084f04c6ca1
2022-04-11 13:19:08 +00:00
Michał Niewrzał
99ec4c8869 satellite/gc: improve test for copies
Initial space used for pieces is calcualted, not retrieved
from storage nodes and at the end of test we are deleting
also copies that become ancestors to verify that all data
was removed from storage nodes.

Change-Id: I9804adb9fa488dc0094a67a6e258c144977e7f5d
2022-04-11 11:06:01 +00:00
Michał Niewrzał
a3d90167c7 mod: bump to latest uplink
Change-Id: I790be139cdb4c52395507c01d4c4d36eab6a5915
2022-04-11 08:52:03 +00:00
Cameron
d4ad3a3ca6 satellite/satellitedb/attribution: update value attribution query to return byte-hours
Before, the VA query was summing the total and dividing by the number of
rows. This gives the average bytes stored per hour, but we charge for
usage with byte-hours. Why not do value attribution the same way?
To do that, we don't divide by the number of rows. We also have object
and segment fees so return segment-hours and object-hours too.

Change-Id: I1f18b7e1b2bae1d3fae1ca3b93bfc24db5b9b0e6
2022-04-08 16:22:21 -04:00
Michał Niewrzał
c105562479 satellite/gc: test GC with object copies
We implemented server-side copy feature and we would like to
confirm that it is not affecting GC.

Fixes https://github.com/storj/storj/issues/4696

Change-Id: Id391f0badf5fce51f9910f0df732d477b07fa7ac
2022-04-07 11:32:35 +00:00
Egon Elbre
e10eabe30b web/storagenode: update dependencies
Also pin all web/multinode dependencies, which was missing from
the other change.

Change-Id: Id78749076af6d80e59949efd73c1e10f5b52589c
2022-04-07 07:50:22 +00:00
Fadila Khadar
3d9329a5b1 satellite/metabase: overwrite existing destination on copy
s3 allows for overwriting an object when using server-side copy.
This change makes overwriting the destination part of the atomic server-side copy operation so that
if copy fails, the old object is still available.

All the segments of the existing destination are deleted. If this destination object is an ancestor of another object, a new ancestor is promoted.

Fixes https://github.com/storj/storj/issues/4607

Change-Id: I85d1250850bb71867586ac230c8275a0cc1b63c3
2022-04-07 06:28:51 +00:00
Moby von Briesen
3397886b14 docs/blueprints: Add session management blueprint
New blueprint describes a design which provides the satellite greater
control over sessions authorized to use the web app.

Change-Id: I5af227aef6d6b096167e2e8a60f1e8214c2cd71f
2022-04-06 21:10:33 +00:00
Vitalii
3b39399905 apigen: endpoint to create new Project
Implemented new endpoint for project creation using apigen.
Implemented new service method compatible with new generated api.

Change-Id: I2bae22c8b046f21ec5bb6522f09b9c4e74bdba0c
2022-04-06 17:49:46 +00:00
Egon Elbre
9d3c886f35 web/multinode: update dependencies
Change-Id: If575d8d9b481476203cc08c80d95d49273d45c29
2022-04-06 14:48:21 +00:00
Clement Sam
e486585853 Dockerfiles: switch base image from alpine to Debian
We've had a lot of issues with alpine and currently there's a broken
network issue on alpine for users running on RPI arm32 architechture
which requires a workaround before docker is able to sync time between
the host and the container: https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.13.0\#time64_requirements.

Since we're switching the base image of the storagenode to debian,
it's best to switch the base image of all our docker images to
debian as well for consistency; less drift across them and keeps
the push target consistent.

Change-Id: If3adf7a57dc59f19ef2221b892f340d919798fc5
2022-04-05 11:40:44 +00:00
Clement Sam
ee7f0d3a2a Makefile: fix wrong indentation
Indentations are off in the push-storagenode-images target in the makefile which is possibly causing build to fail

Change-Id: Ia25b8f700f49c551e3f201c988747a83e04ad83c
2022-04-05 09:11:55 +00:00
Erik van Velzen
61a47f3e95 cmd/uplink: refactor date parsing
Change-Id: I6a5cbdf86eecdc5578f3dae7a8ab1b0d4485e1da
2022-04-05 01:03:20 +00:00
Erik van Velzen
54c3bafb5b satellite/metabase: delete bucket with cross-bucket copies
When deleting a bucket, make sure that object copies in other buckets are
promoted to new ancestor and left in a working state.

Closes https://github.com/storj/storj/issues/4591

Change-Id: I019d916cd6de5ed51dd0dd25f47c35d0ec666af6
2022-04-05 01:32:02 +02:00
Mya
08b87218bf developing: add development guide for new comers
This change introduces a DEVELOPING.md file, commonly seen across
open source repositories as a way to communicate how to get started
contributing code to new-comers.

Change-Id: Idb92231e025250a4c6d2fc789cab5f78ca87086a
2022-04-04 17:33:48 +00:00
paul cannon
985ccbe721 satellite/repair: in dns redial, don't retry if CloseError
To save load on DNS servers, the repair code first tries to dial the
last known good ip and port for a node, and then falls back to a DNS
lookup only if we fail to connect to the last known good ip and port.

However, it looks like we are seeing errors during the client stream
Close() call (probably due to quic-go code), and those are classified
the same as errors encountered during Dial. The repairer code sees this
error, assumes that we failed to contact the node, and retries- but
since we did actually succeed in connecting the first time around, this
results in submitting the same order limit (with the same serial number)
to the storage node, which (rightfully) rejects it.

So together with change I055c186d5fd4e79560f67763175bc3130b9bc7d2 in
storj/uplink, this should avoid the double submission and avoid dinging
nodes' suspension scores unfairly.

See https://github.com/storj/storj/issues/4687.

Also, moving the testsuite directory check up above check-monkit in the
Jenkins Lint task, so that a non-tidy testsuite/go.mod can be recognized
and handled before everything breaks weirdly and seemingly randomly
later on.

Change-Id: Icb2b05aaff921d0af6aba10e450ac7e0a7bb2655
2022-04-04 17:01:09 +00:00
Monty Anderson
348007e119 web/satellite browser: don't use iterable as an array
Fixes a problem with using Upload button to upload files.

Change-Id: I765894535372d1840e7cab7c3a71d5b69d8f17f3
2022-04-04 15:07:54 +00:00
Vitalii
9b695525c6 satellite/console: fixed small email validation issues
Moved invalid email testing to separate test.
Made all the emails used to have .test domain.
Added links to regex resources.

Change-Id: I26920ba7360064528256a6aeaea947bbe56ef618
2022-04-04 09:43:33 +00:00
Michał Niewrzał
e93bbf693d satellite/metainfo: add missing method monitoring
Change-Id: I3a0d8121203a6f543f660de02628967cf7f22040
2022-04-03 15:47:14 +00:00
Vitalii
67b5b07730 apigen: api key authentication implemented
Implemented account management api key authentication.
Extended IsAuthenticated service method to include both cookie and api key authorization.

Change-Id: I6f2d01fdc6115cb860f2e49c74980a39155afe7e
2022-04-01 15:17:38 +00:00
Michał Niewrzał
8cdadae124 satellite/metainfo: optimize geo config check for move/copy
This change has two purposes. First is to avoid DB call in case
source and destination bucket are the same.
Second is to return bucket not found error in correct order. If
source and destination bucket are different we will first check
source and later destination. Currently we will get first error
about not existing destination bucket.
Because of this change we stop putting bucket placement
into satellite stream id but its not needed as we don't use
this value with finish move/copy object methods.

Change-Id: I0f7b3ba604d53c722e8fa4d7a37843a69d02bebd
2022-04-01 11:49:44 +00:00
Michał Niewrzał
2014e4655a satellite/metabase: bring back copy/move validation for key and nonce
Uplink is fixed and now we should always get both key and nonce
or both empty.

Fixes https://github.com/storj/storj/issues/4646

Change-Id: I65dca2d4d5a10787c2fecad39e301121f1ae242a
2022-04-01 07:23:22 +00:00
Cameron
2b39df460c cmd/nullify-bad-user-agents: set user_agent to NULL where user_agent = partner_id
In the migration to migrate the corresponding name of the partner id to
user agent, part of the requirement was to migrate the partner id
itself if there was no partner name associated. This turned out to not
be so good. When we parse the user_agent column later, it is returning an
error if the user agent is one of these UUIDs.

Change-Id: I776ea458b82e1f99345005e5ba73d92264297bec
2022-03-31 16:57:50 -04:00
Michał Niewrzał
25e92fe443 satellite/metabase: deletion query as explicit transaction
Latest CRDB version did't work with our server-side copy deletion
query and we had to rewrite it.

Fixes https://github.com/storj/storj/issues/4655

Change-Id: I66d5c4abfc3c3f53dea8bc01ae11cd2b020e4289
2022-03-31 11:40:36 +00:00
Egon Elbre
7aa001d62f private/version: document kebabToPascal
Change-Id: Id7bdf969072c330956c093c24b662f4330fc4d4c
2022-03-31 13:52:27 +03:00
Egon Elbre
5fca07387f storagenode/storagenodedb: make schemagen gofmt compatible
Few adjustments to the output to make it consistent with gofmt.

Change-Id: Icb673a0632c3be4cb0f4ab1c4aeffc0290e38e95
2022-03-31 13:28:10 +03:00
Egon Elbre
d9b14f7902 private/version: replace custom stringsTitle
cases package has an option cases.NoLower for the behavior we need.

Change-Id: Ie5bd4c52384fff45228321e02ab2478b5fecf245
2022-03-31 13:28:10 +03:00
Qweder93
2a7b20e8e4 cmd/uplink: integrate server-side copy with uplink cp command
Resolves https://github.com/storj/storj/issues/4486

Change-Id: I42ac2ad2e1a05df4a83606f1990b639f08791403
2022-03-31 09:25:29 +00:00
Egon Elbre
e5972d8920 all: fix linting errors
strings.Title is deprecated in Go 1.18, replace it with
golang.org/x/text/cases.

Change-Id: I6185b97d37309dbe4a6715f794383ab259a0658b
2022-03-30 18:45:23 +03:00
Egon Elbre
a2fe69767d satellite/admin: delete unused file
Change-Id: Ie646fbfd9f0e8bb958314a232e8995474de25039
2022-03-30 10:56:26 +00:00
Michał Niewrzał
18ab60dc92 satellite/metabase: drop GetSegmentByOffset
Methods was never used in production and it's not sure that
it will be used at all. Let's drop it and restore if will be needed.

Fixes https://github.com/storj/storj/issues/4480

Change-Id: Ifd780d0096b67be7e72dff84bdcf1d957e0b48b5
2022-03-30 09:03:48 +00:00
paul cannon
d8733ddd40 satellite/satellitedb: stop using _gob columns
This sets the corresponding _numeric columns to be NOT NULL (it has been
verified manually that there are no more NULL _numeric values on any
known satellites, and it should be impossible with current code to get
new NULL values in the _numeric columns.

We can't drop the _gob columns immediately, as there will still be code
running that expects them, but once this version is deployed we can
finally drop them and be totally done with this crazy 5-step migration.

Change-Id: I518302528d972090d56b3eedc815656610ac8e73
2022-03-30 04:13:13 +00:00
Moby von Briesen
0018d62837 satellite/analytics: Associate Hubspot token with new user
If a visitor has accepted cookies on www.storj.io, there might be a
"hubspotutk" cookie in their browser upon account creation. This allows
Hubspot to link website activity with a newly created user.

Change-Id: If06c67fb4d2e5dd3cf46c1fe80a0e9d7f25d6e58
2022-03-29 16:25:33 -04:00