Commit graph

6 commits

Author SHA1 Message Date
noury
b55740aad7 implement file expiration, add basic frontend 2023-07-14 14:11:38 +02:00
Leon Richardt
2dc5c1b011
feat: improve file extension detection
If a file extension is explicitly specified in the upload name, it is
always used directly. Detection of common file extension combinations is
also performed. Currently, only ".tar.gz" and ".tar.xz" are detected. If
you would like to add support for more common combinations, please open
an issue or pull request.

If no file extension is explicitly specified, jaf falls back to MIME
type detection via the github.com/gabriel-vasile/mimetype library.
2022-10-17 20:36:24 +02:00
Leon Richardt
16d9fa28dd
fix(exif): don't abort upload on missing EXIF data
We now correctly test the error type
2022-08-23 23:09:21 +02:00
Leon Richardt
e0afb453a5
feat: add option to scrub EXIF tags on image files
EXIF scrubbing can be enabled via the `ScrubExif` config key. When
enabled, all standard EXIF tags (as defined by the IFD mappings in the
go-exif library) are removed on uploaded JPEG and PNG images.

The `ExifAllowedIds` and `ExifAllowedPaths` config keys can be used to
selectively allow specific tags to survive the scrubbing. This can be
useful if you want to preserve image orientation information for
example. The IDs for standard tags can be found in [1].

The path specification for `ExifAllowedPaths` relies on the format
implemented in go-exif which is "documented" in machine-readable format
in [2]. Multiple paths can be specified, separated by a space. The
path format is as follows:

    1. For tags in the main section: `IFD/<GroupName>/<FieldName>`.
       Examples: `IFD/Orientation`, `IFD/Exif/Flash`,
       `IFD/GPSInfo/GPSTimeStamp`. You will probably want to use both
       [1] and [2] in combination if you plan to specify allowed tags by
       path.
    2. Tags in the thumbnail section follow the same format but paths
       start with `IFD1/` instead of `IFD`.

[1]: https://exiv2.org/tags.html
[2]: a6301f85c8/assets/tags.yaml
2022-08-23 11:40:38 +02:00
Leon Richardt
172fff0edb
ref!: use generics to simply testing logic
Notably, this requires us to bump the Go version in order to use
generics. We now use Go 1.19.
2022-08-21 20:30:07 +02:00
Leon Richardt
bcd34a7a33
dev: add go.mod file
Not surprisingly, it is pretty simple since there are no dependencies.
2021-05-26 21:14:33 +02:00