Compare commits

...

26 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
8c05c61008 * Sat Jan 18 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-22.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 15:15:02 -05:00
e4b308e422 * Fri Jan 03 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-21.sme
- improve support of  systemd service with instance service@instance.service [SME: 12859]
2025-01-03 01:54:02 -05:00
5c4bf19137 * Thu Jan 02 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-20.sme
- Primary default to SSL required and redirect [SME: 12858]
- cleanup remove primary=system [SME: 8268]
2025-01-02 00:36:45 -05:00
5b938b2987 * Tue Dec 31 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-19.sme
- fix www removed from shared on group creation [SME: 12848]
2024-12-31 03:29:03 -05:00
3e5231bf84 * Mon Dec 23 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-18.sme
- add vlan support on External Interface [SME: 12677]
- fix typo [SME: 12763]
2024-12-23 07:08:37 -05:00
6547750d1e * Mon Dec 23 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-17.sme
- add vlan support on External Interface [SME: 12677]
2024-12-23 01:05:02 -05:00
e3e3f2a823 * Mon Dec 23 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-16.sme
-  add kernel module support for rp-pppoe plugin [SME: 12678]
   will allow faster fiber connexion when using multiple queue interface (RSS)
   set-gateway-ip will propagate both wan and diald ip
   run.pppoe call an interface
2024-12-23 00:54:54 -05:00
ed89fb60f4 * Sat Dec 21 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-15.sme
- fix use of passwd command when ldap auth enabled [SME: 6453]
- delete spool file only if exists to avoid error [SME: 12763]
2024-12-22 00:32:50 -05:00
ea9bb397dc Add *.bak to .gitignore 2024-11-12 19:19:12 +00:00
0ef4afa787 Deleting spurious *.spec.bak files 2024-11-12 19:19:10 +00:00
4404c2d3f4 Update README with specific Bugzilla links with status options 2024-10-27 14:28:15 +00:00
bf6e1e3560 Update readme bugzilla link to show all outstanding bugs 2024-10-27 12:11:27 +00:00
7738719049 * Mon Sep 23 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-14.sme
- fix result variable not initialized [SME: 12663]
2024-09-23 09:47:05 -04:00
5a1f39efb3 * Sun Sep 22 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-13.sme
- fix mail spool perms [SME: 12654]
- fix motd noise related to cockpit [SME: 12575]
- fix /run vs /var/run temps dir noise [SME: 12639]
2024-09-22 17:33:04 -04:00
8e4fd3be1e * Wed Aug 14 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-12.sme
- fix 3 regressions from SME10 [SME: 12654]
  fix www missing from shared and few groups [SME: 12146]
  fix group deletion leaves mail spool file [SME: 12431]
  fix path to /etc/systemd for seeking service files [SME: 12421]
2024-08-15 00:05:16 -04:00
80 changed files with 610 additions and 754 deletions

2
.gitignore vendored
View File

@@ -2,3 +2,5 @@
*.log
*spec-20*
*.tar.xz
*.bak
*gz

View File

