Browse Source

Merge pull request #2214 from iwsh/update-for-using-cloudstorage

Update for using cloudstorage
pull/2217/head
Hiroki Nakayama 2 years ago
committed by GitHub
parent
commit
05e12f8efb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions
  1. 1
      backend/config/settings/aws.py
  2. 7
      frontend/domain/models/example/example.ts

1
backend/config/settings/aws.py

@ -8,6 +8,7 @@ AWS_ACCESS_KEY_ID = env("AWS_ACCESS_KEY_ID")
AWS_SECRET_ACCESS_KEY = env("AWS_SECRET_ACCESS_KEY")
AWS_S3_REGION_NAME = env("REGION_NAME", "us-west-1")
AWS_STORAGE_BUCKET_NAME = env("BUCKET_NAME", "doccano")
AWS_S3_ENDPOINT_URL = env("AWS_S3_ENDPOINT_URL", None)
AWS_DEFAULT_ACL = "private"
AWS_BUCKET_ACL = "private"
AWS_AUTO_CREATE_BUCKET = True

7
frontend/domain/models/example/example.ts

@ -11,8 +11,11 @@ export class ExampleItem {
) {}
get url() {
const l = this.fileUrl.indexOf('media/')
return this.fileUrl.slice(l - 1)
const l = this.fileUrl.indexOf('/media/')
if (l < 0) {
return this.fileUrl
}
return this.fileUrl.slice(l)
}
}

Loading…
Cancel
Save