sum7
/
yaja
Archived
1
0
Fork 0

move to dev.sum7.eu

This commit is contained in:
Martin/Geno 2018-02-07 15:34:18 +01:00
parent e474f460aa
commit 79459ff864
No known key found for this signature in database
GPG Key ID: F0D39A37E925E941
26 changed files with 92 additions and 89 deletions

View File

@ -1,6 +1,6 @@
workspace:
base: /go
path: src/github.com/genofire/yaja
path: src/dev.sum7.eu/genofire/yaja
pipeline:
build:

View File

@ -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"

View File

@ -4,7 +4,7 @@ import (
"errors"
"sync"
"github.com/genofire/yaja/model"
"dev.sum7.eu/genofire/yaja/model"
log "github.com/sirupsen/logrus"
)

View File

@ -1,6 +1,6 @@
package main
import "github.com/genofire/yaja/cmd"
import "dev.sum7.eu/genofire/yaja/cmd"
func main() {
cmd.Execute()

View File

@ -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

View File

@ -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 {

View File

@ -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 {

View File

@ -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

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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

View File

@ -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 {

View File

@ -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 {

View File

@ -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"
)

View File

@ -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"
)

View File

@ -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

View File

@ -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 {

View File

@ -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

View File

@ -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 {

View File

@ -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

View File

@ -4,7 +4,7 @@ import (
"encoding/xml"
"net"
"github.com/genofire/yaja/model"
"dev.sum7.eu/genofire/yaja/model"
log "github.com/sirupsen/logrus"
)

View File

@ -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.