Compare commits

...

11 Commits

Author SHA1 Message Date
ccd94a71e2 * Thu Mar 06 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-30.sme
- systemd unit for ippp [SME: 12876]
- systemd unit for wan [SME: 12875]
- improve networking service unit [SME: 12541]
2025-03-06 17:14:41 -05:00
33833b4033 * Thu Mar 06 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-30.sme
-  systemd unit for ippp [SME: 12876]
-  systemd unit for wan [SME: 12875]
2025-03-06 17:11:29 -05:00
a3f80cc6fa test 2025-03-05 22:14:37 -05:00
f0f7b201cc * Wed Mar 05 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-29.sme
- change key type from service to configuration [SME: 11367]
2025-03-05 22:10:01 -05:00
d0b26d9228 * Thu Feb 20 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-28.sme
- clean sme-server.target [SME: 12931]
2025-02-20 22:55:39 -05:00
c58758fe43 * Sun Feb 16 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-27.sme
- fix missing allowed shell for login [SME: 12926]
2025-02-16 02:18:26 -05:00
f1752e7aa5 * Wed Feb 12 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-26.sme
- add pam_abl requirement [SME: 12914]
- add isdn4k-utils requirement for ippp isdn connections [SME: 12909]
- remove pam_tally as deprecated in favor of pam_faillock [SME: 12913]
2025-02-12 22:18:04 -05:00
4c64e91235 * Wed Feb 12 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-26.sme
- add pam_abl requirement [SME: 12914]
- add isdn4k-utils requirement for ippp isdn connections [SME: 12909]
- remove pam_tally as deprecated in favor of pam_faillock [SME: 12913]
- fix CGI::param called in list context [SME: 12888]
2025-02-12 22:17:17 -05:00
74d45e3c8e * Tue Feb 04 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-25.sme
- fix boot ordering cycle [SME: 12902]
2025-02-04 21:19:28 -05:00
507734d114 * Sun Jan 26 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-24.sme
- ippp and wan requires daemontools bins [SME: 12566]
2025-01-26 16:22:48 -05:00
0dfb543664 * Sat Jan 18 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-23.sme
- handle all ssl ciphers and protocol in one place esmith::ssl [SME: 12827]
  this will allow to sync all service default protocol and ciphers
  in one place.
2025-01-18 16:19:09 -05:00
48 changed files with 251 additions and 60 deletions

View File

@@ -45,7 +45,7 @@ foreach (qw(
/etc/diald.conf
/etc/diald.filter
/etc/diald/link
/var/service/ippp/config
/usr/lib/systemd/system/ippp.service.d/50koozali.conf
/etc/ppp/ioptions
))
{

View File

@@ -1 +1 @@
service
configuration

View File

@@ -1 +1 @@
service
configuration

View File

@@ -0,0 +1 @@
configuration

View File

@@ -1 +1 @@
service
configuration

View File

@@ -1 +1 @@
service
configuration

View File

@@ -0,0 +1,11 @@
{
my $pamtally = $DB->get("pam_tally") or return;
my $pamfaillock = $DB->get("pam_faillock") ||
$DB->new_record("pam_faillock", { type => "service" });
$pamfaillock->merge_props($pamtally->props);
$pamtally->delete;
}

View File

@@ -0,0 +1,5 @@
{
foreach my $sservice (qw(serial-console pppoe modSSL pam_abl pam_faillock)) {
$DB->set_prop($sservice, "type", "configuration") if ${$sservice}{type} eq "service";
}
}

View File

@@ -1,9 +1,10 @@
{
my $status = $pam_tally{status} || 'disabled';
return unless $status eq 'enabled';
$OUT .= "auth required pam_tally.so onerr=fail no_magic_root";
}
auth required pam_env.so
{
my $status = $pam_faillock{status} || 'disabled';
return unless $status eq 'enabled';
# lock out users after three unsuccessful attempts and unlock the user account after 10 minutes (600 seconds)
$OUT .= "auth required pam_faillock.so preauth silent audit deny=3 even_deny_root unlock_time=600 root_unlock_time=600";
}
{
my $status = $pam_abl{status} || 'disabled';
return unless $status eq 'enabled';
@@ -15,5 +16,10 @@ auth sufficient pam_unix.so likeauth nullok
return unless $status eq 'enabled';
$OUT .= "auth sufficient pam_ldap.so use_first_pass";
}
{
my $status = $pam_faillock{status} || 'disabled';
return unless $status eq 'enabled';
$OUT .= "auth [default=die] pam_faillock.so authfail audit deny=3 unlock_time=600";
}
auth required pam_deny.so

View File

@@ -7,7 +7,9 @@ account sufficient pam_succeed_if.so uid < 100 quiet
}
account required pam_permit.so
{
my $status = $pam_tally{status} || 'disabled';
my $status = $pam_faillock{status} || 'disabled';
return unless $status eq 'enabled';
$OUT .= "account required pam_tally.so deny=5 reset no_magic_root";
# if you drop this call to pam_faillock.so the lock will be done also
# on non-consecutive authentication failures
$OUT .= "account required pam_faillock.so";
}

