Documentation
¶
Overview ¶
Configuration files, passwords, etc
Index ¶
- Variables
- func GetDataDir() string
- func GetDefaultRealName() string
- func GetFullName() string
- func GetHostcloak() string
- func GetIRCPort() int
- func GetListenOn() []string
- func GetMaxNickLen() int
- func GetQuote() string
- func GetSAMBridge() string
- func GetShortName() string
- func GetSoftware() string
- func GetStartWebserver() bool
- func GetUseI2P() bool
- func GetVersion() string
- func GetWebPort() int
- func MakeHashedAndSaltedPassword(password string) string
- func OperLogin(operatorNick, password string) bool
- func REHASH() ([]string, bool)
- func ReadConfigFile(confFileName string) (string, bool)
- func ReadMOTDFile(motdFileName string) (string, bool)
- func ReadOPERSFile(opersFileName string) (string, bool)
- func SetDataDir(dataDir string) string
- func SetDefaultRealName(newRealName string) string
- func SetFullName(newName string) string
- func SetHostcloak(newName string) string
- func SetIRCPort(newPort int) int
- func SetListenOn(newAddressList []string) []string
- func SetMaxNickLen(newLength int) int
- func SetQuote(newQuote string) string
- func SetSAMBridge(samBridge string) string
- func SetShortName(newName string) string
- func SetSoftware(newName string) string
- func SetStartWebserver(b bool) bool
- func SetUseI2P(b bool) bool
- func SetVersion(newName string) string
- func SetWebPort(newPort int) int
Constants ¶
This section is empty.
Variables ¶
var ( // The Message Of The Day MOTD [][]byte = nil // Path to, or the name of the MOTD file (used to remember where it was, if we want to reload its content) MOTDFile string = "MOTD" // Path to, or the name of the OPERS file (used to remember where it was, if we want to reload its content) OPERSFile string = "OPERS" // Path to, or the name of the MCXHUB config file (used to remember where it was, if we want to reload its content) ConfFile string = "mcxhub.conf" )
Functions ¶
func GetDataDir ¶
func GetDataDir() string
Returns the generic data folder, used by everything that needs to remember things and settings
func GetDefaultRealName ¶
func GetDefaultRealName() string
Returns the "real name" that is reported for users. In MCXHUB, this name is of course hidden, and replaced with a dummy.
func GetFullName ¶
func GetFullName() string
Returns the servers full name (domain name, or similiar)
func GetHostcloak ¶
func GetHostcloak() string
Returns the hostcloak that is used to conceal the real/fake host/ip that users have
func GetListenOn ¶
func GetListenOn() []string
Returns the addresses (IPv4 and IPv6) that MCXHUB is currently (attempting to) listening on.
func GetQuote ¶
func GetQuote() string
Returns the quote that your server occationally, at random times, output.
func GetSAMBridge ¶
func GetSAMBridge() string
func GetSoftware ¶
func GetSoftware() string
Returns the name of the software the server is running ("mcxhub", unless you changed it)
func GetStartWebserver ¶
func GetStartWebserver() bool
Returns true if MCXHUB is configured to start the web server
func MakeHashedAndSaltedPassword ¶
Hashes and salts the password, using the salt that was (hopefully) specified in the config file. The output of this function is suitable for inclusion into the OPERS file.
func REHASH ¶
Reloads *all* configuration files and updates a lot of variables. Typically run as a result from a system operator entering a REHASH-command (/REHASH in IRC.) Returns a list of strings containing human-readable info about how it went, what happened.
func ReadConfigFile ¶
Reads a config file (mcxhub.conf) and updates the server variables accordingly. This should only be done from the REHASH() function, or at server initialization. Returns true unless fatal err.
func ReadMOTDFile ¶
Reads a Message Of The Day-file (MOTD) and updates the server variables accordingly. This should only be done from the REHASH() function, or at server initialization. Returns true unless fatal err.
func ReadOPERSFile ¶
Reads the OPERS file and updates the server variables accordingly. This should only be done from the REHASH() function, or at server initialization. Returns true unless fatal err.
func SetDataDir ¶
Set the generic data folder. Returns the previous value. It probably is very, very, very stupid to change this while running.
func SetDefaultRealName ¶
Sets the servers default real name; The name that replaces every users "real name". The Real Name may contain spaces. Returns previous value.
func SetFullName ¶
Sets the servers full name (the "domain name" of the server). Doing this mid-flight will VERY LIKELY cause serious havoc. Returns previous name.
func SetHostcloak ¶
Sets the hostcloak. Doing this mid-flight will MAYBE cause serious havoc. Returns previous value.
func SetIRCPort ¶
Sets the port the IRC server will be listening on. If you change this, you will also need to notify the IRC server, to start using this port.
func SetListenOn ¶
Sets what addresses (IPv4 and IPv6) the server will be listening on. If you change this, you will also need to notify *all* services to switch to these addresses.
func SetMaxNickLen ¶
Sets the servers maximum nickname length. Doing this mid-flight is slightly weird. Returns previous value.
func SetQuote ¶
Sets the servers quote. Doing this mid-flight is PERFECTLY SAFE. Returns previous value.
func SetSAMBridge ¶
Set the address (IPv4:port) of the I2P SAM bridge. Returns the previous value.
func SetShortName ¶
Sets the servers full name. Doing this mid-flight will MAYBE NOT cause serious havoc. Returns previous name.
func SetSoftware ¶
Sets the servers reported software. Doing this mid-flight will VERY LIKELY cause serious havoc. Returns previous value.
func SetStartWebserver ¶
Set this to true, if you want the webserver to be available as a service. You also need to notify the webserver about this change.
func SetUseI2P ¶
Set this to true, if you want to use I2P. All other I2P-settings will be ignored if set to false. Returns previous value.
func SetVersion ¶
Sets the servers version. Doing this mid-flight will VERY LIKELY cause serious havoc. Returns previous value.
func SetWebPort ¶
Sets the port the webserver is supposed to be listening at. Returns previous value. You also need to notify the webserver to start using the new value.
Types ¶
This section is empty.