From 15c060400af1f402f06116f1554436bc95e099c2 Mon Sep 17 00:00:00 2001 From: BakoD <rudghrnt@ajou.ac.kr> Date: Fri, 8 Nov 2024 01:52:38 +0900 Subject: [PATCH 01/14] Fix: Fix `.gitlab-ci.yml` --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f24f3b3..cde547c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,9 +17,9 @@ test: script: - export DOCKER_HOST=unix:///var/run/docker.sock - docker-compose -f docker-compose.yaml up -d - - pushd front/nginx/ssl + - cd front/nginx/ssl - bash setup_ssl.sh - - popd + - cd ~ only: - develop - master -- GitLab From 2d56990165212944e13509e47ccf3996ffbaa056 Mon Sep 17 00:00:00 2001 From: BakoD <rudghrnt@ajou.ac.kr> Date: Fri, 8 Nov 2024 01:53:58 +0900 Subject: [PATCH 02/14] Fix: Fix `.gitlab-ci.yml` --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cde547c..e7b339f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,7 +18,7 @@ test: - export DOCKER_HOST=unix:///var/run/docker.sock - docker-compose -f docker-compose.yaml up -d - cd front/nginx/ssl - - bash setup_ssl.sh + - ./setup_ssl.sh - cd ~ only: - develop -- GitLab From fd5813c96b2341d7e87b62d956f07e4106048758 Mon Sep 17 00:00:00 2001 From: BakoD <rudghrnt@ajou.ac.kr> Date: Fri, 8 Nov 2024 01:55:12 +0900 Subject: [PATCH 03/14] Fix: Fix `.gitlab-ci.yml` --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e7b339f..f6d145c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,11 +15,11 @@ before_script: test: stage: test script: - - export DOCKER_HOST=unix:///var/run/docker.sock - - docker-compose -f docker-compose.yaml up -d - cd front/nginx/ssl - ./setup_ssl.sh - cd ~ + - export DOCKER_HOST=unix:///var/run/docker.sock + - docker-compose -f docker-compose.yaml up -d only: - develop - master -- GitLab From fcfb16052e2b6c93543906c0b2d77574d3d61717 Mon Sep 17 00:00:00 2001 From: BakoD <rudghrnt@ajou.ac.kr> Date: Fri, 8 Nov 2024 01:57:57 +0900 Subject: [PATCH 04/14] Debug: Debugging `.gitlab-ci.yml` --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f6d145c..5b6286f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,6 +16,7 @@ test: stage: test script: - cd front/nginx/ssl + - ls - ./setup_ssl.sh - cd ~ - export DOCKER_HOST=unix:///var/run/docker.sock -- GitLab From 47335b90ce7144db10576b9436988f73b14fe2f0 Mon Sep 17 00:00:00 2001 From: BakoD <rudghrnt@ajou.ac.kr> Date: Fri, 8 Nov 2024 02:00:51 +0900 Subject: [PATCH 05/14] Debug: Add `+x` permission to `setup_ssl.sh` --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5b6286f..370b5fb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,7 +17,8 @@ test: script: - cd front/nginx/ssl - ls - - ./setup_ssl.sh + - chmod +x setup_ssl.sh + - bash setup_ssl.sh - cd ~ - export DOCKER_HOST=unix:///var/run/docker.sock - docker-compose -f docker-compose.yaml up -d -- GitLab From 716814b70138a9083fdd25871b2476ccbd29315c Mon Sep 17 00:00:00 2001 From: BakoD <rudghrnt@ajou.ac.kr> Date: Fri, 8 Nov 2024 02:02:12 +0900 Subject: [PATCH 06/14] Debug: Add `+x` permission to `setup_ssl.sh` --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 370b5fb..3101ab8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,7 +18,7 @@ test: - cd front/nginx/ssl - ls - chmod +x setup_ssl.sh - - bash setup_ssl.sh + - ./setup_ssl.sh - cd ~ - export DOCKER_HOST=unix:///var/run/docker.sock - docker-compose -f docker-compose.yaml up -d -- GitLab From 5cf28147381a6e2fc0350e0b390bfae8e79a8f4e Mon Sep 17 00:00:00 2001 From: BakoD <rudghrnt@ajou.ac.kr> Date: Fri, 8 Nov 2024 02:22:53 +0900 Subject: [PATCH 07/14] Fix: Fix `.gitlab-ci.yml` --- .gitlab-ci.yml | 1 - front/nginx/ssl/setup_ssl.sh | 40 ++++++++++++++++++++---------------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3101ab8..7549a47 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,6 @@ test: stage: test script: - cd front/nginx/ssl - - ls - chmod +x setup_ssl.sh - ./setup_ssl.sh - cd ~ diff --git a/front/nginx/ssl/setup_ssl.sh b/front/nginx/ssl/setup_ssl.sh index 11c3175..9657f2a 100755 --- a/front/nginx/ssl/setup_ssl.sh +++ b/front/nginx/ssl/setup_ssl.sh @@ -1,23 +1,27 @@ -#!/bin/bash +#!/bin/sh # mkcert �ㅼ튂 �뺤씤 諛� �ㅼ튂 install_mkcert() { - if ! command -v mkcert &> /dev/null; then + if ! command -v mkcert >/dev/null 2>&1; then echo "mkcert媛� �ㅼ튂�섏뼱 �덉� �딆뒿�덈떎. �ㅼ튂瑜� �쒖옉�⑸땲��." - if [[ "$OSTYPE" == "linux-gnu"* ]]; then - echo "由щ늼�� �섍꼍�먯꽌 mkcert �ㅼ튂 以�..." - sudo apt update - sudo apt install -y libnss3-tools - wget -qO - https://dl.filippo.io/mkcert/latest?for=linux/amd64 | sudo tar xz -C /usr/local/bin - elif [[ "$OSTYPE" == "darwin"* ]]; then - echo "留쩙S �섍꼍�먯꽌 mkcert �ㅼ튂 以�..." - brew install mkcert - brew install nss # Firefox瑜� �ъ슜�섎뒗 寃쎌슦 �꾩슂 - else - echo "吏��먰븯吏� �딅뒗 �댁쁺 泥댁젣�낅땲��." - exit 1 - fi + case "$(uname)" in + Linux*) + echo "由щ늼�� �섍꼍�먯꽌 mkcert �ㅼ튂 以�..." + sudo apt update + sudo apt install -y libnss3-tools + wget -qO - https://dl.filippo.io/mkcert/latest?for=linux/amd64 | sudo tar xz -C /usr/local/bin + ;; + Darwin*) + echo "留쩙S �섍꼍�먯꽌 mkcert �ㅼ튂 以�..." + brew install mkcert + brew install nss # Firefox瑜� �ъ슜�섎뒗 寃쎌슦 �꾩슂 + ;; + *) + echo "吏��먰븯吏� �딅뒗 �댁쁺 泥댁젣�낅땲��." + exit 1 + ;; + esac else echo "mkcert媛� �대� �ㅼ튂�섏뼱 �덉뒿�덈떎." fi @@ -31,10 +35,10 @@ install_local_ca() { # SSL �몄쬆�� 諛쒓툒 諛� �대룞 generate_and_move_ssl_certificates() { - local domains=("localhost" "fiturring.kro.kr") # �꾩슂�� �꾨찓�� 異붽� + local domains="localhost fiturring.kro.kr" # �꾩슂�� �꾨찓�� 異붽� - echo "SSL �몄쬆�� 諛쒓툒 以�... �꾨찓��: ${domains[*]}" - mkcert "${domains[@]}" + echo "SSL �몄쬆�� 諛쒓툒 以�... �꾨찓��: $domains" + mkcert $domains # SSL �붾젆�좊━ �앹꽦 mkdir -p "$ssl_dir" -- GitLab From 6c8ae5b2cc7014ace03ca835d702342e5ebac4af Mon Sep 17 00:00:00 2001 From: BakoD <rudghrnt@ajou.ac.kr> Date: Fri, 8 Nov 2024 02:25:58 +0900 Subject: [PATCH 08/14] Fix: Fix `.gitlab-ci.yml` --- .gitlab-ci.yml | 2 +- front/nginx/ssl/setup_ssl.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7549a47..bb39e73 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,7 +18,7 @@ test: - cd front/nginx/ssl - chmod +x setup_ssl.sh - ./setup_ssl.sh - - cd ~ + - cd ../../../ - export DOCKER_HOST=unix:///var/run/docker.sock - docker-compose -f docker-compose.yaml up -d only: diff --git a/front/nginx/ssl/setup_ssl.sh b/front/nginx/ssl/setup_ssl.sh index 9657f2a..b24d01d 100755 --- a/front/nginx/ssl/setup_ssl.sh +++ b/front/nginx/ssl/setup_ssl.sh @@ -8,9 +8,9 @@ install_mkcert() { case "$(uname)" in Linux*) echo "由щ늼�� �섍꼍�먯꽌 mkcert �ㅼ튂 以�..." - sudo apt update - sudo apt install -y libnss3-tools - wget -qO - https://dl.filippo.io/mkcert/latest?for=linux/amd64 | sudo tar xz -C /usr/local/bin + apt update + apt install -y libnss3-tools + wget -qO - https://dl.filippo.io/mkcert/latest?for=linux/amd64 | tar xz -C /usr/local/bin ;; Darwin*) echo "留쩙S �섍꼍�먯꽌 mkcert �ㅼ튂 以�..." -- GitLab From 1bd2e749e03447ae93a218cc4510cd27e849a8a6 Mon Sep 17 00:00:00 2001 From: BakoD <rudghrnt@ajou.ac.kr> Date: Fri, 8 Nov 2024 02:32:49 +0900 Subject: [PATCH 09/14] Fix: Fix `.gitlab-ci.yml` --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bb39e73..1e78daf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,6 +9,9 @@ image: docker:latest before_script: - apk add --no-cache docker-cli docker-compose + - apk update + - apk install -y libnss3-tools + - apk install -y wget - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - echo -e "MYSQL_ROOT_PASSWORD=testdb123\nMYSQL_DATABASE=testdb" > .env @@ -16,6 +19,7 @@ test: stage: test script: - cd front/nginx/ssl + - wget -qO - https://dl.filippo.io/mkcert/latest?for=linux/amd64 | tar xz -C /usr/local/bin - chmod +x setup_ssl.sh - ./setup_ssl.sh - cd ../../../ -- GitLab From 3a1e5518b6caa16912f3f386d9508f42cc65239f Mon Sep 17 00:00:00 2001 From: BakoD <rudghrnt@ajou.ac.kr> Date: Fri, 8 Nov 2024 02:34:37 +0900 Subject: [PATCH 10/14] Fix: Fix `.gitlab-ci.yml` --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1e78daf..9b241ba 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,8 +10,8 @@ image: docker:latest before_script: - apk add --no-cache docker-cli docker-compose - apk update - - apk install -y libnss3-tools - - apk install -y wget + - apk add --no-cache libnss3-tools + - apk add --no-cache wget - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - echo -e "MYSQL_ROOT_PASSWORD=testdb123\nMYSQL_DATABASE=testdb" > .env -- GitLab From 4cd4ec3741fb0d44f5ad128a41c318f1ef8761ab Mon Sep 17 00:00:00 2001 From: BakoD <rudghrnt@ajou.ac.kr> Date: Fri, 8 Nov 2024 02:35:51 +0900 Subject: [PATCH 11/14] Fix: Fix `.gitlab-ci.yml` --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9b241ba..b3defd5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,6 +8,10 @@ variables: image: docker:latest before_script: + - apk update + - apk add --no-cache curl nss + - curl -L https://dl.filippo.io/mkcert/latest?for=linux/amd64 | tar xz -C /usr/local/bin + - mkcert -install - apk add --no-cache docker-cli docker-compose - apk update - apk add --no-cache libnss3-tools @@ -19,7 +23,6 @@ test: stage: test script: - cd front/nginx/ssl - - wget -qO - https://dl.filippo.io/mkcert/latest?for=linux/amd64 | tar xz -C /usr/local/bin - chmod +x setup_ssl.sh - ./setup_ssl.sh - cd ../../../ -- GitLab From b9e696f7ec4ff572697e52940b938d10792a2219 Mon Sep 17 00:00:00 2001 From: BakoD <rudghrnt@ajou.ac.kr> Date: Fri, 8 Nov 2024 02:37:21 +0900 Subject: [PATCH 12/14] Fix: Fix `.gitlab-ci.yml` --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b3defd5..70de6fd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,7 +10,9 @@ image: docker:latest before_script: - apk update - apk add --no-cache curl nss - - curl -L https://dl.filippo.io/mkcert/latest?for=linux/amd64 | tar xz -C /usr/local/bin + - curl -Lo mkcert https://dl.filippo.io/mkcert/latest?for=linux/amd64 + - chmod +x mkcert + - mv mkcert /usr/local/bin/ - mkcert -install - apk add --no-cache docker-cli docker-compose - apk update -- GitLab From 9d5ace8d5b907a05525ce305d3c79d436da5b997 Mon Sep 17 00:00:00 2001 From: BakoD <rudghrnt@ajou.ac.kr> Date: Fri, 8 Nov 2024 02:39:16 +0900 Subject: [PATCH 13/14] Fix: Fix `.gitlab-ci.yml` --- .gitlab-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 70de6fd..f8fcf88 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,8 +15,6 @@ before_script: - mv mkcert /usr/local/bin/ - mkcert -install - apk add --no-cache docker-cli docker-compose - - apk update - - apk add --no-cache libnss3-tools - apk add --no-cache wget - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - echo -e "MYSQL_ROOT_PASSWORD=testdb123\nMYSQL_DATABASE=testdb" > .env -- GitLab From 0a3776ec74f6488c3f511bacd94c95fd99a9b3b1 Mon Sep 17 00:00:00 2001 From: BakoD <rudghrnt@ajou.ac.kr> Date: Fri, 8 Nov 2024 02:41:18 +0900 Subject: [PATCH 14/14] Fix: Remove unused line --- front/nginx/ssl/setup_ssl.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/front/nginx/ssl/setup_ssl.sh b/front/nginx/ssl/setup_ssl.sh index b24d01d..dc0664a 100755 --- a/front/nginx/ssl/setup_ssl.sh +++ b/front/nginx/ssl/setup_ssl.sh @@ -40,9 +40,6 @@ generate_and_move_ssl_certificates() { echo "SSL �몄쬆�� 諛쒓툒 以�... �꾨찓��: $domains" mkcert $domains - # SSL �붾젆�좊━ �앹꽦 - mkdir -p "$ssl_dir" - # �몄쬆�� �뚯씪 �대쫫 蹂�寃� 諛� �대룞 mv "localhost+1.pem" "fullchain.pem" mv "localhost+1-key.pem" "privkey.pem" -- GitLab