View File

@@ -1,4 +1,3 @@
# dhcpd
:programname, isequal, "dhcpd" /var/log/dhcpd/dhcpd.log
& stop

View File

@@ -0,0 +1,3 @@
# ippp
:programname, isequal, "ippp" /var/log/ippp/ippp.log
& stop

View File

@@ -0,0 +1,3 @@
# wan
:programname, isequal, "wan" /var/log/wan/wan.log
& stop

View File

@@ -1 +1,2 @@
/bin/bash
/usr/bin/bash

View File

@@ -1 +1,2 @@
/bin/bash2
/usr/bin/bash2

View File

@@ -1 +1,2 @@
/sbin/e-smith/console
/usr/sbin/e-smith/console

View File

@@ -1 +1,2 @@
/bin/csh
/usr/bin/csh

View File

@@ -1 +1,2 @@
/bin/false
/usr/bin/false

View File

@@ -1 +1,2 @@
/bin/sh
/usr/bin/sh

View File

@@ -0,0 +1,11 @@
[Service]
Environment={
$OUT = 'ppp_options="';
$OUT .= "user $DialupUserAccount name $DialupUserAccount ";
# If you really want to change the options used by ipppd, then
# you can set the IpppdOptions property of the 'isdn' service.
# If you do this, you'd better know what you are doing!
$OUT .= $isdn{'IpppdOptions'} || "noauth debug -vj -vjccomp -bsdcomp -ac -pc";
$OUT .= " noipdefault ipcp-accept-local ipcp-accept-remote";
$OUT .= ' ipparam diald"';
}

View File

@@ -75,15 +75,15 @@ lpd=service|InitscriptOrder|60|status|enabled
mariadb=service|InitscriptOrder|90|status|enabled
masq=service|InitscriptOrder|06|Logging|none|Stealth|no|status|disabled
maxIbayNameLength=2
modSSL=service|status|enabled
modSSL=configuration|status|enabled
mysql.init=service|InitscriptOrder|99|status|enabled
named=service|chroot|yes|status|enabled
network=service|InitscriptOrder|10|status|enabled
ntpd=service|InitscriptOrder|55|status|disabled
php=service|status|enabled
php=configuration|status|enabled
pop3s=service|access|private|status|enabled
popd=service|access|private|status|enabled
pppoe=service|DemandIdleTime|no|InitscriptOrder|57|SynchronousPPP|no|status|disabled
pppoe=configuration|DemandIdleTime|no|InitscriptOrder|57|SynchronousPPP|no|status|disabled
qmail=service|InitscriptOrder|80|status|enabled
random=service|InitscriptOrder|20|status|enabled
scanner=service|ScannerFns|iscan|UpdateTime|1:14|scanMail|yes|status|enabled

View File

@@ -0,0 +1,9 @@
/var/log/ippp/ippp.log {
weekly
rotate 5
copytruncate
compress
notifempty
missingok
}

