asdf
This commit is contained in:
parent
3c79a8c778
commit
5ab07aee34
1 changed files with 7 additions and 1 deletions
|
|
@ -79,13 +79,19 @@ func (a *App) syncCaddyConfigFragment(ctx context.Context) error {
|
|||
if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := os.Chmod(filepath.Dir(path), 0o755); err != nil {
|
||||
return err
|
||||
}
|
||||
tmp := path + ".tmp"
|
||||
if err := os.WriteFile(tmp, []byte(content), 0o640); err != nil {
|
||||
if err := os.WriteFile(tmp, []byte(content), 0o644); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := os.Rename(tmp, path); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := os.Chmod(path, 0o644); err != nil {
|
||||
return err
|
||||
}
|
||||
return a.reloadCaddy()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue