Enhance API with OIDC support, including login and callback endpoints. Update environment variables for OIDC configuration in .env.example. Add new features to the catalog service for listing software families, Minecraft versions, and deployment regions. Implement server management actions such as kill, delete, and update in the servers module. Integrate feature flags for maintenance mode in server operations. Update pnpm-lock.yaml with new dependencies and versions.
This commit is contained in:
@@ -229,6 +229,31 @@ func WriteFile(dataRoot, relativePath, content string, create bool) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// RemovePath deletes a file or directory relative to dataRoot.
|
||||
func RemovePath(dataRoot, relativePath string) error {
|
||||
target, err := ResolvePath(dataRoot, relativePath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := rejectSymlinks(dataRoot, target); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
info, err := os.Lstat(target)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return ErrNotFound
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
if info.IsDir() {
|
||||
return os.RemoveAll(target)
|
||||
}
|
||||
|
||||
return os.Remove(target)
|
||||
}
|
||||
|
||||
// DeleteFile removes a file relative to dataRoot.
|
||||
func DeleteFile(dataRoot, relativePath string) error {
|
||||
filePath, err := ResolvePath(dataRoot, relativePath)
|
||||
|
||||
Reference in New Issue
Block a user