9
root/etc/logrotate.d/wan Normal file
View File

@@ -0,0 +1,9 @@
/var/log/wan/wan.log {
weekly
rotate 5
copytruncate
compress
notifempty
missingok
}

View File

@@ -11,7 +11,7 @@
# This should run before dialds are started and before any attempt
# is made to reconfigure ippp interfaces differently.
config_file=./config
LocalIP=$(/sbin/e-smith/config get LocalIP|| echo "127.0.0.88")
modprobe hisax
# TODO should check here for failure!!
@@ -55,4 +55,5 @@ ifconfig ippp0 "$LocalIP" \
# where all the traffic is to/from the local
# system. i.e. our reply must go out via the
# diald slip proxy.
exec ipppd ippp0 -detach -hostroute $pppopts
# will be done in main process
exit 0

View File

@@ -1 +0,0 @@
/var/service/ippp

View File

@@ -1 +0,0 @@
/var/service/wan

View File

@@ -2,7 +2,7 @@
Description=SME server bootstrap-console
DefaultDependencies=no
Conflicts=shutdown.target
After=livesys.service plymouth-quit-wait.service
After=livesys.service
After=systemd-vconsole-setup.service
Before=getty@tty1.service
Before=shutdown.target

View File

@@ -0,0 +1,21 @@
[Unit]
Description=Koozali SME Server ippp service for dialup
After=network-pre.target
After=networking.service
Requires=network.target
[Service]
Type=simple
#this needs to be updated in a dropin file
Environment=pppopts="user sme name sme noauth debug -vj -vjccomp -bsdcomp -ac -pc noipdefault ipcp-accept-local ipcp-accept-remote ipparam diald"
ExecStartPre=-/sbin/e-smith/service-status ippp
ExecStartPre=/sbin/e-smith/systemd/ippp-pre
ExecStart=/usr/sbin/ipppd ippp0 -detach -hostroute $pppopts
Restart=always
RestartSec=20s
SyslogIdentifier=ippp
[Install]
WantedBy=sme-server.target

View File

@@ -1,8 +1,11 @@
[Unit]
Description= Network management for Koozali SME Server, using old sysvinit script
After=network-pre.target
Wants=network-online.target
Wants=network.target
Before=network-online.target wan.service
Before=network-online.target
Before=network.target
Before=wan.service
Conflicts=NetworkManager.service
[Service]

View File

@@ -8,6 +8,6 @@ Requires=basic.target
Conflicts=rescue.service rescue.target multi-user.target
After=basic.target rescue.service rescue.target runit.service
AllowIsolate=yes
Wants=atd.service auditd.service avahi-daemon.service brandbot.path nfs-client.target remote-fs.target rhel-configure.service
Wants=atd.service auditd.service avahi-daemon.service nfs-client.target remote-fs.target
Wants=dbus.service plymouth-quit-wait.service plymouth-quit.service systemd-logind.service systemd-update-utmp-runlevel.service systemd-user-sessions.service

View File

@@ -1,16 +1,24 @@
[Unit]
Description=WAN interface for Koozali SME Server
After=network-pre.target networking.service
After=network-pre.target
After=networking.service
Before=network-online.target
PartOf=networking.service
[Service]
Type=oneshot
PermissionsStartOnly=true
WorkingDirectory=/var/service/wan
Type=simple
ExecStartPre=/sbin/e-smith/service-status wan
ExecStart=/usr/bin/sv u /service/wan
ExecStop=/usr/bin/sv stop /service/wan
ExecReload=/usr/bin/sv t /service/wan
ExecStart=/var/service/wan/run
ExecReload=/var/service/wan/run
#run.static will just exit, this might create an infinite loop
#unless set on-failure on-abnormal on-abort on-watchdog
Restart=on-failure
RestartSec=20s
RemainAfterExit=yes
SyslogIdentifier=wan
[Install]
WantedBy=sme-server.target

View File

