mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-24 08:57:03 -05:00
use local fqdn for generated user email
This commit is contained in:
parent
5a7f6f15a6
commit
a1ca7e958a
1 changed files with 7 additions and 1 deletions
|
@ -6,6 +6,7 @@ package activitypub
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"code.gitea.io/gitea/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
|
@ -268,7 +269,12 @@ func createUserFromAP(ctx *context.APIContext, personID forgefed.PersonID) (*use
|
||||||
}
|
}
|
||||||
log.Info("RepositoryInbox: validated person: %q", person)
|
log.Info("RepositoryInbox: validated person: %q", person)
|
||||||
|
|
||||||
email := fmt.Sprintf("f%v@%v", uuid.New().String(), personID.Host)
|
localFqdn, err := url.ParseRequestURI(setting.AppURL)
|
||||||
|
if err != nil {
|
||||||
|
return &user_model.User{}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
email := fmt.Sprintf("f%v@%v", uuid.New().String(), localFqdn.Hostname())
|
||||||
loginName := personID.AsLoginName()
|
loginName := personID.AsLoginName()
|
||||||
name := fmt.Sprintf("%v%v", person.PreferredUsername.String(), personID.HostSuffix())
|
name := fmt.Sprintf("%v%v", person.PreferredUsername.String(), personID.HostSuffix())
|
||||||
log.Info("RepositoryInbox: person.Name: %v", person.Name)
|
log.Info("RepositoryInbox: person.Name: %v", person.Name)
|
||||||
|
|
Loading…
Reference in a new issue