Documentation ¶
Index ¶
- Constants
- Variables
- func FreezeACL(aclEntry acl.ACL) (*freezer.ACL, error)
- func FreezeBan(ban ban.Ban) (fb *freezer.Ban)
- func FreezeGroup(group acl.Group) (*freezer.Group, error)
- func GetIP(addr net.Addr) net.IP
- func MurmurImport(filename, datadir string) (err error)
- type Channel
- func (channel *Channel) AddChild(child *Channel)
- func (channel *Channel) AddClient(client *Client)
- func (channel *Channel) AllLinks() (seen map[int]*Channel)
- func (channel *Channel) AllSubChannels() (seen map[int]*Channel)
- func (channel *Channel) DescriptionBlobHashBytes() (buf []byte)
- func (channel *Channel) Freeze() (fc *freezer.Channel, err error)
- func (channel *Channel) HasDescription() bool
- func (channel *Channel) IsEmpty() bool
- func (channel *Channel) IsTemporary() bool
- func (channel *Channel) RemoveChild(child *Channel)
- func (channel *Channel) RemoveClient(client *Client)
- func (c *Channel) Unfreeze(fc *freezer.Channel)
- type Client
- func (client *Client) ACLContext() *acl.Context
- func (client *Client) CertHash() string
- func (client *Client) ClearCaches()
- func (client *Client) Debugf(format string, v ...interface{})
- func (client *Client) Disconnect()
- func (client *Client) ForceDisconnect()
- func (client *Client) HasCertificate() bool
- func (client *Client) IsRegistered() bool
- func (client *Client) IsSuperUser() bool
- func (client *Client) IsVerified() bool
- func (client *Client) Panic(v ...interface{})
- func (client *Client) Panicf(format string, v ...interface{})
- func (client *Client) RejectAuth(rejectType mumbleproto.Reject_RejectType, reason string)
- func (client *Client) SendUDP(buf []byte) error
- func (client *Client) Session() uint32
- func (client *Client) SetDatagramAddr(addr net.Addr) error
- func (client *Client) SetStreamAddr(addr net.Addr) error
- func (client *Client) ShownName() string
- func (client *Client) Tokens() []string
- func (client *Client) UserId() int
- type ClientPredicate
- type KeyValuePair
- type Message
- type Register
- type Server
- func (server *Server) AddChannel(name string) (channel *Channel)
- func (server *Server) CheckServerPassword(password string) bool
- func (server *Server) CheckSuperUserPassword(password string) bool
- func (server *Server) ClearCaches()
- func (server *Server) CurrentPort() int
- func (server *Server) DatagramAddr() net.Addr
- func (server *Server) DatagramAddrString() string
- func (s *Server) DatagramConnection() net.PacketConn
- func (server *Server) Debugf(format string, v ...interface{})
- func (server *Server) DeleteFrozenChannel(channel *Channel)
- func (server *Server) DeleteFrozenUser(user *User)
- func (server *Server) FilterText(text string) (filtered string, err error)
- func (server *Server) Freeze() (fs *freezer.Server, err error)
- func (server *Server) FreezeToFile() error
- func (server *Server) HostAddress() string
- func (server *Server) IsCertHashBanned(hash string) bool
- func (server *Server) IsConnectionBanned(conn net.Conn) bool
- func (server *Server) IsPublic() bool
- func (server *Server) LinkChannels(channel *Channel, other *Channel)
- func (server *Server) ListenDatagram(addr net.Addr) (net.PacketConn, error)
- func (server *Server) ListenStream(addr net.Addr) (net.Listener, error)
- func (server *Server) ListenWeb(addr net.Addr) (net.Listener, error)
- func (server *Server) ListenWebPort() bool
- func (server *Server) Port() int
- func (s *Server) RegisterClient(client *Client) (uid uint32, err error)
- func (server *Server) RegisterPublicServer()
- func (server *Server) RemoveChanel(channel *Channel)
- func (server *Server) RemoveChannel(channel *Channel)
- func (server *Server) RemoveClient(client *Client, kicked bool)
- func (server *Server) RemoveExpiredBans()
- func (s *Server) RemoveRegistration(uid uint32) (err error)
- func (server *Server) ResetConfig(key string)
- func (server *Server) RootChannel() *Channel
- func (s *Server) SendDatagram(buf []byte, addr net.Addr) (err error)
- func (server *Server) Set(key string, value string)
- func (server *Server) SetServerPassword(password string)
- func (server *Server) SetSuperUserPassword(password string)
- func (server *Server) Start() (err error)
- func (server *Server) Stop() (err error)
- func (server *Server) StreamAddr() net.Addr
- func (server *Server) StreamAddrString() string
- func (s *Server) StreamListener() net.Listener
- func (server *Server) TLSAddrString() string
- func (s *Server) TLSStreamListener() net.Listener
- func (s *Server) UnfreezeBanList(fblist *freezer.BanList)
- func (server *Server) UnlinkChannels(channel *Channel, other *Channel)
- func (server *Server) UpdateConfig(key, value string)
- func (server *Server) UpdateFrozenBans(bans []ban.Ban)
- func (server *Server) UpdateFrozenChannel(channel *Channel, state *mumbleproto.ChannelState)
- func (server *Server) UpdateFrozenChannelACLs(channel *Channel)
- func (server *Server) UpdateFrozenUser(client *Client, state *mumbleproto.UserState)
- func (server *Server) UpdateFrozenUserLastChannel(client *Client)
- func (server *Server) WebAddr() net.Addr
- func (server *Server) WebAddrString() string
- func (server *Server) WebPort() int
- type User
- type VoiceBroadcast
- type VoiceTarget
Constants ¶
const ( ChannelInfoDescription int = iota ChannelInfoPosition )
const ( UserInfoName int = iota UserInfoEmail UserInfoComment UserInfoHash UserInfoPassword UserInfoLastActive )
const ( StateClientConnected = iota StateServerSentVersion StateClientSentVersion StateClientAuthenticated StateClientReady StateClientDead )
const CeltCompatBitstream = -2147483637
const DefaultPort = 64738
The default port a Murmur server listens on
const DefaultWebPort = 443
const LogOpsBeforeSync = 100
const SQLiteSupport = true
const UDPPacketSize = 1024
Variables ¶
var BlobStore blobstore.BlobStore
Functions ¶
func FreezeACL ¶
Freeze a ChannelACL into it a flattened protobuf-based structure ready to be persisted to disk.
func FreezeGroup ¶
Freeze a Group into a flattened protobuf-based structure ready to be persisted to disk.
func MurmurImport ¶
Import the structure of an existing Murmur SQLite database.
Types ¶
type Channel ¶
type Channel struct { Id int Name string Position int // ACL ACL acl.Context // Links Links map[int]*Channel // Blobs DescriptionBlob string // contains filtered or unexported fields }
A Mumble channel
func NewChannel ¶
func (*Channel) AllSubChannels ¶
AllSubChannels returns a slice of all of this channel's subchannels.
func (*Channel) DescriptionBlobHashBytes ¶
DescriptionBlobHashBytes gets the channel's blob hash as a byte slice for sending via a protobuf message. Returns nil if there is no blob.
func (*Channel) Freeze ¶
Freeze a channel into a flattened protobuf-based struct ready to be persisted to disk.
func (*Channel) HasDescription ¶
HasDescription Does the channel have a description?
func (*Channel) IsTemporary ¶
IsTemporary checks whether the channel is temporary
func (*Channel) RemoveChild ¶
RemoveChild removes a child channel from a parent
func (*Channel) RemoveClient ¶
RemoveClient removes client
type Client ¶
type Client struct { // Logging *log.Logger // Connection-related StreamAddr net.Addr PacketAddr net.Addr SAM sam3.SAM // Ping stats UdpPingAvg float32 UdpPingVar float32 UdpPackets uint32 TcpPingAvg float32 TcpPingVar float32 TcpPackets uint32 // Version Version uint32 ClientName string OSName string OSVersion string CryptoMode string // Personal Username string Email string Channel *Channel SelfMute bool SelfDeaf bool Mute bool Deaf bool Suppress bool PrioritySpeaker bool Recording bool PluginContext []byte PluginIdentity string // contains filtered or unexported fields }
A client connection
func (*Client) ACLContext ¶
func (*Client) ClearCaches ¶
func (client *Client) ClearCaches()
ClearCaches clears the client's caches
func (*Client) Disconnect ¶
func (client *Client) Disconnect()
Disconnect a client (client requested or server shutdown)
func (*Client) ForceDisconnect ¶
func (client *Client) ForceDisconnect()
Disconnect a client (kick/ban)
func (*Client) HasCertificate ¶
HasCertificate Does the client have a certificate?
func (*Client) IsRegistered ¶
IsRegistered Is the client a registered user?
func (*Client) IsSuperUser ¶
IsSuperUser Is the client the SuperUser?
func (*Client) IsVerified ¶
IsVerified checks whether the client's certificate is verified.
func (*Client) Panic ¶
func (client *Client) Panic(v ...interface{})
Log a panic and disconnect the client.
func (*Client) RejectAuth ¶
func (client *Client) RejectAuth(rejectType mumbleproto.Reject_RejectType, reason string)
Reject an authentication attempt
func (*Client) SendUDP ¶
Send buf as a UDP message. If the client does not have an established UDP connection, the datagram will be tunelled through the client's control channel (TCP).
type ClientPredicate ¶
type KeyValuePair ¶
type Register ¶
type Register struct { XMLName xml.Name `xml:"server"` Version string `xml:"version"` Release string `xml:"release"` Name string `xml:"name"` Host string `xml:"host"` Password string `xml:"password"` Port int `xml:"port"` Url string `xml:"url"` Digest string `xml:"digest"` Users int `xml:"users"` Channels int `xml:"channels"` Location string `xml:"location"` }
type Server ¶
type Server struct { Id int64 TLSConfig *tls.Config WebSocketListener *web.Listener WebSocketTLSConfig *tls.Config WebServer *http.Server SAM *sam3.PrimarySession // Server configuration Config *serverconf.Config // Codec information AlphaCodec int32 BetaCodec int32 PreferAlphaCodec bool Opus bool // Channels Channels map[int]*Channel // Users Users map[uint32]*User UserCertMap map[string]*User UserNameMap map[string]*User Bans []ban.Ban // Logging *log.Logger // contains filtered or unexported fields }
A Murmur server instance
func NewAnonServer ¶
Allocate a new Murmur instance
func NewServerFromFrozen ¶
Create a new server from its on-disk representation.
This will read a full serialized server (typically stored in a file called 'main.fz') from disk. It will also check for a log file ('log.fz') and iterate through the entries of the log file and apply the updates incrementally to the server.
Once both the full server and the log file has been merged together in memory, a new full seralized server will be written and synced to disk, and the existing log file will be removed.
func NewServerFromSQLite ¶
Create a new Server from a Murmur SQLite database
func (*Server) AddChannel ¶
AddChannel adds a new channel to the server. Automatically assign it a channel ID.
func (*Server) CheckServerPassword ¶
CheckServerPassword checks whether password matches the set Server password.
func (*Server) CheckSuperUserPassword ¶
CheckSuperUserPassword checks whether password matches the set SuperUser password.
func (*Server) ClearCaches ¶
func (server *Server) ClearCaches()
ClearCaches clears the Server's caches
func (*Server) CurrentPort ¶
CurrentPort returns the port the native server is currently listening on. If called when the server is not running, this function returns -1.
func (*Server) DatagramAddr ¶
func (*Server) DatagramAddrString ¶
func (*Server) DatagramConnection ¶
func (s *Server) DatagramConnection() net.PacketConn
func (*Server) DeleteFrozenChannel ¶
Mark a channel as deleted in the datastore.
func (*Server) DeleteFrozenUser ¶
Mark a user as deleted in the datstore.
func (*Server) FilterText ¶
Filter incoming text according to the server's current rules.
func (*Server) Freeze ¶
Freeze a server to a flattened protobuf-based structure ready to persist to disk.
func (*Server) FreezeToFile ¶
Freeze a server to disk and closes the log file. This must be called from within the Server's synchronous handler.
func (*Server) HostAddress ¶
HostAddress returns the host address the server will listen on when it is started. This must be an IP address, either IPv4 or IPv6.
func (*Server) IsCertHashBanned ¶
IsCertHashBanned Is the certificate hash banned?
func (*Server) IsConnectionBanned ¶
IsConnectionBanned Is the incoming connection conn banned?
func (*Server) IsPublic ¶
Determines whether a server is public by checking whether the config values required for public registration are set.
This function is used to determine whether or not to periodically contact the master server list and update this server's metadata.
func (*Server) LinkChannels ¶
Link two channels
func (*Server) ListenDatagram ¶
func (*Server) ListenStream ¶
func (*Server) ListenWebPort ¶
ListenWebPort returns true if we should listen to the web port, otherwise false
func (*Server) RegisterClient ¶
Register a client on the server.
func (*Server) RegisterPublicServer ¶
func (server *Server) RegisterPublicServer()
Perform a public server registration update.
When a Mumble server connects to the master server for registration, it connects using its server certificate as a client certificate for authentication purposes.
func (*Server) RemoveChanel ¶
RemoveChanel removes a channel from the server.
func (*Server) RemoveChannel ¶
RemoveChannel removes a channel
func (*Server) RemoveClient ¶
RemoveClient removes a disconnected client from the server's internal representation.
func (*Server) RemoveExpiredBans ¶
func (server *Server) RemoveExpiredBans()
RemoveExpiredBans removes expired bans
func (*Server) RemoveRegistration ¶
RemoveRegistration removes a registered user.
func (*Server) ResetConfig ¶
ResetConfig writes to the freezelog that the config with key has been reset to its default value.
func (*Server) RootChannel ¶
RootChannel gets a pointer to the root channel
func (*Server) SendDatagram ¶
Send the content of buf as a UDP packet to addr.
func (*Server) SetServerPassword ¶
SetServerPassword sets password as the new Server password
func (*Server) SetSuperUserPassword ¶
SetSuperUserPassword sets password as the new SuperUser password
func (*Server) StreamAddr ¶
func (*Server) StreamAddrString ¶
func (*Server) StreamListener ¶
func (*Server) TLSAddrString ¶
func (*Server) TLSStreamListener ¶
func (*Server) UnfreezeBanList ¶
Merge the contents of a freezer.BanList into the server's ban list.
func (*Server) UnlinkChannels ¶
Unlink two channels
func (*Server) UpdateConfig ¶
UpdateConfig writes an updated config value to the datastore.
func (*Server) UpdateFrozenBans ¶
UpdateFrozenBans writes the server's banlist to the datastore.
func (*Server) UpdateFrozenChannel ¶
func (server *Server) UpdateFrozenChannel(channel *Channel, state *mumbleproto.ChannelState)
Given a target channel and a ChannelState protocol message, create a freezer.Channel that only includes the values changed by the given ChannelState message. When done, write that frozen.Channel to the datastore.
func (*Server) UpdateFrozenChannelACLs ¶
UpdateFrozenChannelACLs writes a channel's ACL and Group data to disk. Mumble doesn't support incremental ACL updates and as such we must write all ACLs and groups to the datastore on each change.
func (*Server) UpdateFrozenUser ¶
func (server *Server) UpdateFrozenUser(client *Client, state *mumbleproto.UserState)
Update the datastore with the user's current state.
func (*Server) UpdateFrozenUserLastChannel ¶
Update a user's last active channel
func (*Server) WebAddrString ¶
type User ¶
type User struct { Id uint32 Name string Password string CertHash string Email string TextureBlob string CommentBlob string LastChannelId int LastActive uint64 }
func (*User) CommentBlobHashBytes ¶
CommentBlobHashBytes gets the hash of the user's comment blob as a byte slice for transmitting via a protobuf message. Returns nil if there is no such blob.
func (*User) Freeze ¶
Freeze a User into a flattened protobuf-based structure ready to be persisted to disk.
func (*User) HasComment ¶
HasComment Does the channel have comment?
func (*User) HasTexture ¶
HasTexture Does the user have a texture?
func (*User) TextureBlobHashBytes ¶
TextureBlobHashBytes gets the hash of the user's texture blob as a byte slice for transmitting via a protobuf message. Returns nil if there is no such blob.
type VoiceBroadcast ¶
type VoiceBroadcast struct {
// contains filtered or unexported fields
}
type VoiceTarget ¶
type VoiceTarget struct {
// contains filtered or unexported fields
}
A VoiceTarget holds information about a single VoiceTarget entry of a Client.
func (*VoiceTarget) AddChannel ¶
func (vt *VoiceTarget) AddChannel(id uint32, subchannels bool, links bool, group string)
AddChannel adds a channel to the VoiceTarget. If subchannels is true, any sent voice packets will also be sent to all subchannels. If links is true, any sent voice packets will also be sent to all linked channels. If group is a non-empty string, any sent voice packets will only be broadcast to members of that group who reside in the channel (or its children or linked channels).
func (*VoiceTarget) AddSession ¶
func (vt *VoiceTarget) AddSession(session uint32)
Add's a client's session to the VoiceTarget
func (*VoiceTarget) ClearCache ¶
func (vt *VoiceTarget) ClearCache()
ClearCache clears the VoiceTarget's cache.
func (*VoiceTarget) IsEmpty ¶
func (vt *VoiceTarget) IsEmpty() bool
IsEmpty checks whether the VoiceTarget is empty (has no targets)
func (*VoiceTarget) SendVoiceBroadcast ¶
func (vt *VoiceTarget) SendVoiceBroadcast(vb *VoiceBroadcast)
Send the contents of the VoiceBroadcast to all targets specified in the VoiceTarget.