@@ -200,8 +200,9 @@ SSLv23:!SSLv2:!SSLv3:!TLSv1:!TLSv1_1
=cut
sub SSLprotoQpsmtpd{
my $service= shift || 'qpsmtpd';
my $configdb = esmith::ConfigDB->open_ro or die "Could not open accounts db";
my %qpsmtpd = %{$configdb->get('httpd-e-smith')};
my %qpsmtpd = %{$configdb->get($service)};
# SSLv2 and SSLv3 are not available in el8 openssl-1.1.1, while -ssl3 still referenced
# it will throw Option unknown option -ssl3
my $protocols = "SSLv23:!SSLv2:!SSLv3";

View File

@@ -1,6 +0,0 @@
#! /bin/sh
exec \
/usr/local/bin/setuidgid smelog \
/usr/local/bin/multilog t s5000000 \
/var/log/ippp

View File

@@ -1,7 +0,0 @@
#! /bin/sh
exec \
/usr/local/bin/setuidgid smelog \
/usr/local/bin/multilog t s5000000 \
/var/log/wan

View File

@@ -9,4 +9,5 @@ then
fi
echo script run.$config not found - please report this as a bug
sleep 100
#sleep 100
exit 0

View File

@@ -0,0 +1,31 @@
#!/bin/sh
#----------------------------------------------------------------------
# copyright (C) 1999-2006 Mitel Networks Corporation
#
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#----------------------------------------------------------------------
exec 2>&1
. ./dhclient.config
configfile=/var/lib/dhclient/dhclient-$interface.conf
leasefile=/var/lib/dhclient/dhclient-$interface.leases
export PEERDNS=no
exec /sbin/dhclient -d \
-cf $configfile \
-lf $leasefile \
$interface

View File

@@ -0,0 +1,31 @@
#!/bin/sh
#----------------------------------------------------------------------
# copyright (C) 1999-2006 Mitel Networks Corporation
#
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#----------------------------------------------------------------------
exec 2>&1
. ./dhclient.config
configfile=/var/lib/dhclient/dhclient-$interface.conf
leasefile=/var/lib/dhclient/dhclient-$interface.leases
export PEERDNS=no
exec /sbin/dhclient -d \
-cf $configfile \
-lf $leasefile \
$interface

View File

@@ -3,7 +3,8 @@
ISDN=$(/sbin/e-smith/config getprop isdn status)
if [ "$ISDN" = "enabled" ]
then
sv u /service/ippp
# Stop and then start. If the units are not running yet, they will be started.
/usr/bin/systemctl restart ippp
sleep 10
# TODO check here that ISDN device is available!!
fi

View File

@@ -0,0 +1,21 @@
#------------------------------------------------------------
# !!DO NOT MODIFY THIS FILE!!
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer's guide, which is available
# at http://www.contribs.org/development/
#
# Copyright (C) 1999-2006 Mitel Networks Corporation
#------------------------------------------------------------
/sbin/ifconfig eth1 up mtu 1500
/sbin/modprobe ppp_generic
/sbin/modprobe ppp_async
/sbin/modprobe ppp_synctty
DEVICE=eth1
# add pppoe module
/sbin/modprobe pppoe
PPPD_MLIMIT=100000000
# PPPOE_TIMEOUT should be about 4*LCP_INTERVAL
PPPOE_TIMEOUT=120

View File

@@ -4,7 +4,7 @@ Summary: smeserver server and gateway - base module
%define name smeserver-base
Name: %{name}
%define version 11.0.0
%define release 22
%define release 30
Version: %{version}
Release: %{release}%{?dist}
License: GPL
@@ -49,6 +49,9 @@ Requires: bash-completion
Requires: smeserver-runit >= 2.6.0-7
Requires: smeserver-php >= 3.0.0-22
Requires: smeserver-yum >= 2.6.0-43
# daemontools bins in use :
# /var/service/wan/run.pppoe
Requires: /usr/bin/softlimit
Obsoletes: nss_ldap < 254
Obsoletes: cpu
Obsoletes: rlinetd, e-smith-mod_ssl
@@ -65,7 +68,11 @@ BuildRequires: smeserver-devtools >= 1.13.1-03
BuildRequires: gettext
Requires: gdisk
Requires: ppp
Requires: rp-pppoe
Requires: rp-pppoe
# pam autoblock
Requires: pam_abl
# isdn wan connection (ippp)
Requires: isdn4k-utils
%define dbfiles accounts configuration domains hosts networks
AutoReqProv: no
@@ -114,25 +121,13 @@ mkdir -p $RPM_BUILD_ROOT/etc/selinux
--dir /home/e-smith/ssl.crt 'attr(0700,root,root)' \
--dir /home/e-smith/ssl.pem 'attr(0700,root,root)' \
--dir /var/service/wan 'attr(1755,root,root)' \
--file /var/service/wan/down 'attr(0644,root,root)' \
--file /var/service/wan/run 'attr(0750,root,root)' \
--file /var/service/wan/run.dhclient 'attr(0750,root,root)' \
--file /var/service/wan/run.pppoe 'attr(0750,root,root)' \
--file /var/service/wan/run.static 'attr(0750,root,root)' \
--file /var/service/wan/run.dialup 'attr(0750,root,root)' \
--file /var/service/wan/run.disabled 'attr(0750,root,root)' \
--dir /var/service/wan/supervise 'attr(0700,root,root)' \
--dir /var/service/wan/log 'attr(1755,root,root)' \
--file /var/service/wan/log/run 'attr(0750,root,root)' \
--dir /var/service/wan/log/supervise 'attr(0700,root,root)' \
--dir /var/log/wan 'attr(2750,smelog,smelog)' \
--dir /var/service/ippp 'attr(1755,root,root)' \
--file /var/service/ippp/down 'attr(0644,root,root)' \
--file /var/service/ippp/run 'attr(0750,root,root)' \
--dir /var/service/ippp/supervise 'attr(0700,root,root)' \
--dir /var/service/ippp/log 'attr(1755,root,root)' \
--file /var/service/ippp/log/run 'attr(0750,root,root)' \
--dir /var/service/ippp/log/supervise 'attr(0700,root,root)' \
--dir /var/log/ippp 'attr(2750,smelog,smelog)' \
--dir /etc/e-smith/skel/user/.ssh 'attr(0700,root,root)' \
--file /etc/sysconfig/modules/dummy.modules 'attr(0755,root,root)' \
@@ -160,6 +155,9 @@ rm -rf $RPM_BUILD_ROOT
/sbin/e-smith/create-system-user smelastsys 2999 \
'sme last system user marker' /tmp /bin/false
exit 0
%post
LEXICONS=$(find /etc/e-smith/locale/*/etc/e-smith/web/panels/password/cgi-bin/userpassword -type f 2>/dev/null)
@@ -184,7 +182,32 @@ fi
%changelog
* Sat Jan 18 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-22.sme
* Thu Mar 06 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-30.sme
- systemd unit for ippp [SME: 12876]
- systemd unit for wan [SME: 12875]
- improve networking service unit [SME: 12541]
* Wed Mar 05 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-29.sme
- change key type from service to configuration [SME: 11367]
* Thu Feb 20 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-28.sme
- clean sme-server.target [SME: 12931]
* Sun Feb 16 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-27.sme
- fix missing allowed shell for login [SME: 12926]
* Wed Feb 12 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-26.sme
- add pam_abl requirement [SME: 12914]
- add isdn4k-utils requirement for ippp isdn connections [SME: 12909]
- remove pam_tally as deprecated in favor of pam_faillock [SME: 12913]
* Tue Feb 04 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-25.sme
- fix boot ordering cycle [SME: 12902]
* Sun Jan 26 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-24.sme
- ippp and wan requires daemontools bins [SME: 12566]
* Sat Jan 18 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-23.sme
- handle all ssl ciphers and protocol in one place esmith::ssl [SME: 12827]
this will allow to sync all service default protocol and ciphers
in one place.