Compare commits
10 Commits
11_0_0-26_
...
master
Author | SHA1 | Date | |
---|---|---|---|
![]() |
09908697a4 | ||
08d064bd3d | |||
6957c1ab9c | |||
8615e569eb | |||
ccd94a71e2 | |||
33833b4033 | |||
a3f80cc6fa | |||
f0f7b201cc | |||
d0b26d9228 | |||
c58758fe43 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,3 +4,4 @@
|
|||||||
*.tar.xz
|
*.tar.xz
|
||||||
*.bak
|
*.bak
|
||||||
*gz
|
*gz
|
||||||
|
*.patch
|
||||||
|
18
createlinks
18
createlinks
@@ -45,7 +45,7 @@ foreach (qw(
|
|||||||
/etc/diald.conf
|
/etc/diald.conf
|
||||||
/etc/diald.filter
|
/etc/diald.filter
|
||||||
/etc/diald/link
|
/etc/diald/link
|
||||||
/var/service/ippp/config
|
/usr/lib/systemd/system/ippp.service.d/50koozali.conf
|
||||||
/etc/ppp/ioptions
|
/etc/ppp/ioptions
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
@@ -303,10 +303,11 @@ my $event = "smeserver-base-update";
|
|||||||
|
|
||||||
|
|
||||||
event_link("remove-templates-custom", $event, "02");
|
event_link("remove-templates-custom", $event, "02");
|
||||||
|
event_link("systemd-journald", $event, "02");
|
||||||
|
event_link("dhgenerator", $event, "03");
|
||||||
templates2events("/etc/smartmontools/smartd.conf", $event);
|
templates2events("/etc/smartmontools/smartd.conf", $event);
|
||||||
templates2events("/home/e-smith/ssl.pem/pem", $event);
|
templates2events("/home/e-smith/ssl.pem/pem", $event);
|
||||||
templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $event);
|
templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $event);
|
||||||
event_link("systemd-journald", $event, "02");
|
|
||||||
event_link("fix-startup", $event, "05");
|
event_link("fix-startup", $event, "05");
|
||||||
event_link("init-accounts", $event, "05");
|
event_link("init-accounts", $event, "05");
|
||||||
event_link("mail-spool-fix", $event, "05");
|
event_link("mail-spool-fix", $event, "05");
|
||||||
@@ -612,13 +613,24 @@ $event = "ldap-update";
|
|||||||
templates2events("/home/e-smith/ssl.pem/pem", $event);
|
templates2events("/home/e-smith/ssl.pem/pem", $event);
|
||||||
|
|
||||||
#--------------------------------------------------
|
#--------------------------------------------------
|
||||||
# actions for ldap-update event
|
# actions for ssl-update event
|
||||||
#--------------------------------------------------
|
#--------------------------------------------------
|
||||||
|
|
||||||
$event = "ssl-update";
|
$event = "ssl-update";
|
||||||
|
|
||||||
templates2events("/home/e-smith/ssl.pem/pem", $event);
|
templates2events("/home/e-smith/ssl.pem/pem", $event);
|
||||||
|
|
||||||
|
#--------------------------------------------------
|
||||||
|
# actions for dhparam-update event
|
||||||
|
#--------------------------------------------------
|
||||||
|
|
||||||
|
$event = "dhparam-update";
|
||||||
|
|
||||||
|
event_link("dhgenerator", $event, "03");
|
||||||
|
templates2events("/etc/crontab", $event);
|
||||||
|
# add templates to expand + service to try-restart in target packages
|
||||||
|
# templates2events("/etc/dovecot/ssl/dhparam.pem", $event);
|
||||||
|
# safe_symlink("try-restart", "root/etc/e-smith/events/$event/services2adjust/dovecot");
|
||||||
|
|
||||||
#--------------------------------------------------
|
#--------------------------------------------------
|
||||||
# actions for email-update event:
|
# actions for email-update event:
|
||||||
|
@@ -1 +1 @@
|
|||||||
service
|
configuration
|
||||||
|
@@ -1 +1 @@
|
|||||||
service
|
configuration
|
||||||
|
@@ -1 +1 @@
|
|||||||
service
|
configuration
|
||||||
|
@@ -1 +1 @@
|
|||||||
service
|
configuration
|
||||||
|
@@ -1 +1 @@
|
|||||||
service
|
configuration
|
||||||
|
@@ -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";
|
||||||
|
}
|
||||||
|
}
|
27
root/etc/e-smith/events/actions/dhgenerator
Executable file
27
root/etc/e-smith/events/actions/dhgenerator
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use esmith::ssl;
|
||||||
|
|
||||||
|
my $event=shift||"program";
|
||||||
|
my $folder="/home/e-smith/dh.pem";
|
||||||
|
my $KeySize = 2048;
|
||||||
|
# load config db
|
||||||
|
|
||||||
|
mkdir($folder, 0700) unless(-d $folder );
|
||||||
|
# if program (or during updates) we only generate the 2048 to start all programs after install without waiting too much
|
||||||
|
if ( $event eq "program" || $event eq "temp" ) {
|
||||||
|
my $exit_code=dh_exists_good_size($KeySize,"$folder/$KeySize.pem") || system("/usr/bin/openssl","dhparam","-out","$folder/$KeySize.pem", $KeySize);
|
||||||
|
exit 0;
|
||||||
|
}
|
||||||
|
# if called as event, we generate a 4096 if 2096 exist, and then expand templates for services in need of this
|
||||||
|
# then the event will restart the service to use stronger dh.pem
|
||||||
|
else {
|
||||||
|
$KeySize = 4096 if (dh_exists_good_size($KeySize,"$folder/$KeySize.pem"));
|
||||||
|
print "Key size is $KeySize\n";
|
||||||
|
exit 0 if (dh_exists_good_size($KeySize,"$folder/$KeySize.pem"));
|
||||||
|
# here we should test if uptime > 2 hours and return if not enough uptime
|
||||||
|
system("/usr/bin/openssl","dhparam","-out","$folder/$KeySize.pem", $KeySize);
|
||||||
|
exit 0;
|
||||||
|
}
|
||||||
|
|
@@ -28,6 +28,7 @@ use Errno;
|
|||||||
use esmith::AccountsDB;
|
use esmith::AccountsDB;
|
||||||
|
|
||||||
my $a = esmith::AccountsDB->open_ro or die "Could not open accounts db";
|
my $a = esmith::AccountsDB->open_ro or die "Could not open accounts db";
|
||||||
|
my $c = esmith::ConfigDB->open_ro or die "Could not open configuration db";
|
||||||
|
|
||||||
foreach my $u ($a->users)
|
foreach my $u ($a->users)
|
||||||
{
|
{
|
||||||
@@ -40,6 +41,23 @@ foreach my $u ($a->users)
|
|||||||
|
|
||||||
system("/usr/bin/smbpasswd", "-d", $user) == 0
|
system("/usr/bin/smbpasswd", "-d", $user) == 0
|
||||||
or warn("Problem locking smbpassword for user $user\n");
|
or warn("Problem locking smbpassword for user $user\n");
|
||||||
|
|
||||||
|
my $serv = $c->get('samba') || '';
|
||||||
|
if (($serv eq 'service') && ($user ne 'administrator'))
|
||||||
|
{
|
||||||
|
my $samba = $c->get('samba')->prop('status') || 'disabled';
|
||||||
|
my $sambaip = $c->get('samba')->prop('SambaIP') || '';
|
||||||
|
my $sambapwd = $c->get('samba')->prop('Password') || '';
|
||||||
|
if ($sambaip eq '' || $sambapwd eq '')
|
||||||
|
{
|
||||||
|
$samba = 'disabled';
|
||||||
|
}
|
||||||
|
if ($samba eq 'enabled')
|
||||||
|
{
|
||||||
|
system("/usr/bin/samba-tool", "user", "disable", "$user", "-H", "ldap://$sambaip", "--username=administrator", "--password=$sambapwd") == 0
|
||||||
|
or warn("Problem locking addc password for user $user\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -134,4 +134,23 @@ if ($ldapauth ne 'enabled')
|
|||||||
system("/usr/bin/smbpasswd", "-a", "-d", "$userName")
|
system("/usr/bin/smbpasswd", "-a", "-d", "$userName")
|
||||||
and ( $x = 255, warn "Could not lock (smb) password for $userName\n" );
|
and ( $x = 255, warn "Could not lock (smb) password for $userName\n" );
|
||||||
|
|
||||||
|
my $serv = $conf->get('samba') || '';
|
||||||
|
if (($serv eq 'service') && ($userName ne 'administrator'))
|
||||||
|
{
|
||||||
|
my $samba = $conf->get('samba')->prop('status') || 'disabled';
|
||||||
|
my $sambaip = $conf->get('samba')->prop('SambaIP') || '';
|
||||||
|
my $sambapwd = $conf->get('samba')->prop('Password') || '';
|
||||||
|
if ($sambaip eq '' || $sambapwd eq '')
|
||||||
|
{
|
||||||
|
$samba = 'disabled';
|
||||||
|
}
|
||||||
|
if ($samba eq 'enabled')
|
||||||
|
{
|
||||||
|
system("/usr/bin/samba-tool", "user", "add", "$userName", "--random-password", "-H", "ldap://$sambaip", "--username=administrator", "--password=$sambapwd")
|
||||||
|
and ( $x = 255, warn "Could not create (addc) user for $userName\n" );
|
||||||
|
system("/usr/bin/samba-tool", "user", "disable", "$userName", "-H", "ldap://$sambaip", "--username=administrator", "--password=$sambapwd")
|
||||||
|
and ( $x = 255, warn "Could not lock (addc) password for $userName\n" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
exit ($x);
|
exit ($x);
|
||||||
|
@@ -75,4 +75,21 @@ $result && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to delete (lda
|
|||||||
$result = $ldap->ldapdelgroup($userName);
|
$result = $ldap->ldapdelgroup($userName);
|
||||||
$result && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to delete (ldap) group account $userName.\n" );
|
$result && ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to delete (ldap) group account $userName.\n" );
|
||||||
|
|
||||||
|
my $serv = $conf->get('samba') || '';
|
||||||
|
if (($serv eq 'service') && ($userName ne 'administrator'))
|
||||||
|
{
|
||||||
|
my $samba = $conf->get('samba')->prop('status') || 'disabled';
|
||||||
|
my $sambaip = $conf->get('samba')->prop('SambaIP') || '';
|
||||||
|
my $sambapwd = $conf->get('samba')->prop('Password') || '';
|
||||||
|
if ($sambaip eq '' || $sambapwd eq '')
|
||||||
|
{
|
||||||
|
$samba = 'disabled';
|
||||||
|
}
|
||||||
|
if ($samba eq 'enabled')
|
||||||
|
{
|
||||||
|
system("/usr/bin/samba-tool", "user", "delete", "$userName", "-H", "ldap://$sambaip", "--username=administrator", "--password=$sambapwd")
|
||||||
|
and ( $x = 255, warn "Failed to delete (addc) account $userName.\n" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
exit ($x);
|
exit ($x);
|
||||||
|
@@ -78,6 +78,23 @@ sub lock_user
|
|||||||
{
|
{
|
||||||
$conf->set_value('PasswordSet', 'no');
|
$conf->set_value('PasswordSet', 'no');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $serv = $conf->get('samba') || '';
|
||||||
|
if (($serv eq 'service') && ($userName ne 'administrator'))
|
||||||
|
{
|
||||||
|
my $samba = $conf->get('samba')->prop('status') || 'disabled';
|
||||||
|
my $sambaip = $conf->get('samba')->prop('SambaIP') || '';
|
||||||
|
my $sambapwd = $conf->get('samba')->prop('Password') || '';
|
||||||
|
if ($sambaip eq '' || $sambapwd eq '')
|
||||||
|
{
|
||||||
|
$samba = 'disabled';
|
||||||
|
}
|
||||||
|
if ($samba eq 'enabled')
|
||||||
|
{
|
||||||
|
system("/usr/bin/samba-tool", "user", "disable", "$userName", "-H", "ldap://$sambaip", "--username=administrator", "--password=$sambapwd") == 0
|
||||||
|
or ( $x = 255, warn "Error locking (addc) account $userName" );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub bad_password_users
|
sub bad_password_users
|
||||||
|
8
root/etc/e-smith/templates/etc/crontab/dhgenerate
Normal file
8
root/etc/e-smith/templates/etc/crontab/dhgenerate
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
use esmith::ssl;
|
||||||
|
my $folder="/home/e-smith/dh.pem";
|
||||||
|
my $KeySize = 4096;
|
||||||
|
$OUT = "#4096 dhparam exists";
|
||||||
|
$OUT = '@reboot root sleep 2d && /sbin/e-smith/signal-event dhparam-update'."\n" unless (dh_exists_good_size($KeySize,"$folder/$KeySize.pem"));
|
||||||
|
}
|
||||||
|
|
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
# dhcpd
|
# dhcpd
|
||||||
:programname, isequal, "dhcpd" /var/log/dhcpd/dhcpd.log
|
:programname, isequal, "dhcpd" /var/log/dhcpd/dhcpd.log
|
||||||
& stop
|
& stop
|
||||||
|
3
root/etc/e-smith/templates/etc/rsyslog.conf/32ippp
Normal file
3
root/etc/e-smith/templates/etc/rsyslog.conf/32ippp
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# ippp
|
||||||
|
:programname, isequal, "ippp" /var/log/ippp/ippp.log
|
||||||
|
& stop
|
3
root/etc/e-smith/templates/etc/rsyslog.conf/32wan
Normal file
3
root/etc/e-smith/templates/etc/rsyslog.conf/32wan
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# wan
|
||||||
|
:programname, isequal, "wan" /var/log/wan/wan.log
|
||||||
|
& stop
|
@@ -1 +1,2 @@
|
|||||||
/bin/bash
|
/bin/bash
|
||||||
|
/usr/bin/bash
|
||||||
|
@@ -1 +1,2 @@
|
|||||||
/bin/bash2
|
/bin/bash2
|
||||||
|
/usr/bin/bash2
|
||||||
|
@@ -1 +1,2 @@
|
|||||||
/sbin/e-smith/console
|
/sbin/e-smith/console
|
||||||
|
/usr/sbin/e-smith/console
|
||||||
|
@@ -1 +1,2 @@
|
|||||||
/bin/csh
|
/bin/csh
|
||||||
|
/usr/bin/csh
|
||||||
|
@@ -1 +1,2 @@
|
|||||||
/bin/false
|
/bin/false
|
||||||
|
/usr/bin/false
|
||||||
|
@@ -1 +1,2 @@
|
|||||||
/bin/sh
|
/bin/sh
|
||||||
|
/usr/bin/sh
|
||||||
|
7
root/etc/e-smith/templates/etc/sysconfig/network-scripts/chat-ppp0/20LINUX_PLUGIN
Executable file → Normal file
7
root/etc/e-smith/templates/etc/sysconfig/network-scripts/chat-ppp0/20LINUX_PLUGIN
Executable file → Normal file
@@ -1 +1,6 @@
|
|||||||
LINUX_PLUGIN=/usr/lib64/pppd/2.4.5/rp-pppoe.so
|
{
|
||||||
|
# Find Roaring Penguin pppoe plugin
|
||||||
|
my ($plugin) = glob "/usr/lib*/pppd/*/rp-pppoe.so";
|
||||||
|
$plugin ||= "pppoe_plugin_could_not_be_found";
|
||||||
|
$OUT .= "LINUX_PLUGIN=$plugin\n";
|
||||||
|
}
|
35
root/etc/e-smith/templates/home/e-smith/dh.pem
Normal file
35
root/etc/e-smith/templates/home/e-smith/dh.pem
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
use esmith::ssl;
|
||||||
|
# for the generation of originals in /home/e-smith/dh.pem/
|
||||||
|
# we check that 4096 exist, if not we default to 2048. If not we generate it
|
||||||
|
# for replication : we copy what we have
|
||||||
|
|
||||||
|
my $DHSize = $modSSL{DHSize} ||'4096';
|
||||||
|
my $key = "/home/e-smith/dh.pem";
|
||||||
|
for my $DHSize (qw(4096 2048))
|
||||||
|
{
|
||||||
|
# if key exists and good size, we use it
|
||||||
|
if ( dh_exists_good_size($DHSize,"$key/$DHSize.pem") )
|
||||||
|
{
|
||||||
|
# Old key file is still good. Read it out - processTemplate will work
|
||||||
|
# out that it hasn't changed, and leave the old one in place
|
||||||
|
open(K, "$key/$DHSize.pem") or die "Couldn't open key file: $!";
|
||||||
|
my @key = <K>;
|
||||||
|
chomp @key;
|
||||||
|
$OUT = join "\n", @key;
|
||||||
|
close(K);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# if nothing have ever been generated we call the action script as program
|
||||||
|
# it will generate a 2048, which 'should' be faster than 4096
|
||||||
|
# later if uptime is sufficient 4096 will be generated.
|
||||||
|
my $program = "/etc/e-smith/events/actions/dhgenerator";
|
||||||
|
system($program);
|
||||||
|
open(K, "$key/2048.pem") or die "Couldn't open dh file: $!";
|
||||||
|
my @key = <K>;
|
||||||
|
chomp @key;
|
||||||
|
$OUT = join "\n", @key;
|
||||||
|
close(K);
|
||||||
|
return;
|
||||||
|
}
|
@@ -2,6 +2,7 @@
|
|||||||
use constant KEYLIFEINDAYS => $modSSL{KeyLifeInDays} || 365;
|
use constant KEYLIFEINDAYS => $modSSL{KeyLifeInDays} || 365;
|
||||||
use esmith::ssl;
|
use esmith::ssl;
|
||||||
use Date::Parse;
|
use Date::Parse;
|
||||||
|
use utf8;
|
||||||
use Cwd;
|
use Cwd;
|
||||||
use Net::IP qw(ip_is_ipv4 ip_is_ipv6);
|
use Net::IP qw(ip_is_ipv4 ip_is_ipv6);
|
||||||
use esmith::Logger;
|
use esmith::Logger;
|
||||||
@@ -37,66 +38,70 @@
|
|||||||
$Country = substr($Country, 0, 2);
|
$Country = substr($Country, 0, 2);
|
||||||
$defaultCity = substr($defaultCity, 0, 128);
|
$defaultCity = substr($defaultCity, 0, 128);
|
||||||
$defaultCompany = substr($defaultCompany, 0, 64);
|
$defaultCompany = substr($defaultCompany, 0, 64);
|
||||||
$defaultDepartment = substr($defaultDepartment, 0, 64);
|
$defaultDepartment = substr($defaultDepartment, 0, 64);
|
||||||
|
$defaultDepartment =~ s/[''"]//g;
|
||||||
$email = substr($email, 0, 64);
|
$email = substr($email, 0, 64);
|
||||||
$commonName = substr($commonName, 0, 64);
|
$commonName = substr($commonName, 0, 64);
|
||||||
|
|
||||||
# if self-signed certificate files exists, is a certificate, and is still valid
|
# if self-signed certificate files exists, is a certificate, and is still valid
|
||||||
if ( cert_exists_good_size )
|
if ( cert_exists_good_size )
|
||||||
{
|
{
|
||||||
# check expiry date, if less than 2 days from now we update it.
|
# check expiry date, if less than 2 days from now we update it.
|
||||||
my $expire = `openssl x509 -enddate -noout -in $crt`;
|
my $expire = `openssl x509 -enddate -noout -in $crt`;
|
||||||
$expire =~ s/^notAfter=//;
|
$expire =~ s/^notAfter=//;
|
||||||
$expire = str2time($expire);
|
$expire = str2time($expire);
|
||||||
my $ttl_days = ($expire - time()) / 60 / 60 / 24;
|
my $ttl_days = ($expire - time()) / 60 / 60 / 24;
|
||||||
# check the cert and the key are related, if key has been changed, then we need to change the cert
|
# check the cert and the key are related, if key has been changed, then we need to change the cert
|
||||||
my $crt_md5 = `openssl x509 -noout -modulus -in $crt | openssl md5`;
|
my $crt_md5 = `openssl x509 -noout -modulus -in $crt | openssl md5`;
|
||||||
my $key_md5 = `openssl rsa -noout -modulus -in $key | openssl md5`;
|
my $key_md5 = `openssl rsa -noout -modulus -in $key | openssl md5`;
|
||||||
|
|
||||||
if ( ($ttl_days > 2) && ( "$crt_md5" eq "$key_md5" ) ) {
|
if ( ($ttl_days > 2) && ( "$crt_md5" eq "$key_md5" ) ) {
|
||||||
my $expected_issuer = 'C = '.$Country .
|
my $expected_issuer = 'C='.$Country .
|
||||||
', ST = '.$State;
|
', ST='.$State;
|
||||||
$expected_issuer .= ', L = ' . ($defaultCity ? $defaultCity : 'Default City');
|
$expected_issuer .= ', L=' . ($defaultCity ? $defaultCity : 'Default City');
|
||||||
$expected_issuer .= ', O = ' . ($defaultCompany ? $defaultCompany : 'Default Company Ltd');
|
$expected_issuer .= ', O=' . ($defaultCompany ? $defaultCompany : 'Default Company Ltd');
|
||||||
$expected_issuer .= ", OU = $defaultDepartment" if $defaultDepartment;
|
$expected_issuer .= ", OU=$defaultDepartment" if $defaultDepartment;
|
||||||
$expected_issuer .= ", CN = $commonName" .
|
$expected_issuer .= ", CN=$commonName" .
|
||||||
", emailAddress = $email";
|
", emailAddress=$email";
|
||||||
my $issuer = `openssl x509 -issuer -noout -in $crt`;
|
# format so we can compare with right encoding
|
||||||
|
my $issuer = `openssl x509 -issuer -nameopt dump_der -noout -in $crt`;
|
||||||
chomp $issuer;
|
chomp $issuer;
|
||||||
$issuer =~ s/^issuer=//;
|
$issuer =~ s/^issuer=//;
|
||||||
|
# we remove any "
|
||||||
|
$issuer =~ s/["]//g;
|
||||||
my $signatureAlg = `openssl x509 -text -noout -in $crt | grep "Signature Algorithm" | head -1`;
|
my $signatureAlg = `openssl x509 -text -noout -in $crt | grep "Signature Algorithm" | head -1`;
|
||||||
chomp $signatureAlg;
|
chomp $signatureAlg;
|
||||||
$signatureAlg =~ s/^ *Signature Algorithm: //;
|
$signatureAlg =~ s/^ *Signature Algorithm: //;
|
||||||
|
|
||||||
# Test for expected subjectAltName
|
# Test for expected subjectAltName
|
||||||
# openssl x509 -text -noout -in /etc/dehydrated/certs/domain/cert.pem | sed -ne '/X509v3 Subject Alternative Name/{ N;s/^.*\n//;:a;s/^\( *\)\(.*\), /\2,\1/;ta;p;q; }'
|
# openssl x509 -text -noout -in /etc/dehydrated/certs/domain/cert.pem | sed -ne '/X509v3 Subject Alternative Name/{ N;s/^.*\n//;:a;s/^\( *\)\(.*\), /\2,\1/;ta;p;q; }'
|
||||||
$expected_subjectAltName = `openssl x509 -text -noout -in $crt | sed -ne '/X509v3 Subject Alternative Name/{ N;s/^.*\\n//;:a;s/^\\( *\\)\\(.*\\), /\\2,\\1/;ta;p;q; }'`;
|
$expected_subjectAltName = `openssl x509 -text -noout -in $crt | sed -ne '/X509v3 Subject Alternative Name/{ N;s/^.*\\n//;:a;s/^\\( *\\)\\(.*\\), /\\2,\\1/;ta;p;q; }'`;
|
||||||
chomp $expected_subjectAltName;
|
chomp $expected_subjectAltName;
|
||||||
print FH "Self-Signed Cert: $issuer\n expected $expected_issuer" unless ($issuer eq $expected_issuer);
|
print FH "Self-Signed Cert: $issuer\n expected $expected_issuer" unless ($issuer eq $expected_issuer);
|
||||||
print FH "Self-Signed Cert: $signatureAlg "unless ($signatureAlg ne "sha1WithRSAEncryption");
|
print FH "Self-Signed Cert: $signatureAlg "unless ($signatureAlg ne "sha1WithRSAEncryption");
|
||||||
print FH "Self-Signed Cert: $subjectAltName\n expected: $expected_subjectAltName" unless ($subjectAltName eq $expected_subjectAltName);
|
print FH "Self-Signed Cert: $subjectAltName\n expected: $expected_subjectAltName" unless ($subjectAltName eq $expected_subjectAltName);
|
||||||
if (
|
if (
|
||||||
($issuer eq $expected_issuer)
|
($issuer eq $expected_issuer)
|
||||||
&& ($signatureAlg ne "sha1WithRSAEncryption")
|
&& ($signatureAlg ne "sha1WithRSAEncryption")
|
||||||
&& ($subjectAltName eq $expected_subjectAltName)
|
&& ($subjectAltName eq $expected_subjectAltName)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
# Old key file is still good. Read it out - processTemplate will work
|
# Old key file is still good. Read it out - processTemplate will work
|
||||||
# out that it hasn't changed, and leave the old one in place
|
# out that it hasn't changed, and leave the old one in place
|
||||||
open(C, "$crt") or die "Couldn't open crt file: $!";
|
open(C, "$crt") or die "Couldn't open crt file: $!";
|
||||||
my @crt = <C>;
|
my @crt = <C>;
|
||||||
chomp @crt;
|
chomp @crt;
|
||||||
$OUT = join "\n", @crt;
|
$OUT = join "\n", @crt;
|
||||||
close(C);
|
close(C);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# go to somewhere private and safe where we can run programs
|
# go to somewhere private and safe where we can run programs
|
||||||
# as root
|
# as root
|
||||||
unless (-e "/tmp/ssl")
|
unless (-e "/tmp/ssl")
|
||||||
{
|
{
|
||||||
mkdir "/tmp/ssl", 0700;
|
mkdir "/tmp/ssl", 0700;
|
||||||
}
|
}
|
||||||
chdir "/tmp/ssl" or die "Couldn't change to secure directory: $!";
|
chdir "/tmp/ssl" or die "Couldn't change to secure directory: $!";
|
||||||
|
|
||||||
@@ -104,21 +109,21 @@
|
|||||||
|
|
||||||
unless (open(SSL,"-|"))
|
unless (open(SSL,"-|"))
|
||||||
{
|
{
|
||||||
# child
|
# child
|
||||||
exec("/usr/bin/openssl",
|
exec("/usr/bin/openssl",
|
||||||
qw(req -new -key),
|
qw(req -new -key),
|
||||||
$key,
|
$key,
|
||||||
qw( -sha256 -x509 -days), KEYLIFEINDAYS,
|
qw( -sha256 -x509 -days), KEYLIFEINDAYS,
|
||||||
qw(-set_serial), time(),
|
qw(-set_serial), time(),
|
||||||
qw(-extensions v3_req),
|
qw(-extensions v3_req),
|
||||||
qw(-config), "/etc/openssl.conf"
|
qw(-config), "/etc/openssl.conf"
|
||||||
)
|
)
|
||||||
|| die "can't exec program: $!";
|
|| die "can't exec program: $!";
|
||||||
# NOTREACHED
|
# NOTREACHED
|
||||||
}
|
}
|
||||||
while (<SSL>)
|
while (<SSL>)
|
||||||
{
|
{
|
||||||
$OUT .= $_;
|
$OUT .= $_;
|
||||||
}
|
}
|
||||||
close(SSL) or die "Closing openssl pipe reported: $!";
|
close(SSL) or die "Closing openssl pipe reported: $!";
|
||||||
chdir $here;
|
chdir $here;
|
||||||
|
@@ -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"';
|
||||||
|
}
|
@@ -1 +1,6 @@
|
|||||||
plugin /usr/lib64/pppd/2.4.5/rp-pppoe.so
|
{
|
||||||
|
# Find Roaring Penguin pppoe plugin
|
||||||
|
my ($plugin) = glob "/usr/lib*/pppd/*/rp-pppoe.so";
|
||||||
|
$plugin ||= "pppoe_plugin_could_not_be_found";
|
||||||
|
$OUT .= "plugin $plugin\n";
|
||||||
|
}
|
@@ -75,15 +75,15 @@ lpd=service|InitscriptOrder|60|status|enabled
|
|||||||
mariadb=service|InitscriptOrder|90|status|enabled
|
mariadb=service|InitscriptOrder|90|status|enabled
|
||||||
masq=service|InitscriptOrder|06|Logging|none|Stealth|no|status|disabled
|
masq=service|InitscriptOrder|06|Logging|none|Stealth|no|status|disabled
|
||||||
maxIbayNameLength=2
|
maxIbayNameLength=2
|
||||||
modSSL=service|status|enabled
|
modSSL=configuration|status|enabled
|
||||||
mysql.init=service|InitscriptOrder|99|status|enabled
|
mysql.init=service|InitscriptOrder|99|status|enabled
|
||||||
named=service|chroot|yes|status|enabled
|
named=service|chroot|yes|status|enabled
|
||||||
network=service|InitscriptOrder|10|status|enabled
|
network=service|InitscriptOrder|10|status|enabled
|
||||||
ntpd=service|InitscriptOrder|55|status|disabled
|
ntpd=service|InitscriptOrder|55|status|disabled
|
||||||
php=service|status|enabled
|
php=configuration|status|enabled
|
||||||
pop3s=service|access|private|status|enabled
|
pop3s=service|access|private|status|enabled
|
||||||
popd=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
|
qmail=service|InitscriptOrder|80|status|enabled
|
||||||
random=service|InitscriptOrder|20|status|enabled
|
random=service|InitscriptOrder|20|status|enabled
|
||||||
scanner=service|ScannerFns|iscan|UpdateTime|1:14|scanMail|yes|status|enabled
|
scanner=service|ScannerFns|iscan|UpdateTime|1:14|scanMail|yes|status|enabled
|
||||||
|
@@ -93,6 +93,23 @@ sub change_password {
|
|||||||
$accountdb = esmith::AccountsDB->open();
|
$accountdb = esmith::AccountsDB->open();
|
||||||
|
|
||||||
$q->param(-name => 'status_message', -value => 'PASSWORD_CHANGE_SUCCESS');
|
$q->param(-name => 'status_message', -value => 'PASSWORD_CHANGE_SUCCESS');
|
||||||
|
|
||||||
|
my $serv = $configdb->get('samba') || '';
|
||||||
|
if (($serv eq 'service') && ($acctName ne 'administrator'))
|
||||||
|
{
|
||||||
|
my $samba = $configdb->get('samba')->prop('status') || 'disabled';
|
||||||
|
my $sambaip = $configdb->get('samba')->prop('SambaIP') || '';
|
||||||
|
my $sambapwd = $configdb->get('samba')->prop('Password') || '';
|
||||||
|
if ($sambaip eq '' || $sambapwd eq '')
|
||||||
|
{
|
||||||
|
$samba = 'disabled';
|
||||||
|
}
|
||||||
|
if ($samba eq 'enabled')
|
||||||
|
{
|
||||||
|
system("/usr/bin/samba-tool", "user", "setpassword", "$acctName", "--newpassword=$pass", "-H", "ldap://$sambaip", "--username=administrator", "--password=$sambapwd") == 0
|
||||||
|
or warn ("Error occured while modifying (addc) password for $acctName.\n" );
|
||||||
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
9
root/etc/logrotate.d/ippp
Normal file
9
root/etc/logrotate.d/ippp
Normal 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
9
root/etc/logrotate.d/wan
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/var/log/wan/wan.log {
|
||||||
|
weekly
|
||||||
|
rotate 5
|
||||||
|
copytruncate
|
||||||
|
compress
|
||||||
|
notifempty
|
||||||
|
missingok
|
||||||
|
}
|
||||||
|
|
@@ -1,3 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
/sbin/modprobe dummy
|
/sbin/modprobe dummy
|
||||||
|
$(ip link show dummy0 2>/dev/null 1>&2) || exec ip link add dummy0 type dummy
|
||||||
exec ip link set dummy0 address 10:00:01:02:03:04
|
exec ip link set dummy0 address 10:00:01:02:03:04
|
||||||
|
5
root/var/service/ippp/run → root/sbin/e-smith/systemd/ippp-pre
Normal file → Executable file
5
root/var/service/ippp/run → root/sbin/e-smith/systemd/ippp-pre
Normal file → Executable file
@@ -11,7 +11,7 @@
|
|||||||
# This should run before dialds are started and before any attempt
|
# This should run before dialds are started and before any attempt
|
||||||
# is made to reconfigure ippp interfaces differently.
|
# is made to reconfigure ippp interfaces differently.
|
||||||
|
|
||||||
config_file=./config
|
LocalIP=$(/sbin/e-smith/config get LocalIP|| echo "127.0.0.88")
|
||||||
|
|
||||||
modprobe hisax
|
modprobe hisax
|
||||||
# TODO should check here for failure!!
|
# TODO should check here for failure!!
|
||||||
@@ -55,4 +55,5 @@ ifconfig ippp0 "$LocalIP" \
|
|||||||
# where all the traffic is to/from the local
|
# where all the traffic is to/from the local
|
||||||
# system. i.e. our reply must go out via the
|
# system. i.e. our reply must go out via the
|
||||||
# diald slip proxy.
|
# diald slip proxy.
|
||||||
exec ipppd ippp0 -detach -hostroute $pppopts
|
# will be done in main process
|
||||||
|
exit 0
|
@@ -1 +0,0 @@
|
|||||||
/var/service/ippp
|
|
@@ -1 +0,0 @@
|
|||||||
/var/service/wan
|
|
@@ -15,12 +15,6 @@ enable networking.service
|
|||||||
enable wan.service
|
enable wan.service
|
||||||
enable masq.service
|
enable masq.service
|
||||||
enable php-fpm.service
|
enable php-fpm.service
|
||||||
enable php55-php-fpm.service
|
|
||||||
enable php56-php-fpm.service
|
|
||||||
enable php70-php-fpm.service
|
|
||||||
enable php71-php-fpm.service
|
|
||||||
enable php72-php-fpm.service
|
|
||||||
enable php73-php-fpm.service
|
|
||||||
enable php74-php-fpm.service
|
enable php74-php-fpm.service
|
||||||
enable php80-php-fpm.service
|
enable php80-php-fpm.service
|
||||||
enable httpd-e-smith.service
|
enable httpd-e-smith.service
|
||||||
@@ -73,3 +67,4 @@ disable ntpdate.service
|
|||||||
disable ftp.service
|
disable ftp.service
|
||||||
disable proftpd.service
|
disable proftpd.service
|
||||||
|
|
||||||
|
enable dhparam-generator.service
|
||||||
|
24
root/usr/lib/systemd/system/dhparam-generator.service
Normal file
24
root/usr/lib/systemd/system/dhparam-generator.service
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Diffie Hellman parameter generator
|
||||||
|
#TODO: add Requires= or Wants= to those:
|
||||||
|
Before=ftp.service
|
||||||
|
Before=dovecot.service
|
||||||
|
Before=qpsmtpd.service sqpsmtpd.service uqpsmtpd.service
|
||||||
|
Before=radiusd.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/etc/e-smith/events/actions/dhgenerator
|
||||||
|
# sqpsmtpd and uqpsmtpd use a symlink to /var/service/qpsmtpd/ssl
|
||||||
|
ExecStartPost=-/sbin/e-smith/expand-template /var/service/qpsmtpd/ssl/dhparam.pem
|
||||||
|
ExecStartPost=-/sbin/e-smith/expand-template /etc/dovecot/ssl/dhparam.pem
|
||||||
|
ExecStartPost=-/sbin/e-smith/expand-template /etc/raddb/certs/dh
|
||||||
|
|
||||||
|
PrivateTmp=true
|
||||||
|
ProtectSystem=no
|
||||||
|
ProtectHome=no
|
||||||
|
PrivateDevices=false
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=sme-server.target
|
||||||
|
|
21
root/usr/lib/systemd/system/ippp.service
Normal file
21
root/usr/lib/systemd/system/ippp.service
Normal 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
|
||||||
|
|
@@ -1,8 +1,11 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description= Network management for Koozali SME Server, using old sysvinit script
|
Description= Network management for Koozali SME Server, using old sysvinit script
|
||||||
After=network-pre.target
|
After=network-pre.target
|
||||||
|
Wants=network-online.target
|
||||||
Wants=network.target
|
Wants=network.target
|
||||||
Before=network-online.target wan.service
|
Before=network-online.target
|
||||||
|
Before=network.target
|
||||||
|
Before=wan.service
|
||||||
Conflicts=NetworkManager.service
|
Conflicts=NetworkManager.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
@@ -8,6 +8,6 @@ Requires=basic.target
|
|||||||
Conflicts=rescue.service rescue.target multi-user.target
|
Conflicts=rescue.service rescue.target multi-user.target
|
||||||
After=basic.target rescue.service rescue.target runit.service
|
After=basic.target rescue.service rescue.target runit.service
|
||||||
AllowIsolate=yes
|
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
|
Wants=dbus.service plymouth-quit-wait.service plymouth-quit.service systemd-logind.service systemd-update-utmp-runlevel.service systemd-user-sessions.service
|
||||||
|
|
||||||
|
@@ -1,16 +1,24 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=WAN interface for Koozali SME Server
|
Description=WAN interface for Koozali SME Server
|
||||||
After=network-pre.target networking.service
|
After=network-pre.target
|
||||||
|
After=networking.service
|
||||||
Before=network-online.target
|
Before=network-online.target
|
||||||
PartOf=networking.service
|
PartOf=networking.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
PermissionsStartOnly=true
|
||||||
|
WorkingDirectory=/var/service/wan
|
||||||
|
Type=simple
|
||||||
ExecStartPre=/sbin/e-smith/service-status wan
|
ExecStartPre=/sbin/e-smith/service-status wan
|
||||||
ExecStart=/usr/bin/sv u /service/wan
|
ExecStart=/var/service/wan/run
|
||||||
ExecStop=/usr/bin/sv stop /service/wan
|
ExecReload=/var/service/wan/run
|
||||||
ExecReload=/usr/bin/sv t /service/wan
|
|
||||||
|
#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
|
RemainAfterExit=yes
|
||||||
|
SyslogIdentifier=wan
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=sme-server.target
|
WantedBy=sme-server.target
|
||||||
|
@@ -911,6 +911,29 @@ sub reset_password {
|
|||||||
|
|
||||||
$self->success($self->localise('PASSWORD_CHANGE_SUCCEEDED',
|
$self->success($self->localise('PASSWORD_CHANGE_SUCCEEDED',
|
||||||
{ acctName => $acctName}));
|
{ acctName => $acctName}));
|
||||||
|
|
||||||
|
my $serv = $configdb->get('samba') || '';
|
||||||
|
if (($serv eq 'service') && ($acctName ne 'administrator'))
|
||||||
|
{
|
||||||
|
my $samba = $configdb->get('samba')->prop('status') || 'disabled';
|
||||||
|
my $sambaip = $configdb->get('samba')->prop('SambaIP') || '';
|
||||||
|
my $sambapwd = $configdb->get('samba')->prop('Password') || '';
|
||||||
|
if ($sambaip eq '' || $sambapwd eq '')
|
||||||
|
{
|
||||||
|
$samba = 'disabled';
|
||||||
|
}
|
||||||
|
if ($samba eq 'enabled')
|
||||||
|
{
|
||||||
|
my $password = $self->{cgi}->param('password1');
|
||||||
|
unless (($password) = ($password =~ /^([ -~]+)$/ ))
|
||||||
|
{
|
||||||
|
return $self->error('TAINTED_PASSWORD');
|
||||||
|
}
|
||||||
|
$password = $1;
|
||||||
|
system("/usr/bin/samba-tool", "user", "setpassword", "$acctName", "--newpassword=$password", "-H", "ldap://$sambaip", "--username=administrator", "--password=$sambapwd") == 0
|
||||||
|
or warn ("Error occured while modifying (addc) password for $acctName.\n" );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -6,7 +6,7 @@ use esmith::ConfigDB;
|
|||||||
|
|
||||||
|
|
||||||
our @ISA = qw(Exporter);
|
our @ISA = qw(Exporter);
|
||||||
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);
|
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 dh_exists_good_size);
|
||||||
|
|
||||||
my $configdb = esmith::ConfigDB->open_ro or die "Could not open accounts db";
|
my $configdb = esmith::ConfigDB->open_ro or die "Could not open accounts db";
|
||||||
our $SystemName = $configdb->get('SystemName')->value;
|
our $SystemName = $configdb->get('SystemName')->value;
|
||||||
@@ -162,6 +162,38 @@ sub related_key_cert {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
=head2 dh_exists_good_size
|
||||||
|
# check dh exist
|
||||||
|
# check dh is indeed dh
|
||||||
|
# check dh size
|
||||||
|
# openssl rsa -noout -modulus -in domain.key | openssl md5
|
||||||
|
# openssl x509 -noout -modulus -in domain.crt | openssl md5
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub dh_exists_good_size {
|
||||||
|
my $configdb = esmith::ConfigDB->open_ro or die "Could not open accounts db";
|
||||||
|
my %modSSL = $configdb->as_hash('modSSL');
|
||||||
|
my $KeySize = shift || $modSSL{DHSize} ||'4096';
|
||||||
|
my $dh = shift || "/home/e-smith/dh.pem/$KeySize.pem";
|
||||||
|
if ( -f $dh )
|
||||||
|
{
|
||||||
|
my $signatureKeySize = `openssl dhparam -text -noout -in $dh 2>/dev/null | grep "DH Parameters:" | head -1`;
|
||||||
|
chomp $signatureKeySize;
|
||||||
|
$signatureKeySize =~ s/^.*DH Parameters: \((.*) bit\)/$1/p;
|
||||||
|
if ( $signatureKeySize == $KeySize ) {
|
||||||
|
#print "$signatureKeySize\n";
|
||||||
|
# cert is correct size and exists, we can proceed.
|
||||||
|
# next check key and cert are related
|
||||||
|
# next check cert is still valid
|
||||||
|
# next check alt name are still the same
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
##TODO write sub and migrate those actions from template fragments
|
##TODO write sub and migrate those actions from template fragments
|
||||||
# check cert is related to key
|
# check cert is related to key
|
||||||
# => /etc/e-smith/templates/home/e-smith/ssl.crt
|
# => /etc/e-smith/templates/home/e-smith/ssl.crt
|
||||||
|
@@ -1,6 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
|
|
||||||
exec \
|
|
||||||
/usr/bin/setuidgid smelog \
|
|
||||||
/usr/bin/multilog t s5000000 \
|
|
||||||
/var/log/ippp
|
|
@@ -1,7 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
|
|
||||||
exec \
|
|
||||||
/usr/bin/setuidgid smelog \
|
|
||||||
/usr/bin/multilog t s5000000 \
|
|
||||||
/var/log/wan
|
|
||||||
|
|
@@ -9,4 +9,5 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo script run.$config not found - please report this as a bug
|
echo script run.$config not found - please report this as a bug
|
||||||
sleep 100
|
#sleep 100
|
||||||
|
exit 0
|
||||||
|
31
root/var/service/wan/run.DHCPEthernetAddress
Executable file
31
root/var/service/wan/run.DHCPEthernetAddress
Executable 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
|
31
root/var/service/wan/run.DHCPHostname
Executable file
31
root/var/service/wan/run.DHCPHostname
Executable 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
|
@@ -3,7 +3,8 @@
|
|||||||
ISDN=$(/sbin/e-smith/config getprop isdn status)
|
ISDN=$(/sbin/e-smith/config getprop isdn status)
|
||||||
if [ "$ISDN" = "enabled" ]
|
if [ "$ISDN" = "enabled" ]
|
||||||
then
|
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
|
sleep 10
|
||||||
# TODO check here that ISDN device is available!!
|
# TODO check here that ISDN device is available!!
|
||||||
fi
|
fi
|
||||||
|
21
root/var/service/wan/run.pppoe.conf
Normal file
21
root/var/service/wan/run.pppoe.conf
Normal 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
|
@@ -4,7 +4,7 @@ Summary: smeserver server and gateway - base module
|
|||||||
%define name smeserver-base
|
%define name smeserver-base
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
%define version 11.0.0
|
%define version 11.0.0
|
||||||
%define release 26
|
%define release 34
|
||||||
Version: %{version}
|
Version: %{version}
|
||||||
Release: %{release}%{?dist}
|
Release: %{release}%{?dist}
|
||||||
License: GPL
|
License: GPL
|
||||||
@@ -49,10 +49,9 @@ Requires: bash-completion
|
|||||||
Requires: smeserver-runit >= 2.6.0-7
|
Requires: smeserver-runit >= 2.6.0-7
|
||||||
Requires: smeserver-php >= 3.0.0-22
|
Requires: smeserver-php >= 3.0.0-22
|
||||||
Requires: smeserver-yum >= 2.6.0-43
|
Requires: smeserver-yum >= 2.6.0-43
|
||||||
# daemontools bins in use
|
# daemontools bins in use :
|
||||||
|
# /var/service/wan/run.pppoe
|
||||||
Requires: /usr/bin/softlimit
|
Requires: /usr/bin/softlimit
|
||||||
Requires: /usr/bin/setuidgid
|
|
||||||
Requires: /usr/bin/multilog
|
|
||||||
Obsoletes: nss_ldap < 254
|
Obsoletes: nss_ldap < 254
|
||||||
Obsoletes: cpu
|
Obsoletes: cpu
|
||||||
Obsoletes: rlinetd, e-smith-mod_ssl
|
Obsoletes: rlinetd, e-smith-mod_ssl
|
||||||
@@ -122,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.crt 'attr(0700,root,root)' \
|
||||||
--dir /home/e-smith/ssl.pem 'attr(0700,root,root)' \
|
--dir /home/e-smith/ssl.pem 'attr(0700,root,root)' \
|
||||||
--dir /var/service/wan 'attr(1755,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 'attr(0750,root,root)' \
|
||||||
--file /var/service/wan/run.dhclient '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.pppoe 'attr(0750,root,root)' \
|
||||||
--file /var/service/wan/run.static '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.dialup 'attr(0750,root,root)' \
|
||||||
--file /var/service/wan/run.disabled '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/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 /var/log/ippp 'attr(2750,smelog,smelog)' \
|
||||||
--dir /etc/e-smith/skel/user/.ssh 'attr(0700,root,root)' \
|
--dir /etc/e-smith/skel/user/.ssh 'attr(0700,root,root)' \
|
||||||
--file /etc/sysconfig/modules/dummy.modules 'attr(0755,root,root)' \
|
--file /etc/sysconfig/modules/dummy.modules 'attr(0755,root,root)' \
|
||||||
@@ -168,6 +155,9 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
/sbin/e-smith/create-system-user smelastsys 2999 \
|
/sbin/e-smith/create-system-user smelastsys 2999 \
|
||||||
'sme last system user marker' /tmp /bin/false
|
'sme last system user marker' /tmp /bin/false
|
||||||
|
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
%post
|
%post
|
||||||
LEXICONS=$(find /etc/e-smith/locale/*/etc/e-smith/web/panels/password/cgi-bin/userpassword -type f 2>/dev/null)
|
LEXICONS=$(find /etc/e-smith/locale/*/etc/e-smith/web/panels/password/cgi-bin/userpassword -type f 2>/dev/null)
|
||||||
|
|
||||||
@@ -192,6 +182,35 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jul 09 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0-34.sme
|
||||||
|
- fix hardcoded rp-pppoe.so location - Thanks Nestor [SME: 13074]
|
||||||
|
|
||||||
|
* Thu Jun 12 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-33.sme
|
||||||
|
- fix autorenew of self-signed certificate [SME: 12218]
|
||||||
|
strips unsupported characters, use utf8 encoding
|
||||||
|
|
||||||
|
* Thu Jun 05 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-32.sme
|
||||||
|
- Replicate user accounts to samba Active Directory [SME: 12799]
|
||||||
|
|
||||||
|
* Sun Mar 16 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-31.sme
|
||||||
|
- handle dh params with template [SME: 12826]
|
||||||
|
TODO timer and event
|
||||||
|
- foolproofing dummy.module
|
||||||
|
|
||||||
|
* 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
|
* Wed Feb 12 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-26.sme
|
||||||
- add pam_abl requirement [SME: 12914]
|
- add pam_abl requirement [SME: 12914]
|
||||||
- add isdn4k-utils requirement for ippp isdn connections [SME: 12909]
|
- add isdn4k-utils requirement for ippp isdn connections [SME: 12909]
|
||||||
|
Reference in New Issue
Block a user