3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-04-20 23:07:53 +02:00

Compare commits

..

No commits in common. "master" and "3.1-beta1" have entirely different histories.

9 changed files with 61 additions and 66 deletions

View File

@ -4,8 +4,8 @@
VERSION="$1"
if test -z "$VERSION"; then
echo "Reading version from VERSION file" >&2
VERSION=$(<VERSION)
echo "Usage: $0 <version>"
exit 1
fi
if [[ "$VERSION" == *"alpha"* || "$VERSION" == *"dev"* ]]; then

View File

@ -44,31 +44,7 @@ local build_docker(py_version) = {
}
}
],
"trigger": {
"event": [
"push"
],
"branch": ["release"],
},
"depends_on": ["test-" + py_version]
};
local deploy_pypi(py_version) = {
"kind": "pipeline",
"type": "docker",
"name": "deploy_pypi",
"steps": [
{
"name": "pypi_publish",
"image": "plugins/pypi",
"settings": {
"username": "__token__",
"password": {
"from_secret": "pypi_token"
}
}
}
],
"depends_on": ["test-" + py_version],
"trigger": {
"event": [
"tag"
@ -76,12 +52,10 @@ local deploy_pypi(py_version) = {
"ref": {
"exclude": [
"refs/tags/*alpha*",
"refs/tags/*beta*",
"refs/tags/*dev*"
]
}
},
"depends_on": ["test-" + py_version]
}
};
[
@ -89,6 +63,5 @@ local deploy_pypi(py_version) = {
test("3.8"),
test("3.9"),
test("3.10"),
deploy_pypi("3.10"),
build_docker("3.10"),
]

35
.travis.yml Normal file
View File

@ -0,0 +1,35 @@
dist: bionic
sudo: false
language: python
python:
- '3.5'
- '3.6'
- '3.7'
- '3.8'
install: python3 setup.py install
script:
- python3 -m compileall .
- python3 -m unittest discover test/ --verbose
deploy:
provider: pypi
# Enable this to use test mode
# server: https://testpypi.python.org/pypi
user:
secure: Ql6ihu5MDgWuAvT9NYfriGUYGhHpsqwXfZHWDQT+DfRjOqHo9QT7PnfexeBoe6L6cYUkEnIrnAXKtBXGy6UmyvfrnvBl68877dLVuoC8PfQ4J0ej7TVnCJmT/LwRqFvzZXkeg4CIlJsVJ6pvrPHXQBDPH1rj/rWCucchrofmps8=
password:
secure: JOHSaZDPCImV/TlQ7hqKLzEvxY4/gpYGlZlOvxgFEd/k/sGk13sva1MfQkOh7Fgjblhk/CHt59wVKXa0VaylRugFQnXb+NYNrxYON0IRVsKON20XaLXg7qsyKCS4ml+7cd2KvM8a6LVO9078yLWAhTZkZ69nLIRZwFbmL5+mep4=
on:
tags: true
# Only deploy on tags that don't have -alpha, -beta, etc. suffixes attached
condition: $(python3 -c 'import re,os; print(bool(re.match(r"^(\d+\.){2,}\d+$", os.environ.get("TRAVIS_TAG", ""))))') == "True"
python: '3.6'
# Because our __init__.py is generated at build-time!
skip_cleanup: true
notifications:
email: false

View File

@ -1,13 +1,11 @@
# PyLink IRC Services
## END OF LIFE NOTICE: This project is no longer maintained. So long and thanks for all the fish.
## PyLink is LOOKING FOR NEW MAINTAINERS: Please see my [latest dev update](https://jlu5.com/blog/the-trouble-with-pylink) for more context.
<!--
[![Latest stable release](https://img.shields.io/github/v/tag/jlu5/pylink?label=stable&color=1a1)](https://github.com/PyLink/PyLink/tree/master)
[![Latest stable release](https://img.shields.io/github/v/tag/jlu5/pylink?label=stable&color=1a1)](https://github.com/jlu5/PyLink/tree/master)
[![PyPI version](https://img.shields.io/pypi/v/pylinkirc.svg?maxAge=2592000)](https://pypi.python.org/pypi/pylinkirc/)
[![Docker image version](https://img.shields.io/docker/v/jlu5/pylink/latest?label=docker)](https://hub.docker.com/r/jlu5/pylink)
[![Supported Python versions](https://img.shields.io/badge/python-3.7%20and%20later-50e)](https://www.python.org/downloads/)
-->
[![Supported Python versions](https://img.shields.io/badge/python-3.5%20and%20later-50e)](https://www.python.org/downloads/)
PyLink is an extensible, plugin-based IRC services framework written in Python. It aims to be:
@ -23,7 +21,9 @@ PyLink is licensed under the Mozilla Public License, version 2.0 ([LICENSE.MPL2]
**When upgrading between major versions, remember to read the [release notes](RELNOTES.md) for any breaking changes!**
Please report any bugs you find to the [issue tracker](https://github.com/PyLink/PyLink/issues). Pull requests are likewise welcome.
Please report any bugs you find to the [issue tracker](https://github.com/jlu5/PyLink/issues). Pull requests are likewise welcome.
There is also an IRC channel available: `#pylink @ irc.libera.chat`
## Installation
@ -44,7 +44,7 @@ If you are a developer and want to help make PyLink more portable, patches are w
* *For Unicode support in Relay*: unidecode (`pip3 install Unidecode`)
* *For extended PID file tracking (i.e. removing stale PID files after a crash)*: psutil (`pip3 install psutil`)
2) Clone the repository: `git clone https://github.com/PyLink/PyLink && cd PyLink`
2) Clone the repository: `git clone https://github.com/jlu5/PyLink && cd PyLink`
- Previously there was a *devel* branch for testing versions of PyLink - this practice has since been discontinued.
3) Install PyLink using `python3 setup.py install` (global install) or `python3 setup.py install --user` (local install)
@ -73,7 +73,7 @@ $ docker run -v $HOME/pylink:/pylink jlu5/pylink
2) Run `pip3 install pylinkirc` to download and install PyLink. pip will automatically resolve dependencies.
3) Download or copy https://github.com/PyLink/PyLink/blob/master/example-conf.yml for an example configuration.
3) Download or copy https://github.com/jlu5/PyLink/blob/master/example-conf.yml for an example configuration.
## Configuration
@ -88,7 +88,7 @@ $ docker run -v $HOME/pylink:/pylink jlu5/pylink
These IRCds (in alphabetical order) are frequently tested and well supported. If any issues occur, please file a bug on the issue tracker.
* [InspIRCd](http://www.inspircd.org/) (2.0 - 3.x) - module `inspircd`
- Set the `target_version` option to `insp3` to target InspIRCd 3.x (default), or `insp20` to target InspIRCd 2.0 (legacy).
- Set the `target_version` option to `insp3` to target InspIRCd 3.x, or `insp20` to target InspIRCd 2.0 (currently the default).
- For vHost setting to work, `m_chghost.so` must be loaded. For ident and realname changing support, `m_chgident.so` and `m_chgname.so` must be loaded respectively.
- Supported channel, user, and prefix modes are negotiated on connect, but hotloading modules that change these is not supported. After changing module configuration, it is recommended to SQUIT PyLink to force a protocol renegotiation.
* [Nefarious IRCu](https://github.com/evilnet/nefarious2) (2.0.0+) - module `p10`
@ -138,4 +138,4 @@ PyLink supports connecting to IRCds as a relay bot and forwarding users back as
For Relay to work properly with Clientbot, be sure to load the `relay_clientbot` plugin in conjunction with `relay`.
Note: **Clientbot links can only be used as a leaf for Relay links - they CANNOT be used to host channels!** This means that Relay does not support having all your networks be Clientbot - in those cases you are better off using a classic relay bot, like [RelayNext for Limnoria](https://github.com/jlu5/SupyPlugins/tree/master/RelayNext).
Note: **Clientbot links can only be used as a leaf for Relay links - they CANNOT be used to host channels!** This means that Relay does not support having all your networks be Clientbot - in those cases you are better off using a classic relayer bot, like [RelayNext for Limnoria](https://github.com/jlu5/SupyPlugins/tree/master/RelayNext).

View File

@ -1,18 +1,3 @@
# PyLink 3.1.0 (2023-01-03)
This will be my (**@jlu5**'s) last release.
Changes since 3.1-beta1:
### Feature changes
- Allow loading a custom CA certificate via a ssl_cafile option (#677). Thanks to **@paigeadelethompson** for contributing
### Bug fixes
- relay: strip slashes (/) from idents
- raw: fix permission check logic
# PyLink 3.1-beta1 (2021-12-30)
### Feature changes

View File

@ -1 +1 @@
3.1.0
3.1-beta1

View File

@ -1796,7 +1796,6 @@ class IRCNetwork(PyLinkNetworkCoreWithUtils):
Initializes SSL/TLS for this network.
"""
log.info('(%s) Using TLS/SSL for this connection...', self.name)
cafile = self.serverdata.get('ssl_cafile')
certfile = self.serverdata.get('ssl_certfile')
keyfile = self.serverdata.get('ssl_keyfile')
@ -1805,11 +1804,10 @@ class IRCNetwork(PyLinkNetworkCoreWithUtils):
# Cert and key files are optional, load them if specified.
if certfile and keyfile:
try:
cafile != None and context.load_verify_locations(cafile)
context.load_cert_chain(certfile, keyfile)
except OSError:
log.exception('(%s) Caught OSError trying to initialize the SSL connection; '
'are "ssl_certfile", "ssl_keyfile", and "ssl_cafile" set correctly?',
'are "ssl_certfile" and "ssl_keyfile" set correctly?',
self.name)
raise

View File

@ -12,12 +12,16 @@ def raw(irc, source, args):
Sends raw text to the IRC server.
Use with caution - This command is only officially supported on Clientbot networks."""
if not conf.conf['pylink'].get("raw_enabled", False):
This command is not officially supported on non-Clientbot networks, where it
requires a separate permission."""
if irc.protoname == 'clientbot':
# exec.raw is included for backwards compatibility with PyLink 1.x
perms = ['raw.raw', 'exec.raw']
elif not conf.conf['pylink'].get("raw_enabled", False):
raise RuntimeError("Raw commands are not supported on this protocol")
# exec.raw is included for backwards compatibility with PyLink 1.x
permissions.check_permissions(irc, source, ['raw.raw', 'exec.raw'])
permissions.check_permissions(irc, source, perms)
args = ' '.join(args)
if not args.strip():

View File

@ -129,7 +129,7 @@ def die(irc=None):
except KeyError:
log.debug('relay.die: failed to clear persistent channels:', exc_info=True)
IRC_ASCII_ALLOWED_CHARS = string.digits + string.ascii_letters + '^|\\-_[]{}`'
IRC_ASCII_ALLOWED_CHARS = string.digits + string.ascii_letters + '/^|\\-_[]{}`'
FALLBACK_SEPARATOR = '|'
FALLBACK_CHARACTER = '-'
@ -215,7 +215,7 @@ def normalize_nick(irc, netname, nick, times_tagged=0, uid=''):
# Loop over every character in the nick, making sure that it only contains valid
# characters.
if not is_unicode_capable:
nick = _sanitize(nick, extrachars='/')
nick = _sanitize(nick)
else:
# UnrealIRCd 4's forbidden nick chars, from
# https://github.com/unrealircd/unrealircd/blob/02d69e7d8/src/modules/charsys.c#L152-L163