Skip to content
This repository was archived by the owner on Dec 3, 2023. It is now read-only.

水責め対策 - #17

Merged
tatsuru merged 16 commits into
mainfrom
zone-file
Nov 25, 2023
Merged

水責め対策#17
tatsuru merged 16 commits into
mainfrom
zone-file

Conversation

@Gurrium

@Gurrium Gurrium commented Nov 25, 2023

Copy link
Copy Markdown
Collaborator

#12

@Gurrium
Gurrium requested a review from tatsuru November 25, 2023 06:16
Comment thread webapp/go/main.go Outdated
}

const initialPowerDNSZoneFile = "../pdns/u.isucon.dev.zone.initial"
const powerDNSZoneFile = "../pdns/u.isucon.dev.zone"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このファイルはテンプレなので直接いじらない方がいいですね

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initial になってた。リポジトリに入ってるので消しといた方が良さそう

Comment thread webapp/go/main.go Outdated
}

const initialPowerDNSZoneFile = "../pdns/u.isucon.dev.zone.initial"
const powerDNSZoneFile = "../pdns/u.isucon.dev.zone"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initial になってた。リポジトリに入ってるので消しといた方が良さそう

Comment thread webapp/go/main.go Outdated
// coppy ../pdns/u.isucon.dev.zone.initial to ../pdns/u.isucon.dev.zone
if err := exec.Command("cp", initialPowerDNSZoneFile, powerDNSZoneFile).Run(); err != nil {
c.Logger().Warnf("failed to copy %s to %s: %v", initialPowerDNSZoneFile, powerDNSZoneFile, err)
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここで reload したい

Comment thread webapp/go/user_handler.go
}

if out, err := exec.Command("pdnsutil", "add-record", "u.isucon.dev", req.Name, "A", "0", powerDNSSubdomainAddress).CombinedOutput(); err != nil {
f, err := os.OpenFile(powerDNSZoneFile, os.O_APPEND|os.O_WRONLY, 0644)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

append よさそう

@tatsuru

tatsuru commented Nov 25, 2023

Copy link
Copy Markdown
Owner

@Gurrium コメントしました。あと https://github.com/tatsuru/isucon13/blob/main/webapp/pdns/init_zone.sh もいじらないとですね

@tatsuru

tatsuru commented Nov 25, 2023

Copy link
Copy Markdown
Owner

色々いじったので反映手順

  • pdns.conf をリポジトリからコピー
  • /opt/init_zone_once.sh を exit するように設定
  • pdns を再起動
  • アプリを再起動

@tatsuru
tatsuru merged commit 94a486f into main Nov 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants