65 Commits

Author SHA1 Message Date
Arne Fitzenreiter
36c16c71ed core183: replace https rsa key if it is too small
new openssl need at least 2048 bit rsa keys for apache.
So if the existing is smaller a new 4096 bit key is generated.

fixes #13527

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2024-01-18 18:02:10 +01:00
Adolf Belka
3f18addede backup.pl: Fix for bug#11048 - add script for adding pass/no pass to ovpnconfig from backup
- A script was added to the update.sh script to add pass/no pass to the ovpnconfig entries
   but I forgot that this was also needed in the backup.pl file to add those statuses into
   any ovpnconfig file restored from a backup before the pass/no pass entries were added.
- This patch corrects that oversight.
- Confirmed by testing on my vm. Before the script added to backup.pl a restore of older
   ovpnconfig ended up not showing any icons or status elements. With the script in
   backup.pl confirmed that the restored ovpnconfig showed up in the WUI page correctly
   with the right icons and with the status elements correctly displayed.

Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2023-10-20 08:41:01 +00:00
Adolf Belka
9eb2086e0f backup.pl: Fixes Bug#13137 - Existing n2n client connection created with openssl-1.1.1x fails to start with openssl-3.x
- This code adds the "providers legacy default" line into OpenVPN N2N Client config files
   when restoring them in case it is missing from a backup earlier than CU175.
   Only adds the line if it is not already present.
- Tested out on my vm testbed system

Fixes: Bug#13137
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2023-06-05 14:50:18 +00:00
Peter Müller
bbbb0b9e01 backup(.pl): Replace OpenVPN DH parameter with ffdhe4096
This ensures restoring a backup won't silently bring back an insecure
Diffie-Hellman parameter (which could also not be inspected through the
web interface anymore).

Reported-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-12-17 14:46:32 +00:00
Michael Tremer
233baacd67 backup: Update OpenVPN CRL
After a backup is restored, the CRL might be out of data and client
won't be able to connect to the server any more.

This will immediately update the CRL should it require an update.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-10-24 09:06:16 +00:00
Peter Müller
8df2cfb9c7 backup.pl: Delete directives for dropped OpenVPN convert script
See 0b6d12adae.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Adolf Belka <adolf.belka@ipfire.org>
2022-07-09 15:04:26 +00:00
Peter Müller
c1a5a49b47 backup.pl: Include logwatch summary into backups as well
Fixes: 12827
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Adolf Belka <adolf.belka@ipfire.org>
2022-07-09 15:04:26 +00:00
Peter Müller
4d4f5df0c8 Merge branch 'temp-stevee-idsv4' into next 2022-05-05 16:07:41 +00:00
Stefan Schantl
b3dbe9ef64 backup.pl: Run convert-ids-backend-files converter.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-16 15:57:34 +02:00
Michael Tremer
d5d3748b02 backup: Move empty check to the correct place
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-30 15:50:55 +00:00
Michael Tremer
b275771fdd backup: Only list files that exist
This will prevent tar from throwing any errors later on

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-30 13:43:25 +00:00
Michael Tremer
4f0e7f24f2 backup: Ignore any empty lines in backup include list
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-30 13:43:25 +00:00
Michael Tremer
13f6473a4f backup: Fix broken globbing expansion
This patch fixes globbing expansion in the backup include file list
which got broken in c7e0d73e7c.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Tested-by: Bernhard Bitsch <bernhard.bitsch@ipfire.org>
2022-03-30 13:43:25 +00:00
Michael Tremer
c7e0d73e7c backup: Make include/exclude files relative
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-07 18:51:23 +00:00
Michael Tremer
3f8e70f6b3 backup: Don't restore excluded files
Sometimes, we restore a backup that has been created earlier before
exclude files have been changed. To avoid overwriting those files, we
will consider the exlude list upon restore.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-07 18:51:20 +00:00
Michael Tremer
fc717041c4 backup: Abort when the backup could not be extracted
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-07 18:51:14 +00:00
Peter Müller
86cf6898aa Merge branch 'master-IDSv3' into temp-c164-development 2022-01-14 14:05:10 +00:00
Stefan Schantl
4aa1382e22 backup.pl: Launch convert-ids-multiple-providers if neccessary.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:44 +01:00
Michael Tremer
45a5df5a5e backup: Fork ISO job into the background in CGI script
In order to be able to run the ISO command on command line it is helpful
that the script does not go into background halfway through the process.

