diff --git a/deployment.yaml b/deployment.yaml index 4dab086..1adb24b 100644 --- a/deployment.yaml +++ b/deployment.yaml @@ -24,23 +24,11 @@ spec: env: - name: OIDC_USERS_NAMESPACE value: "default" - # Google test key - - name: RECAPTCHA_PUBLIC_KEY - value: 6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI - - name: RECAPTCHA_PRIVATE_KEY - value: 6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe - - name: INVENTORY_ASSETS_BASE_URL - value: "https://minio.codemowers.eu:9000" - name: MONGO_URI valueFrom: secretKeyRef: name: mongodb-application-readwrite key: connectionString.standard - - name: AWS_ENDPOINT_URL - valueFrom: - secretKeyRef: - name: miniobucket-inventory-app-owner-secrets - key: MINIO_URI - name: ENVIRONMENT_TYPE value: "DEV" - name: MY_POD_NAME diff --git a/inventory-app/const.py b/inventory-app/const.py index 1b91cbf..e67d2cb 100644 --- a/inventory-app/const.py +++ b/inventory-app/const.py @@ -14,7 +14,6 @@ ENVIRONMENT_TYPE = getenv_in("ENVIRONMENT_TYPE", "DEV", "PROD") AWS_S3_ENDPOINT_URL = os.environ["AWS_S3_ENDPOINT_URL"] BUCKET_NAME = os.environ["BUCKET_NAME"] -INVENTORY_ASSETS_BASE_URL = os.environ["INVENTORY_ASSETS_BASE_URL"] MONGO_URI = os.environ["MONGO_URI"] MACADDRESS_OUTLINK_BASEURL = os.environ["MACADDRESS_OUTLINK_BASEURL"] COOKIES_SECRET_KEY = os.environ["COOKIES_SECRET_KEY"] # session storage, random chars diff --git a/inventory-app/inventory.py b/inventory-app/inventory.py index c46a65a..bca54e3 100644 --- a/inventory-app/inventory.py +++ b/inventory-app/inventory.py @@ -260,11 +260,12 @@ def is_image_ext(filename): return '.' in filename and \ filename.rsplit('.', 1)[1].lower() in ["jpg", "jpeg"] -def get_bucket(): +# AWS S3 credentials / env is automagically imported https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html#using-environment-variables +# AWS_ACCESS_KEY_ID, AWS_DEFAULT_REGION, etc +def get_bucket(): #TODO return boto3.client('s3', endpoint_url=const.AWS_S3_ENDPOINT_URL, - config=boto3.session.Config(signature_version='s3v4'), - region_name='us-east-1') + config=boto3.session.Config(signature_version='s3v4')) @page_inventory.route("/inventory//upload-photo", methods=["POST"]) @login_required diff --git a/inventory-app/main.py b/inventory-app/main.py index d5d619a..51a1cb3 100755 --- a/inventory-app/main.py +++ b/inventory-app/main.py @@ -176,7 +176,7 @@ def do_before_request(): @app.context_processor def inject_context(): - return dict(devenv=devenv, inventory_assets_base_url=const.INVENTORY_ASSETS_BASE_URL) + return dict(devenv=devenv) def name_check(form, field): if field.data != field.data.strip(): diff --git a/minio.yml b/minio.yml deleted file mode 100644 index 508840a..0000000 --- a/minio.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -apiVersion: codemowers.cloud/v1beta1 -kind: MinioBucketClaim -metadata: - name: inventory-app -spec: - capacity: 1Gi - class: shared diff --git a/serviceaccount.yml b/serviceaccount.yml deleted file mode 100644 index cd63c8d..0000000 --- a/serviceaccount.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: oidc-gateway-madis -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: passmower -subjects: - - kind: ServiceAccount - name: oidc-gateway - namespace: hard2k1ll-72zn4 ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: oidc-gateway