Can't push (error 401)


#1

I’m using Gogs v 0.11.79.1211 on Windows 10 and SQL lite as database.

Here is my app.ini value.

APP_NAME = Gogs
RUN_USER = MYPC$
RUN_MODE = prod

[database]
DB_TYPE  = sqlite3
HOST     = 127.0.0.1:3306
NAME     = gogs
USER     = root
PASSWD   = 
SSL_MODE = disable
PATH     = D:/my-work-spaces/gogs/data/gogs.db

[repository]
ROOT = D:/my-work-spaces/gogs/gogs-repositories

[server]
DOMAIN       = localhost
HTTP_PORT    = 90
ROOT_URL     = http://gogs.test-localhost.com/
DISABLE_SSH  = false
START_SSH_SERVER = true
SSH_PORT = 29419
SSH_LISTEN_PORT = 29419
OFFLINE_MODE = false
APP_DATA_PATH = D:/my-work-spaces/gogs/data

[mailer]
ENABLED = false

[service]
REGISTER_EMAIL_CONFIRM = false
ENABLE_NOTIFY_MAIL     = false
DISABLE_REGISTRATION   = true
ENABLE_CAPTCHA         = false
REQUIRE_SIGNIN_VIEW    = false
ENABLE_REVERSE_PROXY_AUTHENTICATION = true

[picture]
DISABLE_GRAVATAR        = false
ENABLE_FEDERATED_AVATAR = false

[session]
PROVIDER = file

[log]
MODE      = file
LEVEL     = Info
ROOT_PATH = D:/my-work-spaces/gogs/log

[security]
INSTALL_LOCK = true
SECRET_KEY   = xxxxxxxxx
LOGIN_REMEMBER_DAYS = 20
COOKIE_USERNAME = localhost_gogs
COOKIE_REMEMBER_NAME = localhost_gogs_autologin
REVERSE_PROXY_AUTHENTICATION_USER = X-Forwarded-User

And here is my apache vhost config.

<VirtualHost *:80>
	# Proxy for Gogs.
	ProxyPreserveHost On
	ProxyRequests Off
	ProxyVia Off
	ProxyPreserveHost On
	<Proxy>
		AddDefaultCharset off
		Order deny,allow
		Allow from all
	</Proxy>
	ProxyPass / http://localhost:90/
	ProxyPassreverse / http://localhost:90/
	RequestHeader set X-Forwarded-Context /
	# Virtual host config. -----------------------------------
	ServerAdmin admin@test.vcom
    ServerName gogs.test-localhost.com
    ErrorLog "logs/gogs.test-localhost.com-error.log"
    CustomLog "logs/gogs.test-localhost.com-access.log" common
</VirtualHost>

<VirtualHost *:443>
	# Proxy for Gogs.
	ProxyPreserveHost On
	ProxyRequests Off
	ProxyVia Off
	ProxyPreserveHost On
	<Proxy>
		AddDefaultCharset off
		Order deny,allow
		Allow from all
	</Proxy>
	ProxyPass / http://localhost:90/
	ProxyPassreverse / http://localhost:90/
	RequestHeader set X-Forwarded-Context /
	# Virtual host config. -----------------------------------
	ServerAdmin admin@test.vcom
    ServerName gogs.test-localhost.com
    ErrorLog "logs/gogs.test-localhost.com-error.log"
    CustomLog "logs/gogs.test-localhost.com-access.log" common
	SSLEngine on
	SSLCertificateFile "C:/wwwserver/apache/Apache24/conf/server.crt"
	SSLCertificateKeyFile "C:/wwwserver/apache/Apache24/conf/server.key"
</VirtualHost>

I tried to create repository, clone (using git bash), modify the file, and push (using git bash and Netbeans) on https://try.gogs.io and everything is working fine.
Commit and push using Netbeans is working.

But do the same way with my localhost Gogs, it is unable to push using Netbeans.
I get this error message.

http://vee@gogs.test-localhost.com/vee/rd-wpps-updater.git: 401 Unauthorized

What do I have to do with app.ini or anything?


#2

In most cases, your IDE just remembered/stored wrong username and/or password.