Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
** fix(README): missing version bump to 1.50 in the tweet command
* fix(backups-create): returns an error when the backup fails
* fix(dbng): error wrapping for destroy
* feat(cmd): add `router-multipart-upload` to enable/disable multipart upload on the application router
* chore(deps): update go-scalingo to add `AppsRouterEnableMultipartUpload` and `AppsRouterDisableMultipartUpload`

## 1.50.0

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ COMMANDS:
force-https Enable/Disable automatic redirection of traffic to HTTPS for your application
sticky-session Enable/Disable sticky sessions for your application
router-logs Enable/disable router logs for your application
router-multipart-upload Enable/disable multipart upload on the router for your application
set-canonical-domain Set a canonical domain.
unset-canonical-domain Unset a canonical domain.
db-tunnel Create an encrypted connection to access your database
Expand Down
22 changes: 22 additions & 0 deletions apps/routing_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,28 @@ func RouterLogs(ctx context.Context, appName string, enable bool) error {
return nil
}

func RouterMultipartUpload(ctx context.Context, appName string, enable bool) error {
c, err := config.ScalingoClient(ctx)
if err != nil {
return errors.Wrapf(ctx, err, "get Scalingo client")
}

var action string
if enable {
action = "enable"
_, err = c.AppsRouterEnableMultipartUpload(ctx, appName)
} else {
action = "disable"
_, err = c.AppsRouterDisableMultipartUpload(ctx, appName)
}
if err != nil {
return errors.Wrapf(ctx, err, "configure router-multipart-upload feature")
}

io.Statusf("Router multipart upload has been %sd on %s\n", action, appName)
return nil
}

