Skip to content

Commit 222d806

Browse files
authored
Merge pull request #1959 from sopel-irc/path-setting-and-doc-tweaks
Path setting and doc tweaks; meetbot enforcement change
2 parents 1e89915 + cae966b commit 222d806

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

docs/source/configuration.rst

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ other value will be considered as "false".
6767
When a config option is a choice, it means you can provide only one of the
6868
values defined as valid for this option, or Sopel will complain about it.
6969

70+
.. note::
71+
72+
The INI file structure Sopel uses does **not** require quoting of values,
73+
except for specific cases such as the escaped list value shown above.
74+
Quoting a value unnecessarily can lead to unexpected behavior such as an
75+
absolute pathname being interpreted as relative to Sopel's home directory.
76+
7077
.. __: https://docs.python.org/3/library/configparser.html#supported-ini-file-structure
7178

7279

@@ -190,7 +197,7 @@ you need to set :attr:`~CoreSection.use_ssl` to true::
190197
[core]
191198
use_ssl = yes
192199
verify_ssl = yes
193-
ca_certs = path/to/sopel/ca_certs.pem
200+
ca_certs = /path/to/sopel/ca_certs.pem
194201

195202
In that case:
196203

@@ -400,7 +407,7 @@ and the required credentials:
400407
(``UserServ`` by default)
401408

402409
Multi-stage
403-
-------------
410+
-----------
404411

405412
In some cases, an IRC bot needs to use both server-based and
406413
nick-based authentication.
@@ -588,6 +595,7 @@ Example of configuration for logging::
588595
logging_level = INFO
589596
logging_format = [%(asctime)s] %(levelname)s - %(message)s
590597
logging_datefmt = %Y-%m-%d %H:%M:%S
598+
logdir = /path/to/logs
591599

592600
.. versionadded:: 7.0
593601

@@ -631,7 +639,10 @@ Raw Logs
631639
--------
632640

633641
It is possible to store raw logs of what Sopel receives and sends by setting
634-
the flag :attr:`~CoreSection.log_raw` to true.
642+
the flag :attr:`~CoreSection.log_raw` to true::
643+
644+
[core]
645+
log_raw = on
635646

636647
In that case, IRC messages received and sent are stored into a file named
637648
``<base>.raw.log``, located in the log directory.

sopel/config/core_section.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ class CoreSection(StaticSection):
234234
235235
If not specified, Sopel will try to find the certificate trust store
236236
itself from a set of known locations.
237+
238+
If the given value is not an absolute path, it will be interpreted relative
239+
to the directory containing the config file with which Sopel was started.
237240
"""
238241

239242
channels = ListAttribute('channels')
@@ -685,6 +688,8 @@ def homedir(self):
685688
log_raw = ValidatedAttribute('log_raw', bool, default=False)
686689
"""Whether a log of raw lines as sent and received should be kept.
687690
691+
:default: ``no``
692+
688693
To enable this logging:
689694
690695
.. code-block:: ini
@@ -700,6 +705,11 @@ def homedir(self):
700705
logdir = FilenameAttribute('logdir', directory=True, default='logs')
701706
"""Directory in which to place logs.
702707
708+
:default: ``logs``
709+
710+
If the given value is not an absolute path, it will be interpreted relative
711+
to the directory containing the config file with which Sopel was started.
712+
703713
.. seealso::
704714
705715
The :ref:`Logging` chapter.

sopel/modules/ip.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@
3939

4040
class GeoipSection(types.StaticSection):
4141
GeoIP_db_path = types.FilenameAttribute('GeoIP_db_path', directory=True)
42-
"""Path of the directory containing the GeoIP database files."""
42+
"""Path of the directory containing the GeoIP database files.
43+
44+
If the given value is not an absolute path, it will be interpreted relative
45+
to the directory containing the config file with which Sopel was started.
46+
"""
4347

4448

4549
def configure(config):

sopel/modules/meetbot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class MeetbotSection(types.StaticSection):
2929

3030
meeting_log_path = types.FilenameAttribute(
3131
"meeting_log_path",
32+
relative=False,
3233
directory=True,
3334
default="~/www/meetings")
3435
"""Path to meeting logs storage directory.

0 commit comments

Comments
 (0)