diff --git a/Dockerfile b/Dockerfile index b58873a..67a58c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,6 +30,6 @@ COPY --from=go-builder /app/clipper /bin/clipper COPY --from=go-builder /root/go/bin/migrate /bin/migrate COPY --from=node-builder /app/build /app/assets -ENV ASSETS_HTTP_ROOT "/app/assets" +ENV CLIPPER_ASSETS_HTTP_ROOT "/app/assets" ENTRYPOINT ["/bin/clipper"] diff --git a/backend/.env.example b/backend/.env.example index 08ba090..b24f44c 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -1,33 +1,33 @@ -ENV=development # or production +CLIPPER_ENV=development # or production -BIND_ADDR=localhost:8888 +CLIPPER_BIND_ADDR=localhost:8888 # PostgreSQL connection string. -DATABASE_URL= +CLIPPER_DATABASE_URL= # Optional. If set, files in this location will be served over HTTP at /. # Mostly useful for deployment. -ASSETS_HTTP_ROOT= +CLIPPER_ASSETS_HTTP_ROOT= # Set the store type - either s3 or filesystem. Defaults to filesystem. The S3 # store is recommended for production usage. # # NOTE: Enabling the file system store will disable serving assets over HTTP. -FILE_STORE=filesystem +CLIPPER_FILE_STORE=filesystem # The base URL used for serving file store assets. # Example: http://localhost:8888 -FILE_STORE_HTTP_BASE_URL= +CLIPPER_FILE_STORE_HTTP_BASE_URL= # The root directory for the file system store. -FILE_STORE_HTTP_ROOT=data/ +CLIPPER_FILE_STORE_HTTP_ROOT=data/ # AWS credentials, required for the S3 store. AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_REGION= -S3_BUCKET= +CLIPPER_S3_BUCKET= # The number of concurrent FFMPEG processes that will be permitted. # Defaults to runtime.NumCPU(): -FFMPEG_WORKER_POOL_SIZE= +CLIPPER_FFMPEG_WORKER_POOL_SIZE= diff --git a/backend/config/config.go b/backend/config/config.go index ded49fa..9e7362f 100644 --- a/backend/config/config.go +++ b/backend/config/config.go @@ -43,8 +43,7 @@ type Config struct { FFmpegWorkerPoolSize int } -// TODO: update deployment and add prefix. -var Prefix = "" +const Prefix = "CLIPPER_" func envPrefix(k string) string { return Prefix + k } func getenvPrefix(k string) string { return os.Getenv(Prefix + k) } diff --git a/backend/config/config_test.go b/backend/config/config_test.go index c0dbd5e..0b6158f 100644 --- a/backend/config/config_test.go +++ b/backend/config/config_test.go @@ -12,10 +12,6 @@ import ( "github.com/stretchr/testify/require" ) -func init() { - config.Prefix = "CLIPPER_" -} - type env map[string]string // clearenv clears prefixed keys from the environment. Currently it does not