func AppFirewallRulesList(ctx context.Context, appName string) error {
c, err := config.ScalingoClient(ctx)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions cmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ var (
&forceHTTPSCommand,
&stickySessionCommand,
&routerLogsCommand,
&routerMultipartUploadCommand,
&setCanonicalDomainCommand,
&unsetCanonicalDomainCommand,

Expand Down
36 changes: 36 additions & 0 deletions cmd/routing_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,42 @@ var (
},
}

routerMultipartUploadCommand = cli.Command{
Name: "router-multipart-upload",
Category: "App Management",
Usage: "Enable/disable multipart upload on the router for your application",
Flags: []cli.Flag{
&appFlag,
&cli.BoolFlag{Name: "enable", Aliases: []string{"e"}, Usage: "Enable router multipart upload (default)"},
&cli.BoolFlag{Name: "disable", Aliases: []string{"d"}, Usage: "Disable router multipart upload"},
},
Description: CommandDescription{
Description: "When disabled, the router refuses all requests with a multipart body (403 Forbidden)",
Examples: []string{"scalingo --app my-app router-multipart-upload --disable"},
}.Render(),

Action: func(ctx context.Context, c *cli.Command) error {
currentApp := detect.CurrentApp(ctx, c)
if c.Args().Len() > 1 {
_ = cli.ShowCommandHelp(ctx, c, "router-multipart-upload")
return nil
}

utils.CheckForConsent(ctx, currentApp, utils.ConsentTypeContainers)

enable := !c.IsSet("disable")

err := apps.RouterMultipartUpload(ctx, currentApp, enable)
if err != nil {
errorQuit(ctx, err)
}
return nil
},
ShellComplete: func(_ context.Context, c *cli.Command) {
_ = autocomplete.CmdFlagsAutoComplete(c, "router-multipart-upload")
},
}

appFirewallRulesCommand = cli.Command{
Name: "app-firewall-rules", //nolint: goconst
Category: "App Management",
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.26.8

require (
charm.land/huh/v2 v2.0.3
github.com/Scalingo/go-scalingo/v11 v11.8.0
github.com/Scalingo/go-scalingo/v11 v11.8.1
github.com/Scalingo/go-utils/errors/v3 v3.2.1
github.com/Scalingo/go-utils/logger v1.13.0
github.com/Scalingo/go-utils/pagination v1.2.0
Expand All @@ -27,7 +27,7 @@ require (
go.uber.org/mock v0.6.0
golang.org/x/crypto v0.57.0
golang.org/x/term v0.46.0
golang.org/x/text v0.42.0
golang.org/x/text v0.43.0
)

require (
Expand Down Expand Up @@ -81,7 +81,7 @@ require (
github.com/xo/terminfo v1.2.0 // indirect
go.yaml.in/yaml/v3 v3.0.5 // indirect
golang.org/x/net v0.58.0 // indirect
golang.org/x/sync v0.23.0 // indirect
golang.org/x/sync v0.24.0 // indirect
golang.org/x/sys v0.48.0 // indirect
gopkg.in/errgo.v1 v1.0.1 // indirect
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERo
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/ProtonMail/go-crypto v1.5.2 h1:cucYnvqcY7UOXVD//mSyjeaPY0SSN3v5cDkYPxumINk=
github.com/ProtonMail/go-crypto v1.5.2/go.mod h1:/RaSu30DaKO4RY+XdV/ACcCcZkGr7AhUIduq5sjzzCo=
github.com/Scalingo/go-scalingo/v11 v11.8.0 h1:dzekN/F5izfoUx1kfB/4+IYF76tu9ULXNXQFw+3bAak=
github.com/Scalingo/go-scalingo/v11 v11.8.0/go.mod h1:CFTjdLuGJyCg0b1WShTbKC1cjbczj5kpGT55pUXZj0k=
github.com/Scalingo/go-scalingo/v11 v11.8.1 h1:mukF8XVwIJKNzrzNRWaEUqXbRTM4TYsmEpwehLNYV9g=
github.com/Scalingo/go-scalingo/v11 v11.8.1/go.mod h1:CFTjdLuGJyCg0b1WShTbKC1cjbczj5kpGT55pUXZj0k=
github.com/Scalingo/go-utils/errors/v3 v3.2.1 h1:2w3qUz6MxJa3aqx/biz2G3JquSKsFnfz/E7wrNf/LPc=
github.com/Scalingo/go-utils/errors/v3 v3.2.1/go.mod h1:jVVNoOdYFjuNkR/BeEZWNWJVvu4jmyLY4udlsQQyBss=
github.com/Scalingo/go-utils/logger v1.13.0 h1:3dW2hDo50Oqvdoi1iEFXX0GRRKLvjJLeV68ooObHLmY=
Expand Down Expand Up @@ -197,8 +197,8 @@ golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f/go.mod h1:J1xhfL/vlindoeF/aI
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To=
golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU=
golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk=
golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA=
golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand All @@ -212,8 +212,8 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn
golang.org/x/term v0.46.0 h1:3+OXuTbaKDgwk8jTi3aSLHRlmWqHEUDUtxnbFigO4YE=
golang.org/x/term v0.46.0/go.mod h1:+K02xbkittuwc0Am4abfA3Fc+XRGXkvBXNO88NCXPoc=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI=
golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E=
golang.org/x/text v0.43.0 h1:1QivrlhwAsnMOcqgOdl9my7s9OyZl8O5/UGUTJVXoWc=
golang.org/x/text v0.43.0/go.mod h1:hbSIYA/amXcRXTFSZqh8tWHEoqRvvbKPJ2uz/KU+a+s=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
4 changes: 4 additions & 0 deletions vendor/github.com/Scalingo/go-scalingo/v11/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/github.com/Scalingo/go-scalingo/v11/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 40 additions & 23 deletions vendor/github.com/Scalingo/go-scalingo/v11/apps.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/Scalingo/go-scalingo/v11/mocks_sig.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/Scalingo/go-scalingo/v11/version.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ github.com/ProtonMail/go-crypto/openpgp/s2k
github.com/ProtonMail/go-crypto/openpgp/slhdsa
github.com/ProtonMail/go-crypto/openpgp/x25519
github.com/ProtonMail/go-crypto/openpgp/x448
# github.com/Scalingo/go-scalingo/v11 v11.8.0
# github.com/Scalingo/go-scalingo/v11 v11.8.1
## explicit; go 1.26.8
github.com/Scalingo/go-scalingo/v11
github.com/Scalingo/go-scalingo/v11/billing
Expand Down Expand Up @@ -395,7 +395,7 @@ golang.org/x/crypto/ssh/knownhosts
golang.org/x/net/context
golang.org/x/net/internal/socks
golang.org/x/net/proxy
# golang.org/x/sync v0.23.0
# golang.org/x/sync v0.24.0
## explicit; go 1.26.0
golang.org/x/sync/errgroup
# golang.org/x/sys v0.48.0
Expand All @@ -408,7 +408,7 @@ golang.org/x/sys/windows
# golang.org/x/term v0.46.0
## explicit; go 1.26.0
golang.org/x/term
# golang.org/x/text v0.42.0
# golang.org/x/text v0.43.0
## explicit; go 1.26.0
golang.org/x/text/cases
golang.org/x/text/internal
Expand Down