@@ -6,7 +6,14 @@ SMEServer Koozali developed git repo for smeserver-base smeserver
<br />https://wiki.koozali.org/
## Bugzilla
Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=smeserver-base&product=SME%20Server%2010.X&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED)\
Show list of outstanding bugs:
[All](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=UNCONFIRMED&bug_status=CONFIRMED&bug_status=NEEDINFO&bug_status=IN_PROGRESS&bug_status=RESOLVED&bug_status=VERIFIED&cf_package=smeserver-base&classification=SME+Server&list_id=105756&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
[Confirmed](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=CONFIRMED&cf_package=smeserver-base&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
[Unconfirmed](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=UNCONFIRMED&cf_package=smeserver-base&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
[Need info](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=NEEDINFO&cf_package=smeserver-base&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
[In progress](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=IN_PROGRESS&cf_package=smeserver-base&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
[Resolved](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=RESOLVED&cf_package=smeserver-base&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
[Verified](https://bugs.koozali.org/buglist.cgi?action=wrap&bug_status=VERIFIED&cf_package=smeserver-base&classification=SME+Server&order=changeddate+DESC%2Ccomponent%2Cpriority%2Cbug_severity&query_format=advanced)
And a list of outstanding Legacy bugs: (e-smith-base) [here](https://bugs.koozali.org/buglist.cgi?component=e-smith-base&product=SME%20Server%2010.X&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED)
## Description

View File

@@ -1 +0,0 @@
D

View File

@@ -1 +0,0 @@
rpms/e-smith-base/sme10/e-smith-base-5.8.0

View File

@@ -1 +0,0 @@
:ext:jpp@shell.koozali.org:/cvs/smeserver

View File

@@ -1,672 +0,0 @@
#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
templates2events("/etc/sysconfig/i18n", qw(post-install post-upgrade e-smith-base-update));
templates2events("/etc/selinux/config", qw(post-install post-upgrade e-smith-base-update));
# give the correct configuration file of dhcpd.conf
templates2events("/etc/dhcp/dhcpd.conf", qw(bootstrap-console-save e-smith-base-update));
# ppp-conf-users
foreach (qw(pap-secrets chap-secrets))
{
templates2events("/etc/ppp/$_", qw(
bootstrap-console-save
console-save
remoteaccess-update
e-smith-base-update));
}
foreach (qw(
/var/service/wan/pppoe.pppd.conf
/var/service/wan/run.pppoe.conf
/etc/ppp/ip-down.local
/etc/ppp/ip-up.local
))
{
templates2events("$_", qw(
console-save
bootstrap-console-save
e-smith-base-update
));
}
safe_symlink("daemontools", "root/etc/rc.d/init.d/wan");
service_link_enhanced("wan", "S37", "7");
service_link_enhanced("wan", "K90", "6");
service_link_enhanced("wan", "K90", "0");
service_link_enhanced("wan", "K90", "1");
# conf-dialup
foreach (qw(
/etc/sysconfig/network-scripts/ifcfg-ppp0
/etc/sysconfig/network-scripts/chat-ppp0
/etc/ppp/ip-up.local
/etc/ppp/ip-down.local
/etc/diald.conf
/etc/diald.filter
/etc/diald/link
/var/service/ippp/config
/etc/ppp/ioptions
))
{
templates2events($_, qw(console-save bootstrap-console-save e-smith-base-update));
}
# conf-networking
foreach (qw(
/etc/sysconfig/network-scripts/ifcfg-bond0
/etc/modprobe.d/bonding.conf
/etc/sysconfig/network
/etc/nsswitch.conf
/etc/HOSTNAME
/etc/hosts
/etc/resolv.conf
/etc/sysctl.conf
/var/service/wan/dhclient.config
))
{
templates2events($_, qw(console-save bootstrap-console-save e-smith-base-update));
}
event_link("update-ifcfg", "console-save", "05");
event_link("update-ifcfg", "bootstrap-console-save", "05");
# conf-other
templates2events("/etc/crontab", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
email-update
logrotate
e-smith-base-update
));
templates2events("/etc/mime.types", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
email-update
logrotate
e-smith-base-update
));
templates2events("/etc/sysconfig/rsyslog", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
email-update
logrotate
e-smith-base-update
));
templates2events("/etc/rsyslog.conf", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
email-update
logrotate
e-smith-base-update
));
templates2events("/etc/updatedb.conf", qw(
bootstrap-console-save
e-smith-base-update
));
templates2events("/etc/openssl.conf", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
domain-create
domain-delete
network-create
network-delete
ip-change
e-smith-base-update
));
# conf-routes
event_link("update-ifcfg", "network-create", "05");
event_link("update-ifcfg", "network-delete", "05");
# conf-security
templates2events("/etc/securetty", qw(
console-save
bootstrap-console-save
ibay-create
ibay-delete
ibay-modify
ibay-modify-servers
network-create
network-delete
ip-change
email-update
remoteaccess-update
e-smith-base-update
));
templates2events("/etc/services", qw(
console-save
bootstrap-console-save
ibay-create
ibay-delete
ibay-modify
ibay-modify-servers
network-create
network-delete
ip-change
email-update
remoteaccess-update
e-smith-base-update
));
templates2events("/etc/shells", qw(
console-save
bootstrap-console-save
ibay-create
ibay-delete
ibay-modify
ibay-modify-servers
network-create
network-delete
ip-change
email-update
remoteaccess-update
e-smith-base-update
));
templates2events("/etc/hosts.deny", qw(
console-save
bootstrap-console-save
ibay-create
ibay-delete
ibay-modify
ibay-modify-servers
network-create
network-delete
ip-change
email-update
remoteaccess-update
e-smith-base-update
));
templates2events("/etc/hosts.allow", qw(
console-save
bootstrap-console-save
ibay-create
ibay-delete
ibay-modify
ibay-modify-servers
network-create
network-delete
ip-change
email-update
remoteaccess-update
e-smith-base-update
));
foreach my $file (qw(
/etc/pam.d/login
/etc/pam.d/system-auth
/etc/pam.d/passwd
/etc/pam.d/pwauth
/etc/pam_ldap.conf
/etc/pam_ldap.secret
/etc/security/pam_abl.conf
))
{
templates2events($file, qw(console-save bootstrap-console-save e-smith-base-update));
}
foreach (qw(
/etc/cpu.conf
/etc/cpu-system.conf
))
{
templates2events("$_", qw(
post-upgrade
console-save
bootstrap-console-save
ldap-update
e-smith-base-update
));
}
# conf-userlists
foreach (qw(users.allow accounts.allow accounts.deny))
{
templates2events("/etc/e-smith/pam/$_", qw(
bootstrap-console-save
ibay-create
ibay-delete
user-create
user-delete
password-modify
e-smith-base-update
));
}
# fstab-conf
templates2events("/etc/fstab", qw(post-install post-upgrade e-smith-base-update));
# init-conf
templates2events("/etc/inittab", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
remoteaccess-update
e-smith-base-update
));
# lynx-conf
templates2events("/etc/lynx.cfg", qw(console-save bootstrap-console-save e-smith-base-update));
templates2events("/etc/elinks.conf", qw(bootstrap-console-save e-smith-base-update));
#
# Set up generic logfile timestamp renaming/symlinking
foreach (qw(
/var/log/messages
/var/log/boot.log
/var/log/secure
/var/log/cron
/var/log/spooler
/var/log/maillog
))
{
safe_touch "root/etc/e-smith/events/logrotate/logfiles2timestamp/$_";
safe_touch "root/etc/e-smith/events/post-install/logfiles2timestamp/$_";
safe_touch "root/etc/e-smith/events/post-upgrade/logfiles2timestamp/$_";
safe_touch "root/etc/e-smith/events/e-smith-base-update/logfiles2timestamp/$_";
}
#--------------------------------------------------
# functions for manager panel
#--------------------------------------------------
my $panel = "manager";
panel_link("groups", $panel);
panel_link("localnetworks", $panel);
panel_link("online-manual", $panel);
panel_link("reboot", $panel);
panel_link("remoteaccess", $panel);
panel_link("review", $panel);
panel_link("useraccounts", $panel);
#--------------------------------------------------
# actions for e-smith-base-update event
#--------------------------------------------------
my $event = "e-smith-base-update";
templates2events("/etc/smartd.conf", $event);
templates2events("/home/e-smith/ssl.pem/pem", $event);
event_link("fix-startup", $event, "05");
event_link("rotate_timestamped_logfiles", $event, "05");
event_link("init-accounts", $event, "05");
event_link("set-hostname", $event, "10");
event_link("rmmod-bonding", $event, "10");
event_link("conf-startup", $event, "10");
event_link("user-lock-passwd", $event, "15");
event_link("group-modify-unix", $event, "15");
event_link("update-passwd", $event, "20");
event_link("count-active-user-accounts", $event, "25");
event_link("conf-modules", $event, "30");
event_link("create-mnt-floppy", $event, "50");
event_link("conf-routes", $event, "89");
event_link("reset-unsavedflag", $event, "95")
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/wan");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dhcpd");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyslog");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/crond");
#--------------------------------------------------
# actions for console-save event
#--------------------------------------------------
my $event = "console-save";
templates2events("/etc/smartd.conf", $event);
templates2events("/home/e-smith/ssl.pem/pem", $event);
event_link("set-hostname", $event, "10");
event_link("conf-modules", $event, "30");
event_link("conf-startup", $event, "60");
event_link("reset-unsavedflag", $event, "95");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/wan");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dhcpd");
#--------------------------------------------------
# actions for bootstrap-console-save event
#--------------------------------------------------
$event = "bootstrap-console-save";
templates2events("/etc/smartd.conf", $event);
templates2events("/home/e-smith/ssl.pem/pem", $event);
event_link("rmmod-bonding", $event, "10");
event_link("set-hostname", $event, "10");
event_link("conf-modules", $event, "30");
event_link("conf-startup", $event, "60");
event_link("conf-routes", $event, "89");
event_link("reset-unsavedflag", $event, "95");
#--------------------------------------------------
# actions for bootstrap-ldap-save
#--------------------------------------------------
$event = "bootstrap-ldap-save";
templates2events("/etc/nsswitch.conf", $event);
templates2events("/etc/pam.d/system-auth", $event);
event_link("user-lock-passwd", $event, "15");
event_link("user-modify-unix", $event, "15");
#--------------------------------------------------
# actions for group-create event
#--------------------------------------------------
$event = "group-create";
event_link("group-create-unix", $event, "04");
#--------------------------------------------------
# actions for group-delete event
#--------------------------------------------------
$event = "group-delete";
event_link("group-delete-unix", $event, "15");
#--------------------------------------------------
# actions for group-modify event
#--------------------------------------------------
$event = "group-modify";
event_link("group-modify-unix", $event, "15");
#--------------------------------------------------
# actions for halt event
#--------------------------------------------------
$event = "halt";
event_link("halt", $event, "70");
#--------------------------------------------------
# actions for ip-change event
#--------------------------------------------------
$event = "ip-change";
event_link("set-external-ip", $event, "03");
event_link("update-dns", $event, "85");
#--------------------------------------------------
# actions for network-create event
#--------------------------------------------------
$event = "network-create";
event_link("conf-routes", $event, "89");
#--------------------------------------------------
# actions for network-delete event
#--------------------------------------------------
$event = "network-delete";
event_link("conf-routes", $event, "89");
#--------------------------------------------------
# actions for post-install event
#--------------------------------------------------
$event = "post-install";
event_link("fix-startup", $event, "05");
event_link("rotate_timestamped_logfiles", $event, "05");
event_link("init-accounts", $event, "05");
event_link("init-passwords", $event, "10");
event_link("conf-startup", $event, "10");
event_link("conf-modules", $event, "30");
event_link("create-mnt-floppy", $event, "50");
#--------------------------------------------------
# actions for post-upgrade event
#--------------------------------------------------
$event = "post-upgrade";
event_link("fix-startup", $event, "05");
event_link("rotate_timestamped_logfiles", $event, "05");
event_link("init-accounts", $event, "05");
event_link("conf-startup", $event, "10");
event_link("user-lock-passwd", $event, "15");
event_link("group-modify-unix", $event, "15");
event_link("update-passwd", $event, "20");
event_link("count-active-user-accounts", $event, "25");
event_link("conf-modules", $event, "30");
event_link("create-mnt-floppy", $event, "50");
event_link("copy-anaconda-logs", $event, "90");
#--------------------------------------------------
# actions for reboot event
#--------------------------------------------------
$event = "reboot";
safe_symlink("stop", "root/etc/e-smith/events/$event/services2adjust/wan");
event_link("reboot", $event, "99");
#--------------------------------------------------
# actions for remoteaccess-update event
#--------------------------------------------------
$event = "remoteaccess-update";
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dhcpd");
#--------------------------------------------------
# actions for user-create event
#--------------------------------------------------
$event = "user-create";
event_link("user-create-unix", $event, "04");
event_link("count-active-user-accounts", $event, "25");
event_link("user-group-modify", $event, "85");
#--------------------------------------------------
# actions for user-delete event
#--------------------------------------------------
$event = "user-delete";
event_link("user-delete-groups-and-pseudonyms", $event, "02");
event_link("user-delete-unix", $event, "15");
event_link("initialize-default-databases", $event, "23");
event_link("count-active-user-accounts", $event, "25");
#--------------------------------------------------
# actions for user-modify event
#--------------------------------------------------
$event = "user-modify";
event_link("user-modify-unix", $event, "15");
event_link("user-group-modify", $event, "85");
$event = "user-modify-admin";
event_link("user-modify-unix", $event, "15");
#--------------------------------------------------
# actions for user-lock event
#--------------------------------------------------
$event = "user-lock";
event_link("user-lock-passwd", $event, "15");
event_link("count-active-user-accounts", $event, "25");
#--------------------------------------------------
# actions for password-modify event
#--------------------------------------------------
$event = "password-modify";
event_link("count-active-user-accounts", $event, "25");
#--------------------------------------------------
# actions for timeserver-update event
#--------------------------------------------------
$event = "timeserver-update";
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/crond");
#--------------------------------------------------
# actions for ip-up event
#--------------------------------------------------
$event = "ip-up";
event_link("set-gateway-ip", $event, "55");
#--------------------------------------------------
# actions for ip-down event
#--------------------------------------------------
$event = "ip-down";
event_link("isdn-down-notify", $event, "50");
#--------------------------------------------------
# actions for logrotate event
#--------------------------------------------------
$event = "logrotate";
event_link("rotate_timestamped_logfiles", $event, "05");
event_link("purge-old-logs", $event, "75");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyslog");
#--------------------------------------------------
# actions for local event
#--------------------------------------------------
$event = "local";
#--------------------------------------------------
# actions for ldap-update event
#--------------------------------------------------
$event = "ldap-update";
templates2events("/home/e-smith/ssl.pem/pem", $event);
#--------------------------------------------------
# actions for ldap-update event
#--------------------------------------------------
$event = "ssl-update";
templates2events("/home/e-smith/ssl.pem/pem", $event);
#--------------------------------------------------
# actions for email-update event:
# email parameters have been changed in the e-smith
# manager; update system security, rewrite email config
# files, configure other system files (crontab is the
# important one), and restart server
#--------------------------------------------------
$event = "email-update";
my %service2order =
(
# Start rsyslog up before network!
raidmonitor => "15",
network => "37",
dhcpd => "65",
'local' => "99",
);
foreach my $service (keys %service2order)
{
service_link_enhanced($service, $service2order{$service}, 7);
}
%service2order =
(
dhcpd => "K35",
);
foreach my $service (keys %service2order)
{
service_link_enhanced($service, $service2order{$service}, 0);
service_link_enhanced($service, $service2order{$service}, 6);
service_link_enhanced($service, $service2order{$service}, 1);
}
# Set up links to daemontools.
safe_symlink("daemontools", "root/etc/rc.d/init.d/raidmonitor");
safe_symlink("run.dhclient", "root/var/service/wan/run.DHCPHostname");
safe_symlink("run.dhclient", "root/var/service/wan/run.DHCPEthernetAddress");
# Local event
safe_symlink("../daemontools", "root/etc/rc.d/init.d/supervise/local");
safe_symlink("/var/service/local" , 'root/service/local');
safe_touch("root/var/service/local/down");
# no template headers for /etc/pam_ldap.secret
safe_touch("root/etc/e-smith/templates/etc/pam_ldap.secret/template-begin");
system('mkdir -p root/usr/lib/systemd/system/multi-user.target.wants/');
unlink "root/usr/lib/systemd/system/multi-user.target.wants/bootstrap-console.service";
symlink("/usr/lib/systemd/system/bootstrap-console.service",
"root/usr/lib/systemd/system/multi-user.target.wants/bootstrap-console.service")
or die "Can't symlink to root/usr/lib/systemd/system/multi-user.target.wants/bootstrap-console.service: $!";
# languages links
foreach (qw(fr-be fr-lu fr-mc fr-ch))
{
safe_symlink("fr", "root/etc/e-smith/locale/$_");
}
foreach (qw(en-bz en-ca en-ie en-in en-jm en-my en-ph en-sg en-tt en-za en-zw))
{
safe_symlink("en-us", "root/etc/e-smith/locale/$_");
}
foreach (qw(es-ar es-bo es-cl es-co es-cr es-do es-ec es-es es-gt es-hn es-mx es-ni es-pa es-pe es-pr es-py es-sv es-us es-uy es-ve))
{
safe_symlink("es", "root/etc/e-smith/locale/$_");
}
foreach (qw(de-at de-ch de-de de-li de-lu))
{
safe_symlink("de", "root/etc/e-smith/locale/$_");
}
foreach (qw(it-ch it-it))
{
safe_symlink("it", "root/etc/e-smith/locale/$_");
}
foreach (qw(ro-ro ro-md))
{
safe_symlink("ro", "root/etc/e-smith/locale/$_");
}
foreach (qw(sv-fi sv-se))
{
safe_symlink("sv", "root/etc/e-smith/locale/$_");
}
safe_symlink("zh-tw", "root/etc/e-smith/locale/zh-hk");

