Skip to content

Commit

Permalink
asd
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarrosop committed Aug 21, 2023
1 parent 3e16cc5 commit f821966
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions build/clamav/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh

set -euo pipefail

mkdir -p /clamav

Expand Down
2 changes: 1 addition & 1 deletion build/dev/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ services:
S3_ROOT_FOLDER: "f215cf48-7458-4596-9aa5-2159fc6a3caf"
POSTGRES_MIGRATIONS: 1
POSTGRES_MIGRATIONS_SOURCE: ${HASURA_GRAPHQL_DATABASE_URL:-postgres://postgres:hejsan@postgres:5432/postgres?sslmode=disable}
USE_CLAMAV: tcp://clamd:3310
USE_CLAMAV_SERVER: tcp://clamd:3310
command: serve

clamd:
Expand Down
8 changes: 4 additions & 4 deletions cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const (
fastlyKeyFlag = "fastly-key"
corsAllowOriginsFlag = "cors-allow-origins"
corsAllowCredentialsFlag = "cors-allow-credentials" //nolint: gosec
useClamavFlag = "use-clamav"
useClamavServerFlag = "use-clamav-server"
)

func ginLogger(logger *logrus.Logger) gin.HandlerFunc {
Expand Down Expand Up @@ -92,7 +92,7 @@ func getGin(
gin.SetMode(gin.ReleaseMode)
}

av, err := getAv(viper.GetString(useClamavFlag))
av, err := getAv(viper.GetString(useClamavServerFlag))
if err != nil {
return nil, fmt.Errorf("problem trying to get av: %w", err)
}
Expand Down Expand Up @@ -238,7 +238,7 @@ func init() {
addStringArrayFlag(serveCmd.Flags(), corsAllowOriginsFlag, []string{"*"}, "CORS allow origins")
addBoolFlag(serveCmd.Flags(), corsAllowCredentialsFlag, false, "CORS allow credentials")
addStringFlag(
serveCmd.Flags(), useClamavFlag, "", "Use ClamAV to scan files. Example: tcp://clamavd:3310",
serveCmd.Flags(), useClamavServerFlag, "", "Use ClamAV to scan files. Example: tcp://clamavd:3310",
)
}
}
Expand Down Expand Up @@ -274,7 +274,7 @@ var serveCmd = &cobra.Command{
s3RegionFlag: viper.GetString(s3RegionFlag),
s3BucketFlag: viper.GetString(s3BucketFlag),
s3RootFolderFlag: viper.GetString(s3RootFolderFlag),
useClamavFlag: viper.GetString(useClamavFlag),
useClamavServerFlag: viper.GetString(useClamavServerFlag),
},
).Debug("parameters")

Expand Down

0 comments on commit f821966

Please sign in to comment.