Remove Spectrum in favour of Slidge

Slidge replaces Spectrum with immense improvement to bridging
capabilities, albeit with only experimental MUC support. Nevertheless,
the current state is sufficiently stable for a complete replacement.
This commit is contained in:
Alex Palaistras 2022-12-13 15:37:42 +00:00
parent 560cfc82b6
commit 4bc17662bd
9 changed files with 1 additions and 215 deletions

View File

@ -15,7 +15,6 @@ ignition:
- local: service/prosody/spec.ign
- local: service/biboumi/spec.ign
- local: service/radicale/spec.ign
- local: service/spectrum/spec.ign
- local: service/rss2email/spec.ign
- local: service/navidrome/spec.ign
- local: service/coturn/spec.ign
@ -24,6 +23,7 @@ ignition:
- local: service/prometheus/spec.ign
- local: service/grafana/spec.ign
- local: service/gitea/spec.ign
- local: service/slidge/spec.ign
- local: service/lldap/spec.ign
- local: service/gotosocial/spec.ign

View File

@ -12,7 +12,6 @@ MARIADB_ROOT_PASSWORD=password
PROSODY_HOST=prosody.localhost
PROSODY_HOST_EXTERNAL=prosody-external.localhost
PROSODY_BIBOUMI_PASSWORD=password
PROSODY_SPECTRUM_PASSWORD=password
PROSODY_SLIDGE_PASSWORD=password
# Configuration for Coturn.

View File

@ -1,49 +0,0 @@
FROM docker.io/debian:bullseye-slim AS builder
ARG SKYPE_VERSION=29c860170ca18c3f7f15b5ba7723e06ddc760361
ARG DISCORD_VERSION=df93a225cbaa2ca44baebafb540b840b78d43a7a
RUN apt-get update -y && apt-get install -y --no-install-recommends \
ca-certificates build-essential gettext git libpurple-dev libglib2.0-dev libnss3-dev \
libqrencode-dev libjson-glib-dev libhttp-parser-dev graphicsmagick-imagemagick-compat
RUN git clone https://github.com/EionRobb/skype4pidgin.git && \
cd skype4pidgin/skypeweb && git checkout ${SKYPE_VERSION} && make && make install DESTDIR=/spectrum-plugins && \
rm -Rf /skype4pidgin
RUN git clone https://github.com/EionRobb/purple-discord.git && \
cd purple-discord && git checkout ${DISCORD_VERSION} && make && make install DESTDIR=/spectrum-plugins && \
rm -Rf /purple-discord
FROM docker.io/golang:1.19 AS golang-builder
ARG WHATSAPP_VERSION=51b921da925f64a8b63a353b37d920d0bb40e844
RUN apt-get update -y && apt-get install -y --no-install-recommends \
ca-certificates build-essential cmake git libpurple-dev
RUN git clone https://github.com/hoehermann/purple-gowhatsapp.git && \
cd purple-gowhatsapp && git checkout ${WHATSAPP_VERSION} && mkdir -p build && cd build && \
cmake .. && cmake --build . && make install DESTDIR=/spectrum-plugins && \
rm -Rf /purple-gowhatsapp
FROM docker.io/debian:bullseye-slim
ARG VERSION=2.1.3
RUN apt-get update -y && apt-get install -y --no-install-recommends \
ca-certificates curl gnupg apt-transport-https gettext libnss3 libqrencode4 libjson-glib-1.0-0
RUN echo "deb https://packages.spectrum.im/spectrum2/ bullseye main" > /etc/apt/sources.list.d/spectrum2.list && \
echo "deb-src https://packages.spectrum.im/spectrum2/ bullseye main" >> /etc/apt/sources.list.d/spectrum2.list && \
curl -o - https://packages.spectrum.im/packages.key | apt-key add - && \
apt-get update -y && \
apt-get install -y --no-install-recommends spectrum2=1:${VERSION}"*" spectrum2-backend-libpurple=1:${VERSION}"*"
COPY --from=builder /spectrum-plugins /
COPY --from=golang-builder /spectrum-plugins /
RUN addgroup --system --gid 10000 spectrum
RUN adduser --system --uid 10000 --ingroup spectrum --home /var/lib/spectrum2 spectrum
COPY container/config /etc/spectrum2
COPY container/run-spectrum /run-spectrum
ENTRYPOINT ["/run-spectrum"]

View File

@ -1,12 +0,0 @@
# We create two rootLoggers:
# - "debug" is internal logger used by log4cxx
# - "stdout" is name of our ConsoleAppender logger
log4j.rootLogger=warn, stdout
# Create new ConsoleAppender logger with custom PatternLayout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
# Define the output pattern. Characters are mentioned here:
# http://logging.apache.org/log4cxx/apidocs/classlog4cxx_1_1_pattern_layout.html
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %-5p %c: %m%n

View File