We should rather start it as a background job straight from the CGI
script.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-12-14 14:39:26 +01:00
Michael Tremer
51ed815f5e backup: Create tarball in one pass
This patch is changing the behaviour of the backup script so that it
creates one tarball and compresses it in one go.

This will save storing the original tarball on disk before compressing
it which on my test system requires significant disk space.

This patch also solves a bug where the backup file included with the ISO
image could not be extracted because it was not gzip-compressed when it
was expected to be.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-12-14 14:39:21 +01:00
Michael Tremer
d9db91609f backup: Use filename as specified on console
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-12-14 14:39:17 +01:00
Adolf Belka
e5f3e0397c backup.pl: Fix #12626 backup/include.user entries will not override backup/exclude
- Current situation is that any restrictions in the exclude file will not
   be overwritten by the include.user file
- For example the global exclude file has *.tmp preventing any tmp files
   being backed up from the globally included IPFire files
   If a user has some specific tmp files they want to backup and include
   them in the include.user file they will not override the global
   exclude file.
- This fix does the backup of the global and user backups as two separate
   events and then appends them. This means that any tmp files in the
   include.user file will be backed up.
- The backups are created as a global tar file and then have the user
   tar file appended and then the combined file gzipped and given the .ipf
   suffix. This has to be done this was as gzipped files can not be
   appended to each other whereas tar files can.

Fixes: 12626
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-05-25 09:43:57 +00:00
Stefan Schantl
f1d982cce6 Add convert-to-location converter.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-15 18:21:57 +02:00
Arne Fitzenreiter
34b7b98616 core144: add dhcpcd initskript and user
this commit also re/create the user after backup restore.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-04-19 17:39:47 +00:00
Arne Fitzenreiter
5562f26f69 vnstat: remove wrong tag file
fixes #12305

I had created this tag file to ship the folder but vnstat doesn't like empty files.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-03-26 17:56:23 +00:00
Arne Fitzenreiter
6df8a22b8a core141: correct move of nobeeps flag
in core139 there was a syntax error, and it was missed in
backup converter also.

fixes #12273

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-01-26 13:07:08 +01:00
Michael Tremer
ecbf66761f DNS: Add converter to migrate settings
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-01-07 10:43:19 +00:00
Tim FitzGeorge
28797d488e Restart logging after restoring backup
Send SIGHUP to syslogd and suricata after restoring backup.  This ensures that
if the restored backup includes log files that any new log messages get
appended to the restored log files.  Otherwise they will be written to the
old log files which are pending deletion.

httpd is told to restart using apachectl, which is the equivalent of sending
a signal. 'graceful' (USR1) is used rather than 'restart' (HUP) because the
latter immediately kills the process restoring the backup, preventing
converters from running.

Fixes: 12196
Signed-off-by: Tim FitzGeorge <ipfr@tfitzgeorge.me.uk>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-10-14 17:27:54 +00:00
Michael Tremer
175f5c060e backup: Allow passing name of tarball for creation/restore
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-04-16 13:22:10 +01:00
Stefan Schantl
8c27372438 backup.pl: Run snort to suricata converter when a backup gets restored.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-01-29 08:40:34 +01:00
Michael Tremer
4f10c0b3a3 backup: Fix expanding glogging
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-11-01 10:27:09 +00:00
Michael Tremer
c7b7a70deb backup: Rewrite backup script
The old script was quite messy and written in perl although
it was only calling shell commands.

