fix: builds for non 64 bit linux arch

The scoutfs backend is only supported on 64bit linux.  This corrects
the build constraints to only supported linux arch, and prevents the
incompatible import for unspported arch.

We also need to adjust the body limit setting on 32 bit since this
is an int, and our default limit will overfow on 32 bit.
This commit is contained in:
Ben McClelland
2023-09-10 20:49:56 -07:00
parent f90562fea2
commit 145c2dd4e3
5 changed files with 56 additions and 37 deletions
+9 -1
View File
@@ -20,6 +20,7 @@ import (
"fmt"
"log"
"os"
"strconv"
"github.com/gofiber/fiber/v2"
"github.com/urfave/cli/v2"
@@ -193,10 +194,17 @@ func initFlags() []cli.Flag {
}
func runGateway(ctx *cli.Context, be backend.Backend, s auth.Storer) error {
// int32 max for 32 bit arch
blimit := int64(2*1024*1024*1024 - 1)
if strconv.IntSize > 32 {
// 5GB max for 64 bit arch
blimit = int64(5 * 1024 * 1024 * 1024)
}
app := fiber.New(fiber.Config{
AppName: "versitygw",
ServerHeader: "VERSITYGW",
BodyLimit: 5 * 1024 * 1024 * 1024,
BodyLimit: int(blimit),
})
var opts []s3api.Option