1
0
mirror of https://github.com/anope/anope.git synced 2026-06-14 06:24:47 +02:00

Compare commits

..

3 Commits

Author SHA1 Message Date
Sadie Powell 258daf6c26 Release 2.1.3. 2024-03-04 10:42:12 +00:00
Sadie Powell 57e8b4305e Update the changelogs. 2024-03-04 10:41:31 +00:00
Sadie Powell db4f845fe7 Add NickAlias::GetVhostMask for getting the vident@vhost. 2024-03-04 10:36:10 +00:00
497 changed files with 73808 additions and 81926 deletions
-44
View File
@@ -1,44 +0,0 @@
---
name: Bug report
description: Report a non-security bug in Anope.
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report! Please make sure to answer the questions properly and don't just enter the same text into every field as this will make it harder for us to fix your bug.
If you're looking for help with setting up your services please post on [our support forum](https://github.com/orgs/anope/discussions/categories/support) instead.
If you're reporting a crash or other security issue [please read our security policy](https://github.com/anope/anope/security/policy#reporting-a-vulnerability) for how to report security issues privately.
- type: textarea
attributes:
label: Description
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce the issue
validations:
required: true
- type: textarea
attributes:
label: Describe the results you received
validations:
required: true
- type: textarea
attributes:
label: Describe the results you expected
validations:
required: true
- type: input
attributes:
label: Anope version
description: |-
Either the output of `services --version` (2.0) or `anope --version` (2.1).
validations:
required: true
+33
View File
@@ -0,0 +1,33 @@
---
name: Bug report
about: Report a non-security issue with Anope.
---
<!--
Please fill in the template below. It will help us process your bug report a lot faster. If you have multiple bugs to report then please open one issue for each bug.
-->
**Description**
**Steps to reproduce the issue:**
1.
2.
3.
**Describe the results you received:**
**Describe the results you expected:**
**Additional information you deem important (e.g. issue happens only occasionally):**
**Output of `services --version`:**
-20
View File
@@ -1,20 +0,0 @@
---
name: Feature request
description: Request that a new feature is added to Anope.
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request!
- type: textarea
attributes:
label: Description
validations:
required: true
- type: textarea
attributes:
label: Why this would be useful?
validations:
required: true
+15
View File
@@ -0,0 +1,15 @@
---
name: Feature request
about: Request that a new feature is added to Anope.
---
<!--
Please fill in the template below. It will help us process your feature request a lot faster. If you have multiple features to request then please open one issue for each feature.
-->
**Description**
**Why this would be useful**
-4
View File
@@ -1,5 +1 @@
blank_issues_enabled: false
contact_links:
- name: Support forum
url: https://github.com/orgs/anope/discussions/categories/support
about: Please ask support questions here.
-14
View File
@@ -24,17 +24,3 @@ I have tested this pull request on:
**Operating system name and version:** <!-- e.g. Linux 3.11 -->
**Compiler name and version:** <!-- e.g. GCC 4.2.0 -->
## Checks
<!--
Tick the boxes for the checks you have made.
-->
I have ensured that:
- [ ] The code I am submitting is my own work and/or I have permission from the author to share it.
- [ ] Generative AI (Copilot, ChatGPT, etc) was not used to create any part of this pull request.
- [ ] If the pull request contains a security fix I have followed the reporting rules mentioned in [the security policy](https://github.com/anope/anope/security/policy) (delete if not applicable).
- [ ] I have documented any features added by this pull request (delete if not applicable).
- [ ] This pull request does not introduce any incompatible API changes (stable branches only, delete if not applicable).
+1 -1
View File
@@ -14,6 +14,6 @@ Version | Supported
## Reporting a Vulnerability
Please do not report security vulnerabilities on GitHub. Instead, email the details to team@anope.org or get the attention of a developer in our development IRC channel at irc.teranova.net #anope-devel and PM them the details.
Please do not report security vulnerabilities on GitHub. Instead, email the details to team@anope.org or get the attention of a developer in our development IRC channel at irc.anope.org #anope-devel and PM them the details.
We will triage your issue as soon as possible and try to release a fixed version within a week of receiving your report.
-1
View File
@@ -4,4 +4,3 @@ updates:
directory: /
schedule:
interval: monthly
target-branch: "2.1"
+17 -28
View File
@@ -3,22 +3,23 @@ on:
pull_request:
push:
schedule:
- cron: 0 0 * * 0
workflow_dispatch:
- cron: '0 0 * * 0'
jobs:
build:
if: "!contains(github.event.head_commit.message, '[skip alpine ci]')"
container: alpine:latest
container: alpine:edge
runs-on: ubuntu-latest
env:
CXX: ${{ matrix.compiler }}
CXXFLAGS: -Werror
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v4
- name: Install dependencies
run: |-
run: |
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
apk update
apk add \
argon2-dev \
clang \
cmake \
g++ \
@@ -34,36 +35,24 @@ jobs:
tre-dev
- name: Enable extras
run: |-
for MODULE in enc_argon2 enc_posix ldap mysql regex_pcre2 regex_posix regex_tre sqlite ssl_gnutls ssl_openssl
run: |
for MODULE in ldap ldap_authentication ldap_oper mysql regex_pcre2 regex_posix regex_tre sql_authentication sql_log sql_oper sqlite ssl_gnutls ssl_openssl
do
ln -s $PWD/modules/extra/$MODULE.cpp $PWD/modules
done
- name: Run CMake
env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
CXXFLAGS: -Werror
run: |-
cmake -B "build" \
-D "CMAKE_BUILD_TYPE=Debug" \
-D "INSTDIR=$(readlink -f ../run)" \
-G "Ninja" \
-Wdeprecated \
-Wdev
run: |
mkdir build && cd build
cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=DEBUG -DINSTDIR:STRING=$(readlink -f ../run) ..
- name: Build and install
env:
VERBOSE: ${{ runner.debug }}
run: |-
ninja -C "build" ${{ runner.debug == '1' && '-v' || '' }} install
- name: Build Anope
run: |
ninja -C build install
strategy:
fail-fast: false
matrix:
compiler:
- cc: clang
cxx: clang++
- cc: gcc
cxx: g++
- clang++
- g++
+18 -31
View File
@@ -1,26 +1,25 @@
name: Ubuntu CI
on:
pull_request:
push:
schedule:
- cron: 0 0 * * 0
workflow_dispatch:
- pull_request
- push
jobs:
build:
if: "!contains(github.event.head_commit.message, '[skip ubuntu ci]')"
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
env:
CXX: ${{ matrix.compiler }}
CXXFLAGS: -Werror
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v4
- name: Install dependencies
run: |-
run: |
sudo apt-get update --assume-yes
sudo apt-get install --assume-yes --no-install-recommends \
clang \
g++ \
gettext \
git \
libargon2-dev \
libgnutls28-dev \
libldap2-dev \
libmysqlclient-dev \
@@ -31,36 +30,24 @@ jobs:
ninja-build
- name: Enable extras
run: |-
for MODULE in enc_argon2 enc_posix ldap mysql regex_pcre2 regex_posix regex_tre sqlite ssl_gnutls ssl_openssl
run: |
for MODULE in ldap ldap_authentication ldap_oper mysql regex_pcre2 regex_posix regex_tre sql_authentication sql_log sql_oper sqlite ssl_gnutls ssl_openssl
do
ln -s ${{ github.workspace }}/modules/extra/$MODULE.cpp ${{ github.workspace }}/modules
done
- name: Run CMake
env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
CXXFLAGS: -Werror
run: |-
cmake -B "build" \
-D "CMAKE_BUILD_TYPE=Debug" \
-D "INSTDIR=${{ github.workspace }}/run" \
-G "Ninja" \
-Wdeprecated \
-Wdev
run: |
mkdir build && cd build
cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=DEBUG -DINSTDIR:STRING=${{ github.workspace }}/run ..
- name: Build and install
env:
VERBOSE: ${{ runner.debug }}
run: |-
ninja -C "build" ${{ runner.debug == '1' && '-v' || '' }} install
- name: Build Anope
run: |
ninja -C ${{ github.workspace }}/build install
strategy:
fail-fast: false
matrix:
compiler:
- cc: clang
cxx: clang++
- cc: gcc
cxx: g++
- clang++
- g++
+15 -76
View File
@@ -2,95 +2,34 @@ name: Windows CI
on:
pull_request:
push:
release:
types:
- published
schedule:
- cron: 0 0 * * 0
workflow_dispatch:
- cron: '0 0 * * 0'
jobs:
build:
if: "!contains(github.event.head_commit.message, '[skip windows ci]')"
runs-on: windows-2025
env:
BUILD_PATH: ${{ github.workspace }}\build
BUILD_TYPE: ${{ github.event_name == 'release' && 'Release' || 'Debug' }}
CONAN_FILE: ${{ github.workspace }}\src\win32\conanfile.txt
CONAN_HOME: ${{ github.workspace }}\build\conan
runs-on: windows-2019
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v3
- name: Setup MSVC
uses: TheMrMilchmann/setup-msvc-dev@v4
with:
arch: x64
- name: Setup NSIS
uses: negrutiu/nsis-install@v3
with:
distro: official
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.3
- name: Setup Conan
uses: turtlebrowser/get-conan@v1.2
- name: Create Conan configuration
run: |-
conan profile detect
(Get-Content ${{ env.CONAN_HOME }}\profiles\default).replace('build_type=Release', 'build_type=${{ env.BUILD_TYPE }}') | Set-Content ${{ env.CONAN_HOME }}\profiles\default
(Get-Content ${{ env.CONAN_HOME }}\profiles\default).replace('compiler.cppstd=14', 'compiler.cppstd=17') | Set-Content ${{ env.CONAN_HOME }}\profiles\default
Write-Output 'core.sources:download_urls=["origin", "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/"]' | Out-File -Append ${{ env.CONAN_HOME }}\global.conf
Write-Output 'tools.cmake.cmaketoolchain:generator=Ninja' | Out-File -Append ${{ env.CONAN_HOME }}\global.conf
Write-Output 'user.openssl:windows_use_jom=True' | Out-File -Append ${{ env.CONAN_HOME }}\global.conf
- name: Try to restore libraries from the cache
if: github.event_name != 'release'
uses: actions/cache/restore@v5
id: library-cache
with:
key: Conan VS${{ env.VisualStudioVersion }} ${{ env.BUILD_TYPE }} ${{ hashFiles(env.CONAN_FILE) }}
path: ${{ env.CONAN_HOME }}/p
version: 1.59.0
- name: Install libraries
working-directory: ${{ env.BUILD_PATH }}
run: |-
(Get-Content ${{ env.CONAN_FILE }}).replace('##', '') | Set-Content ${{ env.CONAN_FILE }}
conan install ${{ env.CONAN_FILE }} --build missing --deployer runtime_deploy --deployer-folder extradll --output-folder .
conan cache clean "*"
- name: Save libraries to the cache
if: steps.library-cache.outputs.cache-hit != 'true' && github.event_name != 'release'
uses: actions/cache/save@v5
with:
key: ${{ steps.library-cache.outputs.cache-primary-key }}
path: ${{ env.CONAN_HOME }}\p
run: |
conan install ${{ github.workspace }}\src\win32 --build=missing
- name: Run CMake
working-directory: ${{ env.BUILD_PATH }}
run: |-
cmake -D "CMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}" `
-D "CMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake" `
-G "Ninja Multi-Config" `
-S "${{ github.workspace }}" `
-Wdeprecated `
-Wdev
- name: Build installer
working-directory: ${{ env.BUILD_PATH }}
run: |-
ninja -f "build-${{ env.BUILD_TYPE }}.ninja" ${{ runner.debug == '1' && '-v' || '' }} package
- name: Upload installer
if: github.event_name == 'release'
working-directory: ${{ env.BUILD_PATH }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.event.release.tag_name }} $(Get-ChildItem anope-*.exe)
mkdir ${{ github.workspace }}\build
cd ${{ github.workspace }}\build
cmake -A "x64" -G "Visual Studio 16 2019" ..
- name: Upload artifact
if: github.event_name != 'release'
uses: actions/upload-artifact@v7
with:
name: windows-installer
path: ${{ github.workspace }}\build\\anope-*.exe
- name: Build Anope
working-directory: ${{ github.workspace }}\build
run: |
msbuild PACKAGE.vcxproj /M:3 /P:Configuration=Release /P:Platform=x64 /VERBOSITY:MINIMAL
+5 -6
View File
@@ -1,20 +1,19 @@
build/
config.cache
docs/doxygen
include/sysconf.h
modules/enc_argon2.cpp
modules/enc_posix.cpp
modules/ldap.cpp
modules/ldap_authentication.cpp
modules/ldap_oper.cpp
modules/mysql.cpp
modules/regex_pcre2.cpp
modules/regex_posix.cpp
modules/regex_tre.cpp
modules/sql_authentication.cpp
modules/sql_log.cpp
modules/sql_oper.cpp
modules/sqlite.cpp
modules/ssl_gnutls.cpp
modules/ssl_openssl.cpp
modules/stats
modules/xmlrpc.cpp
run/
*.diff
*.mo
*.pot
+3 -13
View File
@@ -12,49 +12,39 @@ Charles Kingsley <chaz@anope.org>
Charles Kingsley <chaz@anope.org> <sjaz@5417fbe8-f217-4b02-8779-1006273d7864>
Cronus <cronus@nite-serv.com>
Daniel Engel <dane@zero.org> <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
David Robson <rob@anope.org> <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
David Robson <rob@anope.org> <robbeh@5417fbe8-f217-4b02-8779-1006273d7864>
David Robson <rob@anope.org> <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
Dennis Friis <peavey@inspircd.org> <peavey peavey@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>
Fabio Scotoni <cculex@gmail.com>
Filippo Cortigiani <simos@simosnap.org> <devel@devel.crtnet.it>
Filippo Cortigiani <simos@simosnap.org> <simos@H7-25.fritz.box>
Florian Schulze <certus@anope.org> <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
Gabriel Acevedo H. <drstein@anope.org> <drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
Harakiri <harakiri@overstack.fr>
Hendrik Jäger <gitcommit@henk.geekmail.org> <github@henk.geekmail.org>
Jan Milants <viper@anope.org>
Jan Milants <viper@anope.org> <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864>
Jan Milants <viper@anope.org> <viper viper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
Jens Voss <dukepyrolator@anope.org> <anope@s15355730.onlinehome-server.info>
Jens Voss <dukepyrolator@anope.org> <DukePyrolator@5417fbe8-f217-4b02-8779-1006273d7864>
Jens Voss <dukepyrolator@anope.org> <DukePyrolator@anope.org>
Jens Voss <dukepyrolator@anope.org> <jens@pyrobook.(none)>
k4be <k4be@pirc.pl> <34816207+k4bek4be@users.noreply.github.com>
Jens Voss <dukepyrolator@anope.org> Jens Voß <jens@pyrobook.(none)>
Lee Holmes <lethality@anope.org>
Lee Holmes <lethality@anope.org> <lee@lethality.me.uk>
Mark Summers <mark@goopler.net> <mark mark@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
Matt Schatz <genius3000@g3k.solutions>
Matt Ullman <matt@airraidsirens.com> <blindsight@gamesurge.net>
Michael Hazell <michaelhazell@hotmail.com> <Techman-@users.noreply.github.com>
Michael Stapelberg <michael@robustirc.net> <stapelberg@users.noreply.github.com>
Michael Wobst <wobst.michael@web.de>
Michael Wobst <wobst.michael@web.de> <michael@static.163.129.251.148.clients.your-server.de>
Michael Wobst <wobst.michael@web.de> <michael@wobst.at>
Naram Qashat <cyberbotx@anope.org> <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>
Naram Qashat <cyberbotx@anope.org> <cyberbotx@cyberbotx.com>
Naram Qashat <cyberbotx@anope.org> <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>
PeGaSuS <droider.pc@gmail.com>
PeGaSuS <droider.pc@gmail.com> <25697531+TehPeGaSuS@users.noreply.github.com>
Pieter Bootsma <geniusdex@anope.org> <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
Robby <robby@chatbelgie.be> <robby@anope.org>
Robby <robby@chatbelgie.be> <robby@chat.be>
Robert Scheck <robert@fedoraproject.org> <robert-scheck@users.noreply.github.com>
Robin Burchell <w00t@inspircd.org> <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>
Robin Burchell <w00t@inspircd.org> <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>
Sadie Powell <sadie@sadiepowell.dev> <petpow@saberuk.com>
Sadie Powell <sadie@sadiepowell.dev> <sadie@witchery.services>
Sadie Powell <sadie@witchery.services> Peter Powell <petpow@saberuk.com>
Sebastian Barfurth <github@afreshmelon.com>
Sebastian V. <hal9000@denorastats.org>
Sebastian V. <hal9000@denorastats.org> <pimpmylinux@5417fbe8-f217-4b02-8779-1006273d7864>
Trystan S. Lee <trystan@nomadirc.net> <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
Val Lorentz <progval+git@progval.net> <progval+git@progval.net>
+175 -54
View File
@@ -1,12 +1,22 @@
# This usage of CMake requires at least version 3.20
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
# This usage of CMake requires at least version 3.8
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
# Set the project as C++ primarily
# Set the project as C++ primarily, but have C enabled for the checks required later
project(Anope CXX)
enable_language(C)
# Override the module include path to include our directory, for our Anope.cmake, as well as we are using our own version of the NSIS template
set(CMAKE_MODULE_PATH ${Anope_SOURCE_DIR}/cmake)
include(Anope)
# Force the locale to C for later uses of things like gcc so the messages come up in English, not the user's default language
set(ENV{LC_ALL} C)
# Start with empty defaults for library and include directories, to be used by GNU compilers only
set(DEFAULT_LIBRARY_DIRS)
set(DEFAULT_INCLUDE_DIRS)
# We require C++17 to build
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 17)
@@ -15,9 +25,92 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Put modules in their own folder
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if(CMAKE_BUILD_TYPE STREQUAL "")
message(STATUS "CMAKE_BUILD_TYPE has not been specified; defaulting to Debug")
set(CMAKE_BUILD_TYPE "Debug")
# If we are using a GNU compiler (have to use CXX because it seems to fail on C), we will be able to determine it's default paths for libraries and includes
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang$")
# First look for the compiler's default library directories
execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs OUTPUT_VARIABLE LINES OUTPUT_STRIP_TRAILING_WHITESPACE)
# Find only the part after "libraries: "
string(REGEX REPLACE ".*\nlibraries: (.*)$" "\\1" LINE "${LINES}")
# Replace the colons in the list with semicolons (only when not on MinGW, which uses semicolons already), and if on MinGW, just copy the line
if(NOT MINGW)
string(REGEX REPLACE ":" ";" LIBRARIES ${LINE})
else()
set(LIBRARIES "${LINE}")
endif()
# Iterate through the libraries
foreach(LIBRARY ${LIBRARIES})
# Check if the first character is an equal sign, and skip that library directory as it is (I believe) the primary default and shows up later in the list anyways
string(SUBSTRING ${LIBRARY} 0 1 FIRST_CHAR)
if(NOT FIRST_CHAR STREQUAL "=")
# If the directory had no = in front of it, make sure it's absolute and add it to the list of default library directories
get_filename_component(LIBRARY ${LIBRARY} ABSOLUTE)
list(APPEND DEFAULT_LIBRARY_DIRS ${LIBRARY})
endif()
endforeach()
# Remove duplicate entries from the list
if(DEFAULT_LIBRARY_DIRS)
list(REMOVE_DUPLICATES DEFAULT_LIBRARY_DIRS)
endif()
# Create a temporary file to test for the default include directories
FILE(WRITE empty.cpp "")
# Next, we look for the compiler's default include directories
# Run the command to find the default include directories
execute_process(COMMAND ${CMAKE_C_COMPILER} -v -x c++ -E ${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp ERROR_VARIABLE LINES OUTPUT_QUIET ERROR_STRIP_TRAILING_WHITESPACE)
# Remove the empty file, it is no longer needed
FILE(REMOVE empty.cpp)
# Convert the new lines to semicolons
string(REGEX REPLACE "\n" ";" LINES ${LINES})
# Temporary variable saying if we are in the search list or not
set(IN_SEARCH_LIST FALSE)
# Iterate through the lines
foreach(LINE ${LINES})
# If the line has the following on it, the next lines will contain directory names
if(LINE STREQUAL "#include <...> search starts here:")
set(IN_SEARCH TRUE)
else()
# If the line has the following on it, we hit the end of the list
if(LINE STREQUAL "End of search list.")
set(IN_SEARCH FALSE)
else()
# If we are within the block between the above two lines...
if(IN_SEARCH)
# Get everything but the first character of the line
string(LENGTH ${LINE} LINE_LENGTH)
math(EXPR LINE_LENGTH "${LINE_LENGTH} - 1")
string(SUBSTRING ${LINE} 1 ${LINE_LENGTH} INCLUDE)
# For systems like Mac OS X, look for include paths that say " (framework directory)" at the end of them and strip that off
string(REGEX REPLACE " \\(framework directory\\)$" "" INCLUDE ${INCLUDE})
# Convert the path to an absolute one, just in case it wasn't
get_filename_component(INCLUDE ${INCLUDE} ABSOLUTE)
# Add that directory to the list of default include directories
list(APPEND DEFAULT_INCLUDE_DIRS ${INCLUDE})
endif()
endif()
endif()
endforeach()
# Remove duplicate entries from the list
if(DEFAULT_INCLUDE_DIRS)
list(REMOVE_DUPLICATES DEFAULT_INCLUDE_DIRS)
endif()
endif()
# If the user specifies -DCMAKE_BUILD_TYPE on the command line, take their definition
# and dump it in the cache along with proper documentation, otherwise set CMAKE_BUILD_TYPE
# to Debug
# Only do this if not using Visual Studio
if(NOT MSVC)
if(CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
else()
set(CMAKE_BUILD_TYPE DEBUG CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
endif()
endif()
# If running under MinGW, we have to force the resource compiler settings (hopefully this will be fixed in a later version of CMake)
if(MINGW)
set(CMAKE_RC_COMPILER_INIT windres)
enable_language(RC)
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -o <OBJECT> <SOURCE>")
endif()
# Include the checking functions used later in this CMakeLists.txt
@@ -26,10 +119,6 @@ include(CheckTypeSize)
include(CheckLibraryExists)
include(CheckCXXCompilerFlag)
if(NOT WIN32)
include(FindPkgConfig)
endif()
# If extra include directories were specified, tell cmake about them.
if(EXTRA_INCLUDE)
include_directories(${EXTRA_INCLUDE})
@@ -40,15 +129,20 @@ if(EXTRA_LIBS)
link_directories(${EXTRA_LIBS})
endif()
# setup conan
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/conanbuildinfo.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/conanbuildinfo.cmake")
conan_basic_setup()
endif()
# Find gettext
find_package(Gettext)
find_package(Intl)
if(Gettext_FOUND AND Intl_FOUND)
if(GETTEXT_FOUND AND Intl_FOUND)
set(HAVE_LOCALIZATION ON)
include_directories(${Intl_INCLUDE_DIRS})
link_libraries(${Intl_LIBRARIES})
else()
message(STATUS "Unable to find gettext and/or libintl -- read docs/LANGUAGE for how to enable localization")
message("Unable to find gettext and libintl; disabling localization")
set(HAVE_LOCALIZATION OFF)
endif()
@@ -59,6 +153,11 @@ include_directories(
${Anope_SOURCE_DIR}/vendor
)
# Pass on REPRODUCIBLE_BUILD
if(REPRODUCIBLE_BUILD)
add_definitions(-DREPRODUCIBLE_BUILD)
endif()
if(WIN32)
# If using Windows, include the windows specific folder for anope_windows.h
include_directories(${Anope_SOURCE_DIR}/src/win32)
@@ -66,33 +165,33 @@ endif()
# If using Visual Studio, set the C++ flags accordingly
if(MSVC)
# Set the compile flags to have warnings on the max setting (but disable a few annoying ones), exception handling turned on
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /wd4100 /wd4127 /wd4250 /wd4251 /wd4267 /wd4275 /wd4355 /wd4706 /wd4800 /wd4996 /EHs")
# Remove the default exception handling flags, also remove default warning level flag
string(REPLACE "/EHsc " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REPLACE "/GX " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REPLACE "/W3 " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
# Set the compile flags to have warnings on the max setting (but disable a few annoying ones), exception handling turned on, the proper defines
set(CXXFLAGS "${CXXFLAGS} /W4 /wd4100 /wd4127 /wd4250 /wd4251 /wd4267 /wd4275 /wd4355 /wd4706 /wd4800 /wd4996 /EHs")
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
# Otherwise, we're not using Visual Studio
else()
# Set the compile flags to have all warnings on (including shadowed variables)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -Wformat=2 -Wmissing-format-attribute -Wpedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-format-nonliteral -Wno-format-y2k -Wno-format-zero-length -Wno-date-time -Wno-unused-parameter")
set(CXXFLAGS "${CXXFLAGS} -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -Wformat=2 -Wmissing-format-attribute -Wpedantic -Wno-format-nonliteral -Wno-format-zero-length -Wno-unused-parameter ${CMAKE_CXX_FLAGS}")
endif()
# If CMake has found that the given system requires a special library for dl* calls, include it with the linker flags
if(CMAKE_DL_LIBS)
link_libraries(${CMAKE_DL_LIBS})
list(APPEND LINK_LIBS ${CMAKE_DL_LIBS})
endif()
# Find the linker flags required for using threads.
find_package("Threads" REQUIRED)
if(CMAKE_THREAD_LIBS_INIT)
link_libraries(${CMAKE_THREAD_LIBS_INIT})
list(APPEND LINK_LIBS ${CMAKE_THREAD_LIBS_INIT})
endif()
# On Windows, also link Anope to the memory library and Winsock.
if(WIN32)
link_libraries("Ws2_32")
if(MSVC)
link_libraries("win32_memory")
endif()
# Under MinGW, the -shared flag isn't properly set in the module-specific linker flags, add it from the C flags for shared libraries
if(MINGW)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
endif()
if(NOT PROGRAM_NAME)
@@ -105,7 +204,7 @@ if(NOT MSVC)
check_cxx_compiler_flag(-pipe HAVE_PIPE_FLAG)
# If the flag was accepted, add it to the list of flags
if(HAVE_PIPE_FLAG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe")
set(CXXFLAGS "${CXXFLAGS} -pipe")
endif()
endif()
@@ -119,18 +218,26 @@ if(NOT DEFUMASK)
endif()
# Set the DEBUG_BUILD for sysconf.h
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(DEBUG_BUILD TRUE)
endif()
# Check for the existence of the following functions
check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
check_function_exists(umask HAVE_UMASK)
check_function_exists(epoll_wait HAVE_EPOLL)
check_function_exists(poll HAVE_POLL)
check_function_exists(kqueue HAVE_KQUEUE)
# Strip the leading and trailing spaces from the compile flags
if(CXXFLAGS)
string(STRIP ${CXXFLAGS} CXXFLAGS)
endif()
# Strip the leading and trailing spaces from the linker flags
if(LDFLAGS)
string(STRIP ${LDFLAGS} LDFLAGS)
endif()
# Search for the following programs
if(NOT WIN32 AND RUNGROUP)
find_program(CHGRP "chgrp" REQUIRED)
@@ -141,15 +248,15 @@ endif()
if(INSTDIR)
set(CMAKE_INSTALL_PREFIX "${INSTDIR}")
elseif(NOT CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/anope-${VERSION_MAJOR}-${VERSION_MINOR}")
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/anope")
endif()
# Set default paths for various directories if not already defined
if(NOT BIN_DIR)
set(BIN_DIR "bin")
endif()
if(NOT DATA_DIR)
set(DATA_DIR "data")
if(NOT DB_DIR)
set(DB_DIR "data")
endif()
if(NOT DOC_DIR)
set(DOC_DIR "doc")
@@ -157,14 +264,14 @@ endif()
if(NOT CONF_DIR)
set(CONF_DIR "conf")
endif()
if(NOT MODULE_DIR)
set(MODULE_DIR "modules")
if(NOT LIB_DIR)
set(LIB_DIR "lib")
endif()
if(NOT LOCALE_DIR)
set(LOCALE_DIR "locale")
endif()
if(NOT LOG_DIR)
set(LOG_DIR "logs")
if(NOT LOGS_DIR)
set(LOGS_DIR "logs")
endif()
# Version number processing
@@ -213,22 +320,44 @@ if(WIN32)
configure_file(${Anope_SOURCE_DIR}/src/win32/win32.rc.cmake ${Anope_BINARY_DIR}/src/win32/win32.rc)
endif()
# Add the initial files to ignore which will be ignored regardless of if you are building in-source or out-of-source
add_to_cpack_ignored_files(".git\;config.cache\;CMakeFiles\;sysconf.h$\;build" TRUE)
# Add the files we don't want the periods converted for
add_to_cpack_ignored_files(".\\\\\\\\.so$;.\\\\\\\\.o$;.\\\\\\\\.s$;${Anope_SOURCE_DIR}/Makefile$")
# If the two directories are the same, we are building in-source, thus we need to ignore more files from the build
if(${Anope_SOURCE_DIR} STREQUAL ${Anope_BINARY_DIR})
# Add the files that need their periods converted
add_to_cpack_ignored_files("Makefile\;cmake_install.cmake\;sysconf.h$\;CMakeCache.txt\;install_manifest.txt" TRUE)
# Add the files we don't want the periods converted for
add_to_cpack_ignored_files(".\\\\\\\\.so$;CPack.;anope-${VERSION_FULL_NOBUILD}-source\\\\\\\\..")
# If using Visual Studio, add these files as well
if(MSVC)
add_to_cpack_ignored_files(".vcproj$\;.sln$\;.ncb$\;.suo$\;.dir$\;.ilk$\;.exp$\;.pdb$\;.lib$\;/debug$;/release$;/relwithdebinfo$;/minsizerel$" TRUE)
endif()
endif()
# Go into the following directories and run their CMakeLists.txt as well
add_subdirectory(data)
add_subdirectory(docs)
add_subdirectory(language)
add_subdirectory(src)
add_subdirectory(modules)
add_subdirectory(include)
# Get the filename of the Anope binary, to use later
set(SERVICES_BINARY "$<TARGET_FILE:${PROGRAM_NAME}>")
cmake_path(GET SERVICES_BINARY FILENAME SERVICES_BINARY)
get_filename_component(SERVICES_BINARY ${SERVICES_BINARY} NAME)
# At install time, create the following additional directories
file(REAL_PATH ${DATA_DIR} ABSOLUTE_DATA_DIR BASE_DIRECTORY ${CMAKE_INSTALL_PREFIX})
file(REAL_PATH ${LOG_DIR} ABSOLUTE_LOG_DIR BASE_DIRECTORY ${CMAKE_INSTALL_PREFIX})
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ABSOLUTE_DATA_DIR}/backups\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ABSOLUTE_LOG_DIR}\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/backups\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${LOGS_DIR}\")")
if(WIN32)
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ABSOLUTE_DATA_DIR}/runtime\")")
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/runtime\")")
endif()
# On non-Windows platforms, if RUNGROUP is set, change the permissions of the below directories, as well as the group of the data directory
if(NOT WIN32 AND RUNGROUP)
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\$ENV{DESTDIR}${ABSOLUTE_DATA_DIR}/backups\")")
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\$ENV{DESTDIR}${ABSOLUTE_LOG_DIR}\")")
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${DB_DIR}/backups\")")
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${LOGS_DIR}\")")
install(CODE "execute_process(COMMAND ${CHGRP} -R ${RUNGROUP} \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\")")
endif()
# On Windows platforms, install extra files
@@ -238,8 +367,7 @@ if(WIN32)
)
endif()
file(REAL_PATH ${MODULE_DIR} ABSOLUTE_MODULE_DIR BASE_DIRECTORY ${CMAKE_INSTALL_PREFIX})
install(CODE "file(REMOVE_RECURSE \"$ENV{DESTDIR}${ABSOLUTE_MODULE_DIR}\")")
install(CODE "file(REMOVE_RECURSE \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/modules\")")
# Only process the CPack section if we have CPack
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
@@ -250,7 +378,7 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}${VERSION_EXTRA}")
set(CPACK_PACKAGE_FILE_NAME "anope-${VERSION_FULL_NOBUILD}")
set(CPACK_RESOURCE_FILE_LICENSE "${Anope_SOURCE_DIR}/docs/LICENSE.txt")
set(CPACK_RESOURCE_FILE_LICENSE "${Anope_SOURCE_DIR}/docs/COPYING")
# The following doesn't actually do anything. :(
#set(CPACK_RESOURCE_FILE_README "${Anope_SOURCE_DIR}/docs/README")
# The following is primarily for NSIS
@@ -281,14 +409,7 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
endif()
set(CPACK_SOURCE_PACKAGE_FILE_NAME "anope-${VERSION_FULL_NOBUILD}-source")
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_IGNORE_FILES "$ENV{CPACK_IGNORED_FILES}")
set(CPACK_MONOLITHIC_INSTALL TRUE)
include(CPack)
endif()
# Go into the following directories and run their CMakeLists.txt as well
add_subdirectory(data)
add_subdirectory(docs)
add_subdirectory(language)
add_subdirectory(src)
add_subdirectory(modules)
add_subdirectory(include)
+81 -78
View File
@@ -1,21 +1,29 @@
#!/bin/sh
#
# Anope IRC Services <https://www.anope.org/>
# Configuration script for Anope.
#
# Copyright (C) 2003-2026 Anope Contributors
# Anope (C) 2003-2024 Anope Team
# Contact us at team@anope.org
#
# Anope is free software. You can use, modify, and/or distribute it under the
# terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
# for the complete terms of this license and docs/AUTHORS.txt for a list of
# contributors.
# This program is free but copyrighted software; see the file COPYING for
# details.
#
# Based on the original code of Epona by Lara
# Based on the original code of Services by Andy Church
# Based on the original code of Epona by PegSoft.
# Based on the original code of Services by Andy Church.
#
# SPDX-License-Identifier: GPL-2.0-only
###########################################################################
SOURCE_DIR="$(cd "$(dirname "$0")" && pwd)"
. $SOURCE_DIR/src/version.sh
echo2 () {
$ECHO2 "$*$ECHO2SUF" # these are defined later
}
exists () { # because some shells don't have test -e
if [ -f $1 -o -d $1 -o -p $1 -o -c $1 -o -b $1 ] ; then
return 0
else
return 1
fi
}
Load_Cache () {
if [ -f $SOURCE_DIR/config.cache -a -r $SOURCE_DIR/config.cache -a ! "$IGNORE_CACHE" ] ; then
@@ -29,56 +37,83 @@ Load_Cache () {
}
Run_Build_System () {
BUILD_DIR="${SOURCE_DIR}/build"
CMAKE_COMMAND="${CMAKE:-cmake} -B ${BUILD_DIR} -S ${SOURCE_DIR}"
WITH_INST=""
WITH_RUN=""
WITH_PERM=""
EXTRA_INCLUDE=""
EXTRA_LIBS=""
GEN_TYPE=""
if [ "$INSTDIR" != "" ] ; then
CMAKE_COMMAND="${CMAKE_COMMAND} -D INSTDIR=$INSTDIR"
WITH_INST="-DINSTDIR:STRING=$INSTDIR"
fi
if [ "$RUNGROUP" != "" ] ; then
CMAKE_COMMAND="${CMAKE_COMMAND} -D RUNGROUP=$RUNGROUP"
WITH_RUN="-DRUNGROUP:STRING=$RUNGROUP"
fi
if [ "$UMASK" != "" ] ; then
CMAKE_COMMAND="${CMAKE_COMMAND} -D DEFUMASK=$UMASK"
WITH_PERM="-DDEFUMASK:STRING=$UMASK"
fi
if [ "$DEBUG" = "yes" ] ; then
CMAKE_COMMAND="${CMAKE_COMMAND} -D CMAKE_BUILD_TYPE=Debug"
BUILD_TYPE="-DCMAKE_BUILD_TYPE:STRING=DEBUG"
else
CMAKE_COMMAND="${CMAKE_COMMAND} -D CMAKE_BUILD_TYPE=Release"
BUILD_TYPE="-DCMAKE_BUILD_TYPE:STRING=RELEASE"
fi
if [ "$EXTRA_INCLUDE_DIRS" != "" ] ; then
CMAKE_COMMAND="${CMAKE_COMMAND} -D EXTRA_INCLUDE=$EXTRA_INCLUDE_DIRS"
EXTRA_INCLUDE="-DEXTRA_INCLUDE:STRING=$EXTRA_INCLUDE_DIRS"
fi
if [ "$EXTRA_LIB_DIRS" != "" ] ; then
CMAKE_COMMAND="${CMAKE_COMMAND} -D EXTRA_LIBS=$EXTRA_LIB_DIRS"
EXTRA_LIBS="-DEXTRA_LIBS:STRING=$EXTRA_LIB_DIRS"
fi
if [ "$EXTRA_CONFIG_ARGS" != "" ] ; then
CMAKE_COMMAND="${CMAKE_COMMAND} $EXTRA_CONFIG_ARGS"
if [ "$SOURCE_DIR" = "." ] ; then
pwdsave=`pwd`
test -d build || mkdir build
cd "build"
REAL_SOURCE_DIR=".."
else
REAL_SOURCE_DIR="$SOURCE_DIR"
fi
echo $CMAKE_COMMAND
$CMAKE_COMMAND
echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR"
cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR
if [ $? -ne 0 ]; then
echo "You should fix these issues and then run ./Config -quick to rerun CMake."
exit 1
fi
echo ""
echo "Now run 'make -C ${BUILD_DIR#"$PWD/"} install' to build and install Anope."
if [ "$SOURCE_DIR" = "." ] ; then
echo "Now cd build, then run make to build Anope."
cd "$pwdsave"
else
echo "Now run make to build Anope."
fi
}
ECHO2SUF=''
if [ "`echo -n a ; echo -n b`" = "ab" ] ; then
ECHO2='echo -n'
elif [ "`echo 'a\c' ; echo 'b\c'`" = "ab" ] ; then
ECHO2='echo' ; ECHO2SUF='\c'
elif [ "`printf 'a' 2>&1 ; printf 'b' 2>&1`" = "ab" ] ; then
ECHO2='printf "%s"'
else
# oh well...
ECHO2='echo'
fi
export ECHO2 ECHO2SUF
###########################################################################
# Init values
###########################################################################
INSTDIR="${HOME}/anope-${VERSION_MAJOR}.${VERSION_MINOR}"
INSTDIR=$HOME/anope
RUNGROUP=
UMASK=
DEBUG="no"
@@ -86,18 +121,14 @@ EXTRA_INCLUDE_DIRS=
EXTRA_LIB_DIRS=
EXTRA_CONFIG_ARGS=
CAN_QUICK="no"
SOURCE_DIR=`dirname $0`
###########################################################################
# Check out the options
###########################################################################
while [ $# -ge 1 ] ; do
OPTION=$1
while [ "${OPTION#-}" != "$OPTION" ]; do
OPTION="${OPTION#-}"
done
if [ "$OPTION" = "--help" ] ; then
if [ $1 = "--help" ] ; then
echo "Config utility for Anope"
echo "------------------------"
echo "Syntax: ./Config [options]"
@@ -105,15 +136,14 @@ while [ $# -ge 1 ] ; do
echo "-nointro Skip intro (disclaimer, etc)"
echo "-quick Skip questions, go straight to cmake"
exit 0
elif [ "$OPTION" = "devel" ] ; then
elif [ $1 = "-devel" ] ; then
DEBUG="yes"
DEVEL="yes"
INSTDIR="$SOURCE_DIR/run"
elif [ "$OPTION" = "nocache" ] ; then
INSTDIR="$PWD/run"
elif [ $1 = "-nocache" ] ; then
IGNORE_CACHE="1"
elif [ "$OPTION" = "nointro" ] ; then
elif [ $1 = "-nointro" ] ; then
NO_INTRO="1"
elif [ "$OPTION" = "quick" -o "$OPTION" = "q" ] ; then
elif [ $1 = "-quick" -o $1 = "-q" ] ; then
Load_Cache
if [ "$CAN_QUICK" = "yes" ] ; then
Run_Build_System
@@ -133,7 +163,7 @@ done
cmake --version 2>&1 > /dev/null
if [ $? -ne 0 ] ; then
clear
echo "Anope requires CMake 3.20 or newer, which can be downloaded at https://cmake.org/ or through your system's package manager."
echo "Anope requires CMake 3.8 or newer, which can be downloaded at https://cmake.org/ or through your system's package manager."
echo "If you have installed CMake already, ensure it is in your PATH environment variable."
exit 0
fi
@@ -142,6 +172,7 @@ fi
if [ ! "$NO_INTRO" ] ; then
export MORE='-e'
. $SOURCE_DIR/src/version.sh
cat $SOURCE_DIR/.BANNER | sed "s/CURVER/$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH$VERSION_EXTRA/" | sed "s@SOURCE_DIR@$SOURCE_DIR@" | more
echo ""
else
@@ -165,47 +196,20 @@ export ok INPUT
####
TEMP_YN="n"
if [ "$DEVEL" = "yes" ] ; then
TEMP_YN="y"
fi
echo "You are building the 2.1 development branch. This branch is not as well tested"
echo "as the 2.0 stable branch and may have compatibility breaks without notice. Are"
echo "you sure you want to use this version?"
echo -n "[$TEMP_YN] "
read YN
if [ "$YN" ] ; then
if [ "$YN" = "y" ] ; then
DEVEL="yes"
else
DEVEL="no"
fi
fi
echo ""
if [ "$DEVEL" != "yes" ] ; then
echo "If you are building from Git you can run \`git checkout 2.0\` to get the latest"
echo "stable code. Otherwise, you can download the latest 2.0 release tarball from"
echo "https://github.com/anope/anope/releases/latest"
exit 1
fi
####
ok=0
echo "In what directory should Anope be installed?"
while [ $ok -eq 0 ] ; do
echo -n "[$INSTDIR] "
echo2 "[$INSTDIR] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ ! "$INPUT" ] ; then
INPUT=$INSTDIR
fi
if [ ! -d "$INPUT" ] ; then
if [ -e "$INPUT" ]; then
if exists "$INPUT" ; then
echo "$INPUT exists, but is not a directory!"
else
echo "$INPUT does not exist. Create it?"
echo -n "[y] "
echo2 "[y] "
read YN
if [ "$YN" != "n" ] ; then
if mkdir -p $INPUT ; then
@@ -213,7 +217,7 @@ while [ $ok -eq 0 ] ; do
fi
fi
fi
elif [ -e "$INPUT/include/services.h" ]; then
elif exists "$INPUT/include/services.h" ; then
echo "You cannot use the Anope source directory as a target directory."
else
ok=1
@@ -234,7 +238,7 @@ else
echo "should not force files to be owned by a particular group, just press"
echo "Return.)"
fi
echo -n "[$RUNGROUP] "
echo2 "[$RUNGROUP] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ "$INPUT" ] ; then
if [ "$INPUT" = "none" ] ; then
@@ -259,7 +263,7 @@ ok=0
echo "What should the default umask for data files be (in octal)?"
echo "(077 = only accessible by owner; 007 = accessible by owner and group)"
while [ $ok -eq 0 ] ; do
echo -n "[$UMASK] "
echo2 "[$UMASK] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ ! "$INPUT" ] ; then
INPUT=$UMASK
@@ -283,7 +287,7 @@ if [ "$DEBUG" = "yes" ] ; then
TEMP_YN="y"
fi
echo "Would you like to build a debug version of Anope?"
echo -n "[$TEMP_YN] "
echo2 "[$TEMP_YN] "
read YN
if [ "$YN" ] ; then
if [ "$YN" = "y" ] ; then
@@ -301,7 +305,7 @@ echo "You may only need to do this if CMake is unable to locate"
echo "missing dependencies without hints."
echo "Separate directories with semicolons."
echo "If you need no extra include directories, enter NONE in all caps."
echo -n "[$EXTRA_INCLUDE_DIRS] "
echo2 "[$EXTRA_INCLUDE_DIRS] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ "$INPUT" ] ; then
if [ "$INPUT" = "NONE" ] ; then
@@ -319,7 +323,7 @@ echo "You may only need to do this if CMake is unable to locate"
echo "missing dependencies without hints."
echo "Separate directories with semicolons."
echo "If you need no extra library directories, enter NONE in all caps."
echo -n "[$EXTRA_LIB_DIRS] "
echo2 "[$EXTRA_LIB_DIRS] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ "$INPUT" ] ; then
if [ "$INPUT" = "NONE" ] ; then
@@ -334,7 +338,7 @@ echo ""
echo "Are there any extra arguments you wish to pass to CMake?"
echo "If you need no extra arguments to CMake, enter NONE in all caps."
echo -n "[$EXTRA_CONFIG_ARGS] "
echo2 "[$EXTRA_CONFIG_ARGS] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ "$INPUT" ] ; then
if [ "$INPUT" = "NONE" ] ; then
@@ -351,14 +355,13 @@ echo ""
# Store values
################################################################################
echo -n "Saving configuration results in config.cache... "
echo2 "Saving configuration results in config.cache... "
cat <<EOT >$SOURCE_DIR/config.cache
INSTDIR="$INSTDIR"
RUNGROUP="$RUNGROUP"
UMASK=$UMASK
DEBUG="$DEBUG"
DEVEL="$DEVEL"
EXTRA_INCLUDE_DIRS="$EXTRA_INCLUDE_DIRS"
EXTRA_LIB_DIRS="$EXTRA_LIB_DIRS"
EXTRA_CONFIG_ARGS="$EXTRA_CONFIG_ARGS"
BIN
View File
Binary file not shown.
+2 -2
View File
@@ -4,7 +4,7 @@ Anope is an open source set of IRC services. It is highly modular, with a vast n
* [Website](https://anope.org)
* [GitHub](https://github.com/anope)
* IRC \#anope on irc.teranova.net
* IRC \#anope on irc.anope.org
## Installation
@@ -33,7 +33,7 @@ Copy conf/anope.example.conf to conf/anope.conf
$ cp conf/anope.example.conf conf/anope.conf
```
Edit anope.conf, configuring the uplink, serverinfo, and protocol module configurations. Example link blocks for popular IRCds are included in the the example.conf documentation. The [Anope wiki](https://wiki.anope.org) is also a good source of information. Our support channel is located at #anope on [irc.teranova.net](ircs://irc.teranova.net/anope).
Edit anope.conf, configuring the uplink, serverinfo, and protocol module configurations. Example link blocks for popular IRCds are included in the anope.example.conf documentation. The [Anope wiki](https://wiki.anope.org) is also a good source of information. Our support channel is located at #anope on [irc.anope.org](irc://irc.anope.org/#anope).
Note that the example configuration file includes other example configuration files. If you want to modify the other example configuration files, copy them (e.g. `modules.example.conf` to `modules.conf`) and modify the `include` directive in `anope.conf` to include the new file.
+106
View File
@@ -0,0 +1,106 @@
###############################################################################
# calculate_libraries(<source filename> <output variable for linker flags> <output variable for extra depends>)
#
# This macro is used in most of the module (sub)directories to calculate the
# library dependencies for the given source file.
###############################################################################
macro(calculate_libraries SRC SRC_LDFLAGS EXTRA_DEPENDS)
# Set up a temporary LDFLAGS for this file
set(THIS_LDFLAGS "${LDFLAGS}")
# Reset extra dependencies
set(EXTRA_DEPENDENCIES)
# Reset library paths
set(LIBRARY_PATHS)
# Reset libraries
set(LIBRARIES)
# Check to see if there are any lines matching: /* RequiredLibraries: [something] */
if(WIN32)
file(STRINGS ${SRC} REQUIRED_LIBRARIES REGEX "/\\*[ \t]*RequiredWindowsLibraries:[ \t]*.*[ \t]*\\*/")
else()
file(STRINGS ${SRC} REQUIRED_LIBRARIES REGEX "/\\*[ \t]*RequiredLibraries:[ \t]*.*[ \t]*\\*/")
endif()
# Iterate through those lines
foreach(REQUIRED_LIBRARY ${REQUIRED_LIBRARIES})
# Strip off the /* RequiredLibraries: and */ from the line
string(REGEX REPLACE "/\\*[ \t]*Required.*Libraries:[ \t]*([^ \t]*)[ \t]*\\*/" "\\1" REQUIRED_LIBRARY ${REQUIRED_LIBRARY})
# Replace all commas with semicolons
string(REGEX REPLACE "," ";" REQUIRED_LIBRARY ${REQUIRED_LIBRARY})
# Iterate through the libraries given
foreach(LIBRARY ${REQUIRED_LIBRARY})
# If the library has multiple names extract the alternate.
unset(LIBRARY_ALT)
if (${LIBRARY} MATCHES "^.+\\|.+$")
string(REGEX REPLACE ".+\\|(.*)" "\\1" LIBRARY_ALT ${LIBRARY})
string(REGEX REPLACE "(.+)\\|.*" "\\1" LIBRARY ${LIBRARY})
endif()
# Locate the library to see if it exists
if(DEFAULT_LIBRARY_DIRS OR DEFINED $ENV{VCINSTALLDIR})
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${LIBRARY_ALT} PATHS ${DEFAULT_LIBRARY_DIRS} $ENV{VCINSTALLDIR}/lib ${EXTRA_INCLUDE} ${EXTRA_LIBS})
else()
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${LIBRARY_ALT} PATHS ${EXTRA_INCLUDE} ${EXTRA_LIBS} NO_DEFAULT_PATH)
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${LIBRARY_ALT} PATHS ${EXTRA_INCLUDE} ${EXTRA_LIBS})
endif()
# If the library was found, we will add it to the linker flags
if(FOUND_${LIBRARY}_LIBRARY)
if(MSVC)
# For Visual Studio, instead of editing the linker flags, we'll add the library to a separate list of extra dependencies
list(APPEND EXTRA_DEPENDENCIES "${FOUND_${LIBRARY}_LIBRARY}")
else()
# Get the path only of the library, to add it to library paths.
get_filename_component(LIBRARY_PATH ${FOUND_${LIBRARY}_LIBRARY} PATH)
list(APPEND LIBRARY_PATHS "${LIBRARY_PATH}")
# Extract the library short name, add it to the library path
get_filename_component(LIBRARY_NAME ${FOUND_${LIBRARY}_LIBRARY} NAME_WE)
string(REGEX REPLACE "^lib" "" LIBRARY_NAME ${LIBRARY_NAME})
list(APPEND LIBRARIES ${LIBRARY_NAME})
endif()
else()
# In the case of the library not being found, we fatally error so CMake stops trying to generate
message(FATAL_ERROR "${SRC} needs library ${LIBRARY} but we were unable to locate that library! Check that the library is within the search path of your OS.")
endif()
endforeach()
endforeach()
# Remove duplicates from the library paths
if(LIBRARY_PATHS)
list(REMOVE_DUPLICATES LIBRARY_PATHS)
endif()
# Remove diplicates from the libraries
if(LIBRARIES)
list(REMOVE_DUPLICATES LIBRARIES)
endif()
# Iterate through library paths and add them to the linker flags
foreach(LIBRARY_PATH ${LIBRARY_PATHS})
if(NOT "${LIBRARY_PATH}" IN_LIST DEFAULT_LIBRARY_DIRS)
set(THIS_LDFLAGS "${THIS_LDFLAGS} -L${LIBRARY_PATH}")
endif()
endforeach()
# Iterate through libraries and add them to the linker flags
foreach(LIBRARY ${LIBRARIES})
list(APPEND EXTRA_DEPENDENCIES "${LIBRARY}")
endforeach()
set(${SRC_LDFLAGS} "${THIS_LDFLAGS}")
set(${EXTRA_DEPENDS} "${EXTRA_DEPENDENCIES}")
endmacro()
###############################################################################
# add_to_cpack_ignored_files(<item> [TRUE])
#
# A macro to update the environment variable CPACK_IGNORED_FILES which
# contains a list of files for CPack to ignore. If the optional 2nd argument
# of TRUE is given, periods will be converted to \\. for CPack.
###############################################################################
macro(add_to_cpack_ignored_files ITEM)
# Temporary copy of the original item
set(REAL_ITEM "${ITEM}")
# If we have 2+ arguments, assume that the second one was something like TRUE (doesn't matter really) and convert periods so they will be \\. for CPack
if(${ARGC} GREATER 1)
string(REPLACE "." "\\\\." REAL_ITEM ${REAL_ITEM})
endif()
# If the environment variable is already defined, just tack the item to the end
if(DEFINED ENV{CPACK_IGNORED_FILES})
set(ENV{CPACK_IGNORED_FILES} "$ENV{CPACK_IGNORED_FILES};${REAL_ITEM}")
# Otherwise set the environment variable to the item
else()
set(ENV{CPACK_IGNORED_FILES} "${REAL_ITEM}")
endif()
endmacro()
+825
View File
@@ -0,0 +1,825 @@
; CPack install script designed for a nmake build
;--------------------------------
; You must define these values
!define VERSION "@CPACK_PACKAGE_VERSION@"
!define INST_DIR "@CPACK_TEMPORARY_DIRECTORY@"
;--------------------------------
;Variables
Var MUI_TEMP
Var STARTMENU_FOLDER
Var SV_ALLUSERS
Var START_MENU
Var DO_NOT_ADD_TO_PATH
Var ADD_TO_PATH_ALL_USERS
Var ADD_TO_PATH_CURRENT_USER
Var INSTALL_DESKTOP
;--------------------------------
;Include Modern UI
!include "MUI2.nsh"
;Default installation folder
InstallDir "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
;--------------------------------
;General
;Name and file
Name "@CPACK_PACKAGE_NAME@ @CPACK_PACKAGE_VERSION@"
OutFile "@CPACK_TOPLEVEL_DIRECTORY@/@CPACK_OUTPUT_FILE_NAME@"
;Set compression
SetCompressor @CPACK_NSIS_COMPRESSOR@
@CPACK_NSIS_DEFINES@
!include Sections.nsh
;--- Component support macros: ---
; The code for the add/remove functionality is from:
; http://nsis.sourceforge.net/Add/Remove_Functionality
; It has been modified slightly and extended to provide
; inter-component dependencies.
Var AR_SecFlags
Var AR_RegFlags
@CPACK_NSIS_SECTION_SELECTED_VARS@
; Loads the "selected" flag for the section named SecName into the
; variable VarName.
!macro LoadSectionSelectedIntoVar SecName VarName
SectionGetFlags ${${SecName}} $${VarName}
IntOp $${VarName} $${VarName} & ${SF_SELECTED} ;Turn off all other bits
!macroend
; Loads the value of a variable... can we get around this?
!macro LoadVar VarName
IntOp $R0 0 + $${VarName}
!macroend
; Sets the value of a variable
!macro StoreVar VarName IntValue
IntOp $${VarName} 0 + ${IntValue}
!macroend
!macro InitSection SecName
; This macro reads component installed flag from the registry and
;changes checked state of the section on the components page.
;Input: section index constant name specified in Section command.
ClearErrors
;Reading component status from registry
ReadRegDWORD $AR_RegFlags HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" "Installed"
IfErrors "default_${SecName}"
;Status will stay default if registry value not found
;(component was never installed)
IntOp $AR_RegFlags $AR_RegFlags & ${SF_SELECTED} ;Turn off all other bits
SectionGetFlags ${${SecName}} $AR_SecFlags ;Reading default section flags
IntOp $AR_SecFlags $AR_SecFlags & 0xFFFE ;Turn lowest (enabled) bit off
IntOp $AR_SecFlags $AR_RegFlags | $AR_SecFlags ;Change lowest bit
; Note whether this component was installed before
!insertmacro StoreVar ${SecName}_was_installed $AR_RegFlags
IntOp $R0 $AR_RegFlags & $AR_RegFlags
;Writing modified flags
SectionSetFlags ${${SecName}} $AR_SecFlags
"default_${SecName}:"
!insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected
!macroend
!macro FinishSection SecName
; This macro reads section flag set by user and removes the section
;if it is not selected.
;Then it writes component installed flag to registry
;Input: section index constant name specified in Section command.
SectionGetFlags ${${SecName}} $AR_SecFlags ;Reading section flags
;Checking lowest bit:
IntOp $AR_SecFlags $AR_SecFlags & ${SF_SELECTED}
IntCmp $AR_SecFlags 1 "leave_${SecName}"
;Section is not selected:
;Calling Section uninstall macro and writing zero installed flag
!insertmacro "Remove_${${SecName}}"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" \
"Installed" 0
Goto "exit_${SecName}"
"leave_${SecName}:"
;Section is selected:
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" \
"Installed" 1
"exit_${SecName}:"
!macroend
!macro RemoveSection_CPack SecName
; This macro is used to call section's Remove_... macro
;from the uninstaller.
;Input: section index constant name specified in Section command.
!insertmacro "Remove_${${SecName}}"
!macroend
; Determine whether the selection of SecName changed
!macro MaybeSelectionChanged SecName
!insertmacro LoadVar ${SecName}_selected
SectionGetFlags ${${SecName}} $R1
IntOp $R1 $R1 & ${SF_SELECTED} ;Turn off all other bits
; See if the status has changed:
IntCmp $R0 $R1 "${SecName}_unchanged"
!insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected
IntCmp $R1 ${SF_SELECTED} "${SecName}_was_selected"
!insertmacro "Deselect_required_by_${SecName}"
goto "${SecName}_unchanged"
"${SecName}_was_selected:"
!insertmacro "Select_${SecName}_depends"
"${SecName}_unchanged:"
!macroend
;--- End of Add/Remove macros ---
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;----------------------------------------
; based upon a script of "Written by KiCHiK 2003-01-18 05:57:02"
;----------------------------------------
!verbose 3
!include "WinMessages.NSH"
!verbose 4
;====================================================
; get_NT_environment
; Returns: the selected environment
; Output : head of the stack
;====================================================
!macro select_NT_profile UN
Function ${UN}select_NT_profile
StrCmp $ADD_TO_PATH_ALL_USERS "1" 0 environment_single
DetailPrint "Selected environment for all users"
Push "all"
Return
environment_single:
DetailPrint "Selected environment for current user only."
Push "current"
Return
FunctionEnd
!macroend
!insertmacro select_NT_profile ""
!insertmacro select_NT_profile "un."
;----------------------------------------------------
!define NT_current_env 'HKCU "Environment"'
!define NT_all_env 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
!ifndef WriteEnvStr_RegKey
!ifdef ALL_USERS
!define WriteEnvStr_RegKey \
'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
!else
!define WriteEnvStr_RegKey 'HKCU "Environment"'
!endif
!endif
; AddToPath - Adds the given dir to the search path.
; Input - head of the stack
; Note - Win9x systems requires reboot
Function AddToPath
Exch $0
Push $1
Push $2
Push $3
# don't add if the path doesn't exist
IfFileExists "$0\*.*" "" AddToPath_done
ReadEnvStr $1 PATH
Push "$1;"
Push "$0;"
Call StrStr
Pop $2
StrCmp $2 "" "" AddToPath_done
Push "$1;"
Push "$0\;"
Call StrStr
Pop $2
StrCmp $2 "" "" AddToPath_done
GetFullPathName /SHORT $3 $0
Push "$1;"
Push "$3;"
Call StrStr
Pop $2
StrCmp $2 "" "" AddToPath_done
Push "$1;"
Push "$3\;"
Call StrStr
Pop $2
StrCmp $2 "" "" AddToPath_done
Call IsNT
Pop $1
StrCmp $1 1 AddToPath_NT
; Not on NT
StrCpy $1 $WINDIR 2
FileOpen $1 "$1\autoexec.bat" a
FileSeek $1 -1 END
FileReadByte $1 $2
IntCmp $2 26 0 +2 +2 # DOS EOF
FileSeek $1 -1 END # write over EOF
FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n"
FileClose $1
SetRebootFlag true
Goto AddToPath_done
AddToPath_NT:
ReadRegStr $1 ${WriteEnvStr_RegKey} "PATH"
StrCmp $1 "" AddToPath_NTdoIt
Push $1
Call Trim
Pop $1
StrCpy $0 "$1;$0"
AddToPath_NTdoIt:
WriteRegExpandStr ${WriteEnvStr_RegKey} "PATH" $0
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
AddToPath_done:
Pop $3
Pop $2
Pop $1
Pop $0
FunctionEnd
; RemoveFromPath - Remove a given dir from the path
; Input: head of the stack
Function un.RemoveFromPath
Exch $0
Push $1
Push $2
Push $3
Push $4
Push $5
Push $6
IntFmt $6 "%c" 26 # DOS EOF
Call un.IsNT
Pop $1
StrCmp $1 1 unRemoveFromPath_NT
; Not on NT
StrCpy $1 $WINDIR 2
FileOpen $1 "$1\autoexec.bat" r
GetTempFileName $4
FileOpen $2 $4 w
GetFullPathName /SHORT $0 $0
StrCpy $0 "SET PATH=%PATH%;$0"
Goto unRemoveFromPath_dosLoop
unRemoveFromPath_dosLoop:
FileRead $1 $3
StrCpy $5 $3 1 -1 # read last char
StrCmp $5 $6 0 +2 # if DOS EOF
StrCpy $3 $3 -1 # remove DOS EOF so we can compare
StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine
StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine
StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine
StrCmp $3 "" unRemoveFromPath_dosLoopEnd
FileWrite $2 $3
Goto unRemoveFromPath_dosLoop
unRemoveFromPath_dosLoopRemoveLine:
SetRebootFlag true
Goto unRemoveFromPath_dosLoop
unRemoveFromPath_dosLoopEnd:
FileClose $2
FileClose $1
StrCpy $1 $WINDIR 2
Delete "$1\autoexec.bat"
CopyFiles /SILENT $4 "$1\autoexec.bat"
Delete $4
Goto unRemoveFromPath_done
unRemoveFromPath_NT:
ReadRegStr $1 ${WriteEnvStr_RegKey} "PATH"
StrCpy $5 $1 1 -1 # copy last char
StrCmp $5 ";" +2 # if last char != ;
StrCpy $1 "$1;" # append ;
Push $1
Push "$0;"
Call un.StrStr ; Find `$0;` in $1
Pop $2 ; pos of our dir
StrCmp $2 "" unRemoveFromPath_done
; else, it is in path
# $0 - path to add
# $1 - path var
StrLen $3 "$0;"
StrLen $4 $2
StrCpy $5 $1 -$4 # $5 is now the part before the path to remove
StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove
StrCpy $3 $5$6
StrCpy $5 $3 1 -1 # copy last char
StrCmp $5 ";" 0 +2 # if last char == ;
StrCpy $3 $3 -1 # remove last char
WriteRegExpandStr ${WriteEnvStr_RegKey} "PATH" $3
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
unRemoveFromPath_done:
Pop $6
Pop $5
Pop $4
Pop $3
Pop $2
Pop $1
Pop $0
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Uninstall stuff
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
###########################################
# Utility Functions #
###########################################
;====================================================
; IsNT - Returns 1 if the current system is NT, 0
; otherwise.
; Output: head of the stack
;====================================================
; IsNT
; no input
; output, top of the stack = 1 if NT or 0 if not
;
; Usage:
; Call IsNT
; Pop $R0
; ($R0 at this point is 1 or 0)
!macro IsNT un
Function ${un}IsNT
Push $0
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
StrCmp $0 "" 0 IsNT_yes
; we are not NT.
Pop $0
Push 0
Return
IsNT_yes:
; NT!!!
Pop $0
Push 1
FunctionEnd
!macroend
!insertmacro IsNT ""
!insertmacro IsNT "un."
; StrStr
; input, top of stack = string to search for
; top of stack-1 = string to search in
; output, top of stack (replaces with the portion of the string remaining)
; modifies no other variables.
;
; Usage:
; Push "this is a long ass string"
; Push "ass"
; Call StrStr
; Pop $R0
; ($R0 at this point is "ass string")
!macro StrStr un
Function ${un}StrStr
Exch $R1 ; st=haystack,old$R1, $R1=needle
Exch ; st=old$R1,haystack
Exch $R2 ; st=old$R1,old$R2, $R2=haystack
Push $R3
Push $R4
Push $R5
StrLen $R3 $R1
StrCpy $R4 0
; $R1=needle
; $R2=haystack
; $R3=len(needle)
; $R4=cnt
; $R5=tmp
loop:
StrCpy $R5 $R2 $R3 $R4
StrCmp $R5 $R1 done
StrCmp $R5 "" done
IntOp $R4 $R4 + 1
Goto loop
done:
StrCpy $R1 $R2 "" $R4
Pop $R5
Pop $R4
Pop $R3
Pop $R2
Exch $R1
FunctionEnd
!macroend
!insertmacro StrStr ""
!insertmacro StrStr "un."
Function Trim ; Added by Pelaca
Exch $R1
Push $R2
Loop:
StrCpy $R2 "$R1" 1 -1
StrCmp "$R2" " " RTrim
StrCmp "$R2" "$\n" RTrim
StrCmp "$R2" "$\r" RTrim
StrCmp "$R2" ";" RTrim
GoTo Done
RTrim:
StrCpy $R1 "$R1" -1
Goto Loop
Done:
Pop $R2
Exch $R1
FunctionEnd
Function ConditionalAddToRegistry
Pop $0
Pop $1
StrCmp "$0" "" ConditionalAddToRegistry_EmptyString
WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" \
"$1" "$0"
;MessageBox MB_OK "Set Registry: '$1' to '$0'"
DetailPrint "Set install registry entry: '$1' to '$0'"
ConditionalAddToRegistry_EmptyString:
FunctionEnd
;--------------------------------
!ifdef CPACK_USES_DOWNLOAD
Function DownloadFile
IfFileExists $INSTDIR\* +2
CreateDirectory $INSTDIR
Pop $0
; Skip if already downloaded
IfFileExists $INSTDIR\$0 0 +2
Return
StrCpy $1 "@CPACK_DOWNLOAD_SITE@"
try_again:
NSISdl::download "$1/$0" "$INSTDIR\$0"
Pop $1
StrCmp $1 "success" success
StrCmp $1 "Cancelled" cancel
MessageBox MB_OK "Download failed: $1"
cancel:
Return
success:
FunctionEnd
!endif
;--------------------------------
; Installation types
@CPACK_NSIS_INSTALLATION_TYPES@
;--------------------------------
; Component sections
@CPACK_NSIS_COMPONENT_SECTIONS@
;--------------------------------
; Define some macro setting for the gui
@CPACK_NSIS_INSTALLER_MUI_ICON_CODE@
@CPACK_NSIS_INSTALLER_ICON_CODE@
@CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC@
;--------------------------------
;Pages
!define MUI_LANGDLL_REGISTRY_ROOT "SHCTX"
!define MUI_LANGDLL_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@"
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@"
!insertmacro MUI_PAGE_DIRECTORY
;Start Menu Folder Page Configuration
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
@CPACK_NSIS_PAGE_COMPONENTS@
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\doc\README.txt"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "Portuguese"
!insertmacro MUI_LANGUAGE "Spanish"
;--------------------------------
;Installer Sections
Section "-Core installation"
;Use the entire tree produced by the INSTALL target. Keep the
;list of directories here in sync with the RMDir commands below.
SetOutPath "$INSTDIR"
@CPACK_NSIS_FULL_INSTALL@
;Store installation folder
WriteRegStr SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
Push "DisplayName"
Push "@CPACK_NSIS_DISPLAY_NAME@"
Call ConditionalAddToRegistry
Push "DisplayVersion"
Push "@CPACK_PACKAGE_VERSION@"
Call ConditionalAddToRegistry
Push "Publisher"
Push "@CPACK_PACKAGE_VENDOR@"
Call ConditionalAddToRegistry
Push "UninstallString"
Push "$INSTDIR\Uninstall.exe"
Call ConditionalAddToRegistry
Push "NoRepair"
Push "1"
Call ConditionalAddToRegistry
!ifdef CPACK_NSIS_ADD_REMOVE
;Create add/remove functionality
Push "ModifyPath"
Push "$INSTDIR\AddRemove.exe"
Call ConditionalAddToRegistry
!else
Push "NoModify"
Push "1"
Call ConditionalAddToRegistry
!endif
; Optional registration
Push "DisplayIcon"
Push "$INSTDIR\@CPACK_NSIS_INSTALLED_ICON_NAME@"
Call ConditionalAddToRegistry
Push "HelpLink"
Push "@CPACK_NSIS_HELP_LINK@"
Call ConditionalAddToRegistry
Push "URLInfoAbout"
Push "@CPACK_NSIS_URL_INFO_ABOUT@"
Call ConditionalAddToRegistry
Push "Contact"
Push "@CPACK_NSIS_CONTACT@"
Call ConditionalAddToRegistry
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
;Create shortcuts
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
@CPACK_NSIS_CREATE_ICONS@
@CPACK_NSIS_CREATE_ICONS_EXTRA@
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
; Write special uninstall registry entries
Push "StartMenu"
Push "$STARTMENU_FOLDER"
Call ConditionalAddToRegistry
Push "DoNotAddToPath"
Push "$DO_NOT_ADD_TO_PATH"
Call ConditionalAddToRegistry
Push "AddToPathAllUsers"
Push "$ADD_TO_PATH_ALL_USERS"
Call ConditionalAddToRegistry
Push "AddToPathCurrentUser"
Push "$ADD_TO_PATH_CURRENT_USER"
Call ConditionalAddToRegistry
Push "InstallToDesktop"
Push "$INSTALL_DESKTOP"
Call ConditionalAddToRegistry
@CPACK_NSIS_EXTRA_INSTALL_COMMANDS@
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
;--------------------------------
; determine admin versus local install
Function un.onInit
ClearErrors
UserInfo::GetName
IfErrors noLM
Pop $0
UserInfo::GetAccountType
Pop $1
StrCmp $1 "Admin" 0 +3
SetShellVarContext all
;MessageBox MB_OK 'User "$0" is in the Admin group'
Goto done
StrCmp $1 "Power" 0 +3
SetShellVarContext all
;MessageBox MB_OK 'User "$0" is in the Power Users group'
Goto done
noLM:
;Get installation folder from registry if available
done:
!insertmacro MUI_UNGETLANGUAGE
FunctionEnd
;--- Add/Remove callback functions: ---
!macro SectionList MacroName
;This macro used to perform operation on multiple sections.
;List all of your components in following manner here.
@CPACK_NSIS_COMPONENT_SECTION_LIST@
!macroend
Section -FinishComponents
;Removes unselected components and writes component status to registry
!insertmacro SectionList "FinishSection"
!ifdef CPACK_NSIS_ADD_REMOVE
; Get the name of the installer executable
System::Call 'kernel32::GetModuleFileNameA(i 0, t .R0, i 1024) i r1'
StrCpy $R3 $R0
; Strip off the last 13 characters, to see if we have AddRemove.exe
StrLen $R1 $R0
IntOp $R1 $R0 - 13
StrCpy $R2 $R0 13 $R1
StrCmp $R2 "AddRemove.exe" addremove_installed
; We're not running AddRemove.exe, so install it
CopyFiles $R3 $INSTDIR\AddRemove.exe
addremove_installed:
!endif
SectionEnd
;--- End of Add/Remove callback functions ---
;--------------------------------
; Component dependencies
Function .onSelChange
!insertmacro SectionList MaybeSelectionChanged
FunctionEnd
;--------------------------------
;Uninstaller Section
Section "Uninstall"
ReadRegStr $START_MENU SHCTX \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "StartMenu"
;MessageBox MB_OK "Start menu is in: $START_MENU"
ReadRegStr $DO_NOT_ADD_TO_PATH SHCTX \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "DoNotAddToPath"
ReadRegStr $ADD_TO_PATH_ALL_USERS SHCTX \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "AddToPathAllUsers"
ReadRegStr $ADD_TO_PATH_CURRENT_USER SHCTX \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "AddToPathCurrentUser"
;MessageBox MB_OK "Add to path: $DO_NOT_ADD_TO_PATH all users: $ADD_TO_PATH_ALL_USERS"
ReadRegStr $INSTALL_DESKTOP SHCTX \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "InstallToDesktop"
;MessageBox MB_OK "Install to desktop: $INSTALL_DESKTOP "
@CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS@
;Remove files we installed.
;Keep the list of directories here in sync with the File commands above.
@CPACK_NSIS_DELETE_FILES@
@CPACK_NSIS_DELETE_DIRECTORIES@
!ifdef CPACK_NSIS_ADD_REMOVE
;Remove the add/remove program
Delete "$INSTDIR\AddRemove.exe"
!endif
;Remove the uninstaller itself.
Delete "$INSTDIR\Uninstall.exe"
DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@"
;Remove the installation directory if it is empty.
RMDir "$INSTDIR"
; Remove the registry entries.
DeleteRegKey SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@"
; Removes all optional components
!insertmacro SectionList "RemoveSection_CPack"
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
@CPACK_NSIS_DELETE_ICONS@
@CPACK_NSIS_DELETE_ICONS_EXTRA@
;Delete empty start menu parent directories
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
startMenuDeleteLoop:
ClearErrors
RMDir $MUI_TEMP
GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
IfErrors startMenuDeleteLoopDone
StrCmp "$MUI_TEMP" "$SMPROGRAMS" startMenuDeleteLoopDone startMenuDeleteLoop
startMenuDeleteLoopDone:
; If the user changed the shortcut, then uninstall may not work. This should
; try to fix it.
StrCpy $MUI_TEMP "$START_MENU"
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
@CPACK_NSIS_DELETE_ICONS_EXTRA@
;Delete empty start menu parent directories
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
secondStartMenuDeleteLoop:
ClearErrors
RMDir $MUI_TEMP
GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
IfErrors secondStartMenuDeleteLoopDone
StrCmp "$MUI_TEMP" "$SMPROGRAMS" secondStartMenuDeleteLoopDone secondStartMenuDeleteLoop
secondStartMenuDeleteLoopDone:
DeleteRegKey /ifempty SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@"
Push $INSTDIR\bin
StrCmp $DO_NOT_ADD_TO_PATH_ "1" doNotRemoveFromPath 0
Call un.RemoveFromPath
doNotRemoveFromPath:
SectionEnd
;--------------------------------
; determine admin versus local install
; Is install for "AllUsers" or "JustMe"?
; Default to "JustMe" - set to "AllUsers" if admin or on Win9x
; This function is used for the very first "custom page" of the installer.
; This custom page does not show up visibly, but it executes prior to the
; first visible page and sets up $INSTDIR properly...
; Choose different default installation folder based on SV_ALLUSERS...
; "Program Files" for AllUsers, "My Documents" for JustMe...
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
; Reads components status for registry
!insertmacro SectionList "InitSection"
StrCpy $SV_ALLUSERS "JustMe"
StrCpy $INSTDIR "$DOCUMENTS\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
ClearErrors
UserInfo::GetName
IfErrors noLM
Pop $0
UserInfo::GetAccountType
Pop $1
StrCmp $1 "Admin" 0 +3
SetShellVarContext all
;MessageBox MB_OK 'User "$0" is in the Admin group'
StrCpy $SV_ALLUSERS "AllUsers"
Goto done
StrCmp $1 "Power" 0 +3
SetShellVarContext all
;MessageBox MB_OK 'User "$0" is in the Power Users group'
StrCpy $SV_ALLUSERS "AllUsers"
Goto done
noLM:
StrCpy $SV_ALLUSERS "AllUsers"
;Get installation folder from registry if available
done:
StrCmp $SV_ALLUSERS "AllUsers" 0 +2
StrCpy $INSTDIR "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
FunctionEnd
+2 -2
View File
@@ -1,6 +1,6 @@
# Only install cron.example.sh and anope.example.conf from this directory
# Only install example.chk and anope.example.conf from this directory
# NOTE: I would've had this just find all files in the directory, but that would include files not needed (like this file)
set(DATA cron.example.sh anope.example.conf botserv.example.conf hostserv.example.conf modules.example.conf operserv.example.conf chanserv.example.conf global.example.conf memoserv.example.conf nickserv.example.conf chanstats.example.conf)
set(DATA example.chk anope.example.conf botserv.example.conf hostserv.example.conf modules.example.conf operserv.example.conf chanserv.example.conf global.example.conf memoserv.example.conf nickserv.example.conf chanstats.example.conf irc2sql.example.conf stats.standalone.example.conf)
install(FILES ${DATA}
DESTINATION ${CONF_DIR}
)
+274 -357
View File
@@ -65,6 +65,10 @@
* will typically be disabled. If this is not the case, more
* information will be given in the documentation.
*
* [DISCOURAGED]
* Indicates a directive which may cause undesirable side effects if
* specified.
*
* [DEPRECATED]
* Indicates a directive which will disappear in a future version of
* Anope, usually because its functionality has been either
@@ -75,17 +79,13 @@
/*
* [OPTIONAL] Defines
*
* You can use defines for repeated information, which can be used to easily change many
* values in the configuration at once.
*
* To use a define called foo.bar you use ${foo.bar} in your config file. You can also use
* environment variables by prefixing their name with "env." like ${env.USER}.
* You can define values to other values, which can be used to easily change
* many values in the configuration at once.
*/
/*
* The "services.host" define is used in multiple different locations throughout
* the configuration for the server name and pseudoclient hostnames. You should
* change the value to the hostname you wish to use for your services server.
* The services.host define is used in multiple different locations throughout the
* configuration for services clients hostnames.
*/
define
{
@@ -127,9 +127,8 @@ define
* and serverinfo configuration would look like:
*
* # This goes in inspircd.conf, *NOT* your Anope config!
* <module name="account">
* <module name="hidechans">
* <module name="services">
* <module name="services_account">
* <module name="spanningtree">
* <bind address="127.0.0.1" port="7000" type="servers">
* <link name="services.example.com"
@@ -137,7 +136,7 @@ define
* port="7000"
* sendpass="mypassword"
* recvpass="mypassword">
* <services server="services.example.com" silent="yes">
* <uline server="services.example.com" silent="yes">
*
* An example configuration for UnrealIRCd that is compatible with the below uplink
* and serverinfo configuration would look like:
@@ -212,7 +211,7 @@ serverinfo
* other server names on the rest of your IRC network. Note that it does not have
* to be an existing hostname, just one that isn't on your network already.
*/
name = "${services.host}"
name = "services.example.com"
/*
* The text which should appear as the server's information in /WHOIS and similar
@@ -239,15 +238,15 @@ serverinfo
/*
* The filename containing the Anope process ID. The path is relative to the
* data directory.
* services root directory.
*/
pid = "anope.pid"
pid = "data/anope.pid"
/*
* The filename containing the Message of the Day. The path is relative to the
* config directory.
* services root directory.
*/
motd = "motd.txt"
motd = "conf/motd.txt"
}
/*
@@ -257,6 +256,7 @@ serverinfo
* You MUST modify this to match the IRCd you run.
*
* Supported:
* - bahamut
* - hybrid
* - inspircd
* - ngircd
@@ -265,7 +265,26 @@ serverinfo
* - solanum
* - unrealircd
*/
module { name = "inspircd" }
module
{
name = "inspircd"
/*
* Some protocol modules can enforce mode locks server-side. This reduces the spam caused by
* services immediately reversing mode changes for locked modes.
*
* If the protocol module you have loaded does not support this, this setting will have no effect.
*/
use_server_side_mlock = yes
/*
* Some protocol modules can enforce topic locks server-side. This reduces the spam caused by
* services immediately reversing topic changes.
*
* If the protocol module you have loaded does not support this, this setting will have no effect.
*/
use_server_side_topiclock = yes
}
/*
* [REQUIRED] Network Information
@@ -323,29 +342,29 @@ networkinfo
* The characters allowed in hostnames. This is used for validating hostnames given
* to services, such as BotServ bot hostnames and user vhosts. Changing this is not
* recommended unless you know for sure your IRCd supports whatever characters you are
* wanting to use. Telling services to set a vhost containing characters your IRCd
* wanting to use. Telling services to set a vHost containing characters your IRCd
* disallows could potentially break the IRCd and/or Anope.
*
* It is recommended you DON'T change this.
*/
#vhost_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-/"
vhost_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-"
/*
* If enabled, allows vhosts to not contain dots (.).
* If set to true, allows vHosts to not contain dots (.).
* Newer IRCds generally do not have a problem with this, but the same warning as
* vhost_chars applies.
*
* It is recommended you DON'T change this.
*/
allow_undotted_vhosts = no
allow_undotted_vhosts = false
/*
* The characters that are not allowed to be at the very beginning or very ending
* of a vhost. The same warning as vhost_chars applies.
* of a vHost. The same warning as vhost_chars applies.
*
* It is recommended you DON'T change this.
*/
disallow_start_or_end = ".-/"
disallow_start_or_end = ".-"
}
/*
@@ -376,6 +395,19 @@ options
*/
casemap = "ascii"
/*
* This key is used to initiate the random number generator. This number
* MUST be random as you want your passcodes to be random. Don't give this
* key to anyone! Keep it private!
*
* NOTE: If you don't uncomment this or keep the default values, any talented
* programmer would be able to easily "guess" random strings used to mask
* information. Be safe, and come up with a 7-digit number.
*
* This directive is optional, but highly recommended.
*/
#seed = 9866235
/*
* Sets the number of invalid password tries before services removes a user
* from the network. If a user enters a number of invalid passwords equal to
@@ -402,7 +434,7 @@ options
/*
* Sets the delay between automatic database updates.
*/
updatetimeout = 2m
updatetimeout = 5m
/*
* Sets the delay between checks for expired nicknames and channels.
@@ -414,6 +446,12 @@ options
*/
readtimeout = 5s
/*
* Sets the interval between sending warning messages for program errors via
* WALLOPS/GLOBOPS.
*/
warningtimeout = 4h
/*
* Sets the (maximum) frequency at which the timeout list is checked. This,
* combined with readtimeout above, determines how accurately timed events,
@@ -430,11 +468,26 @@ options
timeoutcheck = 3s
/*
* If set Anope will tell users to use a server-side alias for messaging
* services instead of /msg. The alias for each service defaults to the
* bot name but can be configured in the service block.
* If set, this will allow users to let services send PRIVMSGs to them
* instead of NOTICEs. Also see the "msg" option of nickserv:defaults,
* which also toggles the default communication (PRIVMSG or NOTICE) to
* use for unregistered users.
*
* This is a feature that is against the IRC RFC and should be used ONLY
* if absolutely necessary.
*
* This directive is optional, and not recommended.
*/
#servicealias = yes
#useprivmsg = yes
/*
* If set, will force services to only respond to PRIVMSGs addresses to
* Nick@ServerName - e.g. NickServ@example.com. This should be used in
* conjunction with IRCd aliases. This directive is optional.
*
* This option will have no effect on some IRCds, such as TS6 IRCds.
*/
#usestrictprivmsg = yes
/*
* If set, Anope will only show /stats o to IRC Operators. This directive
@@ -476,26 +529,6 @@ options
*/
didyoumeandifference = 4
/*
* The length of codes used for confirming actions like dropping a channel or a
* nickname.
*
* Defaults to 15 if not set.
*/
codelength = 15
/*
* If set, the maximum number of bytes after which to wrap services messages. This
* can be set a bit higher than the default but should be well under the maximum
* message length imposed by your IRC server or messages will end up truncated.
*
* NOTE: this currently only applies to tables but will be expanded to all messages
* in a later release.
*
* Defaults to 100 if not set.
*/
linelength = 100
/* The regex engine to use, as provided by the regex modules.
* Leave commented to disable regex matching.
*
@@ -510,15 +543,12 @@ options
*
* Removing .UTF-8 will instead use the default encoding for the language, e.g. iso-8859-1 for western European languages.
*/
languages = "de_DE.UTF-8 el_GR.UTF-8 es_ES.UTF-8 fr_FR.UTF-8 it_IT.UTF-8 nl_NL.UTF-8 pl_PL.UTF-8 pt_PT.UTF-8 ro_RO.UTF-8 tr_TR.UTF-8"
languages = "ca_ES.UTF-8 de_DE.UTF-8 el_GR.UTF-8 es_ES.UTF-8 fr_FR.UTF-8 hu_HU.UTF-8 it_IT.UTF-8 nl_NL.UTF-8 pl_PL.UTF-8 pt_PT.UTF-8 ru_RU.UTF-8 tr_TR.UTF-8"
/*
* Default language that unregistered users and users of newly-registered
* accounts will receive messages in.
*
* Defaults to the language the system uses. Set to "en_US" to override this
* with English.
*/
* Default language that non- and newly-registered nicks will receive messages in.
* Set to "en" to enable English. Defaults to the language the system uses.
*/
#defaultlanguage = "es_ES.UTF-8"
}
@@ -588,7 +618,7 @@ include
}
/*
* [RECOMMENDED] NickServ
* [OPTIONAL] NickServ
*
* Includes nickserv.example.conf, which is necessary for NickServ functionality.
*
@@ -732,27 +762,22 @@ log
*
* Available privileges:
* botserv/administration - Can view and assign private BotServ bots
* botserv/fantasy - Can use fantasy commands without the FANTASY privilege
* botserv/fantasy - Can use fantasy commands without the FANTASIA privilege
* chanserv/administration - Can modify the settings of any channel (including changing of the owner!)
* chanserv/access/list - Can view channel access and akick lists, but not modify them
* chanserv/access/modify - Can modify channel access and akick lists, and use /chanserv enforce
* chanserv/auspex - Can see any information with /CHANSERV INFO
* chanserv/no-register-limit - May register an unlimited number of channels and nicknames
* chanserv/kick - Can kick and ban users from channels through ChanServ
* chanserv/drop/override - Allows dropping channels without using a confirmation code
* memoserv/info - Can see any information with /MEMOSERV INFO
* memoserv/set-limit - Can set the limit of max stored memos on any user and channel
* memoserv/no-limit - Can send memos through limits and throttles
* nickserv/alist - Can see the channel access list of other users
* nickserv/auspex - Can see any information with /NICKSERV INFO
* nickserv/cert - Can modify other users certificate lists
* nickserv/confirm/email - Can confirm other users email address change
* nickserv/confirm/register - Can confirm other users account registration
* nickserv/confirm - Can confirm other users nicknames
* nickserv/drop - Can drop other users nicks
* nickserv/drop/display - Allows dropping display nicks when preservedisplay is enabled
* nickserv/drop/override - Allows dropping nicks without using a confirmation code
* nickserv/recover - Can recover other users nicks
* nickserv/resend - Can resend confirmation codes via email
* operserv/config - Can modify services's configuration
* operserv/oper/modify - Can add and remove operators with at most the same privileges
* protected - Can not be kicked from channels by services
@@ -771,13 +796,13 @@ log
* nickserv/getemail nickserv/suspend nickserv/ajoin nickserv/list
*
* nickserv/saset/autoop nickserv/saset/display nickserv/saset/email nickserv/saset/greet
* nickserv/saset/keepmodes nickserv/saset/language nickserv/saset/message nickserv/saset/neverop
* nickserv/saset/noexpire nickserv/saset/password nickserv/saset/private nickserv/saset/protect
* nickserv/saset/kill nickserv/saset/keepmodes nickserv/saset/language nickserv/saset/message
* nickserv/saset/neverop nickserv/saset/noexpire nickserv/saset/password nickserv/saset/private
* nickserv/saset/url
*
* hostserv/set hostserv/del hostserv/list
*
* global/global global/queue global/server
* global/global
*
* operserv/news operserv/stats operserv/kick operserv/exception operserv/seen
* operserv/mode operserv/session operserv/modinfo operserv/ignore operserv/chanlist
@@ -817,16 +842,18 @@ opertype
inherits = "Helper, Another Helper"
/* What commands (see above) this opertype may use */
commands = "chanserv/list chanserv/suspend chanserv/topic memoserv/staff nickserv/list nickserv/resend nickserv/suspend operserv/mode operserv/chankill operserv/akill operserv/session operserv/modinfo operserv/sqline operserv/oper operserv/kick operserv/ignore operserv/snline"
commands = "chanserv/list chanserv/suspend chanserv/topic memoserv/staff nickserv/list nickserv/suspend operserv/mode operserv/chankill operserv/akill operserv/session operserv/modinfo operserv/sqline operserv/oper operserv/kick operserv/ignore operserv/snline"
/* What privs (see above) this opertype has */
privs = "chanserv/auspex chanserv/no-register-limit memoserv/* nickserv/auspex nickserv/confirm/*"
privs = "chanserv/auspex chanserv/no-register-limit memoserv/* nickserv/auspex nickserv/confirm"
/*
* Modes to be set on users when they identify to accounts linked to this opertype.
*
* This can be used to automatically oper users who identify for services operator accounts, and is
* useful for setting modes such as Plexus's user mode +N.
*
* Note that some IRCds, such as InspIRCd, do not allow directly setting +o, and this will not work.
*/
#modes = "+o"
}
@@ -877,24 +904,14 @@ opertype
/* An optional password. If defined, the user must login using "/OPERSERV LOGIN" first */
#password = "secret"
/*
* The algorithm which the above password is hashed with. If this is not set then services will
* assume the above password is not hashed.
*
* You will need to have the appropriate encryption module (e.g. enc_bcrypt) loaded in order
* for this to work.
*
*/
#password_hash = "bcrypt"
/* An optional SSL fingerprint. If defined, it's required to be able to use this opertype. */
#certfp = "ed3383b3f7d74e89433ddaa4a6e5b2d7"
/* An optional list of user@host masks. If defined the user must be connected from one of them */
#host = "*@*.anope.org ident@*"
/* An optional vhost to set on users who identify for this oper block.
* This will override HostServ vhosts, and may not be available on all IRCds
/* An optional vHost to set on users who identify for this oper block.
* This will override HostServ vHosts, and may not be available on all IRCds
*/
#vhost = "oper.mynet"
}
@@ -914,7 +931,7 @@ opertype
/*
* [OPTIONAL] Mail Config
*
* This section contains settings related to the use of email from services.
* This section contains settings related to the use of e-mail from services.
* If the usemail directive is set to yes, unless specified otherwise, all other
* directives are required.
*
@@ -928,38 +945,36 @@ mail
* If set, this option enables the mail commands in Anope. You may choose
* to disable it if you have no Sendmail-compatible mailer installed. Whilst
* this directive (and entire block) is optional, it is required if
* nickserv:registration is set to mail.
* nickserv:registration is set to yes.
*/
usemail = yes
/*
* The command used for sending emails. It is assumed that this behaves like
* sendmail (i.e. it reads the email from the standard input stream) but you
* should probably use Postfix or some other sendmail-compatible emailer
* instead of sendmail as sendmail is very hard to configure correctly. If
* you are using Windows then https://www.glob.com.au/sendmail/ is probably
* the best option currently.
* This is the command-line that will be used to call the mailer to send an
* e-mail. It must be called with all the parameters needed to make it
* scan the mail input to find the mail recipient; consult your mailer
* documentation.
*
* If your emailer sends emails directly from the services host you will
* need to configure DKIM, DMARC, and SPF to avoid email hosts from marking
* your services emails as spam. It is important that you do this *BEFORE*
* sending emails for the first time as some email providers will add your
* host to a DNSBL like Spamhaus if they consider your emails to be spam. If
* this is too difficult then you may want to consider sending emails via an
* external email provider using a forwarder like msmtp.
* Postfix users must use the compatible sendmail utility provided with
* it. This one usually needs no parameters on the command-line. Most
* sendmail applications (or replacements of it) require the -t option
* to be used.
*
* If you are running on Windows you should use a Windows sendmail port
* like https://www.glob.com.au/sendmail/ for sending emails.
*/
#sendmailpath = "/usr/sbin/sendmail -it"
sendmailpath = "/usr/sbin/sendmail -t"
/*
* This is the email address from which all the emails are to be sent from.
* This is the e-mail address from which all the e-mails are to be sent from.
* It should really exist.
*/
sendfrom = "services@example.com"
/*
* This controls the minimum amount of time a user must wait before sending
* another email after they have sent one. It also controls the minimum time
* a user must wait before they can receive another email.
* another e-mail after they have sent one. It also controls the minimum time
* a user must wait before they can receive another e-mail.
*
* This feature prevents users from being mail bombed using services and
* it is highly recommended that it be used.
@@ -970,10 +985,10 @@ mail
/*
* If set, Anope will not put quotes around the TO: fields
* in emails.
* in e-mails.
*
* This directive is optional, and as far as we know, it's only needed
* if you are using ESMTP or QMail to send out emails.
* if you are using ESMTP or QMail to send out e-mails.
*/
#dontquoteaddresses = yes
@@ -989,76 +1004,76 @@ mail
* The subject and message of emails sent to users when they register accounts.
*
* Available tokens for this template are:
* {nick} - Gets replaced with the nickname
* {network} - Gets replaced with the network name
* {code} - Gets replaced with the confirmation code
* %n - Gets replaced with the nickname
* %N - Gets replaced with the network name
* %c - Gets replaced with the confirmation code
*/
registration_subject = "Nickname registration for {nick}"
registration_subject = "Nickname registration for %n"
registration_message = "Hi,
You have requested to register the nickname {nick} on {network}.
Please type \" /msg NickServ CONFIRM REGISTER {code} \" to complete registration.
You have requested to register the nickname %n on %N.
Please type \" /msg NickServ CONFIRM %c \" to complete registration.
If you don't know why this mail was sent to you, please ignore it silently.
{network} administrators."
%N administrators."
/*
* The subject and message of emails sent to users when they request a new password.
*
* Available tokens for this template are:
* {nick} - Gets replaced with the nickname
* {network} - Gets replaced with the network name
* {code} - Gets replaced with the confirmation code
* %n - Gets replaced with the nickname
* %N - Gets replaced with the network name
* %c - Gets replaced with the confirmation code
*/
reset_subject = "Reset password request for {nick}"
reset_subject = "Reset password request for %n"
reset_message = "Hi,
You have requested to have the password for {nick} reset.
To reset your password, type \" /msg NickServ CONFIRM RESETPASS {nick} {code} \"
You have requested to have the password for %n reset.
To reset your password, type \" /msg NickServ CONFIRM %n %c \"
If you don't know why this mail was sent to you, please ignore it silently.
{network} administrators."
%N administrators."
/*
* The subject and message of emails sent to users when they request a new email address.
*
* Available tokens for this template are:
* {old_email} - Gets replaced with the old email address
* {new_email} - Gets replaced with the new email address
* {account} - Gets replaced with the nickname
* {network} - Gets replaced with the network name
* {code} - Gets replaced with the confirmation code
* %e - Gets replaced with the old email address
* %E - Gets replaced with the new email address
* %n - Gets replaced with the nickname
* %N - Gets replaced with the network name
* %c - Gets replaced with the confirmation code
*/
emailchange_subject = "Email confirmation"
emailchange_message = "Hi,
You have requested to change your email address from {old_email} to {new_email}.
Please type \" /msg NickServ CONFIRM EMAIL {code} \" to confirm this change.
You have requested to change your email address from %e to %E.
Please type \" /msg NickServ CONFIRM %c \" to confirm this change.
If you don't know why this mail was sent to you, please ignore it silently.
{network} administrators."
%N administrators."
/*
* The subject and message of emails sent to users when they receive a new memo.
*
* Available tokens for this template are:
* {receiver} - Gets replaced with the receiver's nickname
* {sender} - Gets replaced with the sender's nickname
* {number} - Gets replaced with the memo number
* {text} - Gets replaced with the memo text
* {network} - Gets replaced with the network name
* %n - Gets replaced with the nickname
* %s - Gets replaced with the sender's nickname
* %d - Gets replaced with the memo number
* %t - Gets replaced with the memo text
* %N - Gets replaced with the network name
*/
memo_subject = "New memo"
memo_message = "Hi {receiver},
memo_message = "Hi %n,
You've just received a new memo from {sender}. This is memo number {number}.
You've just received a new memo from %s. This is memo number %d.
Memo text:
{text}"
%t"
}
/*
@@ -1070,148 +1085,91 @@ mail
*/
/*
* db_atheme
* [DEPRECATED] db_old
*
* This allows importing databases from Atheme. You should load another database
* module like db_json as well as this as it can only read Atheme databases not
* write them.
* This is the old binary database format from late Anope 1.7.x, Anope 1.8.x, and
* early Anope 1.9.x. This module only loads these databases, and will NOT save them.
* You should only use this to upgrade old databases to a newer database format by loading
* other database modules in addition to this one, which will be used when saving databases.
*/
#module
{
name = "db_atheme"
name = "db_old"
/*
* The file that db_atheme will import your main database from.
* This is the encryption type used by the databases. This must be set correctly or
* your passwords will not work. Valid options are: md5, oldmd5, sha1, and plain.
* You must also be sure to load the correct encryption module below in the Encryption
* Modules section so that your passwords work.
*/
database = "atheme.db"
/*
* If you have custom data in your Atheme database that you want converted
* to Anope misc data to be shown with cs_set_misc you can configure that
* using one or more cs_set_misc blocks.
*/
#cs_set_misc
{
/* The key name used by Atheme. */
atheme = "private:misc:data"
/* The cs_set_misc entry to import into. */
anope = "MISC_DATA"
}
/*
* If you have custom data in your Atheme database that you want converted
* to Anope misc data to be shown with ns_set_misc you can configure that
* using one or more ns_set_misc blocks.
*/
#ns_set_misc
{
/* The key name used by Atheme. */
atheme = "private:misc:data"
/* The ns_set_misc entry to import into. */
anope = "MISC_DATA"
}
#hash = "md5"
}
/*
* [DEPRECATED] db_flatfile
* [RECOMMENDED] db_flatfile
*
* This allows importing databases from the custom flat file format used between
* Anope 1.9.6 and 2.1.17. You should load another database module like db_json
* as well as this as it can only read db_flatfile databases not write them.
* This is the default flatfile database format.
*/
#module
module
{
name = "db_flatfile"
/*
* The file that db_flatfile will import your main database from.
* The database name db_flatfile should use
*/
database = "anope.db"
}
/*
* [RECOMMENDED] db_json
*
* Stores your database in a JSON file.
*/
module
{
name = "db_json"
/*
* The file that db_json will write your main database to.
* Sets the number of days backups of databases are kept. If you don't give it,
* or if you set it to 0, Anope won't backup the databases.
*
* This is relative to your data directory.
* NOTE: Anope must run 24 hours a day for this feature to work.
*
* This directive is optional, but recommended.
*/
database = "anope.json"
keepbackups = 3
/*
* The file that db_json will write third-party databases to.
* Allows Anope to continue file write operations (i.e. database saving)
* even if the original file cannot be backed up. Enabling this option may
* allow Anope to continue operation under conditions where it might
* otherwise fail, such as a nearly-full disk.
*
* {name} will be replaced with the name of the module.
* NOTE: Enabling this option can cause irrecoverable data loss under some
* conditions, so make CERTAIN you know what you're doing when you enable it!
*
* This is relative to your data directory.
* This directive is optional, and you are discouraged against enabling it.
*/
module_database = "{name}.module.json"
#nobackupokay = yes
/*
* Sets how many days and months worth of backups should be kept.
* If enabled, services will fork a child process to save databases.
*
* It is recommended that at the very least you keep one backup. Failure to
* do so may result in total data loss if you ever run out of disk space or
* have a power failure during a database write. However, if you're *REALLY*
* sure this won't happen you can disable backups by setting these to 0.
*/
daily_backups = 7
monthly_backups = 3
/*
* The directory in which backups are kept.
* This is only useful with very large databases, with hundreds
* of thousands of objects, that have a noticeable delay from
* writing databases.
*
* This is relative to your data directory.
* If your database is large enough cause a noticeable delay when
* saving you should consider a more powerful alternative such
* as db_sql or db_redis, which incrementally update their
* databases asynchronously in real time.
*/
backup_directory = "backups"
/*
* Allows Anope to continue writing the database even if the original can
* not be backed up. This is not recommended as it may result in total data
* loss during the circumstances described above.
*
* Defaults to no.
*/
#ignore_backup_failure = yes
/*
* Whether to preserve unknown data within the database. When a module is
* unloaded its data will be kept in the database so that it continues to
* function when reloaded. You can turn this off to clean up unknown data
* on the next database write.
*
* Defaults to yes.
*/
#preserve_unknown_data = no
fork = no
}
/*
* db_sql and db_sql_live
*
* Allows saving and loading databases to a SQL database.
* db_sql module allows saving and loading databases using one of the SQL engines.
* This module loads the databases once on startup, then incrementally updates
* objects in the database as they are changed within Anope in real time. Changes
* to the SQL tables not done by Anope will have no effect and will be overwritten.
*
* db_sql loads the databases once on startup and then incrementally updates in
* in the database as they are changed within Anope. Changes to the SQL tables
* not done by Anope will have no effect and will be overwritten.
* db_sql_live module allows saving and loading databases using one of the SQL engines.
* This module reads and writes to SQL in real time. Changes to the SQL tables
* will be immediately reflected into Anope. This module should not be loaded
* in conjunction with db_sql.
*
* db_sql_live module reads and writes to SQL in real time. Changes to the SQL
* tables will be immediately reflected in Anope. This module can not be loaded
* at the same time as db_sql. It should also not be used on large networks as
* it executes quite a lot of queries which can cause performance issues.
*
* IMPORTANT: The SQL schema has changed in the 2.1 branch. Whilst Anope will
* try to update your schema it is recommended that before upgrading you export
* to a file and re-import your database on 2.1. This will remove any obsolete
* columns and change the types of existing columns to match the new schema.
*/
#module
{
@@ -1219,151 +1177,97 @@ module
#name = "db_sql_live"
/*
* The SQL service that db_sql(_live) should use. These are configured in
* modules.example.conf. For MySQL, this should probably be mysql/main.
* The SQL service db_sql(_live) should use, these are configured in modules.conf.
* For MySQL, this should probably be mysql/main.
*/
engine = "mysql/main"
engine = "sqlite/main"
/*
* An optional prefix to prepended to the name of each created table.
* Do not use the same prefix for other programs.
*/
#prefix = "anope21_"
#prefix = "anope_db_"
/*
* Whether or not to import data from another database module in to SQL on
* startup.
/* Whether or not to import data from another database module in to SQL on startup.
* If you enable this, be sure that the database services is configured to use is
* empty and that another database module to import from is loaded before db_sql.
* After you enable this and do a database import you should disable it for
* subsequent restarts.
*
* If you enable this, be sure that the database Anope is configured to use
* is empty and that another database module to import from is loaded BEFORE
* db_sql. After you enable this and do a database import you MUST disable
* it for subsequent restarts. If you want to keep writing a file database
* after the SQL import is done you should load db_flatfile or db_json AFTER
* this module.
*
* Note that you can not import databases using db_sql_live. If you want to
* import databases and use db_sql_live you should import them using db_sql,
* then shut down and start Anope with db_sql_live.
* Note that you can not import databases using db_sql_live. If you want to import
* databases and use db_sql_live you should import them using db_sql, then shut down
* and start services with db_sql_live.
*/
import = no
import = false
}
/*
* db_redis.
*
* This module allows using Redis (https://redis.io/) as a database backend.
* This module requires that redis is loaded and configured properly.
*
* Redis 2.8 supports keyspace notifications which allows Redis to push notifications
* to Anope about outside modifications to the database. This module supports this and
* will internally reflect any changes made to the database immediately once notified.
* See docs/REDIS for more information regarding this.
*/
#module
{
name = "db_redis"
/*
* Redis database to use. This must be configured with redis.
*/
engine = "redis/main"
}
/*
* [RECOMMENDED] Encryption modules.
*
* The encryption modules are used when dealing with passwords. This determines
* how the passwords are stored in the databases.
* The encryption modules are used when dealing with passwords. This determines how
* the passwords are stored in the databases, and does not add any security as
* far as transmitting passwords over the network goes.
*
* Without any encryption modules loaded users will not be able to authenticate unless
* there is another module loaded that provides authentication checking, such as
* ldap_authentication or sql_authentication.
*
* With enc_none, passwords will be stored in plain text, allowing for passwords
* to be recovered later but it isn't secure and therefore is not recommended.
*
* The other encryption modules use one-way encryption, so the passwords can not
* be recovered later if those are used.
*
* The first encryption module loaded is the primary encryption module. All new passwords are
* encrypted by this module. Old passwords stored in another encryption method are
* automatically re-encrypted by the primary encryption module on next identify.
*
* enc_md5, enc_sha1, and enc_old are deprecated, and are provided for users
* to upgrade to a newer encryption module. Do not use them as the primary
* encryption module. They will be removed in a future release.
*
* The first encryption module loaded is the primary encryption module. All new
* passwords are encrypted by this module. Old passwords encrypted with another
* encryption method are automatically re-encrypted with the primary encryption
* module the next time the user identifies.
*/
/*
* enc_sha2
*
* Provides support for encrypting passwords using the HMAC-SHA-2 algorithm. See
* https://en.wikipedia.org/wiki/SHA-2 and https://en.wikipedia.org/wiki/HMAC
* for more information.
*/
module
{
name = "enc_sha2"
#module { name = "enc_bcrypt" }
module { name = "enc_sha256" }
/** The sub-algorithm to use. Can be set to sha224 for SHA-224, sha256 for
* SHA-256, sha384 for SHA-384, or sha512 for SHA-512. Defaults to sha512.
*/
#algorithm = "sha512"
}
/*
* [EXTRA] enc_argon2
*
* Provides support for encrypting passwords using the Argon2 algorithm. See
* https://en.wikipedia.org/wiki/Argon2 for more information.
*/
#module
{
name = "enc_argon2"
/** The sub-algorithm to use. Can be set to argon2d for Argon2d, argon2i for
* Argon2i, or argon2id for Argon2id. Defaults to argon2id.
*/
#algorithm = "argon2id"
/** The memory hardness in kibibytes of the Argon2 algorithm. Defaults to
* 128 mebibytes.
*/
#memory_cost = 131072
/** The time hardness (iterations) of the Argon2 algorithm. Defaults to 3.
*/
#time_cost = 3
/** The amount of parallel threads to use when encrypting passwords.
* Defaults to 1.
*/
#parallelism = 1
/** The length in bytes of an Argon2 hash. Defaults to 32. */
#hash_length = 32
/** The length in bytes of an Argon2 salt. Defaults to 32. */
#salt_length = 32
}
/*
* enc_bcrypt
*
* Provides support for encrypting passwords using the Bcrypt algorithm. See
* https://en.wikipedia.org/wiki/Bcrypt for more information.
*/
#module
{
name = "enc_bcrypt"
/** The number of Bcrypt rounds to perform on passwords. Can be set to any
* number between 10 and 32 but higher numbers are more CPU intensive and
* may impact performance.
*/
#rounds = 10
}
/*
* [EXTRA] enc_posix
*
* Provides verify-only support for passwords encrypted using the POSIX crypt()
* function. Load this if you are migrating from another services packages such
* as Atheme. See https://en.wikipedia.org/wiki/Crypt_(C) for more information.
*
* You must load another encryption method before this to re-encrypt passwords
* with when a user logs in.
*/
#module { name = "enc_posix" }
/*
* [DEPRECATED] enc_md5, enc_none, enc_sha1, enc_sha256
*
* Provides verify-only support for passwords encrypted using encryption methods
* from older versions of Anope. These methods are no longer considered secure
* and will be removed in a future version of Anope. Only load them if you are
* upgrading from a previous version of Anope that used them.
*
* enc_md5: Verifies passwords encrypted with the MD5 algorithm
* enc_none: Verifies passwords that are not encrypted
* enc_sha1: Verifies passwords encrypted with the SHA1 algorithm
* enc_sha256: Verifies passwords encrypted with the SHA256 algorithm using a
* custom initialisation vector as a salt.
*
* You must load another encryption method before this to re-encrypt passwords
* with when a user logs in.
*/
/*
* [DEPRECATED] Deprecated encryption modules. You can only use these for compatibility with
* old databases and will need to load one of the above modules as your primary encryption
* module.
*/
#module { name = "enc_md5" }
#module { name = "enc_none" }
#module { name = "enc_sha1" }
#module { name = "enc_sha256" }
/*
* enc_old is Anope's previous (broken) MD5 implementation used from 1.4.x to 1.7.16.
* If your databases were made using that module, load it here to allow conversion to the primary
* encryption method.
*/
#module { name = "enc_old" }
/* Extra (optional) modules. */
include
@@ -1381,3 +1285,16 @@ include
type = "file"
name = "chanstats.example.conf"
}
/*
* IRC2SQL Gateway
* This module collects data about users, channels and servers. It doesn't build stats
* itself, however, it gives you the database, it's up to you how you use it.
*
* Requires a MySQL Database and MySQL version 5.5 or higher
*/
#include
{
type = "file"
name = "irc2sql.example.conf"
}
+88 -100
View File
@@ -31,12 +31,12 @@ service
/*
* The hostname of the BotServ client.
*/
host = "${services.host}"
host = "services.host"
/*
* The realname of the BotServ client.
*/
real = "Bot Service"
gecos = "Bot Service"
/*
* The modes this client should use.
@@ -59,17 +59,6 @@ service
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
*/
#channels = "@#services,#mychan"
/*
* The server alias that can be used to securely message this service. If
* your IRC server does not have an alias for this service you can set this
* to an empty string to tell users to use /msg instead.
*
* This setting is ignored when options:servicealias is disabled.
*
* Defaults to the nick of the service if not set.
*/
#alias = "BS"
}
/*
@@ -148,7 +137,7 @@ module
*/
/* Give it a help command. */
command { service = "BotServ"; name = "HELP"; command = "generic/help" }
command { service = "BotServ"; name = "HELP"; command = "generic/help"; }
/*
* bs_assign
@@ -161,9 +150,9 @@ command { service = "BotServ"; name = "HELP"; command = "generic/help" }
* Used for assigning and unassigning bots to channels.
*/
module { name = "bs_assign" }
command { service = "BotServ"; name = "ASSIGN"; command = "botserv/assign" }
command { service = "BotServ"; name = "UNASSIGN"; command = "botserv/unassign" }
command { service = "BotServ"; name = "SET NOBOT"; command = "botserv/set/nobot"; permission = "botserv/set/nobot" }
command { service = "BotServ"; name = "ASSIGN"; command = "botserv/assign"; }
command { service = "BotServ"; name = "UNASSIGN"; command = "botserv/unassign"; }
command { service = "BotServ"; name = "SET NOBOT"; command = "botserv/set/nobot"; permission = "botserv/set/nobot"; }
/*
* bs_autoassign
@@ -194,7 +183,7 @@ module
/*
* The maximum number of entries a single bad words list can have.
*/
badwordsmax = 50
badwordsmax = 32
/*
* If set, BotServ will use case sensitive checking for badwords.
@@ -203,7 +192,7 @@ module
*/
#casesensitive = yes
}
command { service = "BotServ"; name = "BADWORDS"; command = "botserv/badwords" }
command { service = "BotServ"; name = "BADWORDS"; command = "botserv/badwords"; }
/*
* bs_bot
@@ -213,7 +202,7 @@ command { service = "BotServ"; name = "BADWORDS"; command = "botserv/badwords" }
* Used for administrating BotServ bots.
*/
module { name = "bs_bot" }
command { service = "BotServ"; name = "BOT"; command = "botserv/bot"; permission = "botserv/bot" }
command { service = "BotServ"; name = "BOT"; command = "botserv/bot"; permission = "botserv/bot"; }
/*
* bs_botlist
@@ -223,7 +212,7 @@ command { service = "BotServ"; name = "BOT"; command = "botserv/bot"; permission
* Used for listing all available bots.
*/
module { name = "bs_botlist" }
command { service = "BotServ"; name = "BOTLIST"; command = "botserv/botlist" }
command { service = "BotServ"; name = "BOTLIST"; command = "botserv/botlist"; }
/*
* bs_control
@@ -233,8 +222,8 @@ command { service = "BotServ"; name = "BOTLIST"; command = "botserv/botlist" }
* Used for making the bot message a channel.
*/
module { name = "bs_control" }
command { service = "BotServ"; name = "ACT"; command = "botserv/act" }
command { service = "BotServ"; name = "SAY"; command = "botserv/say" }
command { service = "BotServ"; name = "ACT"; command = "botserv/act"; }
command { service = "BotServ"; name = "SAY"; command = "botserv/say"; }
/*
* bs_info
@@ -244,7 +233,7 @@ command { service = "BotServ"; name = "SAY"; command = "botserv/say" }
* Used for getting information on bots or channels.
*/
module { name = "bs_info" }
command { service = "BotServ"; name = "INFO"; command = "botserv/info" }
command { service = "BotServ"; name = "INFO"; command = "botserv/info"; }
/*
* bs_kick
@@ -285,19 +274,21 @@ module
*/
gentlebadwordreason = yes
}
command { service = "BotServ"; name = "KICK"; command = "botserv/kick" }
command { service = "BotServ"; name = "KICK AMSG"; command = "botserv/kick/amsg" }
command { service = "BotServ"; name = "KICK BADWORDS"; command = "botserv/kick/badwords" }
command { service = "BotServ"; name = "KICK BOLDS"; command = "botserv/kick/bolds" }
command { service = "BotServ"; name = "KICK CAPS"; command = "botserv/kick/caps" }
command { service = "BotServ"; name = "KICK COLORS"; command = "botserv/kick/colors" }
command { service = "BotServ"; name = "KICK FLOOD"; command = "botserv/kick/flood" }
command { service = "BotServ"; name = "KICK ITALICS"; command = "botserv/kick/italics" }
command { service = "BotServ"; name = "KICK REPEAT"; command = "botserv/kick/repeat" }
command { service = "BotServ"; name = "KICK REVERSES"; command = "botserv/kick/reverses" }
command { service = "BotServ"; name = "KICK UNDERLINES"; command = "botserv/kick/underlines" }
command { service = "BotServ"; name = "SET DONTKICKOPS"; command = "botserv/set/dontkickops" }
command { service = "BotServ"; name = "SET DONTKICKVOICES"; command = "botserv/set/dontkickvoices" }
command { service = "BotServ"; name = "KICK"; command = "botserv/kick"; }
command { service = "BotServ"; name = "KICK AMSG"; command = "botserv/kick/amsg"; }
command { service = "BotServ"; name = "KICK BADWORDS"; command = "botserv/kick/badwords"; }
command { service = "BotServ"; name = "KICK BOLDS"; command = "botserv/kick/bolds"; }
command { service = "BotServ"; name = "KICK CAPS"; command = "botserv/kick/caps"; }
command { service = "BotServ"; name = "KICK COLORS"; command = "botserv/kick/colors"; }
command { service = "BotServ"; name = "KICK FLOOD"; command = "botserv/kick/flood"; }
command { service = "BotServ"; name = "KICK ITALICS"; command = "botserv/kick/italics"; }
command { service = "BotServ"; name = "KICK REPEAT"; command = "botserv/kick/repeat"; }
command { service = "BotServ"; name = "KICK REVERSES"; command = "botserv/kick/reverses"; }
command { service = "BotServ"; name = "KICK UNDERLINES"; command = "botserv/kick/underlines"; }
command { service = "BotServ"; name = "SET DONTKICKOPS"; command = "botserv/set/dontkickops"; }
command { service = "BotServ"; name = "SET DONTKICKVOICES"; command = "botserv/set/dontkickvoices"; }
/*
* bs_set
@@ -306,9 +297,9 @@ command { service = "BotServ"; name = "SET DONTKICKVOICES"; command = "botserv/s
* botserv/set/private - Used to prohibit specific BotServ bots from being assigned to channels.
*/
module { name = "bs_set" }
command { service = "BotServ"; name = "SET"; command = "botserv/set" }
command { service = "BotServ"; name = "SET BANEXPIRE"; command = "botserv/set/banexpire" }
command { service = "BotServ"; name = "SET PRIVATE"; command = "botserv/set/private"; permission = "botserv/set/private" }
command { service = "BotServ"; name = "SET"; command = "botserv/set"; }
command { service = "BotServ"; name = "SET BANEXPIRE"; command = "botserv/set/banexpire"; }
command { service = "BotServ"; name = "SET PRIVATE"; command = "botserv/set/private"; permission = "botserv/set/private"; }
/*
* greet
@@ -318,9 +309,9 @@ command { service = "BotServ"; name = "SET PRIVATE"; command = "botserv/set/priv
* nickserv/set/greet, nickserv/saset/greet - Used for changing a users greet message, which is displayed when they enter channels.
*/
module { name = "greet" }
command { service = "BotServ"; name = "SET GREET"; command = "botserv/set/greet" }
command { service = "NickServ"; name = "SET GREET"; command = "nickserv/set/greet" }
command { service = "NickServ"; name = "SASET GREET"; command = "nickserv/saset/greet"; permission = "nickserv/saset/greet" }
command { service = "BotServ"; name = "SET GREET"; command = "botserv/set/greet"; }
command { service = "NickServ"; name = "SET GREET"; command = "nickserv/set/greet"; }
command { service = "NickServ"; name = "SASET GREET"; command = "nickserv/saset/greet"; permission = "nickserv/saset/greet"; }
/*
* GREET privilege.
@@ -339,79 +330,76 @@ privilege
xop = "AOP"
}
/*
* fantasy
*
* Allows fantasy commands (e.g. !kick) to be used in channels.
* Allows 'fantasist' commands to be used in channels.
*
* Provides the commands:
* botserv/set/fantasy - Used for enabling or disabling BotServ's fantasy commands.
* botserv/set/fantasy - Used for enabling or disabling BotServ's fantasist commands.
*/
module
{
name = "fantasy"
/*
* Defines the prefixes for fantasy commands in channels. One of these will
* have to be prepended to all fantasy commands. For example, If you choose
* "! ?" as your prefix fantasy commands will be "!kick", "?op", etc.
*
* This directive is optional, it defaults to "!" if not set.
* Defines the prefixes for fantasy commands in channels. One of these characters will have to be prepended
* to all fantasy commands. If you choose "!", for example, fantasy commands will be "!kick",
* "!op", etc. This directive is optional, if left out, the default fantasy character is "!".
*/
#prefix = "! ?"
#fantasycharacter = "!."
}
command { service = "BotServ"; name = "SET FANTASY"; command = "botserv/set/fantasy" }
command { service = "BotServ"; name = "SET FANTASY"; command = "botserv/set/fantasy"; }
/*
* Fantasy commands
*
* Fantasy commands can be executed in channels that have a BotServ bot assigned
* by prefixing the command with one of the fantasy characters configured in the
* {botserv}:prefix directive.
* Fantasy commands can be executed in channels that have a BotServ bot by prefixing the
* command with one of the fantasy characters configured in botserv's fantasycharacter
* directive.
*
* Sane defaults are provided below that do not need to be edited unless you
* wish to change the default behavior.
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
*/
fantasy { name = "ACCESS"; command = "chanserv/access" }
fantasy { name = "AKICK"; command = "chanserv/akick" }
fantasy { name = "AOP"; command = "chanserv/xop" }
fantasy { name = "BAN"; command = "chanserv/ban" }
fantasy { name = "CLONE"; command = "chanserv/clone" }
fantasy { name = "DEHALFOP"; command = "chanserv/modes" }
fantasy { name = "DEOP"; command = "chanserv/modes" }
fantasy { name = "DEOWNER"; command = "chanserv/modes" }
fantasy { name = "DEPROTECT"; command = "chanserv/modes" }
fantasy { name = "DEVOICE"; command = "chanserv/modes" }
fantasy { name = "DOWN"; command = "chanserv/down" }
fantasy { name = "ENFORCE"; command = "chanserv/enforce" }
fantasy { name = "ENTRYMSG"; command = "chanserv/entrymsg" }
fantasy { name = "FLAGS"; command = "chanserv/flags" }
fantasy { name = "HALFOP"; command = "chanserv/modes" }
fantasy { name = "HELP"; command = "generic/help"; prepend_channel = no; require_privilege = no }
fantasy { name = "HOP"; command = "chanserv/xop" }
fantasy { name = "INFO"; command = "chanserv/info"; prepend_channel = no }
fantasy { name = "INVITE"; command = "chanserv/invite" }
fantasy { name = "K"; command = "chanserv/kick" }
fantasy { name = "KB"; command = "chanserv/ban" }
fantasy { name = "KICK"; command = "chanserv/kick" }
fantasy { name = "LEVELS"; command = "chanserv/levels" }
fantasy { name = "LIST"; command = "chanserv/list"; prepend_channel = no }
fantasy { name = "LOG"; command = "chanserv/log" }
fantasy { name = "MODE"; command = "chanserv/mode" }
fantasy { name = "MUTE"; command = "chanserv/ban"; kick = no; mode = "QUIET" }
fantasy { name = "OP"; command = "chanserv/modes" }
fantasy { name = "OWNER"; command = "chanserv/modes" }
fantasy { name = "PROTECT"; command = "chanserv/modes" }
fantasy { name = "QOP"; command = "chanserv/xop" }
fantasy { name = "SEEN"; command = "chanserv/seen"; prepend_channel = no }
fantasy { name = "SOP"; command = "chanserv/xop" }
fantasy { name = "STATUS"; command = "chanserv/status" }
fantasy { name = "SUSPEND"; command = "chanserv/suspend"; permission = "chanserv/suspend" }
fantasy { name = "SYNC"; command = "chanserv/sync" }
fantasy { name = "TOPIC"; command = "chanserv/topic" }
fantasy { name = "UNBAN"; command = "chanserv/unban" }
fantasy { name = "UNMUTE"; command = "chanserv/unban"; mode = "QUIET" }
fantasy { name = "UNSUSPEND"; command = "chanserv/unsuspend"; permission = "chanserv/suspend" }
fantasy { name = "UP"; command = "chanserv/up" }
fantasy { name = "VOICE"; command = "chanserv/modes" }
fantasy { name = "VOP"; command = "chanserv/xop" }
fantasy { name = "ACCESS"; command = "chanserv/access"; }
fantasy { name = "AKICK"; command = "chanserv/akick"; }
fantasy { name = "AOP"; command = "chanserv/xop"; }
fantasy { name = "BAN"; command = "chanserv/ban"; }
fantasy { name = "CLONE"; command = "chanserv/clone"; }
fantasy { name = "DEHALFOP"; command = "chanserv/modes"; }
fantasy { name = "DEOP"; command = "chanserv/modes"; }
fantasy { name = "DEOWNER"; command = "chanserv/modes"; }
fantasy { name = "DEPROTECT"; command = "chanserv/modes"; }
fantasy { name = "DEVOICE"; command = "chanserv/modes"; }
fantasy { name = "DOWN"; command = "chanserv/down"; }
fantasy { name = "ENFORCE"; command = "chanserv/enforce"; }
fantasy { name = "ENTRYMSG"; command = "chanserv/entrymsg"; }
fantasy { name = "FLAGS"; command = "chanserv/flags"; }
fantasy { name = "HALFOP"; command = "chanserv/modes"; }
fantasy { name = "HELP"; command = "generic/help"; prepend_channel = false; }
fantasy { name = "HOP"; command = "chanserv/xop"; }
fantasy { name = "INFO"; command = "chanserv/info"; prepend_channel = false; }
fantasy { name = "INVITE"; command = "chanserv/invite"; }
fantasy { name = "K"; command = "chanserv/kick"; }
fantasy { name = "KB"; command = "chanserv/ban"; }
fantasy { name = "KICK"; command = "chanserv/kick"; }
fantasy { name = "LEVELS"; command = "chanserv/levels"; }
fantasy { name = "LIST"; command = "chanserv/list"; prepend_channel = false; }
fantasy { name = "LOG"; command = "chanserv/log"; }
fantasy { name = "MODE"; command = "chanserv/mode"; }
fantasy { name = "MUTE"; command = "chanserv/ban"; kick = no; mode = "QUIET"; }
fantasy { name = "OP"; command = "chanserv/modes"; }
fantasy { name = "OWNER"; command = "chanserv/modes"; }
fantasy { name = "PROTECT"; command = "chanserv/modes"; }
fantasy { name = "QOP"; command = "chanserv/xop"; }
fantasy { name = "SEEN"; command = "chanserv/seen"; prepend_channel = false; }
fantasy { name = "SOP"; command = "chanserv/xop"; }
fantasy { name = "STATUS"; command = "chanserv/status"; }
fantasy { name = "SUSPEND"; command = "chanserv/suspend"; permission = "chanserv/suspend"; }
fantasy { name = "SYNC"; command = "chanserv/sync"; }
fantasy { name = "TOPIC"; command = "chanserv/topic"; }
fantasy { name = "UNBAN"; command = "chanserv/unban"; }
fantasy { name = "UNSUSPEND"; command = "chanserv/unsuspend"; permission = "chanserv/suspend"; }
fantasy { name = "UP"; command = "chanserv/up"; }
fantasy { name = "VOICE"; command = "chanserv/modes"; }
fantasy { name = "VOP"; command = "chanserv/xop"; }
+100 -132
View File
@@ -21,12 +21,12 @@ service
/*
* The hostname of the ChanServ client.
*/
host = "${services.host}"
host = "services.host"
/*
* The realname of the ChanServ client.
*/
real = "Channel Registration Service"
gecos = "Channel Registration Service"
/*
* The modes this client should use.
@@ -49,17 +49,6 @@ service
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
*/
#channels = "@#services,#mychan"
/*
* The server alias that can be used to securely message this service. If
* your IRC server does not have an alias for this service you can set this
* to an empty string to tell users to use /msg instead.
*
* This setting is ignored when options:servicealias is disabled.
*
* Defaults to the nick of the service if not set.
*/
#alias = "CS"
}
/*
@@ -100,13 +89,12 @@ module
* not in use.
* - cs_no_expire: Enables no expire. Needs founder, successor (if set) or anyone in the access list
* to be a registered nick, otherwise the channel will be dropped.
* - cs_stats: Enable Chanstats for newly registered channels
* - none: No defaults
*
* This directive is optional, if left blank, the options will default to cs_keep_modes, keeptopic, peace,
* persist, securefounder, and signkick. If you really want no defaults, use "none" by itself as the option.
* This directive is optional, if left blank, the options will default to keeptopic, peace,
* securefounder, and signkick. If you really want no defaults, use "none" by itself as the option.
*/
defaults = "cs_keep_modes keeptopic peace persist securefounder signkick"
defaults = "keeptopic peace securefounder signkick"
/*
* The maximum number of channels which may be registered to a single nickname.
@@ -119,21 +107,22 @@ module
/*
* The length of time before a channel registration expires.
*
* This directive is optional. If not set, the default is 30 days.
* This directive is optional, but recommended.
* If not set, the default is 30 days.
*/
#expire = 90d
expire = 30d
/*
* The maximum number of entries on a channel's access list.
* If not set, the default is 1000. This can be set to 0 for unlimited.
* If not set, the default is 1024. This can be set to 0 for unlimited.
*/
accessmax = 1000
accessmax = 1024
/*
* The length of time ChanServ stays in a channel after kicking a user from a channel they are not
* permitted to be in. This only occurs when the user is the only one in the channel.
*/
inhabit = 1m
inhabit = 15s
/*
* Allow only IRC Operators to use ChanServ.
@@ -164,33 +153,27 @@ module
/*
* The message formatting to use for signed kick messages.
* {nick} is the nick of the kicker
* {message} is the message specified
* %n is the nick of the kicker
* %m is the message specified
*/
signkickformat = "{message} ({nick})"
signkickformat = "%m (%n)"
/*
* If set, prevents channel access entries from containing hostmasks.
*/
disallow_hostmask_access = no
disallow_hostmask_access = false
/*
* If set, prevents channels from being on access lists.
*/
disallow_channel_access = no
/*
* If set, prevents malformed hostmasks from being added to access lists
* instead of attempting to fix their format.
*/
#disallow_malformed_hostmask = yes
disallow_channel_access = false
/*
* If set, ChanServ will always lower the timestamp of registered channels to their registration date.
* This prevents several race conditions where unauthorized users can join empty registered channels and set
* modes etc. prior to services deopping them.
*/
always_lower_ts = no
always_lower_ts = false
}
/*
@@ -252,7 +235,6 @@ privilege
rank = 10
level = 3
flag = "f"
flag_migration_requires = "ACCESS_CHANGE"
xop = "VOP"
}
@@ -410,7 +392,7 @@ privilege
}
/*
* FANTASY privilege.
* FANTASIA privilege.
*
* Used by botserv/main and chanserv/xop.
*
@@ -418,7 +400,7 @@ privilege
*/
privilege
{
name = "FANTASY"
name = "FANTASIA"
desc = _("Allowed to use fantasy commands")
rank = 30
level = 3
@@ -497,7 +479,6 @@ privilege
rank = 110
level = 4
flag = "h"
flag_migration_requires = "HALFOP"
xop = "HOP"
}
@@ -640,7 +621,6 @@ privilege
rank = 220
level = 5
flag = "o"
flag_migration_requires = "OP"
xop = "AOP"
}
@@ -713,7 +693,6 @@ privilege
rank = 300
level = 10
flag = "a"
flag_migration_requires = "PROTECT"
xop = "SOP"
}
@@ -748,7 +727,7 @@ privilege
privilege
{
name = "SET"
desc = _("Allowed to modify channel settings")
desc = _("Allowed to set channel settings")
rank = 320
level = 9999
flag = "s"
@@ -857,7 +836,6 @@ privilege
rank = 60
level = 3
flag = "v"
flag_migration_requires = "VOICE"
xop = "VOP"
}
@@ -902,7 +880,7 @@ command_group
}
/* Give it a help command. */
command { service = "ChanServ"; name = "HELP"; command = "generic/help" }
command { service = "ChanServ"; name = "HELP"; command = "generic/help"; }
/*
* cs_access
@@ -918,8 +896,8 @@ command { service = "ChanServ"; name = "HELP"; command = "generic/help" }
* entry by the other access system, which could be an XOP command name, or a set of flags.
*/
module { name = "cs_access" }
command { service = "ChanServ"; name = "ACCESS"; command = "chanserv/access"; group = "chanserv/access" }
command { service = "ChanServ"; name = "LEVELS"; command = "chanserv/levels"; group = "chanserv/access" }
command { service = "ChanServ"; name = "ACCESS"; command = "chanserv/access"; group = "chanserv/access"; }
command { service = "ChanServ"; name = "LEVELS"; command = "chanserv/levels"; group = "chanserv/access"; }
/*
* cs_akick
@@ -935,14 +913,14 @@ module
/*
* The maximum number of entries on a channel's autokick list.
*/
autokickmax = 50
autokickmax = 32
/*
* The default reason for an autokick if none is given.
*/
autokickreason = "User has been banned from the channel"
}
command { service = "ChanServ"; name = "AKICK"; command = "chanserv/akick"; group = "chanserv/management" }
command { service = "ChanServ"; name = "AKICK"; command = "chanserv/akick"; group = "chanserv/management"; }
/*
* cs_ban
@@ -958,7 +936,7 @@ command { service = "ChanServ"; name = "AKICK"; command = "chanserv/akick"; grou
* Used for banning users from channels.
*/
module { name = "cs_ban" }
command { service = "ChanServ"; name = "BAN"; command = "chanserv/ban"; group = "chanserv/management" }
command { service = "ChanServ"; name = "BAN"; command = "chanserv/ban"; }
/*
* cs_clone
@@ -968,7 +946,7 @@ command { service = "ChanServ"; name = "BAN"; command = "chanserv/ban"; group =
* Used for copying channel settings from one channel to another.
*/
module { name = "cs_clone" }
command { service = "ChanServ"; name = "CLONE"; command = "chanserv/clone"; group = "chanserv/management" }
command { service = "ChanServ"; name = "CLONE"; command = "chanserv/clone"; group = "chanserv/management"; }
/*
* cs_drop
@@ -978,7 +956,7 @@ command { service = "ChanServ"; name = "CLONE"; command = "chanserv/clone"; grou
* Used for unregistering channels.
*/
module { name = "cs_drop" }
command { service = "ChanServ"; name = "DROP"; command = "chanserv/drop" }
command { service = "ChanServ"; name = "DROP"; command = "chanserv/drop"; }
/*
* cs_enforce
@@ -988,7 +966,7 @@ command { service = "ChanServ"; name = "DROP"; command = "chanserv/drop" }
* Used to enforce various channel settings such as secureops and restricted.
*/
module { name = "cs_enforce" }
command { service = "ChanServ"; name = "ENFORCE"; command = "chanserv/enforce"; group = "chanserv/management" }
command { service = "ChanServ"; name = "ENFORCE"; command = "chanserv/enforce"; group = "chanserv/management"; }
/*
* cs_entrymsg
@@ -1001,22 +979,10 @@ module
{
name = "cs_entrymsg"
/*
* The maximum number of entry messages allowed per channel.
*
* Defaults to 5
*/
/* The maximum number of entrymsgs allowed per channel. If not set, defaults to 5. */
maxentries = 5
/*
* Whether to include an IRCv3 time tag for the original add time on entry
* messages.
*
* Defaults to yes.
*/
#timestamp = no
}
command { service = "ChanServ"; name = "ENTRYMSG"; command = "chanserv/entrymsg"; group = "chanserv/management" }
command { service = "ChanServ"; name = "ENTRYMSG"; command = "chanserv/entrymsg"; group = "chanserv/management"; }
/*
* cs_flags
@@ -1031,7 +997,7 @@ command { service = "ChanServ"; name = "ENTRYMSG"; command = "chanserv/entrymsg"
* privilege set granted by the access entry.
*/
module { name = "cs_flags" }
command { service = "ChanServ"; name = "FLAGS"; command = "chanserv/flags"; group = "chanserv/access" }
command { service = "ChanServ"; name = "FLAGS"; command = "chanserv/flags"; group = "chanserv/access"; }
/*
* cs_getkey
@@ -1041,7 +1007,7 @@ command { service = "ChanServ"; name = "FLAGS"; command = "chanserv/flags"; grou
* Used for getting the key for channels.
*/
module { name = "cs_getkey" }
command { service = "ChanServ"; name = "GETKEY"; command = "chanserv/getkey" }
command { service = "ChanServ"; name = "GETKEY"; command = "chanserv/getkey"; }
/*
* cs_info
@@ -1051,7 +1017,7 @@ command { service = "ChanServ"; name = "GETKEY"; command = "chanserv/getkey" }
* Used for getting information about channels.
*/
module { name = "cs_info" }
command { service = "ChanServ"; name = "INFO"; command = "chanserv/info" }
command { service = "ChanServ"; name = "INFO"; command = "chanserv/info"; }
/*
* cs_invite
@@ -1061,7 +1027,7 @@ command { service = "ChanServ"; name = "INFO"; command = "chanserv/info" }
* Used for inviting yourself in to channels.
*/
module { name = "cs_invite" }
command { service = "ChanServ"; name = "INVITE"; command = "chanserv/invite" }
command { service = "ChanServ"; name = "INVITE"; command = "chanserv/invite"; }
/*
* cs_kick
@@ -1071,7 +1037,7 @@ command { service = "ChanServ"; name = "INVITE"; command = "chanserv/invite" }
* Used for kicking users from channels.
*/
module { name = "cs_kick" }
command { service = "ChanServ"; name = "KICK"; command = "chanserv/kick"; group = "chanserv/management" }
command { service = "ChanServ"; name = "KICK"; command = "chanserv/kick"; }
/*
* cs_list
@@ -1089,8 +1055,10 @@ module
*/
listmax = 50
}
command { service = "ChanServ"; name = "LIST"; command = "chanserv/list" }
command { service = "ChanServ"; name = "SET PRIVATE"; command = "chanserv/set/private" }
command { service = "ChanServ"; name = "LIST"; command = "chanserv/list"; }
command { service = "ChanServ"; name = "SET PRIVATE"; command = "chanserv/set/private"; }
/*
* cs_log
@@ -1131,7 +1099,7 @@ module
method = "MESSAGE @"
}
}
command { service = "ChanServ"; name = "LOG"; command = "chanserv/log"; group = "chanserv/management" }
command { service = "ChanServ"; name = "LOG"; command = "chanserv/log"; group = "chanserv/management"; }
/*
* cs_mode
@@ -1158,9 +1126,9 @@ module
*
* This directive is optional.
*/
max = 50
max = 32
}
command { service = "ChanServ"; name = "MODE"; command = "chanserv/mode"; group = "chanserv/management" }
command { service = "ChanServ"; name = "MODE"; command = "chanserv/mode"; group = "chanserv/management"; }
command { service = "ChanServ"; name = "OWNER"; command = "chanserv/modes"; group = "chanserv/status"; set = "OWNER" }
command { service = "ChanServ"; name = "DEOWNER"; command = "chanserv/modes"; group = "chanserv/status"; unset = "OWNER" }
@@ -1177,6 +1145,7 @@ command { service = "ChanServ"; name = "DEHALFOP"; command = "chanserv/modes"; g
command { service = "ChanServ"; name = "VOICE"; command = "chanserv/modes"; group = "chanserv/status"; set = "VOICE" }
command { service = "ChanServ"; name = "DEVOICE"; command = "chanserv/modes"; group = "chanserv/status"; unset = "VOICE" }
/*
* cs_register
*
@@ -1185,7 +1154,7 @@ command { service = "ChanServ"; name = "DEVOICE"; command = "chanserv/modes"; gr
* Used for registering channels.
*/
module { name = "cs_register" }
command { service = "ChanServ"; name = "REGISTER"; command = "chanserv/register" }
command { service = "ChanServ"; name = "REGISTER"; command = "chanserv/register"; }
/*
* cs_seen
@@ -1199,10 +1168,13 @@ module
{
name = "cs_seen"
/* If set, uses the older 1.8 style seen, which is less resource intensive */
simple = false
/* Sets the time to keep seen entries in the seen database. */
purgetime = 90d
purgetime = "30d"
}
command { service = "OperServ"; name = "SEEN"; command = "operserv/seen"; permission = "operserv/seen" }
command { service = "OperServ"; name = "SEEN"; command = "operserv/seen"; permission = "operserv/seen"; }
/*
* cs_set
@@ -1246,45 +1218,36 @@ module
* If set, persistent channels have their creation times lowered to their
* original registration dates.
*/
persist_lower_ts = yes
persist_lower_ts = true
}
command { service = "ChanServ"; name = "SET"; command = "chanserv/set"; group = "chanserv/management" }
command { service = "ChanServ"; name = "SET AUTOOP"; command = "chanserv/set/autoop" }
command { service = "ChanServ"; name = "SET BANTYPE"; command = "chanserv/set/bantype" }
command { service = "ChanServ"; name = "SET DESCRIPTION"; command = "chanserv/set/description" }
command { service = "ChanServ"; name = "SET DESC"; command = "chanserv/set/description"; hide = yes }
command { service = "ChanServ"; name = "SET FOUNDER"; command = "chanserv/set/founder" }
command { service = "ChanServ"; name = "SET KEEPMODES"; command = "chanserv/set/keepmodes" }
command { service = "ChanServ"; name = "SET NOEXPIRE"; command = "chanserv/saset/noexpire"; permission = "chanserv/saset/noexpire" }
command { service = "ChanServ"; name = "SET PEACE"; command = "chanserv/set/peace" }
command { service = "ChanServ"; name = "SET PERSIST"; command = "chanserv/set/persist" }
command { service = "ChanServ"; name = "SET RESTRICTED"; command = "chanserv/set/restricted" }
command { service = "ChanServ"; name = "SET SECUREFOUNDER"; command = "chanserv/set/securefounder" }
command { service = "ChanServ"; name = "SET SECUREOPS"; command = "chanserv/set/secureops" }
command { service = "ChanServ"; name = "SET SIGNKICK"; command = "chanserv/set/signkick" }
command { service = "ChanServ"; name = "SET SUCCESSOR"; command = "chanserv/set/successor" }
command { service = "ChanServ"; name = "SET"; command = "chanserv/set"; group = "chanserv/management"; }
command { service = "ChanServ"; name = "SET AUTOOP"; command = "chanserv/set/autoop"; }
command { service = "ChanServ"; name = "SET BANTYPE"; command = "chanserv/set/bantype"; }
command { service = "ChanServ"; name = "SET DESCRIPTION"; command = "chanserv/set/description"; }
command { service = "ChanServ"; name = "SET DESC"; command = "chanserv/set/description"; hide = yes; }
command { service = "ChanServ"; name = "SET FOUNDER"; command = "chanserv/set/founder"; }
command { service = "ChanServ"; name = "SET KEEPMODES"; command = "chanserv/set/keepmodes"; }
command { service = "ChanServ"; name = "SET PEACE"; command = "chanserv/set/peace"; }
command { service = "ChanServ"; name = "SET PERSIST"; command = "chanserv/set/persist"; }
command { service = "ChanServ"; name = "SET RESTRICTED"; command = "chanserv/set/restricted"; }
command { service = "ChanServ"; name = "SET SECURE"; command = "chanserv/set/secure"; }
command { service = "ChanServ"; name = "SET SECUREFOUNDER"; command = "chanserv/set/securefounder"; }
command { service = "ChanServ"; name = "SET SECUREOPS"; command = "chanserv/set/secureops"; }
command { service = "ChanServ"; name = "SET SIGNKICK"; command = "chanserv/set/signkick"; }
command { service = "ChanServ"; name = "SET SUCCESSOR"; command = "chanserv/set/successor"; }
command { service = "ChanServ"; name = "SET NOEXPIRE"; command = "chanserv/saset/noexpire"; permission = "chanserv/saset/noexpire"; }
/*
* cs_set_misc
*
* Provides the command chanserv/set/misc.
*
* Allows you to create arbitrary commands to set data, and have that data show
* up in chanserv/info. You can configure this using the following fields:
*
* misc_description: A description of the command to show in the help.
* misc_title: A human-readable description of the stored data.
* misc_numeric: If defined then the numeric (in the range 1-999) to send the
* data to users with when they join the channel.
* misc_pattern: If defined then a regex pattern (using the engine specified
* in <options:regexengine> to validate the data with).
* misc_syntax: If defined then the syntax to show in the help output and, if
* misc_pattern is defined, when a user specifies an invalid
* value.
* Allows you to create arbitrary commands to set data, and have that data show up in chanserv/info.
* A field named misc_description may be given for use with help output.
*/
module { name = "cs_set_misc" }
command { service = "ChanServ"; name = "SET URL"; command = "chanserv/set/misc"; misc_description = _("Associate a URL with the channel"); misc_numeric = 328; misc_pattern = "^https?:\/\/\S+$" }
#command { service = "ChanServ"; name = "SET EMAIL"; command = "chanserv/set/misc"; misc_description = _("Associate an email address with the channel"); misc_pattern = "^\S+@\S.\S+$"; misc_title = _("Email address") }
command { service = "ChanServ"; name = "SET URL"; command = "chanserv/set/misc"; misc_description = _("Associate a URL with the channel"); }
command { service = "ChanServ"; name = "SET EMAIL"; command = "chanserv/set/misc"; misc_description = _("Associate an E-mail address with the channel"); }
/*
* cs_status
@@ -1295,16 +1258,8 @@ command { service = "ChanServ"; name = "SET URL"; command = "chanserv/set/misc";
* or not they match any autokick entries.
*/
module { name = "cs_status" }
command { service = "ChanServ"; name = "STATUS"; command = "chanserv/status" }
command { service = "ChanServ"; name = "WHY"; command = "chanserv/status"; hide = yes }
/*
* cs_statusupdate
*
* This module automatically updates users' status on channels when the
* channel's access list is modified.
*/
module { name = "cs_statusupdate" }
command { service = "ChanServ"; name = "STATUS"; command = "chanserv/status"; }
command { service = "ChanServ"; name = "WHY"; command = "chanserv/status"; hide = true; }
/*
* cs_suspend
@@ -1323,7 +1278,7 @@ module
* This directive is optional.
* If not set, the default is never.
*/
#suspendexpire = 90d
expire = 90d
/*
* Settings to show to non-opers in ChanServ's INFO output.
@@ -1332,8 +1287,8 @@ module
*/
show = "suspended, by, reason, on, expires"
}
command { service = "ChanServ"; name = "SUSPEND"; command = "chanserv/suspend"; permission = "chanserv/suspend"; group = "chanserv/admin" }
command { service = "ChanServ"; name = "UNSUSPEND"; command = "chanserv/unsuspend"; permission = "chanserv/suspend"; group = "chanserv/admin" }
command { service = "ChanServ"; name = "SUSPEND"; command = "chanserv/suspend"; permission = "chanserv/suspend"; group = "chanserv/admin"; }
command { service = "ChanServ"; name = "UNSUSPEND"; command = "chanserv/unsuspend"; permission = "chanserv/suspend"; group = "chanserv/admin"; }
/*
* cs_sync
@@ -1343,7 +1298,7 @@ command { service = "ChanServ"; name = "UNSUSPEND"; command = "chanserv/unsuspen
* Used to sync users channel status modes with what access they have.
*/
module { name = "cs_sync" }
command { service = "ChanServ"; name = "SYNC"; command = "chanserv/sync"; group = "chanserv/management" }
command { service = "ChanServ"; name = "SYNC"; command = "chanserv/sync"; group = "chanserv/management"; }
/*
* cs_topic
@@ -1354,8 +1309,8 @@ command { service = "ChanServ"; name = "SYNC"; command = "chanserv/sync"; group
*
*/
module { name = "cs_topic" }
command { service = "ChanServ"; name = "TOPIC"; command = "chanserv/topic"; group = "chanserv/management" }
command { service = "ChanServ"; name = "SET KEEPTOPIC"; command = "chanserv/set/keeptopic" }
command { service = "ChanServ"; name = "TOPIC"; command = "chanserv/topic"; group = "chanserv/management"; }
command { service = "ChanServ"; name = "SET KEEPTOPIC"; command = "chanserv/set/keeptopic"; }
/*
* cs_unban
@@ -1365,7 +1320,7 @@ command { service = "ChanServ"; name = "SET KEEPTOPIC"; command = "chanserv/set/
* Used for unbanning users from channels.
*/
module { name = "cs_unban" }
command { service = "ChanServ"; name = "UNBAN"; command = "chanserv/unban"; group = "chanserv/management" }
command { service = "ChanServ"; name = "UNBAN"; command = "chanserv/unban"; }
/*
* cs_updown
@@ -1375,8 +1330,8 @@ command { service = "ChanServ"; name = "UNBAN"; command = "chanserv/unban"; grou
* Used for setting or removing your status modes on a channel.
*/
module { name = "cs_updown" }
command { service = "ChanServ"; name = "DOWN"; command = "chanserv/down"; group = "chanserv/status" }
command { service = "ChanServ"; name = "UP"; command = "chanserv/up"; group = "chanserv/status" }
command { service = "ChanServ"; name = "DOWN"; command = "chanserv/down"; group = "chanserv/status"; }
command { service = "ChanServ"; name = "UP"; command = "chanserv/up"; group = "chanserv/status"; }
/*
* cs_xop
@@ -1393,8 +1348,21 @@ command { service = "ChanServ"; name = "UP"; command = "chanserv/up"; group = "c
* can not view the entire access list at once, and instead should use another access system to do that.
*/
module { name = "cs_xop" }
command { service = "ChanServ"; name = "QOP"; command = "chanserv/xop"; group = "chanserv/access" }
command { service = "ChanServ"; name = "SOP"; command = "chanserv/xop"; group = "chanserv/access" }
command { service = "ChanServ"; name = "AOP"; command = "chanserv/xop"; group = "chanserv/access" }
command { service = "ChanServ"; name = "HOP"; command = "chanserv/xop"; group = "chanserv/access" }
command { service = "ChanServ"; name = "VOP"; command = "chanserv/xop"; group = "chanserv/access" }
command { service = "ChanServ"; name = "QOP"; command = "chanserv/xop"; group = "chanserv/access"; }
command { service = "ChanServ"; name = "SOP"; command = "chanserv/xop"; group = "chanserv/access"; }
command { service = "ChanServ"; name = "AOP"; command = "chanserv/xop"; group = "chanserv/access"; }
command { service = "ChanServ"; name = "HOP"; command = "chanserv/xop"; group = "chanserv/access"; }
command { service = "ChanServ"; name = "VOP"; command = "chanserv/xop"; group = "chanserv/access"; }
/*
* Extra ChanServ related modules.
*/
/*
* cs_statusupdate
*
* This module automatically updates users' status on channels when the
* channel's access list is modified.
*/
module { name = "cs_statusupdate" }
+22 -20
View File
@@ -1,9 +1,5 @@
/*
* Example configuration file for Chanstats.
*
* You can enable Chanstats by default by adding CS_STATS to {chanserv}:defaults
* and NS_STATS to {nickserv}:defaults.
*
* Make sure BotServ, ChanServ and NickServ are running.
*/
@@ -22,28 +18,34 @@ module
* An optional prefix to prepended to the name of each created table.
* Do not use the same prefix for other programs.
*/
#prefix = "chanstats21_"
prefix = "anope_"
smileyshappy = ":) :-) ;) ;-) :D :-D :P :-P"
smileyssad = ":( :-( ;( ;-("
smileysother = ":/ :-/"
/*
* Enable Chanstats for newly registered nicks / channels.
*/
ns_def_chanstats = yes
cs_def_chanstats = yes
}
command { service = "ChanServ"; name = "SET CHANSTATS"; command = "chanserv/set/chanstats" }
command { service = "NickServ"; name = "SET CHANSTATS"; command = "nickserv/set/chanstats" }
command { service = "NickServ"; name = "SASET CHANSTATS"; command = "nickserv/saset/chanstats"; permission = "nickserv/saset/chanstats" }
command { service = "ChanServ"; name = "SET CHANSTATS"; command = "chanserv/set/chanstats"; }
command { service = "NickServ"; name = "SET CHANSTATS"; command = "nickserv/set/chanstats"; }
command { service = "NickServ"; name = "SASET CHANSTATS"; command = "nickserv/saset/chanstats"; permission = "nickserv/saset/chanstats"; }
module { name = "cs_fantasy_stats" }
command { service = "ChanServ"; name = "STATS"; command = "chanserv/stats" }
command { service = "ChanServ"; name = "GSTATS"; command = "chanserv/gstats" }
fantasy { name = "STATS"; command = "chanserv/stats" }
fantasy { name = "GSTATS"; command = "chanserv/gstats" }
command { service = "ChanServ"; name = "STATS"; command = "chanserv/stats"; }
command { service = "ChanServ"; name = "GSTATS"; command = "chanserv/gstats"; }
fantasy { name = "STATS"; command = "chanserv/stats"; }
fantasy { name = "GSTATS"; command = "chanserv/gstats"; }
module { name = "cs_fantasy_top" }
command { service = "ChanServ"; name = "TOP"; command = "chanserv/top" }
command { service = "ChanServ"; name = "TOP10"; command = "chanserv/top10" }
command { service = "ChanServ"; name = "GTOP"; command = "chanserv/gtop" }
command { service = "ChanServ"; name = "GTOP10"; command = "chanserv/gtop10" }
fantasy { name = "TOP"; command = "chanserv/top" }
fantasy { name = "TOP10"; command = "chanserv/top10" }
fantasy { name = "GTOP"; command = "chanserv/gtop" }
fantasy { name = "GTOP10"; command = "chanserv/gtop10" }
command { service = "ChanServ"; name = "TOP"; command = "chanserv/top"; }
command { service = "ChanServ"; name = "TOP10"; command = "chanserv/top10"; }
command { service = "ChanServ"; name = "GTOP"; command = "chanserv/gtop"; }
command { service = "ChanServ"; name = "GTOP10"; command = "chanserv/gtop10"; }
fantasy { name = "TOP"; command = "chanserv/top"; }
fantasy { name = "TOP10"; command = "chanserv/top10"; }
fantasy { name = "GTOP"; command = "chanserv/gtop"; }
fantasy { name = "GTOP10"; command = "chanserv/gtop10"; }
+5 -42
View File
@@ -21,12 +21,12 @@ service
/*
* The hostname of the Global client.
*/
host = "${services.host}"
host = "services.host"
/*
* The realname of the Global client.
*/
real = "Global Noticer"
gecos = "Global Noticer"
/*
* The modes this client should use.
@@ -49,17 +49,6 @@ service
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
*/
#channels = "@#services,#mychan"
/*
* The server alias that can be used to securely message this service. If
* your IRC server does not have an alias for this service you can set this
* to an empty string to tell users to use /msg instead.
*
* This setting is ignored when options:servicealias is disabled.
*
* Defaults to the nick of the service if not set.
*/
#alias = "GL"
}
/*
@@ -93,7 +82,7 @@ module
#globaloncycleup = "Services are now back online - have a nice day"
/*
* If set, Anope will hide the Services Operator's nick in a global
* If set, Anope will hide the IRC Operator's nick in a global
* message/notice.
*
* This directive is optional.
@@ -113,7 +102,7 @@ module
*/
/* Give it a help command. */
command { service = "Global"; name = "HELP"; command = "generic/help" }
command { service = "Global"; name = "HELP"; command = "generic/help"; }
/*
* gl_global
@@ -123,30 +112,4 @@ command { service = "Global"; name = "HELP"; command = "generic/help" }
* Used for sending a message to every online user.
*/
module { name = "gl_global" }
command { service = "Global"; name = "GLOBAL"; command = "global/global"; permission = "global/global" }
/*
* gl_queue
*
* Provides the command global/queue.
*
* Used for queuing messages to send to every online user.
*/
module
{
name = "gl_queue"
/* The maximum number of messages in a message queue. Defaults to 10. */
maxqueue = 10
}
command { service = "Global"; name = "QUEUE"; command = "global/queue"; permission = "global/queue" }
/*
* gl_server
*
* Provides the command global/server.
*
* Used for sending a message to every online user on a server.
*/
module { name = "gl_server" }
command { service = "Global"; name = "SERVER"; command = "global/server"; permission = "global/server" }
command { service = "Global"; name = "GLOBAL"; command = "global/global"; permission = "global/global"; }
+29 -83
View File
@@ -21,12 +21,12 @@ service
/*
* The hostname of the HostServ client.
*/
host = "${services.host}"
host = "services.host"
/*
* The realname of the HostServ client.
*/
real = "Hostname Service"
gecos = "vHost Service"
/*
* The modes this client should use.
@@ -49,17 +49,6 @@ service
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
*/
#channels = "@#services,#mychan"
/*
* The server alias that can be used to securely message this service. If
* your IRC server does not have an alias for this service you can set this
* to an empty string to tell users to use /msg instead.
*
* This setting is ignored when options:servicealias is disabled.
*
* Defaults to the nick of the service if not set.
*/
#alias = "HS"
}
/*
@@ -79,12 +68,7 @@ module
/*
* If enabled, vhosts are activated on users immediately when they are set.
*/
activate_on_set = yes
/*
* If enabled, vhosts are activated on users immediately when they log out of an operator account.
*/
activate_on_deoper = yes
activate_on_set = false
}
/*
@@ -99,144 +83,106 @@ module
*/
/* Give it a help command. */
command { service = "HostServ"; name = "HELP"; command = "generic/help" }
command { service = "HostServ"; name = "HELP"; command = "generic/help"; }
/*
* hs_del
*
* Provides the commands hostserv/del and hostserv/delall.
*
* Used for removing users' vhosts.
* Used for removing users' vHosts.
*/
module { name = "hs_del" }
command { service = "HostServ"; name = "DEL"; command = "hostserv/del"; permission = "hostserv/del" }
command { service = "HostServ"; name = "DELALL"; command = "hostserv/delall"; permission = "hostserv/del" }
command { service = "HostServ"; name = "DEL"; command = "hostserv/del"; permission = "hostserv/del"; }
command { service = "HostServ"; name = "DELALL"; command = "hostserv/delall"; permission = "hostserv/del"; }
/*
* hs_group
*
* Provides the command hostserv/group.
*
* Used for syncing one vhost to many nicks.
* Used for grouping one vHost to many nicks.
*/
module
{
name = "hs_group"
/*
* Upon nickserv/group, this option syncs the nick's main vhost to the grouped nick.
* Upon nickserv/group, this option syncs the nick's main vHost to the grouped nick.
*/
syncongroup = yes
syncongroup = true
/*
* This makes vhosts act as if they are per account.
*/
synconset = yes
synconset = true
}
command { service = "HostServ"; name = "GROUP"; command = "hostserv/group" }
command { service = "HostServ"; name = "GROUP"; command = "hostserv/group"; }
/*
* hs_list
*
* Provides the command hostserv/list.
*
* Used for listing actively set vhosts.
* Used for listing actively set vHosts.
*/
module { name = "hs_list" }
command { service = "HostServ"; name = "LIST"; command = "hostserv/list"; permission = "hostserv/list" }
command { service = "HostServ"; name = "LIST"; command = "hostserv/list"; permission = "hostserv/list"; }
/*
* hs_off
*
* Provides the command hostserv/off.
*
* Used for turning off your vhost.
* Used for turning off your vHost.
*/
module { name = "hs_off" }
command { service = "HostServ"; name = "OFF"; command = "hostserv/off" }
/*
* hs_offfer
*
* Provides the commands hostserv/offfer and hostserv/offerlist.
*
* Used to offer specialized vhosts to users, with template variables available.
*/
module
{
name = "hs_offer"
/*
* How long after a vhost is applied can another vhost be taken.
*/
takedelay = 7d
}
command { service = "HostServ"; name = "OFFER"; command = "hostserv/offer"; permission = "hostserv/offer" }
command { service = "HostServ"; name = "OFFERLIST"; command = "hostserv/offerlist" }
command { service = "HostServ"; name = "OFF"; command = "hostserv/off"; }
/*
* hs_on
*
* Provides the command hostserv/on.
*
* Used for turning on your vhost.
* Used for turning on your vHost.
*/
module { name = "hs_on" }
command { service = "HostServ"; name = "ON"; command = "hostserv/on" }
command { service = "HostServ"; name = "ON"; command = "hostserv/on"; }
/*
* hs_request
*
* Provides the commands:
* hostserv/request - Requests a vhost.
* hostserv/activate - Approves a requested vhost.
* hostserv/reject - Rejects a requested vhost.
* hostserv/waiting - Lists pending vhost requests.
* hostserv/validate - Allows self-service approval of vhosts using DNS
* validation (requires the dns module).
* Provides the commands hostserv/request, hostserv/activate, hostserv/reject, and hostserv/waiting.
*
* Used to manage vhosts requested by users.
* Used to manage vHosts requested by users.
*/
module
{
name = "hs_request"
/*
* If set, Anope will send a memo to the user requesting a vhost when it's been
* If set, Anope will send a memo to the user requesting a vHost when it's been
* approved or rejected.
*/
#memouser = yes
/*
* If set, Anope will send a memo to all services staff when a new vhost is requested.
* If set, Anope will send a memo to all services staff when a new vHost is requested.
*/
#memooper = yes
/*
* If DNS validation is enabled, how long should users have to wait between
* attempts at DNS validation. Defaults to 5 minutes.
*/
#validationcooldown = 5m
/*
* If DNS validation is enabled, the TXT record to look for when determining
* if the requester controls the domain. Defaults to anope-dns-validation.
*/
#validationrecord = "anope-dns-validation"
}
command { service = "HostServ"; name = "REQUEST"; command = "hostserv/request" }
command { service = "HostServ"; name = "ACTIVATE"; command = "hostserv/activate"; permission = "hostserv/set" }
command { service = "HostServ"; name = "REJECT"; command = "hostserv/reject"; permission = "hostserv/set" }
command { service = "HostServ"; name = "WAITING"; command = "hostserv/waiting"; permission = "hostserv/set" }
#command { service = "HostServ"; name = "VALIDATE"; command = "hostserv/validate" }
command { service = "HostServ"; name = "REQUEST"; command = "hostserv/request"; }
command { service = "HostServ"; name = "ACTIVATE"; command = "hostserv/activate"; permission = "hostserv/set"; }
command { service = "HostServ"; name = "REJECT"; command = "hostserv/reject"; permission = "hostserv/set"; }
command { service = "HostServ"; name = "WAITING"; command = "hostserv/waiting"; permission = "hostserv/set"; }
/*
* hs_set
*
* Provides the commands hostserv/set and hostserv/setall.
*
* Used for setting users' vhosts.
* Used for setting users' vHosts.
*/
module { name = "hs_set" }
command { service = "HostServ"; name = "SET"; command = "hostserv/set"; permission = "hostserv/set" }
command { service = "HostServ"; name = "SETALL"; command = "hostserv/setall"; permission = "hostserv/set" }
command { service = "HostServ"; name = "SET"; command = "hostserv/set"; permission = "hostserv/set"; }
command { service = "HostServ"; name = "SETALL"; command = "hostserv/setall"; permission = "hostserv/set"; }
+97
View File
@@ -0,0 +1,97 @@
/*
* Example configuration file for the irc2sql gateway
*
*/
service
{
/*
* The name of the StatServ client.
*/
nick = "StatServ"
/*
* The username of the StatServ client.
*/
user = "StatServ"
/*
* The hostname of the StatServ client.
*/
host = "stats.host"
/*
* The realname of the StatServ client.
*/
gecos = "Statistical Service"
/*
* The modes this client should use.
* Do not modify this unless you know what you are doing.
*
* These modes are very IRCd specific. If left commented, sane defaults
* are used based on what protocol module you have loaded.
*
* Note that setting this option incorrectly could potentially BREAK some, if
* not all, usefulness of the client. We will not support you if this client is
* unable to do certain things if this option is enabled.
*/
#modes = "+o"
/*
* An optional comma separated list of channels this service should join. Outside
* of log channels this is not very useful, as the service will just idle in the
* specified channels, and will not accept any types of commands.
*
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
*/
#channels = "@#stats,#mychan"
}
module
{
name = "irc2sql"
/*
* The name of the client that should send the CTCP VERSION requests.
* It must already exist or must be defined in the following service block.
*/
client = "StatServ"
/*
* The name of the SQL engine to use.
* This must be MySQL and must match the name in the mysql{} block
*/
engine = "mysql/main"
/*
* An optional prefix to prepended to the name of each created table.
* Do not use the same prefix for other programs.
*/
prefix = "anope_"
/*
* GeoIP - Automatically adds users geoip location to the user table.
* Tables are created by irc2sql, you have to run the
* geoipupdate script after you started Anope to download
* and import the GeoIP database.
*
* The geoip database can be the smaller "country" database or the
* larger "city" database. Comment to disable geoip lookup.
*/
geoip_database = "country"
/*
* Get the CTCP version from users
* The users connecting to the network will receive a CTCP VERSION
* request from the above configured stats client
*/
ctcpuser = "yes"
/*
* Send out CTCP VERSION requests to users during burst.
* Disable this if you restart Anope often and don't want to
* annoy your users.
*/
ctcpeob = "yes"
}
+22 -30
View File
@@ -21,12 +21,12 @@ service
/*
* The hostname of the MemoServ client.
*/
host = "${services.host}"
host = "services.host"
/*
* The realname of the MemoServ client.
*/
real = "Memo Service"
gecos = "Memo Service"
/*
* The modes this client should use.
@@ -49,17 +49,6 @@ service
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
*/
#channels = "@#services,#mychan"
/*
* The server alias that can be used to securely message this service. If
* your IRC server does not have an alias for this service you can set this
* to an empty string to tell users to use /msg instead.
*
* This setting is ignored when options:servicealias is disabled.
*
* Defaults to the nick of the service if not set.
*/
#alias = "MS"
}
/*
@@ -89,11 +78,12 @@ module
/*
* The delay between consecutive uses of the MemoServ SEND command. This can help prevent spam
* as well as denial-of-service attacks from sending large numbers of memos and filling up disk
* space (and memory).
* space (and memory). The default 3-second wait means a maximum average of 150 bytes of memo
* per second per user under the current IRC protocol.
*
* This directive is optional, but recommended.
*/
senddelay = 30s
senddelay = 3s
}
/*
@@ -108,7 +98,7 @@ module
*/
/* Give it a help command. */
command { service = "MemoServ"; name = "HELP"; command = "generic/help" }
command { service = "MemoServ"; name = "HELP"; command = "generic/help"; }
/*
* ms_cancel
@@ -118,7 +108,7 @@ command { service = "MemoServ"; name = "HELP"; command = "generic/help" }
* Used to cancel memos already sent but not yet read.
*/
module { name = "ms_cancel" }
command { service = "MemoServ"; name = "CANCEL"; command = "memoserv/cancel" }
command { service = "MemoServ"; name = "CANCEL"; command = "memoserv/cancel"; }
/*
* ms_check
@@ -128,7 +118,7 @@ command { service = "MemoServ"; name = "CANCEL"; command = "memoserv/cancel" }
* Used to check if a sent memo has been read.
*/
module { name = "ms_check" }
command { service = "MemoServ"; name = "CHECK"; command = "memoserv/check" }
command { service = "MemoServ"; name = "CHECK"; command = "memoserv/check"; }
/*
* ms_del
@@ -138,7 +128,7 @@ command { service = "MemoServ"; name = "CHECK"; command = "memoserv/check" }
* Used to delete your memos.
*/
module { name = "ms_del" }
command { service = "MemoServ"; name = "DEL"; command = "memoserv/del" }
command { service = "MemoServ"; name = "DEL"; command = "memoserv/del"; }
/*
* ms_ignore
@@ -156,9 +146,9 @@ module
*
* This directive is optional.
*/
max = 50
max = 32
}
command { service = "MemoServ"; name = "IGNORE"; command = "memoserv/ignore" }
command { service = "MemoServ"; name = "IGNORE"; command = "memoserv/ignore"; }
/*
* ms_info
@@ -168,7 +158,7 @@ command { service = "MemoServ"; name = "IGNORE"; command = "memoserv/ignore" }
* Used to show memo related information about an account or a channel.
*/
module { name = "ms_info" }
command { service = "MemoServ"; name = "INFO"; command = "memoserv/info" }
command { service = "MemoServ"; name = "INFO"; command = "memoserv/info"; }
/*
* ms_list
@@ -178,7 +168,7 @@ command { service = "MemoServ"; name = "INFO"; command = "memoserv/info" }
* Used to list your current memos.
*/
module { name = "ms_list" }
command { service = "MemoServ"; name = "LIST"; command = "memoserv/list" }
command { service = "MemoServ"; name = "LIST"; command = "memoserv/list"; }
/*
* ms_read
@@ -188,7 +178,7 @@ command { service = "MemoServ"; name = "LIST"; command = "memoserv/list" }
* Used to read your memos.
*/
module { name = "ms_read" }
command { service = "MemoServ"; name = "READ"; command = "memoserv/read" }
command { service = "MemoServ"; name = "READ"; command = "memoserv/read"; }
/*
* ms_rsend
@@ -196,6 +186,8 @@ command { service = "MemoServ"; name = "READ"; command = "memoserv/read" }
* Provides the command memoserv/rsend.
*
* Used to send a memo requiring a receipt be sent back once it is read.
*
* Requires configuring memoserv:memoreceipt.
*/
#module
{
@@ -206,9 +198,9 @@ command { service = "MemoServ"; name = "READ"; command = "memoserv/read" }
*
* This directive is optional.
*/
operonly = no
operonly = false
}
#command { service = "MemoServ"; name = "RSEND"; command = "memoserv/rsend" }
#command { service = "MemoServ"; name = "RSEND"; command = "memoserv/rsend"; }
/*
* ms_send
@@ -218,7 +210,7 @@ command { service = "MemoServ"; name = "READ"; command = "memoserv/read" }
* Used to send memos.
*/
module { name = "ms_send" }
command { service = "MemoServ"; name = "SEND"; command = "memoserv/send" }
command { service = "MemoServ"; name = "SEND"; command = "memoserv/send"; }
/*
* ms_sendall
@@ -228,7 +220,7 @@ command { service = "MemoServ"; name = "SEND"; command = "memoserv/send" }
* Used to send a mass memo to every registered user.
*/
module { name = "ms_sendall" }
command { service = "MemoServ"; name = "SENDALL"; command = "memoserv/sendall"; permission = "memoserv/sendall" }
command { service = "MemoServ"; name = "SENDALL"; command = "memoserv/sendall"; permission = "memoserv/sendall"; }
/*
* ms_set
@@ -238,7 +230,7 @@ command { service = "MemoServ"; name = "SENDALL"; command = "memoserv/sendall";
* Used to set settings such as how you are notified of new memos, and your memo limit.
*/
module { name = "ms_set" }
command { service = "MemoServ"; name = "SET"; command = "memoserv/set" }
command { service = "MemoServ"; name = "SET"; command = "memoserv/set"; }
/*
* ms_staff
@@ -248,4 +240,4 @@ command { service = "MemoServ"; name = "SET"; command = "memoserv/set" }
* Used to send a memo to all registered staff members.
*/
module { name = "ms_staff" }
command { service = "MemoServ"; name = "STAFF"; command = "memoserv/staff"; permission = "memoserv/staff" }
command { service = "MemoServ"; name = "STAFF"; command = "memoserv/staff"; permission = "memoserv/staff"; }
+96 -243
View File
@@ -41,6 +41,7 @@ module { name = "help" }
*/
timeout = 5
/* Only edit below if you are expecting to use os_dns or otherwise answer DNS queries. */
/*
@@ -53,17 +54,18 @@ module { name = "help" }
ip = "0.0.0.0"
port = 53
/*
* SOA record information.
*/
/* Email address of the DNS administrator. */
/* E-mail address of the DNS administrator. */
admin = "admin@example.com"
/* This should be the names of the public facing nameservers serving the records. */
nameservers = "ns1.example.com ns2.example.com"
/* The time secondary servers are allowed to cache for. This should be reasonably low
/* The time slave servers are allowed to cache. This should be reasonably low
* if you want your records to be updated without much delay.
*/
refresh = 3600
@@ -117,15 +119,15 @@ module { name = "help" }
time = 4h
/* Reason for akill.
* {nick} is the nick of the user
* {user} is the ident/username of the user
* {real} is the realname of the user
* {host} is the hostname of the user
* {ip} is the IP of the user
* {reply} is the reply reason (configured below). Will be nothing if not configured.
* {network} is the network name set in networkinfo:networkname
* %n is the nick of the user
* %u is the ident/username of the user
* %g is the realname of the user
* %h is the hostname of the user
* %i is the IP of the user
* %r is the reply reason (configured below). Will be nothing if not configured.
* %N is the network name set in networkinfo:networkname
*/
reason = "You are listed in the EFnet RBL, visit https://rbl.efnetrbl.org/?i={ip} for info"
reason = "You are listed in the EFnet RBL, visit https://rbl.efnetrbl.org/?i=%i for info"
/* Replies to ban and their reason. If no replies are configured, all replies get banned. */
reply
@@ -169,7 +171,7 @@ module { name = "help" }
{
name = "dnsbl.dronebl.org"
time = 4h
reason = "You have a host listed in the DroneBL. For more information, visit https://dronebl.org/lookup?ip={ip}&network={network}"
reason = "You have a host listed in the DroneBL. For more information, visit https://dronebl.org/lookup_branded?ip=%i&network=%N"
}
/* Exempt localhost from DNSBL checks */
@@ -231,7 +233,7 @@ module { name = "help" }
}
/*
* [EXTRA] ldap
* ldap [EXTRA]
*
* This module allows other modules to use LDAP. By itself, this module does nothing useful.
*/
@@ -252,7 +254,7 @@ module { name = "help" }
}
/*
* ldap_authentication
* ldap_authentication [EXTRA]
*
* This module allows many commands such as IDENTIFY, RELEASE, RECOVER, GHOST, etc. use
* LDAP to authenticate users. Requires ldap.
@@ -268,10 +270,10 @@ module { name = "help" }
/*
* The search filter used to look up users's accounts.
* {account} is replaced with the user's account.
* {object_class} is replaced with the object_class configured below.
* %account is replaced with the user's account.
* %object_class is replaced with the object_class configured below.
*/
search_filter = "(&(uid={account})(objectClass={object_class}))"
search_filter = "(&(uid=%account)(objectClass=%object_class))"
/*
* The object class used by LDAP to store user account information.
@@ -302,17 +304,17 @@ module { name = "help" }
*
* If not set, then registration is not blocked.
*/
#disable_register_reason = "To register on this network visit https://some.misconfigured.site.example/register"
#disable_register_reason = "To register on this network visit https://some.misconfigured.site/register"
/*
* If set, the reason to give the users who try to "/msg NickServ SET EMAIL".
* If not set, then email changing is not blocked.
*/
#disable_email_reason = "To change your email address visit https://some.misconfigured.site.example"
#disable_email_reason = "To change your email address visit https://some.misconfigured.site"
}
/*
* ldap_oper
* ldap_oper [EXTRA]
*
* This module dynamically ties users to Anope opertypes when they identify
* via LDAP group membership. Requires ldap.
@@ -325,7 +327,7 @@ module { name = "help" }
/*
* An optional binddn to use when searching for groups.
* {account} is replaced with the account name of the user.
* %a is replaced with the account name of the user.
*/
#binddn = "cn=Manager,dc=anope,dc=org"
@@ -341,9 +343,9 @@ module { name = "help" }
/*
* The filter to use when searching for users.
* {account} is replaced with the account name of the user.
* %a is replaced with the account name of the user.
*/
filter = "(member=uid={account},ou=users,dc=anope,dc=org)"
filter = "(member=uid=%a,ou=users,dc=anope,dc=org)"
/*
* The attribute of the group that is the name of the opertype.
@@ -353,7 +355,7 @@ module { name = "help" }
}
/*
* [EXTRA] mysql
* mysql [EXTRA]
*
* This module allows other modules to use MySQL.
*/
@@ -370,13 +372,36 @@ module { name = "help" }
username = "anope"
password = "mypassword"
port = 3306
socket = ""
}
}
/*
* redis
*
* This module allows other modules to use Redis.
*/
#module
{
name = "redis"
/* A redis database */
redis
{
/* The name of this service */
name = "redis/main"
/*
* The redis database to use. New connections default to 0.
*/
db = 0
ip = "127.0.0.1"
port = 6379
}
}
/*
* [EXTRA] regex_pcre2
* regex_pcre2 [EXTRA]
*
* Provides the regex engine regex/pcre, which uses version 2 of the Perl Compatible Regular
* Expressions library.
@@ -384,7 +409,7 @@ module { name = "help" }
#module { name = "regex_pcre2" }
/*
* [EXTRA] regex_posix
* regex_posix [EXTRA]
*
* Provides the regex engine regex/posix, which uses the POSIX compliant regular expressions.
*/
@@ -414,7 +439,7 @@ module
}
/*
* [EXTRA] regex_tre
* regex_tre [EXTRA]
*
* Provides the regex engine regex/tre, which uses the TRE regex library.
*/
@@ -431,7 +456,7 @@ module
service = "ChanServ"; name = "CLEAR"; command = "rewrite"
/* Enable rewrite. */
rewrite = yes
rewrite = true
/* Source message to match. A $ can be used to match anything. */
rewrite_source = "CLEAR $ USERS"
@@ -524,16 +549,26 @@ module
/*
* The reason to ban the user for.
* {type} is replaced with the type of proxy found.
* {ip} is replaced with the IP of proxy found.
* {port} is replaced with the port.
* %h is replaced with the type of proxy found.
* %i is replaced with the IP of proxy found.
* %p is replaced with the port.
*/
reason = "You have an open proxy running on your host ({type}:{ip}:{port})"
reason = "You have an open proxy running on your host (%t:%i:%p)"
}
}
/*
* [EXTRA] ssl_gnutls
* sasl
*
* Some IRCds allow "SASL" authentication to let users identify to services
* during the IRCd user registration process. If this module is loaded, Anope will allow
* authenticating users through this mechanism. Supported mechanisms are:
* PLAIN, EXTERNAL.
*/
module { name = "sasl" }
/*
* ssl_gnutls [EXTRA]
*
* This module provides SSL services to Anope using GnuTLS, for example to
* connect to the uplink server(s) via SSL.
@@ -545,8 +580,7 @@ module
name = "ssl_gnutls"
/*
* An optional certificate and key for ssl_gnutls to give to the uplink. All
* paths are relative to the config directory.
* An optional certificate and key for ssl_gnutls to give to the uplink.
*
* You can generate your own certificate and key pair by using:
*
@@ -554,8 +588,8 @@ module
* certtool --generate-self-signed --load-privkey privkey.pem --outfile fullchain.pem
*
*/
cert = "fullchain.pem"
key = "privkey.pem"
cert = "data/fullchain.pem"
key = "data/privkey.pem"
/*
* Diffie-Hellman parameters to use when acting as a server. This is only
@@ -568,11 +602,11 @@ module
* certtool --generate-dh-params --bits 2048 --outfile dhparams.pem
*
*/
#dhparams = "dhparams.pem"
# dhparams = "data/dhparams.pem"
}
/*
* [EXTRA] ssl_openssl
* ssl_openssl [EXTRA]
*
* This module provides SSL services to Anope using OpenSSL, for example to
* connect to the uplink server(s) via SSL.
@@ -586,15 +620,14 @@ module
/*
* An optional certificate and key for ssl_openssl to give to the uplink.
* All paths are relative to the config directory.
*
* You can generate your own certificate and key pair by using:
*
* openssl genrsa -out privkey.pem 2048
* openssl req -new -x509 -key privkey.pem -out fullchain.pem -days 1095
*/
cert = "fullchain.pem"
key = "privkey.pem"
cert = "data/fullchain.pem"
key = "data/privkey.pem"
/*
* If you wish to increase security you can disable support for older
@@ -607,7 +640,7 @@ module
}
/*
* sql_authentication
* sql_authentication [EXTRA]
*
* This module allows authenticating users against an external SQL database using a custom
* query.
@@ -644,41 +677,24 @@ module
*/
query = "SELECT `email_addr` AS `email` FROM `my_users` WHERE `username` = @a@ AND `password` = MD5(CONCAT('salt', @p@))"
/*
* If your database uses a password hashing algorithm that can not be compared using a simple
* comparison function then you can specify it here to compare locally.
*
* You will need to have the appropriate encryption module (e.g. enc_bcrypt) loaded in order
* for this to work.
*/
#password_hash = "bcrypt"
/*
* If using the password_hash field (above) you will need to specify the name of the field to
* fetch the password from.
*
* Defaults to "password" if not set.
*/
#password_field = "password"
/*
* If set, the reason to give the users who try to "/msg NickServ REGISTER".
* If not set, then registration is not blocked.
*/
#disable_reason = "To register on this network visit https://some.misconfigured.site.example/register"
#disable_reason = "To register on this network visit https://some.misconfigured.site/register"
/*
* If set, the reason to give the users who try to "/msg NickServ SET EMAIL".
* If not set, then email changing is not blocked.
*/
#disable_email_reason = "To change your email address visit https://some.misconfigured.site.example"
#disable_email_reason = "To change your email address visit https://some.misconfigured.site"
}
/*
* sql_log
* sql_log [EXTRA]
*
* This module adds an additional target option to log{} blocks
* that allows logging Services' logs to SQL. To log to SQL, add
* that allows logging Service's logs to SQL. To log to SQL, add
* the SQL service name to log:targets prefixed by sql_log:. For
* example:
*
@@ -695,10 +711,10 @@ module
#module { name = "sql_log" }
/*
* sql_oper
* sql_oper [EXTRA]
*
* This module allows granting users Services Operator privileges based on an
* external SQL database using a custom query.
* This module allows granting users services operator privileges and possibly IRC Operator
* privileges based on an external SQL database using a custom query.
*/
#module
{
@@ -721,7 +737,7 @@ module
}
/*
* [EXTRA] sqlite
* sqlite [EXTRA]
*
* This module allows other modules to use SQLite.
*/
@@ -736,7 +752,7 @@ module
name = "sqlite/main"
/* The database name, it will be created if it does not exist. */
database = "anope.sqlite"
database = "anope.db"
}
}
@@ -754,196 +770,33 @@ module
name = "webcpanel"
/* Web server to use. */
server = "httpd/main"
server = "httpd/main";
/*
* The directory containing the webcpanel templates. This is relative to the
* data directory.
*/
template_dir = "webcpanel/templates/default"
/* Template to use. */
template = "default";
/* Page title. */
title = "Anope IRC Services"
title = "Anope IRC Services";
}
/*
* jsonrpc
* xmlrpc
*
* Allows remote applications to execute methods within Anope using the JSON-RPC
* protocol. See https://www.jsonrpc.org/specification for more information.
*
* By itself this module does nothing. You should load a RPC method module like
* rpc_data which actually provides RPC methods.
*
* See docs/RPC/jsonrpc.js for an example JavaScript JSON-RPC client.
* See docs/RPC/jsonrpc.rb for an example Ruby JSON-RPC client.
*
* IMPORTANT: this can not be loaded at the same time as the xmlrpc module.
*/
#module
{
name = "jsonrpc"
/*
* The maximum number of bits an integer can be have in its native type.
*
* By default Anope will emit integers as their native JSON type. If you are
* using JavaScript (which has 53 bit integers) or another language with
* native integer types smaller than 64 bits you may need to limit the size
* of integers emitted by Anope.
*
* If this is enabled a string will be used for values outside of the range
* supported by the native data type.
*/
#integer_bits = 53
/* Web service to use. Requires httpd. */
server = "httpd/main"
/*
* You can also specify one or more authorization tokens to protect access
* to the JSON-RPC interface. These tokens should be sent using the Bearer
* authorization header as defined in RFC 6750.
*/
#token
{
/* The token used for authentication. */
token = "BmcxTaiYjoBtayfnxCFq"
/*
* The algorithm which the above token is hashed with. If this is not
* set then services will assume the above password is not hashed.
*
* You will need to have the appropriate encryption module (e.g.
* enc_bcrypt) loaded in order for this to work.
*/
#token_hash = "bcrypt"
/** A list of glob patterns for methods the token can execute. */
methods = "~anope.message* anope.*"
}
}
/*
* [EXTRA] xmlrpc
*
* Allows remote applications to execute methods within Anope using the XML-RPC
* protocol. See https://xmlrpc.com/spec.md for more information.
*
* By itself this module does nothing. You should load a RPC method module like
* rpc_data which actually provides RPC methods.
*
* IMPORTANT: this can not be loaded at the same time as the jsonrpc module.
* Allows remote applications (websites) to execute queries in real time to retrieve data from Anope.
* By itself this module does nothing, but allows other modules (xmlrpc_main) to receive and send XMLRPC queries.
*/
#module
{
name = "xmlrpc"
/*
* Whether to enable the use of XML-RPC extensions.
*
* By default Anope will use some extended XML-RPC types. If your XML-RPC
* client can not handle these you will need to disable them.
*
* If i8 is disabled a string will be used for values outside of the range
* supported by the 32-bit int data type.
*
* If nil is disabled an empty struct will be used instead.
*/
#enable_i8 = no
#enable_nil = no
/* Web service to use. Requires httpd. */
server = "httpd/main"
/*
* You can also specify one or more authorization tokens to protect access
* to the XML-RPC interface. These tokens should be sent using the Bearer
* authorization header as defined in RFC 6750.
*/
#token
{
/* The token used for authentication. */
token = "BmcxTaiYjoBtayfnxCFq"
/*
* The algorithm which the above token is hashed with. If this is not
* set then services will assume the above password is not hashed.
*
* You will need to have the appropriate encryption module (e.g.
* enc_bcrypt) loaded in order for this to work.
*/
#token_hash = "bcrypt"
/** A list of glob patterns for methods the token can execute. */
methods = "~anope.message* anope.*"
}
}
/*
* rpc_user
* xmlrpc_main
*
* Adds support for the following RPC methods:
*
* anope.checkCredentials anope.identify
* anope.listCommands anope.command
*
* Requires either the jsonrpc or xmlrpc module.
*
* See docs/RPC/rpc_user.md for API documentation.
* Adds the main XMLRPC core functions.
* Requires xmlrpc.
*/
#module
{
name = "rpc_user"
/*
* Some commands can only be executed by a real IRC user. You can work around
* this executing them as an IRC user logged into the account if one exists.
*/
pretenduser = no
}
/*
* rpc_data
*
* Adds support for the following RPC methods:
*
* anope.listAccounts anope.account
* anope.listChannels anope.channel
* anope.listOpers anope.oper
* anope.listServers anope.server
* anope.listUsers anope.user
*
* Requires either the jsonrpc or xmlrpc module.
*
* See docs/RPC/rpc_data.md for API documentation.
*/
#module { name = "rpc_data" }
/*
* rpc_message
*
* Adds support for the following RPC methods:
*
* anope.messageNetwork anope.messageServer
* anope.messageUser
*
* Requires either the jsonrpc or xmlrpc module.
*
* See docs/RPC/rpc_message.md for API documentation.
*/
#module { name = "rpc_message" }
/*
* rpc_system
*
* Adds support for the following RPC methods:
*
* system.listMethods
*
* Requires either the jsonrpc or xmlrpc module.
*
* See https://gggeek.github.io/phpxmlrpc/doc-1.1/ch08.html for API
* documentation.
*/
#module { name = "rpc_system" }
#module { name = "xmlrpc_main" }
+155 -376
View File
@@ -21,12 +21,12 @@ service
/*
* The hostname of the NickServ client.
*/
host = "${services.host}"
host = "services.host"
/*
* The realname of the NickServ client.
*/
real = "Nickname Registration Service"
gecos = "Nickname Registration Service"
/*
* The modes this client should use.
@@ -49,17 +49,6 @@ service
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
*/
#channels = "@#services,#mychan"
/*
* The server alias that can be used to securely message this service. If
* your IRC server does not have an alias for this service you can set this
* to an empty string to tell users to use /msg instead.
*
* This setting is ignored when options:servicealias is disabled.
*
* Defaults to the nick of the service if not set.
*/
#alias = "NS"
}
/*
@@ -77,23 +66,20 @@ module
client = "NickServ"
/*
* Requires users to give an email address when they register a nick.
* Force users to give an e-mail address when they register a nick.
*
* This directive defaults to "yes" and is recommended to be enabled.
* This directive defaults to "yes" and is recommended to be enabled. This is required if e-mail registration is enabled.
*/
forceemail = yes
/*
* Require users who change their email address to confirm they
* own their new email.
*
* If {ns_register}:registration is set to mail then this defaults
* to yes. Otherwise, it defaults to no.
*/
#confirmemailchanges = yes
confirmemailchanges = no
/*
* A message sent to users on connect if they use an unregistered nick. {nick} will be replaced with the user's nickname.
* A message sent to users on connect if they use an unregistered nick. %n will be replaced with the user's nickname.
*
* This directive is optional.
*/
@@ -105,39 +91,42 @@ module
* by spaces.
*
* The options are:
* - killprotect: Kill nick if not identified within 60 seconds
* - kill_quick: Kill nick if not identified within 20 seconds, this one overrides the killprotect
* option and the killprotect option must be specified with this one
* - kill_immed: Kill nick immediately if not identified, this one overrides both the killprotect
* and kill_quick options and the killprotect option must be specified with this one
* - ns_private: Hide the nick from NickServ's LIST command
* - hide_email: Hide the nick's email address from NickServ's INFO command
* - hide_email: Hide the nick's e-mail address from NickServ's INFO command
* - hide_mask: Hide the nick's last or current user@host from NickServ's INFO command
* - hide_status: Hide the nick's services operator access status from NickServ's INFO command
* - hide_quit: Hide the nick's last quit message from NickServ's INFO command
* - memo_signon: Notify user if they have a new memo when they sign into the nick
* - memo_receive: Notify user if they have a new memo as soon as it's received
* - memo_mail: Notify user if they have a new memo by mail
* - autologin: User will be automatically logged in when they connect with a known SSL cert.
* - autoop: User will be automatically opped in channels they enter and have access to
* - neverop: User can not be added to access lists
* - msg: Messages will be sent as PRIVMSGs instead of NOTICEs
* - msg: Messages will be sent as PRIVMSGs instead of NOTICEs, requires options:useprivmsg
* to be enabled as well
* - ns_keep_modes: Enables keepmodes, which retains user modes across sessions
* - protect: Protects the registered nickname from use by unidentified users.
* - ns_stats: Enable Chanstats for newly registered nicks
*
* This directive is optional, if left blank, the options will default to memo_signon, and
* memo_receive. If you really want no defaults, use "none" by itself as the option.
*/
defaults = "autoop hide_email hide_mask memo_receive memo_signon ns_private protect"
defaults = "killprotect ns_private hide_email hide_mask memo_signon memo_receive autoop"
/*
* The minimum length of time between consecutive uses of NickServ's REGISTER command. This
* directive is optional, but recommended. If not set, it defaults to 15 minutes.
* directive is optional, but recommended. If not set, this restriction will be disabled.
*/
regdelay = 15m
regdelay = 30s
/*
* The length of time before a nick's registration expires.
*
* This directive is optional, but recommended. If not set, the default is one year.
* This directive is optional, but recommended. If not set, the default is 90 days.
*/
expire = 1y
expire = 90d
/*
* Prevents the use of the ACCESS and CERT (excluding their LIST subcommand), DROP, FORBID, SUSPEND
@@ -166,28 +155,14 @@ module
* If set, Anope will not show netsplits in the last quit message field
* of NickServ's INFO command.
*/
hidenetsplitquit = yes
hidenetsplitquit = no
/*
* The default period to force users to stop using a protected nickname after.
*
* Defaults to 1 minute.
* If set, is the length of time NickServ's killquick and kill options wait before
* forcing users off of protected nicknames.
*/
defaultprotect = 1m
/*
* The minimum period that a user can have a user forced off their protected nickname after.
*
* Defaults to 10 seconds.
*/
minprotect = 10s
/*
* The maximum period that a user can have a user forced off their protected nickname after.
*
* Defaults to 10 minutes.
*/
maxprotect = 10m
killquick = 20s
kill = 60s
/*
* If set, forbids the registration of nicks that contain an existing
@@ -204,13 +179,11 @@ module
#restrictopernicks = yes
/*
* The username, hostname, and real name used for pseudoclients created when
* Anope needs to hold a nickname. This is only used if your IRCd does not
* support SVSHOLDs.
* The username, and possibly hostname, used for fake users created when Anope needs to
* hold a nickname.
*/
enforceruser = "enforcer"
enforcerhost = "${services.host}"
enforcerreal = "Services Enforcer"
enforcerhost = "services.host"
/*
* The length of time Anope should hold nicknames for.
@@ -220,17 +193,13 @@ module
releasetimeout = 1m
/*
* When a user's nick is forcibly changed to enforce nickname protection their new
* nick will be based on this value. Any # in the value will be replaced with a random
* number. If your IRCd has support for unique identifiers you can also set this to an
* empty string to change a user's nick to their unique identifier.
* When a user's nick is forcibly changed to enforce a "nick kill", their new nick will start
* with this value. The rest will be made up of 6 or 7 digits.
* Make sure this is a valid nick and Nicklen+7 is not longer than the allowed Nicklen on your ircd.
*
* Make sure this is a valid nick and that it is is not longer than the maximum nick
* length on your IRCd.
*
* This directive is optional. If not set it defaults to "Guest####"
* This directive is optional. If not set it defaults to "Guest"
*/
guestnick = "Guest####"
guestnickprefix = "Guest"
/*
* If set, Anope does not allow ownership of nick names, only ownership of accounts.
@@ -250,12 +219,6 @@ module
* This directive is optional. If not set it defaults to 50.
*/
maxpasslen = 50
/*
* Whether all of the secondary nicks of an account have to expire or be
* dropped before the display nick can expire or be dropped.
*/
preservedisplay = no
}
/*
@@ -281,7 +244,7 @@ command_group
}
/* Give it a help command. */
command { service = "NickServ"; name = "HELP"; command = "generic/help" }
command { service = "NickServ"; name = "HELP"; command = "generic/help"; }
/*
* ns_ajoin
@@ -299,7 +262,7 @@ module
*/
ajoinmax = 10
}
command { service = "NickServ"; name = "AJOIN"; command = "nickserv/ajoin" }
command { service = "NickServ"; name = "AJOIN"; command = "nickserv/ajoin"; }
/*
* ns_alist
@@ -309,8 +272,7 @@ command { service = "NickServ"; name = "AJOIN"; command = "nickserv/ajoin" }
* Used for viewing what channels you have access to.
*/
module { name = "ns_alist" }
command { service = "NickServ"; name = "ALIST"; command = "nickserv/alist" }
command { service = "NickServ"; name = "ACCESS"; command = "nickserv/alist"; hide = yes }
command { service = "NickServ"; name = "ALIST"; command = "nickserv/alist"; }
/*
* ns_cert
@@ -323,32 +285,13 @@ module
{
name = "ns_cert"
/*
* Should users who are connected with a SSL client certificate have its fingerprint be added to
* their account when they register. Defaults to yes.
*/
automatic = yes
/*
* The maximum number of entries allowed on a nickname's certificate fingerprint list.
* The default is 5. This number cannot be set to 0.
*/
max = 5
}
command { service = "NickServ"; name = "CERT"; command = "nickserv/cert" }
command { service = "NickServ"; name = "SET AUTOLOGIN"; command = "nickserv/set/autologin" }
command { service = "NickServ"; name = "SASET AUTOLOGIN"; command = "nickserv/saset/autologin"; permission = "nickserv/saset/autologin" }
/*
* ns_confirm
*
* Provides the command nickserv/confirm.
*
* Used for confirming previous account actions.
*/
module { name = "ns_confirm" }
command { service = "NickServ"; name = "CONFIRM"; command = "nickserv/confirm" }
command { service = "NickServ"; name = "CERT"; command = "nickserv/cert"; }
/*
* ns_drop
@@ -358,76 +301,35 @@ command { service = "NickServ"; name = "CONFIRM"; command = "nickserv/confirm" }
* Used for unregistering names.
*/
module { name = "ns_drop" }
command { service = "NickServ"; name = "DROP"; command = "nickserv/drop" }
command { service = "NickServ"; name = "DROP"; command = "nickserv/drop"; }
/*
* ns_email
* ns_getemail
*
* Provides various functionality relating to email addresses. This includes the
* following commands:
* Provides the command nickserv/getemail.
*
* - nickserv/confirm/email: Used for confirming email changes.
* - nickserv/getemail: Used for getting accounts by searching for emails.
* - nickserv/set/email, nickserv/saset/email: Used for setting an account's
* emailvaddress.
* Used for getting registered accounts by searching for emails.
*/
module
{
name = "ns_email"
/*
* The amount of time a user has after requesting a change of email address
* before it expires. Defaults to 1 day.
*/
#changeexpire = 1d
/*
* The limit to how many registered accounts can use the same email address.
* If set to 0 or left commented there will be no limit enforced when
* registering new accounts or using /msg NickServ SET EMAIL.
*/
#maxemails = 1
/*
* Whether to attempt to remove aliases when counting email addresses. This
* means removing dots (.) and anything after a plus (+) in the user part of
* the address, e.g. foo.bar+baz@example.com -> foobar@example.com.
*/
#remove_aliases = yes
}
command { service = "NickServ"; name = "CONFIRM EMAIL"; command = "nickserv/confirm/email" }
command { service = "NickServ"; name = "GETEMAIL"; command = "nickserv/getemail"; permission = "nickserv/getemail"; group = "nickserv/admin" }
command { service = "NickServ"; name = "SET EMAIL"; command = "nickserv/set/email" }
command { service = "NickServ"; name = "SASET EMAIL"; command = "nickserv/saset/email"; permission = "nickserv/saset/email" }
module { name = "ns_getemail" }
command { service = "NickServ"; name = "GETEMAIL"; command = "nickserv/getemail"; permission = "nickserv/getemail"; group = "nickserv/admin"; }
/*
* ns_group
*
* Provides the commands:
* nickserv/group
* nickserv/ungroup
* nickserv/glist
* nickserv/saset/display
* nickserv/set/display
* Provides the commands nickserv/group, nickserv/glist, and nickserv/ungroup.
*
* Used for controlling grouped nicknames.
* Used for controlling nick groups.
*/
module
{
name = "ns_group"
/*
* The minimum length of time between consecutive uses of the GROUP command. This directive is
* optional, but recommended. If not set, it defaults to 5 minutes.
*/
delay = 5m
/*
* The maximum number of nicks allowed in a group.
*
* This directive is optional, but recommended. If not set or set to 0, no limits will be applied.
*/
maxaliases = 10
maxaliases = 16
/*
* If set, the NickServ GROUP command won't allow any group changes. This is recommended to
@@ -438,15 +340,9 @@ module
*/
nogroupchange = yes
}
command { service = "NickServ"; name = "GLIST"; command = "nickserv/glist" }
command { service = "NickServ"; name = "GROUP"; command = "nickserv/group" }
command { service = "NickServ"; name = "UNGROUP"; command = "nickserv/ungroup" }
command { service = "NickServ"; name = "SET DISPLAY"; command = "nickserv/set/display" }
command { service = "NickServ"; name = "SASET DISPLAY"; command = "nickserv/saset/display"; permission = "nickserv/saset/display" }
# For compatibility with Atheme.
command { service = "NickServ"; name = "SET ACCOUNTNAME"; command = "nickserv/set/display"; hide = yes }
command { service = "NickServ"; name = "SASET ACCOUNTNAME"; command = "nickserv/saset/display"; permission = "nickserv/saset/display"; hide = yes }
command { service = "NickServ"; name = "GLIST"; command = "nickserv/glist"; }
command { service = "NickServ"; name = "GROUP"; command = "nickserv/group"; }
command { service = "NickServ"; name = "UNGROUP"; command = "nickserv/ungroup"; }
/*
* ns_identify
@@ -464,8 +360,8 @@ module
*/
maxlogins = 10
}
command { service = "NickServ"; name = "ID"; command = "nickserv/identify"; hide = yes }
command { service = "NickServ"; name = "IDENTIFY"; command = "nickserv/identify" }
command { service = "NickServ"; name = "ID"; command = "nickserv/identify"; hide = true; }
command { service = "NickServ"; name = "IDENTIFY"; command = "nickserv/identify"; }
/*
* ns_info
@@ -476,10 +372,11 @@ command { service = "NickServ"; name = "IDENTIFY"; command = "nickserv/identify"
*
*/
module { name = "ns_info" }
command { service = "NickServ"; name = "INFO"; command = "nickserv/info" }
command { service = "NickServ"; name = "INFO"; command = "nickserv/info"; }
command { service = "NickServ"; name = "SET HIDE"; command = "nickserv/set/hide"; }
command { service = "NickServ"; name = "SASET HIDE"; command = "nickserv/saset/hide"; permission = "nickserv/saset/hide"; }
command { service = "NickServ"; name = "SET HIDE"; command = "nickserv/set/hide" }
command { service = "NickServ"; name = "SASET HIDE"; command = "nickserv/saset/hide"; permission = "nickserv/saset/hide" }
/*
* ns_list
@@ -498,9 +395,11 @@ module
*/
listmax = 50
}
command { service = "NickServ"; name = "LIST"; command = "nickserv/list" }
command { service = "NickServ"; name = "SET PRIVATE"; command = "nickserv/set/private" }
command { service = "NickServ"; name = "SASET PRIVATE"; command = "nickserv/saset/private"; permission = "nickserv/saset/private" }
command { service = "NickServ"; name = "LIST"; command = "nickserv/list"; }
command { service = "NickServ"; name = "SET PRIVATE"; command = "nickserv/set/private"; }
command { service = "NickServ"; name = "SASET PRIVATE"; command = "nickserv/saset/private"; permission = "nickserv/saset/private"; }
/*
* ns_logout
@@ -510,7 +409,7 @@ command { service = "NickServ"; name = "SASET PRIVATE"; command = "nickserv/sase
* Used for logging out of your account.
*/
module { name = "ns_logout" }
command { service = "NickServ"; name = "LOGOUT"; command = "nickserv/logout" }
command { service = "NickServ"; name = "LOGOUT"; command = "nickserv/logout"; }
/*
* ns_recover
@@ -531,16 +430,16 @@ module
*/
restoreonrecover = yes
}
command { service = "NickServ"; name = "RECOVER"; command = "nickserv/recover" }
command { service = "NickServ"; name = "RECOVER"; command = "nickserv/recover"; }
# For compatibility with Anope 1.8 and Atheme.
command { service = "NickServ"; name = "GHOST"; command = "nickserv/recover"; hide = yes }
command { service = "NickServ"; name = "RELEASE"; command = "nickserv/recover"; hide = yes }
command { service = "NickServ"; name = "GHOST"; command = "nickserv/recover"; hide = true; }
command { service = "NickServ"; name = "RELEASE"; command = "nickserv/recover"; hide = true; }
/*
* ns_register
*
* Provides the commands nickserv/confirm/register, nickserv/register, and nickserv/resend.
* Provides the commands nickserv/confirm, nickserv/register, and nickserv/resend.
*
* Used for registering accounts.
*/
@@ -549,15 +448,11 @@ module
name = "ns_register"
/*
* The method for confirming account registrations. Possible values are:
*
* "admin" to require confirmation by a Services Operator.
* "code" to require confirmation with a code provided via IRC.
* "disable" to disable account registration.
* "mail" to require confirmation with a code provided via email.
* "none" to automatically confirm (this is the default).
* Registration confirmation setting. Set to "none" for no registration confirmation,
* "mail" for email confirmation, and "admin" to have services operators manually confirm
* every registration. Set to "disable" to completely disable all registrations.
*/
registration = "code"
registration = "none"
/*
* The minimum length of time between consecutive uses of NickServ's RESEND command.
@@ -572,7 +467,7 @@ module
*
* This directive is optional.
*/
#nickregdelay = 1m
#nickregdelay = 30s
/*
* The length of time a user using an unconfirmed account has
@@ -580,237 +475,98 @@ module
*/
#unconfirmedexpire = 1d
}
command { service = "NickServ"; name = "CONFIRM REGISTER"; command = "nickserv/confirm/register" }
command { service = "NickServ"; name = "REGISTER"; command = "nickserv/register" }
command { service = "NickServ"; name = "RESEND"; command = "nickserv/resend" }
command { service = "NickServ"; name = "CONFIRM"; command = "nickserv/confirm"; }
command { service = "NickServ"; name = "REGISTER"; command = "nickserv/register"; }
command { service = "NickServ"; name = "RESEND"; command = "nickserv/resend"; }
/*
* ns_resetpass
*
* Provides the command nickserv/confirm/resetpass and nickserv/resetpass.
* Provides the command nickserv/resetpass.
*
* Used for resetting passwords by emailing users a temporary one.
*/
module
{
name = "ns_resetpass"
/*
* The amount of time a user has after requesting a password reset before it
* expires. Defaults to 1 day.
*/
#resetexpire = 1d
}
command { service = "NickServ"; name = "CONFIRM RESETPASS"; command = "nickserv/confirm/resetpass" }
command { service = "NickServ"; name = "RESETPASS"; command = "nickserv/resetpass" }
# For compatibility with Anope 2.0.
command { service = "NickServ"; name = "GETPASS"; command = "nickserv/resetpass"; hide = yes }
/*
* ns_sasl
*
* Provides support for authentication to services via IRCv3 SASL. This is a standardised
* alternative to ns_identify that is supported by several IRCds.
*
* You will need to configure your IRCd to use SASL. See the following links for details:
*
* InspIRCd: https://docs.inspircd.org/4/modules/sasl/
* UnrealIRCd: https://www.unrealircd.org/docs/SASL#Enabling_SASL_on_the_server
*/
module
{
name = "ns_sasl"
/*
* The nick of the client which operates as the SASL agent.
*/
#agent = "NickServ"
/*
* Sets the number of invalid SASL authentication attempts before services
* removes a partially-connected user from the network. If not defined then
* the value specified in options:badpasslimit will be used instead.
*/
#badpasslimit = 1
/*
* Sets the time after which invalid SASL authentication attempts are
* forgotten about. If a user does not fail to authenticate in this amount
* of time, the incorrect password count will reset to zero. If not defined
* then the value specified in options:badpasstimeout will be used instead.
*/
#badpasstimeout = 15m
}
/*
* ns_sasl_anonymous, ns_sasl_external, ns_sasl_plain
*
* Provides support for the following SASL mechanisms:
*
* ns_sasl_anonymous: Adds the ANONYMOUS mechanism which allows logging out of
* an account. See RFC 4505 for more details.
* ns_sasl_external: Adds the EXTERNAL mechanism which allows logging into an
account using a TLS client certificate. See RFC 4422 for
for more details.
* ns_sasl_plain: Adds the PLAIN mechanism which allows logging in to an
account using a plain text username and password. See RFC
4422 for more details.
*/
module { name = "ns_sasl_anonymous" }
module { name = "ns_sasl_external" }
module { name = "ns_sasl_plain" }
module { name = "ns_resetpass" }
command { service = "NickServ"; name = "RESETPASS"; command = "nickserv/resetpass"; }
/*
* ns_set
*
* Provides the commands:
* nickserv/set, nickserv/saset - Dummy help wrappers for the SET and SASET commands.
* nickserv/set/autoop, nickserv/saset/autoop - Determines whether or not modes are automatically set users when joining a channel.
* nickserv/set/display, nickserv/saset/display - Used for setting a users display name.
* nickserv/set/email, nickserv/saset/email - Used for setting a users email address.
* nickserv/set/keepmodes, nickserv/saset/keepmodes - Configure whether or not services should retain a user's modes across sessions.
* nickserv/set/kill, nickserv/saset/kill - Used for configuring nickname protection.
* nickserv/set/language, nickserv/saset/language - Used for configuring what language services use.
* nickserv/set/message, nickserv/saset/message - Used to configure how services send messages to you.
* nickserv/set/neverop, nickserv/saset/neverop - Used to configure whether a user can be added to access lists
* nickserv/saset/noexpire - Used for configuring noexpire, which prevents nicks from expiring.
* nickserv/set/password, nickserv/saset/password - Used for changing a users password.
*/
module { name = "ns_set" }
command { service = "NickServ"; name = "SET"; command = "nickserv/set" }
command { service = "NickServ"; name = "SASET"; command = "nickserv/saset"; permission = "nickserv/saset/"; group = "nickserv/admin" }
command { service = "NickServ"; name = "SET PASSWORD"; command = "nickserv/set/password" }
command { service = "NickServ"; name = "SASET PASSWORD"; command = "nickserv/saset/password"; permission = "nickserv/saset/password" }
command { service = "NickServ"; name = "SASET NOEXPIRE"; command = "nickserv/saset/noexpire"; permission = "nickserv/saset/noexpire" }
/*
* ns_set_keepmodes
*
* Provides the command nickserv/set/keepmodes and nickserv/saset/keepmodes.
*
* Allows configuring services to keep user modes across logins.
*/
module
{
name = "ns_set_keepmodes"
name = "ns_set"
/*
* Anope will try to not restore user modes that aren't settable by users. However, if
* you have modes that you don't want to be automatically restored you can list them
* here.
* Allow the use of the IMMED option in the NickServ SET KILL command.
*
* This directive is optional.
*/
#norestore = "ABCabc"
#allowkillimmed = yes
}
command { service = "NickServ"; name = "SET KEEPMODES"; command = "nickserv/set/keepmodes" }
command { service = "NickServ"; name = "SASET KEEPMODES"; command = "nickserv/saset/keepmodes"; permission = "nickserv/saset/keepmodes" }
/*
* ns_set_language
*
* Provides the command nickserv/set/language and nickserv/saset/language.
*
* Allows configuring the language that services uses.
*/
module { name = "ns_set_language" }
command { service = "NickServ"; name = "SET LANGUAGE"; command = "nickserv/set/language" }
command { service = "NickServ"; name = "SASET LANGUAGE"; command = "nickserv/saset/language"; permission = "nickserv/saset/language" }
command { service = "NickServ"; name = "SET"; command = "nickserv/set"; }
command { service = "NickServ"; name = "SASET"; command = "nickserv/saset"; permission = "nickserv/saset/"; group = "nickserv/admin"; }
/*
* ns_set_layout
*
* Provides the command nickserv/set/layout and nickserv/saset/layout.
*
* Allows configuring the layout that services uses.
*/
module { name = "ns_set_layout" }
command { service = "NickServ"; name = "SET LAYOUT"; command = "nickserv/set/layout" }
command { service = "NickServ"; name = "SASET LAYOUT"; command = "nickserv/saset/layout"; permission = "nickserv/saset/layout" }
command { service = "NickServ"; name = "SET AUTOOP"; command = "nickserv/set/autoop"; }
command { service = "NickServ"; name = "SASET AUTOOP"; command = "nickserv/saset/autoop"; permission = "nickserv/saset/autoop"; }
command { service = "NickServ"; name = "SET DISPLAY"; command = "nickserv/set/display"; }
command { service = "NickServ"; name = "SASET DISPLAY"; command = "nickserv/saset/display"; permission = "nickserv/saset/display"; }
command { service = "NickServ"; name = "SET EMAIL"; command = "nickserv/set/email"; }
command { service = "NickServ"; name = "SASET EMAIL"; command = "nickserv/saset/email"; permission = "nickserv/saset/email"; }
command { service = "NickServ"; name = "SET KEEPMODES"; command = "nickserv/set/keepmodes"; }
command { service = "NickServ"; name = "SASET KEEPMODES"; command = "nickserv/saset/keepmodes"; permission = "nickserv/saset/keepmodes"; }
command { service = "NickServ"; name = "SET KILL"; command = "nickserv/set/kill"; }
command { service = "NickServ"; name = "SASET KILL"; command = "nickserv/saset/kill"; permission = "nickserv/saset/kill"; }
command { service = "NickServ"; name = "SET LANGUAGE"; command = "nickserv/set/language"; }
command { service = "NickServ"; name = "SASET LANGUAGE"; command = "nickserv/saset/language"; permission = "nickserv/saset/language"; }
command { service = "NickServ"; name = "SET MESSAGE"; command = "nickserv/set/message"; }
command { service = "NickServ"; name = "SASET MESSAGE"; command = "nickserv/saset/message"; permission = "nickserv/saset/message"; }
command { service = "NickServ"; name = "SET PASSWORD"; command = "nickserv/set/password"; }
command { service = "NickServ"; name = "SASET PASSWORD"; command = "nickserv/saset/password"; permission = "nickserv/saset/password"; }
command { service = "NickServ"; name = "SET NEVEROP"; command = "nickserv/set/neverop"; }
command { service = "NickServ"; name = "SASET NEVEROP"; command = "nickserv/saset/neverop"; permission = "nickserv/saset/neverop"; }
command { service = "NickServ"; name = "SASET NOEXPIRE"; command = "nickserv/saset/noexpire"; permission = "nickserv/saset/noexpire"; }
/*
* ns_set_message
*
* Provides the commands nickserv/set/message and nickserv/saset/message.
*
* Allows users to let services send them PRIVMSGs instead of NOTICEs.
*
* This might cause problems with badly written clients as the IRC RFC
* requires that automatic responses to a PRIVMSG use a NOTICE to avoid
* message loops. Only enable this if you are sure this can not happen.
*/
#module { name = "ns_set_message" }
#command { service = "NickServ"; name = "SET MESSAGE"; command = "nickserv/set/message" }
#command { service = "NickServ"; name = "SASET MESSAGE"; command = "nickserv/saset/message"; permission = "nickserv/saset/message" }
/*
* ns_set_misc
*
* Provides the command nickserv/set/misc.
*
* Allows you to create arbitrary commands to set data, and have that data show
* up in nickserv/info. You can configure this using the following fields:
*
* misc_description: A description of the command to show in the help.
* misc_title: A human-readable description of the stored data.
* misc_priority: Positive integer representing display order in nickserv/info
* and (if enabled) WHOIS output. Entries with unspecified
* priority will be prioritized in the order of declaration.
* misc_pattern: If defined then a regex pattern (using the engine specified
* in <options:regexengine> to validate the data with).
* misc_syntax: If defined then the syntax to show in the help output and, if
* misc_pattern is defined, when a user specifies an invalid
* value.
* misc_swhois: Whether to also show the data in the WHOIS output of logged
* in users. Requires that your IRCd supports multiple swhois
entries.
* Allows you to create arbitrary commands to set data, and have that data show up in nickserv/info.
* A field named misc_description may be given for use with help output.
*/
module { name = "ns_set_misc" }
command { service = "NickServ"; name = "SET URL"; command = "nickserv/set/misc"; misc_description = _("Associate a URL with your account"); misc_pattern = "^https?:\/\/\S+$"; misc_swhois = yes }
command { service = "NickServ"; name = "SASET URL"; command = "nickserv/saset/misc"; misc_description = _("Associate a URL with this account"); permission = "nickserv/saset/url"; group = "nickserv/admin" }
#command { service = "NickServ"; name = "SET MASTODON"; command = "nickserv/set/misc"; misc_description = _("Associate a Mastodon account with your account"); misc_pattern = "^@\S+@\S+\.\S+$"; misc_title = _("Mastodon") }
#command { service = "NickServ"; name = "SASET MASTODON"; command = "nickserv/saset/misc"; misc_description = _("Associate a Mastodon account with this account"); permission = "nickserv/saset/mastodon"; group = "nickserv/admin" }
#command { service = "NickServ"; name = "SET LOCATION"; command = "nickserv/set/misc"; misc_description = _("Associate a location with your account"); misc_title = _("Location") }
#command { service = "NickServ"; name = "SASET LOCATION"; command = "nickserv/saset/misc"; misc_description = _("Associate a location with this account"); permission = "nickserv/saset/location"; group = "nickserv/admin" }
/*
* ns_set_op
*
* Provides the commands:
* nickserv/set/autoop, nickserv/saset/autoop - Allows configuring whether status modes are automatically granted when joining a channel.
* nickserv/set/neverop, nickserv/saset/neverop - Allows configuring whether a user can be added to access lists.
*/
module { name = "ns_set_op" }
command { service = "NickServ"; name = "SET AUTOOP"; command = "nickserv/set/autoop" }
command { service = "NickServ"; name = "SASET AUTOOP"; command = "nickserv/saset/autoop"; permission = "nickserv/saset/autoop" }
command { service = "NickServ"; name = "SET NEVEROP"; command = "nickserv/set/neverop" }
command { service = "NickServ"; name = "SASET NEVEROP"; command = "nickserv/saset/neverop"; permission = "nickserv/saset/neverop" }
# For compatibility with DALnet Services.
command { service = "NickServ"; name = "SET NOOP"; command = "nickserv/set/neverop"; hide = yes }
command { service = "NickServ"; name = "SASET NOOP"; command = "nickserv/saset/neverop"; permission = "nickserv/saset/neverop"; hide = yes }
/*
* ns_set_protect
*
* Provides the commands nickserv/set/protect and nickserv/saset/protect.
*
* Used for configuring nickname protection.
*/
module { name = "ns_set_protect" }
command { service = "NickServ"; name = "SET PROTECT"; command = "nickserv/set/protect" }
command { service = "NickServ"; name = "SASET PROTECT"; command = "nickserv/saset/protect"; permission = "nickserv/saset/protect" }
# For compatibility with Anope 2.0.
command { service = "NickServ"; name = "SET KILL"; command = "nickserv/set/protect"; hide = yes }
command { service = "NickServ"; name = "SASET KILL"; command = "nickserv/saset/protect"; permission = "nickserv/saset/protect"; hide = yes }
/*
* ns_set_timezone
*
* Provides the command nickserv/set/timezone and nickserv/saset/timezone.
*
* Allows configuring the timezone that services uses.
*/
module { name = "ns_set_timezone" }
command { service = "NickServ"; name = "SET TIMEZONE"; command = "nickserv/set/timezone" }
command { service = "NickServ"; name = "SASET TIMEZONE"; command = "nickserv/saset/timezone"; permission = "nickserv/saset/timezone" }
command { service = "NickServ"; name = "SET URL"; command = "nickserv/set/misc"; misc_description = _("Associate a URL with your account"); }
command { service = "NickServ"; name = "SASET URL"; command = "nickserv/saset/misc"; misc_description = _("Associate a URL with this account"); permission = "nickserv/saset/url"; group = "nickserv/admin"; }
#command { service = "NickServ"; name = "SET DISCORD"; command = "nickserv/set/misc"; misc_description = _("Associate a Discord account with your account"); }
#command { service = "NickServ"; name = "SASET DISCORD"; command = "nickserv/saset/misc"; misc_description = _("Associate a Discord account with this account"); permission = "nickserv/saset/discord"; group = "nickserv/admin"; }
#command { service = "NickServ"; name = "SET FACEBOOK"; command = "nickserv/set/misc"; misc_description = _("Associate a Facebook URL with your account"); }
#command { service = "NickServ"; name = "SASET FACEBOOK"; command = "nickserv/saset/misc"; misc_description = _("Associate a Facebook URL with this account"); permission = "nickserv/saset/facebook"; group = "nickserv/admin"; }
#command { service = "NickServ"; name = "SET MASTODON"; command = "nickserv/set/misc"; misc_description = _("Associate a Mastodon account with your account"); }
#command { service = "NickServ"; name = "SASET MASTODON"; command = "nickserv/saset/misc"; misc_description = _("Associate a Mastodon account with this account"); permission = "nickserv/saset/mastodon"; group = "nickserv/admin"; }
/*
* ns_suspend
@@ -837,15 +593,38 @@ module
*/
show = "suspended, by, reason, on, expires"
}
command { service = "NickServ"; name = "SUSPEND"; command = "nickserv/suspend"; permission = "nickserv/suspend"; group = "nickserv/admin" }
command { service = "NickServ"; name = "UNSUSPEND"; command = "nickserv/unsuspend"; permission = "nickserv/suspend"; group = "nickserv/admin" }
command { service = "NickServ"; name = "SUSPEND"; command = "nickserv/suspend"; permission = "nickserv/suspend"; group = "nickserv/admin"; }
command { service = "NickServ"; name = "UNSUSPEND"; command = "nickserv/unsuspend"; permission = "nickserv/suspend"; group = "nickserv/admin"; }
/*
* ns_update
*
* Provides the command nickserv/update.
*
* Used to update your status on all channels, turn on your vhost, etc.
* Used to update your status on all channels, turn on your vHost, etc.
*/
module { name = "ns_update" }
command { service = "NickServ"; name = "UPDATE"; command = "nickserv/update" }
command { service = "NickServ"; name = "UPDATE"; command = "nickserv/update"; }
/*
* Extra NickServ related modules.
*/
/*
* ns_maxemail
*
* Limits how many times the same email address may be used in Anope
* to register accounts.
*/
#module
{
name = "ns_maxemail"
/*
* The limit to how many registered nicks can use the same e-mail address. If set to 0 or left
* commented, there will be no limit enforced when registering new accounts or using
* /msg NickServ SET EMAIL.
*/
maxemails = 1
}
+54 -109
View File
@@ -21,12 +21,12 @@ service
/*
* The hostname of the OperServ client.
*/
host = "${services.host}"
host = "services.host"
/*
* The realname of the OperServ client.
*/
real = "Operator Service"
gecos = "Operator Service"
/*
* The modes this client should use.
@@ -49,17 +49,6 @@ service
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
*/
#channels = "@#services,#mychan"
/*
* The server alias that can be used to securely message this service. If
* your IRC server does not have an alias for this service you can set this
* to an empty string to tell users to use /msg instead.
*
* This setting is ignored when options:servicealias is disabled.
*
* Defaults to the nick of the service if not set.
*/
#alias = "OS"
}
/*
@@ -111,7 +100,7 @@ module
killonsqline = yes
/*
* Adds the nickname of the Services Operator issuing an AKILL to the kill reason.
* Adds the nickname of the IRC Operator issuing an AKILL to the kill reason.
*
* This directive is optional.
*/
@@ -143,7 +132,7 @@ module
*/
/* Give it a help command. */
command { service = "OperServ"; name = "HELP"; command = "generic/help" }
command { service = "OperServ"; name = "HELP"; command = "generic/help"; }
/*
* os_akill
@@ -153,7 +142,7 @@ command { service = "OperServ"; name = "HELP"; command = "generic/help" }
* Used to ban users from the network.
*/
module { name = "os_akill" }
command { service = "OperServ"; name = "AKILL"; command = "operserv/akill"; permission = "operserv/akill" }
command { service = "OperServ"; name = "AKILL"; command = "operserv/akill"; permission = "operserv/akill"; }
/*
* os_chankill
@@ -163,7 +152,7 @@ command { service = "OperServ"; name = "AKILL"; command = "operserv/akill"; perm
* Used to akill users from an entire channel.
*/
module { name = "os_chankill" }
command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"; permission = "operserv/chankill" }
command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"; permission = "operserv/chankill"; }
/*
* os_defcon
@@ -271,7 +260,7 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
*/
#akillreason = "This network is currently not accepting connections, please try again later."
}
#command { service = "OperServ"; name = "DEFCON"; command = "operserv/defcon"; permission = "operserv/defcon" }
#command { service = "OperServ"; name = "DEFCON"; command = "operserv/defcon"; permission = "operserv/defcon"; }
/*
* os_dns
@@ -287,15 +276,15 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
* To use this module you must set a nameserver record for services
* so that DNS queries go to services.
*
* Alternatively, you may use a secondary DNS server to hide services' IP,
* Alternatively, you may use a slave DNS server to hide service's IP,
* provide query caching, and provide better fault tolerance.
*
* To do this using BIND, configure similar to:
*
* options { max-refresh-time 60 };
* options { max-refresh-time 60; };
* zone "irc.example.com" IN {
* type secondary;
* primaries { 127.0.0.1 port 5353 };
* type slave;
* masters { 127.0.0.1 port 5353; };
* };
*
* Where 127.0.0.1:5353 is the IP and port services are listening on.
@@ -332,7 +321,7 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
*/
readd_connected_servers = no
}
#command { service = "OperServ"; name = "DNS"; command = "operserv/dns"; permission = "operserv/dns" }
#command { service = "OperServ"; name = "DNS"; command = "operserv/dns"; permission = "operserv/dns"; }
/*
* os_config
@@ -342,7 +331,7 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
* Used to view and set configuration options while services are running.
*/
module { name = "os_config" }
command { service = "OperServ"; name = "CONFIG"; command = "operserv/config"; permission = "operserv/config" }
command { service = "OperServ"; name = "CONFIG"; command = "operserv/config"; permission = "operserv/config"; }
/*
* os_forbid
@@ -351,35 +340,8 @@ command { service = "OperServ"; name = "CONFIG"; command = "operserv/config"; pe
*
* Used to forbid specific nicks, channels, emails, etc. from being used.
*/
module
{
name = "os_forbid"
/*
* Allows loading forbids from a file.
*/
#file
{
/*
* The type of forbid to add. Can be set to "chan", "email", "nick",
* "password", or "register".
*/
type = "email"
/*
* The file to read forbids from. Each forbid should be placed on a new
* line. Surrounding whitespace will be ignored.
*/
file = "temp-emails.txt"
/**
* The reason why entries from this file are forbidden.
*/
reason = "Temporary email"
}
}
command { service = "OperServ"; name = "FORBID"; command = "operserv/forbid"; permission = "operserv/forbid" }
module { name = "os_forbid" }
command { service = "OperServ"; name = "FORBID"; command = "operserv/forbid"; permission = "operserv/forbid"; }
/*
* os_ignore
@@ -389,7 +351,7 @@ command { service = "OperServ"; name = "FORBID"; command = "operserv/forbid"; pe
* Used to make Anope ignore users.
*/
module { name = "os_ignore" }
command { service = "OperServ"; name = "IGNORE"; command = "operserv/ignore"; permission = "operserv/ignore" }
command { service = "OperServ"; name = "IGNORE"; command = "operserv/ignore"; permission = "operserv/ignore"; }
/*
* os_info
@@ -399,7 +361,7 @@ command { service = "OperServ"; name = "IGNORE"; command = "operserv/ignore"; pe
* Used to add oper only notes to users and channels.
*/
module { name = "os_info" }
command { service = "OperServ"; name = "INFO"; command = "operserv/info"; permission = "operserv/info" }
command { service = "OperServ"; name = "INFO"; command = "operserv/info"; permission = "operserv/info"; }
/*
* os_jupe
@@ -409,7 +371,7 @@ command { service = "OperServ"; name = "INFO"; command = "operserv/info"; permis
* Used to disconnect servers from the network and prevent them from relinking.
*/
module { name = "os_jupe" }
command { service = "OperServ"; name = "JUPE"; command = "operserv/jupe"; permission = "operserv/jupe" }
command { service = "OperServ"; name = "JUPE"; command = "operserv/jupe"; permission = "operserv/jupe"; }
/*
* os_kick
@@ -419,7 +381,7 @@ command { service = "OperServ"; name = "JUPE"; command = "operserv/jupe"; permis
* Used to kick users from channels.
*/
module { name = "os_kick" }
command { service = "OperServ"; name = "KICK"; command = "operserv/kick"; permission = "operserv/kick" }
command { service = "OperServ"; name = "KICK"; command = "operserv/kick"; permission = "operserv/kick"; }
/*
* os_kill
@@ -429,7 +391,7 @@ command { service = "OperServ"; name = "KICK"; command = "operserv/kick"; permis
* Used to forcibly disconnect users from the network.
*/
module { name = "os_kill" }
command { service = "OperServ"; name = "KILL"; command = "operserv/kill"; permission = "operserv/kill" }
command { service = "OperServ"; name = "KILL"; command = "operserv/kill"; permission = "operserv/kill"; }
/*
* os_list
@@ -439,8 +401,8 @@ command { service = "OperServ"; name = "KILL"; command = "operserv/kill"; permis
* Used to list and search the channels and users currently on the network.
*/
module { name = "os_list" }
command { service = "OperServ"; name = "CHANLIST"; command = "operserv/chanlist"; permission = "operserv/chanlist" }
command { service = "OperServ"; name = "USERLIST"; command = "operserv/userlist"; permission = "operserv/userlist" }
command { service = "OperServ"; name = "CHANLIST"; command = "operserv/chanlist"; permission = "operserv/chanlist"; }
command { service = "OperServ"; name = "USERLIST"; command = "operserv/userlist"; permission = "operserv/userlist"; }
/*
* os_login
@@ -450,8 +412,8 @@ command { service = "OperServ"; name = "USERLIST"; command = "operserv/userlist"
* Used to login to OperServ, only required if your oper block requires this.
*/
module { name = "os_login" }
command { service = "OperServ"; name = "LOGIN"; command = "operserv/login" }
command { service = "OperServ"; name = "LOGOUT"; command = "operserv/logout" }
command { service = "OperServ"; name = "LOGIN"; command = "operserv/login"; }
command { service = "OperServ"; name = "LOGOUT"; command = "operserv/logout"; }
/*
* os_logsearch
@@ -469,7 +431,7 @@ module
*/
logname = "services.log"
}
command { service = "OperServ"; name = "LOGSEARCH"; command = "operserv/logsearch"; permission = "operserv/logsearch" }
command { service = "OperServ"; name = "LOGSEARCH"; command = "operserv/logsearch"; permission = "operserv/logsearch"; }
/*
* os_mode
@@ -479,8 +441,8 @@ command { service = "OperServ"; name = "LOGSEARCH"; command = "operserv/logsearc
* Used to change user and channel modes.
*/
module { name = "os_mode" }
command { service = "OperServ"; name = "UMODE"; command = "operserv/umode"; permission = "operserv/umode" }
command { service = "OperServ"; name = "MODE"; command = "operserv/mode"; permission = "operserv/mode" }
command { service = "OperServ"; name = "UMODE"; command = "operserv/umode"; permission = "operserv/umode"; }
command { service = "OperServ"; name = "MODE"; command = "operserv/mode"; permission = "operserv/mode"; }
/*
* os_modinfo
@@ -490,8 +452,8 @@ command { service = "OperServ"; name = "MODE"; command = "operserv/mode"; permis
* Used to show information about loaded modules.
*/
module { name = "os_modinfo" }
command { service = "OperServ"; name = "MODINFO"; command = "operserv/modinfo"; permission = "operserv/modinfo" }
command { service = "OperServ"; name = "MODLIST"; command = "operserv/modlist"; permission = "operserv/modinfo" }
command { service = "OperServ"; name = "MODINFO"; command = "operserv/modinfo"; permission = "operserv/modinfo"; }
command { service = "OperServ"; name = "MODLIST"; command = "operserv/modlist"; permission = "operserv/modinfo"; }
/*
* os_module
@@ -501,9 +463,9 @@ command { service = "OperServ"; name = "MODLIST"; command = "operserv/modlist";
* Used to load, reload, and unload modules.
*/
module { name = "os_module" }
command { service = "OperServ"; name = "MODLOAD"; command = "operserv/modload"; permission = "operserv/modload" }
command { service = "OperServ"; name = "MODRELOAD"; command = "operserv/modreload"; permission = "operserv/modload" }
command { service = "OperServ"; name = "MODUNLOAD"; command = "operserv/modunload"; permission = "operserv/modload" }
command { service = "OperServ"; name = "MODLOAD"; command = "operserv/modload"; permission = "operserv/modload"; }
command { service = "OperServ"; name = "MODRELOAD"; command = "operserv/modreload"; permission = "operserv/modload"; }
command { service = "OperServ"; name = "MODUNLOAD"; command = "operserv/modunload"; permission = "operserv/modload"; }
/*
* os_news
@@ -529,17 +491,10 @@ module
* This directive is optional, if not set it will default to 3.
*/
#newscount = 3
/*
* Whether to show the datetime at which the news entry was added.
*
* This directive is optional, if not set it will default to yes.
*/
#showdate = yes
}
command { service = "OperServ"; name = "LOGONNEWS"; command = "operserv/logonnews"; permission = "operserv/news" }
command { service = "OperServ"; name = "OPERNEWS"; command = "operserv/opernews"; permission = "operserv/news" }
command { service = "OperServ"; name = "RANDOMNEWS"; command = "operserv/randomnews"; permission = "operserv/news" }
command { service = "OperServ"; name = "LOGONNEWS"; command = "operserv/logonnews"; permission = "operserv/news"; }
command { service = "OperServ"; name = "OPERNEWS"; command = "operserv/opernews"; permission = "operserv/news"; }
command { service = "OperServ"; name = "RANDOMNEWS"; command = "operserv/randomnews"; permission = "operserv/news"; }
/*
* os_noop
@@ -548,8 +503,8 @@ command { service = "OperServ"; name = "RANDOMNEWS"; command = "operserv/randomn
*
* Used to NOOP a server, which prevents users from opering on that server.
*/
#module { name = "os_noop" }
command { service = "OperServ"; name = "NOOP"; command = "operserv/noop"; permission = "operserv/noop" }
module { name = "os_noop" }
command { service = "OperServ"; name = "NOOP"; command = "operserv/noop"; permission = "operserv/noop"; }
/*
* os_oper
@@ -559,7 +514,7 @@ command { service = "OperServ"; name = "NOOP"; command = "operserv/noop"; permis
* Used to configure opers and show information about opertypes.
*/
module { name = "os_oper" }
command { service = "OperServ"; name = "OPER"; command = "operserv/oper"; permission = "operserv/oper" }
command { service = "OperServ"; name = "OPER"; command = "operserv/oper"; permission = "operserv/oper"; }
/*
* os_reload
@@ -569,7 +524,7 @@ command { service = "OperServ"; name = "OPER"; command = "operserv/oper"; permis
* Used to reload the anope.conf configuration file.
*/
module { name = "os_reload" }
command { service = "OperServ"; name = "RELOAD"; command = "operserv/reload"; permission = "operserv/reload" }
command { service = "OperServ"; name = "RELOAD"; command = "operserv/reload"; permission = "operserv/reload"; }
/*
* os_session
@@ -614,7 +569,7 @@ module
*
* This directive is optional, if not set, nothing will be sent.
*/
sessionlimitexceeded = "The session limit for your IP {ip} has been exceeded."
sessionlimitexceeded = "The session limit for your IP %IP% has been exceeded."
/*
* Same as above, but should be used to provide a website address where users can find out more
@@ -652,8 +607,8 @@ module
session_ipv4_cidr = 32
session_ipv6_cidr = 128
}
command { service = "OperServ"; name = "EXCEPTION"; command = "operserv/exception"; permission = "operserv/exception" }
command { service = "OperServ"; name = "SESSION"; command = "operserv/session"; permission = "operserv/session" }
command { service = "OperServ"; name = "EXCEPTION"; command = "operserv/exception"; permission = "operserv/exception"; }
command { service = "OperServ"; name = "SESSION"; command = "operserv/session"; permission = "operserv/session"; }
/*
* os_set
@@ -674,7 +629,7 @@ module
*/
#superadmin = yes
}
command { service = "OperServ"; name = "SET"; command = "operserv/set"; permission = "operserv/set" }
command { service = "OperServ"; name = "SET"; command = "operserv/set"; permission = "operserv/set"; }
/*
* os_shutdown
@@ -683,20 +638,10 @@ command { service = "OperServ"; name = "SET"; command = "operserv/set"; permissi
*
* Used to quit, restart, or shutdown services.
*/
module
{
name = "os_shutdown"
/*
* If enabled then server operators will be required to provide the network
* name to confirm that they are quitting, restarting, or shutting down the
* right server.
*/
requirename = yes
}
#command { service = "OperServ"; name = "QUIT"; command = "operserv/quit"; permission = "operserv/quit" }
command { service = "OperServ"; name = "RESTART"; command = "operserv/restart"; permission = "operserv/restart" }
command { service = "OperServ"; name = "SHUTDOWN"; command = "operserv/shutdown"; permission = "operserv/shutdown" }
module { name = "os_shutdown" }
command { service = "OperServ"; name = "QUIT"; command = "operserv/quit"; permission = "operserv/quit"; }
command { service = "OperServ"; name = "RESTART"; command = "operserv/restart"; permission = "operserv/restart"; }
command { service = "OperServ"; name = "SHUTDOWN"; command = "operserv/shutdown"; permission = "operserv/shutdown"; }
/*
* os_stats
@@ -706,7 +651,7 @@ command { service = "OperServ"; name = "SHUTDOWN"; command = "operserv/shutdown"
* Used to show statistics about services.
*/
module { name = "os_stats" }
command { service = "OperServ"; name = "STATS"; command = "operserv/stats"; permission = "operserv/stats" }
command { service = "OperServ"; name = "STATS"; command = "operserv/stats"; permission = "operserv/stats"; }
/*
* os_svs
@@ -716,9 +661,9 @@ command { service = "OperServ"; name = "STATS"; command = "operserv/stats"; perm
* Used to force users to change nicks, join and part channels.
*/
module { name = "os_svs" }
command { service = "OperServ"; name = "SVSNICK"; command = "operserv/svsnick"; permission = "operserv/svs" }
command { service = "OperServ"; name = "SVSJOIN"; command = "operserv/svsjoin"; permission = "operserv/svs" }
command { service = "OperServ"; name = "SVSPART"; command = "operserv/svspart"; permission = "operserv/svs" }
command { service = "OperServ"; name = "SVSNICK"; command = "operserv/svsnick"; permission = "operserv/svs"; }
command { service = "OperServ"; name = "SVSJOIN"; command = "operserv/svsjoin"; permission = "operserv/svs"; }
command { service = "OperServ"; name = "SVSPART"; command = "operserv/svspart"; permission = "operserv/svs"; }
/*
* os_sxline
@@ -728,8 +673,8 @@ command { service = "OperServ"; name = "SVSPART"; command = "operserv/svspart";
* Used to ban real names, nick names, and possibly channels.
*/
module { name = "os_sxline" }
command { service = "OperServ"; name = "SNLINE"; command = "operserv/snline"; permission = "operserv/snline" }
command { service = "OperServ"; name = "SQLINE"; command = "operserv/sqline"; permission = "operserv/sqline" }
command { service = "OperServ"; name = "SNLINE"; command = "operserv/snline"; permission = "operserv/snline"; }
command { service = "OperServ"; name = "SQLINE"; command = "operserv/sqline"; permission = "operserv/sqline"; }
/*
* os_update
@@ -739,4 +684,4 @@ command { service = "OperServ"; name = "SQLINE"; command = "operserv/sqline"; pe
* Use to immediately update the databases.
*/
module { name = "os_update" }
command { service = "OperServ"; name = "UPDATE"; command = "operserv/update"; permission = "operserv/update" }
command { service = "OperServ"; name = "UPDATE"; command = "operserv/update"; permission = "operserv/update"; }
+518
View File
@@ -0,0 +1,518 @@
/*
* Example configuration file for Anope. After making the appropriate
* changes to this file, place it in the Anope conf directory (as
* specified in the "Config" script, default /home/username/anope/conf)
* under the name "anope.conf".
*
* The format of this file is fairly simple: three types of comments are supported:
* - All text after a '#' on a line is ignored, as in shell scripting
* - All text after '//' on a line is ignored, as in C++
* - A block of text like this one is ignored, as in C
*
* Outside of comments, there are three structures: blocks, keys, and values.
*
* A block is a named container, which contains a number of key to value pairs
* - you may think of this as an array.
*
* A block is created like so:
* foobar
* {
* moo = "cow"
* foo = bar
* }
*
* Note that nameless blocks are allowed and are often used with comments to allow
* easily commenting an entire block, for example:
* #foobar
* {
* moo = "cow"
* foo = bar
* }
* is an entirely commented block.
*
* Keys are case insensitive. Values depend on what key - generally, information is
* given in the key comment. The quoting of values (and most other syntax) is quite
* flexible, however, please do not forget to quote your strings:
*
* "This is a parameter string with spaces in it"
*
* If you need to include a double quote inside a quoted string, precede it
* by a backslash:
*
* "This string has \"double quotes\" in it"
*
* Time parameters can be specified either as an integer representing a
* number of seconds (e.g. "3600" = 1 hour), or as an integer with a unit
* specifier: "s" = seconds, "m" = minutes, "h" = hours, "d" = days.
* Combinations (such as "1h30m") are not permitted. Examples (all of which
* represent the same length of time, one day):
*
* "86400", "86400s", "1440m", "24h", "1d"
*
* In the documentation for each directive, one of the following will be
* included to indicate whether an option is required:
*
* [REQUIRED]
* Indicates a directive which must be given. Without it, Anope will
* not start.
*
* [RECOMMENDED]
* Indicates a directive which may be omitted, but omitting it may cause
* undesirable side effects.
*
* [OPTIONAL]
* Indicates a directive which is optional. If not given, the feature
* will typically be disabled. If this is not the case, more
* information will be given in the documentation.
*
* [DISCOURAGED]
* Indicates a directive which may cause undesirable side effects if
* specified.
*
* [DEPRECATED]
* Indicates a directive which will disappear in a future version of
* Anope, usually because its functionality has been either
* superseded by that of other directives or incorporated into the main
* program.
*/
/*
* [OPTIONAL] Defines
*
* You can define values to other values, which can be used to easily change
* many values in the configuration at once.
*/
/*
* The stats.host define is used in multiple different locations throughout the
* configuration for the stats client hostname.
*/
define
{
name = "stats.host"
value = "stats.example.com"
}
/*
* [OPTIONAL] Additional Includes
*
* You can include additional configuration files here.
* You may also include executable files, which will be executed and
* the output from it will be included into your configuration.
*/
#include
{
type = "file"
name = "some.conf"
}
#include
{
type = "executable"
name = "/usr/bin/wget -q -O - https://some.misconfigured.network.com/stats.conf"
}
/*
* [REQUIRED] IRCd Config
*
* This section is used to set up Anope to connect to your IRC network.
* This section can be included multiple times, and Anope will attempt to
* connect to each server until it finally connects.
*
* Each uplink IRCd should have a corresponding configuration to allow Anope
* to link to it.
*
* An example configuration for InspIRCd that is compatible with the below uplink
* and serverinfo configuration would look like:
*
* # This goes in inspircd.conf, *NOT* your Anope config!
* <link name="stats.example.com"
* ipaddr="127.0.0.1"
* port="7000"
* sendpass="mypassword"
* recvpass="mypassword">
* <uline server="stats.example.com" silent="yes">
* <bind address="127.0.0.1" port="7000" type="servers">
*
* An example configuration for UnrealIRCd that is compatible with the below uplink
* and serverinfo configuration would look like:
*
* // This goes in unrealircd.conf, *NOT* your Anope config!
* listen {
* ip 127.0.0.1;
* port 7000;
* options {
* serversonly;
* };
* };
* link stats.example.com {
* incoming {
* mask *@127.0.0.1;
* };
* password "mypassword";
* class servers;
* };
* ulines { stats.example.com; };
*/
uplink
{
/*
* The IP address, hostname, or UNIX socket path of the IRC server you wish
* to connect Anope to.
* Usually, you will want to connect over 127.0.0.1 (aka localhost).
*
* NOTE: On some shell providers, this will not be an option.
*/
host = "127.0.0.1"
/*
* The protocol that Anope should use when connecting to the uplink. Can
* be set to "ipv4" (the default), "ipv6", or "unix".
*/
protocol = "ipv4"
/*
* Enable if Anope should connect using SSL.
* You must have an SSL module loaded for this to work.
*/
ssl = no
/*
* The port to connect to.
* The IRCd *MUST* be configured to listen on this port, and to accept
* server connections.
*
* Refer to your IRCd documentation for how this is to be done.
*/
port = 7000
/*
* The password to send to the IRC server for authentication.
* This must match the link block on your IRCd.
*
* Refer to your IRCd documentation for more information on link blocks.
*/
password = "mypassword"
}
/*
* [REQUIRED] Server Information
*
* This section contains information about the services server.
*/
serverinfo
{
/*
* The hostname that Anope will be seen as, it must have no conflicts with any
* other server names on the rest of your IRC network. Note that it does not have
* to be an existing hostname, just one that isn't on your network already.
*/
name = "stats.example.com"
/*
* The text which should appear as the server's information in /WHOIS and similar
* queries.
*/
description = "Anope IRC Statistics"
/*
* The local address that Anope will bind to before connecting to the remote
* server. This may be useful for multihomed hosts. If omitted, Anope will let
* the Operating System choose the local address. This directive is optional.
*
* If you don't know what this means or don't need to use it, just leave this
* directive commented out.
*/
#localhost = "nowhere."
/*
* What Server ID to use for this connection?
* Note: This should *ONLY* be used for TS6/P10 IRCds. Refer to your IRCd documentation
* to see if this is needed.
*/
#id = "00A"
/*
* The filename containing the Anope process ID. The path is relative to the
* services root directory.
*/
pid = "data/anope.pid"
/*
* The filename containing the Message of the Day. The path is relative to the
* services root directory.
*/
motd = "conf/motd.txt"
}
/*
* [REQUIRED] Protocol module
*
* This directive tells Anope which IRCd Protocol to speak when connecting.
* You MUST modify this to match the IRCd you run.
*
* Supported:
* - bahamut
* - hybrid
* - inspircd
* - ngircd
* - plexus
* - ratbox
* - solanum
* - unrealircd
*/
module
{
name = "inspircd"
}
/*
* [REQUIRED] Network Information
*
* This section contains information about the IRC network that Anope will be
* connecting to.
*/
networkinfo
{
/*
* This is the name of the network that Anope will be running on.
*/
networkname = "LocalNet"
/*
* Set this to the maximum allowed nick length on your network.
* Be sure to set this correctly, as setting this wrong can result in
* Anope being disconnected from the network. Defaults to 31.
*/
#nicklen = 31
/* Set this to the maximum allowed ident length on your network.
* Be sure to set this correctly, as setting this wrong can result in
* Anope being disconnected from the network. Defaults to 10.
*/
#userlen = 10
/* Set this to the maximum allowed hostname length on your network.
* Be sure to set this correctly, as setting this wrong can result in
* Anope being disconnected from the network. Defaults to 64.
*/
#hostlen = 64
/* Set this to the maximum allowed channel length on your network.
* Defaults to 64.
*/
#chanlen = 32
/* The maximum number of list modes settable on a channel (such as b, e, I).
* Comment out or set to 0 to disable.
*/
modelistsize = 100
/*
* The characters allowed in hostnames. This is used for validating hostnames given
* to services, such as BotServ bot hostnames and user vhosts. Changing this is not
* recommended unless you know for sure your IRCd supports whatever characters you are
* wanting to use. Telling services to set a vHost containing characters your IRCd
* disallows could potentially break the IRCd and/or Anope.
*
* It is recommended you DON'T change this.
*/
vhost_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-"
/*
* If set to true, allows vHosts to not contain dots (.).
* Newer IRCds generally do not have a problem with this, but the same warning as
* vhost_chars applies.
*
* It is recommended you DON'T change this.
*/
allow_undotted_vhosts = false
/*
* The characters that are not allowed to be at the very beginning or very ending
* of a vHost. The same warning as vhost_chars applies.
*
* It is recommended you DON'T change this.
*/
disallow_start_or_end = ".-"
}
/*
* [REQUIRED] Anope Options
*
* This section contains various options which determine how Anope will operate.
*/
options
{
/*
* On Linux/UNIX systems Anope can setuid and setgid to this user and group
* after starting up. This is useful if Anope has to bind to privileged ports.
*/
#user = "anope"
#group = "anope"
/*
* The case mapping used by services. This must be set to a valid locale name
* installed on your machine. Anope uses this case map to compare, with
* case insensitivity, things such as nick names, channel names, etc.
*
* We provide two special casemaps shipped with Anope, ascii and rfc1459.
*
* This value should be set to what your IRCd uses, which is probably rfc1459,
* however Anope has always used ascii for comparison, so the default is ascii.
*
* Changing this value once set is not recommended.
*/
casemap = "ascii"
/*
* Sets the timeout period for reading from the uplink.
*/
readtimeout = 5s
/*
* Sets the interval between sending warning messages for program errors via
* WALLOPS/GLOBOPS.
*/
warningtimeout = 4h
/*
* If set, Anope will only show /stats o to IRC Operators. This directive
* is optional.
*/
#hidestatso = yes
/*
* A space-separated list of U-lined servers on your network, it is assumed that
* the servers in this list are allowed to set channel modes and Anope will
* not attempt to reverse their mode changes.
*
* WARNING: Do NOT put your normal IRC user servers in this directive.
*
* This directive is optional.
*/
#ulineservers = "services.your.network"
/*
* How long to wait between connection retries with the uplink(s).
*/
retrywait = 60s
}
/*
* [RECOMMENDED] Logging Configuration
*
* This section is used for configuring what is logged and where it is logged to.
* You may have multiple log blocks if you wish. Remember to properly secure any
* channels you choose to have Anope log to!
*/
log
{
/*
* Target(s) to log to, which may be one of the following:
* - a channel name
* - a filename
* - globops
*/
target = "stats.log"
/* Log to both stats.log and the channel #stats
*
* Note that some older IRCds, such as Ratbox, require services to be in the
* log channel to be able to message it. To do this, configure service:channels to
* join your logging channel.
*/
#target = "stats.log #stats"
/*
* The source(s) to only accept log messages from. Leave commented to allow all sources.
* This can be a users name, a channel name, one of our clients (e.g. OperServ), or a server name.
*/
#source = ""
/*
* The bot used to log generic messages which have no predefined sender if there
* is a channel in the target directive.
*/
bot = "Global"
/*
* The number of days to keep log files, only useful if you are logging to a file.
* Set to 0 to never delete old log files.
*
* Note that Anope must run 24 hours a day for this feature to work correctly.
*/
logage = 7
/*
* What types of log messages should be logged by this block. There are nine general categories:
*
* servers - Server actions, linking, squitting, etc.
* channels - Actions in channels such as joins, parts, kicks, etc.
* users - User actions such as connecting, disconnecting, changing name, etc.
* other - All other messages without a category.
* rawio - Logs raw input and output from services
* debug - Debug messages (log files can become VERY large from this).
*
* These options determine what messages from the categories should be logged. Wildcards are accepted, and
* you can also negate values with a ~. For example, "~operserv/akill operserv/*" would log all operserv
* messages except for operserv/akill. Note that processing stops at the first matching option, which
* means "* ~operserv/*" would log everything because * matches everything.
*
* Valid server options are:
* connect, quit, sync, squit
*
* Valid channel options are:
* create, destroy, join, part, kick, leave, mode
*
* Valid user options are:
* connect, disconnect, quit, nick, ident, host, mode, maxusers, oper, away
*
* Rawio and debug are simple yes/no answers, there are no types for them.
*
* Note that modules may add their own values to these options.
*/
servers = "*"
#channels = "~mode *"
users = "connect disconnect nick"
other = "*"
rawio = no
debug = no
}
/*
* [REQUIRED] MySQL Database configuration.
*
* mysql
*
* This module allows other modules to use MySQL.
*/
module
{
name = "mysql"
mysql
{
/* The name of this service. */
name = "mysql/main"
database = "anope"
server = "127.0.0.1"
username = "anope"
password = "mypassword"
port = 3306
}
}
/*
* IRC2SQL Gateway
* This module collects data about users, channels and servers. It doesn't build stats
* itself, however, it gives you the database, it's up to you how you use it.
*
* Requires a MySQL Database and MySQL version 5.5 or higher
*/
include
{
type = "file"
name = "irc2sql.example.conf"
}
-94
View File
@@ -1,94 +0,0 @@
Since the first commit in March 2004 90 people have submitted patches, commits,
and other useful contributions to Anope. These people, ordered by the number of
contributions they have made, are:
* Adam <adam@anope.org>
* Sadie Powell <sadie@sadiepowell.dev>
* Robin Burchell <w00t@inspircd.org>
* Naram Qashat <cyberbotx@anope.org>
* Pieter Bootsma <geniusdex@anope.org>
* Jens Voss <dukepyrolator@anope.org>
* David Robson <rob@anope.org>
* Florian Schulze <certus@anope.org>
* Daniel Engel <dane@zero.org>
* Trystan S. Lee <trystan@nomadirc.net>
* Robby <robby@chatbelgie.be>
* Charles Kingsley <chaz@anope.org>
* Lee Holmes <lethality@anope.org>
* Gabriel Acevedo H. <drstein@anope.org>
* Jan Milants <viper@anope.org>
* Adam Kramer <ribosome@anope.org>
* Attila Molnar <attilamolnar@hush.com>
* Michael Wobst <wobst.michael@web.de>
* PeGaSuS <droider.pc@gmail.com>
* Matt Schatz <genius3000@g3k.solutions>
* Mark Summers <mark@goopler.net>
* Daniel Vassdal <shutter@canternet.org>
* MatthewM <mcm@they-got.us>
* Sebastian V. <hal9000@denorastats.org>
* Alvaro Toledo <atoledo@keldon.org>
* Björn Stiddien <keeper@anope.org>
* n0kS Phr33d0m <god@politeia.in>
* Hendrik Jäger <gitcommit@henk.geekmail.org>
* k4be <k4be@pirc.pl>
* Thomas Fargeix <t.fargeix@gmail.com>
* CaPa CuL <capacul@gmail.com>
* Val Lorentz <progval+git@progval.net>
* Bram Matthys <syzop@vulnscan.org>
* Federico G. Schwindt <fgsch@lodoss.net>
* Alexander Barton <alex@barton.de>
* Cronus <cronus@nite-serv.com>
* Dragone2 <dragone2@risposteinformatiche.it>
* H7-25 <simos@simosnap.org>
* Jyzee <jyzee.git@gmail.com>
* Sebastian Barfurth <github@afreshmelon.com>
* Zantox <jyoerger10@msn.com>
* Zoddo <zoddo.ino@gmail.com>
* Dominic Hargreaves <dom@earth.li>
* Michael Hazell <michaelhazell@hotmail.com>
* Robert Scheck <robert@fedoraproject.org>
* Dennis Friis <peavey@inspircd.org>
* Filippo Cortigiani <simos@simosnap.org>
* KidProtect
* Michał Zegan <webczat_200@poczta.onet.pl>
* AlphaTech <alphat3ch@icloud.com>
* Austin Ellis <siniStar@IRC4Fun.net>
* bonnedav <theD_2011@hotmail.com>
* Denis M. (Phr33d0m) <god@politeia.in>
* Harakiri <harakiri@overstack.fr>
* Marcin Łabanowski <marcin@6irc.net>
* Matt Ullman <matt@airraidsirens.com>
* Michael Stapelberg <michael@robustirc.net>
* Alexander Maassen <outsider@twingoversum.scarynet.org>
* artemiiav <artemiiav@gmail.com>
* blackbeard420 <blackbeard@blackbeard420.me>
* BoGu5 <bogus@onzin.org>
* Chris Langsenkamp <chris@langsenkamp.com>
* Clem Morton
* crazycatdevs
* Daniel Oaks <danneh@danneh.net>
* Fabio Scotoni <cculex@gmail.com>
* ItsOnlyBinary
* Jason Foster <retsofaj@gmail.com>
* Jeremy <jeremy@ssnet.ca>
* Josh Soref
* KindOne <ineedalifetoday@live.com>
* linuxdaemon
* Mantas Mikulėnas <grawity@gmail.com>
* Matthew Beeching <jobe@mdbnet.co.uk>
* Michael <michaelhazell@hotmail.com>
* Mingjie Shen <shen497@purdue.edu>
* nekoswag
* Peter Tseng <pht24@cornell.edu>
* Romain Rivière <lecoyote@lecoyote.org>
* Sam James (sam_c) <sam@cmpct.info>
* ShutterQuick <shutter@canternet.org>
* Sketch <denverfreeburn@outlook.com>
* Tim Gunter <tim@vanillaforums.com>
* Toni Kaija <diftraku@gmail.com>
* Victor Coss <gtaxl@gtaxl.net>
* VisioN <vision@myirc.us>
* westor <westor7@gmail.com>
* Wilson Birney <wpb@360scada.com>
* Yann Sionneau <yann@sionneau.net>
* Zach Bloomquist <zrbq@live.com>
-351
View File
@@ -1,351 +0,0 @@
# Anope Change Log
## Anope 2.1.25 (unreleased)
### Changes
* Fixed a crash when a temporary ban expires.
* Fixed a potential crash caused by unusual timestamps being passed to `Anope::strftime`.
* Fixed confirming accounts when `{ns_register}:registration` is set to "admin".
* Fixed migrating access entries from xop to flags granting new privileges in cases where multiple privileges share the same flag.
* Fixed migrating access entries sometimes giving the wrong flags.
* Fixed not being able to update the description of a flags access entry.
## Anope 2.1.24 (2026-04-01)
### Breaking Changes
* If a database contains duplicate corrupt entries from a prior write failure the oldest ones will now be purged from the database. This is a destructive action so make sure you take a manual backup of your database before upgrading.
* Removed support for storing the Anope database in Redis. The Redis code was extremely bitrotted, had not been tested in years, and to our knowledge has almost no (if any) users. It is recommended that db_redis users migrate to db_json or db_sql.
* SQL tables now use versioned prefixes by default. For the SQL database backends the default is `anope21_` and for ChanStats the default is `chanstats21_`. If you do not have a prefix explicitly set in your config you will need to add one it. Alternatively, you may also want to consider exporting to db_json and re-importing to update your SQL schema for the recent database layout changes.
### Changes
* Added some helper methods to `CommandSource` to allow quickly translting messages.
* Changed the Config script to allow multiple dashes in front of options, i.e. `-quick` and `--quick` are now equivalent.
* Converted some language strings to use format strings instead of concatenation.
* Fixed a rare crash in the ns_cert module.
* Fixed building Anope as a unity build.
* Fixed the ns_cert module erasing certificate entries if using an old database.
* Fixed users having the wrong real name in log messages on InspIRCd if it has been previously changed with `CHGNAME` or `SETNAME`.
## Anope 2.1.23 (2026-04-01)
### Changes
* Added examples to several BotServ commands.
* Added missing fields to the `RPL_STATSLINKINFO` output.
* Added support for migrating access entries between systems (currently only `chanserv/flags` is supported).
* Added the default levels to the `chanserv/levels` DESC help.
* Changed access listing commands to only show their own access entries unless `ALL` is specified.
* Fixed a non-translatable string which has been marked as translatable.
* Fixed the missing AUTOLOGIN extension.
* Fixed translating the help output when the flexible layout is used.
* Improved the accuracy of the X-line expiry time in `operserv/stats`.
* Updated the Portuguese translation.
* Updated the Romanian translation.
## Anope 2.1.22 (2026-03-01)
### Breaking Changes
* Automatic login using a known SSL fingerprint now requires the `AUTOLOGIN` option to be set on accounts with `/NS SET AUTOLOGIN ON`. Automatic login is largely obsolete now SASL EXTERNAL exists and is widely supported.
* Conan 2 is now used for packaging dependencies on Windows. If you are building from source you will need to upgrade Conan.
* Non-breaking spaces in translatable messages now use 0x1B instead of 0x1A due to recent msgfmt releases treating 0x1A as an EOF character. If you have an out of tree translation you will need to update it.
* User TLS certificates are now stored in their own `NSCert` table instead of as a column in the `NickCore` table. If you are reading this information you will need to update your code.
### Changes
* Fixed `{botserv}:botmodes` erroneously allowing setting non-status modes on channels.
* Fixed echoing message tags on Solanum.
* Fixed handling incoming `FIDENT` messages on InspIRCd.
* Fixed matching stacked extended bans on InspIRCd and UnrealIRCd.
* Fixed parameter modes in `chanserv/mode` locks erroneously requiring a parameter to unset a lock.
* Fixed restoring the object identifier when unserialising objects in db_json.
* Fixed the consistency of indenting and line wrapping command examples in help output.
* Redesigned the output of `nickserv/list` to show more relevant information.
```
/NICKSERV LIST *
-NickServ- List of entries matching *:
-NickServ- alice (account: alice)
-NickServ- alice|work (account: alice)
-NickServ- bob -- Unconfirmed (account: bob)
-NickServ- mallory -- Suspended (account: mallory)
-NickServ- End of list - 4/4 matches shown.
```
* The cs_set_misc and ns_set_misc modules now can use a separate title from the command name.
```
/NICKSERV SET MASTODON @example@mastodon.social
-NickServ- Mastodon for testuser set to @example@mastodon.social
```
* The cs_set_misc and ns_set_misc modules now support validation of user-specified data.
```
/NICKSERV SET MASTODON example.mastodon.social
-NickServ- Mastodon syntax is invalid.
-NickServ- Syntax: SET MASTODON [@user@host.tld]
```
* The db_atheme module can now import arbitrary metadata to fields from the ns_set_misc module.
* The local clock will now be checked for synchronisation with the IRCd clock on UnrealIRCd.
* The `nickserv/cert` command will now show the time a TLS certificate was created and the nickname of the creator if the `VIEW` subcommand is used.
```
/NICKSERV CERT VIEW
-NickServ- d41d8cd98f00b204e9800998ecf8427e -- created by nick1 at Wed 25 Feb 00:18:50 GMT
```
* The ns_set_misc module can now add account data to the WHOIS output of authenticated users on InspIRCd (with the swhois_ext module) and UnrealIRCd.
```
/WHOIS nick1
* [nick1] (nick1@example.com): nick1
* [nick1] Mastodon: @example@mastodon.social
* [nick1] irc.example.com :Example-IRC server
...
* [nick1] End of WHOIS list.
```
* The regex_posix module is now available on Windows (using the PCRE2 POSIX compatibility layer).
* The regex_tre module is now available on Windows.
* The Windows dependencies have been updated.
## Anope 2.1.21 (2026-02-07)
### Breaking Changes
* `{fantasy}:fantasycharacter` has been replaced with `{fantasy}:prefix` which allows multiple-character fantasy prefixes. If you have multiple custom fantasy characters set you should separate them with a space when upgrading your config.
* The db_json module will now terminate the process if it fails to write the database. This replicates the behaviour previously used by the db_flatfile module.
* When adding an unregistered user to an access list you must now explicitly specify their hostmask. This prevents accidentally adding a hostmask which is too wide.
### Changes
* Added cleaning up of hostmasks when adding them to an access list and `{chanserv}:disallow_malformed_hostmask` to allow rejecting them instead.
* Changed access commands to add the account of a user who is logged in to an account but not using a nickname belonging to that account.
* Fixed a crash when clearing channel entry messages.
* Fixed a memory leak when cloning akicks.
* Fixed cleaning up ban masks.
* Fixed confirming accounts using the webcpanel.
* Fixed importing the time a nickname was used from Atheme.
* Fixed limiting the number of accounts per email address.
* Fixed locking modes that take a parameter when they are added.
* Fixed the `chanserv/enforce` command erroneously enforcing against channel founders.
* Fixed the syntax of the `chanserv/suspend` command.
* Fixed the syntax of the `nickserv/suspend` command.
* Improved password rehash detection in the enc_argon2 module.
* Various minor improvements to how services work internally.
## Anope 2.1.20 (2025-12-01)
### Breaking Changes
* Changed the registration of database types added by modules to be delayed until after the module constructor has been called. This might affect any custom modules you are using.
* Moved akicks out of the core into cs_akick. Modules which depend on akicks now require the cs_akick module to be loaded.
### Changes
* Added `{db_json}:preserve_unknown_data` to configure whether unknown database types are kept in the JSON database. By default unknown database types from unloaded modules will be preserved in the database to allow reloading later. This setting can be used to disable this and prune the database.
* Added support for forbidding passwords. This is intended to be used with file forbids (see below).
```
/OPERSERV FORBID ADD PASSWORD +30d hunter2 This password is insecure
-OperServ- Added a forbid on hunter2 of type password to expire on Mon 29 Dec 2025 11:51:13 AM UTC (30 days from now).
```
* Added support for loading forbids from a file.
```cpp
file
{
type = "email"
file = "temp-emails.txt"
reason = "Temporary email"
}
```
* Added support for the UnrealIRCd `+F` flood profile mode.
* Added the `anope-mkpasswd` script to help generate passwords for use in the config.
```
$ ./anope-mkpasswd argon2id hunter2
For use in the database:
argon2id:$argon2id$v=19$m=65536,t=3,p=4$AmGWdtn1OUT9WSKSqESsPw$iguvHs6oIi/hF7e3t/bGNwgqP41vl/J4qP3a/yH9SLo
For use in an oper:
password = "$argon2id$v=19$m=65536,t=3,p=4$AmGWdtn1OUT9WSKSqESsPw$iguvHs6oIi/hF7e3t/bGNwgqP41vl/J4qP3a/yH9SLo"
password_hash = "argon2id"
For use in an jsonrpc/xmlrpc token:
token = "$argon2id$v=19$m=65536,t=3,p=4$AmGWdtn1OUT9WSKSqESsPw$iguvHs6oIi/hF7e3t/bGNwgqP41vl/J4qP3a/yH9SLo"
token_hash = "argon2id"
Make sure you have the enc_argon2 module loaded!
```
* Added the DISPLAY flag to `nickserv/list` to only show account display nicknames.
```
/NICKSERV LIST *
-NickServ- List of entries matching *:
-NickServ- nick1 (last mask: foo@example.com)
-NickServ- nick1|afk (last mask: bar@example.com)
-NickServ- nick2 (last mask: baz@example.com)
-NickServ- End of list - 3/3 matches shown.
/NICKSERV LIST * DISPLAY
-NickServ- List of entries matching *:
-NickServ- nick1 (last mask: foo@example.com)
-NickServ- nick2 (last mask: baz@example.com)
-NickServ- End of list - 2/2 matches shown.
```
* Added the hs_offer module which allows offering templated vhosts to users (based on a
modsite module by @genius3000 on GitHub).
```
/HOSTSERV OFFER ADD {account}.users.example.com
/HOSTSERV OFFERLIST
-HostServ- Current host offer list:
-HostServ- 2: {account}.users.example.com / FooBar.users.example.com -- does not expire
-HostServ- End of host offer list.
```
* Changed chanserv/mode lock messages to stack the responses into one message per type instead of sending one message per mode.
```
/CHANSERV MODE #stest LOCK ADD +bb foo!foo@foo bar!bar@bar
-ChanServ- +bb foo!foo@foo bar!bar@bar has been locked on #stest.
```
* Changed database objects to rehook to their type when it becomes available again.
* Changed the `nickserv/set/language` and `nickserv/set/timezone` commands to allow setting back to the default value by omitting the last parameter.
```
/NICKSERV SET LANGUAGE
12:23 -NickServ- Language changed to English.
/NICKSERV SET TIMEZONE
12:24 -NickServ- Timezone changed to UTC.
```
* Changed the default install directory from `~/anope` to `~/anope-2.1`.
* Changed the enc_sha1 module to use a vendored SHA-1 implementation.
* Expanded password obscurity checks and added an event hook to allow modules to reject passwords.
* Fixed the rpc_user module sending the "invalid account" and "invalid password" error codes inverted.
* Fixed unintentionally reloading the core database when reloading a module that provides a database type.
* Removed a bunch of obsolete build system cruft.
## Anope 2.1.19 (2025-11-01)
### Breaking Changes
* `pkg-config` is now required to find dependencies for the following modules on UNIX systems:
- enc_argon2
- ldap
- mysql
- regex_pcre2
- regex_tre
* Support for InspIRCd v3 has been dropped ahead of it going EOL in two months. Please migrate to InspIRCd v4 to keep using Anope 2.1 with InspIRCd.
### Changes
* Added a Romanian translation (contributed by @KidProtect on GitHub).
* Added support for associating a timezone with an account to allow users to receive timestamps in their local timezone.
```
/NICKSERV SET TIMEZONE Europe/London
-NickServ- Timezone changed to Europe/Berlin.
/NICKSERV INFO test
-NickServ- Account registered: Thu 09 Oct 2025 15:22:45 CEST (45 seconds ago)
```
NOTE: This requires a compiler with C++20 timezone support.
* Added support for IRCv3 message tags when using Solanum git.
* Added support for language-specific time formats.
```
/NICKSERV SET LANGUAGE tr_TR.UTF-8
-NickServ- Dil Türkçe olarak değiştirildi.
/NICKSERV INFO test
-NickServ- Hesap kaydedildi: Prş 09 Eki 2025 15:22:45 (6 dakika, 16 saniye önce)
```
* Channel entry messages are now tagged with an IRCv3 time tag for the time they were created on supporting IRCds. This defaults to on but can be disabled using `{cs_entrymsg}:timestamp`.
* Reordered the information in the `nickserv/info` command output to show the registration dates before the seen information.
* Updated the Turkish translation (contributed by @CaPaCuL on GitHub).
* Updated the vendored libraries.
+5 -1
View File
@@ -3,7 +3,11 @@ if(WIN32)
# Only install given files from this directory
# NOTE: I would've had this just find all files in the directory, but that would include files not needed (like this file)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/README ${CMAKE_CURRENT_BINARY_DIR}/README.txt)
set(DOCS CHANGES.md DEFCON FAQ INSTALL LANGUAGE MODULES ${CMAKE_CURRENT_BINARY_DIR}/README.txt WIN32.md)
if(IN_SOURCE)
# Add README.txt to list of files for CPack to ignore
add_to_cpack_ignored_files("README.txt$" TRUE)
endif()
set(DOCS Changes Changes.conf DEFCON FAQ INSTALL LANGUAGE MODULES ${CMAKE_CURRENT_BINARY_DIR}/README.txt WIN32.txt)
install(FILES ${DOCS}
DESTINATION ${DOC_DIR}
)
+347
View File
@@ -0,0 +1,347 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the entire
whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years,
to give any third party, for a charge no more than your cost of
physically performing source distribution, a complete machine-readable
copy of the corresponding source code, to be distributed under the terms
of Sections 1 and 2 above on a medium customarily used for software
interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is allowed
only for noncommercial distribution and only if you received the program
in object code or executable form with such an offer, in accord with
Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent license
would not permit royalty-free redistribution of the Program by all those
who receive copies directly or indirectly through you, then the only way
you could satisfy both it and this License would be to refrain entirely
from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is implemented
by public license practices. Many people have made generous contributions
to the wide range of software distributed through that system in reliance
on consistent application of that system; it is up to the author/donor to
decide if he or she is willing to distribute software through any other
system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be
a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make
it free software which everyone can redistribute and change under
these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and an idea of what it does.>
Copyright (C) yyyy name of author
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
type `show w'. This is free software, and you are welcome
to redistribute it under certain conditions; type `show c'
for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
+51
View File
@@ -0,0 +1,51 @@
Anope Version 2.1.3
-------------------
Added alternate command suggestions when a user runs an invalid command.
Added support for the IRCv3 +draft/channel-context tag.
Added support for the IRCv3 +draft/reply tag.
Allow using more than one fingerprint in an oper block.
Changed chanserv/drop to use confirmation codes to confirm a channel drop.
Cleaned up more of the codebase to use Modern C++17.
Enabled using more field limits sent by the IRC server instead of requiring the user to configure them.
Fixed NickServ lying about the minimum password length.
Fixed a crash when sending emails.
Fixed bs_kick not using the correct kick message for automatic kicks.
Increased the security of randomly generated confirmation codes.
Removed the ns_access module and associated cs_secure and ns_secure options.
Removed the ns_status module.
Reworked how messages are sent in protocol modules to allow sending message tags.
Anope Version 2.1.2
-------------------
Bumped the minimum OpenSSL version to 1.1.0.
Bumped the minumum GnuTLS version to 3.0.0.
Disabled SSLv3 support in the m_ssl_openssl module.
Modernized mutex and thread code to use Modern C++.
Normalised the program exit codes.
Updated the Dutch translation.
Updated the French translation.
Anope Version 2.1.1
-------------------
Added the UNBANME privilege to allow users to unban themselves.
Fixed building on Windows systems without chgrp/chmod.
Fixed creating sockets in the m_dns, m_httpd, m_proxyscan, and m_redis modules.
Fixed reading the values of command line arguments.
Moved core privilege descriptions to the example configs.
Updated the Italian translation.
Updated the Polish translation.
Anope Version 2.1.0
-------------------
Added support for access list entry descriptions.
Added support for linking over a UNIX socket.
Added support for server-initiated logins and logouts on UnrealIRCd.
Added support for server-initiated logouts on InspIRCd.
Added support for the ANONYMOUS SASL mechanism.
Allowed users to opt-out of being added to channel access lists.
Cleaned up the codebase to use Modern C++17.
Modernized the build system to use a modern version of CMake.
Removed support for using insecure encryption methods as the primary method.
Removed the Windows-only anopesmtp tool.
Removed the two day X-line cap.
Updated all references to IRCServices to refer to Anope instead.
+46
View File
@@ -0,0 +1,46 @@
Anope Version 2.1.3
-------------------
Added options:didyoumeandifference.
Added support for multiple SSL fingerprints in oper:certfp.
Added the chanserv/cert oper privilege for modifying other user's certificate lists.
Changed networkinfo:chanlen to default to 32 if not set.
Changed networkinfo:hostlen to default to 64 if not set.
Changed networkinfo:modelistsize to default to 100 if not set.
Changed networkinfo:nicklen to default to 31 if not set.
Changed networkinfo:userlen to default to 10 if not set.
Increased the default maximum password length to 50 characters.
Increased the default minimum password length to 10 characters.
Removed the cs_secure option in module:defaults from the chanserv module (now always enabled).
Removed the nickserv/saset/secure command.
Removed the nickserv/saset/secure oper privilege.
Removed the nickserv/set/secure command.
Removed the nickserv/status command.
Removed the ns_access module.
Removed the ns_secure option in module:defaults from the nickserv module (now always enabled).
Anope Version 2.1.2
-------------------
Added module:tlsv10 to the ssl_openssl module for configuring whether TLSv1.0 is usable (defaults to no).
Added module:tlsv11 to the ssl_openssl module for configuring whether TLSv1.1 is usable (defaults to yes).
Added module:tlsv12 to the ssl_openssl module for configuring whether TLSv1.2 is usable (defaults to yes).
Removed module:sslv3 from the ssl_openssl module (now always disabled).
Removed the m_ prefix from the names of the chanstats, dns, dnsbl, helpchan, httpd, ldap, ldap_oper, mysql, proxyscan, redis, regex_pcre2, regex_posix, regex_stdlib, regex_tre, rewrite, sasl, sql_log, sql_oper, sqlite, ssl_gnutls, ssl_openssl, xmlrpc, and xmlrpc_main modules.
Anope Version 2.1.1
-------------------
Added the m_regex_stdlib module.
Removed the m_regex_pcre module (use m_regex_pcre2 instead).
Anope Version 2.1.0
-------------------
Added nickserv:minpasslen for configuring the minimum password length (defaults to 8).
Removed nickserv:strictpasswords as it is obsolete now nickserv:minpasslen exists.
Removed the inspircd12 and inspircd20 modules (use inspircd instead).
Removed the ns_getpass module (no supported encryption modules).
Removed the os_oline module (no supported IRCds).
Removed the unreal module (use unrealircd instead).
Renamed nickserv:passlen to nickserv:maxpasslen.
Renamed the charybdis module to solanum.
Renamed the inspircd3 module to inspircd.
Renamed the unreal4 module to unrealircd.
Replaced uplink:ipv6 with uplink:protocol.
+1 -1
View File
@@ -90,4 +90,4 @@ Anope DefCon
6) Support
You might get DefCon support by posting on our online forum, or maybe on
our #anope channel at /server irc.teranova.net.
our #anope channel at /server irc.anope.org.
-313
View File
@@ -1,313 +0,0 @@
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "Anope"
PROJECT_NUMBER = 2.0
PROJECT_BRIEF =
PROJECT_LOGO =
PROJECT_ICON = src/win32/anope-icon.ico
OUTPUT_DIRECTORY = docs/doxygen
CREATE_SUBDIRS = NO
CREATE_SUBDIRS_LEVEL = 8
ALLOW_UNICODE_NAMES = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
"The $name file" \
is \
provides \
specifies \
contains \
represents \
a \
an \
the
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
JAVADOC_BANNER = NO
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
PYTHON_DOCSTRING = YES
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 4
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
OPTIMIZE_OUTPUT_SLICE = NO
EXTENSION_MAPPING =
MARKDOWN_SUPPORT = YES
TOC_INCLUDE_HEADINGS = 5
MARKDOWN_ID_STYLE = GITHUB
AUTOLINK_SUPPORT = YES
AUTOLINK_IGNORE_WORDS =
BUILTIN_STL_SUPPORT = YES
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
GROUP_NESTED_COMPOUNDS = NO
SUBGROUPING = YES
INLINE_GROUPED_CLASSES = NO
INLINE_SIMPLE_STRUCTS = NO
TYPEDEF_HIDES_STRUCT = NO
LOOKUP_CACHE_SIZE = 0
NUM_PROC_THREADS = 0
TIMESTAMP = NO
EXTRACT_ALL = YES
EXTRACT_PRIVATE = NO
EXTRACT_PRIV_VIRTUAL = NO
EXTRACT_PACKAGE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = NO
EXTRACT_LOCAL_METHODS = NO
EXTRACT_ANON_NSPACES = NO
RESOLVE_UNNAMED_PARAMS = YES
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_UNDOC_NAMESPACES = YES
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = SYSTEM
HIDE_SCOPE_NAMES = NO
HIDE_COMPOUND_REFERENCE= NO
SHOW_HEADERFILE = YES
SHOW_INCLUDE_FILES = YES
SHOW_GROUPED_MEMB_INC = NO
FORCE_LOCAL_INCLUDES = NO
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_MEMBERS_CTORS_1ST = NO
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
STRICT_PROTO_MATCHING = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
LAYOUT_FILE =
CITE_BIB_FILES =
EXTERNAL_TOOL_PATH =
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = NO
WARN_IF_DOC_ERROR = YES
WARN_IF_INCOMPLETE_DOC = YES
WARN_NO_PARAMDOC = NO
WARN_IF_UNDOC_ENUM_VAL = NO
WARN_LAYOUT_FILE = YES
WARN_AS_ERROR = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LINE_FORMAT = "at line $line of file $file"
WARN_LOGFILE =
INPUT = README.md \
include
INPUT_ENCODING = UTF-8
INPUT_FILE_ENCODING =
FILE_PATTERNS =
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = YES
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
FILTER_SOURCE_PATTERNS =
USE_MDFILE_AS_MAINPAGE = README.md
IMPLICIT_DIR_DOCS = YES
FORTRAN_COMMENT_AFTER = 72
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = NO
REFERENCES_RELATION = NO
REFERENCES_LINK_SOURCE = YES
SOURCE_TOOLTIPS = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
ALPHABETICAL_INDEX = YES
IGNORE_PREFIX =
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_EXTRA_STYLESHEET =
HTML_EXTRA_FILES =
HTML_COLORSTYLE = AUTO_LIGHT
HTML_COLORSTYLE_HUE = 220
HTML_COLORSTYLE_SAT = 100
HTML_COLORSTYLE_GAMMA = 80
HTML_DYNAMIC_MENUS = YES
HTML_DYNAMIC_SECTIONS = NO
HTML_CODE_FOLDING = YES
HTML_COPY_CLIPBOARD = YES
HTML_PROJECT_COOKIE =
HTML_INDEX_NUM_ENTRIES = 100
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated documentation"
DOCSET_FEEDURL =
DOCSET_BUNDLE_ID = org.doxygen.Project
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
DOCSET_PUBLISHER_NAME = Publisher
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
SITEMAP_URL =
GENERATE_QHP = NO
QCH_FILE =
QHP_NAMESPACE = org.doxygen.Project
QHP_VIRTUAL_FOLDER = doc
QHP_CUST_FILTER_NAME =
QHP_CUST_FILTER_ATTRS =
QHP_SECT_FILTER_ATTRS =
QHG_LOCATION =
GENERATE_ECLIPSEHELP = NO
ECLIPSE_DOC_ID = org.doxygen.Project
DISABLE_INDEX = NO
GENERATE_TREEVIEW = NO
FULL_SIDEBAR = NO
ENUM_VALUES_PER_LINE = 4
SHOW_ENUM_VALUES = NO
TREEVIEW_WIDTH = 250
EXT_LINKS_IN_WINDOW = NO
OBFUSCATE_EMAILS = YES
HTML_FORMULA_FORMAT = png
FORMULA_FONTSIZE = 10
FORMULA_MACROFILE =
USE_MATHJAX = NO
MATHJAX_VERSION = MathJax_2
MATHJAX_FORMAT = HTML-CSS
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
MATHJAX_EXTENSIONS =
MATHJAX_CODEFILE =
SEARCHENGINE = YES
SERVER_BASED_SEARCH = NO
EXTERNAL_SEARCH = NO
SEARCHENGINE_URL =
SEARCHDATA_FILE = searchdata.xml
EXTERNAL_SEARCH_ID =
EXTRA_SEARCH_MAPPINGS =
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME =
MAKEINDEX_CMD_NAME = makeindex
LATEX_MAKEINDEX_CMD = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4
EXTRA_PACKAGES =
LATEX_HEADER =
LATEX_FOOTER =
LATEX_EXTRA_STYLESHEET =
LATEX_EXTRA_FILES =
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
LATEX_BIB_STYLE = plainnat
LATEX_EMOJI_DIRECTORY =
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
RTF_EXTRA_FILES =
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_SUBDIR =
MAN_LINKS = NO
GENERATE_XML = NO
XML_OUTPUT = xml
XML_PROGRAMLISTING = YES
XML_NS_MEMB_FILE_SCOPE = NO
GENERATE_DOCBOOK = NO
DOCBOOK_OUTPUT = docbook
GENERATE_AUTOGEN_DEF = NO
GENERATE_SQLITE3 = NO
SQLITE3_OUTPUT = sqlite3
SQLITE3_RECREATE_DB = YES
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = CoreExport=/**/ \
ATTR_NOT_NULL(...)=/**/
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
EXTERNAL_PAGES = YES
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
DOT_NUM_THREADS = 0
DOT_COMMON_ATTR = "fontname=Helvetica,fontsize=10"
DOT_EDGE_ATTR = "labelfontname=Helvetica,labelfontsize=10"
DOT_NODE_ATTR = "shape=box,height=0.2,width=0.4"
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
UML_LIMIT_NUM_FIELDS = 10
DOT_UML_DETAILS = NO
DOT_WRAP_THRESHOLD = 17
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DIR_GRAPH_MAX_DEPTH = 1
DOT_IMAGE_FORMAT = png
INTERACTIVE_SVG = NO
DOT_PATH =
DOTFILE_DIRS =
DIA_PATH =
DIAFILE_DIRS =
PLANTUML_JAR_PATH =
PLANTUML_CFG_FILE =
PLANTUML_INCLUDE_PATH =
PLANTUMLFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
MSCGEN_TOOL =
MSCFILE_DIRS =
+6 -6
View File
@@ -27,7 +27,7 @@ Note: You should also read the README and FAQ files!
cmake --version
If it's installed, you will get a line that says something similar to
"cmake version 3.28.3". If the version is less than 3.20.0 or you get
"cmake version 2.8.12.2". If the version is less than 2.4 or you get
an error saying the command was not found, you will not be able to use
CMake unless you install it yourself into your home directory. CMake
can be downloaded from:
@@ -60,7 +60,7 @@ Note: You should also read the README and FAQ files!
most likely not work!
If you need help, you should visit https://forum.anope.org/ or #anope on
irc.teranova.net. Provide *complete* error output, along with other relevant
irc.anope.org. Provide *complete* error output, along with other relevant
information eg. OS, compiler and C++ library versions.
See the README file for more information.
@@ -111,17 +111,17 @@ Note: You should also read the README and FAQ files!
A crontab entry will allow you to check periodically whether Anope is
still running, and restart it if not.
First rename the cron.example.sh script that is in Anope path (by default,
this is ~/anope/conf) to cron.sh and edit it. You'll need to
First rename the example.chk script that is in Anope path (by default,
this is ~/anope/conf) to anope.chk and edit it. You'll need to
modify the CONFIGURATION part of the file. Then ensure that the file is
marked as executable by typing chmod +x cron.sh, and try to launch the
marked as executable by typing chmod +x anope.chk, and try to launch the
script to see if it works (Anope must not be running when you do this ;))
When this is done, you'll have to add the crontab entry. Type crontab -e.
This will open the default text editor with the crontab file. Enter the
following (with correct path):
*/5 * * * * /home/ircd/anope/conf/cron.sh >/dev/null 2>&1
*/5 * * * * /home/ircd/anope/conf/anope.chk >/dev/null 2>&1
The */5 at the beginning means "check every 5 minutes". You may replace
the 5 with other another number if you want (but less than 60). Consult
+6 -6
View File
@@ -27,7 +27,7 @@ Note : Vous devrez également lire les fichiers README et FAQ !
cmake --version
Si CMake est installé, vous aurez une ligne qui dit quelque chose comme
"cmake version 3.28.3". Si la version est inférieure à 3.20.0 ou si vous
"cmake version 2.8.12.2". Si la version est inférieure à 2.4 ou si vous
obtenez une erreur disant que la commande n'a pas été trouvée, vous ne
pourrez pas utiliser CMake à moins de l'installer vous-même dans votre
répertoire home. CMake peut être téléchargé ici :
@@ -64,7 +64,7 @@ Note : Vous devrez également lire les fichiers README et FAQ !
recommandée, et Anope ne fonctionnera probablement pas !
Si vous avez besoin d'aide, vous pouvez aller sur le site
https://forum.anope.org/ ou le canal #anope sur irc.teranova.net.
https://forum.anope.org/ ou le canal #anope sur irc.anope.org.
Fournissez *l'essemble* des erreurs qui apparaîssent, en plus de
toutes informations utiles, comme les versions de votre OS, du
compilateur utilisé et de la librairie C++. Lisez le fichier README
@@ -121,11 +121,11 @@ Note : Vous devrez également lire les fichiers README et FAQ !
Une entrée crontab vous permettra de vérifier périodiquement si Anope
est toujours en cours d'exécution et de le redémarrer s'il n'est pas.
D'abord renommez le script cron.example.sh qui est dans les dossiers
d'Anope (par défaut, ~/anope/conf) en cron.sh et modifiez-le.
D'abord renommez le script example.chk qui est dans les dossiers
d'Anope (par défaut, ~/anope/conf) en anope.chk et modifiez-le.
Vous aurez besoin de modifier la partie CONFIGURATION du fichier.
Assurez-vous ensuite que le fichier est marqué comme exécutable en
tapant chmod +x cron.sh et essayez de lancer le script pour voir
tapant chmod +x anope.chk et essayez de lancer le script pour voir
si cela fonctionne (Anope ne doit pas être en marche lorsque vous
testez cela ;))
@@ -133,7 +133,7 @@ Note : Vous devrez également lire les fichiers README et FAQ !
crontab -e. Cela va ouvrir l'éditeur de texte par défaut avec le
fichier crontab. Entrez la ligne suivante (avec le chemin correct) :
*/5 * * * * /home/ircd/anope/conf/cron.sh > /dev/null 2>&1
*/5 * * * * /home/ircd/anope/conf/anope.chk > /dev/null 2>&1
Le */5 au début signifie "vérifier toutes les 5 minutes". Vous pouvez
remplacer le 5 par un autre numéro si vous voulez (mais moins de 60).
+11 -9
View File
@@ -10,13 +10,16 @@ Anope Multi Language Support
To build Anope with gettext support, gettext and its development libraries must be installed on the system.
On Debian-based systems install the locales-all package.
On Debian install the locales-all package.
On RHEL-based systems run `yum list glibc-langpack-*` and install the languages you want to enable.
On Ubuntu run locale-gen for each language you want to enable.
For example:
locale-gen es_ES.UTF-8
If you have already built Anope you will need to delete the build directory and rebuild from scratch.
Then execute:
dpkg-reconfigure locales
Building Anope on Windows with gettext support is explained in docs/WIN32.md
Building Anope on Windows with gettext support is explained in docs/WIN32.txt
2) Adding a new language
@@ -24,16 +27,15 @@ Anope Multi Language Support
install gettext and run `msginit -l language -o anope.language.po -i anope.pot`. For example if I was translating to
Spanish I could run `msginit -l es_ES -o anope.es_ES.po -i anope.pot`. Open the newly generating .po file and start
translating. Once you are done simply rerun ./Config; make && make install and add the language to your anope.conf.
Note that on Windows it is not quite this simple, windows.cpp must be edited and Anope recompiled and restarted.
Poedit (https://poedit.net/) is a popular po file editor, and we recommend using it or another editor designed to edit
po files (especially on Windows).
There are several control characters within the messages. These are mostly IRC formatting codes (https://modern.ircdocs.horse/formatting)
but 0x1B is special to Anope and is used to prevent the automatic linewrapper from breaking messages in the middle of
text that should not be split (e.g. commands). Your editor may not show these so be careful you don't delete them!
If you have finished a language file translation and you want others to use it, please send it to team@anope.org
(don't forget to mention clearly your (nick)name, your e-mail and the language name). You'll of course get full credit for it.
If you have finished a language file translation and you want others to use it, please file a pull request on GitHub.
You'll of course get full credit for it.
NOTE: There is no guarantee we will use your work so please do not be offended if we say no thanks.
3) Using languages with modules
-338
View File
@@ -1,338 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
<https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Moe Ghoul>, 1 April 1989
Moe Ghoul, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
+2 -2
View File
@@ -43,7 +43,7 @@ Anope Modules
MODLOAD Load a module
MODRELOAD Reload a module
MODUNLOAD Unload a module
MODUNLOAD Un-Load a module
MODLIST List loaded modules
MODINFO Info about a loaded module
@@ -111,7 +111,7 @@ Anope Modules
Use modules at your own risk, and make sure you get them from a
reputable source. You might get module support by contacting the module
author, posting on our online forum, or maybe on our #anope channel
at /server irc.teranova.net.
at /server irc.anope.org.
7) Information for Developers
+8 -7
View File
@@ -1,7 +1,7 @@
Anope -- a set of IRC services for IRC networks
-----------------------------------------------
Anope is 2003-2026 Anope Team <team@anope.org>.
Anope is 2003-2024 Anope Team <team@anope.org>.
Based on Epona 2000-2002 PegSoft <epona@pegsoft.net>.
Based on Services 1996-1999 Andrew Church <achurch@achurch.org>.
@@ -160,19 +160,20 @@ Table of Contents
they log on, to set modes and to kick users from any channel, to
send notices quickly to the entire network, and much more!
* HostServ, a neat service that allows users to show custom vhosts
* HostServ, a neat service that allows users to show custom vHosts
(virtual hosts) instead of their real IP address; this only works
on daemons supporting ip cloaking, such as UnrealIRCd.
Anope currently works with:
* InspIRCd 4 or later
* ircd-hybrid 8.2.34 or later
* ircd-ratbox 3 or later
* Bahamut 1.4.27 or later (including 1.8)
* ircd-hybrid 8.2.23 or later
* InspIRCd 3 or later
* ngIRCd 19.2 or later
* Plexus 3 or later
* Ratbox 2.0.6 or later
* Solanum (all versions)
* UnrealIRCd 6 or later
* UnrealIRCd 4 or later
Anope could also work with some of the daemons derived by the ones listed
above, but there's no support for them if they work or don't work.
@@ -244,7 +245,7 @@ Table of Contents
If you read the documentation carefully, and didn't find the answer to
your question, feel free to post on the website forums or join our irc
channel (irc.teranova.net #anope). Once you join our Support channel be as
channel (irc.anope.org #anope). Once you join our Support channel be as
precise as possible when asking a question, because we have no extraordinary
powers and can't guess things if they aren't provided.
+160
View File
@@ -0,0 +1,160 @@
Anope has Redis database support (https://redis.io/).
This document explains the data structure used by Anope, and explains how
keyspace notification works.
This is not a tutorial on how to use Redis, see https://redis.io/documentation
for that.
Table of Contents
-----------------
1) Data structure
2) Keyspace notifications
3) Examples of modifying, deleting, and creating objects
1) Data structure
There are 4 key namespaces in Anope, they are:
id - The keys in id are used to atomically create object ids for new
objects. For example, if I were to create a new BotInfo I would first:
redis 127.0.0.1:6379> INCR id:BotInfo
To get the object ID of the new object.
ids - The keys in ids contain a set of all object ids of the given type.
For example:
redis 127.0.0.1:6379> SMEMBERS ids:BotInfo
Returns "1", "2", "3", "4", "5", "6", "7", "8" because I have 8 bots that
have IDs 1, 2, 3, 4, 5, 6, 7, and 8, respectively.
hash - The keys in hash are the actual objects, stored as hashes. For
example, if I had just looked up all BotInfo ids and wanted to iterate
over all of them, I would start by:
redis 127.0.0.1:6379> HGETALL hash:BotInfo:1
Which gets all keys and values from the hash of type BotInfo with id 1.
This may return:
"nick" -> "BotServ"
"user" -> "services"
"host" -> "services.anope.org"
"created" -> "1368704765"
value - The keys in value only exist to aid looking up object IDs. They
are sets of object IDs and are used to map key+value pairs to objects.
For example:
redis 127.0.0.1:6379> SMEMBERS value:NickAlias:nick:Adam
Returns a set of object ids of NickAlias objects that have the key
'nick' set to the value 'Adam' in its hash. Clearly this can only
ever contain at most one object, since it is not possible to have
more than one registered nick with the same name, but other keys
will contain more than one, such as:
redis 127.0.0.1:6379> SMEMBERS value:NickCore:email:adam@anope.org
Which would return all accounts with the email "adam@anope.org".
redis 127.0.0.1:6379> SMEMBERS value:ChanAccess:mask:Adam
Which would return all access entries set on the account "Adam".
Behavior similar to SQL's AND, can be achieved using the
SINTER command, which does set intersection on one or more sets.
2) Keyspace notifications
Redis 2.7 (unstable) and 2.8 (stable) and newer support keyspace notifications
(https://redis.io/topics/notifications). This allows Redis to notify Anope of
any external changes to objects in the database. Once notified, Anope will
immediately update the object. Otherwise, Anope keeps all objects in memory
and will not regularly read from the database once started.
You can use this to modify objects in Redis and have them immediately reflected
back into Anope. Additionally you can use this feature to run multiple Anope
instances simultaneously from the same database (see also, Redis database
replication).
To use keyspace notifications you MUST execute
redis 127.0.0.1:6379> CONFIG SET notify-keyspace-events KA
OK
or set notify-keyspace-events in redis.conf properly. Anope always executes
CONFIG SET when it first connects.
If you do not enable keyspace events properly Anope will be UNABLE to see any
object modifications you do.
The key space ids and value are managed entirely by Anope, you do
not (and should not) modify them. Once you modify the object (hash), Anope will
update them for you to correctly reflect any changes made to the object.
Finally, always use atomic operations. If you are inserting a new object with
multiple commands, or inserting multiple objects at once, specifically if the
objects depend on each other, you MUST use a transaction.
3) Examples of modifying, deleting, and creating objects
These examples will ONLY work if you meet the criteria in section 2.
If I want to change the email account 'Adam' to 'Adam@anope.org', I would execute the following:
redis 127.0.0.1:6379> SMEMBERS value:NickCore:display:Adam
Which returns a value of "1", which is the object id I want to modify.
Now to change the email:
redis 127.0.0.1:6379> HSET hash:NickCore:1 email Adam@anope.org
You can now see this in NickServ's INFO command:
-NickServ- Email address: Adam@anope.org
If I want to drop the account "Adam", I would execute the following:
redis 127.0.0.1:6379> SMEMBERS value:NickCore:display:Adam
Which returns a value of "1". I would then check:
redis 127.0.0.1:6379> SMEMBERS value:NickAlias:nc:Adam
To see what nicknames depend on this account to exist, as I will
have to remove those too. This returns the values "2", and "3".
Finally, I can drop the nick using a transaction via:
redis 127.0.0.1:6379> MULTI
OK
redis 127.0.0.1:6379> DEL hash:NickAlias:2
QUEUED
redis 127.0.0.1:6379> DEL hash:NickAlias:3
QUEUED
redis 127.0.0.1:6379> DEL hash:NickCore:1
QUEUED
redis 127.0.0.1:6379> EXEC
Or alternatively simply:
redis 127.0.0.1:6379> DEL hash:NickAlias:2 hash:NickAlias:3 hash:NickCore:1
If I wanted to create a BotServ bot, I would execute the following:
redis 127.0.0.1:6379> INCR id:BotInfo
Which returns a new object ID for me, in this example it will be "8".
Now I can create the object:
HMSET hash:BotInfo:8 nick redis user redis host services.anope.org realname "Anope IRC Services"
Note if you are using HSET instead of HMSET you will need to use a transaction, as shown in the above example.
If you are watching your services logs you will immediately see:
USERS: redis!redis@services.anope.org (Anope IRC Services) connected to the network (services.anope.org)
And the bot redis will be in BotServ's bot list.
Notice how ids:BotInfo and the value keys are updated automatically.
-270
View File
@@ -1,270 +0,0 @@
// SPDX-License-Identifier: CC0-1.0
"use strict";
/** Implements methods for accessing an Anope JSON-RPC server. */
class AnopeRPC {
/**
* Initializes a new AnopeRPC instance with the specified RPC host.
*
* @param {string} host The RPC host base URL.
* @param {string} token The bearer token for authorizing with the RPC interface.
*/
constructor(host, token = "") {
this.host = host;
this.token = token;
}
/**
* Executes an arbitrary RPC query.
*
* @param {string} method The name of the method to execute.
* @param {...*} params The parameters pass to the method.
* @returns {*} The result of the RPC query.
*/
async run(method, ...params) {
const body = JSON.stringify({
"jsonrpc": "2.0",
"method": method,
"params": params.map((p) => p.toString()),
"id": Math.random().toString(36).slice(2)
});
const headers = new Headers();
if (this.token) {
headers.append("Authorization", `Bearer ${btoa(this.token)}`);
}
const response = await fetch(this.host, {
method: 'POST',
headers: headers,
body: body
});
if (!response.ok) {
throw new Error(`HTTP returned ${response.status}`)
}
const json = await response.json();
if ("error" in json) {
throw new Error(`JSON-RPC returned ${json.error.code}: ${json.error.message}`)
}
if ("result" in json) {
return json.result;
}
return null;
}
/**
* Retrieves a list of accounts.
*
* Requires the rpc_data module to be loaded.
*
* @param {string} detail The level of detail to request.
* @returns {(array|object)} A list of accounts.
*/
listAccounts(detail = "name") {
return this.run("anope.listAccounts", detail);
}
/**
* Retrieves information about the specified account.
*
* Requires the rpc_data module to be loaded.
*
* @param {string} name The name of the account.
* @returns {object} An object containing information about the account.
*/
account(name) {
return this.run("anope.account", name);
}
/**
* Retrieves a list of channels.
*
* Requires the rpc_data module to be loaded.
*
* @param {string} detail The level of detail to request.
* @returns {(array|object)} A list of channels.
*/
listChannels(detail = "name") {
return this.run("anope.listChannels", detail);
}
/**
* Retrieves information about the specified channel.
*
* Requires the rpc_data module to be loaded.
*
* @param {string} name The name of the channel.
* @returns {object} An object containing information about the channel.
*/
channel(name) {
return this.run("anope.channel", name);
}
/**
* Retrieves a list of services operators.
*
* Requires the rpc_data module to be loaded.
*
* @param {string} detail The level of detail to request.
* @returns {(array|object)} A list of services operators.
*/
listOpers(detail = "name") {
return this.run("anope.listOpers", detail);
}
/**
* Retrieves information about the specified services operator.
*
* Requires the rpc_data module to be loaded.
*
* @param {string} name The name of the services operator.
* @returns {object} An object containing information about the services operator.
*/
oper(name) {
return this.run("anope.oper", name);
}
/**
* Retrieves a list of servers.
*
* Requires the rpc_data module to be loaded.
*
* @param {string} detail The level of detail to request.
* @returns {(array|object)} A list of servers.
*/
listServers(detail = "name") {
return this.run("anope.listServers", detail);
}
/**
* Retrieves information about the specified server.
*
* Requires the rpc_data module to be loaded.
*
* @param {string} name The name of the server.
* @returns {object} An object containing information about the server.
*/
server(name) {
return this.run("anope.server", name);
}
/**
* Retrieves a list of users.
*
* Requires the rpc_data module to be loaded.
*
* @param {string} detail The level of detail to request.
* @returns {(array|object)} A list of users.
*/
listUsers(detail = "name") {
return this.run("anope.listUsers", detail);
}
/**
* Retrieves information about the specified user.
*
* Requires the rpc_data module to be loaded.
*
* @param {string} nick The nick of the user.
* @returns {object} An object containing information about the user.
*/
user(nick) {
return this.run("anope.user", nick);
}
/**
* Sends a message to every user on the network.
*
* Requires the rpc_message module to be loaded.
*
* @param {...*} messages One or more messages to send.
*/
messageNetwork(...messages) {
return this.run("anope.messageNetwork", ...messages);
}
/**
* Sends a message to every user on the specified server.
*
* Requires the rpc_message module to be loaded.
*
* @param {string} name The name of the server.
* @param {...*} messages One or more messages to send.
*/
messageServer(server, ...messages) {
return this.run("anope.messageServer", server, ...messages);
}
/**
* Sends a message to the specified user.
*
* Requires the rpc_message module to be loaded.
*
* @param {string} source The source pseudoclient to send the message from.
* @param {string} target The target user to send the message to.
* @param {...*} messages One or more messages to send.
*/
messageUser(source, target, ...messages) {
return this.run("anope.messageUser", source, target, ...messages);
}
/**
* Checks whether the specified credentials are valid.
*
* Requires the rpc_user module to be loaded.
*
* @param {string} account A nickname belonging to the account to check.
* @param {string} password The password for the specified account.
* @returns {object} An object containing basic information about the account.
*/
checkCredentials(account, password) {
return this.run("anope.checkCredentials", account, password);
}
/**
* Identifies an IRC user to the specified account.
*
* Requires the rpc_user module to be loaded.
*
* @param {string} account Either an account identifier or nickname belonging to the account to
* identify to.
* @param {string} password The nickname of the IRC user to identify to the account.
*/
identify(account, user) {
return this.run("anope.identify", account, user);
}
/**
* Lists all commands that exist on the network.
*
* Requires the rpc_user module to be loaded.
*
* @param {...*} services The nicknames of the services to list commands for.
* @returns {object} An object containing information about the available commands.
*/
listCommands(...services) {
return this.run("anope.listCommands", ...services);
}
/**
* Lists all commands that exist on the network.
*
* Requires the rpc_user module to be loaded.
*
* @param {string} account If non-empty then the account to execute the command as.
* @param {string} service The service which the command exists on.
* @param {...*} command The the command to execute and any parameters to pass to it.
* @returns {object} An object containing information about the available commands.
*/
command(account, service, ...command) {
return this.run("anope.command", account, service, ...command);
}
}
/*
const arpc = new AnopeRPC("http://127.0.0.1:8080/jsonrpc");
arpc.listServers("full").then(servers => {
console.log(servers);
}).catch (error => {
console.log(error);
});
*/
-242
View File
@@ -1,242 +0,0 @@
# SPDX-License-Identifier: CC0-1.0
require "base64"
require "json"
require "net/http"
# Implements methods for accessing an Anope JSON-RPC server.
class AnopeRPC
# The RPC host base URL.
attr_accessor :host
# The bearer token for authorizing with the RPC interface.
attr_accessor :token
# Initializes a new AnopeRPC instance with the specified RPC host.
#
# @param host [String] The RPC host base URL.
# @param token [String] The bearer token for authorizing with the RPC interface.
def initialize(host, token = nil)
@host = URI(host)
@token = token
end
# Executes an arbitrary RPC query.
#
# @param method [String] The name of the method to execute.
# @param params [Object] The parameters pass to the method.
# @return [Object] The result of the RPC query.
private def run(method, *params)
body = {
jsonrpc: "2.0",
method: method,
params: params.map(&:to_s),
id: rand(36**16).to_s(36)
}.to_json
headers = {}
headers["Authorization"] = "Bearer #{Base64.strict_encode64(@token)}" if @token
response = Net::HTTP.post(@host, body, headers)
raise "HTTP returned #{response.status}" unless response.is_a?(Net::HTTPSuccess)
json = JSON.parse(response.body, symbolize_names: true)
raise "JSON-RPC returned #{json[:error][:code]}: #{json[:error][:message]}" if json.key?(:error)
json.dig(:result)
end
# Retrieves a list of accounts.
#
# Requires the rpc_data module to be loaded.
#
# @param detail [Symbol] detail The level of detail to request.
# @return [Array] If the detail level is set to :name then an array of account names.
# @return [Hash] If the detail level is set to :full then a hash of information about the
# accounts.
def list_accounts(detail = :name)
self.run("anope.listAccounts", detail)
end
# Retrieves information about the specified account.
#
# Requires the rpc_data module to be loaded.
#
# @param name [String] The name of the account.
# @return [Hash] A hash containing information about the account.
def account(name)
self.run("anope.account", name)
end
# Retrieves a list of channels.
#
# Requires the rpc_data module to be loaded.
#
# @param detail [Symbol] detail The level of detail to request.
# @return [Array] If the detail level is set to :name then an array of channel names.
# @return [Hash] If the detail level is set to :full then a hash of information about the
# channels.
def list_channels(detail = :name)
self.run("anope.listChannels", detail)
end
# Retrieves information about the specified channel.
#
# Requires the rpc_data module to be loaded.
#
# @param name [String] The name of the channel.
# @return [Hash] A hash containing information about the channel.
def channel(name)
self.run("anope.channel", name)
end
# Retrieves a list of services operators.
#
# Requires the rpc_data module to be loaded.
#
# @param detail [Symbol] detail The level of detail to request.
# @return [Array] If the detail level is set to :name then an array of services operator names.
# @return [Hash] If the detail level is set to :full then a hash of information about the
# services operators.
def list_opers(detail = :name)
self.run("anope.listOpers", detail)
end
# Retrieves information about the specified services operator.
#
# Requires the rpc_data module to be loaded.
#
# @param name [String] The name of the services operator.
# @return [Hash] A hash containing information about the services operator.
def oper(name)
self.run("anope.oper", name)
end
# Retrieves a list of servers.
#
# Requires the rpc_data module to be loaded.
#
# @param detail [Symbol] detail The level of detail to request.
# @return [Array] If the detail level is set to :name then an array of server names.
# @return [Hash] If the detail level is set to :full then a hash of information about the
# servers.
def list_servers(detail = :name)
self.run("anope.listServers", detail)
end
# Retrieves information about the specified server.
#
# Requires the rpc_data module to be loaded.
#
# @param name [String] The name of the server.
# @return [Hash] A hash containing information about the server.
def server(name)
self.run("anope.server", name)
end
# Retrieves a list of users.
#
# Requires the rpc_data module to be loaded.
#
# @param detail [Symbol] detail The level of detail to request.
# @return [Array] If the detail level is set to :name then an array of user nicknames.
# @return [Hash] If the detail level is set to :full then a hash of information about the
# users.
def list_users(detail = :name)
self.run("anope.listUsers", detail)
end
# Retrieves information about the specified user.
#
# Requires the rpc_data module to be loaded.
#
# @param name [String] The name of the user.
# @return [Hash] A hash containing information about the user.
def user(name)
self.run("anope.user", name)
end
# Sends a message to every user on the network.
#
# Requires the rpc_message module to be loaded.
#
# @param messages [Array<String>] One or more messages to send.
def message_network(*messages)
self.run("anope.messageNetwork", *messages)
end
# Sends a message to every user on the specified server.
#
# Requires the rpc_message module to be loaded.
#
# @param name [String] The name of the server.
# @param messages [Array<String>] One or more messages to send.
def message_server(server, *messages)
self.run("anope.messageServer", server, *messages)
end
# Sends a message to the specified user.
#
# Requires the rpc_message module to be loaded.
#
# @param source [String] The source pseudoclient to send the message from.
# @param target [String] The target user to send the message to.
# @param messages [Array<String>] One or more messages to send.
def message_user(source, target, *messages)
self.run("anope.messageUser", source, target, *messages)
end
# Checks whether the specified credentials are valid.
#
# Requires the rpc_user module to be loaded.
#
# @param account [String] A nickname belonging to the account to check.
# @param password [String] The password for the specified account.
# @return [Hash] A hash containing basic information about the account.
def check_credentials(account, password)
self.run("anope.checkCredentials", account, password)
end
# Identifies an IRC user to the specified account.
#
# Requires the rpc_user module to be loaded.
#
# @param account [String] Either an account identifier or nickname belonging to the account to
# identify to.
# @param password [String] The nickname of the IRC user to identify to the account.
def identify(account, user)
self.run("anope.identify", account, user)
end
# Lists all commands that exist on the network.
#
# Requires the rpc_user module to be loaded.
#
# @param services [Array<String>] The nicknames of the services to list commands for.
# @return [Hash] A hash containing information about the available commands.
def list_commands(*services)
self.run("anope.listCommands", *services)
end
# Lists all commands that exist on the network.
#
# Requires the rpc_user module to be loaded.
#
# @param account [String] If non-empty then the account to execute the command as.
# @param service [String] The service which the command exists on.
# @param command [Array<String>] The the command to execute and any parameters to pass to it.
# @return [Hash] A hash containing information about the available commands.
def command(account, service, *command)
self.run("anope.command", account, service, *command)
end
end
=begin
arpc = AnopeRPC.new("http://127.0.0.1:8080/jsonrpc")
begin
pp arpc.list_servers(:full)
rescue StandardError => err
STDERR.puts err
end
=end
-463
View File
@@ -1,463 +0,0 @@
# Anope `rpc_data` RPC interface
## `anope.listAccounts`
Lists all accounts that exist on the network.
### Parameters
Index | Description
----- | -----------
0 | If specified then the level of detail to retrieve. Can be set to "full" to retrieve all information or "name" to just retrieve the account names. Defaults to "name".
### Errors
Code | Description
------ | -----------
-32099 | The specified detail level does not exist.
### Result
If the detail level is not specified or is "name" then an array of account names.
If the detail level is "full" then a mapping of account names to information about the account. See `anope.account` for more information on the data structure.
#### Example
```json
["account1", "account2", "account3"]
```
## `anope.account`
Retrieves information about the specified account.
### Parameters
Index | Description
----- | -----------
0 | Either a nickname belonging to the account or an account identifier.
### Errors
Code | Description
------ | -----------
-32099 | The specified account does not exist.
### Result
Returns a map containing information about the account.
Key | Type | Description
--- | ---- | -----------
display | string | The display nickname of the account.
email | string or null | The email address associated with the account or null if one has not been specified.
extensions | map | A key-value map of the extensions set on this account by modules.
language | string or null | The language associated with the account or null if the account uses the default language.
lastmail | int | The time at which an email was last sent for this account.
nicks | map | Information about nicknames that belong to the account keyed by the nickname.
nicks.\*.extensions | map | A key-value map of the extensions set on this nickname by modules.
nicks.\*.lastseen | int | The time at which this nickname was last used.
nicks.\*.registered | int | The time at which this nickname was registered.
nicks.\*.vhost | map or null | The vhost associated with the account or null if the user has no vhost.
nicks.\*.vhost.created | int | The time at which the vhost was created.
nicks.\*.vhost.creator | string | The nickname of the creator of the vhost.
nicks.\*.vhost.host | string | The host segment of the vhost.
nicks.\*.vhost.ident | string or null | The ident segment of the vhost or null if there is not one.
nicks.\*.vhost.mask | string | The user@host or host mask of the vhost.
opertype | map or null | The oper type associated with the account or null if they are not a services operator.
opertype.commands | array[string] | The commands that the services operator type can use.
opertype.name | string | The name of the services operator type.
opertype.privileges | array[string] | The privileges that the services operator type has.
registered | int | The time at which the account was registered.
uniqueid | uint | The unique immutable identifier of the account.
users | array[string] | The IRC users who are currently logged in to this account.
#### Example
```json
{
"display": "foo",
"email": "example@example.com",
"extensions": {
"AUTOOP": true,
"HIDE_EMAIL": true,
"HIDE_MASK": true,
"MEMO_RECEIVE": true,
"MEMO_SIGNON": true,
"NS_PRIVATE": true,
"PROTECT": true,
"PROTECT_AFTER": 69
},
"language": null,
"lastmail": 1745071858,
"nicks": {
"foo": {
"extensions": {
"NS_NO_EXPIRE": true
},
"lastseen": 1745074153,
"registered": 1745071857,
"vhost": null
},
"bar": {
"extensions": {},
"lastseen": 1745072602,
"registered": 1745071857,
"vhost": {
"created": 1745072653,
"creator": "foo",
"host": "bar.baz",
"ident": "foo",
"mask": "foo@bar.baz"
}
}
},
"opertype": {
"commands": ["hostserv/*", "operserv/session"],
"name": "Helper",
"privileges": ["chanserv/no-register-limit"]
},
"registered": 1745071857,
"uniqueid": 11085415958920757000,
"users": [
"foo"
]
}
```
## `anope.listChannels`
Lists all channels that exist on the network.
### Parameters
Index | Description
----- | -----------
0 | If specified then the level of detail to retrieve. Can be set to "full" to retrieve all information or "name" to just retrieve the channel names. Defaults to "name".
### Errors
Code | Description
------ | -----------
-32099 | The specified detail level does not exist.
### Result
If the detail level is not specified or is "name" then an array of channel names.
If the detail level is "full" then a mapping of channel names to information about the channel. See `anope.channel` for more information on the data structure.
#### Example
```json
["#chan1", "#chan2", "#chan3"]
```
## `anope.channel`
Retrieves information about the specified channel.
### Parameters
Index | Description
----- | -----------
0 | The name of the channel.
### Errors
Code | Description
------ | -----------
-32099 | The specified channel does not exist.
### Result
Returns a map containing information about the channel.
Key | Type | Description
--- | ---- | -----------
created | int | The UNIX time at which the channel was originally created.
listmodes | map | List modes which are set on the channel keyed by the mode character.
modes | array[string] | Flag and parameter modes which are set on the channel.
name | string | The name of the channel.
registered | boolean | Whether the channel is registered.
topic | map or null | The channel topic or null if no topic is set.
topic.setat | int | The time at which the topic was set.
topic.setby | string | The nick or nuh of the user who set the topic.
topic.value | string | The text of the topic.
users | array[string] | The users that are current in the channel prefixed by their status mode prefixes.
#### Example
```json
{
"created": 1740402691,
"listmodes": {
"b": ["foo!bar@baz", "account:bax"],
},
"modes": ["+knrt", "secret"],
"name": "#chan1",
"registered": true,
"topic": {
"setat": 1740404706,
"setby": "nick1",
"value": "Example channel topic"
},
"users": ["@nick1", "nick2"]
}
```
## `anope.listOpers`
Lists all services operators that exist on the network.
### Parameters
Index | Description
----- | -----------
0 | If specified then the level of detail to retrieve. Can be set to "full" to retrieve all information or "name" to just retrieve the services operator nicknames. Defaults to "name".
### Errors
Code | Description
------ | -----------
-32099 | The specified detail level does not exist.
### Result
If the detail level is not specified or is "name" then an array of services operator names.
If the detail level is "full" then a mapping of services operator names to information about the services operator. See `anope.oper` for more information on the data structure.
#### Example
```json
["nick1", "nick2", "nick3"]
```
## `anope.oper`
Retrieves information about the specified services operator.
### Parameters
Index | Description
----- | -----------
0 | The name of the services operator.
### Errors
Code | Description
------ | -----------
-32099 | The specified services operator does not exist.
### Result
Returns a map containing information about the services operator.
Key | Type | Description
--- | ---- | -----------
fingerprints | array[string] or null | The client certificate fingerprints that a user must be using to log in as this services operator or null if there are no client certificate restrictions.
hosts | array[string] or null | The user@ip and user@ip masks that a user must be connecting from to log in as this services operator or null if there are no host restrictions.
name | string | The name of the services operator.
operonly | boolean | Whether a user has to be a server operator to log in as this services operator.
opertype | map | The oper type associated with the services operator.
opertype.commands | array[string] | The commands that the services operator type can use.
opertype.name | string | The name of the services operator type.
opertype.privileges | array[string] | The privileges that the services operator type has.
password | boolean | Whether a user has to specify a password to log in as the services operator.
vhost | string or null | The vhost of the services operator or null if there is no vhost.
#### Example
```json
{
"fingerprints": null,
"hosts": ["*@*.example.com"],
"name": "stest",
"operonly": true,
"opertype": {
"commands": ["hostserv/*", "operserv/session"],
"name": "Helper",
"privileges": ["chanserv/no-register-limit"]
},
"password": false,
"vhost": null
}
```
## `anope.listServers`
Lists all servers that exist on the network.
### Parameters
Index | Description
----- | -----------
0 | If specified then the level of detail to retrieve. Can be set to "full" to retrieve all information or "name" to just retrieve the server names. Defaults to "name".
### Errors
Code | Description
------ | -----------
-32099 | The specified detail level does not exist.
### Result
If the detail level is not specified or is "name" then an array of server names.
If the detail level is "full" then a mapping of server names to information about the server. See `anope.server` for more information on the data structure.
#### Example
```json
["irc1.example.com", "irc2.example.com", "services.example.com"]
```
## `anope.server`
Retrieves information about the specified server.
### Parameters
Index | Description
----- | -----------
0 | The name of the server.
### Errors
Code | Description
------ | -----------
-32099 | The specified server does not exist.
### Result
Returns a map containing information about the server.
Key | Type | Description
--- | ---- | -----------
description | string | The description of the server.
downlinks | array[string] | The servers which are behind this server
juped | boolean | Whether the server has been juped.
name | string | The name of the server.
sid | string or null | The unique immutable identifier of the server or null if the IRCd does not use SIDs.
synced | boolean | Whether the server has finished syncing.
ulined | boolean | Whether the server is U-lined.
uplink | string or null | The server in front of this server or null if it is the services server.
#### Example
```json
{
"description": "Anope IRC Services",
"downlinks": ["irc.example.com"],
"juped": false,
"name": "services.example.com",
"sid": "00B",
"synced": true,
"ulined": true,
"uplink": null
}
```
## `anope.listUsers`
Lists all users that exist on the network.
### Parameters
Index | Description
----- | -----------
0 | If specified then the level of detail to retrieve. Can be set to "full" to retrieve all information or "name" to just retrieve the user nicknames. Defaults to "name".
### Errors
Code | Description
------ | -----------
-32099 | The specified detail level does not exist.
### Result
If the detail level is not specified or is "name" then an array of user nicknames.
If the detail level is "full" then a mapping of user nicknames to information about the user. See `anope.user` for more information on the data structure.
#### Example
```json
["nick1", "nick2", "nick3"]
```
## `anope.user`
Retrieves information about the specified user.
### Parameters
Index | Description
----- | -----------
0 | The nickname of the user.
### Errors
Code | Description
------ | -----------
-32099 | The specified user does not exist.
### Result
Returns a map containing information about the user.
Key | Type | Description
--- | ---- | -----------
account | map or null | The user's account or null if they are not logged in to an account.
account.display | string | The display nickname of the account.
account.opertype | string or null | The account's oper type or null if the account is not a services operator.
account.uniqueid | uint | The unique immutable identifier of the account.
address | string | The IP address the user is connecting from.
away | map or null | The user's away state or null if they are not away.
away.message | string | The away message specified by the user.
away.time | int | The UNIX time at which the user went away.
channels | array[string] | The channels that the user is in prefixed by their status mode prefixes.
chost | string or null | The cloaked hostname of the user or null if they have no cloak.
fingerprint | string or null | The fingerprint of the user's client certificate or null if they are not using one.
host | string | The real hostname of the user.
ident | string | The username (ident) of the user.
modes | array[string] | Flag and parameter modes which are set on the user.
nick | string | The nickname of the user.
nickchanged | int | The time at which the user last changed their nickname.
real | string | The real name of the user.
server | string | The server that the user is connected to.
signon | int | The time at which the user connected to the network.
tls | bool | Whether the user is connected using TLS (SSL).
uid | string or null | The unique immutable identifier of the user or null if the IRCd does not use UIDs.
vhost | string or null | The virtual host of the user or null if they have no vhost.
vident | string or null | The virtual ident (username) of the user or null if they have no vident.
#### Example
```json
{
"account": {
"display": "nick1",
"opertype": "Services Root",
"uniqueid": "17183514657819486040"
},
"address": "127.0.0.1",
"away": null,
"channels": ["@#chan1", "#chan2"],
"chost": "localhost",
"fingerprint": null,
"host": "localhost",
"id": "9TSAAAAAA",
"ident": "user1",
"modes": ["+r"],
"nick": "nick1",
"nickchanged": 1740408318,
"real": "An IRC User",
"server": "irc.example.com",
"signon": 1740408296,
"tls": true,
"vhost": "staff.example.com",
"vident": null,
}
```
-67
View File
@@ -1,67 +0,0 @@
# Anope `rpc_message` RPC interface
## `anope.messageNetwork`
Sends a message to all users on the network.
### Parameters
Index | Description
----- | -----------
0+ | One or more messages to send.
### Errors
Code | Description
------ | -----------
-32099 | The global service is not available.
### Result
This procedure returns no result.
## `anope.messageServer`
Sends a message to all users on the specified server.
### Parameters
Index | Description
----- | -----------
0 | The name of the server to message users on.
1+ | One or more messages to send.
### Errors
Code | Description
------ | -----------
-32099 | The global service is not available.
-32098 | The specified server does not exist.
### Result
This procedure returns no result.
## `anope.messageUser`
Sends a message to the specified user.
### Parameters
Index | Description
----- | -----------
0 | The source pseudoclient to send the message from.
1 | The target user to send the message to.
2+ | One or more messages to send.
### Errors
Code | Description
------ | -----------
-32099 | The specified source does not exist.
-32098 | The specified target does not exist.
### Result
This procedure returns no result.
-175
View File
@@ -1,175 +0,0 @@
# Anope `rpc_user` RPC interface
## `anope.checkCredentials`
Checks whether the specified credentials are valid.
### Parameters
Index | Description
----- | -----------
0 | A nickname belonging to the account to check.
1 | The password for the specified account.
### Errors
Code | Description
------ | -----------
-32099 | The specified account does not exist.
-32098 | The specified password is not correct.
-32097 | The specified account is suspended.
### Result
Returns a map containing basic information about the account. More information about the account can be found by calling [the `anope.account` event using the value from the `uniqueid` field (requires the rpc_data module)](./rpc_user.md).
Key | Type | Description
--- | ---- | -----------
account | string | The display nickname of the account.
confirmed | boolean | Whether the account has been confirmed.
uniqueid | uint | The unique immutable identifier of the account.
#### Example
```json
{
"account": "foo",
"confirmed": true,
"uniqueid": 11085415958920757000,
}
```
## `anope.identify`
Identifies an IRC user to the specified account.
### Parameters
Index | Description
----- | -----------
0 | Either an account identifier or nickname belonging to the account to identify to.
1 | The nickname of the IRC user to identify to the account.
### Errors
Code | Description
------ | -----------
-32099 | The specified account does not exist.
-32098 | The specified IRC user does not exist.
### Result
This procedure returns no result.
## `anope.listCommands`
Lists all commands that exist on the network.
### Parameters
Index | Description
----- | -----------
0...n | The nicknames of the services to list commands for. If none are specified then all commands are returned.
### Errors
Code | Description
------ | -----------
-32098 | The specified service does not exist.
### Result
Returns a map containing information about the available commands.
Key | Type | Description
--- | ---- | -----------
\* | map | A key-value map of services to the commands that exist on them.
\*.\* | string | A key-value map of commands to information about the commands.
\*.\*.group | string or null | The group that the command belongs to or null if the command is not grouped.
\*.\*.hidden | boolean | Whether the command is visible in the help output.
\*.\*.maxparams | uint or null | The maximum number of parameters that the command accepts or null if there is no limit.
\*.\*.minparams | uint | The minimum number of parameters that the command accepts.
\*.\*.permission | string or null | The services operator permission required to execute the command or null if no permissions are required.
\*.\*.requiresaccount | boolean | Whether a caller must be logged into an account to execute the command.
\*.\*.requiresuser | boolean | Whether an IRC user is required to execute the command.
#### Example
```json
{
"Global": {
"GLOBAL": {
"group": null,
"hidden": false,
"maxparams": 1,
"minparams": 0,
"permission": "global/global",
"requiresaccount": true,
"requiresuser": false
},
"HELP": {
"group": null,
"hidden": false,
"maxparams": null,
"minparams": 0,
"permission": null,
"requireaccount": false,
"requireuser": false
},
"QUEUE": {
"group": null,
"hidden": false,
"maxparams": 2,
"minparams": 1,
"permission": "global/queue",
"requireaccount": true,
"requireuser": false
},
"SERVER": {
"group": null,
"hidden": false,
"maxparams": 2,
"minparams": 1,
"permission": "global/server",
"requireaccount": true,
"requireuser": false
}
}
}
```
## `anope.commands`
Executes the specified command.
### Parameters
Index | Description
----- | -----------
0 | If non-empty then the account to execute the command as.
1 | The service which the command exists on.
2...n | The the command to execute and any parameters to pass to it.
### Errors
Code | Description
------ | -----------
-32099 | The specified account does not exist.
-32098 | The specified service does not exist.
-32097 | The specified command does not exist.
### Result
Returns an array of messages returned by the command.
#### Example
```json
[
"Global commands:",
" GLOBAL Send a message to all users",
" HELP Displays this list and give information about commands",
" QUEUE Manages your pending message queue.",
" SERVER Send a message to all users on a server"
]
```
-57
View File
@@ -1,57 +0,0 @@
# Building Anope on Windows
## Dependencies
You will need the following software installed to build Anope:
* [CMake 3.20 or newer](https://cmake.org/download/#latest)
* [Conan 2 or newer](https://conan.io/downloads) (optional if you don't want to build extra modules)
* [NSIS 3 or newer](https://nsis.sourceforge.io/Download)
* [Visual Studio 2022 or newer](https://visualstudio.microsoft.com/downloads/) (*NOT* Visual Studio Code)
## Building
First you need to download the latest version of the Anope source code from [the releases page](https://github.com/anope/anope/releases) and unpack it using Windows Explorer.
---
Once you have the source code unpacked you need open the Command Prompt and move to the directory in which Anope has been unpacked. You can do this by pressing Control+R and then entering `cmd.exe` and pressing enter. Once the terminal opens you can move to the directory using the following command (assuming you unpacked to `C:\Users\Example\Downloads\anope-2.1`):
```cmd
cd C:\Users\Example\Downloads\anope-2.1
```
---
If you want to build with multiple-language support or want to use the enc_argon2, mysql, regex_pcre2, regex_posix, regex_tre, sqlite, or ssl_openssl extra modules you will now need to install the third-party dependencies using Conan. Before you can do this you need to create a Conan profile for C++17 using the following command:
```cmd
conan profile detect
notepad ~\.conan2\profiles\default
```
When Notepad opens you should find the line beginning with `compiler.cppstd=` and replace the entire line with `compiler.cppstd=17` and save the file.
Now you're ready to install the third-party dependencies using the following command:
```cmd
conan install .\src\win32 --build missing --deployer runtime_deploy --deployer-folder .\build\extradll --output-folder .
call .\conanbuild.bat
```
This will probably take a long time if its the first time you have run it.
---
Now you're ready to build Anope.
```cmd
cd .\build
cmake -A x64 -D "CMAKE_BUILD_TYPE=Release" -D "CMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake" ..
msbuild PACKAGE.vcxproj /P:Configuration=Release /P:Platform=x64 /VERBOSITY:MINIMAL
```
Once the build finishes the installer will be available in the build directory. You can install this by opening the directory in Windows Explorer and then running it as you would with most Windows installers.
Once installed Anope will be available at `C:\Program Files\Anope`.
+161
View File
@@ -0,0 +1,161 @@
Anope for Windows
-----------------
1) Building the Source
2) Installation
3) Compiling Modules
4) Other compile options
5) Credits
1) Building the Source
NOTE: If you have downloaded one of the pre-compiled installers, you do
NOT need to complete this step, and you can proceed to step 2.
If you want to build Anope from source on a Win32 system, you will need
to follow this instructions:
1) Download the required files:
* Current Anope source:
https://github.com/anope/anope/releases
* CMake:
https://cmake.org/download/
(NOTE: When installing, tell CMake to add itself to the PATH.)
If you have Visual C++ 10 or 11 (2010/2012) skip ahead to step 2, else you
need to download and install the following free component from Microsoft.
* Microsoft Visual C++ 2010 Express Edition:
http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express
2) Unpack the Anope tarball with your favorite uncompression program
(WinZip or WinRAR, etc).
3) Bring up the Visual C++ Command Prompt; This will launch a
DOS Command Prompt like window, which will set the environment
properties needed to make Anope.
Create a new directory, which will be used to hold the build files. You can make it
be a directory under the source directory unpacked in step 2, or somewhere else entirely.
Change directories to this new folder, by typing:
cd <path to build directory>
e.g.
cd c:\anope-build
4) You now need to configure Anope to your requirements. At the prompt type:
<path to source directory>\Config.exe
NOTE: If you run an Anti-Virus program such as McAfee or Norton, you may
be unable to run this command due to the protection in place. Some Anti-
Virus programs may detect the Anope Configuration Tool as a worm, however
this is not the case. If you are prompted to allow or deny execution of
the script, you should choose allow. If the script fails to run, and no
notice is displayed, please check your Anti-Virus settings before seeking
assistance.
An interactive configuration program should guide you through the install
options. You will be given a choice to use NMake or not. NMake will compile
inside the command prompt window you are in. If you want to build within
the Visual C++ IDE, say no to that option, and it'll create a Solution for
you to open up.
If you cannot find whats causing the error, please visit our forums or
our IRC Support channel for assistance.
Some Anope modules require third party libraries, such as mysql and
the SSL modules. If these libraries are installed in nonstandard
locations, cmake will probably not find them and should be told where
they are by passing their location to Config.
The libraries used to build the 'extra' modules are available at
https://github.com/Adam-/windows-scripts.
5) You are now ready to compile. If you said you wanted to use NMake in step 4,
at the prompt type:
nmake
Once you are back at the command prompt again, if there have been no
errors, you are ready to go.
If instead you decided to use the Visual C++ IDE, open up the Anope.sln
file. After the IDE has fully loaded, hit F7 to build everything.
Should you encounter errors with the installation process, check the
messages displayed for advice on resolving them. If you are unable to
resolve the issues yourself, seek assistance on our forums or in our
IRC Support channel.
6) Finally you will need to install Anope. If you said you wanted to use NMake
in step 4, at the prompt type:
nmake install
Otherwise, if you decided to use the Visual C++ IDE, find the project called
INSTALL within the Solution Explorer. Right-click on INSTALL and choose Build.
When you have done this, all the files will be installed to where they belong.
The only thing you need to do is rename "data/anope.example.conf" to be "data/anope.conf",
and then follow the steps to set up Anope.
You have now completed the building phase of Anope for Windows. You can
now move on to the next section, which is related to setting up Anope.
2) Installation
Since Anope for Windows does not use a visual interface, you must do the
configuration with a text editor before proceeding with running Anope
itself.
NOTE: You may need to open the configuration file with Wordpad, or a text
editor which supports UNIX line endings. Opening the configuration file in
Notepad will cause strange characters to appear, and you may not be able to
edit the file correctly.
Open anope.conf, and read through it carefully and adjust the settings
you think you need to adjust.
If you are unsure of the settings, you can go to the dos command prompt
and run "anope.exe --nofork --debug" and watch the information as it
attempts to connect.
You can launch services in two ways. If you are sure that the entered
configuration information is correct, simply double clicking the Anope
executable will cause it to start; no window will pop up. If you'd rather
have a more textual output, you can start at the dos prompt and type in
"anope.exe". If services are successfully started up the dos prompt will
seem to hang; at this point you can safely close the dos window.
3) Compiling Modules
If you want to build other modules than the ones shipped by default, you
will need to rerun Config.exe
4) Other compile options
A) If you have trouble recompiling Anope, you should delete all files and folders
within the build folder you created in step 3 of section 1. Afterwards, follow
the directions from step 4 of section 1 down.
5) Credits
Anope is based on Epona and IRCServices. See CREDITS for more credits and
a complete list of all developers.
Anope's Windows-specific code is provided by:
* Dominick Meglio <codemastr@unrealircd.com>
* Trystan Scott Lee <trystan@nomadirc.net>
* Chris Hogben <heinz@anope.org>
Anope's Windows Installer was made using:
* NSIS 2.20 <http://nsis.sourceforge.net>
+29
View File
@@ -0,0 +1,29 @@
XMLRPC using PHP's xmlrpc_encode_request and xmlrpc_decode functions is supported.
This allows external applications, such as websites, to execute remote procedure calls to Anope in real time.
Currently there are 5 supported XMLRPC calls, provided by xmlrpc_main:
checkAuthentication - Takes two parameters, an account name and a password. Checks if the account name is valid and the password
is correct for the account name, useful for making login pages on websites.
command - Takes three parameters, a service name (BotServ, ChanServ, NickServ), a user name (whether online or not), and the command
to execute. This will execute the given command to Anope using the given service name. If the user given is online, the
command reply will go to them, if not it is returned by XMLRPC.
stats - Takes no parameters, returns miscellaneous stats that can be found in the /operserv stats command.
channel - Takes one parameter, a channel name, and returns real time information regarding that channel, such as users, modes
(ban lists and such), topic etc.
user - Takes one parameter, a user name, and returns real time information regarding that user.
opers - Takes no parameters, returns opertypes, their privileges and commands.
notice - Takes three parameters, source user, target user, and message. Sends a message to the user.
XMLRPC was designed to be used with db_sql, and will not return any information that can be pulled from the SQL
database, such as accounts and registered channel information. It is instead used for pulling realtime data such
as users and channels currently online. For examples on how to use these calls in PHP, see xmlrpc.php in docs/XMLRPC.
Also note that the parameter named "id" is reserved for query ID. If you pass a query to Anope containing a value for id. it will
be stored by Anope and the same id will be passed back in the result.
+145
View File
@@ -0,0 +1,145 @@
<?php
/**
* XMLRPC Functions
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*/
class AnopeXMLRPC
{
/**
* The XMLRPC host
*
* @var string
*/
private $host;
/**
* Initiate a new AnopeXMLRPC instance
*
* @param $host
*/
public function __construct($host)
{
$this->host = $host;
}
/**
* Run an XMLRPC command. Name should be a query name and params an array of parameters, eg:
* $this->raw("checkAuthentication", ["adam", "qwerty"]);
* If successful returns back an array of useful information.
*
* Note that $params["id"] is reserved for query ID, you may set it to something if you wish.
* If you do, the same ID will be passed back with the reply from Anope.
*
* @param $name
* @param $params
* @return array|null
*/
public function run($name, $params)
{
$xmlquery = xmlrpc_encode_request($name, $params);
$context = stream_context_create(["http" => [
"method" => "POST",
"header" => "Content-Type: text/xml",
"content" => $xmlquery]]);
$inbuf = file_get_contents($this->host, false, $context);
$response = xmlrpc_decode($inbuf);
if ($response) {
return $response;
}
return null;
}
/**
* Do Command on Service as User, eg:
* $anope->command("ChanServ", "Adam", "REGISTER #adam");
* Returns an array of information regarding the command execution, if
* If 'online' is set to yes, then the reply to the command was sent to the user on IRC.
* If 'online' is set to no, then the reply to the command is in the array member 'return'
*
* @param $service
* @param $user
* @param $command
* @return array|null
*/
public function command($service, $user, $command)
{
return $this->run("command", [$service, $user, $command]);
}
/**
* Check an account/nick name and password to see if they are valid
* Returns the account display name if valid
*
* @param $account
* @param $pass
* @return string|null
*/
public function auth($account, $pass)
{
$ret = $this->run("checkAuthentication", [$account, $pass]);
if ($ret && $ret["result"] == "Success") {
return $ret["account"];
}
return null;
}
/**
* Returns an array of misc stats regarding Anope
*
* @return array|null
*/
public function stats()
{
return $this->run("stats", null);
}
/**
* Look up data for a channel
* Returns an array containing channel information, or an array of size one
* (just containing the name) if the channel does not exist
*
* @param $channel
* @return array|null
*/
public function channel($channel)
{
return $this->run("channel", [$channel]);
}
/**
* Sent a notice to a user.
* Returns an array containing channel information, or an array of size one
* (just containing the name) if the channel does not exist
*
* @param $source
* @param $target
* @param $message
* @return array|null
*/
public function notice($source, $target, $message)
{
return $this->run("notice", [$source, $target, $message]);
}
/**
* Like channel(), but different.
*
* @param $user
* @return array|null
*/
public function user($user)
{
return $this->run("user", [$user]);
}
}
$anope = new AnopeXMLRPC("http://127.0.0.1:8080/xmlrpc");
-326
View File
@@ -1,326 +0,0 @@
Anope Version 2.1.18
--------------------
Added a check that a non-deprecated database module is loaded.
Added support for flexible and monospace layouts to make text easier to read on clients that use a variable-width font.
Added support for logging about deprecated modules on boot.
Added support for per-IRCd hints when a link fails.
Added support for self-service validation of vhosts using DNS TXT records.
Added support for separate bad password limits for pre-connection SASL authentication.
Added support for SRV and TXT records to the dns module.
Added the --nodb option to disable database and encrytption module checks.
Added the nickname registration date to the nickserv/glist output.
Changed db_flatfile to be import-only (migrate to db_json).
Changed the default registration confirmation type to code validation.
Changed the fantasy !help command to not require the FANTASY privilege by default.
Changed various length measurement code to be UTF-8 aware.
Disabled the nickname registration delay by default.
Fixed reporting the MySQL version that the mysql module was built against.
Improved the layout of the nickserv/info command.
Modularised the ns_sasl module to make it easier to pick SASL mechanisms.
Moved duration rounding logic from Anope::Expires to Anope::Duration.
Removed support for importing old databases from 1.8.
Removed support for verifying "old MD5" passwords from 1.7.
Reworked how memory is allocated when formatting messages.
Anope Version 2.1.17
--------------------
Allowed opers to resend passwords for users in nickserv/resend.
Fixed HostServ using a different valid username character set to the protocol module.
Fixed losing the channel and nickname registration time when upgrading from an earlier 2.1 release.
Improved the messages sent when a user is forced off a protected nickname.
Simplified copying modules to the runtime directory on Windows.
Anope Version 2.1.16
--------------------
Added support for on-IRC code confirmation.
Added the ability for fantasy commands to be executable without the FANTASY privilege.
Added the ability to prepend to topics as well as appending to them.
Changed various fields to serialize to the database as a string not an integer.
Disabled db_flatfile by default in preparation for becoming import-only.
Fixed a memory leak in the db_json module.
Fixed building on OpenSSL 1.1.1 (for now).
Fixed removed and later re-added temporary bans being removed automatically.
Fixed sometimes sending malformed LMODE messages on InspIRCd.
Fixed the "did you mean" message suggesting unloaded commands.
Fixed various issues with the example config files.
Marked db_json as the recommended database module.
Moved the BAN, UNBAN, and KICK commands to the chanserv/management group.
Removed support for the 1.8-style seen command.
Reworked confirmation to allow confirmation of multiple account actions.
When dropping a display nickname the new display will now be the oldest in the group.
Anope Version 2.1.15
--------------------
Added a workaround to the jsonrpc module for JavaScript truncating big integers.
Added an example Ruby library for accessing the RPC interface.
Added away state and tls usage to the anope.user RPC event.
Added support for looking up accounts by identifier in the anope.account RPC event.
Added support for storing the setter and set time and setter of list modes and restoring them on InspIRCd and Solanum.
Added support for token authentication to the RPC modules.
Added the anope.checkCredentials, anope.identify, anope.listCommands, and anope.command RPC events to the new rpc_user module.
Bumped the minimum supported version of ircd-hybrid to 8.2.34.
Deprecated irc2sql in favour of rpc_data.
Dropped support for Bahamut as it has no known users.
Fixed creating duplicate Stats rows on some servers.
Fixed loading databases in db_json.
Fixed restoring cloaked hosts on InspIRCd when the cloak module is not loaded.
Fixed some variable shadowing that potentially caused issues with the SQL database backends.
Fixed sometimes writing accounts to the database without a unique identifier.
Fixed various documentation issues with the example JavaScript JSON-RPC client.
Improved CTCP handling and added support for more CTCP types.
Anope Version 2.1.14
--------------------
Added a detail specifier to the anope.list{Channels,Opers,Servers,Users} RPC methods.
Added a matcher for the InspIRCd oper extban.
Added support for hashed operator passwords.
Added support for hiding the date news was added in os_news.
Added support for local password comparison to the sql_authentication module.
Added support for monthly backups to db_json.
Added support for unbanning virtual modes using cs_unban.
Added the !unmute fantasy command.
Added the anope.account and anope.listAccounts RPC methods to the rpc_data module.
Added the protection time to the INFO output.
Allowed unprivileged channel successors to remove themselves from succession.
Bumped the minimum required CMake version to 3.20.
Changed deletion callbacks to specify the mask that was deleted if only one was.
Changed nickserv/alist to show all permissions not just the highest ranked one.
Fixed NEVEROP not being respected in chanserv/set/founder and chanserv/set/successor.
Fixed stripping IRC formatting codes from messages.
Messages are now automatically line wrapped to options:linelength.
Redocumented the ns_sasl module.
Removed hardcoded command names from several messages.
Updated the Windows CI to Windows Server 2025 and Visual Studio 2022.
Anope Version 2.1.13
--------------------
Added a Config check to ensure users actually want to use the development branch.
Added a flag to the version string when Anope is compiled in reproducible mode.
Added a warning on rehash when the max password is longer than the maximum bcrypt password length.
Added an ALLTIME handler on InspIRCd.
Added an opt-out for extended XML-RPC types.
Added RPC messages for sending global messages.
Added support for importing cs_set_misc and ns_set_misc data from Atheme.
Added support for importing news from Atheme.
Added support for oper-only quit messages.
Added support for the experimental "services cloak" system from the InspIRCd development branch.
Added support for using defines from the environment.
Added support for using defines within the value of a variable.
Blacklisted an old version of an UnrealIRCd module that is known to send malformed S2S messages.
Changed RPC events to be registered as core services.
Changed the database to refer to accounts by their account identifier instead of their display nick.
Changed the syntax of defines from "foo" to "${foo}".
Deduplicated JSON generation code in the jsonrpc module.
Fixed a warning when importing an Atheme account that uses external authentication.
Fixed counting email addresses in ns_maxemail.
Fixed db_atheme creating duplicate accounts, bots, and nicks when importing over an existing database.
Fixed deleting old database backups after Anope has been restarted.
Fixed importing user metadata from Anope 1.8.
Fixed including a port in uplink messages when connecting to a UNIX socket endpoint.
Fixed memo ignores being erroneously case sensitive.
Fixed modules with third-party dependencies writing generic log messages instead of module log messages.
Fixed not performing SQL database updates in some rare circumstances.
Fixed sending global messages with the default sender.
Imported mkauthors from InspIRCd and used it to generate docs/AUTHORS.txt
Moved around a bunch of module headers.
Moved database serialization from the serializable to the serializable type.
Moved the SASL protocol interface to its own service.
Refactored handling S2S metadata on InspIRCd.
Updated more messages to use gettext plural forms.
Anope Version 2.1.12
--------------------
Added an example JavaScript library for accessing the RPC interface.
Added an option to require specifying the server name when running destructive network commands like restart or shutdown.
Added support for importing X-line identifiers from Atheme.
Added support for JSON-RPC to the RPC interface.
Added support for killing SASL users that fail to log in repeatedly.
Added support for more RPC response types to the RPC interface.
Added support for multiple targets in chanserv/modes.
Added support for SSL client certificate fallback fingerprints on InspIRCd.
Added the anope. prefix to the channel and user RPC events and moved them to the rpc_data module.
Added the anope.listChannels, anope.listServers, anope.listUsers, and anope.server RPC events to the new rpc_data module.
Added the OPERONLY, UNUSED and VANITY filters to botserv/botlist.
Added the system.listMethods RPC event to the new rpc_system module.
Deprecated support for InspIRCd v3 (scheduled to be removed in around a year).
Fixed enc_bcrypt silently truncating passwords longer than 71 characters.
Fixed ns_set_language being able to be loaded when Anope was built without language support.
Fixed sql_authentication not being able to use the IP address of a RPC, SASL, or web user in SQL queries.
Made modules that use third-party libraries log the version in use on load.
Redesigned the RPC interface to add support for emitting multiple data types.
Replaced the opers RPC event with rpc.listOpers and rpc.oper events in the new rpc_data module.
Updated the Dutch translation.
Anope Version 2.1.11
--------------------
Added support for database migrations to the mysql module.
Added support for renicking users to their UID when enforcing nickname protection.
Added support for sending channel URLs to joining users.
Allowed selecting languages using a shorter version of their name.
Changed various messages to use human-readable durations instead of seconds.
Improved the creation of expiry and duration messages.
Improved the translation system with support for plural forms.
Reworked how guest nicknames are generated.
Simplified how account identifiers are allocated.
Anope Version 2.1.10
--------------------
Added support for NEXTBANS on UnrealIRCd.
Changed hostmask access entries added by nick to use that nick as the default description.
Changed modes to be handled internally in their split form.
Changed ns_cert to notify a user that their certificate is being automatically added to their account.
Fixed matching users against extended bans.
Fixed parsing name-only extended bans on InspIRCd.
Fixed respecting the preferred extended ban format on InspIRCd.
Fixed the name of the cron script in the docs.
Updated the list of supported IRCds.
Updated the location of the Anope IRC channels
Anope Version 2.1.9
-------------------
Bumped the minimum supported version of UnrealIRCd to 6.
Fixed granting IRC operator status to services operators.
Fixed making users an IRC operator on InspIRCd.
Fixed nonicknameownership on InspIRCd v4.
Fixed some messages not being translatable.
Fixed the Argon2 module not having test vectors.
Increased the default nickname expiry period to one year.
Anope Version 2.1.8
-------------------
Added account identifiers to the nickserv/info output.
Added support for bool, float, and uint SQL columns.
Added the ability to automatically determine SQL column types based on the native type.
Added UNIX socket support to mysql module.
Changed smartjoin to use SendClearBans where available.
Dropped support for MinGW in favour of native builds.
Fixed parsing named extbans on InspIRCd.
Fixed parsing SVSMODE and SVS2MODE from UnrealIRCd.
Fixed sending global messages to remotely linked servers.
Removed the services server name from the CTCP version response.
Anope Version 2.1.7
-------------------
Added importing of akick reasons, forbid reasons, opers and session exceptions to db_atheme.
Added support for sending tag messages.
Added the ability to look up account information of an authenticated user.
Fixed a crash in ns_cert when an IRC user is not present during a nick registration.
Fixed a null pointer dereference in the global module.
Fixed a rare memory leak in os_akill and os_sxline.
Improved the performance of some code that looks up the primary nick from an account.
Removed the broken Catalan, Hungarian, and Russian translations.
Reworked the protocol interface for sending messages.
Updated the Turkish translation.
Anope Version 2.1.6
-------------------
Added opportunistic upgrading of TLS fingerprints to more secure algorithms on InspIRCd.
Added support for logging out partially connected users on Plexus.
Added the account registration time to nickserv/info.
Changed ns_cert to automatically add a TLS fingerprint to new accounts if available.
Clarified that a non-deprecated encryption module must be loaded.
Fixed creating the runtime directory on Windows.
Fixed mistakenly allowing badpasslimit to be set to a negative value.
Fixed parsing backup TLS fingerprints on InspIRCd.
Fixed parsing the flood mode on UnrealIRCd.
Fixed parsing the history mode on UnrealIRCd.
Fixed various iterator invalidation issues.
Partially rewrote the Portuguese translation.
Removed some incorrect strings from the Turkish translation.
Renamed the --modulesdir option to --moduledir to match the name of other path options.
Anope Version 2.1.5
-------------------
Added an example systemd unit file.
Added support for BIGLINES on UnrealIRCd.
Bumped the minimum supported version of Bahamut to 2.0.
Fixed truncating messages in global/global and global/server.
Improved building Anope for use as a system package.
Updated the Turkish translation.
Anope Version 2.1.4
-------------------
Added a check for a non-deprecated encryption module on start.
Added a way for protocol modules to report an error to the uplink.
Added more account settings to the webcpanel.
Added self-test functionality for all encryption modules.
Added support for challenge authentication on InspIRCd.
Added support for importing databases from Atheme.
Added support for sending client tags on UnrealIRCd.
Added support for the InspIRCd 1206 (v4) protocol.
Added the --nopid option to disable writing a pid file.
Added the enc_argon2 module to encrypt passwords with Argon2.
Added the enc_sha2 module to encrypt passwords with HMAC-SHA-2.
Added the global/queue command for queueing multi-line messages.
Added the global/server command for sending messages to an individual server.
Added the PASSWORD category to operserv/stats to view password encryption methods.
Added the verify-only enc_posix module to validate passwords from Atheme that were encrypted with Argon2.
Changed nickserv/drop to use confirmation codes to confirm a nickname drop.
Changed various paths to be relative to the data and config directories.
Converted some IRCDProto member functions to variables.
Converted the enc_md5, enc_none, enc_old, enc_sha1, and enc_sha256 modules to be verify-only.
Deduplicated page headers and footers in the webcpanel templates.
Deprecated the enc_sha256 module.
Fixed inconsistent spelling/casing of email, vhost, and vident.
Fixed various bugs in the inspircd module.
Improved portability of email sending.
Improved protocol debug messages.
Improved the performance and reliability of internal conversion logic.
Improved the randomness of randomly generated numbers.
Refactored the enc_bcrypt module and exposed it as an encryption context.
Removed several duplicate translation strings.
Replaced the custom MD5 implementation in enc_md5 with a vendored one.
Replaced the custom SHA256 implementation in enc_sha256 with a vendored one.
The ldap_authentication, ldap_oper, sql_authentication, sql_log, and sql_oper modules are now always enabled.
Anope Version 2.1.3
-------------------
Added alternate command suggestions when a user runs an invalid command.
Added support for the IRCv3 +draft/channel-context tag.
Added support for the IRCv3 +draft/reply tag.
Allow using more than one fingerprint in an oper block.
Changed chanserv/drop to use confirmation codes to confirm a channel drop.
Cleaned up more of the codebase to use Modern C++17.
Enabled using more field limits sent by the IRC server instead of requiring the user to configure them.
Fixed NickServ lying about the minimum password length.
Fixed a crash when sending emails.
Fixed bs_kick not using the correct kick message for automatic kicks.
Increased the security of randomly generated confirmation codes.
Removed the ns_access module and associated cs_secure and ns_secure options.
Removed the ns_status module.
Reworked how messages are sent in protocol modules to allow sending message tags.
Anope Version 2.1.2
-------------------
Bumped the minimum OpenSSL version to 1.1.0.
Bumped the minimum GnuTLS version to 3.0.0.
Disabled SSLv3 support in the m_ssl_openssl module.
Modernized mutex and thread code to use Modern C++.
Normalised the program exit codes.
Updated the Dutch translation.
Updated the French translation.
Anope Version 2.1.1
-------------------
Added the UNBANME privilege to allow users to unban themselves.
Fixed building on Windows systems without chgrp/chmod.
Fixed creating sockets in the m_dns, m_httpd, m_proxyscan, and m_redis modules.
Fixed reading the values of command line arguments.
Moved core privilege descriptions to the example configs.
Updated the Italian translation.
Updated the Polish translation.
Anope Version 2.1.0
-------------------
Added support for access list entry descriptions.
Added support for linking over a UNIX socket.
Added support for server-initiated logins and logouts on UnrealIRCd.
Added support for server-initiated logouts on InspIRCd.
Added support for the ANONYMOUS SASL mechanism.
Allowed users to opt-out of being added to channel access lists.
Cleaned up the codebase to use Modern C++17.
Modernized the build system to use a modern version of CMake.
Removed support for using insecure encryption methods as the primary method.
Removed the Windows-only anopesmtp tool.
Removed the two day X-line cap.
Updated all references to IRCServices to refer to Anope instead.
-204
View File
@@ -1,204 +0,0 @@
Anope Version 2.1.18
--------------------
Added the hostserv/validate command.
Added the nickserv/saset/layout command.
Added the nickserv/set/layout command.
Added the ns_sasl_anonymous module.
Added the ns_sasl_external module.
Added the ns_sasl_plain module.
Added the ns_set_layout module.
Added the ns_set_op module.
Added {hs_request}:validationcooldown (defaults to 5 minutes).
Added {hs_request}:validationrecord (defaults to "anope-dns-validation").
Added {ns_sasl}:badpasslimit (defaults to options:badpasslimit).
Added {ns_sasl}:badpasstimeout (defaults to options:badpasstimeout).
Moved nickserv/set/autoop and nickserv/saset/autoop to the ns_set_op module.
Moved nickserv/set/display and nickserv/saset/display to the ns_set_group module.
Moved nickserv/set/neverop and nickserv/saset/neverop to the ns_set_op module.
Removed the db_old module.
Removed the enc_old module.
Removed {db_flatfile}:fork (module is now import-only).
Removed {db_flatfile}:keepbackups (module is now import-only).
Removed {db_flatfile}:nobackupokay (module is now import-only).
Anope Version 2.1.17
--------------------
Added the nickserv/resend oper privilege.
Anope Version 2.1.16
--------------------
Added fantasy:require_privilege (defaults to yes).
Added the nickserv/confirm/email command.
Added the nickserv/confirm/email oper privilege.
Added the nickserv/confirm/register command.
Added the ns_confirm module.
Added {ns_email}:changeexpire (defaults to 1 day).
Added {ns_resetpass}:resetexpire (defaults to 1 day).
Removed the irc2sql module (migrate to JSON-RPC instead).
Removed {ns_seen}:simple (1.8-style seen has been removed).
Renamed the nickserv/confirm oper privilege to nickserv/confirm/register.
Anope Version 2.1.15
--------------------
Added the ns_email module.
Added the rpc_user module.
Added {jsonrpc}:integer_bits (defaults to 64).
Added {jsonrpc}:token.
Added {nickserv}:enforcerreal (defaults to "Services Enforcer").
Added {xmlrpc}:token.
Moved nickserv/set/email and nickserv/saset/email to the ns_email module.
Removed the bahamut module.
Removed the ns_getemail module (load ns_email instead).
Removed the ns_maxemail module (load ns_email instead).
Removed the rpc_main module (migrate to the other RPC modules).
Removed {chanstats}:cs_def_chanstats (add CS_STATS to {chanserv}:defaults instead).
Removed {chanstats}:ns_def_chanstats (add NS_STATS to {nickserv}:defaults instead).
Renamed service:gecos to service:real.
Anope Version 2.1.14
--------------------
Added oper:password_hash.
Added options:codelength (defaults to 15).
Added {os_news}:showdate (defaults to yes).
Added {sql_authentication}:password_field (defaults to "password").
Added {sql_authentication}:password_hash.
Changed the default value for options:linelength to "100".
Changed the default value for {enc_sha2}:algorithm to "sha512".
Changed the default value for {ns_seen}:purgetime to "90d".
Changed the syntax for template variables in mail:emailchange_message, mail:emailchange_subject, mail:memo_message, mail:memo_subject, mail:registration_message, mail:registration_subject, mail:reset_message, mail:reset_subject, {chanserv}:signkickformat, {dnsbl}:blacklist:reason, {ldap_authentication}:search_filter, {ldap_oper}:binddn, {ldap_oper}:filter, {nickserv}:unregistered_notice, {os_session}:sessionlimitexceeded, {proxyscan}:proxyscan:reason.
Anope Version 2.1.13
--------------------
Added options:linelength (defaults to 120).
Added the db_json module.
Added the rpc_message module.
Added {nickserv}:defaultprotect (defaults to 1m).
Added {nickserv}:maxprotect (defaults to 10m).
Added {nickserv}:minprotect (defaults to 10s)
Added {xmlrpc}:enable_i8 (defaults to yes).
Added {xmlrpc}:enable_nil (defaults to yes).
Changed the syntax for using defines (all existing defines will need to be updated).
Removed {nickserv}:kill (replaced by custom protection timer durations).
Removed {nickserv}:killquick (replaced by custom protection timer durations).
Removed {ns_set_kill}:allowkillimmed (replaced by custom protection timer durations).
Renamed the nickserv/saset/kill command to nickserv/saset/protect.
Renamed the nickserv/saset/kill oper privilege to nickserv/saset/protect.
Renamed the nickserv/set/kill command to nickserv/set/protect.
Renamed the ns_set_kill module to ns_set_protect.
Renamed the sasl module to ns_sasl and moved it to nickserv.example.conf.
Anope Version 2.1.12
--------------------
Added the jsonrpc module.
Added the rpc_data module.
Added the rpc_system module.
Added {hostserv}:activate_on_deoper (defaults to yes).
Added {os_shutdown}:requirename (defaults to yes).
Moved nickserv/set/keepmodes and nickserv/saset/keepmodes to the ns_set_keepmodes module.
Moved the xmlrpc module to extra.
Renamed the xmlrpc_main module to rpc_main.
Anope Version 2.1.11
--------------------
Moved nickserv/set/kill and nickserv/saset/kill to the ns_set_kill module.
Moved {ns_set}:allowkillimmed to {ns_set_kill}:allowkillimmed.
Replaced {nickserv}:guestnickprefix with {nickserv}:guestnick (defaults to Guest####).
Anope Version 2.1.10
--------------------
Added options:servicealias (defaults to no)
Moved nickserv/set/message and nickserv/saset/message to the ns_set_message module.
Removed options:useprivmsg (replaced by loading the ns_set_message module to enable).
Removed options:usestrictprivmsg (feature unusable on modern servers, consider migrating to options:servicealias instead).
Anope Version 2.1.9
-------------------
No significant changes.
Anope Version 2.1.8
-------------------
Added the nickserv/drop/display oper privilege.
Added {nickserv}:preservedisplay (defaults to no).
Anope Version 2.1.7
-------------------
Moved nickserv/set/language and nickserv/saset/language to the ns_set_language module.
Renamed the FANTASIA channel privilege to FANTASY.
Renamed {cs_suspend}:expire to {cs_suspend}:suspendexpire.
Anope Version 2.1.6
-------------------
Added {ns_cert}:automatic (defaults to yes).
Removed {hybrid,inspircd,solanum,unrealircd}:use_server_side_mlock (now always enabled).
Removed {inspircd}:use_server_side_topiclock (now always enabled).
Anope Version 2.1.5
-------------------
Added the nickserv/drop/override and chanserv/drop/override oper privileges.
Anope Version 2.1.4
-------------------
Added the db_atheme module.
Added the enc_argon2 module.
Added the enc_posix module.
Added the enc_sha2 module.
Added the gl_queue module.
Added the gl_server module.
Added the global/queue oper privilege.
Added the global/server oper privilege.
Changed serverinfo:motd to be relative to the config directory.
Changed serverinfo:pid to be relative to the data directory.
Changed the default value of mail:sendmailpath to "/usr/sbin/sendmail -it".
Changed the default value of {chanserv}:accessmax to 1000.
Changed the default value of {chanserv}:inhabit to 1 minute.
Changed the default value of {cs_mode}:max to 50.
Changed the default value of {ms_ignore}:max to 50.
Removed options:seed (not needed with modern random number generation).
Replaced {webcpanel}:template with {webcpanel}:template_dir (defaults to webcpanel/templates/default).
Anope Version 2.1.3
-------------------
Added options:didyoumeandifference (defaults to 4).
Added support for multiple SSL fingerprints in oper:certfp.
Added the chanserv/cert oper privilege for modifying other user's certificate lists.
Changed networkinfo:chanlen to default to 32 if not set.
Changed networkinfo:hostlen to default to 64 if not set.
Changed networkinfo:modelistsize to default to 100 if not set.
Changed networkinfo:nicklen to default to 31 if not set.
Changed networkinfo:userlen to default to 10 if not set.
Increased the default maximum password length to 50 characters.
Increased the default minimum password length to 10 characters.
Removed the cs_secure option in {chanserv}:defaults (now always enabled as support for nick access lists has been removed).
Removed the nickserv/saset/secure command (support for nick access lists has been removed).
Removed the nickserv/saset/secure oper privilege (support for nick access lists has been removed).
Removed the nickserv/set/secure command (support for nick access lists has been removed).
Removed the nickserv/status command (obsolete with modern IRCv3 extensions and the removal of nick access lists).
Removed the ns_access module (support for nick access lists has been removed).
Removed the ns_secure option in {nickserv}:defaults (now always enabled as support for nick access lists has been removed).
Anope Version 2.1.2
-------------------
Added {ssl_openssl}:tlsv10 for configuring whether TLSv1.0 is usable (defaults to no).
Added {ssl_openssl}:tlsv11 for configuring whether TLSv1.1 is usable (defaults to yes).
Added {ssl_openssl}:tlsv12 for configuring whether TLSv1.2 is usable (defaults to yes).
Removed the m_ prefix from the names of the chanstats, dns, dnsbl, helpchan, httpd, ldap, ldap_oper, mysql, proxyscan, redis, regex_pcre2, regex_posix, regex_stdlib, regex_tre, rewrite, sasl, sql_log, sql_oper, sqlite, ssl_gnutls, ssl_openssl, xmlrpc, and xmlrpc_main modules.
Removed {ssl_openssl}:sslv3 (now always disabled).
Anope Version 2.1.1
-------------------
Added the m_regex_stdlib module.
Removed the m_regex_pcre module (use m_regex_pcre2 instead).
Anope Version 2.1.0
-------------------
Added {nickserv}:minpasslen for configuring the minimum password length (defaults to 8).
Removed {nickserv}:strictpasswords (obsolete now {nickserv}:minpasslen exists).
Removed the inspircd12 and inspircd20 modules (use inspircd instead).
Removed the ns_getpass module (no supported encryption modules).
Removed the os_oline module (no supported IRCds).
Removed the unreal module (use unrealircd instead).
Renamed {nickserv}:passlen to {nickserv}:maxpasslen.
Renamed the charybdis module to solanum.
Renamed the inspircd3 module to inspircd.
Renamed the unreal4 module to unrealircd.
Replaced uplink:ipv6 with uplink:protocol (defaults to ipv4).
+10 -6
View File
@@ -1,11 +1,8 @@
# Generate sysconf.h from the earlier configuration
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/sysconf.h.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/sysconf.h"
)
# Set version.cpp to use C++ as well as set its compile flags
set_source_files_properties(version.cpp PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
# Generate version-bin executable to modify version.h, setting it's linker flags as well
add_executable(version-bin version.cpp)
set_target_properties(version-bin PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}")
set(version_BINARY "$<TARGET_FILE:version-bin>")
# Modify version.h from the above executable, with dependencies to version.cpp
# and all of the source files in the main build
@@ -13,6 +10,13 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_
COMMAND version-bin ${Anope_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_BINARY_DIR}/build.h
DEPENDS version-bin ${SRC_SRCS}
)
# Add version-bin to list of files for CPack to ignore
get_filename_component(version_BINARY ${version_BINARY} NAME)
add_to_cpack_ignored_files("${version_BINARY}$" TRUE)
if(NOT WIN32)
add_to_cpack_ignored_files("version.h$" TRUE)
add_to_cpack_ignored_files("build.h$" TRUE)
endif()
# Add a custom target to the above file
add_custom_target(headers DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_BINARY_DIR}/build.h)
+13 -26
View File
@@ -1,16 +1,13 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
#pragma once
@@ -67,9 +64,6 @@ public:
*/
virtual ChanAccess *Create() = 0;
virtual void GetAccess(CommandSource& source, const Privilege *p, Anope::map<Anope::string> &access) = 0;
static void SendAccess(CommandSource &source, const Anope::string &pname);
private:
static std::list<AccessProvider *> Providers;
public:
@@ -80,16 +74,6 @@ public:
class CoreExport ChanAccess
: public Serializable
{
public:
struct Type final
: public Serialize::Type
{
Type();
void Serialize(Serializable *obj, Serialize::Data &data) const override;
Serializable *Unserialize(Serializable *obj, Serialize::Data &data) const override;
};
private:
Anope::string mask;
/* account this access entry is for, if any */
Serialize::Reference<NickCore> nc;
@@ -113,6 +97,9 @@ public:
const Anope::string &Mask() const;
NickCore *GetAccount() const;
void Serialize(Serialize::Data &data) const override;
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
static const unsigned int MAX_DEPTH = 4;
/** Check if this access entry matches the given user or account
+46 -76
View File
@@ -1,16 +1,13 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
#pragma once
@@ -20,13 +17,13 @@
#include "memo.h"
#include "base.h"
typedef Anope::unordered_map<NickAlias *> nickalias_map;
typedef Anope::unordered_map<NickCore *> nickcore_map;
typedef Anope::hash_map<NickAlias *> nickalias_map;
typedef Anope::hash_map<NickCore *> nickcore_map;
typedef std::unordered_map<uint64_t, NickCore *> nickcoreid_map;
extern CoreExport Serialize::Checker<nickalias_map> NickAliasList;
extern CoreExport Serialize::Checker<nickcore_map> NickCoreList;
extern CoreExport Serialize::Checker<nickcoreid_map> NickCoreIdList;
extern CoreExport nickcoreid_map NickCoreIdList;
/* A registered nickname.
* It matters that Base is here before Extensible (it is inherited by Serializable)
@@ -35,29 +32,19 @@ class CoreExport NickAlias final
: public Serializable
, public Extensible
{
public:
struct Type final
: public Serialize::Type
{
Type();
void Serialize(Serializable *obj, Serialize::Data &data) const override;
Serializable *Unserialize(Serializable *obj, Serialize::Data &data) const override;
};
private:
Anope::string vhost_ident, vhost_host, vhost_creator;
time_t vhost_created = 0;
time_t vhost_created;
public:
Anope::string nick;
Anope::string last_quit;
/* Last cloaked user@host this nick was seen using. */
Anope::string last_userhost;
/* Last real user@host this nick was seen using. */
Anope::string last_userhost_real;
time_t registered = Anope::CurTime;
time_t last_seen = Anope::CurTime;
Anope::string last_realname;
/* Last usermask this nick was seen on, eg user@host */
Anope::string last_usermask;
/* Last uncloaked usermask, requires nickserv/auspex to see */
Anope::string last_realhost;
time_t time_registered;
time_t last_seen;
/* Account this nick is tied to. Multiple nicks can be tied to a single account. */
Serialize::Reference<NickCore> nc;
@@ -68,59 +55,56 @@ public:
NickAlias(const Anope::string &nickname, NickCore *nickcore);
~NickAlias();
void Serialize(Serialize::Data &data) const override;
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
/** Set a vhost for the user
* @param ident The ident
* @param host The host
* @param creator Who created the vhost
* @param time When the vhost was created
*/
void SetVHost(const Anope::string &ident, const Anope::string &host, const Anope::string &creator, time_t created = Anope::CurTime);
void SetVhost(const Anope::string &ident, const Anope::string &host, const Anope::string &creator, time_t created = Anope::CurTime);
/** Remove a users vhost
**/
void RemoveVHost();
void RemoveVhost();
/** Check if the user has a vhost
* @return true or false
*/
bool HasVHost() const;
bool HasVhost() const;
/** Retrieve the vhost ident
* @return the ident
*/
const Anope::string &GetVHostIdent() const;
const Anope::string &GetVhostIdent() const;
/** Retrieve the vhost host
* @return the host
*/
const Anope::string &GetVHostHost() const;
const Anope::string &GetVhostHost() const;
/** Retrieve the vhost mask
* @param the mask
*/
Anope::string GetVHostMask() const;
Anope::string GetVhostMask() const;
/** Retrieve the vhost creator
* @return the creator
*/
const Anope::string &GetVHostCreator() const;
const Anope::string &GetVhostCreator() const;
/** Retrieve when the vhost was created
* @return the time it was created
*/
time_t GetVHostCreated() const;
/** Update the last seen time for the nickname.
* @param u The user who is using the nickname.
*/
void UpdateSeen(User *u);
time_t GetVhostCreated() const;
/** Finds a registered nick
* @param nick The nick to lookup
* @return the nick, if found
*/
static NickAlias *Find(const Anope::string &nick);
static NickAlias *FindId(uint64_t uid);
};
/* A registered account. Each account must have a NickAlias with the same nick as the
@@ -131,20 +115,10 @@ class CoreExport NickCore final
: public Serializable
, public Extensible
{
public:
struct Type final
: public Serialize::Type
{
Type();
void Serialize(Serializable *obj, Serialize::Data &data) const override;
Serializable *Unserialize(Serializable *obj, Serialize::Data &data) const override;
};
private:
/* Channels which reference this core in some way (this is on their access list, akick list, is founder, successor, etc) */
Serialize::Checker<std::map<ChannelInfo *, int> > chanaccess;
/* Unique identifier for the account. */
uint64_t uniqueid;
uint64_t id;
public:
/* Name of the account. Find(display)->nc == this. */
Anope::string display;
@@ -153,12 +127,8 @@ public:
Anope::string email;
/* Locale name of the language of the user. Empty means default language */
Anope::string language;
/* Last time an email was sent to this user */
time_t lastmail = 0;
/* The time this account was registered */
time_t registered = Anope::CurTime;
MemoInfo memos;
std::map<Anope::string, ModeData> last_modes;
std::map<Anope::string, Anope::string> last_modes;
/* Nicknames registered that are grouped to this account.
* for n in aliases, n->nc == this.
@@ -166,14 +136,14 @@ public:
Serialize::Checker<std::vector<NickAlias *> > aliases;
/* Set if this user is a services operator. o->ot must exist. */
Oper *o = nullptr;
Oper *o;
/* Unsaved data */
/** The display nick for this account. */
Serialize::Reference<NickAlias> na;
/* Number of channels registered by this account */
uint16_t channelcount = 0;
uint16_t channelcount;
/* Last time an email was sent to this user */
time_t lastmail;
/* Users online now logged into this account */
std::list<User *> users;
@@ -184,15 +154,18 @@ public:
NickCore(const Anope::string &nickdisplay, uint64_t nickid = 0);
~NickCore();
void Serialize(Serialize::Data &data) const override;
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
/** Changes the display for this account
* @param na The new display, must be grouped to this account.
*/
void SetDisplay(NickAlias *na);
void SetDisplay(const NickAlias *na);
/** Checks whether this account is a services oper or not.
* @return True if this account is a services oper, false otherwise.
*/
bool IsServicesOper() const;
virtual bool IsServicesOper() const;
/** Retrieves the account id for this user */
uint64_t GetId();
@@ -202,7 +175,6 @@ public:
* @return The account, if it exists
*/
static NickCore *Find(const Anope::string &nick);
static NickCore *FindId(uint64_t uid);
void AddChannelReference(ChannelInfo *ci);
void RemoveChannelReference(ChannelInfo *ci);
@@ -219,7 +191,6 @@ class CoreExport IdentifyRequest
Module *owner;
Anope::string account;
Anope::string password;
Anope::string address;
std::set<Module *> holds;
bool dispatched = false;
@@ -228,18 +199,17 @@ class CoreExport IdentifyRequest
static std::set<IdentifyRequest *> Requests;
protected:
IdentifyRequest(Module *o, const Anope::string &acc, const Anope::string &pass, const Anope::string &ip);
IdentifyRequest(Module *o, const Anope::string &acc, const Anope::string &pass);
virtual ~IdentifyRequest();
public:
/* One of these is called when the request goes through */
virtual void OnSuccess(NickAlias *na) = 0;
virtual void OnSuccess() = 0;
virtual void OnFail() = 0;
Module *GetOwner() const { return owner; }
const Anope::string &GetAccount() const { return account; }
const Anope::string &GetPassword() const { return password; }
const Anope::string &GetAddress() const { return address; }
/* Holds this request. When a request is held it must be Released later
* for the request to complete. Multiple modules may hold a request at any time,
@@ -259,7 +229,7 @@ public:
* If this request is behind held it must still be Released after calling this.
* @param m The module confirming authentication
*/
void Success(Module *m, NickAlias *na);
void Success(Module *m);
/** Used to either finalize this request or marks
* it as dispatched and begins waiting for the module(s)
+132 -57
View File
@@ -1,16 +1,13 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
#pragma once
@@ -18,9 +15,6 @@
#include "hashcomp.h"
#define UTF_CPP_CPLUSPLUS 201703L
#include "utfcpp/unchecked.h"
namespace Anope
{
/**
@@ -45,7 +39,6 @@ namespace Anope
typedef std::string::reverse_iterator reverse_iterator;
typedef std::string::const_reverse_iterator const_reverse_iterator;
typedef std::string::size_type size_type;
typedef std::string::value_type value_type;
static const size_type npos = static_cast<size_type>(-1);
/**
@@ -58,7 +51,6 @@ namespace Anope
string(const char *_str, size_type n) : _string(_str, n) { }
string(const std::string &_str) : _string(_str) { }
string(const ci::string &_str) : _string(_str.c_str()) { }
string(const std::string_view &_sv) : _string(_sv.begin(), _sv.end()) { }
string(const string &_str, size_type pos, size_type n = npos) : _string(_str._string, pos, n) { }
template <class InputIterator> string(InputIterator first, InputIterator last) : _string(first, last) { }
string(const string &) = default;
@@ -136,7 +128,6 @@ namespace Anope
* Returns the string's length.
*/
inline size_type length() const { return this->_string.length(); }
inline size_type utf8length() const { return utf8::unchecked::distance(str().begin(), str().end()); }
/**
* Returns the size of the currently allocated storage space in the string object.
@@ -229,14 +220,6 @@ namespace Anope
inline bool is_number_only() const { return this->find_first_not_of("0123456789.-") == npos; }
inline bool is_pos_number_only() const { return this->find_first_not_of("0123456789.") == npos; }
/**
* In IRC messages we use a substitute (ASCII 0x1B) instead of a space
* (ASCII 0x20) so it doesn't get line wrapped when put into a message.
* The line wrapper will convert this to a space before it is sent to
* clients.
*/
inline Anope::string nobreak() const { return this->replace_all_cs("\x20", "\x1B"); }
/**
* Replace parts of the string.
*/
@@ -360,9 +343,9 @@ namespace Anope
using multimap = std::multimap<string, T, ci::less>;
template<typename T>
using unordered_map = std::unordered_map<string, T, hash_ci, compare>;
using hash_map = std::unordered_map<string, T, hash_ci, compare>;
#if !REPRODUCIBLE_BUILD
#ifndef REPRODUCIBLE_BUILD
static const char *const compiled = __TIME__ " " __DATE__;
#endif
@@ -383,15 +366,14 @@ namespace Anope
* Use this unless you need very specific time checks
*/
extern CoreExport time_t CurTime;
extern CoreExport long long CurTimeNs;
/** The debug level we are running at.
*/
extern CoreExport unsigned Debug;
extern CoreExport int Debug;
/** Other command line options.
*/
extern CoreExport bool ReadOnly, NoFork, NoThird, NoDB, NoPID, NoExpire, ProtocolDebug;
extern CoreExport bool ReadOnly, NoFork, NoThird, NoExpire, ProtocolDebug;
/** The root of the Anope installation. Usually ~/anope
*/
@@ -418,9 +400,9 @@ namespace Anope
extern CoreExport string Version();
extern CoreExport string VersionShort();
extern CoreExport string VersionBuildString();
extern CoreExport unsigned VersionMajor();
extern CoreExport unsigned VersionMinor();
extern CoreExport unsigned VersionPatch();
extern CoreExport int VersionMajor();
extern CoreExport int VersionMinor();
extern CoreExport int VersionPatch();
/** Determines if we are still attached to the terminal, and can print
* messages to the user via stderr/stdout.
@@ -471,11 +453,39 @@ namespace Anope
extern CoreExport void Unhex(const string &src, string &dest);
extern CoreExport void Unhex(const string &src, char *dest, size_t sz);
/** Base 64 encode a string
* @param src The string to encode
* @param target Where the encoded string is placed
*/
extern CoreExport void B64Encode(const string &src, string &target);
/** Base 64 decode a string
* @param src The base64 encoded string
* @param target The plain text result
*/
extern CoreExport void B64Decode(const string &src, string &target);
/** Encrypts what is in 'src' to 'dest'
* @param src The source string to encrypt
* @param dest The destination where the encrypted string is placed
*/
extern CoreExport bool Encrypt(const Anope::string &src, Anope::string &dest);
extern CoreExport void Encrypt(const Anope::string &src, Anope::string &dest);
/** Hashes a buffer with SipHash-2-4
* @param src The start of the buffer to hash
* @param src_sz The total number of bytes in the buffer
* @param key A 16 byte key to hash the buffer with.
*/
extern CoreExport uint64_t SipHash24(const void *src, unsigned long src_sz, const char key[16]);
/** Returns a sequence of data formatted as the format argument specifies.
** After the format parameter, the function expects at least as many
** additional arguments as specified in format.
* @param fmt Format of the Message
* @param ... any number of parameters
* @return a Anope::string
*/
extern CoreExport string printf(const char *fmt, ...) ATTR_FORMAT(1, 2);
/** Return the last error code
* @return The error code
@@ -500,10 +510,9 @@ namespace Anope
/** Retrieves a human readable string representing the time in seconds
* @param seconds The time on seconds, eg 60
* @param nc The account to use language settings for to translate this string, if applicable
* @param round Whether to round the duration to produce a shorter output.
* @return A human readable string, eg "1 minute"
*/
extern CoreExport Anope::string Duration(time_t seconds, const NickCore *nc = nullptr, bool round = false);
extern CoreExport Anope::string Duration(time_t seconds, const NickCore *nc = NULL);
/** Generates a human readable string of type "expires in ..."
* @param expires time in seconds
@@ -519,18 +528,16 @@ namespace Anope
*/
extern CoreExport Anope::string strftime(time_t t, const NickCore *nc = NULL, bool short_output = false);
/** Parses a raw message from the uplink and calls its command handler.
* @param message Raw message from the uplink
/** Normalize buffer, stripping control characters and colors
* @param A string to be parsed for control and color codes
* @return A string stripped of control and color codes
*/
extern void Process(const Anope::string &message);
extern CoreExport Anope::string NormalizeBuffer(const Anope::string &);
/** Calls the command handler for an already parsed message.
* @param source Source of the message.
* @param command Command name.
* @param params Any extra parameters.
* @param tags IRCv3 message tags.
/** Main processing routine. Parses the message and takes the appropriate action.
* @param Raw message from the uplink
*/
extern CoreExport void ProcessInternal(MessageSource &src, const Anope::string &command, const std::vector<Anope::string> &params, const Anope::map<Anope::string> & tags);
extern void Process(const Anope::string &);
/** Does a blocking dns query and returns the first IP.
* @param host host to look up
@@ -551,11 +558,11 @@ namespace Anope
*/
extern CoreExport Anope::string Random(size_t len);
/** Generate a random number. */
extern CoreExport int RandomNumber();
/** Update the current time. */
extern CoreExport void UpdateTime();
/** Calculates the levenshtein distance between two strings.
* @param s1 The first string.
* @param s2 The second string.
*/
extern CoreExport size_t Distance(const Anope::string &s1, const Anope::string &s2);
}
/** sepstream allows for splitting token separated lists.
@@ -583,9 +590,6 @@ public:
*/
sepstream(const Anope::string &source, char separator, bool allowempty = false);
/** Retrieves the underlying string. */
const auto &GetString() const { return tokens; }
/** Fetch the next token from the stream
* @param token The next token from the stream is placed here
* @return True if tokens still remain, false if there are none left
@@ -672,6 +676,9 @@ protected:
*/
Anope::string source;
public:
/** Default constructor, just uses the error message 'Core threw an exception'.
*/
CoreException() : err("Core threw an exception"), source("The core") { }
/** This constructor can be used to specify an error message before throwing.
*/
CoreException(const Anope::string &message) : err(message), source("The core") { }
@@ -702,6 +709,10 @@ class CoreExport ModuleException
: public CoreException
{
public:
/** Default constructor, just uses the error message 'Module threw an exception'.
*/
ModuleException() : CoreException("Module threw an exception", "A Module") { }
/** This constructor can be used to specify an error message before throwing.
*/
ModuleException(const Anope::string &message) : CoreException(message, "A Module") { }
@@ -712,6 +723,72 @@ public:
virtual ~ModuleException() noexcept = default;
};
class CoreExport ConvertException final
: public CoreException
{
public:
ConvertException(const Anope::string &reason = "") : CoreException(reason) { }
virtual ~ConvertException() noexcept = default;
};
/** Convert something to a string
*/
inline Anope::string stringify(const Anope::string &x)
{
return x;
}
template<typename T> inline Anope::string stringify(const T &x)
{
std::ostringstream stream;
if (!(stream << x))
throw ConvertException("Stringify fail");
return stream.str();
}
template<typename T> inline void convert(const Anope::string &s, T &x, Anope::string &leftover, bool failIfLeftoverChars = true)
{
leftover.clear();
std::istringstream i(s.str());
char c;
if (!(i >> x))
throw ConvertException("Convert fail");
if (failIfLeftoverChars)
{
if (i.get(c))
throw ConvertException("Convert fail");
}
else
{
std::string left;
getline(i, left);
leftover = left;
}
}
template<typename T> inline void convert(const Anope::string &s, T &x, bool failIfLeftoverChars = true)
{
Anope::string Unused;
convert(s, x, Unused, failIfLeftoverChars);
}
template<typename T> inline T convertTo(const Anope::string &s, Anope::string &leftover, bool failIfLeftoverChars = true)
{
T x;
convert(s, x, leftover, failIfLeftoverChars);
return x;
}
template<typename T> inline T convertTo(const Anope::string &s, bool failIfLeftoverChars = true)
{
T x;
convert(s, x, failIfLeftoverChars);
return x;
}
/** Casts to be used instead of dynamic_cast, this uses dynamic_cast
* for debug builds and static_cast on release builds
* to speed up the program because dynamic_cast relies on RTTI.
@@ -731,5 +808,3 @@ template<typename T, typename O> inline T anope_dynamic_static_cast(O ptr)
return static_cast<T>(ptr);
}
#endif
#include "convert.h"
+7 -14
View File
@@ -1,17 +1,10 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
// Copyright (C) 2008-2011 Adam <Adam@anope.org>
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2008-2011 Adam <Adam@anope.org>
* (C) 2008-2024 Anope Team <team@anope.org>
*
* Please read COPYING and README for further details.
*/
#pragma once
+8 -34
View File
@@ -1,19 +1,10 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
// Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
* (C) 2008-2024 Anope Team <team@anope.org>
*
* Please read COPYING and README for further details.
*/
#pragma once
@@ -32,16 +23,6 @@ class CoreExport BotInfo final
: public User
, public Serializable
{
public:
struct Type final
: public Serialize::Type
{
Type();
void Serialize(Serializable *obj, Serialize::Data &data) const override;
Serializable *Unserialize(Serializable *obj, Serialize::Data &data) const override;
};
private:
/* Channels this bot is assigned to */
Serialize::Checker<std::set<ChannelInfo *> > channels;
public:
@@ -50,10 +31,6 @@ public:
time_t lastmsg;
/* Map of actual command names -> service name/permission required */
CommandInfo::map commands;
/** CTCP responses this bot can send. */
Anope::map<std::function<void(BotInfo *, User *, const Anope::string &)>> ctcps;
/* The server-side alias used to message this bot. */
Anope::string alias;
/* Modes the bot should have as configured in service:modes */
Anope::string botmodes;
/* Channels the bot should be in as configured in service:channels */
@@ -133,7 +110,7 @@ public:
* @param message The users' message
* @params tags Message tags
*/
void OnMessage(User *u, const Anope::string &message, const Anope::map<Anope::string> &tags);
virtual void OnMessage(User *u, const Anope::string &message, const Anope::map<Anope::string> &tags);
/** Link a command name to a command in services
* @param cname The command name
@@ -149,9 +126,6 @@ public:
*/
CommandInfo *GetCommand(const Anope::string &cname);
/** Get the command that users can use to send a message to this bot. */
Anope::string GetQueryCommand(const Anope::string &command = "", const Anope::string &extra = "") const;
/** Find a bot by nick
* @param nick The nick
* @param nick_only True to only look by nick, and not by UID
+34 -44
View File
@@ -1,16 +1,10 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/* Channel support
*
* (C) 2008-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
#pragma once
@@ -19,12 +13,12 @@
#include "modes.h"
#include "serialize.h"
typedef Anope::unordered_map<Channel *> channel_map;
typedef Anope::hash_map<Channel *> channel_map;
extern CoreExport channel_map ChannelList;
/* A user's membership to a channel, there is one of these per user per channel. */
struct Membership final
/* A user container, there is one of these per user per channel. */
struct ChanUserContainer final
: public Extensible
{
User *user;
@@ -32,11 +26,7 @@ struct Membership final
/* Status the user has in the channel */
ChannelStatus status;
Membership(User *u, Channel *c)
: user(u)
, chan(c)
{
}
ChanUserContainer(User *u, Channel *c) : user(u), chan(c) { }
};
class CoreExport Channel final
@@ -46,7 +36,7 @@ class CoreExport Channel final
static std::vector<Channel *> deleting;
public:
typedef std::multimap<Anope::string, ModeData> ModeList;
typedef std::multimap<Anope::string, Anope::string> ModeList;
private:
/** A map of channel modes with their parameters set on this channel
*/
@@ -58,14 +48,14 @@ public:
/* Set if this channel is registered. ci->c == this. Contains information relevant to the registered channel */
Serialize::Reference<ChannelInfo> ci;
/* When the channel was created */
time_t created;
time_t creation_time;
/* If the channel has just been created in a netjoin */
bool syncing = false;
bool syncing;
/* Is configured in the conf as a channel bots should be in */
bool botchannel = false;
bool botchannel;
/* Users in the channel */
typedef std::map<User *, Membership *> ChanUserList;
typedef std::map<User *, ChanUserContainer *> ChanUserList;
ChanUserList users;
/* Current topic of the channel */
@@ -76,15 +66,15 @@ public:
* This is the time the topic was *originally set*. When we restore the topic we want to change the TS back
* to this, but we can only do this on certain IRCds.
*/
time_t topic_ts = 0;
time_t topic_ts;
/* The actual time the topic was set, probably close to Anope::CurTime */
time_t topic_time = 0;
time_t topic_time;
time_t server_modetime = 0; /* Time of last server MODE */
time_t chanserv_modetime = 0; /* Time of last check_modes() */
int16_t server_modecount = 0; /* Number of server MODEs this second */
int16_t chanserv_modecount = 0; /* Number of check_mode()'s this sec */
bool bouncy_modes = false; /* Did we fail to set modes here? */
time_t server_modetime; /* Time of last server MODE */
time_t chanserv_modetime; /* Time of last check_modes() */
int16_t server_modecount; /* Number of server MODEs this second */
int16_t chanserv_modecount; /* Number of check_mode()'s this sec */
int16_t bouncy_modes; /* Did we fail to set modes here? */
private:
/** Constructor
@@ -118,9 +108,9 @@ public:
/** Join a user internally to the channel
* @param u The user
* @param status The status to give the user, if any
* @return The membership for the user
* @return The UserContainer for the user
*/
Membership *JoinUser(User *u, const ChannelStatus *status);
ChanUserContainer *JoinUser(User *u, const ChannelStatus *status);
/** Remove a user internally from the channel
* @param u The user
@@ -129,9 +119,9 @@ public:
/** Check if the user is on the channel
* @param u The user
* @return A membership if found, else NULL
* @return A user container if found, else NULL
*/
Membership *FindUser(User *u) const;
ChanUserContainer *FindUser(User *u) const;
/** Check if a user has a status on a channel
* @param u The user
@@ -158,10 +148,10 @@ public:
/** Set a mode internally on a channel, this is not sent out to the IRCd
* @param setter The setter
* @param cm The mode
* @param data Data about the mode.
* @param param The param
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
*/
void SetModeInternal(MessageSource &source, ChannelMode *cm, const ModeData &data = {}, bool enforce_mlock = true);
void SetModeInternal(MessageSource &source, ChannelMode *cm, const Anope::string &param = "", bool enforce_mlock = true);
/** Remove a mode internally on a channel, this is not sent out to the IRCd
* @param setter The Setter
@@ -174,19 +164,19 @@ public:
/** Set a mode on a channel
* @param bi The client setting the modes
* @param cm The mode
* @param data Data about the mode
* @param param Optional param arg for the mode
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
*/
void SetMode(BotInfo *bi, ChannelMode *cm, const ModeData &data = {}, bool enforce_mlock = true);
void SetMode(BotInfo *bi, ChannelMode *cm, const Anope::string &param = "", bool enforce_mlock = true);
/**
* Set a mode on a channel
* @param bi The client setting the modes
* @param name The mode name
* @param data Data about the mode
* @param param Optional param arg for the mode
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
*/
void SetMode(BotInfo *bi, const Anope::string &name, const ModeData &data = {}, bool enforce_mlock = true);
void SetMode(BotInfo *bi, const Anope::string &name, const Anope::string &param = "", bool enforce_mlock = true);
/** Remove a mode from a channel
* @param bi The client setting the modes
@@ -225,7 +215,7 @@ public:
* @param mode the modes
* @param enforce_mlock true to enforce mlock
*/
void SetModesInternal(MessageSource &source, const Anope::string &modes, const std::vector<Anope::string> &params, time_t ts = 0, bool enforce_mlock = true);
void SetModesInternal(MessageSource &source, const Anope::string &mode, time_t ts = 0, bool enforce_mlock = true);
/** Does the given user match the given list? (CMODE_BAN, CMODE_EXCEPT, etc, a list mode)
* @param u The user
+25 -37
View File
@@ -1,23 +1,19 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/* Declarations for command data.
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
#pragma once
#include "service.h"
#include "anope.h"
#include "channels.h"
#include "textproc.h"
struct CommandGroup final
{
@@ -35,12 +31,10 @@ struct CommandInfo final
Anope::string permission;
/* Group this command is in */
Anope::string group;
/* Whether to hide this command in help and suggestions */
/* whether or not to hide this command in help output */
bool hide = false;
/* Whether to prepend the channel name (only used with fantasy) */
/* Only used with fantasy */
bool prepend_channel = false;
/* Whether to require the FANTASY privilege (only used with fantasy) */
bool require_privilege = true;
};
/* Where the replies from commands go to. User inherits from this and is the normal
@@ -87,14 +81,8 @@ public:
bool IsFounder(ChannelInfo *ci);
void Reply(const char *message, ...) ATTR_FORMAT(2, 3);
void Reply(int count, const char *singular, const char *plural, ...) ATTR_FORMAT(4, 5);
void Reply(const Anope::string &message);
const char *Translate(const char *message);
const char *Translate(const Anope::string &message);
const char *Translate(int count, const char *single, const char *plural);
const char *Translate(int count, const Anope::string &single, const Anope::string &plural);
bool HasCommand(const Anope::string &cmd);
bool HasPriv(const Anope::string &cmd);
bool IsServicesOper();
@@ -107,11 +95,11 @@ class CoreExport Command
: public Service
{
Anope::string desc;
std::vector<std::pair<Anope::string, std::function<bool(CommandSource&)>>> syntax;
std::vector<Anope::string> syntax;
/* Allow unregistered users to use this command */
bool allow_unregistered = false;
bool allow_unregistered;
/* Command requires that a user is executing it */
bool require_user = false;
bool require_user;
public:
/* Maximum parameters accepted by this command */
@@ -139,21 +127,21 @@ protected:
void SetDesc(const Anope::string &d);
void ClearSyntax();
void SetSyntax(const Anope::string &s, const std::function<bool(CommandSource&)> &p = nullptr);
virtual void SendSyntax(CommandSource &);
void SetSyntax(const Anope::string &s);
void SendSyntax(CommandSource &);
void AllowUnregistered(bool b);
void RequireUser(bool b);
public:
inline bool AllowUnregistered() const { return this->allow_unregistered; }
inline bool RequireUser() const { return this->require_user; }
bool AllowUnregistered() const;
bool RequireUser() const;
/** Get the command description
* @param source The source wanting the command description
* @return The commands description
*/
virtual Anope::string GetDesc(CommandSource &source) const;
virtual const Anope::string GetDesc(CommandSource &source) const;
/** Execute this command.
* @param source The source
@@ -161,10 +149,10 @@ public:
*/
virtual void Execute(CommandSource &source, const std::vector<Anope::string> &params) = 0;
/** Called when help is requested for the client this command is on.
/** Called when HELP is requested for the client this command is on.
* @param source The source
*/
virtual void OnServHelp(CommandSource &source, HelpWrapper &help);
virtual void OnServHelp(CommandSource &source);
/** Requested when the user is requesting help on this command. Help on this command should be sent to the user.
* @param source The source
@@ -183,9 +171,9 @@ public:
* @param source The source of the command
* @param message The full message to run, the command is at the beginning of the message
*/
static bool Run(CommandSource &source, const Anope::string &message);
static void Run(CommandSource &source, const Anope::string &message);
bool Run(CommandSource &source, const Anope::string &, const CommandInfo &, std::vector<Anope::string> &params);
void Run(CommandSource &source, const Anope::string &, const CommandInfo &, std::vector<Anope::string> &params);
/** Looks up a command name from the service name.
* Note that if the same command exists multiple places this will return the first one encountered
@@ -194,5 +182,5 @@ public:
* @param name If found, is set to the command name, eg REGISTER
* @return true if the given command service exists
*/
static bool FindFromService(const Anope::string &command_service, BotInfo *&bi, Anope::string &name);
static bool FindCommandFromService(const Anope::string &command_service, BotInfo *&bi, Anope::string &name);
};
+46 -40
View File
@@ -1,16 +1,13 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
#pragma once
@@ -18,24 +15,25 @@
#include "regchannel.h"
#include "users.h"
#include "opertype.h"
#include "miscutils.h"
#include <stack>
namespace Configuration
{
namespace Internal
{
class CoreExport Block
{
friend class Configuration::Conf;
friend struct Configuration::Conf;
public:
typedef Anope::map<Anope::string> ItemMap;
typedef Anope::multimap<Block> BlockMap;
typedef Anope::iterator_range<BlockMap::const_iterator> BlockList;
typedef Anope::map<Anope::string> item_map;
typedef Anope::multimap<Block> block_map;
private:
Anope::string name;
ItemMap items;
BlockMap blocks;
unsigned linenum;
item_map items;
block_map blocks;
int linenum;
/* Represents a missing tag. */
static Block EmptyBlock;
@@ -43,23 +41,33 @@ namespace Configuration
public:
Block(const Anope::string &);
const Anope::string &GetName() const;
size_t CountBlock(const Anope::string &name) const;
BlockList GetBlocks(const Anope::string &name) const;
const Block &GetBlock(const Anope::string &name, size_t num = 0) const;
Block *GetMutableBlock(const Anope::string &name, size_t num = 0);
int CountBlock(const Anope::string &name) const;
const Block *GetBlock(const Anope::string &name, int num = 0) const;
Block *GetMutableBlock(const Anope::string &name, int num = 0);
template<typename T> T Get(const Anope::string &tag, const Anope::string &def = "") const
{
return Anope::TryConvert<T>(this->Get<const Anope::string>(tag, def)).value_or(T());
const Anope::string &value = this->Get<const Anope::string>(tag, def);
if (!value.empty())
try
{
return convertTo<T>(value);
}
catch (const ConvertException &) { }
return T();
}
bool Set(const Anope::string &tag, const Anope::string &value);
const ItemMap &GetItems() const;
const item_map &GetItems() const;
};
template<> CoreExport const Anope::string Block::Get(const Anope::string &tag, const Anope::string &def) const;
template<> CoreExport time_t Block::Get(const Anope::string &tag, const Anope::string &def) const;
template<> CoreExport bool Block::Get(const Anope::string &tag, const Anope::string &def) const;
} // namespace Internal
typedef const Internal::Block Block;
typedef Internal::Block MutableBlock;
/** Represents a configuration file
*/
@@ -83,27 +91,26 @@ namespace Configuration
struct Uplink;
class CoreExport Conf final
: public Block
struct CoreExport Conf final
: Block
{
private:
/** Replaces defined variables within a string. */
Anope::string ReplaceVars(const Anope::string &str, const File &file, unsigned linenumber);
public:
/* options:readtimeout */
time_t ReadTimeout;
/* options:useprivmsg */
bool UsePrivmsg;
/* If we should default to privmsging clients */
bool DefPrivmsg;
/* Default language */
Anope::string DefLanguage;
/* options:timeoutcheck */
time_t TimeoutCheck;
/* options:servicealias */
bool ServiceAlias;
/* options:usestrictprivmsg */
bool UseStrictPrivmsg;
/* networkinfo:nickchars */
Anope::string NickChars;
/* either "/msg " or "/" */
Anope::string StrictPrivmsg;
/* List of uplink servers to try and connect to */
std::vector<Uplink> Uplinks;
/* A vector of our logfile options */
@@ -131,12 +138,12 @@ namespace Configuration
void LoadConf(File &file);
void Post(Conf *old);
Block &GetModule(const Module *);
Block &GetModule(const Anope::string &name);
Block *GetModule(Module *);
Block *GetModule(const Anope::string &name);
BotInfo *GetClient(const Anope::string &name);
const Block &GetCommand(CommandSource &);
const Block *GetCommand(CommandSource &);
};
struct Uplink final
@@ -149,7 +156,6 @@ namespace Configuration
Uplink(const Anope::string &_host, int _port, const Anope::string &_password, int _protocol) : host(_host), port(_port), password(_password), protocol(_protocol) { }
inline bool operator==(const Uplink &other) const { return host == other.host && port == other.port && password == other.password && protocol == other.protocol; }
inline bool operator!=(const Uplink &other) const { return !(*this == other); }
Anope::string str() const;
};
}
-135
View File
@@ -1,135 +0,0 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
#pragma once
#include <optional>
namespace Anope
{
/** Attempts to convert a string to any type.
* @param in The value to convert.
* @param leftover If non-nullptr then the location to store leftover data.
*/
template<typename T>
inline std::optional<T> TryConvert(const Anope::string &in, Anope::string *leftover = nullptr)
{
std::istringstream tmp(in.str());
T out;
if (!(tmp >> out))
return std::nullopt;
if (leftover)
{
leftover->clear();
std::getline(tmp, leftover->str());
}
else
{
char extra;
if (tmp >> extra)
return std::nullopt;
}
return out;
}
/** Converts a string to any type.
* @param in The value to convert.
* @param def The default to use if the conversion failed.
* @param leftover If non-nullptr then the location to store leftover data.
*/
template<typename T>
inline T Convert(const Anope::string &in, T def, Anope::string *leftover = nullptr)
{
return TryConvert<T>(in, leftover).value_or(def);
}
/** Attempts to convert any type to a string.
* @param in The value to convert.
*/
template <class T>
inline std::optional<Anope::string> TryString(const T &in)
{
std::ostringstream tmp;
if (!(tmp << in))
return std::nullopt;
return tmp.str();
}
/** No-op function that returns the string that was passed to it.
* @param in The string to return.
*/
inline const string &ToString(const string &in)
{
return in;
}
/** Converts a std::string to a string.
* @param in The value to convert.
*/
inline string ToString(const std::string &in)
{
return in;
}
/** Converts a char array to a string.
* @param in The value to convert.
*/
inline string ToString(const char *in)
{
return string(in);
}
/** Converts a char to a string.
* @param in The value to convert.
*/
inline string ToString(char in)
{
return string(1, static_cast<string::value_type>(in));
}
/** Converts an unsigned char to a string.
* @param in The value to convert.
*/
inline string ToString(unsigned char in)
{
return string(1, static_cast<string::value_type>(in));
}
/** Converts a bool to a string.
* @param in The value to convert.
*/
inline string ToString(bool in)
{
return (in ? "1" : "0");
}
/** Converts a type that std::to_string is implemented for to a string.
* @param in The value to convert.
*/
template<typename Stringable>
inline std::enable_if_t<std::is_arithmetic_v<Stringable>, string> ToString(const Stringable &in)
{
return std::to_string(in);
}
/** Converts any type to a string.
* @param in The value to convert.
*/
template <class T>
inline std::enable_if_t<!std::is_arithmetic_v<T>, string> ToString(const T &in)
{
return TryString(in).value_or(Anope::string());
}
}
+20 -23
View File
@@ -1,31 +1,29 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
#pragma once
class AccessGroup;
class AutoKick;
class BotInfo;
namespace BotServ { class BadWord; }
class CallBack;
class ChanAccess;
class Channel;
class ChannelInfo;
class ChannelStatus;
namespace ChanServ { class AutoKick; class ModeLock; }
struct ChanUserContainer;
class ClientSocket;
class Command;
class CommandSource;
namespace Configuration { class Conf; }
namespace Configuration { struct Conf; }
class ConnectionSocket;
namespace DNS { struct Query; }
class Entry;
@@ -34,21 +32,14 @@ class InfoFormatter;
class IRCDProto;
class ListenSocket;
class Log;
struct Membership;
class Memo;
struct MemoInfo;
class MessageSource;
struct ModeData;
class Module;
class NickAlias;
class NickCore;
namespace NickServ { struct Cert; }
struct Oper;
namespace OperServ { struct Exception; }
class OperType;
class ReferenceBase;
class Regex;
namespace SASL { struct Message; }
class Serializable;
class Server;
class Socket;
@@ -56,3 +47,9 @@ class Thread;
class User;
class XLine;
class XLineManager;
struct BadWord;
struct Exception;
struct MemoInfo;
struct ModeLock;
struct Oper;
namespace SASL { struct Message; }
+13 -17
View File
@@ -1,16 +1,10 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
#pragma once
@@ -179,13 +173,13 @@ public:
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override
{
T *t = this->Get(e);
data.Store(this->name, *t);
data[this->name] << *t;
}
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
{
T t;
if (data.TryLoad(this->name, t))
if (data[this->name] >> t)
this->Set(e, t);
else
this->Unset(e);
@@ -200,12 +194,14 @@ public:
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override
{
data.Store(this->name, this->HasExt(e));
data[this->name] << true;
}
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
{
if (data.Load<bool>(this->name))
bool b = false;
data[this->name] >> b;
if (b)
this->Set(e);
else
this->Unset(e);
+7 -14
View File
@@ -1,17 +1,10 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
// Copyright (C) 2009-2011 InspIRCd Development Team
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2002-2011 InspIRCd Development Team
* (C) 2009-2024 Anope Team <team@anope.org>
*
* Please read COPYING and README for further details.
*/
#pragma once
+69 -121
View File
@@ -1,16 +1,10 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2008-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
#pragma once
@@ -41,14 +35,6 @@ namespace Language
*/
extern void InitLanguages();
/** Sets the locale to the specified language.
* @param lang The language to translate to.
*/
extern CoreExport void SetLocale(const char *lang);
/** Sets the locale back to the default. */
extern CoreExport void ResetLocale();
/** Translates a string to the default language.
* @param string A string to translate
* @return The translated string if found, else the original string.
@@ -69,112 +55,74 @@ namespace Language
*/
extern CoreExport const char *Translate(const NickCore *nc, const char *string);
/** Translates a string to the given language.
/** Translatesa string to the given language.
* @param lang The language to translate to
* @param string The string to translate
* @return The translated string if found, else the original string.
*/
extern CoreExport const char *Translate(const char *lang, const char *string);
/** Translates a plural string to the default language.
* @param count The number of items the string is counting.
* @param singular The string to translate if there is one of \p count
* @param plural The string to translate if there is multiple of \p count
* @return The translated string if found, else the original string.
*/
extern CoreExport const char *Translate(int count, const char *singular, const char *plural);
/** Translates a plural string to the language of the given user.
* @param u The user to translate the string for
* @param count The number of items the string is counting.
* @param singular The string to translate if there is one of \p count
* @param plural The string to translate if there is multiple of \p count
* @return The translated string if found, else the original string.
*/
extern CoreExport const char *Translate(User *u, int count, const char *singular, const char *plural);
/** Translates a plural string to the language of the given account.
* @param nc The account to translate the string for
* @param count The number of items the string is counting.
* @param singular The string to translate if there is one of \p count
* @param plural The string to translate if there is multiple of \p count
* @return The translated string if count, else the original string
*/
extern CoreExport const char *Translate(const NickCore *nc, int count, const char *singular, const char *plural);
/** Translates a plural string to the given language.
* @param lang The language to translate to
* @param count The number of items the string is counting.
* @param singular The string to translate if there is one of \p count
* @param plural The string to translate if there is multiple of \p count
* @return The translated string if found, else the original string.
*/
extern CoreExport const char *Translate(const char *lang, int count, const char *singular, const char *plural);
} // namespace Language
/* Commonly used language strings */
#define ACCESS_DENIED _("Access denied.")
#define BAD_EXPIRY_TIME _("Invalid expiry time.")
#define BAD_USERHOST_MASK _("Mask must be in the form \037user\037@\037host\037.")
#define CONFIRM_DROP _("Please confirm that you want to drop \002%s\002 with \002%s\033%s\033%s\002")
#define CONFIRM_REGISTER_ADMIN _("All new accounts must be confirmed by an administrator. Please wait for your registration to be confirmed.")
#define CONFIRM_REGISTER_CODE _("All new accounts must be confirmed. To confirm your account, type \002%s\002.")
#define CONFIRM_REGISTER_MAIL _("All new accounts must be confirmed. To confirm your account, follow the instructions that were emailed to you.")
#define LIST_INCORRECT_RANGE _("Incorrect range specified. The correct syntax is \002#\037from\037-\037to\037\002.")
#define MAIL_X_INVALID _("\002%s\002 is not a valid email address.")
#define MORE_INFO _("Type \002%s\002 for more information.")
#define NO_EXPIRE _("does not expire")
#define PASSWORD_INCORRECT _("Password incorrect.")
#define READ_ONLY_MODE _("Services are temporarily in read-only mode.")
#define TIME_NEVER _("Never")
#define TIME_NOW _("Now")
#define TIME_UNKNOWN _("Unknown")
#define TRY_AGAIN_LATER _("The \002%s\002 command is temporarily unavailable. Please try again later.")
#define USERHOST_MASK_TOO_WIDE _("%s coverage is too wide; Please use a more specific mask.")
#define BOT_DOES_NOT_EXIST _("Bot \002%s\002 does not exist.")
#define BOT_NOT_ASSIGNED _("You must assign a bot to the channel before using this command.")
#define BOT_NOT_ON_CHANNEL _("Bot is not on channel \002%s\002.")
#define CHAN_ACCESS_LIMIT N_("You can only have %u access entry on a channel.", "You can only have %u access entries on a channel.")
#define CHAN_ACCESS_LIMIT_DEEP N_("You can only have %u access entry on a channel, including access entries from other channels.", "You can only have %u access entries on a channel, including access entries from other channels.")
#define CHAN_ACCESS_LEVEL_RANGE _("Access level must be between %d and %d inclusive.")
#define CHAN_ACCESS_MALFORMED _("You cannot add a malformed mask to an access list. Did you mean to add %s instead?")
#define CHAN_ACCESS_FOREIGN N_("%u access entry from other access systems not shown; use \002%s\033ALL\002 to view all access entries.", "%u access entries from other access systems not shown; use \002%s\033ALL\002 to view all access entries.")
#define CHAN_EXCEPTED _("\002%s\002 matches an except on %s and cannot be banned until the except has been removed.")
#define CHAN_INFO_HEADER _("Information about channel \002%s\002:")
#define CHAN_LIMIT_EXCEEDED _("You have already exceeded your limit of \002%d\002 channels.")
#define CHAN_LIMIT_REACHED _("You have already reached your limit of \002%d\002 channels.")
#define CHAN_NOT_ALLOWED_TO_JOIN _("You are not permitted to be on this channel.")
#define CHAN_SETTING_CHANGED _("%s for %s set to %s.")
#define CHAN_SETTING_INVALID _("%s syntax is invalid.")
#define CHAN_SETTING_UNSET _("%s for %s unset.")
#define CHAN_SYMBOL_REQUIRED _("Please use the symbol of \002#\002 when attempting to register.")
#define CHAN_X_INVALID _("Channel %s is not a valid channel.")
#define CHAN_X_NOT_IN_USE _("Channel \002%s\002 doesn't exist.")
#define CHAN_X_NOT_REGISTERED _("Channel \002%s\002 isn't registered.")
#define CHAN_X_SUSPENDED _("Channel %s is currently suspended.")
#define HOST_NO_VIDENT _("Your IRCd does not support vidents. If this is incorrect please report this as a possible bug.")
#define HOST_NOT_ASSIGNED _("Please contact an Operator to get a vhost assigned to this nick.")
#define HOST_SET_VHOST_ERROR _("A vhost must be in the format of a valid hostname.")
#define HOST_SET_VHOST_TOO_LONG _("Error! The vhost is too long, please use a hostname shorter than %zu characters.")
#define HOST_SET_VIDENT_ERROR _("A vident must be in the format of a valid ident.")
#define HOST_SET_VIDENT_TOO_LONG _("Error! The vident is too long, please use an ident shorter than %zu characters.")
#define MEMO_HAVE_NO_MEMOS _("You have no memos.")
#define MEMO_HAVE_NO_NEW_MEMOS _("You have no new memos.")
#define MEMO_NEW_MEMO_ARRIVED _("You have a new memo from %s. Type \002%s\033%zu\002 to read it.")
#define MEMO_NEW_X_MEMO_ARRIVED _("There is a new memo on channel %s. Type \002%s\033%s\033%zu\002 to read it.")
#define MEMO_X_HAS_NO_MEMOS _("%s has no memos.")
#define MEMO_X_HAS_NO_NEW_MEMOS _("%s has no new memos.")
#define NICK_ALREADY_REGISTERED _("Nickname \002%s\002 is already registered!")
#define NICK_CANNOT_BE_REGISTERED _("Nickname \002%s\002 may not be registered.")
#define NICK_IDENTIFY_REQUIRED _("You must be logged into an account to use that command.")
#define NICK_SET_DISPLAY_CHANGED _("The new display is now \002%s\002.")
#define NICK_X_NOT_IN_USE _("Nick \002%s\002 isn't currently in use.")
#define NICK_X_NOT_ON_CHAN _("\002%s\002 is not currently on channel %s.")
#define NICK_X_NOT_REGISTERED _("Nick \002%s\002 isn't registered.")
#define NICK_X_SUSPENDED _("Nick %s is currently suspended.")
#define MORE_INFO _("\002%s%s HELP %s\002 for more information.")
#define BAD_USERHOST_MASK _("Mask must be in the form \037user\037@\037host\037.")
#define BAD_EXPIRY_TIME _("Invalid expiry time.")
#define USERHOST_MASK_TOO_WIDE _("%s coverage is too wide; Please use a more specific mask.")
#define READ_ONLY_MODE _("Services are in read-only mode!")
#define PASSWORD_INCORRECT _("Password incorrect.")
#define ACCESS_DENIED _("Access denied.")
#define MORE_OBSCURE_PASSWORD _("Please try again with a more obscure password. Passwords should not be\n" \
"something that could be easily guessed (e.g. your real name or your nick) and\n" \
"cannot contain the space or tab characters.\n")
#define PASSWORD_TOO_SHORT _("Your password is too short. It must be longer than %u characters.")
#define PASSWORD_TOO_LONG _("Your password is too long. It must be shorter than %u characters.")
#define NICK_NOT_REGISTERED _("Your nick isn't registered.")
#define NICK_X_NOT_REGISTERED _("Nick \002%s\002 isn't registered.")
#define NICK_X_NOT_IN_USE _("Nick \002%s\002 isn't currently in use.")
#define NICK_X_NOT_ON_CHAN _("\002%s\002 is not currently on channel %s.")
#define NICK_X_SUSPENDED _("Nick %s is currently suspended.")
#define CHAN_X_SUSPENDED _("Channel %s is currently suspended.")
#define CHAN_X_NOT_REGISTERED _("Channel \002%s\002 isn't registered.")
#define CHAN_X_NOT_IN_USE _("Channel \002%s\002 doesn't exist.")
#define NICK_IDENTIFY_REQUIRED _("You must be logged into an account to use that command.")
#define MAIL_X_INVALID _("\002%s\002 is not a valid e-mail address.")
#define UNKNOWN _("<unknown>")
#define NO_EXPIRE _("does not expire")
#define LIST_INCORRECT_RANGE _("Incorrect range specified. The correct syntax is \002#\037from\037-\037to\037\002.")
#define NICK_IS_SECURE _("This nickname is registered and protected. If it is your\n" \
"nick, type \002%s%s IDENTIFY \037password\037\002. Otherwise,\n" \
"please choose a different nick.")
#define FORCENICKCHANGE_NOW _("This nickname has been registered; you may not use it.")
#define NICK_CANNOT_BE_REGISTERED _("Nickname \002%s\002 may not be registered.")
#define NICK_ALREADY_REGISTERED _("Nickname \002%s\002 is already registered!")
#define NICK_SET_DISPLAY_CHANGED _("The new display is now \002%s\002.")
#define NICK_CONFIRM_INVALID _("Invalid passcode has been entered, please check the e-mail again, and retry.")
#define CHAN_NOT_ALLOWED_TO_JOIN _("You are not permitted to be on this channel.")
#define CHAN_X_INVALID _("Channel %s is not a valid channel.")
#define CHAN_REACHED_CHANNEL_LIMIT _("Sorry, you have already reached your limit of \002%d\002 channels.")
#define CHAN_EXCEEDED_CHANNEL_LIMIT _("Sorry, you have already exceeded your limit of \002%d\002 channels.")
#define CHAN_SYMBOL_REQUIRED _("Please use the symbol of \002#\002 when attempting to register.")
#define CHAN_SETTING_CHANGED _("%s for %s set to %s.")
#define CHAN_SETTING_UNSET _("%s for %s unset.")
#define CHAN_ACCESS_LEVEL_RANGE _("Access level must be between %d and %d inclusive.")
#define CHAN_INFO_HEADER _("Information for channel \002%s\002:")
#define CHAN_EXCEPTED _("\002%s\002 matches an except on %s and cannot be banned until the except has been removed.")
#define MEMO_NEW_X_MEMO_ARRIVED _("There is a new memo on channel %s.\n" \
"Type \002%s%s READ %s %zu\002 to read it.")
#define MEMO_NEW_MEMO_ARRIVED _("You have a new memo from %s.\n" \
"Type \002%s%s READ %zu\002 to read it.")
#define MEMO_HAVE_NO_MEMOS _("You have no memos.")
#define MEMO_X_HAS_NO_MEMOS _("%s has no memos.")
#define MEMO_SEND_DISABLED _("Sorry, memo sending is temporarily disabled.")
#define MEMO_HAVE_NO_NEW_MEMOS _("You have no new memos.")
#define MEMO_X_HAS_NO_NEW_MEMOS _("%s has no new memos.")
#define BOT_DOES_NOT_EXIST _("Bot \002%s\002 does not exist.")
#define BOT_NOT_ASSIGNED _("You must assign a bot to the channel before using this command.")
#define BOT_NOT_ON_CHANNEL _("Bot is not on channel \002%s\002.")
#define HOST_SET_ERROR _("A vHost must be in the format of a valid hostname.")
#define HOST_SET_IDENT_ERROR _("A vHost ident must be in the format of a valid ident.")
#define HOST_SET_TOOLONG _("Error! The vHost is too long, please use a hostname shorter than %zu characters.")
#define HOST_SET_IDENTTOOLONG _("Error! The vHost ident is too long, please use an ident shorter than %zu characters.")
#define HOST_NOT_ASSIGNED _("Please contact an Operator to get a vHost assigned to this nick.")
#define HOST_NO_VIDENT _("Your IRCd does not support vIdent's, if this is incorrect, please report this as a possible bug")
+42 -13
View File
@@ -1,16 +1,13 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
#pragma once
@@ -60,3 +57,35 @@ public:
*/
virtual bool InvalidRange(const Anope::string &list);
};
/** This class handles formatting LIST/VIEW replies.
*/
class CoreExport ListFormatter final
{
public:
typedef std::map<Anope::string, Anope::string> ListEntry;
private:
NickCore *nc;
std::vector<Anope::string> columns;
std::vector<ListEntry> entries;
public:
ListFormatter(NickCore *nc);
ListFormatter &AddColumn(const Anope::string &name);
void AddEntry(const ListEntry &entry);
bool IsEmpty() const;
void Process(std::vector<Anope::string> &);
};
/** This class handles formatting INFO replies
*/
class CoreExport InfoFormatter final
{
NickCore *nc;
std::vector<std::pair<Anope::string, Anope::string> > replies;
unsigned longest = 0;
public:
InfoFormatter(NickCore *nc);
void Process(std::vector<Anope::string> &);
Anope::string &operator[](const Anope::string &key);
void AddOption(const Anope::string &opt);
};
+10 -13
View File
@@ -1,16 +1,13 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
#pragma once
+11 -14
View File
@@ -1,16 +1,13 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
#pragma once
@@ -29,7 +26,6 @@ namespace Mail
: public Thread
{
private:
Anope::string error;
Anope::string sendmail_path;
Anope::string send_from;
Anope::string mail_to;
@@ -39,6 +35,7 @@ namespace Mail
Anope::string content_type;
bool dont_quote_addresses;
bool success = false;
public:
/** Construct this message. Once constructed call Thread::Start to launch the mail sending.
* @param sf Config->SendFrom
+14 -22
View File
@@ -1,16 +1,13 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
#pragma once
@@ -21,20 +18,15 @@ class CoreExport Memo final
: public Serializable
{
public:
struct Type final
: public Serialize::Type
{
Type();
void Serialize(Serializable *obj, Serialize::Data &data) const override;
Serializable *Unserialize(Serializable *obj, Serialize::Data &data) const override;
};
MemoInfo *mi;
bool unread;
bool receipt;
Memo();
~Memo();
void Serialize(Serialize::Data &data) const override;
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
Anope::string owner;
/* When it was sent */
time_t time;
@@ -49,7 +41,7 @@ struct CoreExport MemoInfo final
{
int16_t memomax = 0;
Serialize::Checker<std::vector<Memo *> > memos;
std::set<Anope::string, ci::less> ignores;
std::vector<Anope::string> ignores;
MemoInfo();
Memo *GetMemo(unsigned index) const;
+12 -23
View File
@@ -1,16 +1,13 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
#pragma once
@@ -48,13 +45,6 @@ namespace Message
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport Ignore final
: IRCDMessage
{
Ignore(Module *creator, const Anope::string &mname);
void Run(MessageSource &source, const std::vector<Anope::string> &params, const Anope::map<Anope::string> &tags) override;
};
struct CoreExport Invite
: IRCDMessage
{
@@ -76,11 +66,10 @@ namespace Message
* @param source The source of the SJOIN
* @param chan The channel the users are joining to
* @param ts The TS for the channel
* @param modes The mode letters sent with the SJOIN, if any
* @param modeparams The mode parameters sent with the SJOIN, if any
* @param modes The modes sent with the SJOIN, if any
* @param users The users and their status, if any
*/
static void SJoin(MessageSource &source, const Anope::string &chan, time_t ts, const Anope::string &modes, const std::vector<Anope::string> &modeparams, const std::list<SJoinUser> &users);
static void SJoin(MessageSource &source, const Anope::string &chan, time_t ts, const Anope::string &modes, const std::list<SJoinUser> &users);
};
struct CoreExport Kick
-87
View File
@@ -1,87 +0,0 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
#pragma once
#include <iterator>
#include <utility>
namespace Anope
{
template <typename Iterator>
class iterator_range;
/** Returns a range containing all elements equivalent to \p value.
* @param collection The collection to search within.
* @param value The value to search for.
*/
template <typename Collection, typename Value>
auto equal_range(const Collection& collection, const Value& value)
{
return iterator_range(collection.equal_range(value));
}
/** Returns a range representing a reverse iterator for the specified colleciton.
* @param collection The collection to create a reverse iterator for.
*/
template <typename Collection>
auto reverse_range(const Collection& collection)
{
return iterator_range(collection.rbegin(), collection.rend());
}
}
/** Represents a range of iterators. */
template <typename Iterator>
class Anope::iterator_range final
{
private:
/** An iterator which points to the start of the range. */
const Iterator begini;
/* An iterator which points to one past the end of the range. */
const Iterator endi;
public:
/** Initialises a new iterator range with the specified iterators.
* @param begin An iterator which points to the start of the range.
* @param end An iterator which points to one past the end of the range.
*/
explicit iterator_range(Iterator begin, Iterator end)
: begini(begin)
, endi(end)
{
}
/** Initialises a new iterator range from a pair of iterators.
* @param range A pair of iterators in the format [first, last).
*/
explicit iterator_range(std::pair<Iterator, Iterator> range)
: begini(range.first)
, endi(range.second)
{
}
/** Determines whether the iterator range is empty. */
bool empty() const { return begini == endi; }
/** Retrieves an iterator which points to the start of the range. */
const Iterator& begin() const { return begini; }
/** Retrieves an iterator which points to one past the end of the range. */
const Iterator& end() const { return endi; }
/** Retrieves the number of hops within the iterator range. */
typename std::iterator_traits<Iterator>::difference_type count() const { return std::distance(begini, endi); }
};
+28 -61
View File
@@ -1,17 +1,10 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
// Copyright (C) 2008-2011 Adam <Adam@anope.org>
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/* Mode support
*
* (C) 2008-2011 Adam <Adam@anope.org>
* (C) 2008-2024 Anope Team <team@anope.org>
*
* Please read COPYING and README for further details.
*/
#pragma once
@@ -40,20 +33,6 @@ enum ModeClass
MC_USER
};
struct ModeData final
{
Anope::string value;
Anope::string set_by;
time_t set_at;
ModeData(const Anope::string &v = "", const Anope::string &s = "", time_t t = 0)
: value(v)
, set_by(s)
, set_at(t)
{
}
};
/** This class is the basis of all modes in Anope
*/
class CoreExport Mode
@@ -77,6 +56,11 @@ public:
*/
Mode(const Anope::string &mname, ModeClass mclass, char mc, ModeType type);
virtual ~Mode() = default;
/** Can a user set this mode, used for mlock
* @param u The user
*/
virtual bool CanSet(User *u) const;
};
/** This class is a user mode, all user modes use this/inherit from this
@@ -90,12 +74,6 @@ public:
* @param mc The mode char
*/
UserMode(const Anope::string &name, char mc);
/** Can a user set this mode, used for mlock
* @param source The user who is setting the mode.
* @param target The user the mode is being set on.
*/
virtual bool CanSet(User *source, User *target) const { return true; }
};
class CoreExport UserModeParam
@@ -130,11 +108,7 @@ public:
*/
ChannelMode(const Anope::string &name, char mc);
/** Can a user set this mode, used for mlock
* @param u The user who is setting the mode.
* @param c The channel the mode is being set on.
*/
virtual bool CanSet(User *u, Channel *c) const;
bool CanSet(User *u) const override;
virtual void Check() { }
@@ -242,7 +216,6 @@ template<typename T>
class CoreExport ChannelModeVirtual
: public T
{
protected:
Anope::string base;
ChannelMode *basech;
@@ -261,20 +234,16 @@ public:
/* The status a user has on a channel (+v, +h, +o) etc */
class CoreExport ChannelStatus final
{
private:
std::set<ChannelMode *> modes;
static bool IsValidMode(ChannelMode *cm);
Anope::string modes;
public:
ChannelStatus() = default;
ChannelStatus(const Anope::string &modes);
void AddMode(char c);
void AddMode(ChannelMode *cm);
void DelMode(ChannelMode *cm);
bool HasMode(ChannelMode *cm) const;
void DelMode(char c);
bool HasMode(char c) const;
bool Empty() const;
void Clear();
const auto &Modes() const { return modes; }
const Anope::string &Modes() const;
Anope::string BuildModePrefixList() const;
};
@@ -284,7 +253,7 @@ class CoreExport UserModeOperOnly
public:
UserModeOperOnly(const Anope::string &mname, char um) : UserMode(mname, um) { }
bool CanSet(User *source, User *target) const override;
bool CanSet(User *u) const override;
};
class CoreExport UserModeNoone
@@ -293,7 +262,7 @@ class CoreExport UserModeNoone
public:
UserModeNoone(const Anope::string &mname, char um) : UserMode(mname, um) { }
bool CanSet(User *source, User *target) const override;
bool CanSet(User *u) const override;
};
/** Channel mode +k (key)
@@ -316,7 +285,7 @@ public:
ChannelModeOperOnly(const Anope::string &mname, char mc) : ChannelMode(mname, mc) { }
/* Opers only */
bool CanSet(User *u, Channel *c) const override;
bool CanSet(User *u) const override;
};
/** This class is used for channel modes only servers may set
@@ -327,7 +296,7 @@ class CoreExport ChannelModeNoone
public:
ChannelModeNoone(const Anope::string &mname, char mc) : ChannelMode(mname, mc) { }
bool CanSet(User *u, Channel *c) const override;
bool CanSet(User *u) const override;
};
/** This is the mode manager
@@ -339,7 +308,6 @@ public:
class CoreExport ModeManager final
{
public:
using Change = std::multimap<Mode *, std::pair<bool, ModeData>>;
/* Number of generic channel and user modes we are tracking */
static unsigned GenericChannelModes;
@@ -407,18 +375,18 @@ public:
* @param c The channel
* @param cm The channel mode
* @param set true for setting, false for removing
* @param data Data about the mode.
* @param param The param, if there is one
*/
static void StackerAdd(BotInfo *bi, Channel *c, ChannelMode *cm, bool set, const ModeData &data = {});
static void StackerAdd(BotInfo *bi, Channel *c, ChannelMode *cm, bool set, const Anope::string &param = "");
/** Add a mode to the stacker to be set on a user
* @param bi The client to set the modes from
* @param u The user
* @param um The user mode
* @param set true for setting, false for removing
* @param data Data about the mode.
* @param param The param, if there is one
*/
static void StackerAdd(BotInfo *bi, User *u, UserMode *um, bool set, const ModeData &data = {});
static void StackerAdd(BotInfo *bi, User *u, UserMode *um, bool set, const Anope::string &param = "");
/** Process all of the modes in the stacker and send them to the IRCd to be set on channels/users
*/
@@ -443,18 +411,17 @@ public:
Anope::string nick, user, host, real;
/** Constructor
* @param mask A full or partial nick!ident@host/cidr#real name mask
* @param mode What mode this host is for, can be empty for unknown/no mode
* @Param real Whether to allow a real name in the mask.
* @param host A full or partial nick!ident@host/cidr#real name mask
*/
Entry(const Anope::string &mask, const Anope::string &mode = "", bool real = true);
Entry(const Anope::string &mode, const Anope::string &host);
/** Get the banned mask for this entry
* @return The mask
*/
Anope::string GetMask() const;
Anope::string GetCleanMask() const;
Anope::string GetNUHMask() const;
/** Check if this entry matches a user
* @param u The user
+15 -14
View File
@@ -1,16 +1,13 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
#pragma once
@@ -42,9 +39,13 @@
#include "services.h"
#include "socketengine.h"
#include "sockets.h"
#include "textproc.h"
#include "threadengine.h"
#include "timers.h"
#include "uplink.h"
#include "users.h"
#include "xline.h"
#include "modules/pseudoclients/chanserv.h"
#include "modules/pseudoclients/global.h"
#include "modules/pseudoclients/memoserv.h"
#include "modules/pseudoclients/nickserv.h"
+162 -293
View File
File diff suppressed because it is too large Load Diff
-85
View File
@@ -1,85 +0,0 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
#pragma once
#define BOTSERV_BAD_WORDS_EXT "badwords"
#define BOTSERV_BAD_WORDS_TYPE "BadWord"
namespace BotServ
{
class BadWord;
struct BadWords;
/** Flags for badwords. */
enum BadWordType
{
/* Always kicks if the word is said */
BW_ANY,
/* User must way the entire word */
BW_SINGLE,
/* The word has to start with the badword */
BW_START,
/* The word has to end with the badword */
BW_END
};
}
/* Structure used to contain bad words. */
class BotServ::BadWord
{
protected:
BadWord() = default;
public:
Anope::string chan;
Anope::string word;
BotServ::BadWordType type;
virtual ~BadWord() = default;
};
struct BotServ::BadWords
{
virtual ~BadWords() = default;
/** Add a badword to the badword list
* @param word The badword
* @param type The type (SINGLE START END)
* @return The badword
*/
virtual BotServ::BadWord *AddBadWord(const Anope::string &word, BotServ::BadWordType type) = 0;
/** Get a badword structure by index
* @param index The index
* @return The badword
*/
virtual BotServ::BadWord *GetBadWord(unsigned index) const = 0;
/** Get how many badwords are on this channel
* @return The number of badwords in the vector
*/
virtual unsigned GetBadWordCount() const = 0;
/** Remove a badword
* @param index The index of the badword
*/
virtual void EraseBadWord(unsigned index) = 0;
/** Clear all badwords from the channel
*/
virtual void ClearBadWords() = 0;
virtual void Check() = 0;
};
-57
View File
@@ -1,57 +0,0 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
#pragma once
#define BOTSERV_KICKER_DATA_EXT "kickerdata"
namespace BotServ
{
class KickerData;
/* Indices for TTB (Times To Ban) */
enum
{
TTB_BOLDS,
TTB_COLORS,
TTB_REVERSES,
TTB_UNDERLINES,
TTB_BADWORDS,
TTB_CAPS,
TTB_FLOOD,
TTB_REPEAT,
TTB_ITALICS,
TTB_AMSGS,
TTB_SIZE
};
}
class BotServ::KickerData
{
protected:
KickerData() = default;
public:
bool amsgs, badwords, bolds, caps, colors, flood, italics, repeat, reverses, underlines;
int16_t ttb[BotServ::TTB_SIZE]; /* Times to ban for each kicker */
int16_t capsmin, capspercent; /* For CAPS kicker */
int16_t floodlines, floodsecs; /* For FLOOD kicker */
int16_t repeattimes; /* For REPEAT kicker */
bool dontkickops, dontkickvoices;
virtual ~KickerData() = default;
virtual void Check(ChannelInfo *ci) = 0;
};
+72
View File
@@ -0,0 +1,72 @@
/* BotServ core functions
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
#pragma once
/** Flags for badwords
*/
enum BadWordType
{
/* Always kicks if the word is said */
BW_ANY,
/* User must way the entire word */
BW_SINGLE,
/* The word has to start with the badword */
BW_START,
/* The word has to end with the badword */
BW_END
};
/* Structure used to contain bad words. */
struct BadWord
{
Anope::string chan;
Anope::string word;
BadWordType type;
virtual ~BadWord() = default;
protected:
BadWord() = default;
};
struct BadWords
{
virtual ~BadWords() = default;
/** Add a badword to the badword list
* @param word The badword
* @param type The type (SINGLE START END)
* @return The badword
*/
virtual BadWord *AddBadWord(const Anope::string &word, BadWordType type) = 0;
/** Get a badword structure by index
* @param index The index
* @return The badword
*/
virtual BadWord *GetBadWord(unsigned index) const = 0;
/** Get how many badwords are on this channel
* @return The number of badwords in the vector
*/
virtual unsigned GetBadWordCount() const = 0;
/** Remove a badword
* @param index The index of the badword
*/
virtual void EraseBadWord(unsigned index) = 0;
/** Clear all badwords from the channel
*/
virtual void ClearBadWords() = 0;
virtual void Check() = 0;
};
+46
View File
@@ -0,0 +1,46 @@
/* BotServ core functions
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
#pragma once
/* Indices for TTB (Times To Ban) */
enum
{
TTB_BOLDS,
TTB_COLORS,
TTB_REVERSES,
TTB_UNDERLINES,
TTB_BADWORDS,
TTB_CAPS,
TTB_FLOOD,
TTB_REPEAT,
TTB_ITALICS,
TTB_AMSGS,
TTB_SIZE
};
struct KickerData
{
bool amsgs, badwords, bolds, caps, colors, flood, italics, repeat, reverses, underlines;
int16_t ttb[TTB_SIZE]; /* Times to ban for each kicker */
int16_t capsmin, capspercent; /* For CAPS kicker */
int16_t floodlines, floodsecs; /* For FLOOD kicker */
int16_t repeattimes; /* For REPEAT kicker */
bool dontkickops, dontkickvoices;
protected:
KickerData() = default;
public:
virtual ~KickerData() = default;
virtual void Check(ChannelInfo *ci) = 0;
};
-108
View File
@@ -1,108 +0,0 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
#pragma once
#define CHANSERV_AUTO_KICK_TYPE "AutoKick"
#define CHANSERV_AUTO_KICK_SERVICE "ChanServ::AutoKickService"
namespace ChanServ
{
class AutoKick;
class AutoKickService;
ServiceReference<AutoKickService> akick_service(CHANSERV_AUTO_KICK_SERVICE, CHANSERV_AUTO_KICK_SERVICE);
}
class ChanServ::AutoKickService
: public Service
{
public:
AutoKickService(Module *m)
: Service(m, CHANSERV_AUTO_KICK_SERVICE, CHANSERV_AUTO_KICK_SERVICE)
{
}
/** Add an akick entry to the channel by NickCore
* @param user The user who added the akick
* @param akicknc The nickcore being akicked
* @param reason The reason for the akick
* @param t The time the akick was added, defaults to now
* @param lu The time the akick was last used, defaults to never
*/
virtual AutoKick *AddAKick(ChannelInfo *ci, const Anope::string &user, NickCore *akicknc, const Anope::string &reason, time_t t = Anope::CurTime, time_t lu = 0) = 0;
/** Add an akick entry to the channel by reason
* @param user The user who added the akick
* @param mask The mask of the akick
* @param reason The reason for the akick
* @param t The time the akick was added, defaults to now
* @param lu The time the akick was last used, defaults to never
*/
virtual AutoKick *AddAKick(ChannelInfo *ci, const Anope::string &user, const Anope::string &mask, const Anope::string &reason, time_t t = Anope::CurTime, time_t lu = 0) = 0;
/** Get an entry from the channel akick list
* @param index The index in the akick vector
* @return The akick structure, or NULL if not found
*/
virtual AutoKick *GetAKick(ChannelInfo *ci, unsigned index) = 0;
/** Get the size of the akick vector for this channel
* @return The akick vector size
*/
virtual unsigned GetAKickCount(ChannelInfo *ci) = 0;
/** Erase an entry from the channel akick list
* @param index The index of the akick
*/
virtual void EraseAKick(ChannelInfo *ci, unsigned index) = 0;
virtual void EraseAKick(ChannelInfo *ci, AutoKick *akick) = 0;
/** Clear the whole akick list
*/
virtual void ClearAKick(ChannelInfo *ci) = 0;
};
class ChanServ::AutoKick final
: public Serializable
{
public:
/* Channel this autokick is on */
Serialize::Reference<ChannelInfo> ci;
Anope::string mask;
Serialize::Reference<NickCore> nc;
Anope::string reason;
Anope::string creator;
time_t addtime;
time_t last_used;
AutoKick()
: Serializable(CHANSERV_AUTO_KICK_TYPE)
{
}
~AutoKick()
{
if (!this->ci)
return;
if (ChanServ::akick_service)
ChanServ::akick_service->EraseAKick(this->ci, this);
if (this->nc)
this->nc->RemoveChannelReference(this->ci);
}
};
-57
View File
@@ -1,57 +0,0 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
#pragma once
#define CHANSERV_ENTRY_MESSAGE_EXT "entrymsg"
#define CHANSERV_ENTRY_MESSAGE_TYPE "EntryMsg"
namespace ChanServ
{
class EntryMessage;
class EntryMessageList;
}
class ChanServ::EntryMessage
{
protected:
EntryMessage() = default;
public:
Anope::string chan;
Anope::string creator;
Anope::string message;
time_t when = 0;
virtual ~EntryMessage() = default;
};
class ChanServ::EntryMessageList
: public Serialize::Checker<std::vector<ChanServ::EntryMessage *>>
{
protected:
EntryMessageList()
: Serialize::Checker<std::vector<ChanServ::EntryMessage *>>(CHANSERV_ENTRY_MESSAGE_TYPE)
{
}
public:
virtual ~EntryMessageList()
{
for (auto i = (*this)->size(); i > 0; --i)
delete (*this)->at(i - 1);
}
virtual ChanServ::EntryMessage *Create() = 0;
};
-58
View File
@@ -1,58 +0,0 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
#pragma once
#define CHANSERV_LOG_SETTING_EXT "logsettings"
#define CHANSERV_LOG_SETTING_TYPE "LogSetting"
namespace ChanServ
{
class LogSetting;
class LogSettings;
}
class ChanServ::LogSetting
{
protected:
LogSetting() = default;
public:
Anope::string chan;
/* Our service name of the command */
Anope::string service_name;
/* The name of the client the command is on */
Anope::string command_service;
/* Name of the command to the user, can have spaces */
Anope::string command_name;
Anope::string method, extra;
Anope::string creator;
time_t created;
virtual ~LogSetting() = default;
};
class ChanServ::LogSettings
: public Serialize::Checker<std::vector<ChanServ::LogSetting *>>
{
protected:
LogSettings()
: Serialize::Checker<std::vector<ChanServ::LogSetting *>>(CHANSERV_LOG_SETTING_TYPE)
{
}
public:
virtual ~LogSettings() = default;
virtual ChanServ::LogSetting *Create() = 0;
};
-39
View File
@@ -1,39 +0,0 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
#pragma once
#define CHANSERV_SERVICE "ChanServ::Service"
namespace ChanServ
{
class Service;
ServiceReference<Service> service(CHANSERV_SERVICE, CHANSERV_SERVICE);
}
class ChanServ::Service
: public ::Service
{
public:
Service(Module *m)
: ::Service(m, CHANSERV_SERVICE, CHANSERV_SERVICE)
{
}
/* Have ChanServ hold the channel, that is, join and set +nsti and wait
* for a few minutes so no one can join or rejoin.
*/
virtual void Hold(Channel *c) = 0;
};
+37
View File
@@ -0,0 +1,37 @@
/*
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
#pragma once
struct EntryMsg
{
Anope::string chan;
Anope::string creator;
Anope::string message;
time_t when;
virtual ~EntryMsg() = default;
protected:
EntryMsg() = default;
};
struct EntryMessageList
: Serialize::Checker<std::vector<EntryMsg *> >
{
protected:
EntryMessageList() : Serialize::Checker<std::vector<EntryMsg *> >("EntryMsg") { }
public:
virtual ~EntryMessageList()
{
for (unsigned i = (*this)->size(); i > 0; --i)
delete (*this)->at(i - 1);
}
virtual EntryMsg *Create() = 0;
};
+45
View File
@@ -0,0 +1,45 @@
/* ChanServ core functions
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
#pragma once
struct LogSetting
{
Anope::string chan;
/* Our service name of the command */
Anope::string service_name;
/* The name of the client the command is on */
Anope::string command_service;
/* Name of the command to the user, can have spaces */
Anope::string command_name;
Anope::string method, extra;
Anope::string creator;
time_t created;
virtual ~LogSetting() = default;
protected:
LogSetting() = default;
};
struct LogSettings
: Serialize::Checker<std::vector<LogSetting *> >
{
typedef std::vector<LogSetting *>::iterator iterator;
protected:
LogSettings() : Serialize::Checker<std::vector<LogSetting *> >("LogSetting")
{
}
public:
virtual ~LogSettings() = default;
virtual LogSetting *Create() = 0;
};
@@ -1,36 +1,18 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/* ChanServ core functions
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
#pragma once
#define CHANSERV_MODE_LOCK_EXT "modelocks"
#define CHANSERV_MODE_LOCK_TYPE "ModeLock"
namespace ChanServ
struct ModeLock
{
class ModeLock;
class ModeLocks;
using ModeLockList = std::vector<ModeLock *>;
}
class ChanServ::ModeLock
{
protected:
ModeLock() = default;
public:
Anope::string ci;
bool set;
Anope::string name;
@@ -39,14 +21,14 @@ public:
time_t created;
virtual ~ModeLock() = default;
protected:
ModeLock() = default;
};
class ChanServ::ModeLocks
struct ModeLocks
{
protected:
ModeLocks() = default;
typedef std::vector<ModeLock *> ModeList;
public:
virtual ~ModeLocks() = default;
/** Check if a mode is mlocked
@@ -84,7 +66,7 @@ public:
/** Get all of the mlocks for this channel
* @return The mlocks
*/
virtual const ChanServ::ModeLockList &GetMLock() const = 0;
virtual const ModeList &GetMLock() const = 0;
/** Get a list of mode locks on a channel
* @param name The mode name to get a list of
+11 -33
View File
@@ -1,21 +1,16 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
#pragma once
#include <memory>
namespace DNS
{
/** Valid query types
@@ -34,12 +29,8 @@ namespace DNS
QUERY_SOA = 6,
/* Reverse DNS lookup */
QUERY_PTR = 12,
/* TXT lookup */
QUERY_TXT = 16,
/* IPv6 AAAA lookup */
QUERY_AAAA = 28,
/** SRV lookup */
QUERY_SRV = 33,
/* Zone transfer */
QUERY_AXFR = 252,
/* A lookup for any record */
@@ -97,23 +88,11 @@ namespace DNS
};
};
namespace Record
{
struct SRV final
{
uint16_t priority = UINT16_MAX;
uint16_t weight = 0;
uint16_t port = 0;
Anope::string host;
};
}
struct ResourceRecord final
: Question
{
unsigned int ttl = 0;
Anope::string rdata;
std::shared_ptr<void> rdataobj;
time_t created;
ResourceRecord(const Anope::string &n, QueryType t, unsigned short c = 1) : Question(n, t, c), created(Anope::CurTime) { }
@@ -194,13 +173,12 @@ namespace DNS
/** Used to time out the query, xalls OnError and lets the TimerManager
* delete this request.
*/
bool Tick() override
void Tick() override
{
Log(LOG_DEBUG_2) << "Resolver: timeout for query " << this->name;
Query rr(*this);
rr.error = ERROR_TIMEDOUT;
this->OnError(&rr);
return false;
}
};
+18 -130
View File
@@ -1,150 +1,38 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2003-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
#pragma once
namespace Encryption
{
/** Base class for encryption contexts. */
typedef std::pair<const unsigned char *, size_t> Hash;
typedef std::pair<const uint32_t *, size_t> IV;
class Context
{
public:
virtual ~Context() = default;
/** Updates the encryption context with the specified data.
* @param str The data to update the context with.
*/
inline void Update(const Anope::string &str)
{
Update(reinterpret_cast<const unsigned char *>(str.c_str()), str.length());
}
/** Updates the encryption context with the specified data.
* @param data The data to update the context with.
* @param len The length of the data.
*/
virtual void Update(const unsigned char *data, size_t len) = 0;
/** Finalises the encryption context and returns the digest. */
virtual Anope::string Finalize() = 0;
virtual void Finalize() = 0;
virtual Hash GetFinalizedHash() = 0;
};
/** Provider of encryption contexts. */
class Provider
: public Service
{
public:
/** The byte size of the block cipher. */
const size_t block_size;
/** The byte size of the resulting digest. */
const size_t digest_size;
/** Creates a provider of encryption contexts.
* @param creator The module that created this provider.
* @param algorithm The name of the encryption algorithm.
* @param bs The byte size of the block cipher.
* @param ds The byte size of the resulting digest.
*/
Provider(Module *creator, const Anope::string &algorithm, size_t bs, size_t ds)
: Service(creator, "Encryption::Provider", algorithm)
, block_size(bs)
, digest_size(ds)
{
}
Provider(Module *creator, const Anope::string &sname) : Service(creator, "Encryption::Provider", sname) { }
virtual ~Provider() = default;
/** Checks whether a plain text value matches a hash created by this provider. */
virtual bool Compare(const Anope::string &hash, const Anope::string &plain)
{
return !hash.empty() && hash.equals_cs(ToPrintable(Encrypt(plain)));
}
/** Called on initialising a encryption provider to check it works properly. */
void Check(const Anope::map<Anope::string> &checks)
{
for (const auto &[hash, plain] : checks)
{
if (!Compare(hash, plain))
throw ModuleException("BUG: unable to generate " + this->name + " hashes safely! Please report this!");
}
Log(LOG_DEBUG) << "The " << this->name << " encryption provider appears to be working correctly.";
}
/** Creates a new encryption context. */
virtual std::unique_ptr<Context> CreateContext() = 0;
/** Quickly encrypts the specified values and returns the digest. */
template<typename... Args>
Anope::string Encrypt(Args &&...args)
{
auto context = CreateContext();
context->Update(std::forward<Args>(args)...);
return context->Finalize();
}
/** Calculates the RFC 2104 hash-based message authentication code for the specified data. */
inline Anope::string HMAC(const Anope::string &key, const Anope::string &data)
{
if (!block_size)
return {};
auto keybuf = key.length() > block_size ? Encrypt(key) : key;
keybuf.resize(block_size);
Anope::string hmac1;
Anope::string hmac2;
for (size_t i = 0; i < block_size; ++i)
{
hmac1.push_back(static_cast<char>(keybuf[i] ^ 0x5C));
hmac2.push_back(static_cast<char>(keybuf[i] ^ 0x36));
}
hmac2.append(data);
hmac1.append(Encrypt(hmac2));
return Encrypt(hmac1);
}
/** Converts a hash to its printable form. */
virtual Anope::string ToPrintable(const Anope::string &hash)
{
return Anope::Hex(hash);
}
};
/** Helper template for creating simple providers of encryption contexts. */
template <typename T>
class SimpleProvider final
: public Provider
{
public:
/** Creates a simple provider of encryption contexts.
* @param creator The module that created this provider.
* @param algorithm The name of the encryption algorithm.
* @param bs The byte size of the block cipher.
* @param ds The byte size of the resulting digest.
*/
SimpleProvider(Module *creator, const Anope::string &algorithm, size_t bs, size_t ds)
: Provider(creator, algorithm, bs, ds)
{
}
/** @copydoc Encryption::Provider::CreateContext. */
std::unique_ptr<Context> CreateContext() override
{
return std::make_unique<T>();
}
virtual Context *CreateContext(IV * = NULL) = 0;
virtual IV GetDefaultIV() = 0;
};
}
-90
View File
@@ -1,90 +0,0 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
#pragma once
#define GLOBAL_NO_MESSAGE _("You do not have any messages queued and did not specify a message to send.")
#define GLOBAL_QUEUE_CONFLICT _("You can not send a single message while you have messages queued.")
#define GLOBAL_SERVICE "Global::Service"
namespace Global
{
class Service;
ServiceReference<Global::Service> service(GLOBAL_SERVICE, GLOBAL_SERVICE);
}
class Global::Service
: public ::Service
{
public:
Service(Module *m)
: ::Service(m, GLOBAL_SERVICE, GLOBAL_SERVICE)
{
}
/** Retrieves the bot which sends global messages unless otherwise specified. */
virtual Reference<BotInfo> GetDefaultSender() const = 0;
/** Clears any queued messages for the specified account.
* @param nc The account to clear queued messages for.
*/
virtual void ClearQueue(NickCore *nc) = 0;
/** Retrieves the size of the messages queue for the specified user.
* @param nc The account to count queued messages for.
*/
inline size_t CountQueue(NickCore *nc) const
{
auto *q = GetQueue(nc);
return q ? q->size() : 0;
}
/** Retrieves the messages queue for the specified user.
* @param nc The account to retrieve queued messages for.
*/
virtual const std::vector<Anope::string> *GetQueue(NickCore *nc) const = 0;
/** Queues a message to be sent later.
* @param nc The account to queue the message for.
* @param message The message to queue.
* @return The new number of messages in the queue.
*/
virtual size_t Queue(NickCore *nc, const Anope::string &message) = 0;
/** Sends a single message to all users on the network.
* @param message The message to send.
* @param source If non-nullptr then the source of the message.
* @param sender If non-nullptr then the bot to send the message from.
* @param server If non-nullptr then the server to send messages to.
* @return If the message was sent then true; otherwise, false.
*/
virtual bool SendSingle(const Anope::string &message, CommandSource *source = nullptr, BotInfo *sender = nullptr, Server *server = nullptr) = 0;
/** Sends a message queue to all users on the network.
* @param source The source of the message.
* @param sender If non-nullptr then the bot to send the message from.
* @param server If non-nullptr then the server to send messages to.
* @return If the message queue was sent then true; otherwise, false.
*/
virtual bool SendQueue(CommandSource &source, BotInfo *sender = nullptr, Server *server = nullptr) = 0;
/** Unqueues a message from the message queue.
* @param nc The account to unqueue the message from.
* @param idx The index of the item to remove.
* @return Whether the message was removed from the queue.
*/
virtual bool Unqueue(NickCore *nc, size_t idx) = 0;
};
-38
View File
@@ -1,38 +0,0 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
#pragma once
#define HOSTSERV_HOST_REQUEST_EXT "hostrequest"
namespace HostServ
{
class HostRequest;
}
class HostServ::HostRequest
{
protected:
HostRequest() = default;
public:
Anope::string nick;
Anope::string ident;
Anope::string host;
time_t time = 0;
Anope::string validation_token;
time_t last_validation = 0;
virtual ~HostRequest() = default;
};
+42 -73
View File
@@ -1,52 +1,35 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2012-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
#pragma once
namespace HTTP
enum HTTPError
{
struct Reply;
struct Message;
class Page;
class Client;
class Provider;
enum Error
{
OK = 200,
FOUND = 302,
BAD_REQUEST = 400,
PAGE_NOT_FOUND = 404,
NOT_SUPPORTED = 505,
};
}
HTTP_ERROR_OK = 200,
HTTP_FOUND = 302,
HTTP_BAD_REQUEST = 400,
HTTP_PAGE_NOT_FOUND = 404,
HTTP_NOT_SUPPORTED = 505
};
/* A message to someone */
struct HTTP::Reply final
struct HTTPReply final
{
HTTP::Error error = HTTP::OK;
HTTPError error = HTTP_ERROR_OK;
Anope::string content_type;
std::map<Anope::string, Anope::string, ci::less> headers;
typedef std::list<std::pair<Anope::string, Anope::string> > cookie;
std::vector<cookie> cookies;
Reply() = default;
Reply &operator=(const HTTP::Reply &) = default;
HTTPReply() = default;
HTTPReply &operator=(const HTTPReply &) = default;
Reply(const HTTP::Reply &other)
: error(other.error)
, length(other.length)
HTTPReply(const HTTPReply &other) : error(other.error), length(other.length)
{
content_type = other.content_type;
headers = other.headers;
@@ -56,7 +39,7 @@ struct HTTP::Reply final
out.push_back(new Data(datum->buf, datum->len));
}
~Reply()
~HTTPReply()
{
for (const auto *datum : out)
delete datum;
@@ -98,27 +81,26 @@ struct HTTP::Reply final
};
/* A message from someone */
struct HTTP::Message final
struct HTTPMessage final
{
std::map<Anope::string, Anope::string, ci::less> headers;
std::map<Anope::string, Anope::string, ci::less> cookies;
std::map<Anope::string, Anope::string, ci::less> get_data;
std::map<Anope::string, Anope::string, ci::less> post_data;
std::map<Anope::string, Anope::string> headers;
std::map<Anope::string, Anope::string> cookies;
std::map<Anope::string, Anope::string> get_data;
std::map<Anope::string, Anope::string> post_data;
Anope::string content;
};
class HTTP::Page
class HTTPClient;
class HTTPProvider;
class HTTPPage
: public virtual Base
{
Anope::string url;
Anope::string content_type;
public:
Page(const Anope::string &u, const Anope::string &ct = "text/html")
: url(u)
, content_type(ct)
{
}
HTTPPage(const Anope::string &u, const Anope::string &ct = "text/html") : url(u), content_type(ct) { }
const Anope::string &GetURL() const { return this->url; }
@@ -131,10 +113,10 @@ public:
* @param The HTTP header sent from the client to request the page
* @param The HTTP header that will be sent back to the client
*/
virtual bool OnRequest(HTTP::Provider *, const Anope::string &, HTTP::Client *, HTTP::Message &, HTTP::Reply &) = 0;
virtual bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &) = 0;
};
class HTTP::Client
class HTTPClient
: public ClientSocket
, public BinarySocket
, public Base
@@ -146,24 +128,18 @@ protected:
}
public:
Client(ListenSocket *l, int f, const sockaddrs &a)
: ClientSocket(l, a)
, BinarySocket()
{
}
HTTPClient(ListenSocket *l, int f, const sockaddrs &a) : ClientSocket(l, a), BinarySocket() { }
virtual Anope::string GetIP() const
virtual const Anope::string GetIP()
{
return this->clientaddr.addr();
}
virtual void SendError(HTTP::Error err, const Anope::string &msg) = 0;
virtual void SendReply(HTTP::Reply *) = 0;
virtual void SendError(HTTPError err, const Anope::string &msg) = 0;
virtual void SendReply(HTTPReply *) = 0;
};
#define HTTP_PROVIDER "HTTP::Provider"
class HTTP::Provider
class HTTPProvider
: public ListenSocket
, public Service
{
@@ -174,14 +150,7 @@ public:
std::vector<Anope::string> ext_ips;
std::vector<Anope::string> ext_headers;
Provider(Module *c, const Anope::string &n, const Anope::string &i, const unsigned short p, bool s)
: ListenSocket(i, p, i.find(':') != Anope::string::npos)
, Service(c, HTTP_PROVIDER, n)
, ip(i)
, port(p)
, ssl(s)
{
}
HTTPProvider(Module *c, const Anope::string &n, const Anope::string &i, const unsigned short p, bool s) : ListenSocket(i, p, i.find(':') != Anope::string::npos), Service(c, "HTTPProvider", n), ip(i), port(p), ssl(s) { }
const Anope::string &GetIP() const
{
@@ -198,12 +167,12 @@ public:
return this->ssl;
}
virtual bool RegisterPage(HTTP::Page *page) = 0;
virtual void UnregisterPage(HTTP::Page *page) = 0;
virtual HTTP::Page *FindPage(const Anope::string &name) = 0;
virtual bool RegisterPage(HTTPPage *page) = 0;
virtual void UnregisterPage(HTTPPage *page) = 0;
virtual HTTPPage *FindPage(const Anope::string &name) = 0;
};
namespace HTTP
namespace HTTPUtils
{
inline Anope::string URLDecode(const Anope::string &url)
{
-55
View File
@@ -1,55 +0,0 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
#pragma once
class OperInfo
{
protected:
OperInfo() = default;
OperInfo(const Anope::string &t, const Anope::string &i, const Anope::string &a, time_t c)
: target(t)
, info(i)
, adder(a)
, created(c)
{
}
public:
Anope::string target;
Anope::string info;
Anope::string adder;
time_t created = 0;
virtual ~OperInfo() = default;
};
class OperInfoList
: public Serialize::Checker<std::vector<OperInfo *>>
{
public:
OperInfoList()
: Serialize::Checker<std::vector<OperInfo *>>("OperInfo")
{
}
virtual ~OperInfoList()
{
for (auto *info : *(*this))
delete info;
}
virtual OperInfo *Create() = 0;
};
+7 -23
View File
@@ -1,16 +1,10 @@
// Anope IRC Services <https://www.anope.org/>
//
// Copyright (C) 2003-2026 Anope Contributors
//
// Anope is free software. You can use, modify, and/or distribute it under the
// terms of version 2 of the GNU General Public License. See docs/LICENSE.txt
// for the complete terms of this license and docs/AUTHORS.txt for a list of
// contributors.
//
// Based on the original code of Epona by Lara
// Based on the original code of Services by Andy Church
//
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* (C) 2011-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
#pragma once
@@ -173,14 +167,4 @@ public:
* @param attributes The attributes to modify
*/
virtual void Modify(LDAPInterface *i, const Anope::string &base, LDAPMods &attributes) = 0;
/** Escapes a LDAP string for use in a DN.
* @param str The string to escape.
*/
virtual Anope::string EscapeDN(const Anope::string &str) const = 0;
/** Escapes a LDAP string for use in a search filter.
* @param str The string to escape.
*/
virtual Anope::string EscapeSF(const Anope::string &str) const = 0;
};

Some files were not shown because too many files have changed in this diff Show More