This version is now written in shell although keeping the .pl
file suffix and is a drop-in replacement.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-10-31 14:22:56 +00:00
Michael Tremer
a6c190818a backup: Fix deleting backup files
Signed-off-by: Arne Fitzenreiter <arne.fitzenreiter@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-09-20 14:21:41 +01:00
Matthias Fischer
84578512f5 Fixes for 'backup.pl' (Bug #11816)
Hi,

Fixes #11816
(https://bugzilla.ipfire.org/show_bug.cgi?id=11816 and
https://bugzilla.ipfire.org/attachment.cgi?id=608):

"[root@ipfire ~]# backupctrl exclude
...
tar: The following options were used after any non-optional arguments in
archive create or update mode.  These options are positional and affect
only arguments that follow them.  Please, rearrange them properly.
tar: --exclude-from '/var/ipfire/backup/exclude.user' has no effect
tar: Exiting with failure status due to previous errors"

Please test - I got no errors anymore.

Best,
Matthias

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-14 20:38:47 +01:00
Arne Fitzenreiter
5604dc748d backup: make include file parsing more robust. 2015-03-06 17:22:18 +01:00
Arne Fitzenreiter
2b4593b27f backup.pl: remove wrong curly bracket. 2014-02-04 16:01:43 +01:00
Michael Tremer
9063a04e94 Merge branch 'master' into fifteen
Conflicts:
	config/backup/backup.pl
2014-01-09 13:31:25 +01:00
Michael Tremer
59cbe38697 backup: Convert backups with old CCD files. 2014-01-09 12:31:31 +01:00
Alexander Marx
cbc6219852 Firewall: Fix typo in backup script which stops the conversion of old firewallrules 2013-11-08 13:41:25 +01:00
Alexander Marx
8039a71099 Firewall: renamed forwardfwctrl to firewallctrl 2013-10-24 09:42:42 +02:00
Alexander Marx
6d8eb5dec7 Firewall: Renamed directory /var/ipfire/forward to /var/ipfire/firewall 2013-10-24 09:24:12 +02:00
Alexander Marx
e09884e04f Forward Firewall: some fixes:
1) Counter was not correctly decreased when deleting a network from a customgroup
2) Convert-outgoingfw improved
3) Backup didn't set filepermissions correctly
2013-08-09 14:12:39 +02:00
Alexander Marx
f7e649ddfb Forward Firewall: some typos in dmz-converter 2013-08-09 14:12:39 +02:00
Alexander Marx
a60dbb4b6a Forward Firewall: added dmz-converter.
Also extended backup.pl script to support old backups. Now it is possible to restore old backups into new firewall. On restore, all config files of new firewall will be destroyed and the 4 converters will recreate them.
2013-08-09 14:12:37 +02:00
Alexander Marx
9edb1d7a8e Forward Firewall: edited Backup.pl. If someone put /var/ipfire/outgoing into /var/ipfire/backup/include, the rules are backed up and need to be restored.
Now the backup takes care of this and checks if there are old rules to convert.
2013-08-09 14:08:13 +02:00
Alexander Marx
99e698d033 Forward Firewall: Minor changes...
1) improved convert-outgoingfw. source was wrong when tun+ interface
2) target had always a ":" in ruletable
3) convert-outgoingfw bugfix: ports where not cleared for next rule
2013-08-09 14:08:12 +02:00
Alexander Marx
e0800c21db Forward Firewall: Edited Backup.pl so that any old backups get converted to new firewall. Afterwards the directories /var/ipfire/outgoing and /var/ipfire/xtaccess are removed! 2013-08-09 14:08:12 +02:00
Alexander Marx
c490c6e802 Backup: added ovpn-ccd-converter script to restore. With this patch one is able to restore old backups and the openvpn clients get converted for new ccd-file 2013-01-07 15:36:27 +01:00
Christian Schmidt
cb13f50d50 Fixed backup not taking user files into account. 2011-03-15 18:28:07 +01:00
Christian Schmidt
c0faa0efaf Fixed all those tar --preserve errors present. 2010-02-20 12:41:57 +01:00