Skip to content

Commit

Permalink
Add readonly mode
Browse files Browse the repository at this point in the history
  • Loading branch information
maschwenk committed Nov 10, 2023
1 parent 81e0b60 commit 664159f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const schema = Type.Object(
BODY_LIMIT: Type.Optional(Type.Number({ default: 104857600 })),
STORAGE_PATH: Type.Optional(Type.String()),
STORAGE_PATH_USE_TMP_FOLDER: Type.Optional(Type.Boolean({ default: true })),
READ_ONLY_MODE: Type.Optional(Type.Boolean({ default: false })),
// AWS_ env vars are used as aws-sdk defaults
AWS_ACCESS_KEY_ID: Type.Optional(Type.String()),
AWS_SECRET_ACCESS_KEY: Type.Optional(Type.String()),
Expand Down
4 changes: 3 additions & 1 deletion src/plugins/remote-cache/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ async function turboRemoteCache(

i.route(getArtifact)
i.route(headArtifact)
i.route(putArtifact)
if (!instance.config.READ_ONLY_MODE) {
i.route(putArtifact);
}
i.route(artifactsEvents)
},
{ prefix: `/${apiVersion}` },
Expand Down

0 comments on commit 664159f

Please sign in to comment.