From 19cb08b025307f5e7d1dd3b51cc23e108a52ff3b Mon Sep 17 00:00:00 2001 From: Moby von Briesen Date: Mon, 15 May 2023 16:18:34 -0400 Subject: [PATCH] web/satellite: add "public linksharing URL" * Update defaults for gateway credentials URL and linksharing URL to use storjsatelliteshare.io instead of storjshare.io * Add new config for "public linksharing URL" and set it to link.storjshare.io * Use "private" linksharing URL for actions within the object browser * Use "public" linksharing URL for sharing files externally Resolves https://github.com/storj/storj/issues/5805 Change-Id: I2c8fbd04141755b4751dcf4d054253a7ff8d6cf3 --- satellite/console/consoleweb/config.go | 1 + satellite/console/consoleweb/server.go | 6 ++++-- scripts/testdata/satellite-config.yaml.lock | 9 ++++++--- web/satellite/src/components/modals/ShareBucketModal.vue | 4 ++-- web/satellite/src/components/objects/UploadFile.vue | 9 ++++++++- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/satellite/console/consoleweb/config.go b/satellite/console/consoleweb/config.go index 7e1cf320a..153075775 100644 --- a/satellite/console/consoleweb/config.go +++ b/satellite/console/consoleweb/config.go @@ -29,6 +29,7 @@ type FrontendConfig struct { CouponCodeSignupUIEnabled bool `json:"couponCodeSignupUIEnabled"` FileBrowserFlowDisabled bool `json:"fileBrowserFlowDisabled"` LinksharingURL string `json:"linksharingURL"` + PublicLinksharingURL string `json:"publicLinksharingURL"` PathwayOverviewEnabled bool `json:"pathwayOverviewEnabled"` Captcha console.CaptchaConfig `json:"captcha"` AllProjectsDashboard bool `json:"allProjectsDashboard"` diff --git a/satellite/console/consoleweb/server.go b/satellite/console/consoleweb/server.go index 5c2ad5c0b..73a29532b 100644 --- a/satellite/console/consoleweb/server.go +++ b/satellite/console/consoleweb/server.go @@ -80,7 +80,7 @@ type Config struct { PartneredSatellites Satellites `help:"names and addresses of partnered satellites in JSON list format" default:"[{\"name\":\"US1\",\"address\":\"https://us1.storj.io\"},{\"name\":\"EU1\",\"address\":\"https://eu1.storj.io\"},{\"name\":\"AP1\",\"address\":\"https://ap1.storj.io\"}]"` GeneralRequestURL string `help:"url link to general request page" default:"https://supportdcs.storj.io/hc/en-us/requests/new?ticket_form_id=360000379291"` ProjectLimitsIncreaseRequestURL string `help:"url link to project limit increase request page" default:"https://supportdcs.storj.io/hc/en-us/requests/new?ticket_form_id=360000683212"` - GatewayCredentialsRequestURL string `help:"url link for gateway credentials requests" default:"https://auth.storjshare.io" devDefault:"http://localhost:8000"` + GatewayCredentialsRequestURL string `help:"url link for gateway credentials requests" default:"https://auth.storjsatelliteshare.io" devDefault:"http://localhost:8000"` IsBetaSatellite bool `help:"indicates if satellite is in beta" default:"false"` BetaSatelliteFeedbackURL string `help:"url link for for beta satellite feedback" default:""` BetaSatelliteSupportURL string `help:"url link for for beta satellite support" default:""` @@ -89,7 +89,8 @@ type Config struct { CouponCodeSignupUIEnabled bool `help:"indicates if user is allowed to add coupon codes to account from signup" default:"false"` FileBrowserFlowDisabled bool `help:"indicates if file browser flow is disabled" default:"false"` CSPEnabled bool `help:"indicates if Content Security Policy is enabled" devDefault:"false" releaseDefault:"true"` - LinksharingURL string `help:"url link for linksharing requests" default:"https://link.storjshare.io" devDefault:"http://localhost:8001"` + LinksharingURL string `help:"url link for linksharing requests within the application" default:"https://link.storjsatelliteshare.io" devDefault:"http://localhost:8001"` + PublicLinksharingURL string `help:"url link for linksharing requests for external sharing" default:"https://link.storjshare.io" devDefault:"http://localhost:8001"` PathwayOverviewEnabled bool `help:"indicates if the overview onboarding step should render with pathways" default:"true"` AllProjectsDashboard bool `help:"indicates if all projects dashboard should be used" default:"false"` GeneratedAPIEnabled bool `help:"indicates if generated console api should be used" default:"false"` @@ -523,6 +524,7 @@ func (server *Server) frontendConfigHandler(w http.ResponseWriter, r *http.Reque CouponCodeSignupUIEnabled: server.config.CouponCodeSignupUIEnabled, FileBrowserFlowDisabled: server.config.FileBrowserFlowDisabled, LinksharingURL: server.config.LinksharingURL, + PublicLinksharingURL: server.config.PublicLinksharingURL, PathwayOverviewEnabled: server.config.PathwayOverviewEnabled, DefaultPaidStorageLimit: server.config.UsageLimits.Storage.Paid, DefaultPaidBandwidthLimit: server.config.UsageLimits.Bandwidth.Paid, diff --git a/scripts/testdata/satellite-config.yaml.lock b/scripts/testdata/satellite-config.yaml.lock index a7e8b12e2..54ac75a27 100755 --- a/scripts/testdata/satellite-config.yaml.lock +++ b/scripts/testdata/satellite-config.yaml.lock @@ -254,7 +254,7 @@ compensation.withheld-percents: 75,75,75,50,50,50,25,25,25,0,0,0,0,0,0 # console.frame-ancestors: tardigrade.io storj.io # url link for gateway credentials requests -# console.gateway-credentials-request-url: https://auth.storjshare.io +# console.gateway-credentials-request-url: https://auth.storjsatelliteshare.io # url link to general request page # console.general-request-url: https://supportdcs.storj.io/hc/en-us/requests/new?ticket_form_id=360000379291 @@ -271,8 +271,8 @@ compensation.withheld-percents: 75,75,75,50,50,50,25,25,25,0,0,0,0,0,0 # url link to let us know page # console.let-us-know-url: https://storjlabs.atlassian.net/servicedesk/customer/portals -# url link for linksharing requests -# console.linksharing-url: https://link.storjshare.io +# url link for linksharing requests within the application +# console.linksharing-url: https://link.storjsatelliteshare.io # number of times user can try to login without penalty # console.login-attempts-without-penalty: 3 @@ -310,6 +310,9 @@ compensation.withheld-percents: 75,75,75,50,50,50,25,25,25,0,0,0,0,0,0 # url link to project limit increase request page # console.project-limits-increase-request-url: https://supportdcs.storj.io/hc/en-us/requests/new?ticket_form_id=360000683212 +# url link for linksharing requests for external sharing +# console.public-linksharing-url: https://link.storjshare.io + # number of events before the limit kicks in # console.rate-limit.burst: 5 diff --git a/web/satellite/src/components/modals/ShareBucketModal.vue b/web/satellite/src/components/modals/ShareBucketModal.vue index 6d2c22945..049f1c3c4 100644 --- a/web/satellite/src/components/modals/ShareBucketModal.vue +++ b/web/satellite/src/components/modals/ShareBucketModal.vue @@ -164,9 +164,9 @@ async function setShareLink(): Promise { path = encodeURIComponent(path.trim()); - const linksharingURL = configStore.state.config.linksharingURL; + const publicLinksharingURL = configStore.state.config.publicLinksharingURL; - link.value = `${linksharingURL}/${credentials.accessKeyId}/${path}`; + link.value = `${publicLinksharingURL}/${credentials.accessKeyId}/${path}`; } catch (error) { await notify.error(error.message, AnalyticsErrorEventSource.SHARE_BUCKET_MODAL); } finally { diff --git a/web/satellite/src/components/objects/UploadFile.vue b/web/satellite/src/components/objects/UploadFile.vue index 9c86c0f04..2ea7a0ac7 100644 --- a/web/satellite/src/components/objects/UploadFile.vue +++ b/web/satellite/src/components/objects/UploadFile.vue @@ -93,6 +93,13 @@ const linksharingURL = computed((): string => { return configStore.state.config.linksharingURL; }); +/** + * Returns public linksharing URL from store. + */ +const publicLinksharingURL = computed((): string => { + return configStore.state.config.publicLinksharingURL; +}); + /** * Generates a URL for an object map. */ @@ -128,7 +135,7 @@ async function generateShareLinkUrl(path: string): Promise { await analytics.eventTriggered(AnalyticsEvent.LINK_SHARED); - return `${linksharingURL.value}/${credentials.accessKeyId}/${path}`; + return `${publicLinksharingURL.value}/${credentials.accessKeyId}/${path}`; } catch (error) { await notify.error(error.message, AnalyticsErrorEventSource.UPLOAD_FILE_VIEW);