move to dev.sum7.eu
This commit is contained in:
parent
e474f460aa
commit
79459ff864
|
@ -1,6 +1,6 @@
|
|||
workspace:
|
||||
base: /go
|
||||
path: src/github.com/genofire/yaja
|
||||
path: src/dev.sum7.eu/genofire/yaja
|
||||
|
||||
pipeline:
|
||||
build:
|
||||
|
|
|
@ -10,13 +10,13 @@ import (
|
|||
|
||||
"golang.org/x/crypto/acme/autocert"
|
||||
|
||||
"github.com/genofire/yaja/database"
|
||||
"github.com/genofire/yaja/model/config"
|
||||
"github.com/genofire/yaja/server/extension"
|
||||
"dev.sum7.eu/genofire/yaja/database"
|
||||
"dev.sum7.eu/genofire/yaja/model/config"
|
||||
"dev.sum7.eu/genofire/yaja/server/extension"
|
||||
|
||||
"github.com/genofire/golang-lib/file"
|
||||
"github.com/genofire/golang-lib/worker"
|
||||
"github.com/genofire/yaja/server"
|
||||
"dev.sum7.eu/genofire/golang-lib/file"
|
||||
"dev.sum7.eu/genofire/golang-lib/worker"
|
||||
"dev.sum7.eu/genofire/yaja/server"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"errors"
|
||||
"sync"
|
||||
|
||||
"github.com/genofire/yaja/model"
|
||||
"dev.sum7.eu/genofire/yaja/model"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
|
2
main.go
2
main.go
|
@ -1,6 +1,6 @@
|
|||
package main
|
||||
|
||||
import "github.com/genofire/yaja/cmd"
|
||||
import "dev.sum7.eu/genofire/yaja/cmd"
|
||||
|
||||
func main() {
|
||||
cmd.Execute()
|
||||
|
|
|
@ -3,8 +3,8 @@ package extension
|
|||
import (
|
||||
"encoding/xml"
|
||||
|
||||
"github.com/genofire/yaja/messages"
|
||||
"github.com/genofire/yaja/server/utils"
|
||||
"dev.sum7.eu/genofire/yaja/messages"
|
||||
"dev.sum7.eu/genofire/yaja/server/utils"
|
||||
)
|
||||
|
||||
type IQExtensions []IQExtension
|
||||
|
|
|
@ -3,9 +3,9 @@ package extension
|
|||
import (
|
||||
"encoding/xml"
|
||||
|
||||
"github.com/genofire/yaja/database"
|
||||
"github.com/genofire/yaja/messages"
|
||||
"github.com/genofire/yaja/server/utils"
|
||||
"dev.sum7.eu/genofire/yaja/database"
|
||||
"dev.sum7.eu/genofire/yaja/messages"
|
||||
"dev.sum7.eu/genofire/yaja/server/utils"
|
||||
)
|
||||
|
||||
type IQDisco struct {
|
||||
|
|
|
@ -3,8 +3,8 @@ package extension
|
|||
import (
|
||||
"encoding/xml"
|
||||
|
||||
"github.com/genofire/yaja/messages"
|
||||
"github.com/genofire/yaja/server/utils"
|
||||
"dev.sum7.eu/genofire/yaja/messages"
|
||||
"dev.sum7.eu/genofire/yaja/server/utils"
|
||||
)
|
||||
|
||||
type IQExtensionDiscovery struct {
|
||||
|
|
|
@ -3,8 +3,8 @@ package extension
|
|||
import (
|
||||
"encoding/xml"
|
||||
|
||||
"github.com/genofire/yaja/messages"
|
||||
"github.com/genofire/yaja/server/utils"
|
||||
"dev.sum7.eu/genofire/yaja/messages"
|
||||
"dev.sum7.eu/genofire/yaja/server/utils"
|
||||
)
|
||||
|
||||
//TODO Draft
|
||||
|
|
|
@ -3,8 +3,8 @@ package extension
|
|||
import (
|
||||
"encoding/xml"
|
||||
|
||||
"github.com/genofire/yaja/messages"
|
||||
"github.com/genofire/yaja/server/utils"
|
||||
"dev.sum7.eu/genofire/yaja/messages"
|
||||
"dev.sum7.eu/genofire/yaja/server/utils"
|
||||
)
|
||||
|
||||
type IQPing struct {
|
||||
|
|
|
@ -3,8 +3,8 @@ package extension
|
|||
import (
|
||||
"encoding/xml"
|
||||
|
||||
"github.com/genofire/yaja/messages"
|
||||
"github.com/genofire/yaja/server/utils"
|
||||
"dev.sum7.eu/genofire/yaja/messages"
|
||||
"dev.sum7.eu/genofire/yaja/server/utils"
|
||||
)
|
||||
|
||||
type IQPrivate struct {
|
||||
|
|
|
@ -3,8 +3,8 @@ package extension
|
|||
import (
|
||||
"encoding/xml"
|
||||
|
||||
"github.com/genofire/yaja/messages"
|
||||
"github.com/genofire/yaja/server/utils"
|
||||
"dev.sum7.eu/genofire/yaja/messages"
|
||||
"dev.sum7.eu/genofire/yaja/server/utils"
|
||||
)
|
||||
|
||||
type IQPrivateBookmark struct {
|
||||
|
|
|
@ -3,8 +3,8 @@ package extension
|
|||
import (
|
||||
"encoding/xml"
|
||||
|
||||
"github.com/genofire/yaja/messages"
|
||||
"github.com/genofire/yaja/server/utils"
|
||||
"dev.sum7.eu/genofire/yaja/messages"
|
||||
"dev.sum7.eu/genofire/yaja/server/utils"
|
||||
)
|
||||
|
||||
type IQPrivateMetacontact struct {
|
||||
|
|
|
@ -3,8 +3,8 @@ package extension
|
|||
import (
|
||||
"encoding/xml"
|
||||
|
||||
"github.com/genofire/yaja/messages"
|
||||
"github.com/genofire/yaja/server/utils"
|
||||
"dev.sum7.eu/genofire/yaja/messages"
|
||||
"dev.sum7.eu/genofire/yaja/server/utils"
|
||||
)
|
||||
|
||||
type IQPrivateRoster struct {
|
||||
|
|
|
@ -3,9 +3,9 @@ package extension
|
|||
import (
|
||||
"encoding/xml"
|
||||
|
||||
"github.com/genofire/yaja/database"
|
||||
"github.com/genofire/yaja/messages"
|
||||
"github.com/genofire/yaja/server/utils"
|
||||
"dev.sum7.eu/genofire/yaja/database"
|
||||
"dev.sum7.eu/genofire/yaja/messages"
|
||||
"dev.sum7.eu/genofire/yaja/server/utils"
|
||||
)
|
||||
|
||||
type IQRoster struct {
|
||||
|
|
|
@ -3,7 +3,7 @@ package extension
|
|||
import (
|
||||
"encoding/xml"
|
||||
|
||||
"github.com/genofire/yaja/server/utils"
|
||||
"dev.sum7.eu/genofire/yaja/server/utils"
|
||||
)
|
||||
|
||||
type Extensions []Extension
|
||||
|
|
|
@ -3,7 +3,7 @@ package extension
|
|||
import (
|
||||
"encoding/xml"
|
||||
|
||||
"github.com/genofire/yaja/server/utils"
|
||||
"dev.sum7.eu/genofire/yaja/server/utils"
|
||||
)
|
||||
|
||||
type Message struct {
|
||||
|
|
|
@ -3,8 +3,8 @@ package extension
|
|||
import (
|
||||
"encoding/xml"
|
||||
|
||||
"github.com/genofire/yaja/messages"
|
||||
"github.com/genofire/yaja/server/utils"
|
||||
"dev.sum7.eu/genofire/yaja/messages"
|
||||
"dev.sum7.eu/genofire/yaja/server/utils"
|
||||
)
|
||||
|
||||
type Presence struct {
|
||||
|
|
|
@ -4,12 +4,12 @@ import (
|
|||
"crypto/tls"
|
||||
"net"
|
||||
|
||||
"github.com/genofire/yaja/database"
|
||||
"github.com/genofire/yaja/model"
|
||||
"github.com/genofire/yaja/server/extension"
|
||||
"github.com/genofire/yaja/server/toclient"
|
||||
"github.com/genofire/yaja/server/toserver"
|
||||
"github.com/genofire/yaja/server/utils"
|
||||
"dev.sum7.eu/genofire/yaja/database"
|
||||
"dev.sum7.eu/genofire/yaja/model"
|
||||
"dev.sum7.eu/genofire/yaja/server/extension"
|
||||
"dev.sum7.eu/genofire/yaja/server/toclient"
|
||||
"dev.sum7.eu/genofire/yaja/server/toserver"
|
||||
"dev.sum7.eu/genofire/yaja/server/utils"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"golang.org/x/crypto/acme/autocert"
|
||||
)
|
||||
|
|
|
@ -4,9 +4,9 @@ import (
|
|||
"crypto/tls"
|
||||
"fmt"
|
||||
|
||||
"github.com/genofire/yaja/messages"
|
||||
"github.com/genofire/yaja/model"
|
||||
"github.com/genofire/yaja/server/utils"
|
||||
"dev.sum7.eu/genofire/yaja/messages"
|
||||
"dev.sum7.eu/genofire/yaja/model"
|
||||
"dev.sum7.eu/genofire/yaja/server/utils"
|
||||
"golang.org/x/crypto/acme/autocert"
|
||||
)
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package state
|
||||
|
||||
import (
|
||||
"github.com/genofire/yaja/server/extension"
|
||||
"github.com/genofire/yaja/server/utils"
|
||||
"dev.sum7.eu/genofire/yaja/server/extension"
|
||||
"dev.sum7.eu/genofire/yaja/server/utils"
|
||||
)
|
||||
|
||||
// SendingClient state
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package state
|
||||
|
||||
import "github.com/genofire/yaja/server/utils"
|
||||
import "dev.sum7.eu/genofire/yaja/server/utils"
|
||||
|
||||
// State processes the stream and moves to the next state
|
||||
type State interface {
|
||||
|
|
|
@ -7,11 +7,11 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/genofire/yaja/database"
|
||||
"github.com/genofire/yaja/messages"
|
||||
"github.com/genofire/yaja/server/extension"
|
||||
"github.com/genofire/yaja/server/state"
|
||||
"github.com/genofire/yaja/server/utils"
|
||||
"dev.sum7.eu/genofire/yaja/database"
|
||||
"dev.sum7.eu/genofire/yaja/messages"
|
||||
"dev.sum7.eu/genofire/yaja/server/extension"
|
||||
"dev.sum7.eu/genofire/yaja/server/state"
|
||||
"dev.sum7.eu/genofire/yaja/server/utils"
|
||||
"golang.org/x/crypto/acme/autocert"
|
||||
)
|
||||
|
||||
|
@ -64,24 +64,26 @@ func (state *TLSStream) Process() state.State {
|
|||
return state
|
||||
}
|
||||
|
||||
fmt.Fprintf(state.Client.Conn, `<?xml version='1.0'?>
|
||||
<stream:stream id='%x' version='1.0' xmlns='%s' xmlns:stream='%s'>`,
|
||||
utils.CreateCookie(), messages.NSClient, messages.NSStream)
|
||||
|
||||
if state.domainRegisterAllowed(state.Client.JID) {
|
||||
fmt.Fprintf(state.Client.Conn, `<stream:features>
|
||||
<mechanisms xmlns='%s'>
|
||||
<mechanism>PLAIN</mechanism>
|
||||
</mechanisms>
|
||||
<register xmlns='%s'/>
|
||||
</stream:features>`,
|
||||
fmt.Fprintf(state.Client.Conn, `<?xml version='1.0'?>
|
||||
<stream:stream id='%x' version='1.0' xmlns='%s' xmlns:stream='%s'>
|
||||
<stream:features>
|
||||
<register xmlns='%s'/>
|
||||
<mechanisms xmlns='%s'>
|
||||
<mechanism>PLAIN</mechanism>
|
||||
</mechanisms>
|
||||
</stream:features>`,
|
||||
utils.CreateCookie(), messages.NSClient, messages.NSStream,
|
||||
messages.NSSASL, messages.NSFeaturesIQRegister)
|
||||
} else {
|
||||
fmt.Fprintf(state.Client.Conn, `<stream:features>
|
||||
<mechanisms xmlns='%s'>
|
||||
<mechanism>PLAIN</mechanism>
|
||||
</mechanisms>
|
||||
</stream:features>`,
|
||||
fmt.Fprintf(state.Client.Conn, `<?xml version='1.0'?>
|
||||
<stream:stream id='%x' version='1.0' xmlns='%s' xmlns:stream='%s'>
|
||||
<stream:features>
|
||||
<mechanisms xmlns='%s'>
|
||||
<mechanism>PLAIN</mechanism>
|
||||
</mechanisms>
|
||||
</stream:features>`,
|
||||
utils.CreateCookie(), messages.NSClient, messages.NSStream,
|
||||
messages.NSSASL)
|
||||
}
|
||||
|
||||
|
@ -166,12 +168,13 @@ func (state *AuthedStart) Process() state.State {
|
|||
return nil
|
||||
}
|
||||
fmt.Fprintf(state.Client.Conn, `<?xml version='1.0'?>
|
||||
<stream:stream id='%x' version='1.0' xmlns='%s' xmlns:stream='%s'>`,
|
||||
utils.CreateCookie(), messages.NSClient, messages.NSStream)
|
||||
|
||||
fmt.Fprintf(state.Client.Conn, `<stream:features>
|
||||
<bind xmlns='%s'/>
|
||||
</stream:features>`,
|
||||
<stream:stream xmlns:stream='%s' xml:lang='en' from='%s' id='%x' version='1.0' xmlns='%s'>
|
||||
<stream:features>
|
||||
<bind xmlns='%s'>
|
||||
<required/>
|
||||
</bind>
|
||||
</stream:features>`,
|
||||
messages.NSStream, state.Client.JID.Domain, utils.CreateCookie(), messages.NSClient,
|
||||
messages.NSBind)
|
||||
|
||||
return state.Next
|
||||
|
|
|
@ -4,11 +4,11 @@ import (
|
|||
"encoding/xml"
|
||||
"fmt"
|
||||
|
||||
"github.com/genofire/yaja/database"
|
||||
"github.com/genofire/yaja/messages"
|
||||
"github.com/genofire/yaja/model"
|
||||
"github.com/genofire/yaja/server/state"
|
||||
"github.com/genofire/yaja/server/utils"
|
||||
"dev.sum7.eu/genofire/yaja/database"
|
||||
"dev.sum7.eu/genofire/yaja/messages"
|
||||
"dev.sum7.eu/genofire/yaja/model"
|
||||
"dev.sum7.eu/genofire/yaja/server/state"
|
||||
"dev.sum7.eu/genofire/yaja/server/utils"
|
||||
)
|
||||
|
||||
type RegisterFormRequest struct {
|
||||
|
|
|
@ -6,11 +6,11 @@ import (
|
|||
"encoding/xml"
|
||||
"fmt"
|
||||
|
||||
"github.com/genofire/yaja/database"
|
||||
"github.com/genofire/yaja/messages"
|
||||
"github.com/genofire/yaja/server/extension"
|
||||
"github.com/genofire/yaja/server/state"
|
||||
"github.com/genofire/yaja/server/utils"
|
||||
"dev.sum7.eu/genofire/yaja/database"
|
||||
"dev.sum7.eu/genofire/yaja/messages"
|
||||
"dev.sum7.eu/genofire/yaja/server/extension"
|
||||
"dev.sum7.eu/genofire/yaja/server/state"
|
||||
"dev.sum7.eu/genofire/yaja/server/utils"
|
||||
"golang.org/x/crypto/acme/autocert"
|
||||
)
|
||||
|
||||
|
@ -90,14 +90,14 @@ func (state *TLSStream) Process() state.State {
|
|||
}
|
||||
|
||||
fmt.Fprintf(state.Client.Conn, `<?xml version='1.0'?>
|
||||
<stream:stream id='%x' version='1.0' xmlns='%s' xmlns:stream='%s'>`,
|
||||
utils.CreateCookie(), messages.NSClient, messages.NSStream)
|
||||
|
||||
fmt.Fprintf(state.Client.Conn, `<stream:features>
|
||||
<stream:stream id='%x' version='1.0' xmlns='%s' xmlns:stream='%s'>
|
||||
<stream:features>
|
||||
<mechanisms xmlns='%s'>
|
||||
<mechanism>EXTERNAL</mechanism>
|
||||
</mechanisms>
|
||||
<bidi xmlns='urn:xmpp:features:bidi'/>
|
||||
</stream:features>`,
|
||||
utils.CreateCookie(), messages.NSClient, messages.NSStream,
|
||||
messages.NSSASL)
|
||||
|
||||
return state.Next
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"encoding/xml"
|
||||
"net"
|
||||
|
||||
"github.com/genofire/yaja/model"
|
||||
"dev.sum7.eu/genofire/yaja/model"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/genofire/yaja/model"
|
||||
"dev.sum7.eu/genofire/yaja/model"
|
||||
)
|
||||
|
||||
// Cookie is used to give a unique identifier to each request.
|
||||
|
|
Reference in New Issue