Enhance Dockerfile and documentation for GeoIP directory permissions
- Updated Dockerfile to create and set ownership for the /var/lib/telemt-gateway directory, ensuring the gateway user has the necessary permissions. - Added documentation in GEOIP.md to clarify directory permissions required for GeoIP data downloads, including guidance on volume mounting and user ID consistency.
This commit is contained in:
@@ -38,11 +38,11 @@ func downloadRawMMDB(ctx context.Context, client *http.Client, url, destPath str
|
||||
}
|
||||
dir := filepath.Dir(destPath)
|
||||
if err := os.MkdirAll(dir, 0o755); err != nil {
|
||||
return fmt.Errorf("geoip mkdir: %w", err)
|
||||
return fmt.Errorf("geoip mkdir %q: %w (directory must exist or be creatable by the process)", dir, err)
|
||||
}
|
||||
tmp, err := os.CreateTemp(dir, "geolite-*.mmdb.part")
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("geoip temp file in %q: %w", dir, err)
|
||||
}
|
||||
tmpPath := tmp.Name()
|
||||
_, copyErr := io.Copy(tmp, resp.Body)
|
||||
@@ -87,11 +87,11 @@ func downloadGzippedMMDB(ctx context.Context, client *http.Client, url, destPath
|
||||
|
||||
dir := filepath.Dir(destPath)
|
||||
if err := os.MkdirAll(dir, 0o755); err != nil {
|
||||
return fmt.Errorf("geoip mkdir: %w", err)
|
||||
return fmt.Errorf("geoip mkdir %q: %w (directory must exist or be creatable by the process)", dir, err)
|
||||
}
|
||||
tmp, err := os.CreateTemp(dir, "geolite-*.mmdb.part")
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("geoip temp file in %q: %w", dir, err)
|
||||
}
|
||||
tmpPath := tmp.Name()
|
||||
_, copyErr := io.Copy(tmp, gzr)
|
||||
|
||||
Reference in New Issue
Block a user