Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nshm 9 set up environment #66

Merged
merged 322 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
322 commits
Select commit Hold shift + click to select a range
f5f6d4e
Merge remote-tracking branch 'origin/NSHM-54-add-an-item-into-favorli…
MrPhotato Oct 11, 2024
09c1099
Fix: Target directory
MrPhotato Oct 11, 2024
b1da7af
Feat: Add support for Package
MrPhotato Oct 11, 2024
a78f84f
feat: add a new endpoint for frontend to get user info directly by Pa…
JYForever0114 Oct 11, 2024
b0d9479
feat: change JWT token secretKey to static
JYForever0114 Oct 11, 2024
a611256
feat: use more user info to generate JWT token
JYForever0114 Oct 11, 2024
5e28b91
chore: merge branch 'main' into NSHM-54-add-an-item-into-favorlist
mrcaidev Oct 12, 2024
1a97905
Merge remote-tracking branch 'origin/NSHM-110-Comprehensive-account-t…
JYForever0114 Oct 12, 2024
2ef4af8
Merge remote-tracking branch 'refs/remotes/origin/NSHM-110-Comprehens…
MrPhotato Oct 12, 2024
2eaf30f
merge from account
MrPhotato Oct 12, 2024
886a49f
Feat: support static token secret
MrPhotato Oct 12, 2024
67eb2dd
test: WishlistControllerTest
MrPhotato Oct 12, 2024
11d2293
test: WishlistServiceImplTestTest
MrPhotato Oct 12, 2024
78438e9
fix: previous merge skips the add to wishlist button
mrcaidev Oct 12, 2024
9b907bb
feat: Add Delete Like and get Item Like Info
MrPhotato Oct 13, 2024
d3424c8
test: Delete Like test and get Like Info test
MrPhotato Oct 14, 2024
8b0a1ee
Nshm 111 ci integration and test (#34)
MrPhotato Oct 14, 2024
6226933
Nshm 111 ci integration and test (#34)
MrPhotato Oct 14, 2024
d07479b
fix: paras in api
MrPhotato Oct 15, 2024
c982542
Merge remote-tracking branch 'origin/NSHM-87-See-most-recent-want-tim…
MrPhotato Oct 15, 2024
0e3554a
Merge branch 'refs/heads/NSHM-54-add-an-item-into-favorlist' into NSH…
MrPhotato Oct 15, 2024
fd13687
fix: paras in api
MrPhotato Oct 15, 2024
4681cb6
fix: check item like info no updated param
MrPhotato Oct 15, 2024
932a3c7
Merge branch 'refs/heads/NSHM-54-add-an-item-into-favorlist' into NSH…
MrPhotato Oct 15, 2024
404685e
Test: CI test
MrPhotato Oct 16, 2024
8e9ed18
Test: Disable checkstyle
MrPhotato Oct 16, 2024
8c5ab72
Fix: CI read secrets
MrPhotato Oct 16, 2024
c0e5537
Fix: CI read secrets
MrPhotato Oct 16, 2024
178ac7e
Fix: Try to read env
MrPhotato Oct 16, 2024
31d5905
Fix: Try to read env
MrPhotato Oct 16, 2024
df51913
Fix: Try to read env
MrPhotato Oct 16, 2024
81d7019
Fix: Try to read env
MrPhotato Oct 16, 2024
2169491
Fix: Try to read env
MrPhotato Oct 16, 2024
68a2715
Fix: Try to read env
MrPhotato Oct 16, 2024
032471a
chore: solve confict merge from origin/NSHM-111-CI-Integration-and-Test
Oct 19, 2024
fe0ef47
test: ci-wishlist-service
Oct 19, 2024
748a605
feat: add notification healthcheck endpoint
mrcaidev Oct 19, 2024
3822c2f
feat: add web service healthcheck endpoint
mrcaidev Oct 19, 2024
40d7ab8
feat: add curl in final image
mrcaidev Oct 19, 2024
d331728
test: ci-wishlist-service with jacoco
Oct 19, 2024
efa4631
test: add default directory
Oct 19, 2024
29ab3d4
test: add docker logs to check mongo db
Oct 19, 2024
f0f2c71
test: add jacoco with pom xml
Oct 19, 2024
6b9610f
chore: add jwt fake key
Oct 19, 2024
32adc32
fix: change token payload and relevant test.
MrPhotato Oct 19, 2024
25ecd66
test: add mongo command to check database
Oct 19, 2024
b46fead
Merge remote-tracking branch 'origin/NSHM-9-Set-up-environment' into …
MrPhotato Oct 19, 2024
ed9ac27
Merge remote-tracking branch 'origin/NSHM-9-Set-up-environment' into …
MrPhotato Oct 19, 2024
38bc7e3
chore: syntax error
Oct 19, 2024
355c999
chore: remove nc
Oct 19, 2024
ef7691d
chore: combined mongo command with creation
Oct 19, 2024
31df89a
test: add user creation in 1-schema
Oct 19, 2024
992c475
test: add mvn test container
Oct 19, 2024
5ea1094
test: add mongodb health-check
Oct 19, 2024
28bf2aa
chore: fix syntax
Oct 19, 2024
e984153
test: delete health-check
Oct 19, 2024
980b9f6
test: delete github.workplace
Oct 19, 2024
dfd9d80
chore: fix mongodb volume path
Oct 19, 2024
b29b9f8
chore: fix mongodb volume path
Oct 19, 2024
2cb16fe
test: add mongosh health check
Oct 19, 2024
ad80fd4
chore: add deafult working dir
Oct 19, 2024
6134f55
chore: add mongosh to check user
Oct 19, 2024
0aca5a0
chore: add create user in schem
Oct 19, 2024
d67ad80
test: test_nshm_wishlist db test
Oct 19, 2024
deab1bf
test: test_nshm_wishlist db test with schema
Oct 19, 2024
3f0482f
test: authentication failed
Oct 19, 2024
36decaa
test: change host name to mongo from localhost
Oct 19, 2024
0662849
test: open interface mongo container
Oct 19, 2024
6bf4f59
test: upload docker compose test yaml for mvn test
Oct 19, 2024
5e4de99
test: add pwd, ls to check reports
Oct 19, 2024
e60671c
test: add ls reports
Oct 19, 2024
3359bf7
test: add chown to change permission reports dir
Oct 19, 2024
2bdccf2
test: add absolute path
Oct 19, 2024
40e8a12
test: delete chown
Oct 19, 2024
0634eb2
chore: add branch to provision infra
Oct 20, 2024
286a9ab
chore: delete setup branch from ci-wishlist
Oct 20, 2024
7b086aa
fix: changing wishlist to port 8083
MrPhotato Oct 20, 2024
455dff3
feat: add secrets, rabbitmq operation
Oct 20, 2024
ae28983
fix: service port, add ingress rabbitmq management, default app
Oct 20, 2024
0e85f81
chore: add branch to destroy infra
Oct 20, 2024
893ecb4
chore: separate namespaces
Oct 20, 2024
314941b
feat: add readiness,liveness proves
Oct 21, 2024
0293ea0
chore: merge from main to setupenv
Oct 21, 2024
6962a88
feat: add locust for load testing
Oct 22, 2024
beb6e86
chore: Delete terraform/modules/ec2/setup directory
z1yoon Oct 22, 2024
340e877
chore: move argocd application install to bash script
Oct 22, 2024
d809fd2
chore: increase max work node group
Oct 22, 2024
96c4fc2
chore: upgrade hpa version, values.yaml
Oct 22, 2024
1fe1420
test: mv values.yaml
Oct 22, 2024
077172d
test: mv Chart.yaml
Oct 22, 2024
7431bfc
test: mv values.yaml inside template
Oct 22, 2024
5d2cf01
test: mv Chart.yaml inside template dir
Oct 22, 2024
92cc048
chore: adjust dir location
Oct 22, 2024
a005d4e
chore: enabled rabbitmq pv,pvc
Oct 23, 2024
dd10a42
chore: add NSHM-9-Set-up-environment in gitops.yaml
Oct 23, 2024
2abacb0
feat: add notification deployment
Oct 23, 2024
9cc2a7e
chore: add noti in values.yaml, merge from main
Oct 23, 2024
476fbe7
chore: increase ec2 size
Oct 23, 2024
0798d83
test: build test
Oct 23, 2024
5ae007f
chore: fix sed
Oct 23, 2024
f8c09ce
test: build web image test
Oct 23, 2024
a87b941
chore: fix file location
Oct 23, 2024
fffbecc
test: build web image test
Oct 23, 2024
3429140
chore: updated image tags for services: web
Oct 23, 2024
e421b20
test: decrese rabbitmq resources
Oct 23, 2024
ad73a18
chore: add default storage class gp2
Oct 23, 2024
5ff365f
chore: updated image tags for services: web
Oct 23, 2024
704e04d
test: upgrade prometheus version
Oct 23, 2024
fd2e606
feat: add loki with argocd application
Oct 24, 2024
1ab8598
feat: add init container to inject db init script
Oct 24, 2024
3709880
fix: psql access command
Oct 24, 2024
be2fc41
chore: add grafana in ingress.yaml
Oct 24, 2024
722ade0
test: add init container to link dir
Oct 24, 2024
dc2c9f5
test: delete init container, fix init.js
Oct 24, 2024
ff603e6
chore: updated image tags for services: item
Oct 24, 2024
c106e97
chore: add branch name to clone repo in container
Oct 24, 2024
1b4cc10
fix: rabbitmq-cluster yaml
Oct 24, 2024
3909a76
test: additionalConfig rabbitmq
Oct 24, 2024
eee8a7d
test: additionalConfig rabbitmq user,pass
Oct 24, 2024
a6c4b92
test: add rabbitmq external secret
Oct 24, 2024
1dfff63
test: add ingress instead of service lb
Oct 24, 2024
4d75b3e
fix: remove rabbitmq from nshm ingress yaml
Oct 24, 2024
d2983a7
chore: add ingressclassname
Oct 24, 2024
93684ae
test: add test file to build account service image
Oct 25, 2024
2c1b876
chore: updated image tags for services: account
Oct 25, 2024
5f19829
chore: delete cors
Oct 25, 2024
5656af0
chore: updated image tags for services: item
Oct 25, 2024
5993ddc
test: remove test file to trigger account build image
Oct 25, 2024
6314f75
chore: updated image tags for services: account
Oct 25, 2024
b0cf1d5
test: add test file to trigger noti image to build
Oct 25, 2024
aa90bc0
chore: add notification in gitops.yaml
Oct 25, 2024
4c30ac7
test: delete test file to trigger noti image to build
Oct 25, 2024
53973ea
chore: updated image tags for services: notification
Oct 25, 2024
fd7aaff
test: add test file to trigger build image of web
Oct 25, 2024
9b8c9e6
chore: updated image tags for services: account
Oct 25, 2024
3f7caa9
test: add git fetch
Oct 25, 2024
a0b4e3f
chore: remove test file to trigger workflow to build image
Oct 25, 2024
1054f5d
chore: updated image tags for services: web
Oct 25, 2024
6d0f638
chore: remove test.yaml
Oct 25, 2024
89de6c7
chore: merge from main to setupenv
Oct 25, 2024
3e801d8
feat: add rabbitmq image in rabbimtqcluster, merge from main to setupenv
Oct 26, 2024
68e6e46
chore: updated image tags for services: wishlist
Oct 26, 2024
79657e1
chore: change rabbitmq base image with management enabled
Oct 26, 2024
de4e986
chore: updated image tags for services: rabbitmq
Oct 26, 2024
f924e76
chore: change wishilist db dev to prod
Oct 27, 2024
9270df1
chore: volume typo
Oct 27, 2024
29df257
fix: move alb ingress controller to nginx ingress controller
Oct 27, 2024
54baf9c
chore: remove redirection in ingress yaml
Oct 27, 2024
3c829d0
chore: target to
Oct 27, 2024
0afeb55
chore: sepearte locust ingress
Oct 27, 2024
c3863ba
test: add permanent redirect
Oct 27, 2024
a872801
test: delete permanent redirect
Oct 27, 2024
42f2640
test: rewrite to
Oct 27, 2024
d0985a2
test: rewrite to without /
Oct 27, 2024
259b27e
test: remove regex
Oct 27, 2024
19e9081
test: order change
Oct 27, 2024
29a0422
test: add pathtype ImplementationSpecific
Oct 27, 2024
45b422b
test: rm pathtype ImplementationSpecific
Oct 27, 2024
c286038
test: rm rewrite target
Oct 27, 2024
5386e19
test: add rewrite target again
Oct 27, 2024
e47cd99
chore: remove original ingress.yaml
Oct 27, 2024
3d95bbd
fix: ingress yaml api/*
Oct 27, 2024
9c7623c
test: use configuration snippet
Oct 27, 2024
69971ac
chore: separate argocd ingress
Oct 27, 2024
39dc508
fix: path type ImplementationSpecific
Oct 27, 2024
146b35e
fix: adjust path
Oct 27, 2024
f45de72
fix: add argocd ingress redirect
Oct 27, 2024
865355f
fix: argocd 80 to 443
Oct 27, 2024
6958d54
fix: ingress yaml not to use snippet
Oct 27, 2024
357a5b3
fix: remove /api
Oct 27, 2024
470f787
fix: add /api
Oct 27, 2024
092db3c
fix: pathType
Oct 27, 2024
c82f16b
fix: explicitly mention /api/auth
Oct 27, 2024
de469ea
test: rollback to ImplementationSpecific
Oct 27, 2024
eb076f3
test: rewrite
Oct 27, 2024
3b55915
test: rewrite //
Oct 27, 2024
34622f9
test: rewrite /
Oct 27, 2024
346b576
test: rewrite regex
Oct 27, 2024
79844bc
test: remove /
Oct 27, 2024
65d3726
test: move bracket
Oct 27, 2024
250f6ff
test: add server snippet
Oct 27, 2024
bfe914c
test: add rewrite
Oct 27, 2024
1aa42e0
test: remove /api
Oct 27, 2024
47549ff
test: remove regex
Oct 27, 2024
4031f2b
test: fix path
Oct 27, 2024
94e1689
test: fix backend path
Oct 27, 2024
887662f
test: fix group to
Oct 27, 2024
2781ef3
test: fix backend service path with /api
Oct 27, 2024
cbca64d
test: fix backend service path with regex
Oct 27, 2024
43bfa04
test: fix backend service path with regex
Oct 27, 2024
6841e19
test: fix backend service path
Oct 27, 2024
96acd58
test: fix backend service path
Oct 27, 2024
3e6eabd
test: delete /
Oct 27, 2024
c128e20
test: delete /
Oct 27, 2024
363aac1
test: fix rewrite
Oct 27, 2024
5f73224
test: fix backend service path
Oct 27, 2024
216dfff
test: fix backend service path
Oct 27, 2024
7ac3588
chore: fix rabbitmq port
Oct 27, 2024
c4d333b
chore: separate rabbitmq ingress
Oct 27, 2024
9207e74
chore: add command to enable plugin in rabbitmq yaml
Oct 27, 2024
87b3c93
chore: remove lifecycle
Oct 27, 2024
167bdcb
test: add api
Oct 27, 2024
9905d1c
test: remove api in auth
Oct 27, 2024
5108d22
chore: separate api host
Oct 27, 2024
4a236be
test: touch test to trigger image build
Oct 27, 2024
6736e3f
chore: updated image tags for services: web
Oct 27, 2024
a2f06dc
test: rm test to trigger image build
Oct 27, 2024
bfe40cb
chore: updated image tags for services: web
Oct 27, 2024
f5ab318
test: fix regex
Oct 27, 2024
5d0e658
chore: fix typo
Oct 27, 2024
e799a88
chore: fix regex
Oct 27, 2024
7e9d93f
chore: fix regex
Oct 27, 2024
bdd2c1f
chore: fix regex
Oct 27, 2024
d880cf4
chore: fix regex
Oct 27, 2024
53dc91c
chore: fix regex
Oct 27, 2024
8595581
chore: delete rabbitmq
Oct 27, 2024
2034f9b
test: change frontend to prefix
Oct 27, 2024
77f4ce7
test: change web path
Oct 27, 2024
990dc8e
test: change web path
Oct 27, 2024
f226156
test: change web path
Oct 27, 2024
24fb9f9
test: change web path
Oct 27, 2024
305c693
test: change web path
Oct 27, 2024
6decf53
test: change web path
Oct 27, 2024
aced76c
test: touch test to trigger image build
Oct 27, 2024
7a12d7b
chore: updated image tags for services: web
Oct 27, 2024
322423e
test: change web path
Oct 27, 2024
e4c2d79
test: touch test to trigger image build
Oct 27, 2024
1a05865
chore: updated image tags for services: web
Oct 27, 2024
5bc6e56
chore: fix typo
Oct 27, 2024
dc55f26
chore: fix typo
Oct 27, 2024
865a605
test: add /
Oct 27, 2024
45b0de6
test: add /
Oct 27, 2024
8f31b81
test: fix locust get path
Oct 27, 2024
54bbbb4
chore: add logs to item service rabbitmq connection
mrcaidev Oct 27, 2024
72199c3
chore: add logs to notification service rabbitmq connection
mrcaidev Oct 27, 2024
a282583
chore: merge branch 'NSHM-9-Set-up-environment' of github.com:SE-Row-…
mrcaidev Oct 27, 2024
0470033
chore: updated image tags for services: item
Oct 27, 2024
971c9cd
chore: rebuild repective images
Oct 27, 2024
20cbb86
chore: updated image tags for services: item
Oct 27, 2024
b7b0fd4
chore: mv argo ingress to helm value
Oct 27, 2024
2f5e719
chore: add rabbitmq ingress
Oct 27, 2024
f655178
chore: delete init container in rabbitmq cluster
Oct 27, 2024
02f7561
chore: add override_special for rds random password
Oct 27, 2024
66573e4
chore: updated image tags for services: rabbitmq
Oct 27, 2024
b645fc8
chore: fix namespace for rabbitmq
Oct 27, 2024
0504fc8
chore: add argocd dir in repo
Oct 28, 2024
e731fb8
chore: add additionalPlugins in rabbitmqcluster yaml:
Oct 28, 2024
405ae45
chore: chnage endpoint, reduce hpa util percentage
Oct 28, 2024
7181d51
Merge branch 'main' into NSHM-9-Set-up-environment
Nov 6, 2024
26a5607
chore: updated image tags for services: account
Nov 6, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/destroy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- NSHM-9-Set-up-environment
workflow_dispatch:
inputs:
destroy:
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/gitops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
- setup-infra
- NSHM-9-Set-up-environment
paths:
- services/**

Expand Down Expand Up @@ -35,6 +35,10 @@ jobs:
- 'services/item/**'
wishlist:
- 'services/wishlist/**'
notification:
- 'services/notification/**'
rabbitmq:
- 'services/rabbitmq/**'

build:
name: Build and push Docker image
Expand Down Expand Up @@ -79,14 +83,16 @@ jobs:

- name: Update Image Tag Values
run: |
chart_dir="helm"
chart_dir="helm/nshm"
new_image_tag=${{ github.sha }}
sed -i -E "s|(repository: z1yoon/nshm-${{ matrix.service }}[[:space:]]+tag: )[^\"]*|\1$new_image_tag|g" "$chart_dir/values.yaml"
sed -i "/z1yoon\/nshm-${{ matrix.service }}/{n;s/tag: .*/tag: $new_image_tag/;}" $chart_dir/values.yaml
cat $chart_dir/values.yaml

- name: Commit the changes
run: |
git fetch origin
git config --global user.email "[email protected]"
git config --global user.name "nshm"
git commit -am "Updated image tags for services: ${{ matrix.service }}"
git commit -am "chore: updated image tags for services: ${{ matrix.service }}"
git push
continue-on-error: true
18 changes: 18 additions & 0 deletions argocd/argo-locust-app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: locust-load-testing
namespace: argocd
spec:
project: default
source:
repoURL: 'https://github.com/SE-Row-1/nus-secondhand-market.git'
targetRevision: NSHM-9-Set-up-environment
path: locust
destination:
server: 'https://kubernetes.default.svc'
namespace: locust
syncPolicy:
automated:
prune: true
selfHeal: true
18 changes: 18 additions & 0 deletions argocd/argo-metric-app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: metric-server
namespace: argocd
spec:
project: default
source:
repoURL: https://kubernetes-sigs.github.io/metrics-server/
chart: metrics-server
targetRevision: 3.12.2
destination:
server: https://kubernetes.default.svc
namespace: kube-system
syncPolicy:
automated:
prune: true
selfHeal: true
55 changes: 55 additions & 0 deletions argocd/argo-monitoring-app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: prometheus-stack
namespace: argocd
spec:
project: default
source:
repoURL: https://prometheus-community.github.io/helm-charts
chart: kube-prometheus-stack
targetRevision: 65.3.1
helm:
values: |
grafana:
ingress:
enabled: true
ingressClassName: nginx
annotations:
kubernetes.io/ingress.class: nginx
hosts:
- grafana.nshm.store
path: /
adminUser: "nshm"
adminPassword: "nshm123"
persistence:
enabled: true
storageClassName: gp3
size: 10Gi
prometheus:
prometheusSpec:
storageSpec:
volumeClaimTemplate:
spec:
storageClassName: gp3
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 20Gi
alertmanager:
alertmanagerSpec:
storage:
volumeClaimTemplate:
spec:
storageClassName: gp3
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 5Gi
destination:
server: https://kubernetes.default.svc
namespace: monitoring
syncPolicy:
automated:
prune: true
selfHeal: true
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ metadata:
name: nshm
namespace: argocd
spec:
project: nshm-project
project: default
source:
repoURL: 'https://github.com/SE-Row-1/nus-secondhand-market.git'
targetRevision: setup-infra
path: helm
targetRevision: NSHM-9-Set-up-environment
path: helm/nshm
destination:
server: 'https://kubernetes.default.svc'
namespace: nshm
Expand Down
18 changes: 18 additions & 0 deletions argocd/argo-rabbitmq-app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: rabbitmq-cluster-operator
namespace: argocd
spec:
project: default
source:
repoURL: registry-1.docker.io/bitnamicharts
chart: rabbitmq-cluster-operator
targetRevision: 4.3.25
destination:
server: https://kubernetes.default.svc
namespace: rabbitmq
syncPolicy:
automated:
prune: true
selfHeal: true
11 changes: 11 additions & 0 deletions argocd/argo-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
server:
ingress:
enabled: true
ingressClassName: nginx
hostname: argocd.nshm.store
path: /
pathType: Prefix

configs:
params:
server.insecure: true
54 changes: 40 additions & 14 deletions encrypt.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#!/bin/bash
# Check if the passphrase file exists

# Define passphrase file, S3 bucket, services directory, and envs directory
PASSPHRASE_FILE="nshm.passphrase"
S3_BUCKET="s3://nus-backend-terraform"
SERVICES_DIR="services"
ENVS_DIR="envs"

# Check if the passphrase file exists; download from S3 if not
if [ ! -f "$PASSPHRASE_FILE" ]; then
echo "Passphrase file not found, downloading from S3..."
aws s3 cp "${S3_BUCKET}/${PASSPHRASE_FILE}" .
Expand All @@ -14,25 +18,47 @@ if [ ! -f "$PASSPHRASE_FILE" ]; then
else
echo "Passphrase file already exists."
fi
# Get a list of service directories
service_dirs=($(ls -d "$SERVICES_DIR"/*))
# Loop through each service directory and encrypt its .env file


# Function to encrypt a single .env file
encrypt_env_file() {
local env_file=$1
local service_name=$2
echo "Encrypting $env_file..."

# Encrypt the .env file, outputting to the encrypted_envs directory
gpg --batch --yes --passphrase-file "$PASSPHRASE_FILE" --symmetric --output "$ENVS_DIR/${service_name}.env.gpg" "$env_file"

# Check if encryption was successful
if [ $? -eq 0 ]; then
echo "$env_file encrypted successfully and saved as $ENVS_DIR/${service_name}.env.gpg"
else
echo "Failed to encrypt $env_file for $service_name. Exiting..."
exit 1
fi
}

# Encrypt .env files within subdirectories of services
service_dirs=($(ls -d "$SERVICES_DIR"/*/))
for service_dir in "${service_dirs[@]}"; do
SERVICE_NAME=$(basename "$service_dir")
ENV_FILE="$service_dir/.env"
# Check if .env file exists
if [ -f "$ENV_FILE" ]; then
echo "Encrypting $ENV_FILE..."
gpg --batch --yes --passphrase-file "$PASSPHRASE_FILE" --symmetric --output "envs/$SERVICE_NAME.env.gpg" "$ENV_FILE"
if [ $? -eq 0 ]; then
echo "$ENV_FILE encrypted successfully and moved to envs/$SERVICE_NAME.env.gpg"
else
echo "Failed to encrypt $ENV_FILE for $SERVICE_NAME. Exiting..."
exit 1
fi
encrypt_env_file "$ENV_FILE" "$SERVICE_NAME"
else
echo "No .env file found in $service_dir, skipping..."
fi
done
echo "All services processed."

# Encrypt .env files in the envs directory
for env_file in "$ENVS_DIR"/*.env; do
if [ -f "$env_file" ]; then
SERVICE_NAME=$(basename "$env_file" .env)
encrypt_env_file "$env_file" "$SERVICE_NAME"
else
echo "No .env files found in $ENVS_DIR."
fi
done

echo "All .env files processed and encrypted."

3 changes: 2 additions & 1 deletion envs/account-postgres.env.gpg
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Œ †—(҂AÉ=ÿҋ6Յ<à ¿ò/ÁÑB ’½••“Ì翓Õ5…®o’¥Ì,ßt²Gï~’<ã+¨ÏYçTÈ/ÃXæ:5êVT­okÁv+Ãäû2Œ(á"}bA·FÑ8'ÈBAc° åZÅ AV^ŽÇtàh¶ã„HØdu‡¼D´K‰ÛµÏÿ`£ƒ‰Na‘4Éh
Œ aXOò”¶!öҋÆ=u—ç'uÉS¶C2áÆÁ& g
ÝãÇL)‘g¨ËÅRãJhì‡;5MèÆÿv¯•Ù}E¨hÚ<Ê4ƒTSCòNXÿÎ3t]¾Ñ闗½oqª˜±#¢Ìøez´%ž;®ë]Q'g4 Â¬í%hDŒÇûÞzҔìË[²é$åVgéµEßs[Ù
Expand Down
Binary file modified envs/account.env.gpg
Binary file not shown.
Binary file modified envs/currency.env.gpg
Binary file not shown.
2 changes: 2 additions & 0 deletions envs/ec2.env.gpg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Œ ‡Âh9Cå”éöÒÀŒ笇Õ²–KKXœƒYÎ{\*ð*j­t¸Tü|Iÿ z} ùãúEl¸\¹üáXš ‡øXu¤Í‹´å­
ú-Áa¤k¹¼aè{”ßè³A—¼õ3Fj¤ZÔaö¾éÕ›Ð߇7Õÿj2sPno=÷`1ojº"Ɉ說´ ì ªE^ו>ÇÓÎ"/ÒÈ'Èv–<A©+ÍK/9†&fqŠ4]•Hd’¹!èe/àá uáMsr»GøjqiePšœátŠ{¾Åh³'veÄgËPÆ=ÎÑ’ÄBô³f%Ï¥"ÚÖ¶øn.¯Uªe¹gèjý¨¥ÊmîÌ3‘¸x1t&t‡¡\¯ïÔö|Óñ.·©h!·z3i%ëáb©<x‰Õ*ã`žÅü20IMüANuîpºpÁQ’-)•PëÌ û
Expand Down
Binary file modified envs/item-mongo.env.gpg
Binary file not shown.
Binary file modified envs/item.env.gpg
Binary file not shown.
Binary file modified envs/notification.env.gpg
Binary file not shown.
Binary file modified envs/rabbitmq.env.gpg
Binary file not shown.
2 changes: 1 addition & 1 deletion envs/web.env.gpg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Œ =:‡‰7 ÿÿÒp[(S±q!d·Fr™çG‚+þ+R;)@{“C+‰¯™F°HÕšInT;ۈŠpܺÁRe}®‹]*¥÷hàÜz®"ŠÞç+õñ9óI~Ⱥ½õŸªp–ÉBïÚ¶¹Ü=.§UÝ]GT V
Œ yÓýýO˜²yöÒpwâÿ’Àñ‡ßIíÍëóDé<0§Üä³\¬ïÝXPT£ˆRã”ìþê z#í¯þèۼ¾´ÎÆ+¥*²jB‚ˆBÞ`ŒD·‰–3>IiXN?~Àâ)QË£öû"пPÕ7üÿXµe€7’¥
Expand Down
5 changes: 2 additions & 3 deletions envs/wishlist-mongo.env.gpg
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
Œ Ž¸³]Ÿºu0ÿҟÕËÌkø”‚ØjH”윍<Ê0u$OÀø@(Ÿêkú®Ny75¢ð–Âý•£=F¤è*É`ÎÞ¾ˆ¡Z°ºÍ£ÈI·‹P\¨t‡¢ÜÚ”&qjl‚n½j;ÀM®ˆ>¾x)ÆîtdwZ¬[6ÿ‰ö
½ÀS#[»RÑÁïpZH%:o‚¦9nÎ;Fýì ‚
6«A¶>÷ó;Ò
Œ úcº!›ÆövöÒ¦½ ¶À¶à3=7W|\Žð]®˜ÑNzgsIm×ÄBp¯í(@8
•†Ä…óã‰6a{¥]¯\`êCì3fÙRõzãÆ0il ^-~såø¨šqulq’½²ƒœ'½6ψäV˜£-¡…˜°¯ûŠµ0Ùîk›SMøE;ï@WXº3Û¾ïéõ佶¥®ÝL„ìò?P ¸¬jÛ}•;æ_
Expand Down
Binary file modified envs/wishlist.env.gpg
Binary file not shown.
13 changes: 0 additions & 13 deletions helm/Chart.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions helm/charts/mongodb/.helmignore

This file was deleted.

6 changes: 0 additions & 6 deletions helm/charts/mongodb/Chart.lock

This file was deleted.

41 changes: 0 additions & 41 deletions helm/charts/mongodb/Chart.yaml

This file was deleted.

Loading
Loading