Allow images from outside your application's priv/ directory. Set this record
as Emerge.Config.Assets.runtime_paths. This controls runtime image paths,
not your application's general filesystem access.
%Emerge.Config{
assets: %Emerge.Config.Assets{
runtime_paths: %Emerge.Config.RuntimePaths{
enabled: true,
allowlist: ["/data/photos"]
}
}
}Fields
enabled—falseby default. Settrueto allow runtime sources such as{:path, "/data/photos/photo.jpg"}; an allowlist is also required.allowlist— allowed absolute directory roots; defaults to[], allowing no runtime files. Keep the list as narrow as possible.follow_symlinks—falseby default, rejecting symlink path components. Withtrue, resolved paths must still fall within an allowed directory.max_file_size— positive encoded-file size limit in bytes; defaults to25_000_000. This does not limit decoded image dimensions or peak memory.extensions— allowed filename extensions, including their leading dot. Defaults to[".png", ".jpg", ".jpeg", ".webp", ".gif", ".bmp", ".svg"]. The list replaces these defaults when supplied.
Logical application assets do not need this opt-in. All fields require a new viewport to change. See Use assets for source syntax.
Summary
Types
Canonical form after nested keyword records have been expanded.
Typed keyword shorthand accepted in this record's parent field.
Types
@type normalized_t() :: t()
Canonical form after nested keyword records have been expanded.
@type options() :: [ enabled: boolean(), allowlist: [String.t()], follow_symlinks: boolean(), max_file_size: pos_integer(), extensions: [String.t()] ]
Typed keyword shorthand accepted in this record's parent field.
@type t() :: %Emerge.Config.RuntimePaths{ allowlist: [String.t()], enabled: boolean(), extensions: [String.t()], follow_symlinks: boolean(), max_file_size: pos_integer() }