Commit Graph

78 Commits

Author SHA1 Message Date
2b9575c51a
actually pass file type to image::write() 2022-06-11 06:40:00 +02:00
e4b246bc75
remove debug statement 2022-06-11 06:27:26 +02:00
78a7184250
allow requesting file type, try to guess right quality 2022-06-11 06:16:12 +02:00
6aa3b40faa
Read images from file, allow forcing magick 2022-06-11 05:28:55 +02:00
17205298cd
implement fallbacks 2022-06-11 04:46:54 +02:00
cb354e666d
move types to types.hpp, match hash to email 2022-06-11 04:29:05 +02:00
cbd86c7000
Generate hashtable 2022-06-09 20:53:26 +02:00
03ae11a842
Parse REQUEST_URI 2022-06-09 04:28:50 +02:00
7316fe90e3
start of rewrite
- update CMake files
- add QA and formatting configs
2022-06-09 02:31:30 +02:00
3433f88dcc
Don't allow redirections to external websites.
All checks were successful
continuous-integration/drone/push Build is passing
See <https://cwe.mitre.org/data/definitions/601.html>.
2021-11-26 04:45:59 +01:00
891d5d3ca3
Update formatting, add namespace and fix a few warnings.
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-24 11:25:15 +02:00
a0db3380b1
Detect which file-system-header to include more reliably. 2020-10-24 10:55:35 +02:00
Nicholas Guriev
a7c89b0e3f
Do not reopen stdout while image resizing
On Linux, some web-servers (Apache in particular) close file with fd = 1 and
offer something else as stdout. Notable difference can be seen with a pipe and
an immediate redirection. Consider:

  $ REQUEST_URI=/avatar/68b329da9893e34099c7d8ad5cb9c940 libravatarserv | cat > /tmp/response1.out
  $ REQUEST_URI=/avatar/68b329da9893e34099c7d8ad5cb9c940 libravatarserv > /tmp/response2.out
  $ diff -s /tmp/response{1,2}.out
  Binary files /tmp/response1.out and /tmp/response2.out differ

Solution.

The output should be identical in both cases. So do not let ImageMagick to open
/dev/stdout by itself, instead write the resulted image to an in-memory buffer
and then to a file associated with the "cout" global object.
2020-10-23 21:13:47 +03:00
de7e61a2fe
Update copyright years.
All checks were successful
the build was successful
2019-02-28 19:49:46 +01:00
1a4ebaf024
Fixed the bug introduced by latest bugfix. m(
All checks were successful
the build was successful
We included ?/& in the search, but forgot to set the pos +1 char to
the right.
2019-02-28 19:05:27 +01:00
3f32e4ff51
Bugfix: "forcedefault" would be treated as "default".
All checks were successful
the build was successful
2019-02-28 18:54:50 +01:00
00a29894e9
Fixed background color for identicons.
All checks were successful
the build was successful
It was 2 characters too short. That resulted in an error.
2019-02-28 18:24:52 +01:00
97099f0a8a
retro and identicon is now 5x5.
All checks were successful
the build was successful
ivatar changed the size of retro to 5x5, mirroring that.
2019-02-28 17:53:52 +01:00
fba5c64486
Adjust identicons to match ivatar (10x10, padding, colors, retro = identicon).
All checks were successful
the build was successful
2019-02-20 23:12:48 +01:00
021e9cfc1d
Initialize variables in Request and Image. 2019-02-20 03:04:23 +01:00
ee6a113e1a
Re-use Image object for identicons. 2019-02-20 03:03:09 +01:00
7e41468176
Set identicons to png
All checks were successful
the build was successful
2018-12-27 06:55:16 +01:00
68ac890eab
Switched identicon algorithm to sigil.
All checks were successful
the build was successful
2018-12-27 00:18:24 +01:00
a909b0405c
Deleted old identicon code. 2018-12-26 05:55:18 +01:00
41299b9529
Transformed some errors into warnings. 2018-12-26 05:47:06 +01:00
1dd89882b1
Switched to identiconpp for identicon-generation. 2018-12-26 05:45:31 +01:00
d2d35d8ac5
If requested size is < 0, return 80px image.
All checks were successful
the build was successful
2018-12-09 19:54:38 +01:00
f7d6bdc3e9
Moved Cache-Control header from program to nginx config. 2018-12-09 19:50:05 +01:00
9aa8803029
Return 501 or redirect if "Mystery Person" is not found.
All checks were successful
the build was successful
2018-12-06 22:03:59 +01:00
b00dce398e
Removed header: "Connection: close"
All checks were successful
the build was successful
I'm not sure what my motivation was to put it in there. It has no
place in a CGI program.
2018-12-03 22:07:51 +01:00
3666be0872
Added "public" to Cache-Control header.
All checks were successful
the build was successful
"max-age" already indicates that it can be cached, but it can't hurt
to allow it explicitly.
2018-12-03 21:27:26 +01:00
3bdcd7b120
Include only necessary Magick++-headers.
All checks were successful
the build was successful
2018-12-01 11:33:32 +01:00
785cd7a35f
Refactored settings-stuff into own file.
All checks were successful
the build was successful
2018-11-30 07:00:37 +01:00
06a1bfccd9
Exit with error code 1 if request is bad 2018-11-30 06:54:56 +01:00
1aca78df88
Check if hash is valid 2018-11-30 06:48:45 +01:00
513391f44b
Replaced "\n\n" with << endl << endl for consistency
All checks were successful
the build was successful
2018-11-29 13:45:46 +01:00
268ff7ab6f
If size=0, return standard size(80px) 2018-11-29 13:43:56 +01:00
ec140aad01
Bugfix: detect file type and send appropriate Content-Type. 2018-11-29 13:40:50 +01:00
f670c1c8a1
Abort if favicon is requested.
All checks were successful
the build was successful
2018-11-28 17:29:08 +01:00
b0e267f13f
Refactored a tiny little bit.
All checks were successful
the build was successful
2018-11-28 16:15:10 +01:00
4418251844
Initialize default fallback with "404"
All checks were successful
the build was successful
2018-11-28 14:56:15 +01:00
3e037d4936
Changed the HTTP Status responses to be more accurate
All checks were successful
the build was successful
2018-11-28 10:31:20 +01:00
30020024bd
Install README.md
All checks were successful
the build was successful
2018-11-27 17:57:55 +01:00
a8c807717e
Made the documentation more coherent
All checks were successful
the build was successful
2018-11-27 17:14:35 +01:00
fbf7437dd9
Added settings to redirect to libravatar.org if the user was not found
All checks were successful
the build was successful
or the fallback is unknown.
2018-11-27 16:56:00 +01:00
4d0033652d
Added setting to configure the default fallback.
All checks were successful
the build was successful
2018-11-27 15:48:58 +01:00
cf6b1f84aa
Initialize pseudorandom number with 2^64-1
All checks were successful
the build was successful
2018-11-27 12:01:03 +01:00
87bedbbf7b
typo
All checks were successful
the build was successful
2018-11-27 10:14:44 +01:00
645554e226
Added identicon support (closes #2)
Some checks failed
the build failed
2018-11-27 10:05:35 +01:00
8cc6e73cb1
Bugfix: Return 404 if fallback is empty or unknown
All checks were successful
the build was successful
2018-11-27 05:15:46 +01:00