Merge pull request #228 from dod-ccpo/update-secret-key

Fix PDF uploading
This commit is contained in:
patricksmithdds 2018-08-29 11:13:46 -04:00 committed by GitHub
commit 10aff81b99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 7 deletions

View File

@ -1,4 +1,6 @@
from tempfile import NamedTemporaryFile
from uuid import uuid4 from uuid import uuid4
from libcloud.storage.types import Provider from libcloud.storage.types import Provider
from libcloud.storage.providers import get_driver from libcloud.storage.providers import get_driver
@ -26,11 +28,13 @@ class Uploader:
) )
object_name = uuid4().hex object_name = uuid4().hex
self.container.upload_object_via_stream( with NamedTemporaryFile() as tempfile:
iterator=fyle.stream.__iter__(), tempfile.write(fyle.stream.read())
object_name=object_name, self.container.upload_object(
extra={"acl": "private"}, file_path=tempfile.name,
) object_name=object_name,
extra={"acl": "private"},
)
return (fyle.filename, object_name) return (fyle.filename, object_name)
def download(self, path): def download(self, path):

View File

@ -24,7 +24,7 @@ spec:
fsGroup: 101 fsGroup: 101
containers: containers:
- name: atst - name: atst
image: registry.atat.codes:443/atst-prod:e38bc2f image: registry.atat.codes:443/atst-prod:0696894
resources: resources:
requests: requests:
memory: "2500Mi" memory: "2500Mi"
@ -74,7 +74,7 @@ spec:
secret: secret:
secretName: atst-config-ini secretName: atst-config-ini
items: items:
- key: atst-overrides.ini - key: override.ini
path: atst-overrides.ini path: atst-overrides.ini
mode: 0644 mode: 0644
- name: nginx-auth-tls - name: nginx-auth-tls

View File

@ -4,6 +4,9 @@
source "$(dirname "${0}")"/../script/include/global_header.inc.sh source "$(dirname "${0}")"/../script/include/global_header.inc.sh
# create upload directory for app
mkdir uploads | true
# Enable DB migration # Enable DB migration
MIGRATE_DB="true" MIGRATE_DB="true"