mcxconfig

package
v0.0.0-...-2b5d22d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2017 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Overview

Configuration files, passwords, etc

Index

Constants

This section is empty.

Variables

View Source
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 GetIRCPort

func GetIRCPort() int

Returns the port the IRC server is listening on

func GetListenOn

func GetListenOn() []string

Returns the addresses (IPv4 and IPv6) that MCXHUB is currently (attempting to) listening on.

func GetMaxNickLen

func GetMaxNickLen() int

Returns the maximum nickname length

func GetQuote

func GetQuote() string

Returns the quote that your server occationally, at random times, output.

func GetSAMBridge

func GetSAMBridge() string

func GetShortName

func GetShortName() string

Returns the servers short name

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 GetUseI2P

func GetUseI2P() bool

Returns true if I2P should be used, otherwise false, derp.

func GetVersion

func GetVersion() string

Returns the servers version.

func GetWebPort

func GetWebPort() int

Returns the port the Webserver is listening on

func MakeHashedAndSaltedPassword

func MakeHashedAndSaltedPassword(password string) string

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 OperLogin

func OperLogin(operatorNick, password string) bool

returns true if the password for the specified operator was correct!

func REHASH

func REHASH() ([]string, bool)

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

func ReadConfigFile(confFileName string) (string, bool)

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

func ReadMOTDFile(motdFileName string) (string, bool)

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

func ReadOPERSFile(opersFileName string) (string, bool)

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

func SetDataDir(dataDir string) string

Set the generic data folder. Returns the previous value. It probably is very, very, very stupid to change this while running.

func SetDefaultRealName

func SetDefaultRealName(newRealName string) string

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

func SetFullName(newName string) string

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

func SetHostcloak(newName string) string

Sets the hostcloak. Doing this mid-flight will MAYBE cause serious havoc. Returns previous value.

func SetIRCPort

func SetIRCPort(newPort int) int

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

func SetListenOn(newAddressList []string) []string

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

func SetMaxNickLen(newLength int) int

Sets the servers maximum nickname length. Doing this mid-flight is slightly weird. Returns previous value.

func SetQuote

func SetQuote(newQuote string) string

Sets the servers quote. Doing this mid-flight is PERFECTLY SAFE. Returns previous value.

func SetSAMBridge

func SetSAMBridge(samBridge string) string

Set the address (IPv4:port) of the I2P SAM bridge. Returns the previous value.

func SetShortName

func SetShortName(newName string) string

Sets the servers full name. Doing this mid-flight will MAYBE NOT cause serious havoc. Returns previous name.

func SetSoftware

func SetSoftware(newName string) string

Sets the servers reported software. Doing this mid-flight will VERY LIKELY cause serious havoc. Returns previous value.

func SetStartWebserver

func SetStartWebserver(b bool) bool

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

func SetUseI2P(b bool) bool

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

func SetVersion(newName string) string

Sets the servers version. Doing this mid-flight will VERY LIKELY cause serious havoc. Returns previous value.

func SetWebPort

func SetWebPort(newPort int) int

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL