mirror of
https://github.com/progval/irctest.git
synced 2025-04-06 23:39:46 +00:00
pull the mysql password from an env variable
This commit is contained in:
@ -209,6 +209,32 @@ class OragonoController(BaseServerController, DirectoryBasedController):
|
|||||||
config.update(LOGGING_CONFIG)
|
config.update(LOGGING_CONFIG)
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
def addMysqlToConfig(self):
|
||||||
|
mysql_password = os.getenv('MYSQL_PASSWORD')
|
||||||
|
if not mysql_password:
|
||||||
|
return None
|
||||||
|
config = self.baseConfig()
|
||||||
|
config['datastore']['mysql'] = {
|
||||||
|
"enabled": True,
|
||||||
|
"host": "localhost",
|
||||||
|
"user": "oragono",
|
||||||
|
"password": mysql_password,
|
||||||
|
"history-database": "oragono_history",
|
||||||
|
"timeout": "3s",
|
||||||
|
}
|
||||||
|
config['accounts']['multiclient'] = {
|
||||||
|
'enabled': True,
|
||||||
|
'allowed-by-default': True,
|
||||||
|
'always-on': 'disabled',
|
||||||
|
}
|
||||||
|
config['history']['persistent'] = {
|
||||||
|
"enabled": True,
|
||||||
|
"unregistered-channels": True,
|
||||||
|
"registered-channels": "opt-out",
|
||||||
|
"direct-messages": "opt-out",
|
||||||
|
}
|
||||||
|
return config
|
||||||
|
|
||||||
def rehash(self, case, config):
|
def rehash(self, case, config):
|
||||||
self._config = config
|
self._config = config
|
||||||
self._write_config()
|
self._write_config()
|
||||||
|
@ -112,31 +112,7 @@ class ChathistoryTestCase(cases.BaseServerTestCase):
|
|||||||
self.validate_chathistory(echo_messages, 1, chname)
|
self.validate_chathistory(echo_messages, 1, chname)
|
||||||
|
|
||||||
def customizedConfig(self):
|
def customizedConfig(self):
|
||||||
if MYSQL_PASSWORD == "":
|
return self.controller.addMysqlToConfig()
|
||||||
return None
|
|
||||||
|
|
||||||
# enable mysql-backed history for all channels and logged-in clients
|
|
||||||
config = self.controller.baseConfig()
|
|
||||||
config['datastore']['mysql'] = {
|
|
||||||
"enabled": True,
|
|
||||||
"host": "localhost",
|
|
||||||
"user": "oragono",
|
|
||||||
"password": MYSQL_PASSWORD,
|
|
||||||
"history-database": "oragono_history",
|
|
||||||
"timeout": "3s",
|
|
||||||
}
|
|
||||||
config['accounts']['multiclient'] = {
|
|
||||||
'enabled': True,
|
|
||||||
'allowed-by-default': True,
|
|
||||||
'always-on': 'disabled',
|
|
||||||
}
|
|
||||||
config['history']['persistent'] = {
|
|
||||||
"enabled": True,
|
|
||||||
"unregistered-channels": True,
|
|
||||||
"registered-channels": "opt-out",
|
|
||||||
"direct-messages": "opt-out",
|
|
||||||
}
|
|
||||||
return config
|
|
||||||
|
|
||||||
@cases.SpecificationSelector.requiredBySpecification('Oragono')
|
@cases.SpecificationSelector.requiredBySpecification('Oragono')
|
||||||
def testChathistoryDMs(self):
|
def testChathistoryDMs(self):
|
||||||
|
@ -7,6 +7,9 @@ from irctest.irc_utils.random import random_name
|
|||||||
|
|
||||||
class ZncPlaybackTestCase(cases.BaseServerTestCase):
|
class ZncPlaybackTestCase(cases.BaseServerTestCase):
|
||||||
|
|
||||||
|
def customizedConfig(self):
|
||||||
|
return self.controller.addMysqlToConfig()
|
||||||
|
|
||||||
@cases.SpecificationSelector.requiredBySpecification('Oragono')
|
@cases.SpecificationSelector.requiredBySpecification('Oragono')
|
||||||
def testZncPlayback(self):
|
def testZncPlayback(self):
|
||||||
chname = random_name('#znc_channel')
|
chname = random_name('#znc_channel')
|
||||||
|
Reference in New Issue
Block a user