Commit Graph

125 Commits

Author SHA1 Message Date
Holger Weiss 63777f830d Use maps instead of dicts in HTTP upload modules
ejabberd currently depends on Erlang/OTP 17.1 or higher, so we can now
use maps.
2016-01-16 01:30:22 +01:00
Badlop f448ff608a Update copyright to 2016 (#901) 2016-01-13 12:29:14 +01:00
Matthias Rieber 0ad0fd2187 mod_http_upload: Use application/octet-stream instead of text/html for security reasons 2016-01-11 12:13:19 +01:00
Holger Weiss e1539a11be mod_http_upload: Use full PUT URL for process name
Don't just use the "put_url" domain name, but also any path components
of the specified URL, to generate a mod_http_upload process name.  This
way, a single domain name can be used for multiple virtual hosts by
specifying a "put_url" such as "https://example.com/@HOST@/".
2016-01-06 00:12:36 +01:00
Holger Weiss 3f5a20c90a mod_http_upload: Rename variable for clarity 2016-01-05 22:06:34 +01:00
Holger Weiss 94c620cc27 mod_http_upload: Fix logging of file size mismatch 2016-01-04 01:01:14 +01:00
Evgeniy Khramtsov 95265dd3ad Move JID related functions to jid.erl (#847) 2015-11-24 18:44:13 +03:00
Holger Weiss 43626f5c97 mod_http_upload: Return error atoms, not strings
Don't convert error atoms to strings before actually logging them.  This
avoids a bogus error message when a user who has no uploaded files is
removed.
2015-11-17 00:12:20 +01:00
Holger Weiss 55a92c2983 mod_http_upload: Log message if URL looks wrong
Log an [info] message if a PUT request looks like the specified
"put_url" contains a path component that doesn't match the
"request_handlers" path, as in the following configuration:

  listen:
    -
      module: ejabberd_http
      port: 5444
      request_handlers:
        "/": mod_http_upload

  modules:
    mod_http_upload:
      put_url: "http://example.com/path/"
2015-11-11 22:51:40 +01:00
Holger Weiss 20709f9880 mod_http_upload: Make case indentation consistent
Use four spaces (or the corresponding amount of tab characters) for case
indentation everywhere in mod_http_upload and mod_http_upload_quota.
2015-11-09 19:23:52 +01:00
Holger Weiss 113c315857 mod_http_upload: Apply cosmetic changes 2015-11-09 19:12:08 +01:00
Holger Weiss 842db2ca15 mod_http_upload: Don't flatten command strings 2015-11-09 18:50:45 +01:00
Holger Weiss 9c80cb2b26 mod_http_upload: Don't let identify/1 return error
Let identify/1 return 'pass' when it failed to identify the file type,
as this doesn't (necessarily) indicate an error condition.  This also
makes it consistent with the return value of convert/2.
2015-11-09 18:41:31 +01:00
Holger Weiss fec7e47169 Add copyright and license to HTTP upload modules 2015-11-04 01:22:39 +01:00
Holger Weiss 4566325241 mod_http_upload: Don't complain during shutdown
Ignore the case where, for some reason, no process is found to be
stopped.

Closes #810.
2015-11-02 23:46:58 +01:00
Holger Weiss 1b368a86b7 mod_http_upload: Use binary strings in most places
Switch to binary strings to fix a type issue, and for consistency.

Closes #808.
2015-11-02 23:46:31 +01:00
Holger Weiss 9d2f1d5f0d mod_http_upload: Check availability of ImageMagick
Log an error message during startup if the thumbnail option is enabled
but ImageMagick is not installed.
2015-11-02 01:12:10 +01:00
Holger Weiss eeb705fc2f mod_http_upload: Suppress error on non-image files
Don't log an error (but only a debug) message if ImageMagick fails to
indentify the file type for thumbnail creation.  The image might be
encrypted, or it could be a non-image file.

Closes #809.
2015-11-01 23:29:22 +01:00
Holger Weiss 915383e150 mod_http_upload: Add missing trailing dot
(Thanks to Matthias Rieber.)
2015-10-29 10:09:55 +01:00
Holger Weiss 32fe74c923 mod_http_upload: Document protocol support 2015-10-28 23:52:33 +01:00
Holger Weiss 62ea763089 mod_http_upload: Fix string()/binary() type issue 2015-10-26 22:32:12 +01:00
Holger Weiss 3e7ee6af6d mod_http_upload: Add/fix function specifications 2015-10-26 22:30:58 +01:00
Holger Weiss b5a09f8b15 mod_http_upload: Strip newline from command output
The list_to_integer/1 function doesn't cope with trailing newline
characters.
2015-10-26 22:10:32 +01:00
Evgeniy Khramtsov 6f2e178de1 Rename badly entitled record field 2015-10-26 15:05:28 +03:00
Evgeniy Khramtsov 137a4ee087 Add HTTP File Upload support (XEP-0363) 2015-10-26 14:10:55 +03:00