Add a config variable for the example dir.

This makes including example files easier on system-wide installs.
This commit is contained in:
Sadie Powell 2024-08-30 15:31:47 +01:00
parent af6a690f52
commit ef8e631be2
9 changed files with 27 additions and 23 deletions

View File

@ -39,4 +39,4 @@
<cpcase lower="222" upper="254"> # þ => Þ
# Include the ASCII rules to avoid duplication.
<include file="examples/codepages/ascii.example.conf">
<include file="&dir.example;/codepages/ascii.example.conf">

View File

@ -57,4 +57,4 @@
<cpcase lower="254" upper="222"> # ţ => Ţ
# Include the ASCII rules to avoid duplication.
<include file="examples/codepages/ascii.example.conf">
<include file="&dir.example;/codepages/ascii.example.conf">

View File

@ -228,7 +228,7 @@
# can be done by using <connect connected="no"> #
# To enable IRCCloud on your network uncomment this:
#<include file="examples/providers/irccloud.example.conf">
#<include file="&dir.example;/providers/irccloud.example.conf">
# A connect class with <connect:deny> set denies connections from the specified host/IP range.
<connect
@ -494,7 +494,7 @@
# This file has all the information about oper classes, types and o:lines.
# You *MUST* edit it.
#<include file="examples/opers.example.conf">
#<include file="&dir.example;/opers.example.conf">
#-#-#-#-#-#-#-#-#-#- MISCELLANEOUS CONFIGURATION -#-#-#-#-#-#-#-#-#-#
# #
@ -503,7 +503,7 @@
#
# motd - displayed on connect and when a user executes /MOTD
# Modules can also define their own files
<files motd="examples/motd.example.txt">
<files motd="&dir.example;/motd.example.txt">
# Example of an executable file include. Note this will be read on rehash,
# not when the command is run.
@ -1050,7 +1050,7 @@
# provide almost all the features of InspIRCd. :) #
# #
# The default does nothing -- we include it for simplicity for you. #
#<include file="examples/modules.example.conf">
#<include file="&dir.example;/modules.example.conf">
#-#-#-#-#-#-#-#-#-#-#-# SERVICES CONFIGURATION #-#-#-#-#-#-#-#-#-#-#-#
# #
@ -1059,13 +1059,13 @@
# exemptions for services pseudoclients: #
#
# Anope users should uncomment this:
#<include file="examples/services/anope.example.conf">
#<include file="&dir.example;/services/anope.example.conf">
#
# Atheme users should uncomment this:
#<include file="examples/services/atheme.example.conf">
#<include file="&dir.example;/services/atheme.example.conf">
#
# Users of other services should uncomment this:
#<include file="examples/services/generic.example.conf">
#<include file="&dir.example;/services/generic.example.conf">
#########################################################################
# #

View File

@ -653,11 +653,11 @@
#<module name="codepage">
#
# You should include one of the following files to set your codepage:
#<include file="examples/codepages/ascii.example.conf">
#<include file="examples/codepages/iso-8859-1.example.conf">
#<include file="examples/codepages/iso-8859-2.example.conf">
#<include file="examples/codepages/rfc1459.example.conf">
#<include file="examples/codepages/strict-rfc1459.example.conf">
#<include file="&dir.example;/codepages/ascii.example.conf">
#<include file="&dir.example;/codepages/iso-8859-1.example.conf">
#<include file="&dir.example;/codepages/iso-8859-2.example.conf">
#<include file="&dir.example;/codepages/rfc1459.example.conf">
#<include file="&dir.example;/codepages/strict-rfc1459.example.conf">
#
# You can also define a custom codepage. For details on how to do this
# please refer to the docs site:
@ -939,13 +939,13 @@
# more of the following example configs for popular DNSBLs: #
# #
# DroneBL (https://dronebl.org) #
#<include file="examples/providers/dronebl.example.conf">
#<include file="&dir.example;/providers/dronebl.example.conf">
# #
# EFnet RBL (https://rbl.efnetrbl.org) #
#<include file="examples/providers/efnet-rbl.example.conf">
#<include file="&dir.example;/providers/efnet-rbl.example.conf">
# #
# dan.me.uk Tor exit node DNSBL (https://www.dan.me.uk/dnsbl) #
#<include file="examples/providers/torexit.example.conf">
#<include file="&dir.example;/providers/torexit.example.conf">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Exempt channel operators module: Provides support for allowing #
@ -1000,7 +1000,7 @@
# specify below the path to the filter.conf file, or define some #
# <keyword> tags. #
# #
#<include file="examples/filter.example.conf">
#<include file="&dir.example;/filter.example.conf">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Gateway module: Enables forwarding the real IP address of a user from
@ -1138,7 +1138,7 @@
# If you specify to use the help module, then specify below the path #
# to the help.conf file. #
# #
#<include file="examples/help.example.conf">
#<include file="&dir.example;/help.example.conf">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Help mode module: Provides oper-only user mode `h` (helpop) which
@ -2432,7 +2432,7 @@
#
# This file has all the information about server links and services servers.
# You *MUST* edit it if you intend to link servers.
#<include file="examples/links.example.conf">
#<include file="&dir.example;/links.example.conf">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# SQL authentication module: Allows IRCd connections to be tied into

View File

@ -92,7 +92,7 @@
# operator type. This can be viewed with /OPERMOTD or automatically
# on login if automotd (see below) is enabled.
# Requires the opermotd module to be loaded.
motd="examples/opermotd.example.txt"
motd="&dir.example;/opermotd.example.txt"
# automotd: Whether to send the server operator MOTD (see above)
# to operators of this type when they log in.

View File

@ -2,4 +2,4 @@
# by Anope. See https://www.anope.org for more information on Anope.
# This file inherits from the generic config to avoid repetition.
<include file="examples/services/generic.example.conf">
<include file="&dir.example;/services/generic.example.conf">

View File

@ -3,7 +3,7 @@
# information on Atheme.
# This file inherits from the generic config to avoid repetition.
<include file="examples/services/generic.example.conf">
<include file="&dir.example;/services/generic.example.conf">
# Long hand aliases for services pseudoclients.
<alias text="ALIS" replace="SQUERY $requirement :$2-" requires="ALIS" service="yes">

View File

@ -34,6 +34,9 @@
/** The default location that config files are stored in. */
#define INSPIRCD_CONFIG_PATH "@CONFIG_DIR@"
/** The default location that example config files are stored in. */
#define INSPIRCD_EXAMPLE_PATH "@EXAMPLE_DIR@"
/** The default location that data files are stored in. */
#define INSPIRCD_DATA_PATH "@DATA_DIR@"

View File

@ -492,6 +492,7 @@ ParseStack::ParseStack(ServerConfig* conf)
// Directories that were set at build time.
{ "dir.config", INSPIRCD_CONFIG_PATH },
{ "dir.example", INSPIRCD_EXAMPLE_PATH },
{ "dir.data", INSPIRCD_DATA_PATH },
{ "dir.log", INSPIRCD_LOG_PATH },
{ "dir.module", INSPIRCD_MODULE_PATH },