[help] no `create project` at Poject page of gerrit

40 views
Skip to first unread message

prife zhu

unread,
Jun 16, 2016, 3:53:59 AM6/16/16
to Repo and Gerrit Discussion
Hi, I am a newbie of gerrit. after setup gerrit, I met several problems:
1) there is no `create project` at Poject page of gerrit, as the following figure shows.
2) sign out don't work

Any suggestions will be appreciated.




necessary informations:
Ubuntu 14.04-64bit
nginx/1.4.6
psql (PostgreSQL) 9.3.9


```
[gerrit]
        basePath = git
        #canonicalWebUrl = http://droi:8081/
        canonicalWebUrl = http://192.168.3.47/gerrit
[database]
        type = postgresql
        hostname = localhost
        database = reviewdb
        username = gerrit2
[index]
        type = LUCENE
[auth]
        #type = OPENID
        type = HTTP
[receive]
        enableSignedPush = false
[sendemail]
        smtpServer = localhost
[container]
        user = gerrit2
        javaHome = /usr/lib/jvm/java-7-openjdk-amd64/jre
[sshd]
        listenAddress = *:29418
[httpd]
        listenUrl = proxy-http://*:8081/gerrit
[cache]
        directory = cache
```

add following code in /etc/nginx/sites-available/default

    location /gerrit/ {
        proxy_pass http://localhost:8081;
        proxy_set_header  X-Forwarded-For $remote_addr;
        proxy_set_header  Host $host;
        auth_basic        "Gerrit Code Review";
        auth_basic_user_file /home/gerrit2/gerrit_passwd/htpasswd.conf;
    }

 I create an user named 'admin' in  /home/gerrit2/gerrit_passwd/htpasswd.conf.

Björn Pedersen

unread,
Jun 16, 2016, 4:07:13 AM6/16/16
to Repo and Gerrit Discussion
Hi,

the logic for getting the initial admin user is not based on the user name. The first user to login gets admin privileges.
Then additional user can get assigned the  admin role in All-Projects access settings.

Björn

prife zhu

unread,
Jun 16, 2016, 4:26:16 AM6/16/16
to Repo and Gerrit Discussion
Hi  Pedersen,

Thanks for your reply.

The `admin` is not registered in gerrit. I create 'admin' with  `htpasswd -c gerrit_passwd/htpasswd.conf admin`, then

add following code in /etc/nginx/sites-available/default

    location /gerrit/ {
        proxy_pass http://localhost:8081;
        proxy_set_header  X-Forwarded-For $remote_addr;
        proxy_set_header  Host $host;
        auth_basic        "Gerrit Code Review";
        auth_basic_user_file /home/gerrit2/gerrit_passwd/htpasswd.conf;
    }

Then, when I open 'http://localhost/gerrit/' in web browser, a dialog just poped, as following. input "admin" then gerrit is opened with "admin" logged in.
How could I gets admin privileges? 



在 2016年6月16日星期四 UTC+8下午4:07:13,Björn Pedersen写道:

prife zhu

unread,
Jun 16, 2016, 10:54:32 PM6/16/16
to Repo and Gerrit Discussion
I reinstall the gerrit, change sql to h2, then I can create project in web. But I still cannot sign out.


在 2016年6月16日星期四 UTC+8下午4:07:13,Björn Pedersen写道:
Hi,

Björn Pedersen

unread,
Jun 17, 2016, 3:57:06 AM6/17/16
to Repo and Gerrit Discussion
Hi,

that you can not log out is expected and documented[1] for  HTTP authentication. Thats something your login frame needs to do (with just htpassword logout is not possible, I think). 

Björn

[1] https://gerrit-review.googlesource.com/Documentation/config-sso.html#_http_basic_digest_authentication
Reply all
Reply to author
Forward
0 new messages