WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions backend/src/services/s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import { S3Client } from "@aws-sdk/client-s3";
import dotenv from "dotenv";
dotenv.config();

export const s3 = new S3Client({
// replace with secrets
region: process.env.S3_BUCKET,
endpoint: process.env.S3_ENDPOINT,
credentials: {
accessKeyId: process.env.S3_ACCESS_KEY,
secretAccessKey: process.env.S3_SECRET_KEY,
},
});
const s3Creds = {
// replace with secrets
region: process.env.S3_BUCKET,
endpoint: process.env.S3_ENDPOINT,
credentials: {
accessKeyId: process.env.S3_ACCESS_KEY,
secretAccessKey: process.env.S3_SECRET_KEY,
},
};

export const s3 = new S3Client(s3Creds);
8 changes: 4 additions & 4 deletions deploy/resources/deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
spec:
selector:
matchLabels:
run: backend-app
app: backend-app
template:
metadata:
labels:
Expand All @@ -26,11 +26,11 @@ spec:
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend-app
app: frontend-app
spec:
selector:
matchLabels:
run: frontend-app
app: frontend-app
template:
metadata:
labels:
Expand All @@ -44,7 +44,7 @@ spec:
imagePullPolicy: Always
env:
- name: INTERNAL_TODO_API
value: "http://backend-app.default.svc.cluster.local/api/v1/upcloud"
value: "http://backend-app-cluster-ip.default.svc.cluster.local"
envFrom:
- secretRef:
name: dotfile-secret
Expand Down
2 changes: 1 addition & 1 deletion deploy/resources/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ data:
S3_ENDPOINT: ""
S3_ACCESS_KEY: ""
S3_SECRET_KEY: ""
S3_REGION: ""
S3_REGION: ""
6 changes: 3 additions & 3 deletions deploy/resources/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ kind: Service
metadata:
labels:
app: backend-app
name: backend-app-loadbalancer
name: backend-app-cluster-ip
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
run: backend-app
app: backend-app
type: ClusterIP
# frontend app
---
Expand All @@ -28,5 +28,5 @@ spec:
protocol: TCP
targetPort: 3000
selector:
run: frontend-app
app: frontend-app
type: LoadBalancer