3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-27 05:03:07 +01:00
Commit Graph

57 Commits

Author SHA1 Message Date
James Lu
4a8c96c883 And now, a test fixture for protocols/ 2019-08-18 16:36:02 -07:00
James Lu
80188c3673 Sort imports via isort 2019-07-14 15:12:29 -07:00
James Lu
8386edc6d5 conf: rename ConfigValidationError -> ConfigurationError & inherit from RuntimeError 2018-06-13 22:46:58 -07:00
Jordy Zomer
be8e4be49d Use yaml.safe_load instead of yaml.load to prevent executing arbitrary code (#589) 2018-03-29 14:10:33 -07:00
James Lu
d172831805 conf: rename methods to snake case (#523) 2018-03-02 20:23:48 -08:00
James Lu
03103bea14 conf: use a more informative description for validate() 2018-03-02 20:23:47 -08:00
James Lu
0ea35dab18 Merge branch 'master' into devel
Conflicts:
	docs/technical/channel-modes.csv
	docs/technical/user-modes.csv
	protocols/hybrid.py
2017-08-31 15:18:38 -07:00
James Lu
0eb605219b conf: use splitext() to fetch the config name
This fixes incorrect behaviour when there are multiple .'s in the config filename (e.g. '1.2.3.yml' got truncated to confname='1')
2017-08-31 15:14:47 -07:00
James Lu
136e5fbee7 conf: fix getDatabaseName calling the wrong variable name
(cherry picked from commit 21b8b51cba)
2017-08-30 20:13:51 -07:00
James Lu
43b6566aa8 Move getDatabaseName from utils to conf (#476) 2017-08-28 20:27:39 -07:00
James Lu
819ac4d406 Move world.log_queue to world._log_queue 2017-07-20 21:16:44 +08:00
James Lu
7e8ff51646 conf: when config loading fails, show an error /before/ quitting
This fixes a regression from 2b346e3c01.
2017-07-17 07:56:23 -07:00
James Lu
880d0975db Merge branch 'type-to-isinstance' of https://github.com/cooper/PyLink into devel 2017-07-14 05:22:37 -07:00
James Lu
2b346e3c01 conf: use Python logging when avaiable when the config file fails to load 2017-07-12 22:44:51 -07:00
James Lu
fceb2efce4 conf: remove ancient migration note from PyLink 0.9.x 2017-07-12 22:24:59 -07:00
Mitchell Cooper
3e356180a0 use isinstance() for conf values as well 2017-07-12 17:38:31 -04:00
James Lu
60a0bcdc7a Rename config option log:stdout -> log:console
Closes #386.
2017-06-02 08:42:32 -07:00
James Lu
9ea9f66dd7 conf: actually pass the logger object to _log in validateConf 2017-06-02 08:34:43 -07:00
James Lu
a8c1a46e3d core: queue messages for logging when 'log' isn't available during init
Closes #428.
2017-03-15 23:00:26 -07:00
James Lu
dc298b3182 conf: join conf::bot and conf::pylink so that they mean the same thing (#343) 2017-03-10 23:47:07 -08:00
James Lu
8a773dea4e core: normalize exit codes 2017-02-27 07:26:29 -08:00
James Lu
0ebb52e64f conf: simplify newlogins checks & allow missing permissions blocks if an old login is also present 2017-02-24 21:07:28 -08:00
James Lu
0706b6cf78 Style/spacing fixes for last commit 2017-02-21 17:04:59 -08:00
Ken Spencer
a8fe353ba4 servprotect: make length and age configurable (#417)
Fixes #395
2017-02-21 17:02:26 -08:00
Ken Spencer
b3075d3414 conf: change asserts to validations (#414) 2017-02-21 10:10:54 -08:00
James Lu
f83a81242a conf: reuse already-fetched newlogins value 2017-02-20 19:31:31 -08:00
Ken Spencer
07ac649763 conf: check for permissions block, per my own experience (#413) 2017-02-20 19:27:15 -08:00
James Lu
e7e2f2c98e core: update "missing dependencies" errors
Closes #363.
2016-12-09 17:15:53 -08:00
James Lu
b3387f2d41 conf: fix deprecation warnings crashing because log is unavailable
This allows conf methods to access to global logger by via an optional 'logger' argument. However,
the caveat is that the logging facilities are still unavailable on first start, because log can
only be imported *after* the configuration is loaded.
2016-12-05 22:43:01 -08:00
Ken Spencer
a173e2a61f pylink: Warn users that configuration is changing. (closes #361) 2016-11-22 22:49:23 -08:00
James Lu
93ca62aa49 Revamp configuration to support multiple accounts (#319) 2016-11-07 21:01:28 -08:00
James Lu
9950e0948f conf: split off absolute paths in confname
This fixes invalid database names such as "automode-/tmp/test.db" from being generated when PyLink is started with an absolute path to its config.

Closes #358.
2016-11-02 22:23:45 -07:00
James Lu
c410de2fad Make server config validation protocol specific
Closes #282.
2016-07-28 21:34:00 -07:00
James Lu
0a0e19d4c2 conf: remove key checks for password fields
TODO: replace this with more verbose checks in protocol modules
2016-07-20 23:55:34 -07:00
James Lu
fab61729b9 conf: throw a specific error when PyYAML is missing 2016-07-19 17:47:39 -07:00
James Lu
166adcf44d conf: add migration warning for the config file rename 2016-07-19 17:40:22 -07:00
James Lu
e4b400042e core: make maxnicklen optional, defaulting it to 30 2016-06-27 22:39:18 -07:00
James Lu
2c0a09271c conf: re-add dummy conf / confname so that dependant modules are still importable 2016-06-25 14:37:06 -07:00
James Lu
5a363c22af conf: remove checks for 'channels' in server: blocks
This key is no longer mandatory as of ceed9346c0.
2016-06-25 14:25:57 -07:00
James Lu
dce768017a [WIP] conf: re-add 'fname' variable (used by REHASH) 2016-06-21 11:31:39 -07:00
James Lu
cb633cfba5 Default config file location is now pylink.yml 2016-06-21 10:59:03 -07:00
James Lu
2f188dc60d core: Remove load-conf-on-import, implement basic command line options via argparse
Ref #242.
2016-06-21 10:55:42 -07:00
James Lu
481d70eff8 New import paths for properly installed pylinkirc 2016-06-20 18:18:54 -07:00
James Lu
da7bd649d2 conf: fix testconf missing the logging: section 2016-03-11 23:14:16 -08:00
James Lu
584f952113 conf: check to make sure logging block exists in config 2016-02-07 18:01:12 -08:00
James Lu
e4fb64aeba Document more parts of the core - comments are cool right 2015-12-06 17:40:13 -08:00
James Lu
5027feb553 Don't crash when REHASH loads a config file that's invalid
This was actually several bugs in one:
- The sys.exit() call in loadConf should be... toggleable
- loadConf printed errors but forgot to re-raise the actual exception it caught
- The error reply in the REHASH command was passing the wrong arguments to irc.reply(), which would cause an error within an error when it ran
2015-11-11 18:55:51 -08:00
James Lu
48831863d2 validateConf: allow autojoin channels to be empty; nothing wrong with that 2015-09-28 19:22:19 -07:00
James Lu
e84a2d1025 Modularize our import hacks, make Irc() take a conf object again 2015-09-28 19:12:45 -07:00
James Lu
630aa83084 core: add some rudimentary config file validation 2015-09-28 11:55:31 -07:00