Skip to content

Commit

Permalink
mod_filestore: add simple test function to test the filestore connect…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
mworrell committed Dec 24, 2021
1 parent 90db6f2 commit 58a2296
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/mod_filestore/support/filestore_admin.erl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
-export([
event/2,
task_file_to_local/1,
task_file_to_remote/1
task_file_to_remote/1,

testcred/1
]).

-include_lib("zotonic.hrl").
Expand Down Expand Up @@ -74,6 +76,12 @@ event(#submit{message=admin_filestore_queue}, Context) ->

-define(DATA, <<"Geen wolkje aan de lucht.">>).

testcred(Context) ->
S3Url = m_config:get_value(mod_filestore, s3url, Context),
S3Key = m_config:get_value(mod_filestore, s3key, Context),
S3Secret = m_config:get_value(mod_filestore, s3secret, Context),
testcred(S3Url, S3Key, S3Secret, false).

% Try a put, get, and delete sequence - optionally create private bucket
testcred(S3Url, S3Key, S3Secret, IsCreateBucket)
when is_binary(S3Url), is_binary(S3Key), is_binary(S3Secret) ->
Expand Down

0 comments on commit 58a2296

Please sign in to comment.