Cur only the specified apiExposedURL can be use with OAuth, But offen we may have Wan/Lan/Vpn url request to agola/gitea. In this situation, Then I try to set multi OAuth with diff url:
Urls:
agola-domain
http://domain/oauth2/callback
agola-lan (## test this)
http://lan:8000/oauth2/callback
agola-vpn
http://vpn:8000/oauth2/callback
Set OAuth returns OK:
##setOAuth
api=lan:8000
gitea=xxx-gitea:9443
id=cxxxa00
sec=xxa4xxxxewpYk=
rsource=gitea-sam-lan
docker run --rm sorintlab/agolademo --token "admintoken" --gateway-url http://$api remotesource create \
--name $rsource \
--type gitea \
--api-url https://$gitea \
--auth-type oauth2 \
--clientid $id \
--secret $sec \
--skip-ssh-host-key-check
2019-11-05T06:04:20.774Z INFO cmd/remotesourcecreate.go:110 creating remotesource
2019-11-05T06:04:21.070Z INFO cmd/remotesourcecreate.go:115 remotesource gitea-sam-lan created, ID: ab4186xxxx7383a1
OAuth login get err:
redirect_uri=http%3A%2F%2F6.6.6.197%3A8000%2Foauth2%2Fcallback
6.6.6.197 just to be Vpn-ip that set in agola with apiExposedURL
. Not http://lan:8000/oauth2/callback
set in gitea.