Skip to content

Commit

Permalink
Satellite/console: Reduce free account limits
Browse files Browse the repository at this point in the history
Update free account limits to segments(10k), storage(25gb), and
bandwidth(25gb)

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

Change-Id: I59250fc9f1eebc812bc85ecfbc2924f8c4369064
  • Loading branch information
lizzythomson authored and Storj Robot committed Mar 29, 2023
1 parent 54b6e16 commit 63533c6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
14 changes: 7 additions & 7 deletions satellite/admin/project_test.go
Expand Up @@ -47,7 +47,7 @@ func TestProjectGet(t *testing.T) {
t.Run("OK", func(t *testing.T) {
link := "http://" + address.String() + "/api/projects/" + project.ID.String()
expected := fmt.Sprintf(
`{"id":"%s","publicId":"%s","name":"%s","description":"%s","userAgent":null,"ownerId":"%s","rateLimit":null,"burstLimit":null,"maxBuckets":null,"createdAt":"%s","memberCount":0,"storageLimit":"25.00 GB","bandwidthLimit":"25.00 GB","userSpecifiedStorageLimit":null,"userSpecifiedBandwidthLimit":null,"segmentLimit":150000}`,
`{"id":"%s","publicId":"%s","name":"%s","description":"%s","userAgent":null,"ownerId":"%s","rateLimit":null,"burstLimit":null,"maxBuckets":null,"createdAt":"%s","memberCount":0,"storageLimit":"25.00 GB","bandwidthLimit":"25.00 GB","userSpecifiedStorageLimit":null,"userSpecifiedBandwidthLimit":null,"segmentLimit":10000}`,
project.ID.String(),
project.PublicID.String(),
project.Name,
Expand Down Expand Up @@ -88,7 +88,7 @@ func TestProjectLimit(t *testing.T) {
linkLimit := "http://" + address.String() + "/api/projects/" + project.ID.String() + "/limit"

t.Run("Get OK", func(t *testing.T) {
assertGet(ctx, t, linkLimit, `{"usage":{"amount":"25.00 GB","bytes":25000000000},"bandwidth":{"amount":"25.00 GB","bytes":25000000000},"rate":{"rps":0},"maxBuckets":0,"maxSegments":150000}`, planet.Satellites[0].Config.Console.AuthToken)
assertGet(ctx, t, linkLimit, `{"usage":{"amount":"25.00 GB","bytes":25000000000},"bandwidth":{"amount":"25.00 GB","bytes":25000000000},"rate":{"rps":0},"maxBuckets":0,"maxSegments":10000}`, planet.Satellites[0].Config.Console.AuthToken)
})

t.Run("Get Not Found", func(t *testing.T) {
Expand Down Expand Up @@ -136,7 +136,7 @@ func TestProjectLimit(t *testing.T) {
require.Equal(t, http.StatusOK, response.StatusCode)
require.NoError(t, response.Body.Close())

assertGet(ctx, t, linkLimit, `{"usage":{"amount":"1.0 TiB","bytes":1099511627776},"bandwidth":{"amount":"25.00 GB","bytes":25000000000},"rate":{"rps":0},"maxBuckets":0,"maxSegments":150000}`, planet.Satellites[0].Config.Console.AuthToken)
assertGet(ctx, t, linkLimit, `{"usage":{"amount":"1.0 TiB","bytes":1099511627776},"bandwidth":{"amount":"25.00 GB","bytes":25000000000},"rate":{"rps":0},"maxBuckets":0,"maxSegments":10000}`, planet.Satellites[0].Config.Console.AuthToken)

req, err = http.NewRequestWithContext(ctx, http.MethodPut, linkLimit+"?usage=1GB", nil)
require.NoError(t, err)
Expand All @@ -147,7 +147,7 @@ func TestProjectLimit(t *testing.T) {
require.Equal(t, http.StatusOK, response.StatusCode)
require.NoError(t, response.Body.Close())

assertGet(ctx, t, linkLimit, `{"usage":{"amount":"1.00 GB","bytes":1000000000},"bandwidth":{"amount":"25.00 GB","bytes":25000000000},"rate":{"rps":0},"maxBuckets":0,"maxSegments":150000}`, planet.Satellites[0].Config.Console.AuthToken)
assertGet(ctx, t, linkLimit, `{"usage":{"amount":"1.00 GB","bytes":1000000000},"bandwidth":{"amount":"25.00 GB","bytes":25000000000},"rate":{"rps":0},"maxBuckets":0,"maxSegments":10000}`, planet.Satellites[0].Config.Console.AuthToken)
})

t.Run("Update Bandwidth", func(t *testing.T) {
Expand All @@ -160,7 +160,7 @@ func TestProjectLimit(t *testing.T) {
require.Equal(t, http.StatusOK, response.StatusCode)
require.NoError(t, response.Body.Close())

assertGet(ctx, t, linkLimit, `{"usage":{"amount":"1.00 GB","bytes":1000000000},"bandwidth":{"amount":"1.00 MB","bytes":1000000},"rate":{"rps":0},"maxBuckets":0,"maxSegments":150000}`, planet.Satellites[0].Config.Console.AuthToken)
assertGet(ctx, t, linkLimit, `{"usage":{"amount":"1.00 GB","bytes":1000000000},"bandwidth":{"amount":"1.00 MB","bytes":1000000},"rate":{"rps":0},"maxBuckets":0,"maxSegments":10000}`, planet.Satellites[0].Config.Console.AuthToken)
})

t.Run("Update Rate", func(t *testing.T) {
Expand All @@ -173,7 +173,7 @@ func TestProjectLimit(t *testing.T) {
require.Equal(t, http.StatusOK, response.StatusCode)
require.NoError(t, response.Body.Close())

assertGet(ctx, t, linkLimit, `{"usage":{"amount":"1.00 GB","bytes":1000000000},"bandwidth":{"amount":"1.00 MB","bytes":1000000},"rate":{"rps":100},"maxBuckets":0,"maxSegments":150000}`, planet.Satellites[0].Config.Console.AuthToken)
assertGet(ctx, t, linkLimit, `{"usage":{"amount":"1.00 GB","bytes":1000000000},"bandwidth":{"amount":"1.00 MB","bytes":1000000},"rate":{"rps":100},"maxBuckets":0,"maxSegments":10000}`, planet.Satellites[0].Config.Console.AuthToken)
})

t.Run("Update Buckets", func(t *testing.T) {
Expand All @@ -186,7 +186,7 @@ func TestProjectLimit(t *testing.T) {
require.Equal(t, http.StatusOK, response.StatusCode)
require.NoError(t, response.Body.Close())

assertGet(ctx, t, linkLimit, `{"usage":{"amount":"1.00 GB","bytes":1000000000},"bandwidth":{"amount":"1.00 MB","bytes":1000000},"rate":{"rps":100},"maxBuckets":2000,"maxSegments":150000}`, planet.Satellites[0].Config.Console.AuthToken)
assertGet(ctx, t, linkLimit, `{"usage":{"amount":"1.00 GB","bytes":1000000000},"bandwidth":{"amount":"1.00 MB","bytes":1000000},"rate":{"rps":100},"maxBuckets":2000,"maxSegments":10000}`, planet.Satellites[0].Config.Console.AuthToken)
})

t.Run("Update Segment Limit", func(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions satellite/console/projects.go
Expand Up @@ -66,19 +66,19 @@ type UsageLimitsConfig struct {

// StorageLimitConfig is a configuration struct for default storage per-project usage limits.
type StorageLimitConfig struct {
Free memory.Size `help:"the default free-tier storage usage limit" default:"150.00GB" testDefault:"25.00 GB"`
Free memory.Size `help:"the default free-tier storage usage limit" default:"25.00GB" testDefault:"25.00 GB"`
Paid memory.Size `help:"the default paid-tier storage usage limit" default:"25.00TB" testDefault:"25.00 GB"`
}

// BandwidthLimitConfig is a configuration struct for default bandwidth per-project usage limits.
type BandwidthLimitConfig struct {
Free memory.Size `help:"the default free-tier bandwidth usage limit" default:"150.00GB" testDefault:"25.00 GB"`
Free memory.Size `help:"the default free-tier bandwidth usage limit" default:"25.00GB" testDefault:"25.00 GB"`
Paid memory.Size `help:"the default paid-tier bandwidth usage limit" default:"100.00TB" testDefault:"25.00 GB"`
}

// SegmentLimitConfig is a configuration struct for default segments per-project usage limits.
type SegmentLimitConfig struct {
Free int64 `help:"the default free-tier segment usage limit" default:"150000"`
Free int64 `help:"the default free-tier segment usage limit" default:"10000"`
Paid int64 `help:"the default paid-tier segment usage limit" default:"100000000"`
}

Expand Down
6 changes: 3 additions & 3 deletions scripts/testdata/satellite-config.yaml.lock
Expand Up @@ -329,7 +329,7 @@ compensation.withheld-percents: 75,75,75,50,50,50,25,25,25,0,0,0,0,0,0
# console.terms-and-conditions-url: https://www.storj.io/terms-of-service/

# the default free-tier bandwidth usage limit
# console.usage-limits.bandwidth.free: 150.00 GB
# console.usage-limits.bandwidth.free: 25.00 GB

# the default paid-tier bandwidth usage limit
# console.usage-limits.bandwidth.paid: 100.00 TB
Expand All @@ -341,13 +341,13 @@ compensation.withheld-percents: 75,75,75,50,50,50,25,25,25,0,0,0,0,0,0
# console.usage-limits.project.paid: 3

# the default free-tier segment usage limit
# console.usage-limits.segment.free: 150000
# console.usage-limits.segment.free: 10000

# the default paid-tier segment usage limit
# console.usage-limits.segment.paid: 100000000

# the default free-tier storage usage limit
# console.usage-limits.storage.free: 150.00 GB
# console.usage-limits.storage.free: 25.00 GB

# the default paid-tier storage usage limit
# console.usage-limits.storage.paid: 25.00 TB
Expand Down
Expand Up @@ -44,26 +44,26 @@ const plans = ref<PricingPlanInfo[]>([
new PricingPlanInfo(
PricingPlanType.PRO,
'Pro Account',
'150 GB Free',
'25 GB Free',
'Only pay for what you need. $4/TB stored per month* $7/TB for bandwidth.',
'*Additional per-segment fee of $0.0000088 applies.',
null,
null,
'Add a credit card to activate your Pro Account.<br><br>Get 150GB free storage and bandwidth. Only pay for what you use beyond that.',
'Add a credit card to activate your Pro Account.<br><br>Get 25GB free storage and bandwidth. Only pay for what you use beyond that.',
'No charge today',
'150GB Free',
'25GB Free',
),
new PricingPlanInfo(
PricingPlanType.FREE,
'Free Account',
'Limited',
'Free usage up to 150GB storage and 150GB bandwidth per month.',
'Free usage up to 25GB storage and 25GB bandwidth per month.',
null,
null,
null,
'Start for free to try Storj and upgrade later.',
null,
'Limited 150',
'Limited 25',
),
]);
Expand Down
2 changes: 1 addition & 1 deletion web/satellite/src/views/registration/RegisterArea.vue
Expand Up @@ -49,7 +49,7 @@
>
<div class="register-area__input-area__container__title-area" @click.stop="toggleDropdown">
<div class="register-area__input-area__container__title-container">
<h1 class="register-area__input-area__container__title-area__title">Get 150 GB Free</h1>
<h1 class="register-area__input-area__container__title-area__title">Get 25 GB Free</h1>
</div>
<div class="register-area__input-area__expand">
<div class="register-area__input-area__info-button">
Expand Down

1 comment on commit 63533c6

@storjrobot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Storj Community Forum (official). There might be relevant details there:

https://forum.storj.io/t/update-proposal-for-storage-node-operators/21749/843

Please sign in to comment.