diff --git a/.github/workflows/deploy-frontend-prod.yml b/.github/workflows/deploy-frontend-prod.yml index ad199d4f6..ef079df49 100644 --- a/.github/workflows/deploy-frontend-prod.yml +++ b/.github/workflows/deploy-frontend-prod.yml @@ -25,7 +25,7 @@ jobs: role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions-frontend-access aws-region: ap-south-1 - - name: Build frontend and push on ECR + - name: Build frontend and copy to S3 run: | cd nuxt-frontend sed -i "s|VITE_IFRAMELY_KEY_VALUE|${{ secrets.IFRAMELY_KEY }}|g" config.prod.js diff --git a/db/sql.go b/db/sql.go index 06db215af..9fceeb982 100644 --- a/db/sql.go +++ b/db/sql.go @@ -13,7 +13,7 @@ import ( func NewSql() *sqlx.DB { - log.Info("Initializing New Mysql Instance") + log.Info("Initializing New Postgresql Instance") var db *sqlx.DB username := os.Getenv("DB_USERNAME") @@ -51,7 +51,7 @@ func NewSql() *sqlx.DB { sslmode = "disable" } - db = sqlx.MustConnect("postgres", "postgres://"+username+":"+password+"@"+host+":"+port+"?sslmode="+sslmode) + db = sqlx.MustConnect("postgres", "postgres://"+username+":"+password+"@"+host+":"+port+"/"+name+"?sslmode="+sslmode) db.Mapper = reflectx.NewMapperFunc("json", strings.ToLower) db.SetConnMaxLifetime(time.Minute * 1) diff --git a/jobs/jobs.go b/jobs/jobs.go index 3b9097ed5..21925bf5c 100644 --- a/jobs/jobs.go +++ b/jobs/jobs.go @@ -186,7 +186,7 @@ func (repository *CareerRepository) SaveApplicationsData(c *gin.Context) { func (repository *CareerRepository) InsertJobApplication(input JobsApplicationsDetails) error { // Upload resume to S3 - resumeURL, err := utils.UploadResumeToS3(input.File) + resumeURL, err := utils.UploadResumeToS3(input.File, input.Email) if err != nil { log.Error(err) return err diff --git a/nuxt-frontend/yarn.lock b/nuxt-frontend/yarn.lock index 92e292721..9f853d22b 100644 --- a/nuxt-frontend/yarn.lock +++ b/nuxt-frontend/yarn.lock @@ -112,9 +112,9 @@ tslib "^1.11.1" "@aws-sdk/client-s3@^3.388.0": - version "3.438.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-s3/-/client-s3-3.438.0.tgz#9988f9eda5772f119585f54a07541298b4053b35" - integrity sha512-5VxdfyZ9oovbK5qzIYW4ZeJ1waD6VqfclSDQLHmgulekM2JYo/goEQJSjWnI4VMWuMsopzvqyeA+L9xq9uXLBQ== + version "3.440.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-s3/-/client-s3-3.440.0.tgz#13d28155dfa5c3c54a892e16182649b6a18762b7" + integrity sha512-BIALZvf7BNfiY68YwNhQv2OPHER6q+AMTXrpKNXUAL5xJid86FqXiLDB0JmJXjZM4DOf+QUYuT6Ee60LVQgmaQ== dependencies: "@aws-crypto/sha1-browser" "3.0.0" "@aws-crypto/sha256-browser" "3.0.0" @@ -129,7 +129,7 @@ "@aws-sdk/middleware-location-constraint" "3.433.0" "@aws-sdk/middleware-logger" "3.433.0" "@aws-sdk/middleware-recursion-detection" "3.433.0" - "@aws-sdk/middleware-sdk-s3" "3.433.0" + "@aws-sdk/middleware-sdk-s3" "3.440.0" "@aws-sdk/middleware-signing" "3.433.0" "@aws-sdk/middleware-ssec" "3.433.0" "@aws-sdk/middleware-user-agent" "3.438.0" @@ -421,10 +421,10 @@ "@smithy/types" "^2.4.0" tslib "^2.5.0" -"@aws-sdk/middleware-sdk-s3@3.433.0": - version "3.433.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.433.0.tgz#5b5c2fcd4c012aebe91b9b26b57b6509b4d9959f" - integrity sha512-mkn3DiSuMVh4NTLsduC42Av+ApcOor52LMoQY0Wc6M5Mx7Xd05U+G1j8sjI9n/1bs5cZ/PoeRYJ/9bL1Xxznnw== +"@aws-sdk/middleware-sdk-s3@3.440.0": + version "3.440.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.440.0.tgz#43d9028f557a579ff96515e46968deef430f3fed" + integrity sha512-DVTSr+82Z8jR9xTwDN3YHzxX7qvi0n96V92OfxvSRDq2BldCEx/KEL1orUZjw97SAXhINOlUWjRR7j4HpwWQtQ== dependencies: "@aws-sdk/types" "3.433.0" "@aws-sdk/util-arn-parser" "3.310.0" @@ -3175,46 +3175,46 @@ resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== -"@unhead/dom@1.8.1", "@unhead/dom@^1.7.4": - version "1.8.1" - resolved "https://registry.yarnpkg.com/@unhead/dom/-/dom-1.8.1.tgz#f30a85738c7b0c6bc2ffcfb09c1d806ec07e35bd" - integrity sha512-cBGCXSeJVizG95dTudB069N0DMzWCHznbjYAJUv6sh0fwPUXUfKSHgf3h+Av3rkKeWEYguULN+bpnPOIfs7fJQ== +"@unhead/dom@1.8.2", "@unhead/dom@^1.7.4": + version "1.8.2" + resolved "https://registry.yarnpkg.com/@unhead/dom/-/dom-1.8.2.tgz#84c9d90627492e9537e9334f1f5304234653076b" + integrity sha512-wyWf2bFItWvWHdfv8BlIyS7fcPYQBhJkwvkCjf3D7bnTXrd2ZyoUck07x3XApFiZavW8KD+A3S6jS39f/h4lBw== dependencies: - "@unhead/schema" "1.8.1" - "@unhead/shared" "1.8.1" + "@unhead/schema" "1.8.2" + "@unhead/shared" "1.8.2" -"@unhead/schema@1.8.1": - version "1.8.1" - resolved "https://registry.yarnpkg.com/@unhead/schema/-/schema-1.8.1.tgz#892e9b42ee0bf0a14d576fe5db589c5b0d6d2460" - integrity sha512-mR9i4BANtAug7gZEuyPkGYtVv2CF0wv8bqbPrt3OVSmpW0ts6bin1+ILM7HVKDpAOC7O1l4iyRrHOPocNPeVKQ== +"@unhead/schema@1.8.2": + version "1.8.2" + resolved "https://registry.yarnpkg.com/@unhead/schema/-/schema-1.8.2.tgz#717e7e3876e502482863dce268524f9ac745c0dc" + integrity sha512-bpCv8ualep2aqbhkBXUKfhYICi35+Pb1CBc5v6oJHHJgHKBIAbBQpbpi14amRMnRuSYDeSOCEM6SV8OJntcNDA== dependencies: hookable "^5.5.3" zhead "^2.2.4" -"@unhead/shared@1.8.1": - version "1.8.1" - resolved "https://registry.yarnpkg.com/@unhead/shared/-/shared-1.8.1.tgz#4f8a37557b8cdfdd8bc5ff4cbbae38293edf2e42" - integrity sha512-sFPx36i+InwneUJggwgobvta5KpE/Aj8SIOwHVMXZyj2w/TJshVpR+APFNKn3VMVlliZgl8UPLOROBDxAMXRDQ== +"@unhead/shared@1.8.2": + version "1.8.2" + resolved "https://registry.yarnpkg.com/@unhead/shared/-/shared-1.8.2.tgz#4536044d000bd829852ceaa539b5427830792fc3" + integrity sha512-GDrUDN3x2anpNQQOgjmKjpi2ygNsBAwok9C6Z1YCeM2YtjF1lhqF9cTCXaapNEq81FkC0R0LTgnVxa/HJ4n3lQ== dependencies: - "@unhead/schema" "1.8.1" + "@unhead/schema" "1.8.2" "@unhead/ssr@^1.7.4": - version "1.8.1" - resolved "https://registry.yarnpkg.com/@unhead/ssr/-/ssr-1.8.1.tgz#359be8a847864a092d8cdae9381408d5d34019ec" - integrity sha512-SRP+eEQMw+eAGxyTpXDwWDEATY1N8YIpcZwYLJ8dqUaiEYUZTuigCvWv38MAJbT6Os9XSYioWuEwB95HAJwfKg== + version "1.8.2" + resolved "https://registry.yarnpkg.com/@unhead/ssr/-/ssr-1.8.2.tgz#a9ef41a18730cedec1f961c09cfb776f359aa72d" + integrity sha512-6x5O8z7QOWc3gD6+Zw7pgNSo4AmHqlYHp56JJ0eFSQPrvxFDdmC/ukebG3ATbFcwfCTyobm4IC25Kk4vMOYo0A== dependencies: - "@unhead/schema" "1.8.1" - "@unhead/shared" "1.8.1" + "@unhead/schema" "1.8.2" + "@unhead/shared" "1.8.2" "@unhead/vue@^1.7.4": - version "1.8.1" - resolved "https://registry.yarnpkg.com/@unhead/vue/-/vue-1.8.1.tgz#e2ae966c3c4a43a7e0c54b69287d0efcd478fbc5" - integrity sha512-qLxrbbr4+AJjlRsayPnIoaMN6p+qndmGNLLslrcfxq0w3qCUSfVbPA/02AD1vpEUlxXy4hHFnnhQzi0b7gEufg== + version "1.8.2" + resolved "https://registry.yarnpkg.com/@unhead/vue/-/vue-1.8.2.tgz#68596443544a690a26bdcd43f328fb9b1a56a0a1" + integrity sha512-EcXw7Q++GFcsaJhZ9s6SdRnyVGelOqfhY5/xOt7FfWnTkYGqBaOxWhTrIvNSThh58lkMnAxCr/azI/z6pBVNgw== dependencies: - "@unhead/schema" "1.8.1" - "@unhead/shared" "1.8.1" + "@unhead/schema" "1.8.2" + "@unhead/shared" "1.8.2" hookable "^5.5.3" - unhead "1.8.1" + unhead "1.8.2" "@vercel/nft@^0.24.3": version "0.24.3" @@ -5028,9 +5028,9 @@ ee-first@1.1.1: integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== electron-to-chromium@^1.4.535: - version "1.4.571" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.571.tgz#8aa71539eb82db98740c3ec861256cc34e0356fd" - integrity sha512-Sc+VtKwKCDj3f/kLBjdyjMpNzoZsU6WuL/wFb6EH8USmHEcebxRXcRrVpOpayxd52tuey4RUDpUsw5OS5LhJqg== + version "1.4.572" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.572.tgz#ed9876658998138fe9e3aa47ecfa0bf914192a86" + integrity sha512-RlFobl4D3ieetbnR+2EpxdzFl9h0RAJkPK3pfiwMug2nhBin2ZCsGIAJWdpNniLz43sgXam/CgipOmvTA+rUiA== emoji-regex@^8.0.0: version "8.0.0" @@ -9172,9 +9172,9 @@ terser-webpack-plugin@^5.3.7: terser "^5.16.8" terser@^5.16.8, terser@^5.17.4: - version "5.23.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.23.0.tgz#a9c02bc3087d0f5b1cc63bbfb4fe0f7e5dbbde82" - integrity sha512-Iyy83LN0uX9ZZLCX4Qbu5JiHiWjOCTwrmM9InWOzVeM++KNWEsqV4YgN9U9E8AlohQ6Gs42ztczlWOG/lwDAMA== + version "5.24.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.24.0.tgz#4ae50302977bca4831ccc7b4fef63a3c04228364" + integrity sha512-ZpGR4Hy3+wBEzVEnHvstMvqpD/nABNelQn/z2r0fjVWGQsN3bpOLzQlqDxmb4CDZnXq5lpjnQ+mHQLAOpfM5iw== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.8.2" @@ -9360,14 +9360,14 @@ unenv@^1.7.4: node-fetch-native "^1.4.0" pathe "^1.1.1" -unhead@1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/unhead/-/unhead-1.8.1.tgz#c6dda1ea9337a02a4d6a1bf38aa0fa9a32e484bd" - integrity sha512-hidjRl/irt/kvbJmyA+oED8xh+VnlQqfye3oxoZEuGr+JEKnU7keWNyiQxkSWpo9z5rwg52CKgCmY7oMuPMtmw== +unhead@1.8.2: + version "1.8.2" + resolved "https://registry.yarnpkg.com/unhead/-/unhead-1.8.2.tgz#97598439deaec7efb987cc6818b51a25f980c1fd" + integrity sha512-f7Ha07cT+cgYav06tRNKxUrOZ722QtvYExn0McE68DYUGUM2boPCxXWlHcZXpSAbOj5OQI5AwQE5Xb3Qp2dWDQ== dependencies: - "@unhead/dom" "1.8.1" - "@unhead/schema" "1.8.1" - "@unhead/shared" "1.8.1" + "@unhead/dom" "1.8.2" + "@unhead/schema" "1.8.2" + "@unhead/shared" "1.8.2" hookable "^5.5.3" unicode-canonical-property-names-ecmascript@^2.0.0: diff --git a/utils/s3.go b/utils/s3.go index 67606edd2..7b065bba6 100644 --- a/utils/s3.go +++ b/utils/s3.go @@ -99,7 +99,7 @@ func UploadFileToS3(fileName string, sess *session.Session) { return } -func UploadResumeToS3(fileHeader *multipart.FileHeader) (string, error) { +func UploadResumeToS3(fileHeader *multipart.FileHeader, email string) (string, error) { file, err := fileHeader.Open() if err != nil { return "", err @@ -114,7 +114,7 @@ func UploadResumeToS3(fileHeader *multipart.FileHeader) (string, error) { svc := s3.New(sess) - fileName := GenerateUniqueFileName(fileHeader.Filename) + fileName := email + "_" + GenerateUniqueFileName(fileHeader.Filename) params := &s3.PutObjectInput{ Bucket: aws.String("canopas-website"),