--- rpms/smeserver-manager/sme10/smeserver-manager.spec 2020/04/07 17:56:02 1.18
+++ rpms/smeserver-manager/sme10/smeserver-manager.spec 2021/12/27 17:28:17 1.57
@@ -1,46 +1,314 @@
-# $Id: smeserver-manager.spec,v 1.17 2020/04/07 13:29:49 brianr Exp $
+# $Id: smeserver-manager.spec,v 1.56 2021/12/27 16:48:38 brianr Exp $
Summary: Sme server navigation module : manager 2
%define name smeserver-manager
Name: %{name}
-%define version 0.1.0
-%define release 15
+%define version 0.1.4
+%define release 10
Version: %{version}
Release: %{release}%{?dist}
License: GPL
Group: Networking/Daemons
Source: %{name}-%{version}.tar.xz
-Patch0: smeserver-manager-0.1.0-bz10506.patch
-Patch1: smeserver-manager-add-basic-files.patch
-Patch2: smeserver-manager-0.1.0-mojo_struct.patch
-Patch3: smeserver-manager-0.1.0-setuid_groups.patch
-Patch4: smeserver-manager-0.1.0-reboot_ibays_theme.patch
-Patch5: smeserver-manager-0.1.0-add-adminlte.patch
-Patch6: smeserver-manager-0.1.0-navigation_header_listes.patch
-Patch7: smeserver-manager-0.1.0-navigation_errors.patch
-Patch8: smeserver-manager-0.1.0-theme_navig_message.patch
-Patch9: smeserver-manager-0.1.0-domains_pseudos_hosts.patch
-Patch10: smeserver-manager-0.1.0-remotax_users_logs.patch
-Patch11: smeserver-manager-0.1.0-localnetworks-panel-remove-adminlte.patch
-Patch12: smeserver-manager-0.1.0-localnetworks-remove-db-call-from-del.patch
-Patch13: smeserver-manager-0.1.0-portforwarding-localnetwork-cleanup.patch
-Patch14: smeserver-manager-0.1.0-portforwarding-rule-comment-missing.patch
+Patch0: %{name}-%{version}-list_access_csrf.patch
+Patch1: %{name}-%{version}-review_csrf_url.patch
+Patch2: smeserver-manager-0.1.4-Add-dummy-classes-to-ep-files.patch
+Patch3: smeserver-manager-0.1.4-Add-span-to-group-member-checkbox-list.patch
+Patch4: smeserver-manager-0.1.4-Review-configuration-Virtual-domains-re-format-html.patch
+Patch5: smeserver-manager-0.1.4-Sort-out-responsive-table-in-user-and-host-lists.patch
+Patch6: smeserver-manager-0.1.4-fix-translation-strings-with-prefix-for-review-config.patch
+Patch7: smeserver-manager-0.1.4-format-for-dhcp-ips-in-review-config.patch
+Patch8: smeserver-manager-0.1.4-fix_backup_empty_selection_list.patch
+
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
+BuildArchitectures: noarch
BuildRequires: e-smith-devtools
-BuildRequires: gettext
-BuildRequires: gcc
+#
+#BuildRequires: perl >= 0:5.016
+#BuildRequires: perl(Test::More)
+#BuildRequires: perl(Test::Mojo)
+#BuildRequires: perl(Mojolicious) >= 7.56
+#BuildRequires: perl(Mojolicious::Plugin::I18N) >= 1.6
+#BuildRequires: perl(Net::Netmask) >= 1.9
+#
+
Requires: e-smith-lib >= 1.18.0-26
Requires: e-smith-manager >= 2.4.0-22
-Requires: perl-Mojolicious >= 6.44
-Requires: perl-Mojolicious-Plugin-I18N >= 1.6
-Requires: pwauth
-Requires: perl(Apache::AuthTkt)
-#Requires: smeserver-manager-html
-#Provides: server-manager2
+Requires: perl(Mojolicious) >= 7.56
+Requires: perl(Mojolicious::Plugin::I18N) >= 1.6
+Requires: perl(Mojolicious::Plugin::RenderFile) >= 0.12
+Requires: perl(Mojolicious::Plugin::CSRFDefender) >= 0.0.8
+Requires: perl(Net::Netmask) >= 1.9
+#Requires: js-jquery > 2.2.4-3 (optional)
+
+Provides: server-manager
AutoReqProv: no
+%define dir_mngr /usr/share/smanager
+
+%description
+This RPM contributes the navigation bars for the smeserver-manager. New Mojolicious version.
+
+%prep
+%setup
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+
+%build
+perl createlinks
+
+# Force creation of potentially empty directories
+mkdir -p root/etc/e-smith/db/routes
+mkdir -p root/home/e-smith/db/navigation2
+mkdir -p root%{dir_mngr}/themes/default/public/css
+
+%install
+rm -rf $RPM_BUILD_ROOT
+(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
+rm -f %{name}-%{version}-%{release}-filelist
+/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
+--dir %{dir_mngr} 'attr(0755,root,root)' \
+--file %{dir_mngr}/log/development.log 'attr(0660,root,admin)' \
+--file %{dir_mngr}/log/production.log 'attr(0660,root,admin)' \
+--file %{dir_mngr}/script/daily.sh 'attr(0770,root,root)' \
+--file %{dir_mngr}/script/routes.pl 'attr(0770,root,root)' \
+--file %{dir_mngr}/script/secrets.pl 'attr(0770,root,root)' \
+> %{name}-%{version}-%{release}-filelist
+
+echo "%doc COPYING f2b/*" >> %{name}-%{version}-%{release}-filelist
+
+%check
+#cd $RPM_BUILD_ROOT/%{dir_mngr} && QUICK_TEST=1 /usr/bin/prove -q -l -r
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%pre
+
+%preun
+if [ -h %{dir_mngr}/themes/default/public/js/jquery.min.js ]
+then
+ unlink %{dir_mngr}/themes/default/public/js/jquery.min.js
+fi
+true
+
+%post
+if [ -f /usr/share/javascript/jquery/latest/jquery.min.js ]
+then
+ [ -d %{dir_mngr}/themes/default/public/js ] ||
+ mkdir %{dir_mngr}/themes/default/public/js
+ [ -h %{dir_mngr}/themes/default/public/js/jquery.min.js ] ||
+ ln -s /usr/share/javascript/jquery/latest/jquery.min.js %{dir_mngr}/themes/default/public/js/jquery.min.js
+fi
+true
+
+%postun
+
+%files -f %{name}-%{version}-%{release}-filelist
+%defattr(-,root,root)
+
%changelog
-* Tue Apr 07 2020 Brian Read 0.1.0-14.sme
+* Mon Dec 27 2021 Michel Begue 0.1.4-10.sme
+- Fix empty selection list in workstation restore of backup panel [SME: 11185]
+
+* Mon Dec 27 2021 Brian Read 0.1.4-9.sme
+- format-for-dhcp-ips-in-review-config [SME: ]
+
+* Sun Dec 26 2021 Brian Read 0.1.4-8.sme
+- fix-translation-strings-with-prefix-for-review-config [SME: 11823]
+
+* Sun Dec 26 2021 Brian Read 0.1.4-7.sme
+- Sort-out-responsive-table-in-user-and-host-lists [SME: 11824]
+
+* Sun Dec 26 2021 Brian Read 0.1.4-6.sme
+- e-format html for Vistual domains inReview config to be compatible with email format list [SME 11822]
+
+* Mon Dec 20 2021 Brian Read 0.1.4-5.sme
+- Add-span-to-group-member-checkbox-list [SME: 11815]
+
+* Mon Nov 29 2021 Brian Read 0.1.4-4.sme
+- Add-dummy-classes-to-ep-files.patch [SME: 11780]
+
+* Mon Nov 15 2021 Michel Begue 0.1.4-3.sme
+- Fix error message when linking, unlinking jquery in spec
+- Correct the 'review' panel presentation
+- Modify CSRFDefender plugin to take into account GET method
+- Add TOKEN param where the GET method is used in templates
+- Remove smanager from local url address
+
+* Mon Oct 11 2021 Michel Begue 0.1.4-2.sme
+- Fix incorrect list order (users, ibays, ...)
+- Add external private access (remote management)
+- Change CSRF error message
+
+* Mon Jun 21 2021 Michel Begue 0.1.4-1.sme
+- New version: smeserver-manager-0.1.4-1 (= 0.1.2-13)
+
+* Sat Jun 19 2021 Michel Begue 0.1.2-13.sme
+- Remove non english locale files (move to smeserver-manager-locale)
+- Fix error in 'locale2-conf' action
+
+* Tue Jun 15 2021 Michel Begue 0.1.2-12.sme
+- Fix errors in daily script
+- Fix url and routes for 'hostentries' panel
+- Change GET to POST method for CSRF plugin (routes and templates)
+- Fix some translations
+
+* Tue Jun 08 2021 Michel Begue 0.1.2-11.sme
+- Add cron job for secrets and routes purge
+- Add CSRFDefender plugin against CSRF attacks
+- Add optional fail2ban configuration files in doc
+- Fix zh-tw locale file name
+- Fix missing links in 'Bugreport'
+- Fix copyright in footer
+- Fix translations
+
+* Thu Jun 03 2021 Michel Begue 0.1.2-10.sme
+- Add header for contrib in layout
+- fix emailsettings error 'webmail is only SSL' [SME: 11443]
+- fix locale files
+- clean up template files
+
+* Wed Apr 21 2021 Michel Begue 0.1.2-9.sme
+- Add access attribute in configuration base
+- Verify modes and access compatibility
+- Display theme_switch button to logged in users only [SME: 11571]
+
+* Tue Apr 20 2021 Michel Begue 0.1.2-8.sme
+- Fix 'theme switch' [SME: 11571]
+
+* Mon Apr 12 2021 Michel Begue 0.1.2-7.sme
+- Fix server-mode in bugreport [SME: 10448]
+- Add systemd-default for smanager type (service) [SME: 11544]
+- Fix smanager type and status in db
+- Move initial security notification to central place
+- Render 'Manual' output in template
+- Add a link to koozali.org on Sme logo
+
+* Mon Jan 25 2021 Michel Begue 0.1.2-6.sme
+- Fix missing backup functions
+- background mode for halt and reboot
+- Store debug mode in ENV
+- Add a warning mode notification
+- Fix some translations needing to be escaped
+
+* Wed Jan 13 2021 Michel Begue 0.1.2-5.sme
+- Fix menu items not translated [SME: 11322]
+- Add other locales files
+
+* Thu Jan 07 2021 Michel Begue 0.1.2-4.sme
+- Fix 404 error when trailing slash is missing
+- Fix missing translations for ibay and quota panels
+- Comment out pptp settings in remoteaccess panel
+- Fix 'sigusr1' exec for httpd [SME: 11185]
+
+* Tue Dec 01 2020 Michel Begue 0.1.2-3.sme
+- Fix download error on 'viewlogfiles' panel [SME: 11217]
+- Fix duplicate entries in log files to be chosen
+- Fix duplicate translation terms in 'General' lexicon
+
+* Fri Nov 20 2020 Michel Begue 0.1.2-2.sme
+- Fix smanager-update event name
+- Move smanager service to /usr/lib/systemd
+- Fix Bugreport file download
+- Fix translations missing in 'viewlogfiles'
+- Remove Admin auth in httpd configuration
+- Add an optional alias for admin sign in.
+- Remove systemctl from .spec file
+
+* Thu Nov 19 2020 Michel Begue 0.1.2-1.sme
+- Create new version smeserver-manager-0.1.2-1 (= 0.1.0-31)
+
+* Wed Oct 07 2020 Michel Begue 0.1.0-31.sme
+- smanager-refresh event come back
+- add smanager version in footer
+- add optional refresh in layout
+- fix yum logfile displaying
+
+* Mon Oct 05 2020 Michel Begue 0.1.0-30.sme
+- fix I18N Namespace change for keeping Language
+- clean up emailsettings code
+- remove old global lexicon files
+- add first simple tests
+- add smanager-update event
+
+* Mon Aug 17 2020 Michel Begue 0.1.0-29.sme
+- validate lexicon file before install
+- fix route url construction (+)
+- add authentication messages to locales
+
+* Fri Aug 07 2020 Michel Begue 0.1.0-28.sme
+- validate netmask in LocalNetworks [SME: 10976]
+- validate netmask in RemoteAccess [SME: 10977]
+- prettier action button
+- accept undescore in lexicon name
+- change route urls for LocalNetworks and Portforwarding
+- add rendering to LocalNetworks notification
+
+* Mon Jul 06 2020 Michel Begue 0.1.0-27.sme
+- Fix typo in %post here
+- Complete 'datetime' panel
+- Fix notification in 'quota' panel
+
+* Wed Jul 01 2020 Michel Begue 0.1.0-26.sme
+- Fix first start error
+- Fix incorrect messages and various typos in modules
+- Add possibility to hide menu(s) (requires jquery)
+
+* Sat Jun 13 2020 Michel Begue 0.1.0-25.sme
+- Remove 'Starterwebsite' panel [SME: 8903]
+- Add choice for creating Pseudonyms [SME: 9457]
+- Change URL in 'useraccounts' templates
+- Change app to smanager in controller 'Swttheme'
+
+* Wed Jun 10 2020 Michel Begue 0.1.0-24.sme
+- Fix missing translations for some panels
+
+* Mon Jun 08 2020 Michel Begue 0.1.0-23.sme
+- Transform to Mojo application (apache/mod_proxy mode)
+- Add internal login and multi mode menus
+- Add userpassword panel
+
+* Fri May 08 2020 Michel Begue 0.1.0-22.sme
+- Fix translation in 'useraccounts' panel
+- Restore theme switcher route
+- Fix theme switcher redirection
+- fix lexicon file not found [SME: 10927]
+
+* Mon Apr 27 2020 Michel Begue 0.1.0-21.sme
+- Fix error and success management
+- Optimize Routes (number)
+- Delete share_dir variable
+- Attach Locale lexicon to Panel and Panel?
+- Fix lack of translation of first page
+
+* Wed Apr 15 2020 Michel Begue 0.1.0-20.sme
+- Patch the I18N plugin to accept namespace changes
+- Split global locales files to module level
+- Consider additional contrib locales files
+- Consider additional contrib routes and navigation item
+- fix colour button in portforwarding panel
+- fix missing esmith::util in starterwebsite panel
+
+* Tue Apr 14 2020 Michel Begue 0.1.0-19.sme
+- Remove tests : useraccounts, wbl
+
+* Sat Apr 11 2020 Michel Begue 0.1.0-18.sme
+- Add panels : emailaccess, yum, backup
+- Fix Rendering comments in portforwarding & localnetworks panels
+- Css and images files added (from manager).
+- Initial javascript in navigation added (jQuery) -optional-
+- Add 'Heading...' navigation informations in controllers
+- Show Themes_switch if there is more than one theme
+
+* Tue Apr 07 2020 Brian Read 0.1.0-15.sme
- Sort out rule comment in portforwarding add panel
* Tue Apr 07 2020 Brian Read 0.1.0-14.sme
@@ -820,135 +1088,3 @@ AutoReqProv: no
* Tue Mar 14 2000 Charlie Brady
Wed Mar 14 2000 --> Wed Mar 08 2000 or Tue Mar 14 2000 or Wed Mar 15 2000 or ....
- initial release
-
-%description
-This RPM contributes the navigation bars for the smeserver-manager.
-
-%prep
-%setup
-%patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
-%patch6 -p1
-%patch7 -p1
-%patch8 -p1
-%patch9 -p1
-%patch10 -p1
-%patch11 -p1
-%patch12 -p1
-%patch13 -p1
-%patch14 -p1
-
-%build
-# Force creation of potentially empty directories
-perl createlinks
-mkdir -p root/etc/e-smith/web/functions2
-mkdir -p root/home/e-smith/db/navigation
-mkdir -p root/etc/e-smith/web/common/css
-mkdir -p root/etc/e-smith/web/panels/manager2/{cgi-bin,html}
-mkdir -p root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/images
-#mkdir -p root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/AdminLTE/public{css,images,js,tmp}
-#mkdir -p root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/AdminLTE/templates/{layouts,partials}
-
-gcc -o root/etc/e-smith/web/functions2/wrapper2 manager2.c
-
-#mkdir -p root/usr/share/locale/en_US/LC_MESSAGES/
-#xgettext -o root/usr/share/locale/en_US/LC_MESSAGES/foot.tmpl.po root/etc/e-smith/templates/etc/e-smith/web/common/foot.tmpl/25Copyright
-## make header/footer symlinks
-#ln -s head.tmpl root/etc/e-smith/web/common/userpassword_head.tmpl
-#ln -s head.tmpl root/etc/e-smith/web/common/noframes_head.tmpl
-#ln -s foot.tmpl root/etc/e-smith/web/common/noframes_foot.tmpl
-
-#mkdir -p root/etc/e-smith/web/panels/manager2/html
-for file in index #initial
-do
- ln -s ../../../functions2/wrapper2 root/etc/e-smith/web/panels/manager2/html/${file}.cgi
-done
-
-# Force creation of potentially empty directories
-#mkdir -p root/etc/httpd/admin-conf
-#mkdir -p root/service
-#mkdir -p root/etc/rc.d/init.d/supervise
-#for service in httpd-admin
-#do
-# ln -s /var/service/$service root/service/$service
-# mkdir -p root/var/service/$service/supervise
-# touch root/var/service/$service/down
-# if [ -d root/var/service/$service/log ]
-# then
-# mkdir -p root/var/service/$service/log/supervise
-# mkdir -p root/var/log/$service
-# fi
-# ln -s ../daemontools root/etc/rc.d/init.d/supervise/$service
-#done
-
-%install
-rm -rf $RPM_BUILD_ROOT
-(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
-rm -f %{name}-%{version}-%{release}-filelist
-/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
---file /etc/e-smith/web/panels/manager2/cgi-bin/wbl 'attr(4750,root,admin)' \
---file /etc/e-smith/web/panels/manager2/cgi-bin/useraccounts 'attr(4750,root,admin)' \
---dir /etc/e-smith/web/panels/manager2 'attr(0755,root,root)' \
---file /etc/e-smith/web/functions2/wrapper2 'attr(4750,root,admin)' \
---file /etc/e-smith/web/functions2/index.cgi 'attr(0500,root,root)' \
-> %{name}-%{version}-%{release}-filelist
-echo "%doc COPYING" >> %{name}-%{version}-%{release}-filelist
-
-
-# Samples only
-# --file /etc/e-smith/web/common/cgi-bin/login 'attr(0755,root,root)' \
-# --file /etc/e-smith/web/common/cgi-bin/logout 'attr(0755,root,root)' \
-# --file /etc/e-smith/web/functions/wrapper 'attr(4750,root,admin)' \
-# --dir /var/service/httpd-admin 'attr(01755,root,root)' \
-# --file /var/service/httpd-admin/down 'attr(0644,root,root)' \
-# --file /var/service/httpd-admin/run 'attr(0755,root,root)' \
-# --dir /var/service/httpd-admin/log 'attr(0755,root,root)' \
-# --dir /var/service/httpd-admin/log/supervise 'attr(0700,root,root)' \
-# --dir /var/service/httpd-admin/supervise 'attr(0700,root,root)' \
-# --file /var/service/httpd-admin/log/run 'attr(0755,root,root)' \
-# --dir /var/log/httpd-admin 'attr(0750,smelog,smelog)' \
-# > %{name}-%{version}-%{release}-filelist
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%pre
-%preun
-#rm -f /etc/e-smith/web/panels/manager2/srvmngr/public/css/sme_core.css
-#rm -f /etc/e-smith/web/panels/manager2/srvmngr/public/images/btn_donateCC_LG.gif
-#rm -f /etc/e-smith/web/panels/manager2/cgi-bin/logout
-
-%post
-#find /etc/e-smith/web/panels/manager/cgi-bin/ -type f | \
-# sed -n '/\/[0-9a-z]\{32\}$/p' | \
-# xargs grep -l Persisten | \
-# xargs rm -f
-ln -s /etc/e-smith/web/common/css/sme_core.css /etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_core.css
-ln -s /etc/e-smith/web/common/css/sme_main.css /etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_main.css
-ln -s /etc/e-smith/web/common/css/sme_menu.css /etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_menu.css
-ln -s /etc/e-smith/web/common/btn_donateCC_LG.gif /etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/images/btn_donateCC_LG.gif
-ln -s /etc/e-smith/web/common/smeserver_logo.jpg /etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/images/smeserver_logo.jpg
-ln -s /etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/conf/srvmngr.conf /etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/srvmngr.conf
-ln -s /etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/script/srvmngr.pl /etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/srvmngr.pl
-ln -s /etc/e-smith/web/common/cgi-bin/logout /etc/e-smith/web/panels/manager2/cgi-bin/logout
-/sbin/e-smith/expand-template /etc/httpd/admin-conf/httpd.conf
-chmod 0755 /etc/e-smith/web/panels/manager2/html/index.cgi
-chown root:admin /etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/log/development.log
-chmod 0660 /etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/log/development.log
-chown root:admin /etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/js/navigation.js
-chmod 0660 /etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/js/navigation.js
-#chown root:admin /etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/AdminLTE/public/js/navigation.js
-#chmod 0660 /etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/AdminLTE/public/js/navigation.js
-chown root:admin /etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_navig.html.ep
-chmod 0660 /etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/templates/partials/_navig.html.ep
-chown root:admin /etc/e-smith/web/functions2/wrapper2
-chmod 4750 /etc/e-smith/web/functions2/wrapper2
-
-
-%postun
-%files -f %{name}-%{version}-%{release}-filelist
-%defattr(-,root,root)