gerrit-oauth-provider: Gerrit's page hangs while trying to do "Sing In"
Hi,
I’m trying to start a gerrit instance with this plugin but when auth.type set to OAUTH I can’t register new user since browser hangs (it keep loading page with “Waiting for testgerrit.example.com…”) every time I click on “Sign In”.
Here is the script I’m using on my testing machine:
#!/bin/bash -e
set -x
/var/lib/gerrit/bin/gerrit.sh stop --site-path /var/lib/gerrit || echo ""
rm -rf /var/lib/gerrit
mkdir -p /var/lib/gerrit/plugins
mkdir -p /var/lib/gerrit/etc
wget --directory-prefix /var/lib/gerrit https://gerrit-releases.storage.googleapis.com/gerrit-2.11.war
wget --directory-prefix /var/lib/gerrit/plugins https://github.com/davido/gerrit-oauth-provider/releases/download/v2.11/gerrit-oauth-provider.jar
cp /home/gerrit.config /var/lib/gerrit/etc/gerrit.config
java -jar /var/lib/gerrit/gerrit-2.11.war init --batch -d /var/lib/gerrit
java -jar /var/lib/gerrit/gerrit-2.11.war reindex -d /var/lib/gerrit
/var/lib/gerrit/bin/gerrit.sh start --site-path /var/lib/gerrit
I’ve tried both google and github. Result is the same.
Here is a configuration I have after java -jar ... init:
> cat /var/lib/gerrit/etc/gerrit.config
[gerrit]
basePath = git
canonicalWebUrl = http://testgerrit.example.com/
[database]
type = h2
database = db/ReviewDB
[index]
type = LUCENE
[auth]
type = OAUTH
[sendemail]
smtpServer = localhost
[container]
user = root
javaHome = /usr/lib/jvm/java-7-openjdk-amd64/jre
[sshd]
listenAddress = *:29418
[httpd]
listenUrl = http://*:80/
[cache]
directory = cache
[plugin "gerrit-oauth-provider-google-oauth"]
client-id = 37xxxxx6c.apps.googleusercontent.com
client-secret = 7qxxxxxjK
link-to-existing-openid-accounts = true
Thanks, Ruslan
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 26 (11 by maintainers)
For an alternative view of this, read https://www.2uo.de/myths-about-urandom/.
There, the author claims that it’s ok to use
/dev/urandom(which is non-blocking) for cryptographic purposes, and is actually preferred to/dev/random(which is blocking, can causes this problem).If that is true, we should switch to using
/dev/urandom, which would solve this problem (Gerrit hanging on sign-in when using the OAuth plugin).I’l have a poke around and see if I can find any other write-ups about this.