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

GitCryptでSettingsディレクトリを暗号化 #92

Merged
merged 10 commits into from
Jul 9, 2023
Merged
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
4 changes: 4 additions & 0 deletions .git-crypt/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Do not edit this file. To specify the files to encrypt, create your own
# .gitattributes file in the directory where your files are.
* !filter !diff
*.gpg binary
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
�^�qo��[��@�IK�S�Š���1������=O�X���]
D�z0���i����#�̟9��=�, �S��T����L�B&��d/ֳ���� 9����J�bF�:�r��@����Ts���쾒��QJ\����F�����ݛ V0����B���4 M�����x P$�����{���*
�O����:#�.���.%�$��k��n��?�ݜD���]�lbsh��0��X�.���^��Ĭ�{���N�o鸟^z����|l}�Օ�۞�t���l���:tz1�d��<9��
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
�^��-&�@��!��-0I����G>ڀ�b��h-K� tDI0jʂ䊚����0�@��<��]��J�v�Y:c��[�� S˫>��Ў�� Eۮ-�sg�����T)샹�t����De����x��;)��O��,}o�pa� N��y��tUܟw�����G�[�x�yq��*�K�_V揔/���<v�,�ސ��s�6�]�G��x6��" ��#?`��C����ᗟ���WY}G������t�Se(�ǠM��+�S?p���B5`恮/zS�2�P��"��a.{����
Expand Down
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# all envfile
*/**.env filter=git-crypt diff=git-crypt

# settings
settings/** filter=git-crypt diff=git-crypt
13 changes: 3 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
# env_file
*/**.env

# keycloak
auth/data/export.json
auth/data/out*.json
auth/data/merged.json

# cloudflare
cloudflare/**/cert.pem
cloudflare/**/*.json
settings/dev/data/export.json
settings/dev/data/out*.json
settings/dev/data/merged.json
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
build:
# セッティングをPull
sh ../settings/pull.sh
# # セッティングをPull
# sh ../settings/pull.sh
# 全てのコンテナをビルド
docker compose down -v
docker compose build
Expand Down
8 changes: 0 additions & 8 deletions cloudflare/dev/config.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions cloudflare/prod/config.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions cloudflare/stage/config.yaml

This file was deleted.

8 changes: 4 additions & 4 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
cloudflare:
image: cloudflare/cloudflared:latest
container_name: "cloudflare"
volumes: [./cloudflare/prod:/home/nonroot/.cloudflared]
volumes: [settings/prod/cloudflare:/home/nonroot/.cloudflared]
command: tunnel run

auth: # keycloak
Expand All @@ -15,15 +15,15 @@ services:
volumes:
- ./auth/merge.sh:/opt/keycloak/merge.sh
- ./auth/themes:/opt/keycloak/themes
env_file: [../settings/account/production.env]
env_file: [settings/prod/auth.env]

api: # hasura
build:
context: .docker
dockerfile: api.Dockerfile
container_name: "account_api"
volumes: [./api:/hasura]
env_file: [../settings/account/production.env]
env_file: [settings/prod/api.env]

front: # nextjs
build:
Expand All @@ -32,4 +32,4 @@ services:
container_name: account_front
command: sh -c "npm install && npm run build && npm run start"
volumes: [.:/repo]
env_file: [../settings/account/production.env]
env_file: [settings/prod/front.env]
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
volumes:
- db_data:/var/lib/postgresql/data
- ./sql:/sql
env_file: [../settings/account/development.env]
env_file: [settings/dev/db.env]
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
Expand All @@ -22,11 +22,11 @@ services:
- 8080:8080
- 9990:9990
command: start-dev
env_file: [../settings/account/development.env]
env_file: [settings/dev/auth.env]
volumes:
- ./auth/merge.sh:/opt/keycloak/merge.sh
- ./auth/themes:/opt/keycloak/themes
- ../settings/account/data:/opt/keycloak/data # required settings repository
- ./auth/data:/opt/keycloak/data # required unlock for git-crypt
depends_on:
db:
condition: service_healthy
Expand All @@ -40,7 +40,7 @@ services:
container_name: "account_api"
ports: ["8082:8080"]
volumes: [./api:/hasura]
env_file: [../settings/account/development.env]
env_file: [settings/dev/api.env]
depends_on:
db:
condition: service_healthy
Expand All @@ -53,7 +53,7 @@ services:
ports: [3000:3000]
command: sh -c "npm install && npm run dev"
volumes: [.:/repo]
env_file: [../settings/account/development.env]
env_file: [settings/dev/front.env]
depends_on: [auth, api]

volumes:
Expand Down
Binary file added settings/dev/api.env
Binary file not shown.
Binary file added settings/dev/auth.env
Binary file not shown.
Binary file not shown.
Binary file added settings/dev/cloudflare/cert.pem
Binary file not shown.
Binary file added settings/dev/cloudflare/config.yaml
Binary file not shown.
Binary file added settings/dev/data/import.json
Binary file not shown.
Binary file added settings/dev/db.env
Binary file not shown.
Binary file added settings/dev/front.env
Binary file not shown.
Binary file added settings/prod/api.env
Binary file not shown.
Binary file added settings/prod/auth.env
Binary file not shown.
Binary file not shown.
Binary file added settings/prod/cloudflare/cert.pem
Binary file not shown.
Binary file added settings/prod/cloudflare/config.yaml
Binary file not shown.
Binary file added settings/prod/front.env
Binary file not shown.