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: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,5 @@ NODE_VERSION=22
POSTGRES_VERSION=14
POSTGRES_USER=postgres

MIGRATE_BASE_IMAGE=flyway/flyway:10.9.1

MINIO_GATEWAY_PORT=9000
MINIO_CONSOLE_PORT=9001
5 changes: 0 additions & 5 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ require (
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/google/uuid v1.6.0
github.com/hashicorp/go-version v1.7.0
github.com/jackc/pgtype v1.14.3
github.com/jackc/pgx/v5 v5.7.1
github.com/jmoiron/sqlx v1.4.0
github.com/labstack/echo-jwt/v4 v4.2.0
github.com/labstack/echo/v4 v4.12.0
github.com/lib/pq v1.10.9
github.com/stretchr/testify v1.9.0
github.com/tidwall/btree v1.7.0
github.com/xeipuuv/gojsonschema v1.2.0
Expand Down Expand Up @@ -51,10 +48,8 @@ require (
github.com/aws/smithy-go v1.20.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/pgx/v4 v4.18.3 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/labstack/gommon v0.4.2 // indirect
Expand Down
192 changes: 0 additions & 192 deletions api/go.sum

Large diffs are not rendered by default.

20 changes: 3 additions & 17 deletions api/internal/cloud/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,32 +59,19 @@ func cleanFilepath(rawPath string) (string, error) {
}

func (s *S3Blob) NewReader(rawPath, bucketName string) (io.ReadCloser, error) {
path, err := cleanFilepath(rawPath)
if err != nil {
return nil, err
}
key := strings.TrimPrefix(s.cfg.bucketPrefix+strings.TrimPrefix(path, s.cfg.routePrefix), "/")
if bucketName == "" {
bucketName = s.cfg.bucketName
}
output, err := s.GetObject(context.Background(), &s3.GetObjectInput{Bucket: aws.String(bucketName), Key: aws.String(key)})
if err != nil {
return nil, err
}
return output.Body, nil
return s.NewReaderContext(context.Background(), rawPath, bucketName)
}

func (s *S3Blob) NewReaderContext(ctx context.Context, rawPath, bucketName string) (io.ReadCloser, error) {
path, err := cleanFilepath(rawPath)
if err != nil {
return nil, err
}
key := aws.String(s.cfg.bucketPrefix + strings.TrimPrefix(path, s.cfg.routePrefix))
key := strings.TrimPrefix(s.cfg.bucketPrefix+strings.TrimPrefix(path, s.cfg.routePrefix), "/")
if bucketName == "" {
bucketName = s.cfg.bucketName
}

output, err := s.GetObject(ctx, &s3.GetObjectInput{Bucket: aws.String(bucketName), Key: key})
output, err := s.GetObject(ctx, &s3.GetObjectInput{Bucket: aws.String(bucketName), Key: aws.String(key)})
if err != nil {
return nil, err
}
Expand All @@ -100,7 +87,6 @@ func (s *S3Blob) UploadContext(ctx context.Context, r io.Reader, rawPath, bucket
if bucketName == "" {
bucketName = s.cfg.bucketName
}

_, err = s.Upload(ctx, &s3.PutObjectInput{
Bucket: aws.String(bucketName),
Key: key,
Expand Down
25 changes: 13 additions & 12 deletions api/internal/config/server.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package config

type ServerConfig struct {
AllowOrigins []string `env:"ALLOWED_ORIGINS"`
ApplicationKey string `env:"APPLICATION_KEY"`
AuthDisabled bool `env:"AUTH_DISABLED"`
AuthJWTMocked bool `env:"AUTH_JWT_MOCKED"`
AuthAllowEmailSuffixes []string `env:"AUTH_ALLOW_EMAIL_SUFFIXES"`
AuthPublicKey string `env:"AUTH_PUBLIC_KEY"`
AuthSigningMethod string `env:"AUTH_SIGNING_METHOD"`
Debug bool `env:"DEBUG"`
RequestLoggerEnabled bool `env:"REQUEST_LOGGER_ENABLED"`
RoutePrefix string `env:"ROUTE_PREFIX"`
ServerBaseUrl string `env:"SERVER_BASE_URL"`
AvailableTimezones []string
AllowOrigins []string `env:"ALLOWED_ORIGINS"`
ApplicationKey string `env:"APPLICATION_KEY"`
AuthDisabled bool `env:"AUTH_DISABLED"`
AuthJWTMocked bool `env:"AUTH_JWT_MOCKED"`
AuthAllowEmailSuffixes []string `env:"AUTH_ALLOW_EMAIL_SUFFIXES"`
AuthPublicKey string `env:"AUTH_PUBLIC_KEY"`
AuthSigningMethod string `env:"AUTH_SIGNING_METHOD"`
Debug bool `env:"DEBUG"`
ReportDownloadJobMocked bool `env:"REPORT_DOWNLOAD_JOB_MOCKED"`
RequestLoggerEnabled bool `env:"REQUEST_LOGGER_ENABLED"`
RoutePrefix string `env:"ROUTE_PREFIX"`
ServerBaseUrl string `env:"SERVER_BASE_URL"`
AvailableTimezones []string
}
44 changes: 22 additions & 22 deletions api/internal/db/batch.go

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

Loading
Loading