@ -1,96 +0,0 @@
[service]
# The name of user/group Spectrum runs as.
user = spectrum
group = spectrum
# JID of Spectrum instance.
jid = ${SPECTRUM_HOSTNAME}
# Password used to connect the XMPP server.
password = ${SPECTRUM_PASSWORD}
# XMPP server to which Spectrum connects in gateway mode.
server = ${SPECTRUM_XMPP_HOST}
# XMPP server port.
port = 5347
# Interface on which Spectrum listens for backends.
# backend_host = 127.0.0.1
# Port on which Spectrum listens for backends.
# By default Spectrum chooses random backend port and there's no need to change it normally
# backend_port = 10001
# Number of users per one legacy network backend.
users_per_backend = 10
# Full path to backend binary.
backend = /usr/bin/spectrum2_libpurple_backend
# Choice of "protocol=any" means that user sets his protocol in his JID which has to be in following format: protocol.username@domain.tld
# So for example: prpl-jabber.hanzz.k%gmail.com@domain.tld
protocol = ${SPECTRUM_PROTOCOL}
# Where to re-host files uploaded by legacy protocol buddies, and which URL to return to XMPP.
web_directory=/var/lib/spectrum2-media
web_url=https://${PROSODY_HOST_EXTERNAL}/spectrum
# If enabled, your legacy network buddies will be removed when you unsubscribe from them in the XMPP.
# enable_remove_buddy = true
[identity]
# Name of Spectrum instance in service discovery
name = Spectrum Transport (${SPECTRUM_PROTOCOL})
# Type of transport ("msn", "icq", "xmpp").
# Check http://xmpp.org/registrar/disco-categories.html#gateway
type = xmpp
# Category of transport, default is "gateway".
# category = gateway
[logging]
# log4cxx/log4j logging configuration file in ini format used for main spectrum2 instance.
config = /etc/spectrum2/logging.cfg
# log4cxx/log4j logging configuration file in ini format used for backends.
backend_config = /etc/spectrum2/logging.cfg
[database]
# Database backend type
# "sqlite3", "mysql", "pqxx", or "none" without database backend
type = sqlite3
# For SQLite3: Full path to database
# For MySQL and PostgreSQL: name of database
# default database = /var/lib/spectrum2/$jid/database.sql
# database = jabber_transport
# Prefix used for tables
# prefix = jabber_
[registration]
# Enable public registrations
enable_public_registration = ${SPECTRUM_REGISTRATION_ENABLED}
# Text to display upon user registration form
# username_label=Jabber JID (e.g. user@server.tld):
# instructions=Enter your remote jabber JID and password as well as your local username and password
# If true a local Jabber account on <local_account_server> is needed for transport registration, the idea
# is to enable public registration from other servers, but only for users, who have already local accounts.
# require_local_account=1
# local_username_label=Local username (without @server.tld):
# local_account_server=localhost
# local_account_server_timeout=10000
[purple]
# Download user icons for WhatsApp.
get-icons = true
# Improve compatibility with WhatsApp protocol plugin.
bridge-compatibility = true
# Handle link-only messages for up to 2MB as media messages instead for WhatsApp.
embed-max-file-size = 2

View File

@ -1,13 +0,0 @@
#!/bin/sh
# Prepare configuration files for environment variable substitution.
ENV_NAMES="$(env | awk -F '=' '{printf "$%s ", $1}')"
for file in /etc/spectrum2/*.template; do
envsubst "${ENV_NAMES}" < "${file}" > $(echo "${file}" | awk -F '.template$' '{print $1}')
done
# Correct permissions for data files.
chown -R spectrum:spectrum /var/lib/spectrum2 /var/lib/spectrum2-media
# Run entrypoint.
/usr/bin/spectrum2 -n /etc/spectrum2/spectrum.cfg

View File

@ -1,8 +0,0 @@
variant: fcos
version: 1.3.0
storage:
trees:
- path: /etc/coreos-home-server/spectrum
local: service/spectrum/
- path: /etc/systemd/system
local: service/spectrum/systemd/

View File

@ -1,10 +0,0 @@
# Configuration for Spectrum.
SPECTRUM_HOSTNAME=spectrum
SPECTRUM_PROTOCOL=any
SPECTRUM_PASSWORD=${PROSODY_SPECTRUM_PASSWORD}
SPECTRUM_XMPP_HOST=prosody
SPECTRUM_REGISTRATION_ENABLED=1
# Options for Prosody component configuration.
PROSODY_COMPONENT_PASSWORD=${PROSODY_SPECTRUM_PASSWORD}
PROSODY_HOST_EXTERNAL=${PROSODY_HOST_EXTERNAL}

View File

@ -1,25 +0,0 @@
[Unit]
Description=Spectrum IM Transport for XMPP (%i)
Wants=container-build@%p.service container-volume@%p-%i.service prosody.service prosody-component-register@%p-%i.service nginx-serve-volume@%p-media.service
After=container-build@%p.service container-volume@%p-%i.service prosody.service prosody-component-register@%p-%i.service
Before=nginx-serve-volume@%p-media.service
[Service]
Type=notify
NotifyAccess=all
SyslogIdentifier=%N
Restart=on-failure
Environment=PODMAN_SYSTEMD_UNIT=%n
Environment=SPECTRUM_HOSTNAME=%p-%i SPECTRUM_PROTOCOL=prpl-%i
ExecStart=/bin/podman run --replace --name %p-%i --net internal --sdnotify=conmon \
--env-file %E/coreos-home-server/%p/%p.env \
--env SPECTRUM_HOSTNAME=${SPECTRUM_HOSTNAME} \
--env SPECTRUM_PROTOCOL=${SPECTRUM_PROTOCOL} \
--volume %p-%i:/var/lib/spectrum2:z \
--volume %p-media:/var/lib/spectrum2-media:z \
localhost/%p:latest
ExecStop=/bin/podman stop --ignore --time 10 %p-%i
ExecStopPost=/bin/podman rm --ignore --force %p-%i
[Install]
WantedBy=multi-user.target