test ract
This commit is contained in:
@@ -70,6 +70,11 @@ async def openapi(username: str = Depends(_verify_docs)):
|
||||
return JSONResponse(app.openapi())
|
||||
|
||||
|
||||
@app.get("/health", include_in_schema=False)
|
||||
async def health():
|
||||
return {"ok": True}
|
||||
|
||||
|
||||
app.include_router(public_router, prefix="/news", tags=["public"])
|
||||
app.include_router(auth_router, prefix="/admin", tags=["admin-auth"])
|
||||
app.include_router(articles_router, prefix="/admin/articles", tags=["admin-articles"])
|
||||
|
||||
@@ -33,16 +33,16 @@ def ensure_bucket(client: Minio):
|
||||
try:
|
||||
if not client.bucket_exists(MINIO_BUCKET):
|
||||
client.make_bucket(MINIO_BUCKET)
|
||||
policy = f"""{{
|
||||
"Version":"2012-10-17",
|
||||
"Statement":[{{
|
||||
"Effect":"Allow",
|
||||
"Principal":"*",
|
||||
"Action":["s3:GetObject"],
|
||||
"Resource":["arn:aws:s3:::{MINIO_BUCKET}/*"]
|
||||
}}]
|
||||
}}"""
|
||||
client.set_bucket_policy(MINIO_BUCKET, policy)
|
||||
policy = f"""{{
|
||||
"Version":"2012-10-17",
|
||||
"Statement":[{{
|
||||
"Effect":"Allow",
|
||||
"Principal":"*",
|
||||
"Action":["s3:GetObject"],
|
||||
"Resource":["arn:aws:s3:::{MINIO_BUCKET}/*"]
|
||||
}}]
|
||||
}}"""
|
||||
client.set_bucket_policy(MINIO_BUCKET, policy)
|
||||
except S3Error:
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user