Happy New Year. About the htpasswd auth with gitea possibility and solution


Wellcome 2019. Happy New Year.

I run gogs and gos docker container image well. (Without my ideal htpasswd(http basic auth) authorization.)

Without “http basic auth”, the web site is exposed to anyone. Also, I successfully run “git clone” and “git push” well via terminal.:grinning:

But, my ideal configuration is to make “http basic auth” for web. This “http basic auth” require the credentials on web and terminal. My wish is only on web, not on terminal with “git clone” and “git push”.

I found the “http basic auth” has “some interaction” with the git server its authorization. For example, a user must input its username and password when he/she run “git clone” or “git push”. After finishing input, it bump up the authorization fail message.

The prompt is for requiring credentials which is not explicitly to say which credentials is. (The file of http basic auth file or git database.)

So, I have the question.

  1. Is able to add the head on Nginx or Apache and make gitea know the right credentials?

  2. Or, is able to have a proper Nginx or Apache configuration for avoiding the authorization mechanism which is raised via gitea?

I found a way to get worked if I input the registered users credentials from git database to “http basic auth file”. However, it is no sense to get known the registered users’ password. (The database is to encode the password.) Is it a way to integrate the credentials on both gitea database and htpasswd? Maybe this is the third question.

But, I still want that it can be done via this way. A way is a simple SSO via htpasswd. If possible, how to do it? Wish some kind tutorials, advice and comment. :grinning::grinning::fireworks::fireworks:

I used Nginx reversed proxy. If I am lucky, I also wish the configurations for Nginx. In addition, I run git database on docker container.

I had posted it on gogs discussion.

Because I try to configure the ideal git server. I had referred many articles about Nginx configuration tips, docker container’s system tip and knowledge and git database.

If you are quite beginning in this configuration and its know-how, I would like to share those article for you. (All of them are on internet. But, I read them.) Thanks.

Welcome any comment. Wish you have a wonderful 2019. Thanks again. :fireworks: