Commit graph

35 commits

Author SHA1 Message Date
noury
b55740aad7 implement file expiration, add basic frontend 2023-07-14 14:11:38 +02:00
Leon Richardt
4d5f23377a
Merge pull request #16 from leon-richardt/feat/better-file-extension-detection
feat: improve file extension detection
2022-10-17 20:42:02 +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
a885de840e
Merge pull request #13 from leon-richardt/fix/exif/do-not-abort-on-no-exif-data
fix(exif): don't abort upload on missing EXIF data
2022-08-23 23:10:31 +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
ffb88d9a58
Merge pull request #12 from leon-richardt/ref/error-on-unknown-config-key
ref: error out on unknown config keys
2022-08-23 12:20:43 +02:00
Leon Richardt
7985419e1e
ref: error out on unknown config keys 2022-08-23 12:04:56 +02:00
Leon Richardt
b3f6b5a590
Merge pull request #7 from leon-richardt/feat/scrub-exif
feat: add option to scrub EXIF tags on image files
2022-08-23 11:44:36 +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
445540c747
Merge pull request #11 from leon-richardt/ref/default-config
ref: provide default values for config items
2022-08-23 11:30:15 +02:00
Leon Richardt
4425398462
ref: provide default values for config items 2022-08-23 11:27:12 +02:00
Leon Richardt
413202a208
Merge pull request #9 from leon-richardt/ref/use-generics-for-testing
ref!: use generics to simply testing logic
2022-08-21 20:32:33 +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
fd1c79948a
Merge pull request #8 from pajlada/chore/ci-go-build-and-test
ci: Add build and test workflow
2022-08-21 14:00:59 +02:00
Rasmus Karlsson
667ea359ef ci: Add build and test workflow 2022-08-19 20:50:01 +02:00
Leon Richardt
153f64e07f
Merge pull request #6 from leon-richardt/fix/FileDir-test-case
fix(config_test): update test expectation for `FileDir`
2022-08-18 22:07:22 +02:00
Leon Richardt
0d5b4543be
fix(config_test): update test expectation for FileDir
The value for FileDir was updated in PR #3 but we missed also updating
the test in config_test.go. This is a hint that we should maybe setup a
GitHub Action to run tests on PRs. :-)
2022-08-18 22:04:37 +02:00
Leon Richardt
52a39f1ab2
Merge pull request #4 from leon-richardt/doc/update-readme
doc(README): update `example.conf` excerpt
2022-08-14 13:45:28 +02:00
Leon Richardt
f6dee4c429
doc(README): update example.conf excerpt
The value for `FileDir` was updated in PR #3 but we missed also updating
the `example.conf` excerpt accordingly.
2022-08-14 13:39:49 +02:00
Leon Richardt
df690928a7
Merge pull request #2 from pajlada/feat/add-dockerfile
Add Docker support
2022-08-14 13:34:12 +02:00
Rasmus Karlsson
e945a57a55 Create default FileDir directory in Dockerfile 2022-08-14 13:29:12 +02:00
Rasmus Karlsson
5cec67bfdb Add port publishing with some documentation 2022-08-14 13:29:12 +02:00
Rasmus Karlsson
ae33975668 Rename docker-publish workflow jobs 2022-08-14 13:29:12 +02:00
Rasmus Karlsson
728e6452b3 Add Docker support
Instructions for how to build & use it added to README.md

Add GitHub workflow to publishing the docker image to the
GitHub Container Repository
2022-08-14 13:29:12 +02:00
Leon Richardt
6cb1b09386
Merge pull request #3 from pajlada/chore/update-example-filedir
Update example config FileDir to `/var/www/jaf/`
2022-08-14 13:27:34 +02:00
Rasmus Karlsson
fa4b60d9d3 Update example config FileDir to /var/www/jaf/
As discussed in this PR: https://github.com/leon-richardt/jaf/pull/2
2022-08-14 13:26:17 +02:00
Leon Richardt
3b247a932f
Merge pull request #1 from leon-richardt/ref/check-file-existence
ref: check file existence instead of keeping in-memory set
2022-06-21 18:18:35 +02:00
Leon Richardt
9ca7b2a898
ref: check file existence instead of keeping in-memory set
The benefit of keeping all managed file names in memory instead of
checking on demand does not outweigh the increased memory usage.
Additionally, this method allows users to manually move files into the
served directory without fearing they might be overwritten by jaf.
2022-06-21 17:28: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
Leon Richardt
bb8cb748d9
doc: subdivide "Configuration" section 2020-10-29 10:14:11 +01:00
Leon Richardt
9cd60561e2
doc: add usage instructions to README 2020-10-29 10:12:55 +01:00
Leon Richardt
6e9346e741
doc: add license 2020-10-27 23:22:22 +01:00
Leon Richardt
2fc0dd23d0
doc: add README 2020-10-27 23:19:06 +01:00
Leon Richardt
19576ac602
ref: remove debug output 2020-10-27 17:24:10 +01:00
Leon Richardt
2b9de72507
initial commit 2020-10-27 17:18:07 +01:00