Linting.
This commit is contained in:
parent
8655d73248
commit
97bb1e209d
|
@ -13,8 +13,8 @@ const PUBLIC_READ_POLICY = {
|
|||
Principal: "*",
|
||||
Action: "s3:GetObject",
|
||||
Resource: `arn:aws:s3:::${APP_BUCKET}/*`,
|
||||
}
|
||||
]
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
async function getCouchSession() {
|
||||
|
@ -25,7 +25,7 @@ async function getCouchSession() {
|
|||
json: {
|
||||
username: env.COUCH_DB_USERNAME,
|
||||
password: env.COUCH_DB_PASSWORD,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
const cookie = session.headers["set-cookie"][0]
|
||||
|
@ -50,19 +50,25 @@ async function getMinioSession() {
|
|||
})
|
||||
// make sure the bucket exists
|
||||
try {
|
||||
await objClient.headBucket({
|
||||
Bucket: APP_BUCKET
|
||||
}).promise()
|
||||
await objClient.putBucketPolicy({
|
||||
await objClient
|
||||
.headBucket({
|
||||
Bucket: APP_BUCKET,
|
||||
})
|
||||
.promise()
|
||||
await objClient
|
||||
.putBucketPolicy({
|
||||
Bucket: APP_BUCKET,
|
||||
Policy: JSON.stringify(PUBLIC_READ_POLICY),
|
||||
}).promise()
|
||||
})
|
||||
.promise()
|
||||
} catch (err) {
|
||||
// bucket doesn't exist create it
|
||||
if (err.statusCode === 404) {
|
||||
await objClient.createBucket({
|
||||
await objClient
|
||||
.createBucket({
|
||||
Bucket: APP_BUCKET,
|
||||
}).promise()
|
||||
})
|
||||
.promise()
|
||||
} else {
|
||||
throw err
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ const checkKey = require("../../middleware/check-key")
|
|||
|
||||
const router = Router()
|
||||
|
||||
router
|
||||
.post("/api/deploy", checkKey, controller.deploy)
|
||||
router.post("/api/deploy", checkKey, controller.deploy)
|
||||
|
||||
module.exports = router
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
const deployRoutes = require("./deploy")
|
||||
|
||||
exports.routes = [
|
||||
deployRoutes,
|
||||
]
|
||||
exports.routes = [deployRoutes]
|
||||
|
|
Loading…
Reference in New Issue