├── root ├── etc │ ├── e-smith │ │ ├── templates-custom │ │ │ └── .gitignore │ │ ├── db │ │ │ ├── certificates │ │ │ │ ├── defaults │ │ │ │ │ └── .gitignore │ │ │ │ └── migrate │ │ │ │ │ └── .gitignore │ │ │ ├── configuration │ │ │ │ ├── defaults │ │ │ │ │ ├── pki │ │ │ │ │ │ ├── State │ │ │ │ │ │ ├── ChainFile │ │ │ │ │ │ ├── CommonName │ │ │ │ │ │ ├── CountryCode │ │ │ │ │ │ ├── Locality │ │ │ │ │ │ ├── CrtFile │ │ │ │ │ │ ├── EmailAddress │ │ │ │ │ │ ├── KeyFile │ │ │ │ │ │ ├── LetsEncryptMail │ │ │ │ │ │ ├── Organization │ │ │ │ │ │ ├── SubjectAltName │ │ │ │ │ │ ├── LetsEncryptDomains │ │ │ │ │ │ ├── OrganizationalUnitName │ │ │ │ │ │ ├── type │ │ │ │ │ │ ├── CertificateDuration │ │ │ │ │ │ ├── LetsEncryptChallenge │ │ │ │ │ │ └── LetsEncryptShortChain │ │ │ │ │ ├── proxy │ │ │ │ │ │ ├── host │ │ │ │ │ │ ├── port │ │ │ │ │ │ ├── user │ │ │ │ │ │ ├── password │ │ │ │ │ │ └── type │ │ │ │ │ ├── MinUid │ │ │ │ │ │ └── type │ │ │ │ │ ├── root │ │ │ │ │ │ ├── SenderAddress │ │ │ │ │ │ ├── EmailAddress │ │ │ │ │ │ ├── KeepMessageCopy │ │ │ │ │ │ └── type │ │ │ │ │ ├── yum-cron │ │ │ │ │ │ ├── customMail │ │ │ │ │ │ ├── download │ │ │ │ │ │ ├── messages │ │ │ │ │ │ ├── type │ │ │ │ │ │ ├── applyUpdate │ │ │ │ │ │ ├── randomWait │ │ │ │ │ │ └── status │ │ │ │ │ ├── logrotate │ │ │ │ │ │ ├── Times │ │ │ │ │ │ ├── Rotate │ │ │ │ │ │ ├── Compression │ │ │ │ │ │ └── type │ │ │ │ │ ├── nsswitch │ │ │ │ │ │ ├── ethers │ │ │ │ │ │ ├── group │ │ │ │ │ │ ├── passwd │ │ │ │ │ │ ├── rpc │ │ │ │ │ │ ├── shadow │ │ │ │ │ │ ├── hosts │ │ │ │ │ │ ├── netgroup │ │ │ │ │ │ ├── netmasks │ │ │ │ │ │ ├── networks │ │ │ │ │ │ ├── protocols │ │ │ │ │ │ ├── publickey │ │ │ │ │ │ ├── services │ │ │ │ │ │ ├── aliases │ │ │ │ │ │ ├── type │ │ │ │ │ │ ├── automount │ │ │ │ │ │ └── bootparams │ │ │ │ │ ├── postfix │ │ │ │ │ │ ├── type │ │ │ │ │ │ └── status │ │ │ │ │ ├── rsyslog │ │ │ │ │ │ ├── LogAll2VT6 │ │ │ │ │ │ ├── type │ │ │ │ │ │ └── status │ │ │ │ │ ├── sysconfig │ │ │ │ │ │ ├── Release │ │ │ │ │ │ ├── Version │ │ │ │ │ │ ├── ZeroConf │ │ │ │ │ │ ├── type │ │ │ │ │ │ └── ProductName │ │ │ │ │ ├── tls │ │ │ │ │ │ ├── policy │ │ │ │ │ │ └── type │ │ │ │ │ ├── OrganizationContact │ │ │ │ │ │ ├── State │ │ │ │ │ │ ├── City │ │ │ │ │ │ ├── CountryCode │ │ │ │ │ │ ├── Department │ │ │ │ │ │ ├── type │ │ │ │ │ │ ├── Company │ │ │ │ │ │ ├── PhoneNumber │ │ │ │ │ │ └── Street │ │ │ │ │ ├── dns │ │ │ │ │ │ ├── type │ │ │ │ │ │ └── NameServers │ │ │ │ │ ├── fstab │ │ │ │ │ │ └── type │ │ │ │ │ ├── maxAcctNameLength │ │ │ │ │ │ └── type │ │ │ │ │ ├── maxGroupNameLength │ │ │ │ │ │ └── type │ │ │ │ │ ├── firewall │ │ │ │ │ │ └── type │ │ │ │ │ └── passwordstrength │ │ │ │ │ │ ├── MaxPassAge │ │ │ │ │ │ ├── MinPassAge │ │ │ │ │ │ ├── PassExpires │ │ │ │ │ │ ├── PassWarning │ │ │ │ │ │ ├── Users │ │ │ │ │ │ └── type │ │ │ │ └── migrate │ │ │ │ │ ├── letsencrypt_cleanup │ │ │ │ │ ├── yum-cron_remove_command_prop │ │ │ │ │ └── issue3149.ns7 │ │ │ ├── networks │ │ │ │ ├── defaults │ │ │ │ │ └── ppp0 │ │ │ │ │ │ ├── user │ │ │ │ │ │ ├── FwInBandwidth │ │ │ │ │ │ ├── FwOutBandwidth │ │ │ │ │ │ ├── Password │ │ │ │ │ │ ├── name │ │ │ │ │ │ ├── role │ │ │ │ │ │ ├── AuthType │ │ │ │ │ │ ├── type │ │ │ │ │ │ └── provider │ │ │ │ └── migrate │ │ │ │ │ ├── issue5019.el7 │ │ │ │ │ ├── issue5234.el7 │ │ │ │ │ └── trafficshaping.el7 │ │ │ └── routes │ │ │ │ └── migrate │ │ │ │ └── issue5079 │ │ ├── templates-user-custom │ │ │ └── .gitignore │ │ ├── templates │ │ │ ├── etc │ │ │ │ ├── shells │ │ │ │ │ ├── sh │ │ │ │ │ ├── template-begin │ │ │ │ │ ├── bash │ │ │ │ │ ├── csh │ │ │ │ │ ├── false │ │ │ │ │ └── nologin │ │ │ │ ├── yum │ │ │ │ │ ├── vars │ │ │ │ │ │ └── nsrelease │ │ │ │ │ │ │ ├── template-begin │ │ │ │ │ │ │ ├── 50output │ │ │ │ │ │ │ └── 00default │ │ │ │ │ └── yum-cron.conf │ │ │ │ │ │ ├── 40groups │ │ │ │ │ │ ├── 50base │ │ │ │ │ │ ├── 20emitters │ │ │ │ │ │ ├── 30email │ │ │ │ │ │ └── 10commands │ │ │ │ ├── sysconfig │ │ │ │ │ └── network │ │ │ │ │ │ ├── 10networking │ │ │ │ │ │ ├── 20forward_ipv4 │ │ │ │ │ │ └── 30zeroConf │ │ │ │ ├── backup-config.d │ │ │ │ │ └── nethserver-certificates.include │ │ │ │ │ │ ├── template-begin │ │ │ │ │ │ └── 10base │ │ │ │ ├── resolv.conf │ │ │ │ │ ├── 10domain │ │ │ │ │ └── 20roleNone │ │ │ │ ├── nethserver │ │ │ │ │ ├── eorepo.conf │ │ │ │ │ │ ├── 50output │ │ │ │ │ │ └── 00default │ │ │ │ │ └── pkginfo.conf │ │ │ │ │ │ ├── 00template_vars │ │ │ │ │ │ └── 50print_list │ │ │ │ ├── yum.conf │ │ │ │ │ ├── 30groups │ │ │ │ │ ├── 10base │ │ │ │ │ ├── 20proxy │ │ │ │ │ └── 50disclaimer │ │ │ │ ├── hosts │ │ │ │ │ ├── 10localhost │ │ │ │ │ ├── 00hostnames_var │ │ │ │ │ └── 20hostname │ │ │ │ ├── sudoers │ │ │ │ │ ├── 00adm_commands │ │ │ │ │ └── 30nethserver_adm │ │ │ │ ├── cron.hourly │ │ │ │ │ └── jobs.deny │ │ │ │ │ │ └── 10yumcron │ │ │ │ ├── selinux │ │ │ │ │ └── config │ │ │ │ │ │ └── 10selinux │ │ │ │ ├── logviewer.conf │ │ │ │ │ ├── 00info │ │ │ │ │ └── 10base │ │ │ │ ├── modprobe.d │ │ │ │ │ └── bonding.conf │ │ │ │ │ │ └── 10base │ │ │ │ ├── profile.d │ │ │ │ │ └── nethserver_proxy.sh │ │ │ │ │ │ └── 10base │ │ │ │ └── logrotate.conf │ │ │ │ │ └── 10base │ │ │ └── certificate │ │ │ │ ├── crt │ │ │ │ ├── template-begin │ │ │ │ ├── 30chain │ │ │ │ └── 00crt │ │ │ │ ├── key │ │ │ │ ├── template-begin │ │ │ │ └── 00key │ │ │ │ └── pem │ │ │ │ ├── template-begin │ │ │ │ ├── 10key │ │ │ │ ├── 20crt │ │ │ │ └── 30chain │ │ ├── validators │ │ │ ├── logical-interface-create │ │ │ │ └── .gitignore │ │ │ └── actions │ │ │ │ ├── pem-certificate │ │ │ │ ├── hostname-localhost │ │ │ │ ├── rsa-key │ │ │ │ ├── tlspolicy-ecdsa-cert │ │ │ │ ├── logfile │ │ │ │ ├── hostname-length │ │ │ │ ├── uniq-networksdb-key │ │ │ │ ├── group-length │ │ │ │ ├── user-length │ │ │ │ ├── open-tcp-connection │ │ │ │ └── interface-role │ │ ├── templates.metadata │ │ │ └── etc │ │ │ │ ├── fstab │ │ │ │ └── sudoers │ │ └── events │ │ │ └── actions │ │ │ ├── network-start │ │ │ ├── nethserver-system-init-clear │ │ │ ├── static-routes-save │ │ │ ├── trusted-networks-modify │ │ │ ├── nethserver-base-selinux-setup │ │ │ ├── hostname-set │ │ │ ├── nethserver-base-interface-update │ │ │ ├── system-shutdown │ │ │ ├── password-cleanup │ │ │ ├── nethserver-base-fixrepos │ │ │ ├── nethserver-generate-certificate │ │ │ ├── nethserver-base-distro-upgrade │ │ │ ├── system-adjust │ │ │ ├── adjust-fixnetwork-flag │ │ │ ├── firewall-adjust │ │ │ ├── nethserver-base-software-repos │ │ │ ├── network-route-up │ │ │ ├── network-stop │ │ │ ├── nethserver-base-conf │ │ │ ├── password-set │ │ │ ├── network-route-down │ │ │ ├── interface-config-reset │ │ │ ├── interface-rename │ │ │ ├── nethserver-base-restore-yumrepos │ │ │ ├── nethserver-base-synchronize-nssdb │ │ │ └── nethserver-certificate-upload │ ├── backup-data.d │ │ ├── nethserver-base.exclude │ │ └── nethserver-base.include │ ├── systemd │ │ └── system │ │ │ └── network.service.d │ │ │ └── override.conf │ ├── cron.daily │ │ ├── nethserver-letsencrypt-certs │ │ └── nethserver-check-builtin-certificate │ ├── letsencrypt │ │ └── renewal-hooks │ │ │ └── deploy │ │ │ └── 10nethserver │ ├── udev │ │ └── rules.d │ │ │ └── 95-NetworksDB.rules │ ├── backup-config.d │ │ └── nethserver-base.include │ ├── nethserver │ │ ├── eorepo.conf │ │ ├── pkginfo.conf │ │ └── todos.d │ │ │ └── 10green-dhcp │ ├── httpd │ │ └── conf.d │ │ │ └── letsencrypt.conf │ ├── profile.d │ │ └── nethserver.sh │ └── sudoers.d │ │ └── 20_nethserver_base └── usr │ ├── share │ └── nethesis │ │ └── NethServer │ │ ├── Module │ │ ├── Dashboard │ │ │ ├── Applications │ │ │ │ └── .gitignore │ │ │ ├── Interfaces │ │ │ │ └── ApplicationInterface.php │ │ │ └── SystemStatus │ │ │ │ └── RaidStatus.php │ │ ├── Login.php │ │ ├── UserDashboard │ │ │ └── UserProfileRedirect.php │ │ ├── UserProfile.php │ │ ├── Pki │ │ │ ├── Index.php │ │ │ └── CertAdapter.php │ │ ├── LogViewer.php │ │ ├── Applications.php │ │ ├── PackageManager │ │ │ ├── ClearYumCache.php │ │ │ └── DistroUpgrade.php │ │ ├── FQDN.php │ │ ├── Shutdown.php │ │ ├── FirstConfigWiz │ │ │ └── Cover.php │ │ ├── UserProfile │ │ │ └── ChangePassword.php │ │ └── StaticRoutes.php │ │ ├── Template │ │ ├── AdminTodo.php │ │ ├── FirstConfigWiz │ │ │ ├── WizHeader.php │ │ │ ├── Hostname.php │ │ │ ├── WizFooter.php │ │ │ ├── Review.php │ │ │ └── Cover.php │ │ ├── FQDN.php │ │ ├── TlsPolicy.php │ │ ├── UserProfile │ │ │ ├── ChangePassword.php │ │ │ └── Personal.php │ │ ├── PackageManager │ │ │ ├── PackagesElement.php │ │ │ ├── EditModule.php │ │ │ ├── DistroUpgrade.php │ │ │ ├── Configuration.php │ │ │ ├── Packages.php │ │ │ ├── Modules │ │ │ │ └── Update.php │ │ │ └── Review.php │ │ ├── Dashboard │ │ │ ├── SystemStatus │ │ │ │ ├── SystemRelease.php │ │ │ │ └── RaidStatus.php │ │ │ ├── SystemStatus.php │ │ │ └── Applications.php │ │ ├── Shutdown.php │ │ ├── NetworkAdapter │ │ │ ├── CreateIpAlias.php │ │ │ ├── UpstreamProxy.php │ │ │ ├── ConfirmInterfaceCreation.php │ │ │ ├── ReleasePhysicalInterface.php │ │ │ ├── CleanPhysicalInterface.php │ │ │ ├── SetPppoeParameters.php │ │ │ ├── DeleteLogicalInterface.php │ │ │ └── CreateLogicalInterface.php │ │ ├── Organization.php │ │ ├── Pki │ │ │ ├── SetDefault.php │ │ │ ├── GenerateLe.php │ │ │ ├── Show.php │ │ │ ├── Index.php │ │ │ ├── Generate.php │ │ │ └── Upload.php │ │ ├── NetworkServices │ │ │ └── Modify.php │ │ ├── Services │ │ │ └── Systemctl.php │ │ ├── LocalNetwork │ │ │ └── CreateUpdate.php │ │ ├── Applications.php │ │ └── StaticRoutes │ │ │ └── Modify.php │ │ ├── Help │ │ └── en │ │ │ ├── NethServer_Module_PackageManager.rst │ │ │ ├── NethServer_Module_TlsPolicy.rst │ │ │ ├── NethServer_Module_Pki.rst │ │ │ ├── NethServer_Module_FQDN.rst │ │ │ ├── NethServer_Module_FirstConfigWiz.rst │ │ │ ├── NethServer_Module_NetworkServices.rst │ │ │ ├── NethServer_Module_Shutdown.rst │ │ │ ├── NethServer_Module_Organization.rst │ │ │ ├── NethServer_Module_UserProfile.rst │ │ │ ├── NethServer_Module_LocalNetwork.rst │ │ │ ├── NethServer_Module_LogViewer.rst │ │ │ └── NethServer_Module_StaticRoutes.rst │ │ ├── Language │ │ └── en │ │ │ ├── NethServer_Module_Dashboard_SystemStatus.php │ │ │ ├── NethServer_Module_Dashboard_SystemStatus_SystemRelease.php │ │ │ ├── NethServer_Module_Dashboard.php │ │ │ ├── NethServer_Module_Shutdown.php │ │ │ ├── NethServer_Module_UserProfile.php │ │ │ ├── NethServer_Module_NetworkAdapter_UpstreamProxy.php │ │ │ ├── NethServer_Module_Dashboard_Applications.php │ │ │ ├── NethServer_Module_Organization.php │ │ │ ├── NethServer_Module_Dashboard_SystemStatus_RaidStatus.php │ │ │ ├── NethServer_Module_LogViewer.php │ │ │ ├── NethServer_Module_TlsPolicy.php │ │ │ ├── NethServer_Module_Welcome.php │ │ │ ├── NethServer_Module_Dashboard_SystemStatus_Network.php │ │ │ ├── NethServer_Module_StaticRoutes.php │ │ │ ├── NethServer_Module_LocalNetwork.php │ │ │ ├── NethServer_Module_NetworkServices.php │ │ │ ├── NethServer_Module_FirstConfigWiz.php │ │ │ ├── NethServer_Module_FQDN.php │ │ │ ├── NethServer_Module_Dashboard_SystemStatus_Resources.php │ │ │ └── NethServer.php │ │ ├── Test │ │ └── Unit │ │ │ └── NethServer │ │ │ └── Tool │ │ │ └── PasswordStashTest.php │ │ └── Tool │ │ ├── WikiText.php │ │ ├── CustomModuleAttributesProvider.php │ │ └── php-markdown │ │ └── License.text │ ├── libexec │ └── nethserver │ │ ├── yum-packages-to-remove │ │ ├── bond-slave-mac │ │ ├── trusted-networks │ │ ├── sigev-batch │ │ ├── pki-genkey │ │ ├── control-service │ │ ├── read-service-status │ │ ├── admin-todos │ │ ├── pki-info │ │ └── ptrack-yum-update │ └── lib │ └── systemd │ ├── system-preset │ └── 50-nethserver-system-init.preset │ └── system │ ├── nethserver-config-network.service │ └── nethserver-system-init.service ├── locale └── nethserver-base.pot └── .github └── workflows └── make-rpms.yml /root/etc/e-smith/templates-custom/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/certificates/defaults/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/certificates/migrate/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/pki/State: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/proxy/host: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/proxy/port: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/proxy/user: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/networks/defaults/ppp0/user: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates-user-custom/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/shells/sh: -------------------------------------------------------------------------------- 1 | /bin/sh 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/shells/template-begin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/pki/ChainFile: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/pki/CommonName: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/pki/CountryCode: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/pki/Locality: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/proxy/password: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/networks/defaults/ppp0/FwInBandwidth: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/networks/defaults/ppp0/FwOutBandwidth: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/networks/defaults/ppp0/Password: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/networks/defaults/ppp0/name: -------------------------------------------------------------------------------- 1 | PPPoE 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/networks/defaults/ppp0/role: -------------------------------------------------------------------------------- 1 | red 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/certificate/crt/template-begin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/certificate/key/template-begin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/certificate/pem/template-begin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/shells/bash: -------------------------------------------------------------------------------- 1 | /bin/bash 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/shells/csh: -------------------------------------------------------------------------------- 1 | /bin/csh 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/shells/false: -------------------------------------------------------------------------------- 1 | /bin/false 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/MinUid/type: -------------------------------------------------------------------------------- 1 | 5000 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/pki/CrtFile: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/pki/EmailAddress: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/pki/KeyFile: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/pki/LetsEncryptMail: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/pki/Organization: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/pki/SubjectAltName: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/root/SenderAddress: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/yum-cron/customMail: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/networks/defaults/ppp0/AuthType: -------------------------------------------------------------------------------- 1 | auto 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/certificate/pem/10key: -------------------------------------------------------------------------------- 1 | ../key/00key -------------------------------------------------------------------------------- /root/etc/e-smith/templates/certificate/pem/20crt: -------------------------------------------------------------------------------- 1 | ../crt/00crt -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/shells/nologin: -------------------------------------------------------------------------------- 1 | /sbin/nologin 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/validators/logical-interface-create/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/logrotate/Times: -------------------------------------------------------------------------------- 1 | 52 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/nsswitch/ethers: -------------------------------------------------------------------------------- 1 | files 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/nsswitch/group: -------------------------------------------------------------------------------- 1 | files 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/nsswitch/passwd: -------------------------------------------------------------------------------- 1 | files 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/nsswitch/rpc: -------------------------------------------------------------------------------- 1 | files 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/nsswitch/shadow: -------------------------------------------------------------------------------- 1 | files 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/pki/LetsEncryptDomains: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/postfix/type: -------------------------------------------------------------------------------- 1 | service 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/root/EmailAddress: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/rsyslog/LogAll2VT6: -------------------------------------------------------------------------------- 1 | no 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/rsyslog/type: -------------------------------------------------------------------------------- 1 | service 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/sysconfig/Release: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/sysconfig/Version: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/tls/policy: -------------------------------------------------------------------------------- 1 | 20200510 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/yum-cron/download: -------------------------------------------------------------------------------- 1 | yes 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/yum-cron/messages: -------------------------------------------------------------------------------- 1 | yes 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/yum-cron/type: -------------------------------------------------------------------------------- 1 | service 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/networks/defaults/ppp0/type: -------------------------------------------------------------------------------- 1 | xdsl-disabled 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/certificate/pem/30chain: -------------------------------------------------------------------------------- 1 | ../crt/30chain -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/yum/vars/nsrelease/template-begin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/OrganizationContact/State: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/dns/type: -------------------------------------------------------------------------------- 1 | configuration 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/fstab/type: -------------------------------------------------------------------------------- 1 | configuration 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/logrotate/Rotate: -------------------------------------------------------------------------------- 1 | weekly 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/maxAcctNameLength/type: -------------------------------------------------------------------------------- 1 | 31 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/maxGroupNameLength/type: -------------------------------------------------------------------------------- 1 | 31 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/nsswitch/hosts: -------------------------------------------------------------------------------- 1 | files dns 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/nsswitch/netgroup: -------------------------------------------------------------------------------- 1 | nisplus 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/nsswitch/netmasks: -------------------------------------------------------------------------------- 1 | files 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/nsswitch/networks: -------------------------------------------------------------------------------- 1 | files 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/nsswitch/protocols: -------------------------------------------------------------------------------- 1 | files 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/nsswitch/publickey: -------------------------------------------------------------------------------- 1 | nisplus 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/nsswitch/services: -------------------------------------------------------------------------------- 1 | files 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/pki/OrganizationalUnitName: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/pki/type: -------------------------------------------------------------------------------- 1 | configuration 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/postfix/status: -------------------------------------------------------------------------------- 1 | enabled 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/proxy/type: -------------------------------------------------------------------------------- 1 | configuration 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/root/KeepMessageCopy: -------------------------------------------------------------------------------- 1 | yes 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/root/type: -------------------------------------------------------------------------------- 1 | configuration 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/rsyslog/status: -------------------------------------------------------------------------------- 1 | enabled 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/tls/type: -------------------------------------------------------------------------------- 1 | configuration 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/yum-cron/applyUpdate: -------------------------------------------------------------------------------- 1 | no 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/yum-cron/randomWait: -------------------------------------------------------------------------------- 1 | 360 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/yum-cron/status: -------------------------------------------------------------------------------- 1 | enabled 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/networks/defaults/ppp0/provider: -------------------------------------------------------------------------------- 1 | xDSL provider 2 | -------------------------------------------------------------------------------- /root/etc/backup-data.d/nethserver-base.exclude: -------------------------------------------------------------------------------- 1 | /var/lib/nethserver/secrets 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/dns/NameServers: -------------------------------------------------------------------------------- 1 | 8.8.4.4,8.8.8.8 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/firewall/type: -------------------------------------------------------------------------------- 1 | configuration 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/logrotate/Compression: -------------------------------------------------------------------------------- 1 | disabled 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/logrotate/type: -------------------------------------------------------------------------------- 1 | configuration 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/nsswitch/aliases: -------------------------------------------------------------------------------- 1 | files nisplus 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/nsswitch/type: -------------------------------------------------------------------------------- 1 | configuration 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/passwordstrength/MaxPassAge: -------------------------------------------------------------------------------- 1 | 180 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/passwordstrength/MinPassAge: -------------------------------------------------------------------------------- 1 | 0 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/passwordstrength/PassExpires: -------------------------------------------------------------------------------- 1 | no 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/passwordstrength/PassWarning: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/passwordstrength/Users: -------------------------------------------------------------------------------- 1 | strong 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/pki/CertificateDuration: -------------------------------------------------------------------------------- 1 | 3650 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/pki/LetsEncryptChallenge: -------------------------------------------------------------------------------- 1 | http 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/sysconfig/ZeroConf: -------------------------------------------------------------------------------- 1 | disabled 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/sysconfig/type: -------------------------------------------------------------------------------- 1 | configuration 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/yum/vars/nsrelease/50output: -------------------------------------------------------------------------------- 1 | { $OUT="$release" } -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Module/Dashboard/Applications/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/backup-data.d/nethserver-base.include: -------------------------------------------------------------------------------- 1 | /root 2 | /var/lib/nethserver 3 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/OrganizationContact/City: -------------------------------------------------------------------------------- 1 | Hometown 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/OrganizationContact/CountryCode: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/OrganizationContact/Department: -------------------------------------------------------------------------------- 1 | Main 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/OrganizationContact/type: -------------------------------------------------------------------------------- 1 | configuration -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/nsswitch/automount: -------------------------------------------------------------------------------- 1 | files nisplus 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/passwordstrength/type: -------------------------------------------------------------------------------- 1 | configuration 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/pki/LetsEncryptShortChain: -------------------------------------------------------------------------------- 1 | enabled 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/sysconfig/ProductName: -------------------------------------------------------------------------------- 1 | NethServer 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/sysconfig/network/10networking: -------------------------------------------------------------------------------- 1 | NETWORKING=yes 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/OrganizationContact/Company: -------------------------------------------------------------------------------- 1 | Example Org 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/OrganizationContact/PhoneNumber: -------------------------------------------------------------------------------- 1 | 575-1685 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/sysconfig/network/20forward_ipv4: -------------------------------------------------------------------------------- 1 | FORWARD_IPV4=yes 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/OrganizationContact/Street: -------------------------------------------------------------------------------- 1 | 123 Main Street 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/backup-config.d/nethserver-certificates.include/template-begin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/defaults/nsswitch/bootparams: -------------------------------------------------------------------------------- 1 | nisplus [NOTFOUND=return] files 2 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates.metadata/etc/fstab: -------------------------------------------------------------------------------- 1 | FILTER=sub { $_[0] =~ /^\s*$/ ? '' : $_[0] } 2 | -------------------------------------------------------------------------------- /root/etc/systemd/system/network.service.d/override.conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | KillMode=control-group 3 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/network-start: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec systemctl start network 4 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/resolv.conf/10domain: -------------------------------------------------------------------------------- 1 | domain { $DomainName } 2 | search { $DomainName } 3 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/nethserver/eorepo.conf/50output: -------------------------------------------------------------------------------- 1 | { 2 | $OUT .= join("\n", @repos); 3 | } 4 | -------------------------------------------------------------------------------- /root/etc/cron.daily/nethserver-letsencrypt-certs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | /usr/libexec/nethserver/letsencrypt-certs 4 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/nethserver-system-init-clear: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | rm -f /var/spool/first-boot 4 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates.metadata/etc/sudoers: -------------------------------------------------------------------------------- 1 | PERMS=0440 2 | OUTPUT_FILENAME="/etc/sudoers.d/10_nethserver" 3 | 4 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/AdminTodo.php: -------------------------------------------------------------------------------- 1 | /dev/null 6 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/sysconfig/network/30zeroConf: -------------------------------------------------------------------------------- 1 | { 2 | $OUT .= "NOZEROCONF=yes\n" if (($sysconfig{'ZeroConf'}||'') eq 'disabled'); 3 | } 4 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/sudoers/00adm_commands: -------------------------------------------------------------------------------- 1 | { 2 | # 3 | # 00adm_commands 4 | # 5 | @adm_commands = (); 6 | 7 | ''; 8 | } 9 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/cron.hourly/jobs.deny/10yumcron: -------------------------------------------------------------------------------- 1 | # 2 | # 10yumcron 3 | # 4 | # WARNING: run-parts does not allow spaces around the values! 5 | # 6 | 0yum-hourly.cron 7 | -------------------------------------------------------------------------------- /root/etc/udev/rules.d/95-NetworksDB.rules: -------------------------------------------------------------------------------- 1 | # 2 | # Update NetworksDB 3 | # 4 | SUBSYSTEM=="net", ACTION=="*", KERNEL=="*", RUN+="/sbin/e-smith/nethserver-config-network --update-db-only" 5 | -------------------------------------------------------------------------------- /root/usr/libexec/nethserver/yum-packages-to-remove: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | /usr/bin/yum -C --assumeno remove $@ | sed '/^[^ ].*\|^\s+$\|^$\|^\s{2,}\|^\s\s/d' | sed 1d | head -n -1 | awk '{print $1}' 3 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Help/en/NethServer_Module_PackageManager.rst: -------------------------------------------------------------------------------- 1 | Software center 2 | =============== 3 | 4 | The UI reference is available online at 5 | 6 | http://docs.nethserver.org/en/v7/packages.html -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/nethserver-base-selinux-setup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . /etc/sysconfig/selinux 4 | 5 | if [ `getenforce` == 'Enforcing' ] && [ "${SELINUX}" == "disabled" ]; then 6 | setenforce 0 7 | fi 8 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Help/en/NethServer_Module_TlsPolicy.rst: -------------------------------------------------------------------------------- 1 | ========== 2 | TLS policy 3 | ========== 4 | 5 | The UI reference is available online at 6 | 7 | http://docs.nethserver.org/en/v7/ui/TlsPolicy.html 8 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/selinux/config/10selinux: -------------------------------------------------------------------------------- 1 | # Totally disable SELinux, also avoid useless auditing log 2 | 3 | # enforcing, permissive, disabled 4 | SELINUX=disabled 5 | 6 | # targeted, mls 7 | SELINUXTYPE=targeted 8 | -------------------------------------------------------------------------------- /root/etc/backup-config.d/nethserver-base.include: -------------------------------------------------------------------------------- 1 | /var/lib/nethserver/db 2 | /var/lib/nethserver/secrets 3 | /etc/e-smith/templates-custom 4 | /etc/e-smith/templates-user-custom 5 | /etc/hostname 6 | /etc/localtime 7 | /etc/letsencrypt 8 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/FirstConfigWiz/WizHeader.php: -------------------------------------------------------------------------------- 1 | header()->setAttribute('template', $T($view->getModule()->getIdentifier() . '_Title')); 4 | 5 | -------------------------------------------------------------------------------- /root/etc/nethserver/eorepo.conf: -------------------------------------------------------------------------------- 1 | # 2 | # This file is read by software-repos-save event 3 | # 4 | # Listed repositories will be enabled, everything else will be disabled 5 | # 6 | # Blank lines and lines beginning with "#" are ignored 7 | # 8 | -------------------------------------------------------------------------------- /root/usr/lib/systemd/system-preset/50-nethserver-system-init.preset: -------------------------------------------------------------------------------- 1 | # This is a one-shot service: 2 | enable nethserver-system-init.service 3 | 4 | # Disable unwanted services: 5 | disable NetworkManager.service 6 | disable firewalld.service 7 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/FirstConfigWiz/Hostname.php: -------------------------------------------------------------------------------- 1 | panel() 6 | ->insert($view->textInput('FQDN')) 7 | ; 8 | 9 | include 'WizFooter.php'; 10 | 11 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/hosts/00hostnames_var: -------------------------------------------------------------------------------- 1 | { 2 | # 3 | # 00hostnames_var 4 | # 5 | @hostnames = (); 6 | 7 | push @hostnames, "${SystemName}.${DomainName}"; 8 | push @hostnames, $SystemName; 9 | 10 | ''; 11 | } -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/logviewer.conf/00info: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # 00info -- Notes 4 | # 5 | # This file contains a list of glob patterns that match valid log file 6 | # names. It is parsed by "logviewer" command. See `logviewer -l` (#470). 7 | # 8 | 9 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/nethserver/pkginfo.conf/00template_vars: -------------------------------------------------------------------------------- 1 | { 2 | # 3 | # 00template_vars 4 | # 5 | our @repo_list = qw( 6 | nethserver-updates 7 | nethforge 8 | ); 9 | ''; 10 | } 11 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Help/en/NethServer_Module_Pki.rst: -------------------------------------------------------------------------------- 1 | ================== 2 | Server certificate 3 | ================== 4 | 5 | The reference is available online at 6 | 7 | http://docs.nethserver.org/en/v7/base_system.html#server-certificate 8 | -------------------------------------------------------------------------------- /root/etc/nethserver/pkginfo.conf: -------------------------------------------------------------------------------- 1 | # 2 | # This is the list of YUM repositories that have their groups listed 3 | # on the Software Center UI page, through the pkginfo helper. 4 | # 5 | # One repository identifier per line 6 | # 7 | nethserver-updates 8 | nethforge 9 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Language/en/NethServer_Module_Dashboard_SystemStatus.php: -------------------------------------------------------------------------------- 1 | get_prop_and_delete('pki','LetsEncryptRenewDays'); 7 | $DB->get_prop_and_delete('pki','LetsEncrypt'); 8 | ''; 9 | } 10 | -------------------------------------------------------------------------------- /root/etc/httpd/conf.d/letsencrypt.conf: -------------------------------------------------------------------------------- 1 | Alias "/.well-known/acme-challenge/" "/var/www/html/.well-known/acme-challenge/" 2 | 3 | Require all granted 4 | Options -Indexes -FollowSymLinks 5 | AllowOverride None 6 | 7 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/configuration/migrate/yum-cron_remove_command_prop: -------------------------------------------------------------------------------- 1 | { 2 | # We want to remove ${'yum-cron'}{'command'} 3 | # in later release it can be removed 4 | # introduced in version 0.1.7.el7 5 | 6 | $DB->get_prop_and_delete('yum-cron', 'command'); 7 | 8 | ''; 9 | } 10 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/logviewer.conf/10base: -------------------------------------------------------------------------------- 1 | # 2 | # 10base 3 | # 4 | 5 | include /var/log/* 6 | exclude /var/log/dmesg* 7 | exclude /var/log/btmp* 8 | exclude /var/log/wtmp* 9 | exclude /var/log/lastlog 10 | exclude *.gz 11 | exclude /var/log/samba/cores/* 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/sudoers/30nethserver_adm: -------------------------------------------------------------------------------- 1 | # 2 | # 30nethserver_adm 3 | # 4 | Cmnd_Alias NETHSERVER_ADM = { join(', ', @adm_commands, @cmnd_alias_httpd_admin) } 5 | 6 | %adm ALL=NOPASSWD: NETHSERVER_ADM 7 | 8 | # server-manager does not require a tty 9 | Defaults:srvmgr !requiretty 10 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/FQDN.php: -------------------------------------------------------------------------------- 1 | header('FQDN')->setAttribute('template', $T('FQDN_header')); 4 | 5 | echo $view->panel() 6 | ->insert($view->textInput('FQDN')) 7 | ; 8 | 9 | echo $view->buttonList($view::BUTTON_SUBMIT | $view::BUTTON_HELP); 10 | 11 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/yum/yum-cron.conf/40groups: -------------------------------------------------------------------------------- 1 | [groups] 2 | # NOTE: This only works when group_command != objects, which is now the default 3 | # List of groups to update 4 | group_list = None 5 | 6 | # The types of group packages to install 7 | group_package_types = mandatory, default 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/modprobe.d/bonding.conf/10base: -------------------------------------------------------------------------------- 1 | { 2 | # 3 | # 10base 4 | # 5 | 6 | use esmith::NetworksDB; 7 | my $idb = esmith::NetworksDB->open_ro(); 8 | my @bonds = $idb->bonds; 9 | foreach my $i (@bonds) { 10 | my $name = $i->key; 11 | $OUT.="alias $name bonding\n"; 12 | } 13 | 14 | } 15 | 16 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/FirstConfigWiz/WizFooter.php: -------------------------------------------------------------------------------- 1 | buttonList($view::BUTTON_HELP) 5 | ->insert($view->button('Back', $view::BUTTON_CANCEL)) 6 | ->insert($view->button('Next', $view::BUTTON_SUBMIT)) 7 | ; 8 | 9 | 10 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Language/en/NethServer_Module_Dashboard_SystemStatus_SystemRelease.php: -------------------------------------------------------------------------------- 1 | header()->setAttribute('template', $T('TlsPolicy_header')); 4 | 5 | echo $view->panel() 6 | ->insert($view->selector('Policy', $view::SELECTOR_DROPDOWN)) 7 | ; 8 | 9 | echo $view->buttonList($view::BUTTON_SUBMIT | $view::BUTTON_HELP); 10 | 11 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Help/en/NethServer_Module_FQDN.rst: -------------------------------------------------------------------------------- 1 | ==================== 2 | Host and domain name 3 | ==================== 4 | 5 | This field configures the server Fully Qualified Domain Name (FQDN). 6 | 7 | .. Warning:: The FQDN cannot be changed if the system is bound to an 8 | Account provider. 9 | 10 | 11 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Language/en/NethServer_Module_Dashboard.php: -------------------------------------------------------------------------------- 1 | header('username')->setAttribute('template', $T('ChangePassword_Header')); 4 | 5 | /* @var $view \Nethgui\Renderer\Xhtml */ 6 | echo $view->textInput('oldPassword', $view::TEXTINPUT_PASSWORD); 7 | 8 | include dirname(__DIR__) . '/PasswordForm.php'; 9 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/nethserver/pkginfo.conf/50print_list: -------------------------------------------------------------------------------- 1 | # 2 | # This is the list of YUM repositories that have their groups listed 3 | # on the Software Center UI page, through the pkginfo helper. 4 | # 5 | # One repository identifier per line 6 | # 7 | { 8 | # 9 | # 50print_list 10 | # 11 | $OUT = join("\n", @repo_list); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/hosts/20hostname: -------------------------------------------------------------------------------- 1 | # 2 | # 20hostname(s) 3 | # 4 | { 5 | use esmith::NetworksDB; 6 | my $ndb = esmith::NetworksDB->open_ro() || return; 7 | foreach ($ndb->green()) { 8 | if($_->prop('ipaddr')) { 9 | $OUT .= sprintf "%-18s\t%s\n", $_->prop('ipaddr'), join(' ', @hostnames); 10 | } 11 | } 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/yum/yum-cron.conf/50base: -------------------------------------------------------------------------------- 1 | [base] 2 | # This section overrides yum.conf 3 | 4 | # Use this to filter Yum core messages 5 | # -4: critical 6 | # -3: critical+errors 7 | # -2: critical+errors+warnings (default) 8 | debuglevel = -2 9 | 10 | # skip_broken = True 11 | mdpolicy = group:main 12 | 13 | # Uncomment to auto-import new gpg keys (dangerous) 14 | # assumeyes = True 15 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/networks/migrate/issue5019.el7: -------------------------------------------------------------------------------- 1 | { 2 | # 3 | # issue 5019 - remove hwaddr https://github.com/NethServer/dev/issues/5019 4 | # 5 | 6 | use esmith::NetworksDB; 7 | my $ndb = esmith::NetworksDB->open(); 8 | 9 | foreach ($ndb->get_all()) { 10 | if (defined($_->prop('hwaddr'))) { 11 | $_->delete_prop('hwaddr'); 12 | } 13 | } 14 | 15 | ''; 16 | } 17 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Language/en/NethServer_Module_Shutdown.php: -------------------------------------------------------------------------------- 1 | open(); 8 | 9 | foreach ($ndb->get_all()) { 10 | if (defined($_->prop('device'))) { 11 | $_->delete_prop('device'); 12 | } 13 | } 14 | 15 | ''; 16 | } 17 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/resolv.conf/20roleNone: -------------------------------------------------------------------------------- 1 | { 2 | # Ask the first two NameServers: 3 | use NethServer::Service; 4 | my $s = new NethServer::Service('dnsmasq'); 5 | if( ! ($s->is_owned() && $s->is_enabled()) ) { 6 | my @servers = split /,/, $dns{NameServers}; 7 | foreach (splice @servers, 0, 2) { 8 | $OUT .= sprintf("nameserver %s\n", $_); 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Language/en/NethServer_Module_UserProfile.php: -------------------------------------------------------------------------------- 1 | textLabel('name') 5 | ->setAttribute('template', '${0}') 6 | ->setAttribute('escapeHtml', FALSE); 7 | 8 | echo ''; 9 | 10 | echo $view->textLabel('version'); 11 | 12 | echo ''; 13 | 14 | echo $view->textLabel('release'); 15 | 16 | ?> 17 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Language/en/NethServer_Module_NetworkAdapter_UpstreamProxy.php: -------------------------------------------------------------------------------- 1 | "; 4 | echo "
"; 5 | echo $view->header()->setAttribute('template',$T('release_title')); 6 | echo "
".$T('release_label')."
"; echo $view->textLabel('release'); echo "
"; 7 | echo "
".$T('kernel_label')."
"; echo $view->textLabel('kernel'); echo "
"; 8 | echo "
"; 9 | echo ""; 10 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Language/en/NethServer_Module_Dashboard_Applications.php: -------------------------------------------------------------------------------- 1 | open(); 8 | 9 | $cdb->get_value_and_delete('messagebus'); 10 | 11 | $cdb->get_value_and_delete('SystemMode'); 12 | $cdb->get_value_and_delete('PasswordSet'); 13 | $cdb->get_value_and_delete('UnsavedChanges'); 14 | $cdb->get_value_and_delete('crond'); 15 | 16 | ''; 17 | } -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/backup-config.d/nethserver-certificates.include/10base: -------------------------------------------------------------------------------- 1 | { 2 | use JSON; 3 | use File::Basename; 4 | my $certs = decode_json(`/usr/libexec/nethserver/cert-list`); 5 | foreach my $file ( keys %{$certs}) { 6 | $OUT .= "$file\n"; 7 | $OUT .= ${$certs}{$file}{'key'}."\n"; 8 | if ( ${$certs}{$file}{'chain'} ne "" ) { 9 | $OUT .= ${$certs}{$file}{'chain'}."\n"; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Language/en/NethServer_Module_Organization.php: -------------------------------------------------------------------------------- 1 | header()->setAttribute('template', $T('Shutdown_Title')); 4 | 5 | /* @var $view \Nethgui\Renderer\Xhtml */ 6 | echo $view->radioButton('Action', 'reboot', $view::STATE_CHECKED); 7 | echo $view->radioButton('Action', 'poweroff'); 8 | 9 | echo $view->buttonList() 10 | ->insert($view->button('Shutdown', $view::BUTTON_SUBMIT)) 11 | ->insert($view->button('Help', $view::BUTTON_HELP)); 12 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Language/en/NethServer_Module_Dashboard_SystemStatus_RaidStatus.php: -------------------------------------------------------------------------------- 1 | header('alias')->setAttribute('template', $T('CreateIpAlias_header')); 5 | 6 | echo $view->textInput('ipaddr'); 7 | echo $view->textInput('netmask'); 8 | 9 | echo $view->buttonList($view::BUTTON_HELP) 10 | ->insert($view->button('CreateIpAlias', $view::BUTTON_SUBMIT)) 11 | ->insert($view->button('Cancel', $view::BUTTON_CANCEL)) 12 | ; -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/Organization.php: -------------------------------------------------------------------------------- 1 | header()->setAttribute('template', $T('Organization_Title')); 4 | 5 | echo $view->panel() 6 | ->insert($view->textInput('Company')) 7 | ->insert($view->textInput('City')) 8 | ->insert($view->textInput('Department')) 9 | ->insert($view->textInput('PhoneNumber')) 10 | ->insert($view->textInput('Street')); 11 | 12 | echo $view->buttonList($view::BUTTON_SUBMIT | $view::BUTTON_HELP); 13 | 14 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/PackageManager/EditModule.php: -------------------------------------------------------------------------------- 1 | header('name')->setAttribute('template', $T('EditModule_header')); 5 | 6 | echo $view->selector('components', $view::SELECTOR_MULTIPLE | $view::LABEL_NONE); 7 | 8 | echo $view->hidden('name'); 9 | 10 | echo $view->buttonList() 11 | ->insert($view->button('Run', $view::BUTTON_SUBMIT)) 12 | ->insert($view->button('Cancel', $view::BUTTON_CANCEL)) 13 | ; 14 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/NetworkAdapter/UpstreamProxy.php: -------------------------------------------------------------------------------- 1 | header()->setAttribute('template', $T('UpstreamProxy_header')); 4 | 5 | echo $view->panel() 6 | ->insert($view->textInput('host')) 7 | ->insert($view->textInput('port')) 8 | ->insert($view->textInput('username')) 9 | ->insert($view->textInput('password', $view::TEXTINPUT_PASSWORD)) 10 | ; 11 | 12 | echo $view->buttonList($view::BUTTON_SUBMIT | $view::BUTTON_CANCEL | $view::BUTTON_HELP); 13 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/certificate/crt/30chain: -------------------------------------------------------------------------------- 1 | { 2 | # 3 | # include chain file 4 | # 5 | 6 | $OUT = ''; 7 | 8 | my $file = $pki{ChainFile} || ""; 9 | 10 | if(! $file || ! -f $file ) { 11 | return ''; 12 | } 13 | 14 | # Perlish way to slurp a text file: 15 | $OUT = do { 16 | local $/ = undef; 17 | open my $fh, "<", $file 18 | or warn "[WARNING] could not open SSL chain file $file: $!\n"; 19 | <$fh>; 20 | }; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /root/usr/lib/systemd/system/nethserver-config-network.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Reconfigure newtork interfaces 3 | Documentation=https://github.com/NethServer/nethserver-base 4 | ConditionPathExists=!/var/spool/first-boot 5 | ConditionFileNotEmpty=/var/lib/nethserver/db/networks 6 | After=network-online.target 7 | RefuseManualStart=true 8 | RefuseManualStop=true 9 | 10 | [Service] 11 | Type=oneshot 12 | ExecStart=/sbin/e-smith/nethserver-config-network 13 | 14 | [Install] 15 | WantedBy=multi-user.target 16 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Help/en/NethServer_Module_FirstConfigWiz.rst: -------------------------------------------------------------------------------- 1 | =================== 2 | First configuration 3 | =================== 4 | 5 | At the end of the installation, the administrator should provide some 6 | configuration parameters that could not be probed automatically. 7 | 8 | At the bottom of every page the following buttons are displayed: 9 | 10 | :guilabel:`Back` 11 | Go to the previous page 12 | 13 | :guilabel:`Next` 14 | Saves the parameters and move to the next page 15 | 16 | -------------------------------------------------------------------------------- /root/usr/lib/systemd/system/nethserver-system-init.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Initialize NethServer configuration 3 | Documentation=https://github.com/nethesis/nethserver-base 4 | ConditionPathExists=/var/spool/first-boot 5 | After=network-online.target 6 | DefaultDependencies=false 7 | Conflicts=shutdown.target 8 | RefuseManualStart=true 9 | RefuseManualStop=true 10 | 11 | [Service] 12 | Type=oneshot 13 | ExecStart=/sbin/e-smith/signal-event system-init 14 | 15 | [Install] 16 | WantedBy=multi-user.target 17 | 18 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Help/en/NethServer_Module_NetworkServices.rst: -------------------------------------------------------------------------------- 1 | ================ 2 | Network services 3 | ================ 4 | 5 | The table shows all network services running locally on the server. 6 | 7 | Each service can have multiple TCP/UDP ports open. 8 | Ports are open into the firewall accordingly to the `access` property. 9 | 10 | Edit 11 | ==== 12 | 13 | Zones 14 | Select the zones from which clients are allowed to connect to the service. 15 | If none is selected, access is granted to the local host only. 16 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/NetworkAdapter/ConfirmInterfaceCreation.php: -------------------------------------------------------------------------------- 1 | header('values')->setAttribute('template', $T('Confirm_header')); 5 | echo $view->textList('actions')->setAttribute('class', 'labeled-control wspreline')->setAttribute('class', 'labeled-control HelpDocument'); 6 | 7 | echo $view->buttonList($view::BUTTON_HELP) 8 | ->insert($view->button('CreateLogicalInterface', $view::BUTTON_SUBMIT)) 9 | ->insert($view->button('Back', $view::BUTTON_CANCEL)) 10 | ; 11 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Help/en/NethServer_Module_Shutdown.rst: -------------------------------------------------------------------------------- 1 | ======== 2 | Shutdown 3 | ======== 4 | 5 | 6 | Allows you to turn off or restart the server. 7 | It's mandatory to shutdown the system before turning off the server. 8 | The execution of these functions takes a few minutes. 9 | 10 | 11 | WARNING! Clicking SHUTDOWN THE SYSTEM operation will start 12 | immediately. 13 | 14 | 15 | Restart 16 | Restart the server terminating all running processes. 17 | 18 | Power-off 19 | Turn off the server after completing all the running processes. 20 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/FirstConfigWiz/Review.php: -------------------------------------------------------------------------------- 1 | textList('changes')->setAttribute('tag', 'div/ul.disc/li'); 8 | 9 | echo "
"; 10 | echo $view->textLabel('redirect'); 11 | echo "
"; 12 | 13 | echo $view->buttonList($view::BUTTON_HELP) 14 | ->insert($view->button('Back', $view::BUTTON_CANCEL)) 15 | ->insert($view->button('Apply', $view::BUTTON_SUBMIT)) 16 | ; 17 | 18 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/NetworkAdapter/ReleasePhysicalInterface.php: -------------------------------------------------------------------------------- 1 | requireFlag($view::INSET_DIALOG); 5 | echo $view->header('device')->setAttribute('template', $T('ReleasePhysicalInterface_header')); 6 | 7 | echo $view->textLabel('message')->setAttribute('tag', 'div')->setAttribute('class', 'labeled-control wspreline'); 8 | 9 | echo $view->buttonList() 10 | ->insert($view->button('Release', $view::BUTTON_SUBMIT)) 11 | ->insert($view->button('Cancel', $view::BUTTON_CANCEL)) 12 | ; 13 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Language/en/NethServer_Module_LogViewer.php: -------------------------------------------------------------------------------- 1 | header()->setAttribute('template', $T('Pki_Title')); 4 | 5 | $view->requireFlag($view::INSET_DIALOG); 6 | 7 | echo "
".$view->translate('certificate_label').": "; 8 | echo $view->textLabel('cert'); 9 | echo "
"; 10 | echo $view->translate('default_cert_label'); 11 | 12 | echo $view->buttonList() 13 | ->insert($view->button('Confirm', $view::BUTTON_SUBMIT)) 14 | ->insert($view->button('Cancel', $view::BUTTON_CANCEL)) 15 | ; 16 | 17 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/yum/vars/nsrelease/00default: -------------------------------------------------------------------------------- 1 | { 2 | # 3 | # 00default -- version number from nethserver-release package 4 | # can be overridden to implement automatic upgrades 5 | # known implementors: nethserver-subscription 6 | # 7 | 8 | our $release = do { 9 | # Read from filesystem because the config DB can be overridden 10 | # by the "pre-restore-config" event: 11 | open my $nsh, "<", '/etc/e-smith/db/configuration/force/sysconfig/Version'; 12 | <$nsh>; 13 | }; 14 | 15 | chomp $release; 16 | 17 | ''; 18 | } -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/FirstConfigWiz/Cover.php: -------------------------------------------------------------------------------- 1 | ".$T("Welcome_title", iterator_to_array($view)).""; 7 | 8 | echo "
"; 9 | echo $T("Welcome_body"); 10 | echo "
"; 11 | 12 | echo "
"; 13 | echo $T("Welcome_next"); 14 | echo "
"; 15 | 16 | $url = $view->getModuleUrl('../Cover?skip'); 17 | echo $view->buttonList($view::BUTTON_HELP) 18 | ->insert($view->literal(''.$T('Next_label').'')) 19 | ; 20 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/Pki/GenerateLe.php: -------------------------------------------------------------------------------- 1 | header()->setAttribute('template', $T('GenerateLe_Header')); 4 | 5 | echo $view->panel() 6 | ->insert($view->textInput('LetsEncryptMail')) 7 | ->insert($view->textArea('LetsEncryptDomains', $view::LABEL_ABOVE)->setAttribute('dimensions', '5x30')); 8 | 9 | 10 | echo $view->buttonList() 11 | ->insert($view->button('GenerateLe', $view::BUTTON_SUBMIT)) 12 | ->insert($view->button('Cancel', $view::BUTTON_CANCEL)) 13 | ->insert($view->button('Help', $view::BUTTON_HELP)) 14 | ; 15 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/NetworkAdapter/CleanPhysicalInterface.php: -------------------------------------------------------------------------------- 1 | requireFlag($view::INSET_DIALOG); 5 | echo $view->header('device')->setAttribute('template', $T('CleanPhysicalInterface_header')); 6 | 7 | echo $view->textLabel('device')->setAttribute('tag', 'div')->setAttribute('class', 'labeled-control wspreline')->setAttribute('template', $T('Confirm device ${0} removal')); 8 | 9 | echo $view->buttonList() 10 | ->insert($view->button('Clean', $view::BUTTON_SUBMIT)) 11 | ->insert($view->button('Cancel', $view::BUTTON_CANCEL)) 12 | ; 13 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/NetworkServices/Modify.php: -------------------------------------------------------------------------------- 1 | header('name')->setAttribute('template', $T('Update_Service_Header')); 6 | 7 | echo $view->fieldset()->setAttribute('template', $T('configuration_label')) 8 | ->insert($view->textList('Config')); 9 | 10 | echo $view->fieldset()->setAttribute('template', $T('zones_label')) 11 | ->insert($view->selector('access', $view::SELECTOR_MULTIPLE | $view::LABEL_NONE)) 12 | ; 13 | 14 | echo $view->buttonList($view::BUTTON_SUBMIT | $view::BUTTON_CANCEL | $view::BUTTON_HELP); 15 | 16 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/yum.conf/20proxy: -------------------------------------------------------------------------------- 1 | { 2 | my $proxy_host = $proxy{host} || ''; 3 | my $proxy_port = $proxy{port} || '3128'; 4 | my $proxy_user = $proxy{user} || ''; 5 | my $proxy_pass = $proxy{password} || ''; 6 | 7 | $OUT = ''; 8 | if (! $proxy_host eq ''){ 9 | $OUT .= "#\n# 20proxy\n#\n"; 10 | $OUT .= "proxy=http://$proxy_host:$proxy_port\n"; 11 | if (! $proxy_user eq '' && ! $proxy_pass eq ''){ 12 | $OUT .= "proxy_username=$proxy_user\nproxy_password=$proxy_pass\n"; 13 | } 14 | } else { 15 | $OUT .= "#\n# 20proxy - disabled\n#\n"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/Dashboard/SystemStatus.php: -------------------------------------------------------------------------------- 1 | useFile('js/jquery.masonry.min.js'); 3 | 4 | foreach($view->getModule()->getChildren() as $child) { 5 | echo $view->inset($child->getIdentifier()); 6 | } 7 | 8 | $module1Url = json_encode($view->getModuleUrl("/AdminTodo?notifications")); 9 | 10 | $view->includeJavascript(" 11 | (function ( $ ) { 12 | 13 | function loadPage() { 14 | $.Nethgui.Server.ajaxMessage({ 15 | isMutation: false, 16 | url: $module1Url 17 | }); 18 | } 19 | 20 | $(document).ready(function() { 21 | loadPage(); 22 | }); 23 | 24 | })( jQuery); 25 | "); 26 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Test/Unit/NethServer/Tool/PasswordStashTest.php: -------------------------------------------------------------------------------- 1 | object = new \NethServer\Tool\PasswordStash; 14 | } 15 | 16 | public function testStore() 17 | { 18 | $tmpPath = sys_get_temp_dir(); 19 | $this->object->store('password'); 20 | $this->assertEquals('password', file_get_contents($this->object->getFilePath())); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/Pki/Show.php: -------------------------------------------------------------------------------- 1 | header('name')->setAttribute('template', $T('Show_header')); 4 | 5 | echo $view->textLabel('x509text')->setAttribute('class', 'labeled-control x509text ui-corner-all')->setAttribute('tag', 'div'); 6 | 7 | $view->includeCss(" 8 | .x509text { white-space: pre-wrap; padding: 4px; border: 1px solid #c2c2c2; background: #e2e2r2; color: #4b4b4b; } 9 | "); 10 | 11 | echo $view->buttonList() 12 | ->insert($view->button('Cancel', $view::BUTTON_CANCEL)) 13 | ->insert($view->button('Help', $view::BUTTON_HELP)) 14 | ->insert($view->button('SetDefault', $view::BUTTON_LINK)); -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/Services/Systemctl.php: -------------------------------------------------------------------------------- 1 | requireFlag($view::INSET_DIALOG); 3 | 4 | $action = $view->getModule()->getIdentifier(); 5 | 6 | $headerText = $T(ucfirst($action).' service `${0}`'); 7 | $panelText = $T('Proceed with `${0}` '.$action.'?'); 8 | 9 | echo $view->panel() 10 | ->insert($view->header('service')->setAttribute('template', $headerText)) 11 | ->insert($view->textLabel('service')->setAttribute('template', $panelText)) 12 | ; 13 | 14 | echo $view->buttonList() 15 | ->insert($view->button('Yes', $view::BUTTON_SUBMIT)) 16 | ->insert($view->button('No', $view::BUTTON_CANCEL)->setAttribute('value', $view['Cancel'])) 17 | ; 18 | 19 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Help/en/NethServer_Module_Organization.rst: -------------------------------------------------------------------------------- 1 | ===================== 2 | Organization contacts 3 | ===================== 4 | 5 | Values from these fields are shown on the Server Manager login screen. 6 | 7 | If the users and groups module is available, these field values are the default 8 | contact information for the system users. 9 | 10 | Company 11 | Enter the company name. 12 | 13 | City 14 | Enter the city of the company. 15 | 16 | Department 17 | Enter the department or office whose members will have access 18 | the services of the server. 19 | 20 | Phone 21 | Enter the phone number of the company. 22 | 23 | Address 24 | Enter the address of the company. 25 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/yum.conf/50disclaimer: -------------------------------------------------------------------------------- 1 | # This is the default, if you make this bigger yum won't see if the metadata 2 | # is newer on the remote and so you'll "gain" the bandwidth of not having to 3 | # download the new metadata and "pay" for it by yum not having correct 4 | # information. 5 | # It is esp. important, to have correct metadata, for distributions like 6 | # Fedora which don't keep old packages around. If you don't like this checking 7 | # interupting your command line usage, it's much better to have something 8 | # manually check the metadata once an hour (yum-updatesd will do this). 9 | # metadata_expire=90m 10 | 11 | # PUT YOUR REPOS HERE OR IN separate files named file.repo 12 | # in /etc/yum.repos.d 13 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/certificate/key/00key: -------------------------------------------------------------------------------- 1 | { 2 | # 3 | # private key expansion 4 | # 5 | 6 | $OUT = ''; 7 | my $errors = 0; 8 | 9 | foreach my $file ($pki{'KeyFile'}, '/etc/pki/tls/private/NSRV.key') { 10 | 11 | if(! $file || ! -f $file) { 12 | next; 13 | } 14 | 15 | # Perlish way to slurp a text file: 16 | $OUT = do { 17 | local $/ = undef; 18 | open my $fh, "<", $file 19 | or ++$errors; 20 | <$fh>; 21 | }; 22 | 23 | if($OUT) { 24 | last; 25 | } 26 | 27 | } 28 | 29 | if(!$OUT || $errors) { 30 | die("[ERROR] SSL private key expansion failed!\n"); 31 | } 32 | } -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/yum/yum-cron.conf/20emitters: -------------------------------------------------------------------------------- 1 | [emitters] 2 | # Name to use for this system in messages that are emitted. If 3 | # system_name is None, the hostname will be used. 4 | system_name = None 5 | 6 | # How to send messages. Valid options are stdio and email. If 7 | # emit_via includes stdio, messages will be sent to stdout; this is useful 8 | # to have cron send the messages. If emit_via includes email, this 9 | # program will send email itself according to the configured options. 10 | # If emit_via is None or left blank, no messages will be sent. 11 | emit_via = email 12 | 13 | # The width, in characters, that messages that are emitted should be 14 | # formatted to. 15 | output_width = 80 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /root/etc/profile.d/nethserver.sh: -------------------------------------------------------------------------------- 1 | # 2 | # /etc/profile.d/nethserver.sh -- Custom additions for NethServer environment 3 | # 4 | 5 | if [ "$USER" = "root" ]; then 6 | export PATH=/sbin/e-smith:$PATH 7 | fi 8 | 9 | # Feature #1224 -- Date and time in Bash history 10 | export HISTTIMEFORMAT="%Y-%m-%d %T " 11 | 12 | # 13 | # Define shortcut aliases for members of the adm group 14 | # 15 | if groups | grep -s '\badm\b' >/dev/null 2>/dev/null; then 16 | 17 | admpath=/sbin/e-smith 18 | 19 | alias db="sudo ${admpath}/db" 20 | alias config="sudo ${admpath}/config" 21 | alias signal-event="sudo ${admpath}/signal-event" 22 | alias expand-template="sudo ${admpath}/expand-template" 23 | 24 | unset admpath 25 | 26 | fi 27 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/certificate/crt/00crt: -------------------------------------------------------------------------------- 1 | { 2 | # 3 | # public certificate expansion 4 | # 5 | 6 | $OUT = ''; 7 | my $errors = 0; 8 | 9 | foreach my $file ($pki{'CrtFile'}, '/etc/pki/tls/certs/NSRV.crt') { 10 | 11 | if(! $file || ! -f $file) { 12 | next; 13 | } 14 | 15 | # Perlish way to slurp a text file: 16 | $OUT = do { 17 | local $/ = undef; 18 | open my $fh, "<", $file 19 | or ++$errors; 20 | <$fh>; 21 | }; 22 | 23 | if($OUT) { 24 | last; 25 | } 26 | 27 | } 28 | 29 | if(!$OUT || $errors) { 30 | die("[ERROR] SSL certificate expansion failed!\n"); 31 | } 32 | } -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/LocalNetwork/CreateUpdate.php: -------------------------------------------------------------------------------- 1 | getModule()->getIdentifier() == 'update') { 4 | $headerText = 'Update network `${0}`'; 5 | } else { 6 | $headerText = 'Create a new network'; 7 | } 8 | 9 | echo $view->panel() 10 | ->insert($view->header('network')->setAttribute('template', $T($headerText))) 11 | ->insert($view->textInput('network', ($view->getModule()->getIdentifier() == 'update' ? $view::STATE_READONLY : 0))) 12 | ->insert($view->textInput('Mask', ($view->getModule()->getIdentifier() == 'update' ? $view::STATE_READONLY : 0))) 13 | ->insert($view->textInput('Description')); 14 | 15 | echo $view->buttonList($view::BUTTON_SUBMIT | $view::BUTTON_CANCEL); 16 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Language/en/NethServer_Module_Dashboard_SystemStatus_Network.php: -------------------------------------------------------------------------------- 1 | header()->setAttribute('template', $T('Pki_Title')); 5 | 6 | echo $view->buttonList($view::BUTTON_HELP) 7 | ->insert( 8 | $view->buttonList()->setAttribute('class', 'Buttonset v1 inlineblock') 9 | ->insert($view->button('Upload', $view::BUTTON_LINK)->setAttribute('value', $view->getModuleUrl('../Upload'))) 10 | ->insert($view->button('Generate', $view::BUTTON_LINK)->setAttribute('value', $view->getModuleUrl('../Generate'))) 11 | ->insert($view->button('GenerateLe', $view::BUTTON_LINK)->setAttribute('value', $view->getModuleUrl('../GenerateLe'))) 12 | ); 13 | 14 | require __DIR__ . '/../../../Nethgui/Template/Table/Read.php'; 15 | 16 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/UserProfile/Personal.php: -------------------------------------------------------------------------------- 1 | header('username')->setAttribute('template', $T('UserProfile_Header')); 6 | 7 | echo $view->textInput('FullName', $view::STATE_DISABLED | $view::STATE_READONLY); 8 | 9 | if($view['username'] === 'root') { 10 | echo $view->textInput('EmailAddress'); 11 | $buttonList = $view->buttonList($view::BUTTON_SUBMIT | $view::BUTTON_HELP); 12 | $buttonList->insert($view->button('ChangePassword', $view::BUTTON_LINK)); 13 | } else { 14 | $buttonList = $view->buttonList($view::BUTTON_HELP); 15 | if (!$view['readOnly']) { 16 | $buttonList->insert($view->button('ChangePassword', $view::BUTTON_LINK)); 17 | } 18 | } 19 | echo $buttonList; 20 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/yum/yum-cron.conf/30email: -------------------------------------------------------------------------------- 1 | [email] 2 | # The address to send email messages from. 3 | # NOTE: 'localhost' will be replaced with the value of system_name. 4 | email_from = root@{$DomainName} 5 | 6 | # List of addresses to send messages to. 7 | { 8 | use Email::Valid; 9 | my @customMail; 10 | foreach my $email (split(/,/, (${'yum-cron'}{'customMail'} || ''))) { 11 | push @customMail , $email if (Email::Valid->address($email)); 12 | #sort email array 13 | %seen = (); 14 | @customMail = sort (grep { ! $seen{ $_ }++ } (@customMail)); 15 | } 16 | 17 | $OUT .= "email_to = root\@$SystemName.$DomainName " . join (' ',@customMail); 18 | } 19 | 20 | # Name of the host to connect to to send email messages. 21 | email_host = localhost 22 | 23 | 24 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Language/en/NethServer_Module_StaticRoutes.php: -------------------------------------------------------------------------------- 1 | ) { 23 | chomp $row; 24 | if ($row =~ /Slave Interface:\s+(.*)/) { 25 | if ($1 eq $eth) { 26 | $found = 1; 27 | } 28 | } 29 | if ($found && $row =~ /Permanent HW addr:\s+(.*)/) { 30 | print "$1\n"; 31 | exit 0; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Language/en/NethServer_Module_LocalNetwork.php: -------------------------------------------------------------------------------- 1 | header('')->setAttribute('template', $T('DistroUpgrade_header')); 5 | 6 | echo sprintf('

%s

', htmlspecialchars($T('DistroUpgradeAvailable_message1', $view['DistroUpgradeParams']))); 7 | echo sprintf('

%s

', htmlspecialchars($T('DistroUpgradeAvailable_message2', $view['DistroUpgradeParams']))); 8 | 9 | echo $view->buttonList($view::BUTTON_HELP) 10 | ->insert($view->button('UpgradeLater', $view::BUTTON_LINK)) 11 | ->insert($view->button('DistroUpgrade', $view::BUTTON_SUBMIT)) 12 | ; 13 | 14 | $view->includeCss(' 15 | #PackageManager_DistroUpgrade .information { 16 | font-size: 1.2em; 17 | max-width: 505px; 18 | margin-bottom: 1em; 19 | } 20 | '); -------------------------------------------------------------------------------- /root/etc/e-smith/db/networks/migrate/trafficshaping.el7: -------------------------------------------------------------------------------- 1 | { 2 | # 3 | # 4 | 5 | use esmith::NetworksDB; 6 | use esmith::DB::db; 7 | 8 | my $ndb = esmith::NetworksDB->open() || return ''; 9 | my $tdb = esmith::DB::db->open('tc') || return ''; 10 | 11 | foreach ($ndb->red()) { 12 | # skip if FwInBandwidth and FwOutBandwidth are already configured 13 | if ($_->prop('FwInBandwidth') && $_->prop('FwOutBandwidth')) 14 | { 15 | next; 16 | } 17 | my $interface = $_->key; 18 | my $tmp = $tdb->get($interface) || next; 19 | my $in = $tdb->get_prop_and_delete($interface, 'In') || ''; 20 | my $out = $tdb->get_prop_and_delete($interface, 'Out') || ''; 21 | $ndb->set_prop($interface,'FwInBandwidth', $in); 22 | $ndb->set_prop($interface,'FwOutBandwidth', $out); 23 | $tmp->delete(); 24 | } 25 | 26 | ''; 27 | } 28 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/Applications.php: -------------------------------------------------------------------------------- 1 | getModule()->getChildren() as $child) { 4 | $info = $child->getInfo(); 5 | echo "
"; 6 | echo "

".$child->getName()."

"; 7 | echo "
"; 8 | echo "
"; 9 | echo ''; 10 | echo "
"; 11 | echo "
"; 12 | 13 | } 14 | if (count($view->getModule()->getChildren()) == 0) { 15 | echo "

".$T('no_application_installed')."

"; 16 | } 17 | echo "
"; 18 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/StaticRoutes/Modify.php: -------------------------------------------------------------------------------- 1 | getModule()->getIdentifier() == 'update') { 4 | $headerText = 'Update static route `${0}`'; 5 | } else { 6 | $headerText = 'Create a new static route'; 7 | } 8 | 9 | echo $view->panel() 10 | ->insert($view->header('network')->setAttribute('template', $T($headerText))) 11 | ->insert($view->textInput('network', ($view->getModule()->getIdentifier() == 'update' ? $view::STATE_READONLY : 0))) 12 | ->insert($view->textInput('Router')) 13 | ->insert($view->selector('Device', $view::SELECTOR_DROPDOWN)) 14 | ->insert($view->textInput('Description')); 15 | 16 | echo $view->fieldset('')->setAttribute('template', $T('Advanced_label')) 17 | ->insert($view->textInput('Metric')); 18 | 19 | echo $view->buttonList($view::BUTTON_SUBMIT | $view::BUTTON_HELP | $view::BUTTON_CANCEL); 20 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Help/en/NethServer_Module_LocalNetwork.rst: -------------------------------------------------------------------------------- 1 | ================= 2 | Trusted networks 3 | ================= 4 | 5 | For security reasons, some server services are available 6 | only on the local network. Any private networks (eg. networks 7 | connected in VPN) can have the same privileges as the local network 8 | if configured in this panel. 9 | 10 | If the network can be reached only using a router, make sure 11 | to create a static route for the network itself 12 | inside the :guilabel:`Static routes` panel. 13 | 14 | Create / Modify 15 | =============== 16 | 17 | Create a new trusted network: hosts on this 18 | network will be able to access services of the server. 19 | 20 | Network address 21 | Network address for the new route. 22 | 23 | Network Mask 24 | Network mask for the new route. 25 | 26 | Description 27 | A free text field to record any annotation. 28 | 29 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/hostname-set: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2017 Nethesis S.r.l. 4 | # http://www.nethesis.it - nethserver@nethesis.it 5 | # 6 | # This script is part of NethServer. 7 | # 8 | # NethServer is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, 11 | # or any later version. 12 | # 13 | # NethServer is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with NethServer. If not, see COPYING. 20 | # 21 | 22 | /bin/hostnamectl set-hostname $(/bin/cat /etc/hostname) 23 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/nethserver-base-interface-update: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2014 Nethesis S.r.l. 5 | # http://www.nethesis.it - support@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see . 21 | # 22 | 23 | exec /sbin/e-smith/signal-event interface-update 24 | -------------------------------------------------------------------------------- /root/etc/sudoers.d/20_nethserver_base: -------------------------------------------------------------------------------- 1 | # 2 | # 20_nethserver_base 3 | # 4 | %adm ALL=NOPASSWD: /sbin/e-smith/db, \ 5 | /sbin/e-smith/signal-event, \ 6 | /sbin/e-smith/validate, \ 7 | /sbin/e-smith/pam-authenticate-pw, \ 8 | /sbin/e-smith/logviewer, \ 9 | /usr/libexec/nethserver/pkgaction, \ 10 | /usr/libexec/nethserver/pkginfo, \ 11 | /usr/libexec/nethserver/read-service-status, \ 12 | /usr/libexec/nethserver/pki-info, \ 13 | /usr/libexec/nethserver/sigev-batch, \ 14 | /usr/libexec/nethserver/admin-todos, \ 15 | /usr/libexec/nethserver/nic-info, \ 16 | /usr/libexec/nethserver/control-service, \ 17 | /usr/libexec/nethserver/cert-list, \ 18 | /usr/libexec/nethserver/letsencrypt-certs, \ 19 | /usr/bin/yum clean all, \ 20 | /sbin/service [a-zA-Z0-9_-]* status, \ 21 | /etc/e-smith/events/actions/nethserver-generate-certificate, \ 22 | /usr/libexec/nethserver/yum-packages-to-remove 23 | 24 | 25 | -------------------------------------------------------------------------------- /root/etc/e-smith/validators/actions/hostname-localhost: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2018 Nethesis S.r.l. 5 | # http://www.nethesis.it - nethserver@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see COPYING. 21 | # 22 | 23 | echo $1 | grep -qi "localhost" 24 | 25 | if [ $? -eq 0 ]; then 26 | exit 1 27 | else 28 | exit 0 29 | fi 30 | -------------------------------------------------------------------------------- /root/usr/libexec/nethserver/trusted-networks: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # 4 | # Copyright (C) 2015 Nethesis S.r.l. 5 | # http://www.nethesis.it - nethserver@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see COPYING. 21 | # 22 | 23 | use strict; 24 | use NethServer::TrustedNetworks; 25 | use JSON; 26 | 27 | print JSON::encode_json([NethServer::TrustedNetworks::list_full()]); 28 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/Dashboard/Applications.php: -------------------------------------------------------------------------------- 1 | includeCSS(" 3 | div.app-item { 4 | margin: 5px; 5 | padding: 5px; 6 | border: 1px solid #ccc; 7 | width: auto; 8 | } 9 | 10 | .app-item dt { 11 | float: left; 12 | clear: left; 13 | width: 100px; 14 | text-align: right; 15 | font-weight: bold; 16 | } 17 | .app-item dt:after { 18 | content: \":\"; 19 | } 20 | .app-item dd { 21 | margin: 0 0 0 110px; 22 | padding: 0 0 0.5em 0; 23 | } 24 | "); 25 | 26 | 27 | foreach($view->getModule()->getChildren() as $child) { 28 | echo "
"; 29 | echo $view->header()->setAttribute('template',$child->getName()); 30 | foreach($child->getInfo() as $k=>$v) { 31 | echo "
".$T($k)."
"; 32 | if(strpos($k,'url') === 0) { 33 | echo "
".$child->getName()."
"; 34 | } else { 35 | echo "
$v
"; 36 | } 37 | } 38 | echo "
"; 39 | } 40 | -------------------------------------------------------------------------------- /root/etc/e-smith/validators/actions/rsa-key: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2018 Nethesis S.r.l. 5 | # http://www.nethesis.it - nethserver@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see COPYING. 21 | # 22 | 23 | FILE=$1 24 | 25 | openssl rsa -in $FILE -text -noout &>/dev/null 26 | if [[ $? != 0 ]]; then 27 | openssl ec -in $FILE -noout &>/dev/null 28 | if [[ $? != 0 ]]; then 29 | exit 1 30 | fi 31 | fi -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/system-shutdown: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2016 Nethesis S.r.l. 5 | # http://www.nethesis.it - nethserver@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see COPYING. 21 | # 22 | 23 | event=$1 24 | action=$2 25 | 26 | if [[ "${action}" == "poweroff" ]]; then 27 | systemctl poweroff 28 | elif [[ "${action}" == "reboot" ]]; then 29 | systemctl reboot 30 | else 31 | exit 1 32 | fi 33 | 34 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/password-cleanup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2012 Nethesis S.r.l. 5 | # http://www.nethesis.it - support@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see . 21 | # 22 | 23 | if [ $# -ge 3 ]; then 24 | EVENT=$1 25 | USER=$2 26 | FILE=$3 27 | /usr/bin/shred -u $FILE 2> /dev/null 28 | else 29 | echo "Not enough arguments" 30 | exit 1 31 | fi 32 | 33 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Module/Login.php: -------------------------------------------------------------------------------- 1 | header()->setAttribute('template', $T('Configuration_header')); 5 | 6 | echo $view->fieldset('')->setAttribute('template', $T('YumCron_label')) 7 | ->insert($view->fieldsetSwitch('download', 'yes', $view::FIELDSETSWITCH_CHECKBOX | $view::FIELDSETSWITCH_EXPANDABLE)->setAttribute('uncheckedValue', 'no') 8 | ->insert($view->checkBox('applyUpdate', 'yes')->setAttribute('uncheckedValue', 'no'))) 9 | ->insert($view->fieldsetSwitch('messages', 'yes', $view::FIELDSETSWITCH_CHECKBOX | $view::FIELDSETSWITCH_EXPANDABLE)->setAttribute('uncheckedValue', 'no') 10 | ->insert($view->textArea('customMail', $view::LABEL_ABOVE)->setAttribute('dimensions', '5x30'))) 11 | ; 12 | 13 | echo $view->buttonList($view::BUTTON_HELP) 14 | ->insert($view->button('BackToModules', $view::BUTTON_LINK)) 15 | ->insert($view->button('Save', $view::BUTTON_SUBMIT)) 16 | ; 17 | 18 | $view->includeCss(' 19 | .policy-description { 20 | max-width: 40em; 21 | } 22 | '); -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Help/en/NethServer_Module_LogViewer.rst: -------------------------------------------------------------------------------- 1 | ======== 2 | View log 3 | ======== 4 | 5 | Find and display the contents of log files. 6 | 7 | Find in log files 8 | ================= 9 | 10 | Allow you to browse all the server log files and do 11 | full searches into them. 12 | 13 | Find 14 | Allow you to search for words and phrases within all 15 | server logs. 16 | 17 | You can go directly to each log through the links 18 | listed on the page. 19 | 20 | Show single log 21 | =============== 22 | 23 | Allow you to browse the contents of the selected log and 24 | follow the text flow in real time. 25 | 26 | Close 27 | Close the selected log window and return to 28 | the main page. 29 | 30 | Empty 31 | It allows you to empty the contents of the log window. The data 32 | are removed only from the display window, no 33 | changes are made to contents of the log. 34 | 35 | Follow 36 | Update in real time the display window with the new 37 | information that are written into the log. 38 | 39 | Stop 40 | Stops updating the real-time log visualization. 41 | 42 | -------------------------------------------------------------------------------- /root/etc/e-smith/validators/actions/tlspolicy-ecdsa-cert: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2018 Nethesis S.r.l. 5 | # http://www.nethesis.it - nethserver@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see COPYING. 21 | # 22 | 23 | privkey=$1 24 | tlspolicy=$2 25 | 26 | openssl ec -in "${privkey}" -noout &>/dev/null 27 | if [[ $? == 0 ]]; then 28 | if [[ -z ${tlspolicy} ]] || (( ${tlspolicy} >= 20180621 )); then 29 | exit 0 30 | else 31 | exit 3 32 | fi 33 | fi 34 | 35 | exit 0 36 | -------------------------------------------------------------------------------- /root/etc/e-smith/validators/actions/logfile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # 4 | # Copyright (C) 2013 Nethesis S.r.l. 5 | # http://www.nethesis.it - support@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see . 21 | # 22 | 23 | use strict; 24 | 25 | my $fileName = shift; 26 | 27 | # Read the list of valid log file names: 28 | my @logs = split("\n", `/sbin/e-smith/logviewer -l`); 29 | 30 | if( ! grep { $_ eq $fileName } @logs) { 31 | # Forbidden access 32 | exit 3; 33 | } 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /root/usr/libexec/nethserver/sigev-batch: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | # 4 | # Copyright (C) 2014 Nethesis S.r.l. 5 | # http://www.nethesis.it - support@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see . 21 | # 22 | 23 | spoolfile=$1 24 | 25 | if [ ! -r "${spoolfile}" ]; then 26 | echo $(basename $0) "[ERROR] missing file argument!"; 27 | exit 1; 28 | fi 29 | 30 | exec <${spoolfile} 31 | 32 | declare -a argv 33 | 34 | while read -a argv; do 35 | /sbin/e-smith/signal-event ${argv[*]} 36 | done 37 | 38 | rm -f ${spoolfile} 39 | -------------------------------------------------------------------------------- /root/etc/e-smith/validators/actions/hostname-length: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2016 Nethesis S.r.l. 5 | # http://www.nethesis.it - nethserver@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see COPYING. 21 | # 22 | 23 | H=$(echo "$1" | cut -d. -f1) 24 | 25 | # NetBIOS length limit for hostname H 26 | if (( ${#H} > 15 || ${#H} == 0 )); then 27 | exit 3 28 | fi 29 | 30 | # Check it is composed by "letters, digits, hyphens, and periods": 31 | if [[ -n "$(tr -d '[:alnum:].-' <<< ${H})" ]]; then 32 | exit 4 33 | fi 34 | 35 | exit 0 36 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/nethserver-base-fixrepos: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2019 Nethesis S.r.l. 5 | # http://www.nethesis.it - nethserver@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see COPYING. 21 | # 22 | 23 | ns_release_lock="$(/sbin/e-smith/config getprop sysconfig NsReleaseLock)" 24 | 25 | if [[ -z ${ns_release_lock} ]]; then 26 | exit 0 27 | fi 28 | 29 | echo '[NOTICE] applying new YUM repository configuration' 30 | /sbin/e-smith/config delprop sysconfig NsReleaseLock 31 | exec /sbin/e-smith/signal-event software-repos-save 32 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/logrotate.conf/10base: -------------------------------------------------------------------------------- 1 | # see "man logrotate" for details 2 | { 3 | my $rotate = $logrotate{'Rotate'} || 'weekly'; 4 | $OUT.="$rotate\n"; 5 | } 6 | 7 | # keep 4 times worth of backlogs 8 | { 9 | my $times = $logrotate{'Times'} || '4'; 10 | $OUT.="rotate $times\n"; 11 | } 12 | 13 | # create new (empty) log files after rotating old ones 14 | create 15 | 16 | # use date as a suffix of the rotated file 17 | dateext 18 | 19 | # uncomment this if you want your log files compressed 20 | { 21 | my $compress = $logrotate{'Compression'} || 'disabled'; 22 | if ($compress eq 'enabled') { 23 | $OUT.="compress\n"; 24 | } else { 25 | $OUT.="#compress\n"; 26 | } 27 | } 28 | 29 | # RPM packages drop log rotation information into this directory 30 | include /etc/logrotate.d 31 | 32 | # no packages own wtmp and btmp -- we'll rotate them here 33 | /var/log/wtmp \{ 34 | monthly 35 | create 0664 root utmp 36 | minsize 1M 37 | rotate 1 38 | \} 39 | 40 | /var/log/btmp \{ 41 | missingok 42 | monthly 43 | create 0600 root utmp 44 | rotate 1 45 | \} 46 | 47 | # system-specific logs may be also be configured here. 48 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/nethserver-generate-certificate: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2014 Nethesis S.r.l. 5 | # http://www.nethesis.it - support@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see . 21 | # 22 | 23 | 24 | CrtFile_default='/etc/pki/tls/certs/NSRV.crt' 25 | KeyFile_default='/etc/pki/tls/private/NSRV.key' 26 | 27 | if ! [ -f ${KeyFile_default} ]; then 28 | /usr/libexec/nethserver/pki-genkey || exit 3 29 | fi 30 | 31 | /usr/libexec/nethserver/pki-gencrt -f ${CrtFile_default} 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/PackageManager/Packages.php: -------------------------------------------------------------------------------- 1 | rejectFlag($view::INSET_FORM); 4 | // $view->requireFlag($view::INSET_DIALOG); 5 | 6 | echo $view->header()->setAttribute('template', $T('Packages_header')); 7 | 8 | ?> 9 | 10 | 11 | 12 | objectsCollection('packages') 15 | ->setAttribute('tag', 'tbody') 16 | ->setAttribute('template', 'NethServer\Template\PackageManager\PackagesElement') 17 | ->setAttribute('key', 'name'); 18 | 19 | $packagesTarget = $view->getClientEventTarget('packages'); 20 | 21 | $view->includeCss(" 22 | table.SmallTable {width: auto; font-size: 12px} 23 | .SmallTable td {padding: 0 1ex 4px 0} 24 | .SmallTable th {text-align: left; padding: 0 1ex 4px 0} 25 | "); 26 | ?>
buttonList($view::BUTTON_HELP) 30 | ->insert($view->button('Back', $view::BUTTON_CANCEL)) 31 | ; 32 | 33 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Language/en/NethServer_Module_NetworkServices.php: -------------------------------------------------------------------------------- 1 | /etc/yum/vars/nsrelease 29 | yum update -y \* @nethserver-iso | /usr/libexec/nethserver/ptrack-yum-update 30 | if [[ ${PIPESTATUS[0]} != 0 ]]; then 31 | echo "[ERROR] yum update failed" 1>&2 32 | exit 1 33 | fi 34 | 35 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Language/en/NethServer_Module_FQDN.php: -------------------------------------------------------------------------------- 1 | . 21 | # 22 | 23 | import sys 24 | sys.path.append('/usr/lib/yum-plugins') 25 | 26 | import nethserver_events 27 | 28 | events = nethserver_events.filter_update_events(nethserver_events.read_package_list()) 29 | 30 | events.append('firewall-adjust') 31 | events.append('runlevel-adjust') 32 | 33 | success = nethserver_events.run_events(events) 34 | 35 | sys.exit(0 if success else 1) 36 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Help/en/NethServer_Module_StaticRoutes.rst: -------------------------------------------------------------------------------- 1 | ============== 2 | Static routes 3 | ============== 4 | 5 | This page can be used to configure static routes for the network traffic. 6 | For example, static routes can be used 7 | to reach private networks connected via dedicated lines. 8 | 9 | Remember to add the same network to the :guilabel:`Trusted networks` panel, 10 | if hosts on the remote network should access local services. 11 | 12 | Create / Modify 13 | =============== 14 | 15 | Create a new route to a remote network. 16 | 17 | Network address 18 | Destination network in CIDR format or with the special value *default*. 19 | If *default* is used, the route will create a default gateway rule for the given interface. 20 | Please note that the gateway specified inside the green interface has precedence. 21 | 22 | Router address 23 | Address of the gateway used to reach the specified network, 24 | this field is required. 25 | 26 | Device 27 | If needed, select a device to force the traffic into chosen network interface. 28 | 29 | Metric 30 | Metric is used to determine whether one route should be chosen over another. 31 | 32 | Description 33 | A free text field to record any annotation. 34 | 35 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/adjust-fixnetwork-flag: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2017 Nethesis S.r.l. 5 | # http://www.nethesis.it - nethserver@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see COPYING. 21 | # 22 | 23 | flag=/var/run/.nethserver-fixnetwork 24 | output=$(/usr/libexec/nethserver/eth-unmapped) 25 | 26 | if [[ $output == "[]" ]]; then 27 | if [[ -f $flag ]]; then 28 | rm -f $flag 29 | echo "[NOTICE] network configuration seems good flag $flag cleared!" 30 | fi 31 | elif [[ ! -f $flag ]]; then 32 | touch $flag 33 | echo "[WARNING] bad network configuration detected flag $flag set!" 34 | fi 35 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/firewall-adjust: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # 4 | # Copyright (C) 2012 Nethesis S.r.l. 5 | # http://www.nethesis.it - support@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see . 21 | # 22 | 23 | use strict; 24 | use esmith::ConfigDB; 25 | use esmith::event; 26 | 27 | my $event = shift || die("Missing event argument!"); 28 | my $fevent = "nethserver-firewall-base-save"; 29 | 30 | if ( -e "/etc/e-smith/events/".$fevent) { 31 | $fevent = "nethserver-firewall-base-save"; 32 | 33 | if( ! esmith::event::event_signal($fevent, $event)) { 34 | exit(1); 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/nethserver-base-software-repos: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2018 Nethesis S.r.l. 5 | # http://www.nethesis.it - nethserver@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see COPYING. 21 | # 22 | 23 | event=$1 24 | eorepo_cfg=/etc/nethserver/eorepo.conf 25 | 26 | if [[ -r ${eorepo_cfg} ]]; then 27 | repositories=($(grep -v -e '^#' -e '^$' ${eorepo_cfg})) 28 | fi 29 | 30 | if [[ ${#repositories[@]} -gt 0 ]]; then 31 | echo "[NOTICE] eorepo ${repositories[*]}" 32 | /sbin/e-smith/eorepo ${repositories[*]} 33 | yum --setopt=exit_on_lock=1 clean all && rm -rf /var/cache/yum/* 34 | fi 35 | 36 | exit 0 37 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/NetworkAdapter/SetPppoeParameters.php: -------------------------------------------------------------------------------- 1 | header()->setAttribute('template', $T('SetPppoeParameters_header')); 5 | 6 | echo $view->selector('PppoeInterface', $view::SELECTOR_DROPDOWN )->setAttribute('choices', 'PppoeInterfaceDatasource'); 7 | echo $view->textInput('PppoeProvider'); 8 | echo $view->textInput('PppoeUser'); 9 | echo $view->textInput('PppoePassword', $view::TEXTINPUT_PASSWORD); 10 | echo $view->selector('PppoeAuthType', $view::SELECTOR_DROPDOWN)->setAttribute('choices', \Nethgui\Widget\XhtmlWidget::hashToDatasource(array('auto' => $T('AuthType_auto'), 'pap' => $T('AuthType_pap'), 'chap' => $T('AuthType_chap')))); 11 | 12 | echo $view->fieldset()->setAttribute('template', $T('multiwan_label')) 13 | ->insert($view->textInput('ProviderName')) 14 | ->insert($view->textInput('Weight')) 15 | ; 16 | 17 | echo $view->fieldset()->setAttribute('template', $T('trafficshaping_label')) 18 | ->insert($view->textInput('FwInBandwidth')) 19 | ->insert($view->textInput('FwOutBandwidth')); 20 | 21 | echo $view->buttonList($view::BUTTON_HELP) 22 | ->insert($view->button('Submit', $view::BUTTON_SUBMIT)) 23 | ->insert($view->button('Back', $view::BUTTON_CANCEL)) 24 | ; 25 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Tool/WikiText.php: -------------------------------------------------------------------------------- 1 | . 21 | */ 22 | 23 | /** 24 | * The Textile class wrapper 25 | * 26 | * @author Davide Principi 27 | * @since 1.0 28 | */ 29 | class WikiText 30 | { 31 | public function __construct() 32 | { 33 | require_once 'php-markdown/markdown.php'; 34 | } 35 | 36 | public function convert($text) 37 | { 38 | return \Markdown($text); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /root/usr/libexec/nethserver/pki-genkey: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2013 Nethesis S.r.l. 5 | # http://www.nethesis.it - support@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see . 21 | # 22 | 23 | DEFAULT_KEY="/etc/pki/tls/private/NSRV.key" 24 | PRIVATE_KEY=${1:-$DEFAULT_KEY} 25 | 26 | if [ -f ${PRIVATE_KEY} ]; then 27 | # Fail, refusing to overwrite existing PRIVATE_KEY file. 28 | echo "$0: file ${PRIVATE_KEY} exists!" 1>&2 29 | exit 1 30 | fi 31 | 32 | # Generate a private RSA key 33 | umask 077 34 | /usr/bin/openssl genpkey -out "${PRIVATE_KEY}" -algorithm RSA -pkeyopt rsa_keygen_bits:2048 &>/dev/null 35 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Module/UserDashboard/UserProfileRedirect.php: -------------------------------------------------------------------------------- 1 | . 21 | */ 22 | 23 | /** 24 | * Redirect to UserProfile module 25 | * 26 | * @author Davide Principi 27 | * @since 1.0 28 | */ 29 | class UserProfileRedirect extends \Nethgui\Controller\AbstractController 30 | { 31 | public function prepareView(\Nethgui\View\ViewInterface $view) 32 | { 33 | $view->getCommandList()->sendQuery($view->getModuleUrl('/UserProfile')); 34 | } 35 | } -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/Pki/Generate.php: -------------------------------------------------------------------------------- 1 | header()->setAttribute('template', $T('Generate_Header')); 4 | 5 | echo $view->fieldset() 6 | ->insert($view->textInput('C')->setAttribute('placeholder', $view['C_default'])) 7 | ->insert($view->textInput('ST')->setAttribute('placeholder', $view['ST_default'])) 8 | ->insert($view->textInput('L')->setAttribute('placeholder', $view['L_default'])) 9 | ->insert($view->textInput('O')->setAttribute('placeholder', $view['O_default'])) 10 | ->insert($view->textInput('OU')->setAttribute('placeholder', $view['OU_default'])) 11 | ->insert($view->textInput('CN')->setAttribute('placeholder', $view['CN_default'])) 12 | ->insert($view->textInput('EmailAddress')->setAttribute('placeholder', $view['EmailAddress_default'])) 13 | ->insert($view->textArea('SubjectAltName', $view::LABEL_ABOVE)->setAttribute('dimensions', '5x30')->setAttribute('placeholder', $view['SubjectAltName_default'])) 14 | ; 15 | 16 | echo $view->fieldset() 17 | ->insert($view->textInput('CertificateDuration')) 18 | ; 19 | 20 | echo $view->buttonList() 21 | ->insert($view->button('Generate', $view::BUTTON_SUBMIT)) 22 | ->insert($view->button('Cancel', $view::BUTTON_CANCEL)) 23 | ->insert($view->button('Help', $view::BUTTON_HELP)) 24 | ; 25 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/network-route-up: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # 4 | # network-route-up -- call ifup-route on all interfaces 5 | # 6 | 7 | # 8 | # Copyright (C) 2013 Nethesis S.r.l. 9 | # http://www.nethesis.it - support@nethesis.it 10 | # 11 | # This script is part of NethServer. 12 | # 13 | # NethServer is free software: you can redistribute it and/or modify 14 | # it under the terms of the GNU General Public License as published by 15 | # the Free Software Foundation, either version 3 of the License, 16 | # or any later version. 17 | # 18 | # NethServer is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | # GNU General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU General Public License 24 | # along with NethServer. If not, see . 25 | # 26 | 27 | 28 | use esmith::NetworksDB; 29 | use strict; 30 | 31 | my $idb = esmith::NetworksDB->open_ro(); 32 | my @interfaces = $idb->interfaces; 33 | 34 | foreach my $i (@interfaces) { 35 | my $if = $i->key; 36 | my %props = $i->props; 37 | my $role = $props{'role'} || ''; 38 | next unless ($role ne ''); 39 | 40 | system("/etc/sysconfig/network-scripts/ifup-routes $if &>/dev/null"); 41 | } 42 | 43 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/network-stop: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # 4 | # Copyright (C) 2012 Nethesis S.r.l. 5 | # http://www.nethesis.it - support@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see . 21 | # 22 | 23 | use esmith::NetworksDB; 24 | use strict; 25 | 26 | system(qw(systemctl stop network)); 27 | 28 | # Query the currently active interfaces: 29 | foreach (split(/\n/, `ip -o link`)) { 30 | my ($id, $name, $details) = split(/:/, $_); 31 | next if ($name =~ "lo"); 32 | 33 | # Ensure all ethernets are down: 34 | my $output = `ip link set $name down 2>&1`; 35 | if ( $? != 0 ) { 36 | warn "Could not bring down " . $name . ": " . $output . "\n"; 37 | } 38 | } 39 | 40 | exit 0; 41 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Language/en/NethServer_Module_Dashboard_SystemStatus_Resources.php: -------------------------------------------------------------------------------- 1 | requireFlag($view::FORM_ENC_MULTIPART); 4 | 5 | echo $view->header()->setAttribute('template', $T('Upload_Header')); 6 | 7 | $idCrt = $view->getUniqueId('crt'); 8 | $idKey = $view->getUniqueId('key'); 9 | $idChain = $view->getUniqueId('chain'); 10 | 11 | echo $view->fileUpload('UploadCrt')->setAttribute('htmlName', 'crt'); 12 | echo $view->fileUpload('UploadKey')->setAttribute('htmlName', 'key'); 13 | echo $view->fileUpload('UploadChain')->setAttribute('htmlName', 'chain'); 14 | echo $view->textInput('UploadName'); 15 | 16 | echo $view->buttonList() 17 | ->insert($view->button('Upload', $view::BUTTON_SUBMIT)) 18 | ->insert($view->button('Cancel', $view::BUTTON_CANCEL)) 19 | ->insert($view->button('Help', $view::BUTTON_HELP)) 20 | ; 21 | 22 | $idView = $view->getUniqueId(); 23 | $idUploadName = $view->getUniqueId('UploadName'); 24 | 25 | $view->includeJavascript(" 26 | (function ( $ ) { 27 | var formTag = $('#{$idView} form'); 28 | var uploadNameInput = $('#{$idUploadName}'); 29 | $('#{$idCrt}').on('change', function (e) { 30 | if( ! uploadNameInput.val()) { 31 | var name = (new FormData(formTag[0])).get('crt').name; 32 | uploadNameInput.val(name.replace(/\..*\$/, '')); 33 | } 34 | }); 35 | } ( jQuery )); 36 | "); 37 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Module/UserProfile.php: -------------------------------------------------------------------------------- 1 | . 22 | */ 23 | 24 | /** 25 | * Change current logged in user settings 26 | * 27 | * @author Davide Principi 28 | * @since 1.0 29 | */ 30 | class UserProfile extends \Nethgui\Controller\CompositeController 31 | { 32 | 33 | public function initialize() 34 | { 35 | parent::initialize(); 36 | $this->addChild(new \NethServer\Module\UserProfile\Personal()); 37 | $this->addChild(new \NethServer\Module\UserProfile\ChangePassword()); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/nethserver-base-conf: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # 4 | # Copyright (C) 2012 Nethesis S.r.l. 5 | # http://www.nethesis.it - support@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see . 21 | # 22 | 23 | use strict; 24 | 25 | # 26 | # Import distribution GPG keys into RPM database -- Refs #1597 27 | # 28 | foreach (qw( 29 | RPM-GPG-KEY-CentOS-6 30 | RPM-GPG-KEY-NethServer-6 31 | )) { 32 | my $keyFile = '/etc/pki/rpm-gpg/' . $_; 33 | if ( -f $keyFile ) { 34 | if( system('/bin/rpm', '--import', $keyFile) != 0) { 35 | warn "[WARNING] Failed to import RPM GPG key $keyFile."; 36 | } 37 | } 38 | } 39 | 40 | # 41 | # Always use nmap-netcat 42 | # 43 | system("/usr/sbin/alternatives --set nmap /usr/bin/ncat") 44 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/NetworkAdapter/DeleteLogicalInterface.php: -------------------------------------------------------------------------------- 1 | requireFlag($view::INSET_DIALOG); 5 | echo $view->header('device')->setAttribute('template', $T('DeleteLogicalInterface_header')); 6 | 7 | echo $view->textLabel('message')->setAttribute('tag', 'div')->setAttribute('class', 'labeled-control wspreline'); 8 | echo $view->selector('successor', $view::SELECTOR_DROPDOWN); 9 | 10 | echo $view->buttonList() 11 | ->insert($view->button('DeleteLogicalInterface', $view::BUTTON_SUBMIT)) 12 | ->insert($view->button('Cancel', $view::BUTTON_CANCEL)) 13 | ; 14 | 15 | $successorId = $view->getClientEventTarget('successor'); 16 | 17 | $view->includeJavascript(" 18 | (function ( $ ) { 19 | // Hide successor selector if non is available 20 | var updateFormState = function () { 21 | var action = 'hide'; 22 | $('.${successorId}').children().each(function (index, option) { 23 | if($(option).attr('value') != '') { 24 | action = 'show'; 25 | return false; 26 | } 27 | }); 28 | $('.${successorId}').parent()[action](); 29 | }; 30 | 31 | // bind the updateFormState method: 32 | $('.${successorId}').on('nethguicreate', function() { 33 | $('.${successorId}').on('nethguiupdateview', updateFormState); 34 | }); 35 | } ( jQuery )); 36 | "); 37 | 38 | -------------------------------------------------------------------------------- /root/usr/libexec/nethserver/control-service: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2016 Nethesis S.r.l. 5 | # http://www.nethesis.it - support@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see . 21 | # 22 | 23 | service=$1 24 | action=$2 25 | 26 | exists=`/sbin/e-smith/config getprop $service status 2>/dev/null` 27 | 28 | if [ "x" = "x$exists" ]; then 29 | echo "Invalid service: $service" 30 | exit 1 31 | fi 32 | 33 | if [ "x" = "x$action" ]; then 34 | echo "Invalid action: $action" 35 | exit 1 36 | fi 37 | 38 | if [ "$action" != "start" ] && [ "$action" != "stop" ] && [ "$action" != "restart" ]; then 39 | echo "Invalid action: $action" 40 | exit 1 41 | fi 42 | 43 | logger -t control-service "$service $action" 44 | systemctl $action $service 45 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/password-set: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2012 Nethesis S.r.l. 5 | # http://www.nethesis.it - support@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see . 21 | # 22 | 23 | if ! [ $# -ge 3 ]; then 24 | echo "[ERROR] Not enough arguments." 25 | exit 2 26 | fi 27 | 28 | EVENT=$1 29 | USER=$2 30 | FILE=$3 31 | 32 | # Check if the user is inside the passwd 33 | /usr/bin/grep -q "^$USER:" /etc/passwd 34 | 35 | if [[ $? -gt 0 ]]; then 36 | # Skipping user if it belongs to a domain 37 | exit 0 38 | fi 39 | 40 | if ! [ -f "${FILE}" ]; then 41 | echo "[ERROR] Password file not found" 42 | exit 1 43 | fi 44 | 45 | PASSWORD="$(<$FILE)" 46 | /usr/bin/passwd --stdin "$USER" <header()->setAttribute('template', $T('CreateLogicalInterface_header')); 5 | 6 | 7 | echo $view->selector('role', $view::SELECTOR_DROPDOWN); 8 | 9 | $types = $view 10 | //->panel() 11 | ->fieldset()->setAttribute('template', $T('InterfaceType_label')) 12 | ->insert($view->fieldsetSwitch('type', 'bond', $view::FIELDSETSWITCH_EXPANDABLE) 13 | ->insert($view->selector('bond', $view::SELECTOR_MULTIPLE | $view::LABEL_NONE)) 14 | ->insert($view->selector('bondMode', $view::SELECTOR_DROPDOWN)) 15 | ) 16 | ->insert($view->fieldsetSwitch('type', 'bridge', $view::FIELDSETSWITCH_EXPANDABLE) 17 | ->insert($view->selector('bridge', $view::SELECTOR_MULTIPLE | $view::LABEL_NONE)) 18 | ) 19 | ->insert($view->fieldsetSwitch('type', 'vlan', $view::FIELDSETSWITCH_EXPANDABLE) 20 | ->insert($view->textInput('vlanTag')) 21 | ->insert($view->selector('vlan', $view::SELECTOR_DROPDOWN)) 22 | ) 23 | ; 24 | 25 | if(in_array('red', $view->getModule()->getParent()->getInterfaceRoles())) { 26 | $types->insert($view->radioButton('type', 'xdsl')); 27 | } 28 | 29 | echo $types; 30 | 31 | echo $view->buttonList($view::BUTTON_HELP) 32 | ->insert($view->button('Next', $view::BUTTON_SUBMIT)) 33 | ->insert($view->button('Back', $view::BUTTON_CANCEL)) 34 | ; 35 | -------------------------------------------------------------------------------- /locale/nethserver-base.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # This file is put in the public domain. 3 | # FIRST AUTHOR , YEAR. 4 | # 5 | #, fuzzy 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: nethserver-base 3.0.10-2-g78528d5\n" 9 | "Report-Msgid-Bugs-To: nethserver@googlegroups.com\n" 10 | "POT-Creation-Date: 2016-10-20 12:00+0200\n" 11 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 | "Last-Translator: FULL NAME \n" 13 | "Language-Team: LANGUAGE \n" 14 | "Language: \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=CHARSET\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 19 | 20 | #: root/etc/nethserver/todos.d/10eth-unmapped:44 21 | msgid "Assign role to network interface" 22 | msgid_plural "Assign roles to network interfaces" 23 | msgstr[0] "" 24 | msgstr[1] "" 25 | 26 | #: root/etc/nethserver/todos.d/10eth-unmapped:48 27 | #, python-brace-format 28 | msgid "A role must be assigned to a new network card" 29 | msgid_plural "There are {0} roles to be assigned to network cards" 30 | msgstr[0] "" 31 | msgstr[1] "" 32 | 33 | #: root/etc/nethserver/todos.d/10green-dhcp:52 34 | msgid "One or more green interfaces use DHCP" 35 | msgstr "" 36 | 37 | #: root/etc/nethserver/todos.d/10green-dhcp:56 38 | msgid "" 39 | "Using DHCP on green interfaces leads to unexpected behavior. Please, change " 40 | "the interface to static if possible" 41 | msgstr "" 42 | -------------------------------------------------------------------------------- /root/etc/e-smith/templates/etc/yum/yum-cron.conf/10commands: -------------------------------------------------------------------------------- 1 | [commands] 2 | # What kind of update to use: 3 | # default = yum upgrade 4 | # security = yum --security upgrade 5 | # security-severity:Critical = yum --sec-severity=Critical upgrade 6 | # minimal = yum --bugfix update-minimal 7 | # minimal-security = yum --security update-minimal 8 | # minimal-security-severity:Critical = --sec-severity=Critical update-minimal 9 | update_cmd = default 10 | 11 | # Whether a message should be emitted when updates are available, 12 | # were downloaded, or applied. 13 | update_messages = {${'yum-cron'}{'messages'} || 'yes'} 14 | 15 | # Whether updates should be downloaded when they are available. 16 | download_updates = {${'yum-cron'}{'download'} || 'yes'} 17 | 18 | # Whether updates should be applied when they are available. Note 19 | # that download_updates must also be yes for the update to be applied. 20 | apply_updates = {${'yum-cron'}{'applyUpdate'} || 'no'} 21 | 22 | # Maximum amout of time to randomly sleep, in minutes. The program 23 | # will sleep for a random amount of time between 0 and random_sleep 24 | # minutes before running. This is useful for e.g. staggering the 25 | # times that multiple systems will access update servers. If 26 | # random_sleep is 0 or negative, the program will run immediately. 27 | # 6*60 = 360 28 | random_sleep = {${'yum-cron'}{'randomWait'}||'360'} 29 | 30 | 31 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Module/Dashboard/Interfaces/ApplicationInterface.php: -------------------------------------------------------------------------------- 1 | . 21 | */ 22 | 23 | /** 24 | * Describe an application which will be visibile in the application tab. 25 | * 26 | * @author Giacomo Sanchietti 27 | */ 28 | interface ApplicationInterface 29 | { 30 | /** 31 | * Return an associative array in the format $key => $value. 32 | * If a key starts with the 'url' string, the value will be formatted as a link 33 | **/ 34 | public function getInfo(); 35 | 36 | /** 37 | * Return the name of the module. The name is used for sorting. 38 | */ 39 | public function getName(); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /root/usr/libexec/nethserver/read-service-status: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # 4 | # Copyright (C) 2013 Nethesis S.r.l. 5 | # http://www.nethesis.it - support@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see . 21 | # 22 | 23 | use strict; 24 | 25 | use esmith::ConfigDB; 26 | use NethServer::Service; 27 | use JSON; 28 | 29 | my $confDb = esmith::ConfigDB->open_ro(); 30 | my @services = map { $_->key } $confDb->get_all_by_prop('type' => 'service'); 31 | 32 | my %serviceStatus = (); 33 | 34 | foreach (@services) { 35 | next if ( ! -e "/etc/e-smith/db/configuration/defaults/$_/status" ); 36 | 37 | my $s = NethServer::Service->new($_, $confDb); 38 | $serviceStatus{$_} = { 39 | 'enabled' => $s->is_enabled() ? 1 : 0, 40 | 'running' => $s->is_running() ? 1 : 0 41 | }; 42 | } 43 | 44 | print JSON::to_json(\%serviceStatus); 45 | exit(0); 46 | 47 | -------------------------------------------------------------------------------- /root/etc/e-smith/validators/actions/uniq-networksdb-key: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # 4 | # Copyright (C) 2015 Nethesis S.r.l. 5 | # http://www.nethesis.it - support@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see . 21 | # 22 | 23 | package esmith; 24 | 25 | use esmith::NetworksDB; 26 | 27 | 28 | =head2 validate_networkName_conflict 29 | 30 | Returns 'OK' if the key name doesn't yet exist. Returns a localised error 31 | otherwise. 32 | 33 | =cut 34 | 35 | my $keyName = shift || die('Missing key name argument'); 36 | my $keydb = esmith::NetworksDB->open_ro() || die('Could not open NetworksDB'); 37 | 38 | my $key = $keydb->get($keyName); 39 | my $type; 40 | 41 | if (defined $key) 42 | { 43 | $type = $key->prop('type'); 44 | } 45 | else 46 | { 47 | exit 0; 48 | } 49 | 50 | print "A $type key with the same name already exists\n"; 51 | exit 3; 52 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Module/Pki/Index.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Description of Index 24 | * 25 | * @author Davide Principi 26 | */ 27 | class Index extends \Nethgui\Controller\AbstractController 28 | { 29 | public function prepareView(\Nethgui\View\ViewInterface $view) 30 | { 31 | parent::prepareView($view); 32 | $view['tableClass'] = 'small-dataTable'; 33 | $view['columns'] = array( 34 | array('name' => 'Name'), 35 | array('name' => 'Issuer'), 36 | array('name' => 'ExpireDate'), 37 | array('name' => 'Actions'), 38 | ); 39 | $view['rows'] = $this->fetchCertificatesDatabase(); 40 | } 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Module/LogViewer.php: -------------------------------------------------------------------------------- 1 | . 21 | */ 22 | 23 | 24 | /** 25 | * Find and show a system log file 26 | * 27 | * @author Davide Principi 28 | * @since 1.0 29 | */ 30 | class LogViewer extends \Nethgui\Controller\CompositeController 31 | { 32 | 33 | protected function initializeAttributes(\Nethgui\Module\ModuleAttributesInterface $base) 34 | { 35 | return \Nethgui\Module\SimpleModuleAttributesProvider::extendModuleAttributes($base, 'Administration', 20); 36 | } 37 | 38 | public function initialize() 39 | { 40 | parent::initialize(); 41 | $this->addChild(new LogViewer\Find()); 42 | $this->addChild(new LogViewer\Read()); 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /root/etc/e-smith/validators/actions/group-length: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # 3 | # Copyright (C) 2012 Nethesis S.r.l. 4 | # http://www.nethesis.it - support@nethesis.it 5 | # 6 | # This script is part of NethServer. 7 | # 8 | # NethServer is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, 11 | # or any later version. 12 | # 13 | # NethServer is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with NethServer. If not, see . 20 | # 21 | package esmith; 22 | 23 | use esmith::ConfigDB; 24 | 25 | =head2 validate_account_length ACCOUNTNAME 26 | 27 | returns 'OK' if the account name is shorter than the maximum account name length 28 | returns 'ACCOUNT_TOO_LONG' otherwise 29 | 30 | =cut 31 | 32 | my $groupName = shift || die("Missing group name argument"); 33 | my $db = esmith::ConfigDB->open_ro() or die("Could not open ConfigDB"); 34 | 35 | my $maxGroupNameLength = ($db->get('maxGroupNameLength') 36 | ? $db->get('maxGroupNameLength')->prop('type') 37 | : "") || 32; 38 | 39 | if ( length $groupName > $maxGroupNameLength ) { 40 | print "Max group name length is: $maxGroupNameLength\n"; 41 | exit 1 42 | } 43 | 44 | exit 0; 45 | 46 | -------------------------------------------------------------------------------- /root/etc/e-smith/validators/actions/user-length: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # 3 | # Copyright (C) 2012 Nethesis S.r.l. 4 | # http://www.nethesis.it - support@nethesis.it 5 | # 6 | # This script is part of NethServer. 7 | # 8 | # NethServer is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, 11 | # or any later version. 12 | # 13 | # NethServer is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with NethServer. If not, see . 20 | # 21 | package esmith; 22 | 23 | use esmith::ConfigDB; 24 | 25 | =head2 validate_account_length ACCOUNTNAME 26 | 27 | returns 'OK' if the account name is shorter than the maximum account name length 28 | returns 'ACCOUNT_TOO_LONG' otherwise 29 | 30 | =cut 31 | 32 | my $acctName = shift || die("Missing user name argument"); 33 | 34 | my $db = esmith::ConfigDB->open_ro() or die("Could not open ConfigDB"); 35 | 36 | my $maxAcctNameLength = ($db->get('maxAcctNameLength') 37 | ? $db->get('maxAcctNameLength')->prop('type') 38 | : "") || 32; 39 | 40 | if ( length($acctName) > $maxAcctNameLength ) { 41 | print "Max user name length is: $maxAcctNameLength\n"; 42 | exit 1 43 | } 44 | 45 | exit 0; 46 | 47 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Language/en/NethServer.php: -------------------------------------------------------------------------------- 1 | "; 4 | echo $view->header()->setAttribute('template',$T('raidstatus_title')); 5 | if (count($view['status']['results']) == 0) { 6 | echo $T('no_raid'); 7 | } else { 8 | foreach ($view['status']['results'] as $raid) { 9 | echo "
".$raid['md']."
".$T($raid['result'])."
"; 10 | echo "
"; 11 | echo "
".$T('level')."
RAID"; echo $raid['level']; echo "
"; 12 | echo "
".$T('devs')."
"; echo $raid['ok_devs'] . "/" . $raid['tot_devs'] ; 13 | echo " (".($raid['active_devs']=='none'?$T("none"):$raid['active_devs']).")"; 14 | echo "
"; 15 | if ($raid['failed_devs'] != 'none') { 16 | echo "
".$T('failed_devs')."
"; echo $raid['failed_devs']; echo "
"; 17 | } 18 | if ($raid['spare_devs'] != 'none') { 19 | echo "
".$T('spare_devs')."
"; echo $raid['spare_devs']; echo "
"; 20 | } 21 | echo "
"; 22 | } 23 | } 24 | echo ""; 25 | 26 | $view->includeCSS(" 27 | dl.raid { 28 | margin-bottom: 8px; 29 | } 30 | dl.raid:last-of-type { 31 | margin-bottom: 0px; 32 | } 33 | 34 | dt.raid { 35 | font-size: 1.2em; 36 | font-weight: bold; 37 | } 38 | dd.raid-ok { 39 | padding: 3px; 40 | color: green; 41 | font-weight: bold; 42 | } 43 | dd.raid-critical { 44 | padding: 3px; 45 | color: red; 46 | font-weight: bold; 47 | } 48 | 49 | "); 50 | 51 | -------------------------------------------------------------------------------- /root/etc/e-smith/validators/actions/open-tcp-connection: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # Copyright (C) 2012 Nethesis S.r.l. 4 | # http://www.nethesis.it - support@nethesis.it 5 | # 6 | # This script is part of NethServer. 7 | # 8 | # NethServer is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, 11 | # or any later version. 12 | # 13 | # NethServer is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with NethServer. If not, see . 20 | # 21 | use strict; 22 | use IO::Handle; 23 | 24 | my $port_number = shift || die('Missing port number argument'); 25 | my $server_name = shift || die('Missing server name argument'); 26 | 27 | =head1 validate-remote-port 28 | 29 | Arguments: 30 | 31 | =cut 32 | 33 | use esmith::util::network; 34 | 35 | if( ! esmith::util::network::isValidPort($port_number) ) { 36 | # Invalid port number argument 37 | exit 3; 38 | } 39 | 40 | if( ! (esmith::util::network::isValidHostname($server_name)) ) { 41 | # Invalid host address 42 | exit 4; 43 | } 44 | 45 | my $output = qx(/usr/bin/nc -z -v $server_name $port_number 2>&1); 46 | 47 | if($? != 0) { 48 | my $reason = [split(/:\s+/, $output, 3)]->[-1]; 49 | print $reason; 50 | exit 1; 51 | } 52 | 53 | exit 0; 54 | -------------------------------------------------------------------------------- /root/usr/libexec/nethserver/admin-todos: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # 4 | # Copyright (C) 2015 Nethesis S.r.l. 5 | # http://www.nethesis.it - support@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see COPYING. 21 | # 22 | 23 | use JSON; 24 | use Encode qw(encode decode); 25 | use strict; 26 | use Carp; 27 | 28 | my $errors = 0; 29 | my $count = 0; 30 | open(STDERR, '| /bin/logger -t admin-todos'); 31 | 32 | print '['; 33 | 34 | foreach(glob '/etc/nethserver/todos.d/*') { 35 | my $output = `/usr/bin/timeout --kill-after 7 2 $_`; 36 | $output =~ s/(^\s+|\s+$)//; 37 | if($? != 0) { 38 | print STDERR "[ERROR] admin-todos: $_ exit code $?\n"; 39 | $errors ++; 40 | next; 41 | } 42 | if( ! $output) { 43 | next; 44 | } 45 | my $data = eval{ JSON::decode_json(decode('UTF-8', $output)); }; 46 | if( ! defined $data) { 47 | $errors ++; 48 | next; 49 | } 50 | if($count) { 51 | print ','; 52 | } 53 | print JSON::encode_json($data); 54 | $count ++; 55 | } 56 | 57 | print ']'; 58 | 59 | close(STDERR); 60 | 61 | exit($errors == 0 ? 0 : 1); 62 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Tool/CustomModuleAttributesProvider.php: -------------------------------------------------------------------------------- 1 | . 22 | */ 23 | 24 | /** 25 | * TODO: add component description here 26 | * 27 | * @author Davide Principi 28 | * @since 1.0 29 | */ 30 | class CustomModuleAttributesProvider extends \Nethgui\Module\SimpleModuleAttributesProvider 31 | { 32 | 33 | public function __construct(\Nethgui\Module\ModuleAttributesInterface $base, $overrides = array()) 34 | { 35 | foreach (array('title', 'category', 'description', 'languageCatalog', 'tags', 'menuPosition') as $field) { 36 | if (isset($overrides[$field])) { 37 | $this->$field = $overrides[$field]; 38 | } else { 39 | $getter = 'get' . ucfirst($field); 40 | $this->$field = \call_user_func(array($base, $getter)); 41 | } 42 | } 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Module/Dashboard/SystemStatus/RaidStatus.php: -------------------------------------------------------------------------------- 1 | . 21 | */ 22 | 23 | /** 24 | * Retrieve system raid status 25 | * 26 | * @author Giacomo Sanchietti 27 | */ 28 | class RaidStatus extends \Nethgui\Controller\AbstractController 29 | { 30 | 31 | public $sortId = 10; 32 | 33 | private $status = ""; 34 | 35 | private function readRaidStatus() 36 | { 37 | return json_decode($this->getPlatform()->exec('/usr/libexec/nethserver/raid-status')->getOutput(), true); 38 | } 39 | 40 | public function process() 41 | { 42 | $this->status = $this->readRaidStatus(); 43 | } 44 | 45 | public function prepareView(\Nethgui\View\ViewInterface $view) 46 | { 47 | if (!$this->status) { 48 | $this->status = $this->readRaidStatus(); 49 | } 50 | $view['status'] = $this->status; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /root/etc/e-smith/validators/actions/interface-role: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # 4 | # Copyright (C) 2013 Nethesis S.r.l. 5 | # http://www.nethesis.it - support@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see . 21 | # 22 | 23 | use strict; 24 | use JSON qw(decode_json); 25 | use esmith::NetworksDB; 26 | 27 | my $r = decode_json($ARGV[0]); 28 | my %h = %{$r}; 29 | 30 | # Initialize missing parameters as empty strings: 31 | foreach (qw(device role bootproto ipaddr netmask gateway)) { 32 | if( ! defined $h{$_} ) { 33 | $h{$_} = ''; 34 | } 35 | } 36 | 37 | 38 | # 39 | # 1. Only red interfaces can use DHCP 40 | # 41 | if($h{'bootproto'} eq 'dhcp' && $h{'role'} !~ m/^(red|green)$/ ) { 42 | print "only_red_or_green_dhcp\n"; 43 | exit 3; 44 | } 45 | 46 | # 47 | # 2. There must be a green interface 48 | # 49 | if($h{'role'} ne 'green') { 50 | 51 | my $ndb = esmith::NetworksDB->open_ro() || die("Could not open NetworksDB"); 52 | 53 | if( ! grep { $_->key() eq $h{'device'} ? () : $_ } $ndb->green()) { 54 | print "one_green_at_least\n"; 55 | exit 4; 56 | } 57 | } 58 | 59 | 60 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Module/Applications.php: -------------------------------------------------------------------------------- 1 | . 21 | */ 22 | 23 | /** 24 | * Application tab with plugin behaviour 25 | */ 26 | class Applications extends \Nethgui\Controller\ListComposite 27 | { 28 | 29 | protected function initializeAttributes(\Nethgui\Module\ModuleAttributesInterface $base) 30 | { 31 | return new \NethServer\Tool\CustomModuleAttributesProvider($base, array( 32 | 'languageCatalog' => array('NethServer_Module_Dashboard_Applications'), 33 | 'category' => 'Status') 34 | ); 35 | } 36 | 37 | public function initialize() 38 | { 39 | parent::initialize(); 40 | $this->loadChildrenDirectory($this, 'Dashboard/Applications'); 41 | $this->sortChildren(array($this,"sortApplication")); 42 | } 43 | 44 | public function sortApplication($a, $b) 45 | { 46 | return strcmp($a->getName(), $b->getName()); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/network-route-down: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # 4 | # network-route-up -- call ifup-route on all interfaces 5 | # 6 | 7 | # 8 | # Copyright (C) 2013 Nethesis S.r.l. 9 | # http://www.nethesis.it - support@nethesis.it 10 | # 11 | # This script is part of NethServer. 12 | # 13 | # NethServer is free software: you can redistribute it and/or modify 14 | # it under the terms of the GNU General Public License as published by 15 | # the Free Software Foundation, either version 3 of the License, 16 | # or any later version. 17 | # 18 | # NethServer is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | # GNU General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU General Public License 24 | # along with NethServer. If not, see . 25 | # 26 | 27 | 28 | use esmith::NetworksDB; 29 | use strict; 30 | 31 | our $output_dir = $output_dir || $ENV{ESMITH_NETWORK_OUT_DIR} || "/etc/sysconfig/network-scripts"; 32 | 33 | my $idb = esmith::NetworksDB->open_ro(); 34 | my @interfaces = $idb->interfaces; 35 | 36 | foreach my $i (@interfaces) { 37 | my $if = $i->key; 38 | my %props = $i->props; 39 | my $role = $props{'role'} || ''; 40 | next unless ($role ne ''); 41 | 42 | next unless (-f "$output_dir/route-$if"); 43 | open FILE, "<", "$output_dir/route-$if"; 44 | 45 | while () { 46 | s/#.*//; # ignore comments by erasing them 47 | next if /^(\s)*$/; # skip blank lines 48 | chomp; # remove trailing newline characters 49 | system("ip ro del $_"); 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /root/etc/nethserver/todos.d/10green-dhcp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # 4 | # Copyright (C) 2016 Nethesis S.r.l. 5 | # 6 | # This script is part of NethServer. 7 | # 8 | # NethServer is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, 11 | # or any later version. 12 | # 13 | # NethServer is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with NethServer. If not, see COPYING. 20 | # 21 | 22 | import gettext 23 | import json 24 | import os 25 | import sys 26 | 27 | out = '' 28 | 29 | try: 30 | out = os.popen('/sbin/e-smith/db networks showjson').read() 31 | except: 32 | pass 33 | 34 | if(not out): 35 | exit(1) 36 | 37 | interfaces = json.loads(out, 'UTF-8') 38 | warn = 0 39 | 40 | for i in interfaces: 41 | try: 42 | if i['props']['role'] == 'green': 43 | if i['props']['bootproto'] == 'dhcp': 44 | warn = warn + 1 45 | except: 46 | continue 47 | 48 | if( warn > 0): 49 | gettext.textdomain('nethserver-base') 50 | msg = { 51 | "action": { 52 | "label": gettext.gettext('One or more green interfaces use DHCP'), 53 | "url": '/NetworkAdapter' 54 | }, 55 | "icon": "bolt", 56 | "text": gettext.gettext('Using DHCP on green interfaces leads to unexpected behavior. Please, change the interface to static if possible') 57 | } 58 | json.dump(msg, sys.stdout) 59 | 60 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Module/PackageManager/ClearYumCache.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Description of ClearYumCache 24 | * 25 | * @author Davide Principi 26 | */ 27 | class ClearYumCache extends \Nethgui\Controller\AbstractController 28 | { 29 | 30 | public function process() 31 | { 32 | parent::process(); 33 | if ($this->getRequest()->isMutation()) { 34 | $this->getPlatform()->exec('/usr/bin/sudo /usr/bin/yum clean all'); 35 | } 36 | } 37 | 38 | public function prepareView(\Nethgui\View\ViewInterface $view) 39 | { 40 | parent::prepareView($view); 41 | $this->absoluteModulePath = '/' . implode('/', array_slice($view->getModulePath(), 0, -1)); 42 | } 43 | 44 | public function nextPath() 45 | { 46 | if ($this->getRequest()->isMutation()) { 47 | return $this->absoluteModulePath . '/Modules'; 48 | } 49 | return FALSE; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/interface-config-reset: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # interface-config-write -- remove ifcfg-* interface configurations 5 | # 6 | 7 | # 8 | # Copyright (C) 2012 Nethesis S.r.l. 9 | # http://www.nethesis.it - support@nethesis.it 10 | # 11 | # This script is part of NethServer. 12 | # 13 | # NethServer is free software: you can redistribute it and/or modify 14 | # it under the terms of the GNU General Public License as published by 15 | # the Free Software Foundation, either version 3 of the License, 16 | # or any later version. 17 | # 18 | # NethServer is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | # GNU General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU General Public License 24 | # along with NethServer. If not, see . 25 | # 26 | 27 | source /etc/rc.d/init.d/functions 28 | 29 | if [ "x$ESMITH_NETWORK_OUT_DIR" == "x" ]; then 30 | ESMITH_NETWORK_OUT_DIR=/etc/sysconfig/network-scripts 31 | fi 32 | 33 | interfaces=$(ls $ESMITH_NETWORK_OUT_DIR/ifcfg-* | \ 34 | LC_ALL=C sed -e "$__sed_discard_ignored_files" \ 35 | -e '/\(ifcfg-lo$\|:\|ifcfg-.*-range\)/d' \ 36 | -e '{ s/^ifcfg-//g;s/[0-9]/ &/}' | \ 37 | LC_ALL=C sort -k 1,1 -k 2n | \ 38 | LC_ALL=C sed 's/ //') 39 | 40 | 41 | for i in $interfaces; do 42 | rm -f $i 2>/dev/null 43 | done 44 | 45 | # remove all aliases 46 | rm -f $ESMITH_NETWORK_OUT_DIR/ifcfg-*:* 2>/dev/null 47 | # remove all routes 48 | rm -f $ESMITH_NETWORK_OUT_DIR/route-* 2>/dev/null 49 | 50 | # cleanup old unused file 51 | rm -f /etc/sysconfig/static-routes 52 | 53 | exit 0 54 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Module/FQDN.php: -------------------------------------------------------------------------------- 1 | . 21 | */ 22 | 23 | use Nethgui\System\PlatformInterface as Validate; 24 | 25 | /** 26 | * Change SystemName and DomainName 27 | * 28 | * @author Giacomo Sanchietti 29 | */ 30 | class FQDN extends \Nethgui\Controller\AbstractController 31 | { 32 | 33 | protected function initializeAttributes(\Nethgui\Module\ModuleAttributesInterface $base) 34 | { 35 | return \Nethgui\Module\SimpleModuleAttributesProvider::extendModuleAttributes($base, 'Configuration', 10); 36 | } 37 | 38 | public function initialize() 39 | { 40 | parent::initialize(); 41 | $this->declareParameter('FQDN', $this->createValidator()->hostname(2)->platform('myhostname'), array('NethServer::Database::Hostname', 'StaticHostname')); 42 | } 43 | 44 | protected function onParametersSaved($changes) 45 | { 46 | $this->getPlatform()->signalEvent('hostname-modify &'); 47 | } 48 | 49 | } 50 | 51 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Tool/php-markdown/License.text: -------------------------------------------------------------------------------- 1 | PHP Markdown 2 | Copyright (c) 2004-2009 Michel Fortin 3 | 4 | All rights reserved. 5 | 6 | Based on Markdown 7 | Copyright (c) 2003-2006 John Gruber 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are 13 | met: 14 | 15 | * Redistributions of source code must retain the above copyright notice, 16 | this list of conditions and the following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above copyright 19 | notice, this list of conditions and the following disclaimer in the 20 | documentation and/or other materials provided with the distribution. 21 | 22 | * Neither the name "Markdown" nor the names of its contributors may 23 | be used to endorse or promote products derived from this software 24 | without specific prior written permission. 25 | 26 | This software is provided by the copyright holders and contributors "as 27 | is" and any express or implied warranties, including, but not limited 28 | to, the implied warranties of merchantability and fitness for a 29 | particular purpose are disclaimed. In no event shall the copyright owner 30 | or contributors be liable for any direct, indirect, incidental, special, 31 | exemplary, or consequential damages (including, but not limited to, 32 | procurement of substitute goods or services; loss of use, data, or 33 | profits; or business interruption) however caused and on any theory of 34 | liability, whether in contract, strict liability, or tort (including 35 | negligence or otherwise) arising in any way out of the use of this 36 | software, even if advised of the possibility of such damage. 37 | -------------------------------------------------------------------------------- /root/etc/cron.daily/nethserver-check-builtin-certificate: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2013 Nethesis S.r.l. 5 | # http://www.nethesis.it - support@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see . 21 | # 22 | 23 | program=$(basename $0) 24 | pki_info=/usr/libexec/nethserver/pki-info 25 | 26 | # 10 days advance alert 27 | alert=10 28 | 29 | # Have custom certificate? 30 | cert=/etc/pki/tls/certs/NSRV.crt 31 | 32 | # Certificate expire timestamp 33 | exp=$(${pki_info} -e ${cert}) 34 | 35 | # Renew, if cert is stale and not custom 36 | must_renew() { 37 | perl -MDate::Parse -e ' 38 | $oneday = str2time($ARGV[0]) < (time() + (24 * 3600)); 39 | exit($oneday ? 0 : 1); 40 | ' -- "${exp}" 41 | } 42 | 43 | # 44 | # Send mail to root user 45 | # 46 | 47 | if must_renew; then 48 | { 49 | /etc/e-smith/events/actions/nethserver-generate-certificate 50 | echo "$(hostname) certificate has been automatically generated" 51 | echo "" 52 | ${pki_info} -s ${cert} 2>&1 53 | } | mail -s "$(hostname) certificate has been generated" root@localhost 54 | echo "[WARNING] $(hostname) certificate has been generated" | logger -t "${program}" -p user.warn 55 | fi 56 | -------------------------------------------------------------------------------- /root/usr/libexec/nethserver/pki-info: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2014 Nethesis S.r.l. 5 | # http://www.nethesis.it - support@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see . 21 | # 22 | 23 | usage () { 24 | echo " 25 | Usage: 26 | $0 [ -s | -e | -t ] 27 | 28 | -s print the certificate 29 | -e print the expire date 30 | -t test if cert is expired 31 | " 32 | } 33 | 34 | print_certificate () { 35 | /usr/bin/openssl x509 -in ${1} -noout -text 36 | } 37 | 38 | print_expire_date () { 39 | exp_date=$(/usr/bin/openssl x509 -in ${1} -noout -enddate) 40 | [[ $? = 0 ]] && date -d "${exp_date##notAfter=}" --rfc-3339=seconds 41 | } 42 | 43 | test_expired () { 44 | perl -MDate::Parse -e 'exit(time() < str2time($ARGV[0]));' -- "$(/usr/bin/openssl x509 -in ${1} -noout -enddate | cut -f 2 -d =)" 45 | } 46 | 47 | while getopts "t:e:s:" opt; do 48 | case $opt in 49 | s) 50 | print_certificate $OPTARG 51 | ;; 52 | e) 53 | print_expire_date $OPTARG 54 | ;; 55 | t) 56 | if test_expired $OPTARG; then 57 | exit 2 58 | fi 59 | ;; 60 | \?) # Print help message and exit 61 | usage 62 | exit 1 63 | ;; 64 | esac 65 | done 66 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/interface-rename: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # 4 | # Copyright (C) 2017 Nethesis S.r.l. 5 | # http://www.nethesis.it - nethserver@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see COPYING. 21 | # 22 | 23 | use esmith::NetworksDB; 24 | use esmith::ConfigDB; 25 | 26 | shift; # skip event name 27 | 28 | my $argnum = @ARGV; 29 | 30 | if ($argnum == 0) { 31 | # Nothing to do 32 | exit 0; 33 | } 34 | 35 | if (defined($ARGV[0]) && $ARGV[0] eq '--skip-network') { 36 | # Do not change network config 37 | exit 0; 38 | } 39 | 40 | if ( ($argnum) % 2 ) { 41 | die("Odd numbers of parmeters"); 42 | } 43 | 44 | my $i = 0; 45 | while ($i < $argnum) { 46 | my $old = $ARGV[$i] || ''; 47 | my $new = $ARGV[$i+1] || ''; 48 | $i=$i+2; 49 | 50 | if ($old eq '' && $new eq '') { 51 | die("Empty parameters"); 52 | } 53 | 54 | update_refs($old, $new); 55 | } 56 | 57 | 58 | sub update_refs { 59 | my $old = shift; 60 | my $new = shift; 61 | 62 | warn "[NOTICE] Rename interface $old -> $new\n"; 63 | foreach (glob('/var/lib/nethserver/db/*')) { 64 | # Replace strings inside the db, except for MAC address reservation records 65 | system("sed -i '/MacAddress/! {s/\\b$old\\b/$new/g}' $_"); 66 | } 67 | } 68 | 69 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/nethserver-base-restore-yumrepos: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2018 Nethesis S.r.l. 5 | # http://www.nethesis.it - nethserver@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see COPYING. 21 | # 22 | 23 | # 24 | # Extract the configuration DB from backup to a temporary dir, and use it 25 | # to restore the yum repositories configuration 26 | # 27 | 28 | configdb=/var/lib/nethserver/db/configuration 29 | tmpdir=$(mktemp -d /tmp/restore-yumrepos.XXXXXXX) 30 | tmpdb=$(mktemp -u /var/lib/nethserver/db/configuration.XXXXXXXX) 31 | trap "mv -vf ${tmpdb} ${configdb} ; rm -rf ${tmpdir}" EXIT 32 | 33 | tar -x -C "${tmpdir}" -f /var/lib/nethserver/backup/backup-config.tar.xz var/lib/nethserver/db/configuration 34 | 35 | # rename current db 36 | mv -f ${configdb} ${tmpdb} 37 | 38 | # copy db from backup 39 | cp -a "${tmpdir}/var/lib/nethserver/db/configuration" ${configdb} 40 | 41 | systemId=$(/sbin/e-smith/config getprop subscription SystemId) 42 | if [[ -z ${systemId} ]]; then 43 | systemId=$(/sbin/e-smith/config getprop nethupdate SystemID) 44 | fi 45 | 46 | echo "[NOTICE] Restoring YUM repository configuration" 47 | if [[ -n ${systemId} ]]; then 48 | echo "[NOTICE] This system is subscribed as ${systemId}" 49 | fi 50 | 51 | /sbin/e-smith/signal-event software-repos-save 52 | 53 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/nethserver-base-synchronize-nssdb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # 4 | # Copyright (C) 2013 Nethesis S.r.l. 5 | # http://www.nethesis.it - support@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see . 21 | # 22 | 23 | use NethServer::Password; 24 | use File::Temp; 25 | use esmith::ConfigDB; 26 | 27 | my $event = shift; 28 | my $nssPath = shift; 29 | my $keySecret = "/etc/pki/nssdb/password"; 30 | 31 | my $configDb = esmith::ConfigDB->open_ro() || die("Could not open ConfigDB"); 32 | my $certName = join('.', $configDb->get_value('SystemName'), $configDb->get_value('DomainName')); 33 | 34 | if( ! $nssPath) { 35 | $nssPath = '/etc/pki/nssdb/'; 36 | } 37 | 38 | NethServer::Password::store($keySecret); 39 | 40 | my $certFile = File::Temp::tempnam('/tmp', 'certXXXXXX'); 41 | 42 | # Export certificate+key to pkcs12 format 43 | system("cat /etc/pki/tls/private/NSRV.key /etc/pki/tls/certs/NSRV.crt | /usr/bin/openssl pkcs12 -export -name $certName -out $certFile -password file:$keySecret") == 0 or die("[ERROR] Certificate exportation failed"); 44 | 45 | # Import certificate+key into NSS DB 46 | system("/usr/bin/pk12util -v -i $certFile -d $nssPath -k $keySecret -w $keySecret") == 0 or die("[ERROR] Certificate importation failed"); 47 | 48 | END { 49 | unlink $certFile; 50 | } 51 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/PackageManager/Modules/Update.php: -------------------------------------------------------------------------------- 1 | buttonList() 4 | ->insert($view->button('DoUpdate', $view::BUTTON_SUBMIT)) 5 | ; 6 | ?> 7 | 8 | 9 | 10 | objectsCollection('updates') 13 | ->setAttribute('ifEmpty', function (\Nethgui\Renderer\Xhtml $renderer) { 14 | return sprintf('', $renderer->translate('noupdates_message')); 15 | }) 16 | ->setAttribute('tag', 'tbody') 17 | ->setAttribute('template', 'NethServer\Template\PackageManager\PackagesElement') 18 | ->setAttribute('key', 'name'); 19 | 20 | ?>
%s
getClientEventTarget('changelog'); 23 | 24 | $view->includeCss(" 25 | table.SmallTable {width: auto; font-size: 12px} 26 | .SmallTable td {padding: 0 1ex 4px 0} 27 | .SmallTable th {text-align: left; padding: 0 1ex 4px 0} 28 | .${changelogTarget} { font-size: smaller; border: 1px solid #d2d2d2; background: #eee; padding: 1em } 29 | 30 | .nextRelease .Controller {margin-top: 4px} 31 | "); 32 | 33 | echo $view->fieldset(NULL, $view::FIELDSET_EXPANDABLE)->setAttribute('template', $T('Changelog_label')) 34 | ->insert($view->textLabel('changelog')->setAttribute('tag', 'pre')); 35 | 36 | $upstreamReleaseTemplate = 37 | '' . 38 | '

{{message}}

' . 39 | '
' . 40 | $view->button('ChangePolicy', $view::BUTTON_LINK)->setAttribute('value', '{{link}}') . 41 | '
'; 42 | 43 | $view->getModule()->notifications->defineTemplate('nextRelease', $upstreamReleaseTemplate, 'nextRelease bg-yellow'); 44 | -------------------------------------------------------------------------------- /root/etc/e-smith/db/routes/migrate/issue5079: -------------------------------------------------------------------------------- 1 | { 2 | use esmith::ConfigDB; 3 | use esmith::NetworksDB; 4 | use Net::IPv4Addr; 5 | my $db = esmith::ConfigDB->open('routes'); 6 | 7 | my $idb = esmith::NetworksDB->open_ro(); 8 | my @interfaces = $idb->interfaces; 9 | 10 | foreach my $static ($db->get_all_by_prop('type' => 'static')) { 11 | my $mask = $static->prop('Mask') || next; # already converted 12 | my $net = $static->key; 13 | my $desc = $static->prop('Description') || ''; 14 | my $router = $static->prop('Router') || ''; 15 | my $device = ''; 16 | my $cidr = Net::IPv4Addr::ipv4_network($net, $mask); 17 | 18 | foreach my $i (@interfaces) { 19 | my %props = $i->props; 20 | my $role = $props{'role'} || next; 21 | my $type = $props{'type'} || next; 22 | next if ($type eq 'alias'); 23 | my $ipaddr = $props{'ipaddr'} || ''; 24 | my $netmask = $props{'netmask'} || ''; 25 | my $dev = $i->key; 26 | my $inet = ''; 27 | my $imsk = ''; 28 | if ($ipaddr eq '' && $netmask eq '') { 29 | my $tmp = `/sbin/ip -o -4 address show $dev primary | head -1 | awk '{print \$4}'`; 30 | chomp $tmp; 31 | ($ipaddr, $netmask) = split(/\//, $tmp); 32 | next if ( ! $ipaddr || ! $netmask); 33 | ($inet,$imsk) = Net::IPv4Addr::ipv4_network("$ipaddr/$netmask"); 34 | } else { 35 | ($inet,$imsk) = Net::IPv4Addr::ipv4_network($ipaddr, $netmask); 36 | } 37 | if (Net::IPv4Addr::ipv4_in_network($inet, $imsk, $router)) { 38 | $device = $dev; 39 | } 40 | 41 | } 42 | 43 | 44 | $static->delete(); 45 | $db->new_record($cidr, {type => 'static', 'Router' => $router, 'Description' => $desc, 'Device' => $device, 'Metric' => ''}); 46 | } 47 | 48 | ''; 49 | } 50 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Module/Pki/CertAdapter.php: -------------------------------------------------------------------------------- 1 | . 20 | */ 21 | 22 | /** 23 | * Description of CertAdapter 24 | * 25 | * @author Davide Principi 26 | */ 27 | class CertAdapter extends \Nethgui\Adapter\LazyLoaderAdapter 28 | { 29 | 30 | private $platform; 31 | 32 | public function __construct(\Nethgui\System\PlatformInterface $p) 33 | { 34 | $this->platform = $p; 35 | parent::__construct(array($this, 'fetchCertificatesDatabase')); 36 | } 37 | 38 | public function fetchCertificatesDatabase() 39 | { 40 | 41 | $data = json_decode($this->platform->exec('/usr/bin/sudo /usr/libexec/nethserver/cert-list')->getOutput(), TRUE); 42 | if ($data === FALSE) { 43 | return new \ArrayObject(); 44 | } 45 | 46 | $db = array(); 47 | 48 | foreach ($data as $k => $v) { 49 | $db[$k] = array( 50 | 'Name' => $k, 51 | 'Issuer' => $v['issuer'], 52 | 'ExpireDate' => strftime('%Y-%m-%d', $v['expiration_t']), 53 | 'Default' => $v['default'] 54 | ); 55 | } 56 | 57 | return new \ArrayObject($db); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Module/Shutdown.php: -------------------------------------------------------------------------------- 1 | . 21 | */ 22 | 23 | /** 24 | * Reboots and switch off the machine 25 | * 26 | * @author Davide Principi 27 | * @since 1.0 28 | */ 29 | class Shutdown extends \Nethgui\Controller\AbstractController 30 | { 31 | 32 | protected function initializeAttributes(\Nethgui\Module\ModuleAttributesInterface $base) 33 | { 34 | return \Nethgui\Module\SimpleModuleAttributesProvider::extendModuleAttributes($base, 'Administration', 20); 35 | } 36 | 37 | public function initialize() 38 | { 39 | parent::initialize(); 40 | $this->declareParameter('Action', $this->createValidator()->memberOf('poweroff', 'reboot')); 41 | } 42 | 43 | public function process() 44 | { 45 | parent::process(); 46 | 47 | if ($this->getRequest()->isMutation()) { 48 | if ($this->parameters['Action'] === 'poweroff') { 49 | $this->getPlatform()->signalEvent('system-shutdown@post-response', array('poweroff')); 50 | } else { 51 | $this->getPlatform()->signalEvent('system-shutdown@post-response', array('reboot')); 52 | } 53 | } 54 | } 55 | 56 | } -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Template/PackageManager/Review.php: -------------------------------------------------------------------------------- 1 | header()->setAttribute('template', $T('Review_header')); 6 | 7 | $template = strtr("
8 | {{#addGroups?}}
%install_modules
9 |
    {{#addGroups}}
  • {{.}}
  • {{/addGroups}}
{{/addGroups?}} 10 | {{#removeGroups?}}
%remove_modules
11 |
    {{#removeGroups}}
  • {{.}}
  • {{/removeGroups}}
{{/removeGroups?}} 12 | {{#addPackages?}}
%install_optionals
13 |
    {{#addPackages}}
  • {{.}}
  • {{/addPackages}}
{{/addPackages?}} 14 | {{#removePackages?}}
%remove_packages
15 |
    {{#removePackages}}
  • {{.}}
  • {{/removePackages}}
{{/removePackages?}} 16 |
", array('%install_modules' => $T('Install_modules_label'), '%remove_modules' => $T('Remove_modules_label'), '%install_optionals' => $T('Install_optionals_label'), '%remove_packages' => $T('Remove_packages_label'))); 17 | 18 | $view->includeJavascript(" 19 | (function( $ ) { 20 | $(function(){ 21 | var template = " . json_encode($template) . "; 22 | var templateTarget = " . json_encode($view->getClientEventTarget('messages')) . "; 23 | $('.' + templateTarget).on('nethguiupdateview', function (e, data) { 24 | $(this).html(Mustache.render(template, data)); 25 | }); 26 | }); 27 | }( jQuery )); 28 | "); 29 | 30 | $eventTarget = $view->getClientEventTarget('messages'); 31 | $view->includeCss(" 32 | .${eventTarget} ul { list-style: disc } 33 | .${eventTarget} li { margin-left: 2em } 34 | .${eventTarget} dd { margin-bottom: 0.5em } 35 | "); 36 | 37 | $mustache = new \Mustache_Engine(); 38 | echo sprintf('
%s
', $view->getClientEventTarget('messages'), $mustache->render($template, $view['messages'])); 39 | echo $view->hidden('removeGroup'); 40 | echo $view->buttonList() 41 | ->insert($view->button('Run', $view::BUTTON_SUBMIT)) 42 | ->insert($view->button('Cancel', $view::BUTTON_CANCEL)) 43 | ; 44 | -------------------------------------------------------------------------------- /root/etc/e-smith/events/actions/nethserver-certificate-upload: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2016 Nethesis S.r.l. 5 | # http://www.nethserver.org - support@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see . 21 | # 22 | 23 | 24 | EVENT=$1 25 | NAME=$2 26 | CRT=$3 27 | KEY=$4 28 | CHAIN=$5 29 | DST=/etc/pki/tls/ 30 | 31 | # If we exit early, clean up intermediate files: 32 | trap "rm -f ${DST}/certs/${NAME}.crt ${DST}/private/${NAME}.key ${DST}/certs/${NAME}-chain.crt" EXIT 33 | 34 | if [ -z $NAME ]; then 35 | echo "[ERROR]: invalid name for certificate" 36 | exit 1 37 | fi 38 | 39 | umask 0022 40 | openssl x509 -in $CRT 2>/dev/null >${DST}/certs/${NAME}.crt 41 | if [ $? -gt 0 ]; then 42 | echo "[ERROR]: invalid certificate '$CRT'" 43 | exit 1 44 | fi 45 | 46 | umask 0077 47 | openssl rsa -in $KEY 2>/dev/null >${DST}/private/${NAME}.key 48 | if [[ $? != 0 ]]; then 49 | openssl ec -in $KEY 2>/dev/null >${DST}/private/${NAME}.key 50 | if [[ $? != 0 ]]; then 51 | echo "[ERROR]: invalid private key '$KEY'" 52 | exit 1 53 | fi 54 | fi 55 | 56 | umask 0022 57 | if [[ -n "$CHAIN" && -s "$CHAIN" ]]; then 58 | openssl x509 -in $CHAIN 2>/dev/null >${DST}/certs/${NAME}-chain.crt 59 | if [ $? -gt 0 ]; then 60 | echo "[ERROR]: invalid chain file '$CHAIN'" 61 | exit 1 62 | fi 63 | fi 64 | 65 | # Remove error cleanup procedure handler: 66 | trap - EXIT 67 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Module/FirstConfigWiz/Cover.php: -------------------------------------------------------------------------------- 1 | . 22 | */ 23 | 24 | /** 25 | * TODO: add component description here 26 | * 27 | * @author Davide Principi 28 | * @since 1.6 29 | */ 30 | class Cover extends \Nethgui\Controller\AbstractController { 31 | 32 | public $wizardPosition = 0; 33 | 34 | public function process() { 35 | parent::process(); 36 | if ($this->getRequest()->hasParameter('skip')) { 37 | $sessDb = $this->getPlatform()->getDatabase('SESSION'); 38 | $sessDb->deleteKey(get_class($this->getParent())); 39 | $sessDb->setType(get_class($this->getParent()), array()); 40 | } 41 | } 42 | 43 | public function nextPath() { 44 | if ($this->getRequest()->hasParameter('skip')) { 45 | $successor = $this->getParent()->getSuccessor($this); 46 | return $successor ? $successor->getIdentifier() : 'Review'; 47 | } 48 | return parent::nextPath(); 49 | } 50 | 51 | public function prepareView(\Nethgui\View\ViewInterface $view) { 52 | parent::prepareView($view); 53 | $view->copyFrom($this->getPlatform()->getDatabase('configuration')->getKey('sysconfig')); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /root/usr/libexec/nethserver/ptrack-yum-update: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # 4 | # Copyright (C) 2018 Nethesis S.r.l. 5 | # http://www.nethesis.it - nethserver@nethesis.it 6 | # 7 | # This script is part of NethServer. 8 | # 9 | # NethServer is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, 12 | # or any later version. 13 | # 14 | # NethServer is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with NethServer. If not, see COPYING. 21 | # 22 | 23 | use strict; 24 | use NethServer::TrackerClient; 25 | 26 | my $tracker = NethServer::TrackerClient->new(); 27 | 28 | my %tasks = ( 29 | 'deps' => $tracker->declare_task('Resolve dependencies'), 30 | 'download' => $tracker->declare_task('Download RPMs'), 31 | 'installing' => $tracker->declare_task('Install RPMs'), 32 | 'verifying' => $tracker->declare_task('Verifying RPMs'), 33 | ); 34 | 35 | while () { 36 | print $_; 37 | chomp $_; 38 | if($_ =~ /^Dependencies Resolved/) { 39 | $tracker->set_task_done($tasks{'deps'}, $_, 0); 40 | } elsif ($_ =~ /^Total download size/) { 41 | $tracker->set_task_progress($tasks{'download'}, 0.1, $_); 42 | } elsif ($_ =~ /^Running transaction check/) { 43 | $tracker->set_task_done($tasks{'download'}, $_, 0); 44 | } elsif ($_ =~ m| Installing *: .* +(\d+)/(\d+)|) { 45 | $tracker->set_task_progress($tasks{'installing'}, $1 / $2, $_); 46 | } elsif ($_ =~ m| Verifying *: .* +(\d+)/(\d+)|) { 47 | $tracker->set_task_progress($tasks{'verifying'}, $1 / $2, $_); 48 | } elsif ($_ =~ /^Complete!/) { 49 | $tracker->set_task_done($tasks{'installing'}, $_, 0); 50 | $tracker->set_task_done($tasks{'verifying'}, $_, 0); 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Module/UserProfile/ChangePassword.php: -------------------------------------------------------------------------------- 1 | . 22 | */ 23 | 24 | /** 25 | * Change the current user password 26 | * 27 | * @author Davide Principi 28 | * @since 1.0 29 | */ 30 | class ChangePassword extends \NethServer\Tool\ChangePassword 31 | { 32 | 33 | public function initialize() 34 | { 35 | parent::initialize(); 36 | $this->declareParameter('oldPassword', \Nethgui\System\PlatformInterface::ANYTHING); 37 | } 38 | 39 | public function validate(\Nethgui\Controller\ValidationReportInterface $report) 40 | { 41 | parent::validate($report); 42 | if ($this->getRequest()->isMutation()) { 43 | $v = new \NethServer\Tool\PamValidator(); 44 | $v->setLog($this->getLog()); 45 | $v->setPhpWrapper($this->getPhpWrapper()); 46 | if ( ! $v->evaluate(array($this->getRequest()->getUser()->getCredential('username'), $this->parameters['oldPassword']))) { 47 | $report->addValidationError($this, 'oldPassword', $v); 48 | } 49 | } 50 | } 51 | 52 | public function nextPath() 53 | { 54 | return $this->getRequest()->isMutation() ? 'Personal' : parent::nextPath(); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Module/PackageManager/DistroUpgrade.php: -------------------------------------------------------------------------------- 1 | getRequest()->isMutation()) { 32 | $this->getPlatform()->signalEvent('software-repos-upgrade &'); 33 | } 34 | } 35 | 36 | public function prepareView(\Nethgui\View\ViewInterface $view) 37 | { 38 | parent::prepareView($view); 39 | $db = $this->getPlatform()->getDatabase('configuration'); 40 | $productName = $db->getProp('sysconfig', 'ProductName'); 41 | $sbVersion = $db->getProp('subscription', 'NsRelease'); 42 | $view['DistroUpgradeParams'] = array('product' => $productName, 'version' => $sbVersion); 43 | $view['UpgradeLater'] = $view->getModuleUrl('../Modules'); 44 | if ($this->getRequest()->isMutation()) { 45 | $this->getPlatform()->setDetachedProcessCondition('success', array( 46 | 'location' => array( 47 | 'url' => $view->getModuleUrl('../Modules?installSuccess'), 48 | 'freeze' => TRUE, 49 | ))); 50 | } 51 | } 52 | 53 | } -------------------------------------------------------------------------------- /root/usr/share/nethesis/NethServer/Module/StaticRoutes.php: -------------------------------------------------------------------------------- 1 | . 21 | */ 22 | 23 | use Nethgui\System\PlatformInterface as Validate; 24 | 25 | /** 26 | * Manage static routes 27 | */ 28 | class StaticRoutes extends \Nethgui\Controller\TableController 29 | { 30 | 31 | protected function initializeAttributes(\Nethgui\Module\ModuleAttributesInterface $base) 32 | { 33 | return \Nethgui\Module\SimpleModuleAttributesProvider::extendModuleAttributes($base, 'Configuration'); 34 | } 35 | 36 | public function initialize() 37 | { 38 | $columns = array( 39 | 'Key', 40 | 'Router', 41 | 'Device', 42 | 'Metric', 43 | 'Description', 44 | 'Actions' 45 | ); 46 | 47 | $this 48 | ->setTableAdapter($this->getPlatform()->getTableAdapter('routes', 'static')) 49 | ->setColumns($columns) 50 | ->addTableAction(new \NethServer\Module\StaticRoutes\Modify('create')) 51 | ->addTableAction(new \Nethgui\Controller\Table\Help('Help')) 52 | ->addRowAction(new \NethServer\Module\StaticRoutes\Modify('update')) 53 | ->addRowAction(new \NethServer\Module\StaticRoutes\Modify('delete')) 54 | ; 55 | 56 | parent::initialize(); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /.github/workflows/make-rpms.yml: -------------------------------------------------------------------------------- 1 | name: Make RPMs 2 | on: 3 | push: 4 | branches: 5 | - master 6 | - main 7 | pull_request: 8 | jobs: 9 | make-rpm: 10 | runs-on: ubuntu-22.04 11 | env: 12 | dest_id: core 13 | docker_image: ghcr.io/nethserver/makerpms:7 14 | steps: 15 | - uses: actions/checkout@v3 16 | with: 17 | fetch-depth: 0 18 | ref: ${{ github.head_ref }} 19 | - name: Generate .env file 20 | run: | 21 | cat > .env <