View File

@@ -1 +0,0 @@
sme10

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
))
{
@@ -309,6 +309,7 @@ templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $even
event_link("systemd-journald", $event, "02");
event_link("fix-startup", $event, "05");
event_link("init-accounts", $event, "05");
event_link("mail-spool-fix", $event, "05");
event_link("logrotate-migrate", $event, "06");
event_link("rotate_logfiles", $event, "07");
event_link("set-hostname", $event, "10");
@@ -325,6 +326,7 @@ event_link("conf-routes", $event, "89");
event_link("systemd-default", $event, "88");
event_link("systemd-isolate", $event, "89");
event_link("systemd-reload", $event, "89");
event_link("fix-noise-el8", $event, "89");
event_link("raidmonitor-check", $event, "92");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/network");
@@ -457,6 +459,7 @@ event_link("conf-modules", $event, "30");
event_link("create-mnt-floppy", $event, "50");
event_link("systemd-default", $event, "88");
event_link("systemd-reload", $event, "89");
event_link("fix-noise-el8", $event, "89");
#--------------------------------------------------
# actions for post-upgrade event
@@ -469,6 +472,7 @@ templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $even
event_link("systemd-journald", $event, "02");
event_link("fix-startup", $event, "05");
event_link("init-accounts", $event, "05");
event_link("mail-spool-fix", $event, "05");
event_link("logrotate-migrate", $event, "06");
event_link("rotate_logfiles", $event, "07");
event_link("conf-startup", $event, "10");
@@ -512,6 +516,7 @@ $event = "user-create";
event_link("user-create-unix", $event, "04");
event_link("count-active-user-accounts", $event, "25");
event_link("user-group-modify", $event, "85");
event_link("mail-spool-fix", $event, "89");
#--------------------------------------------------
# actions for user-delete event
@@ -523,6 +528,7 @@ event_link("user-delete-groups-and-pseudonyms", $event, "02");
event_link("user-delete-unix", $event, "15");
event_link("initialize-default-databases", $event, "23");
event_link("count-active-user-accounts", $event, "25");
event_link("mail-spool-fix", $event, "89");
#--------------------------------------------------
# actions for user-modify event
@@ -624,6 +630,7 @@ templates2events("/home/e-smith/ssl.pem/pem", $event);
$event = "email-update";
event_link("systemd-default", $event, "88");
event_link("systemd-reload", $event, "89");
event_link("mail-spool-fix", $event, "89");
#--------------------------------------------------
# actions for webapps-update event

View File

@@ -0,0 +1,2 @@
# cockpit noise [SME: 12575]
cockpit-ws:any:ln -sfn /dev/null /etc/motd.d/cockpit

View File

@@ -0,0 +1 @@
enabled

View File

@@ -1 +0,0 @@
system

View File

@@ -0,0 +1,10 @@
{
# Delete any pre-existing primary=system record (all lower case)
my $p = $DB->get('primary');
return unless defined $p;
my $type = $p->prop('type');
return unless defined $type;
$p->delete if $type eq 'system';
}

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

@@ -0,0 +1,4 @@
#!/bin/bash
# remove cockpit alert forever [SME: 12575]
ln -sfn /dev/null /etc/motd.d/cockpit

View File

@@ -137,7 +137,9 @@ foreach my $member (@groupMembers)
# new group to the list. Finally sort, join and run the usermod
# function to update the group list for this member.
my $cmd = "/usr/bin/id -G -n '$member'";
#my $cmd = "/usr/bin/id -G -n '$member'";
# this will not fail in case of apache aliase before www in passwd
my $cmd = "/usr/bin/groups '$member' 2>/dev/null | cut -d' ' -f3- ";
my $groups = `$cmd 2>/dev/null`;
if ($? != 0)
{

View File

@@ -59,4 +59,7 @@ $result && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to delete dumm
$result = $ldap->ldapdelgroup($groupName);
$result && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to delete (ldap) group $groupName.\n" );
# delete mail spool file
unless ($x == 255) { if ( -e "/var/spool/mail/$groupName" ) {unlink("/var/spool/mail/$groupName") or ( $x = 255, warn "Failed to delete /var/spool/mail/$groupName.\n" );} }
exit ($x);

View File

@@ -54,6 +54,11 @@ else
@groups = $a->groups;
}
# fix www missing in shared
my ( $name, $passwd, $gid, $members ) = getgrnam('shared');
my @mb= split(/ /, $members);
system("usermod -a -G shared www") unless ( grep(/^www$/, @mb) ) ;
foreach my $group (@groups)
{
my $groupName = $group->key;
@@ -125,18 +130,23 @@ foreach my $group (@groups)
# We need to add or remove this member from the group
# Get the supplementary group list for the member we are adding or
# deleting.
my $cmd = "/usr/bin/id -G -n '$member'";
#my $cmd = "/usr/bin/id -G -n '$member'";
# this will not fail in case of apache before www in passwd
my $cmd = "/usr/bin/groups '$member' 2>/dev/null | cut -d' ' -f3- ";
my $groups = `$cmd 2>/dev/null`;
if ($? != 0)
{
die "Failed to get supplementary group list for $member.\n";
}
$groups =~ s/^.*:\s+//;
chomp ($groups);
my @groupList = split (/\s+/, $groups);
@groupList = grep (!/^$member$/, @groupList);
# Apache is an alias for www
@groupList = map { $_ =~ s/^apache$/www/g; $_ } @groupList;
# www needs to be in shared
push(@groupList,'shared') if ( ($member eq 'www') and (! grep{$_ eq 'shared'} @groupList));
if ($oldMembers{$member})
{

View File

@@ -0,0 +1,47 @@
#! /bin/bash
#----------------------------------------------------------------------
# copyright (C) 2023 Koozali SME Server
#
# 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
#
#----------------------------------------------------------------------
# fix ownership of spool folder content
pushd /var/spool/mail/ >/dev/null
for file in *; do
if [ ! -f "$file" ]; then
continue
fi
if ( ! `id -u $file 2>/dev/null 1>&2`) ; then
echo "$file user does not exist deleting mail spool file"
rm -f /var/spool/mail/$file
continue
fi
userf=$(stat -c %U /var/spool/mail/$file 2>/dev/null)
if [[ "$userf" != "$file" ]]; then
uidf=$(stat -c %u /var/spool/mail/$file 2>/dev/null)
uiduser=$(id -u $file 2>/dev/null )
# extra step needed if username has an alias eg www=apache
if [[ "$uidf" != "$uiduser" ]]; then
echo "fixing ownership of $file spool mail"
# extra security we want to clean it from sensitive information
echo ""> /var/spool/mail/$file
chown $file /var/spool/mail/$file
fi
fi
done
popd >/dev/null

View File

@@ -34,7 +34,7 @@
# remote_ip = $6
# ipparam = $7
if [ "$7" = "diald" ]
if [ "$7" = "diald" ] || [ "$7" = "wan" ]
then
exec /sbin/e-smith/config set GatewayIP "$6"
fi

View File

@@ -54,7 +54,9 @@ if (!symlink($old_qfn, $new_qfn)) {
# we let the dedicated systemd command tryin to do what we will do later in this script
# as up to systemd 236 it is bugged see:
# https://github.com/systemd/systemd/pull/7158 and https://github.com/systemd/systemd/pull/7289
# https://github.com/systemd/systemd/pull/7158 : systemctl: respect [Install] section in drop-ins: should be fixed in SME 12 (239)
# https://github.com/systemd/systemd/issues/9477 : aliases; open
# https://github.com/systemd/systemd/pull/9901 allow instantiated units to be enabled via presets v240
system("/usr/bin/systemctl preset-all");
# in case preset-all messed up with our default target
system("/usr/bin/systemctl set-default sme-server.target");
@@ -101,11 +103,12 @@ foreach my $filen (reverse sort keys %files) {
my $service=$2;
my $stats=$1;
# print $_ ."\n";
#ignore service that does not exists !
# ignore service that does not exists !
# here we are searching for service@instance.service type
my $multiple = $service;
($multiple = $service ) =~ s/([a-zA-Z0-9\-_.]+@)(.*)/$1.service/ if ( $service =~ /@/ );
#print "$stats $service $multiple\n";
next unless ( -e "/usr/lib/systemd/system/$service" or -e "/etc/lib/systemd/system/$service" or -e "/usr/lib/systemd/system/$multiple");
#print "$stats $service $multiple\n" if $service ne $multiple;
next unless ( -e "/usr/lib/systemd/system/$service" or -e "/etc/systemd/system/$service" or -e "/usr/lib/systemd/system/$multiple");
# eliminate duplicates, this way we keep only the last entry of the lowest file as we do it in reverse order of file,
# but from top to bottom of file.
$services{$service}=$stats;
@@ -117,7 +120,7 @@ foreach my $filen (reverse sort keys %files) {
#print "want $service \n";
}
else {
my $wanted = `grep -P '^WantedBy=.*sme-server.target' /usr/lib/systemd/system/$service* /etc/systemd/system/$service* -rsh` ;
my $wanted = `grep -P '^WantedBy=.*sme-server.target' /usr/lib/systemd/system/$service* /etc/systemd/system/$service* /usr/lib/systemd/system/$multiple* /etc/systemd/system/$multiple* -rsh` ;
chomp $wanted;
$wantedBy{$service}=1 unless ( $wanted eq "");
#print "want $service \n" unless ( $wanted eq "") ;

View File

@@ -18,6 +18,15 @@ if (($c->get('EthernetDriver1')->value || 'unknown') eq 'dummy'){
if (($c->get('InternalInterface')->prop('NICBonding') || 'disabled') eq 'enabled'){
push @adapters, "bond\tbond\t10:00:01:02:03:04\tBonding virtual Interface\tbond0";
}
# if external VLAN is configured
if (($c->get('ExternalInterface')->prop('VLAN') || 'disabled') ne 'disabled'){
my $name= ($c->get('ExternalInterface')->prop('Name') eq "ppp0") ? $c->get('pppoe')->prop('PhysicalInterface') : $c->get('ExternalInterface')->prop('Name') ;
my $vlan=$c->get('ExternalInterface')->prop('VLAN');
$name=~ s/\.$vlan$//;
my ($newl) = grep ( /$name$/ , @adapters);
push @adapters, "$newl.$vlan";
}
#TODO if external virtual lan is configured
# Expand templates for every adapters found
foreach my $adapter (@adapters){

View File

@@ -32,6 +32,7 @@ my $a = esmith::AccountsDB->open or die "Could not open accounts db";
my $conf = esmith::ConfigDB->open or die "Could not open configuration db";
my $ldapauth = $conf->get('ldap')->prop('Authentication') || 'disabled';
my $result;
my $x = 0; # exit value
# prepare LDAP bind

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

@@ -2,7 +2,7 @@ password sufficient pam_unix.so nullok md5 shadow
{
my $status = $ldap{Authentication} || 'disabled';
return unless $status eq 'enabled';
$OUT .= "password sufficient pam_ldap.so use_authtok";
$OUT .= "password sufficient pam_ldap.so";
}
password required pam_deny.so

View File

@@ -0,0 +1,3 @@
# PPPOE needs this if using kernel space with rp-pppoe.se plugin
/sbin/iptables -t mangle -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

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 @@
LINUX_PLUGIN=/usr/lib64/pppd/2.4.5/rp-pppoe.so

View File

@@ -0,0 +1,10 @@
{
$is_vlan = "no";
if ( ( exists $ExternalInterface{VLAN} && $ExternalInterface{VLAN} =~ /^\d+$/ ) && ($is_external || ( $ExternalInterface{Configuration} eq "pppoe") && $pppoe{PhysicalInterface} eq $THIS_DEVICE ) )
{
$ifup_this_device = "yes";
$is_vlan = "yes";
}
"";
}

View File

@@ -0,0 +1,4 @@
{
return unless ($is_vlan eq "yes");
$OUT = "VLAN=yes\n";
}

View File

@@ -11,7 +11,7 @@ foreach my $service ($c->get_all_by_prop(type => 'service')){
my $multiple = $servicename;
($multiple = $servicename ) =~ s/([a-zA-Z0-9\-_.]+@)(.*)/$1.service/ if ( $servicename =~ /@/ );
$OUT .= "# Systemd service file does not exist : " unless -e "/usr/lib/systemd/system/$servicename" || -e "/etc/lib/systemd/system/$servicename" || -e "/usr/lib/systemd/system/$multiple";
$OUT .= "# Systemd service file does not exist : " unless -e "/usr/lib/systemd/system/$servicename" || -e "/etc/systemd/system/$servicename" || -e "/usr/lib/systemd/system/$multiple";
$OUT .= "$status $servicename\n";
$OUT .= "$status $multiple\n" unless $multiple eq $servicename ;

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

@@ -0,0 +1 @@
plugin /usr/lib64/pppd/2.4.5/rp-pppoe.so

View File

@@ -0,0 +1,2 @@
# add pppoe module
/sbin/modprobe pppoe

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

@@ -0,0 +1 @@
8021q

View File

@@ -0,0 +1 @@
d /run/portreserve 0755 root root 10d

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

@@ -559,9 +559,37 @@ ETHERNET_EXTERNAL:
goto ETHERNET_EXTERNAL;
}
goto ETHERNET_EXTERNAL_VLAN;# was SERVER_GATEWAY_DEDICATED;
}
#------------------------------------------------------------
ETHERNET_EXTERNAL_VLAN:
#------------------------------------------------------------
{
($rc, $choice) = $console->input_page
(
title => gettext("Select External Interface VLAN"),
text =>
gettext("Your ISP might have provided you a VLAN to use, if not leave empty."),
value => $db->get_prop('ExternalInterface', 'VLAN') || ""
);
goto ETHERNET_EXTERNAL unless ($rc == 0);
# sanitize if a previous VLAN is present
my $extIF = $db->get_prop('ExternalInterface', 'Name');
$extIF =~ s/\.\d+$//;
if ( $choice =~ /^\d+$/ )
{
$db->set_prop('ExternalInterface', 'VLAN', $choice );
$db->set_prop('ExternalInterface', 'Name', $extIF . ".$choice") unless $db->get_prop('ExternalInterface', 'Name') =~ /\.$choice$/;
}
else
{
$db->delete_prop('ExternalInterface', 'VLAN');
$db->set_prop('ExternalInterface', 'Name',$extIF);
}
goto SERVER_GATEWAY_DEDICATED;
}
#------------------------------------------------------------
SERVER_GATEWAY_DEDICATED:
#------------------------------------------------------------

View File

@@ -6,18 +6,26 @@ use esmith::ConfigDB;
our @ISA = qw(Exporter);
our @EXPORT = qw( key_exists_good_size cert_exists_good_size cert_is_cert key_is_key related_key_cert);
our @EXPORT = qw( key_exists_good_size cert_exists_good_size cert_is_cert key_is_key related_key_cert SSLproto SSLprotoApache SSLprotoComa SSLprotoHyphen SSLprotoMin SSLprotoLDAP SSLprotoQpsmtpd $smeCiphers $smeSSLprotocol %existingSSLprotos);
my $configdb = esmith::ConfigDB->open_ro or die "Could not open accounts db";
our $SystemName = $configdb->get('SystemName')->value;
our $DomainName = $configdb->get('DomainName')->value;
our $FQDN = "$SystemName.$DomainName";
# test key size
# test key exists
#default cipher list
our $smeCiphers = "TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:TLS_AES_128_CCM_SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:ECDH-RSA-AES256-GCM-SHA384:ECDH-ECDSA-AES256-GCM-SHA384:ECDH-RSA-AES256-SHA384:ECDH-ECDSA-AES256-SHA384:ECDH-RSA-AES256-SHA:ECDH-ECDSA-AES256-SHA:!ADH:!SSLv2:!ADH:!aNULL:!MD5:!RC4";
#default protocol list
# 2024 phase out : TLS 1.1 and 1.0 ; insuficient: SSL 3.0, 2.0 and 1.0
our $smeSSLprotocol = "TLSv1.2 TLSv1.3";
# SSLv2 and SSLv3 are not available in el8 openssl-1.1.1, while -ssl3 still in man page
# it will throw Option unknown option -ssl3
our %existingSSLprotos=%{ {'SSLv3'=>1, 'TLSv1'=>1, 'TLSv1.1'=>1, 'TLSv1.2'=>1, 'TLSv1.3'=>1}};
=head1 NAME
esmith::php - A few tools to help with php-fpm installed versions
esmith::ssl - A few tools to help with ssl handling
=head1 SYNOPSIS
@@ -42,6 +50,7 @@ returns 0 if key is missing or wrong size
returns 1 if key exists and key size is correct
=cut
sub key_exists_good_size {
my $configdb = esmith::ConfigDB->open_ro or die "Could not open accounts db";
my %modSSL = $configdb->as_hash('modSSL');
@@ -74,8 +83,8 @@ sub key_exists_good_size {
# check cert size Public-Key
# openssl rsa -noout -modulus -in domain.key | openssl md5
# openssl x509 -noout -modulus -in domain.crt | openssl md5
=cut
sub cert_exists_good_size {
my $configdb = esmith::ConfigDB->open_ro or die "Could not open accounts db";
my %modSSL = $configdb->as_hash('modSSL');
@@ -99,6 +108,10 @@ sub cert_exists_good_size {
return 0;
}
=head2 cert_is_cert
check if file is really a certificate
=cut
sub cert_is_cert {
my $crt = shift || "/home/e-smith/ssl.crt/$FQDN.crt";
if ( -f $crt )
@@ -115,6 +128,10 @@ sub cert_is_cert {
return 0;
}
=head2 key_is_key
check if file is really a key
=cut
sub key_is_key {
my $key = shift || "/home/e-smith/ssl.key/$FQDN.key";
if ( -f $key )
@@ -144,7 +161,8 @@ sub related_key_cert {
}
return 0;
}
##TODO migrate those actions from
##TODO write sub and migrate those actions from template fragments
# check cert is related to key
# => /etc/e-smith/templates/home/e-smith/ssl.crt
# check cert domain and alt
@@ -152,3 +170,126 @@ sub related_key_cert {
# check is valid / expiry date
# => /etc/e-smith/templates/home/e-smith/ssl.crt
###################################
=head2 SSLprotoApache
output a list of allowed protocols with apache format
e.g. -all +TLSv1.2 +TLSv1.3
=cut
sub SSLprotoApache{
my $protocols = " -all +".join(" +",split(" ",$smeSSLprotocol)) ." ";
my $configdb = esmith::ConfigDB->open_ro or die "Could not open accounts db";
my $httpd = $configdb->get('httpd-e-smith');
# SSLv2 and SSLv3 are not available in el8 openssl-1.1.1, while -ssl3 still referenced
# it will throw Option unknown option -ssl3
#$protocols .= " +SSLv3" if ($httpd->{'SSLv3'} || 'disabled') eq 'enabled';
# TODO: a loop using existingSSLprotos
$protocols .= " +TLSv1" if ($httpd->{'TLSv1'} || 'disabled') eq 'enabled';
$protocols .= " +TLSv1.1" if ($httpd->{'TLSv1.1'} || 'disabled') eq 'enabled';
# look closely this is to remove what has been added on first line,
# hence the minus sign and reverse logic.
$protocols .= " -TLSv1.2" unless ($httpd->{'TLSv1.2'} || 'enabled') eq 'enabled';
$protocols .= " -TLSv1.3" unless ($httpd->{'TLSv1.3'} || 'enabled') eq 'enabled';
return $protocols;
}
=head2 SSLprotoQpsmtpd
output an expected IO::Socket::SSL string to enable
only the wanted TLS versions
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($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";
# TODO: a loop using existingSSLprotos and SSLprotoHyphen()
$protocols .= ':!TLSv1' unless ($qpsmtpd{'TLSv1'} || 'disabled') eq 'enabled';
$protocols .= ':!TLSv1_1' unless ($qpsmtpd{'TLSv1.1'} || 'disabled') eq 'enabled';
$protocols .= ':!TLSv1_2' unless ($qpsmtpd{'TLSv1.2'} || 'enabled') eq 'enabled';
$protocols .= ':!TLSv1_3' unless ($qpsmtpd{'TLSv1.3'} || 'enabled') eq 'enabled';
return $protocols;
}
=head2 SSLproto
default display of list of protocol. This is how it will be displayed in
httpd.conf and proftpd.conf
e.g. TLSv1.2 TLSv1.3
=cut
sub SSLproto{
return $smeSSLprotocol;
}
=head2 SSLprotoComa
way to display protocols in Mariadb as a string list separated by coma
e.g. TLSv1.2,TLSv1.3
=cut
sub SSLprotoComa{
my $string = shift || $smeSSLprotocol;
$string =~ s/[ :]/,/g;
return $string;
}
=head2 SSLprotoHyphen
convert TLSv1.2 to TLSv1_2
This is the format required by perl IO::Socket::SSL; and as the result by
qpsmtpd, uqpsmtpd, sqpsmtpd SME Server services
=cut
sub SSLprotoHyphen {
my $string = shift || $smeSSLprotocol;
$string =~ s/[ ,]/:/g;
$string =~ s/\./_/g;
return $string;
}
=head2 SSLprotoMin
display only the lower protocol, as expected for dovecot
ssl_min_protocol = TLSv1.2
# limit : will not handle all or sslv23 as input
=cut
sub SSLprotoMin{
my @SSLarray = split(" ",shift || $smeSSLprotocol);
my %hash ;
foreach my $value (@SSLarray) {
my $toto = $value =~ s/(.*)(\d{1})+$/$2/r;
# hack for TLS > SSL
$toto = ($value =~ /^TLS/) ? "2$toto" : "1$toto";
$hash{$toto}=$value ;
}
my @keys_sorted_by_value = sort { $a <=> $b } keys %hash;
my $lowest_value = $keys_sorted_by_value[0] ;
return $hash{$lowest_value};
}
=head2 SSLprotoLDAP
convert min protocol suported to LDAP format
TLSProtocolMin 3.3
To require TLS 1.x or higher, set this option to 3.(x+1), e.g., TLSProtocolMin 3.2 would require TLS 1.1.
from $smeSSLprotocol = "TLSv1.2 TLSv1.3";
=cut
sub SSLprotoLDAP{
# convert to array
my @SSLarray = split(" ",shift || $smeSSLprotocol);
return "3.0" if (grep /^SSLv3$/, @SSLarray);
# TLSv1
return "3.1" if (grep /^TLSv1$/ , @SSLarray);
# keep only digit after .
@SSLarray = grep{ $_ =~ s/(.*)(\d{1})+$/$2/ } @SSLarray;
# order
@SSLarray = sort @SSLarray;
# get lower
my $num = $SSLarray[0];
# sum 3.1 + 0.$x
$num = "0.".$num;
# return
$num = $num +3.1;
return $num;
}

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

@@ -29,4 +29,4 @@ exec \
/usr/local/bin/softlimit -m $PPPD_MLIMIT \
/usr/bin/setsid \
/usr/sbin/pppd ${extaddr:+$extaddr:} \
file pppoe.pppd.conf
file pppoe.pppd.conf ${interface}

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 11
%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,6 +182,74 @@ fi
%changelog
* 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.
* Fri Jan 03 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-21.sme
- improve support of systemd service with instance service@instance.service [SME: 12859]
* Thu Jan 02 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-20.sme
- Primary default to SSL required and redirect [SME: 12858]
- cleanup remove primary=system [SME: 8268]
* Tue Dec 31 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-19.sme
- fix www removed from shared on group creation [SME: 12848]
* Mon Dec 23 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-18.sme
- add vlan support on External Interface [SME: 12677]
- fix typo [SME: 12763]
* Mon Dec 23 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-16.sme
- add kernel module support for rp-pppoe plugin [SME: 12678]
will allow faster fiber connexion when using multiple queue interface (RSS)
set-gateway-ip will propagate both wan and diald ip
run.pppoe call an interface
* Sat Dec 21 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-15.sme
- fix use of passwd command when ldap auth enabled [SME: 6453]
- delete spool file only if exists to avoid error [SME: 12763]
* Mon Sep 23 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-14.sme
- fix result variable not initialized [SME: 12663]
* Sun Sep 22 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-13.sme
- fix mail spool perms [SME: 12654]
- fix motd noise related to cockpit [SME: 12575]
- fix /run vs /var/run temps dir noise [SME: 12639]
* Wed Aug 14 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-12.sme
- fix 3 regressions from SME10 [SME: 12654]
fix www missing from shared and few groups [SME: 12146]
fix group deletion leaves mail spool file [SME: 12431]
fix path to /etc/systemd for seeking service files [SME: 12421]
* Tue Aug 13 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-11.sme
- fix new systemd.log does not fill after log rotate [SME: 12688]