cumet04 / switchbot-logger

MIT License
0 stars 0 forks source link

認証を簡易path認証からbasic認証に変更 #97

Closed cumet04 closed 3 months ago

cumet04 commented 3 months ago

appで地味にpageが増えていて認証コピペが増えている(かつ全然標準の仕組みじゃないので色々乗っかれない)とか、e2eでもなんともいえない認証指定してるのとかをなんとかする

[!WARNING] Secretの追加があるのでapply手順注意・raspi側の反映もある

github-actions[bot] commented 3 months ago

Plan Result

CI link

:warning: Resource Deletion will happen

This plan contains resource delete operation. Please check the plan result very carefully!

Plan: 2 to add, 1 to change, 1 to destroy.
Change Result (Click me) ```hcl # google_cloud_run_v2_service.CloudRunApp_CloudRun_app_service_A75522C2 will be updated in-place ~ resource "google_cloud_run_v2_service" "CloudRunApp_CloudRun_app_service_A75522C2" { id = "projects/switchbot-logger/locations/us-central1/services/app" name = "app" # (30 unchanged attributes hidden) ~ template { # (9 unchanged attributes hidden) ~ containers { name = null # (5 unchanged attributes hidden) ~ env { ~ name = "AUTH_PATH" -> "SWITCHBOT_TOKEN" # (1 unchanged attribute hidden) ~ value_source { ~ secret_key_ref { ~ secret = "auth_path" -> "switchbot_token" # (1 unchanged attribute hidden) } } } ~ env { ~ name = "SWITCHBOT_TOKEN" -> "SWITCHBOT_SECRET" # (1 unchanged attribute hidden) ~ value_source { ~ secret_key_ref { ~ secret = "switchbot_token" -> "switchbot_secret" # (1 unchanged attribute hidden) } } } ~ env { ~ name = "SWITCHBOT_SECRET" -> "SENTRY_AUTH_TOKEN" # (1 unchanged attribute hidden) ~ value_source { ~ secret_key_ref { ~ secret = "switchbot_secret" -> "sentry_token" # (1 unchanged attribute hidden) } } } ~ env { ~ name = "SENTRY_AUTH_TOKEN" -> "BASIC_USER" # (1 unchanged attribute hidden) ~ value_source { ~ secret_key_ref { ~ secret = "sentry_token" -> "basic_user" # (1 unchanged attribute hidden) } } } + env { + name = "BASIC_PASS" + value_source { + secret_key_ref { + secret = "basic_pass" + version = "latest" } } } # (5 unchanged blocks hidden) } # (1 unchanged block hidden) } # (1 unchanged block hidden) } # google_secret_manager_secret.CloudRunApp_Secret_auth_path_this_B5518CA1 will be destroyed # (because google_secret_manager_secret.CloudRunApp_Secret_auth_path_this_B5518CA1 is not in configuration) - resource "google_secret_manager_secret" "CloudRunApp_Secret_auth_path_this_B5518CA1" { - annotations = {} -> null - create_time = "2024-01-22T16:02:48.415409Z" -> null - effective_annotations = {} -> null - effective_labels = {} -> null - id = "projects/switchbot-logger/secrets/auth_path" -> null - labels = {} -> null - name = "projects/474847252006/secrets/auth_path" -> null - project = "switchbot-logger" -> null - secret_id = "auth_path" -> null - terraform_labels = {} -> null - version_aliases = {} -> null # (2 unchanged attributes hidden) - replication { - auto { } } - timeouts {} } # google_secret_manager_secret.CloudRunApp_Secret_basic_pass_this_1C7E4E5A will be created + resource "google_secret_manager_secret" "CloudRunApp_Secret_basic_pass_this_1C7E4E5A" { + create_time = (known after apply) + effective_annotations = (known after apply) + effective_labels = (known after apply) + expire_time = (known after apply) + id = (known after apply) + name = (known after apply) + project = "switchbot-logger" + secret_id = "basic_pass" + terraform_labels = (known after apply) + replication { + auto { } } } # google_secret_manager_secret.CloudRunApp_Secret_basic_user_this_3BC52ED0 will be created + resource "google_secret_manager_secret" "CloudRunApp_Secret_basic_user_this_3BC52ED0" { + create_time = (known after apply) + effective_annotations = (known after apply) + effective_labels = (known after apply) + expire_time = (known after apply) + id = (known after apply) + name = (known after apply) + project = "switchbot-logger" + secret_id = "basic_user" + terraform_labels = (known after apply) + replication { + auto { } } } Plan: 2 to add, 1 to change, 1 to destroy. ```
cumet04 commented 3 months ago

stagingはいい感じに動いているようだ

cumet04 commented 3 months ago

raspiの手順についてREADME修正が必要な気がするが...まぁあとでいいか...