Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work with groonga-httpd with BASIC authentication #1

Closed
yoshihara opened this issue Oct 14, 2017 · 4 comments
Closed

Work with groonga-httpd with BASIC authentication #1

yoshihara opened this issue Oct 14, 2017 · 4 comments

Comments

@yoshihara
Copy link

(日本語)twitterでご連絡したとおりの内容です。設定内容や手順など書きましたので調査のご参考になれば幸いです。(ファイルは多かったのでgistに入れました)もし何かありましたらこちらのコメントもしくはtwitterにてご連絡いただければ幸いです。


Hi,

I use embulk-output-groonga to insert data to groonga-httpd.
The groonga-httpd server has configuration for BASIC authentication, but I can do it without id/pass for BASIC auth unexpectedly. Would you please tell me this is the correct work ?

I prepare files to reproduce this, here https://gist.github.com/yoshihara/bed63fca0f852aed282f93f7c73b9e99 .
This groonga-httpd server has BASIC authentication groonga / test .

How to reproduce:

% sudo docker build -f Dockerfile -t yoshihara/groonga-test ./
% sudo docker run -v $PWD:/groonga -p 10041:10041  -d yoshihara/groonga-test
% embulk run embulk_config.yml

This is embulk run output:

2017-10-14 19:05:56.101 +0900: Embulk v0.8.34
2017-10-14 19:06:01.892 +0900 [INFO] (0001:transaction): Loaded plugin embulk-output-groonga (0.1.1)
2017-10-14 19:06:01.920 +0900 [INFO] (0001:transaction): Listing local files at directory '.' filtering filename by prefix 'test.csv'
2017-10-14 19:06:01.922 +0900 [INFO] (0001:transaction): "follow_symlinks" is set false. Note that symbolic links to directories are skipped.
2017-10-14 19:06:01.928 +0900 [INFO] (0001:transaction): Loading files [test.csv]
2017-10-14 19:06:01.978 +0900 [INFO] (0001:transaction): Using local thread executor with max_threads=8 / output tasks 4 = input tasks 1 * 4
2017-10-14 19:06:02.023 +0900 [INFO] (0001:transaction): {done:  0 / 1, running: 0}
2017-10-14 19:06:02.721 +0900 [INFO] (embulk-output-executor-0): groonga inserted 3 / 3
2017-10-14 19:06:02.724 +0900 [INFO] (0001:transaction): {done:  1 / 1, running: 0}
2017-10-14 19:06:02.735 +0900 [INFO] (main): Committed.
2017-10-14 19:06:02.736 +0900 [INFO] (main): Next config diff: {"in":{"last_path":"test.csv"},"out":{}}

Using Groonga version is 6.1,5. embulk-output-groonga is 0.1.1.
Thanks.

@hiroyuki-sato
Copy link
Owner

@yoshihara
Copy link
Author

yoshihara commented Oct 27, 2017

This patch makes my expected response by curl http://localhost:10041/d/status (gets 401) :

diff --git a/groonga-httpd.conf b/groonga-httpd.conf
index 0279737..962f84c 100644
--- a/groonga-httpd.conf
+++ b/groonga-httpd.conf
@@ -44,6 +44,9 @@ http {
     server_name localhost;
 
     location /d/ {
+      auth_basic "Restricted";
+      auth_basic_user_file /etc/nginx/.htpasswd;
+
       groonga on;
       # You can disable log for Groonga.
       groonga_log_path /var/lib/groonga/log/log;

After applying this patch, curl -u groonga:test http://localhost:10041/d/status gets status info correctly.

@yoshihara
Copy link
Author

I use embulk-output-groonga v0.1.2 so this problem is fixed. Thanks! :)

@hiroyuki-sato
Copy link
Owner

Thank you!
Fixed by #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants