Code Monkey home page Code Monkey logo

docker-backuppc's Introduction

👋

I'm Dave, residing in the far west of Canada. In the 2000s I got fed up with my life working with computers and sold everything I owned, bought a bicycle, and rode it around the world. Eventually along the way I ran out of money, got married, and ended up moving back to Canada. You guessed it, I'm back in IT doing "good" for organizations around the world.

I'm using Github to share some of the work in use for clients, sanitized for public consumption. I like lightweight, highly configurable solutions that can meet more than a single use case.

I'm helping a limited number of teams and organizations. If you would like to have my help with your team and/or product, feel free to contact me.

If my open source projects are useful for your product/company you can also sponsor my work on them.

My website https://www.tiredofit.ca has more details.

docker-backuppc's People

Contributors

stephdl avatar tiredofit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

docker-backuppc's Issues

Error in log: can't open 'BackupPC-4.3.1.tar.gz': No such file or directory

I am trying to start this container and got following in logs:

backuppc                 | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
backuppc                 | [INFO] ** [nginx] Starting nginx 1.17.9
backuppc                 | [INFO] ** [fcgiwrap] Starting fcgiwrap
backuppc                 | [INFO] ** [zabbix] Starting Zabbix Agent
backuppc                 | [s6-init] ensuring user provided files have correct perms...nginx: [emerg] open() "/www/logs/nginx/error.log" failed (2: No such file or directory)
backuppc                 | exited 0.
backuppc                 | [fix-attrs.d] applying ownership & permissions fixes...
backuppc                 | [fix-attrs.d] 00-functions: applying... 
backuppc                 | [fix-attrs.d] 00-functions: exited 0.
backuppc                 | [fix-attrs.d] 01-s6: applying... 
backuppc                 | [fix-attrs.d] 01-s6: exited 0.
backuppc                 | [fix-attrs.d] 02-zabbix: applying... 
backuppc                 | [fix-attrs.d] 02-zabbix: exited 0.
backuppc                 | [fix-attrs.d] 03-logrotate: applying... 
backuppc                 | [fix-attrs.d] 03-logrotate: exited 0.
backuppc                 | [fix-attrs.d] done.
backuppc                 | [cont-init.d] executing container initialization scripts...
backuppc                 | [cont-init.d] 00-startup: executing... 
backuppc                 | [NOTICE] ** [container-init] Detected Container that has been restarted - Cleaning '/tmp/state' files
backuppc                 | [cont-init.d] 00-startup: exited 0.
backuppc                 | [cont-init.d] 01-timezone: executing... 
backuppc                 | [NOTICE] ** [timezone] Setting timezone to 'America/Vancouver'
backuppc                 | cp: can't create '/etc/localtime': File exists
backuppc                 | [cont-init.d] 01-timezone: exited 0.
backuppc                 | [cont-init.d] 02-permissions: executing... 
backuppc                 | [cont-init.d] 02-permissions: exited 0.
backuppc                 | [cont-init.d] 03-zabbix: executing... 
backuppc                 | [cont-init.d] 03-zabbix: exited 0.
backuppc                 | [cont-init.d] 04-cron: executing... 
backuppc                 | [cont-init.d] 04-cron: exited 0.
backuppc                 | [cont-init.d] 05-smtp: executing... 
backuppc                 | [NOTICE] ** [smtp] Sendmail replaced and enabled to route mail to: 'postfix-relay'
backuppc                 | [cont-init.d] 05-smtp: exited 0.
backuppc                 | [cont-init.d] 10-nginx: executing... 
backuppc                 | /etc/nginx/nginx.conf ATTRIB 
backuppc                 | [NOTICE] ** [nginx] Disable Nginx FastCGI HTTPS Termination Support
backuppc                 | [cont-init.d] 10-nginx: exited 0.
backuppc                 | [cont-init.d] 11-nginx-config-reload: executing... 
backuppc                 | [cont-init.d] 11-nginx-config-reload: exited 0.
backuppc                 | [cont-init.d] 20-backuppc: executing... 
backuppc                 | [WARN] ** [backuppc] First run of the container. BackupPC will be installed.
backuppc                 | [WARN] ** [backuppc] If exist, configuration and data will be reused and upgraded as needed.
backuppc                 | addgroup: group 'backuppc' in use
backuppc                 | adduser: user 'backuppc' in use
backuppc                 | tar: can't open 'BackupPC-4.3.1.tar.gz': No such file or directory
backuppc                 | /var/run/s6/etc/cont-init.d/20-backuppc: line 29: cd: /usr/src/BackupPC-4.3.1: No such file or directory
backuppc                 | [INFO] ** [backuppc] Container initialization complete
backuppc                 | [cont-init.d] 20-backuppc: exited 0.
backuppc                 | [cont-init.d] 99-container: executing... 
backuppc                 | [cont-init.d] 99-container: exited 0.
backuppc                 | [cont-init.d] done.
backuppc                 | [services.d] starting services
backuppc                 | [services.d] done.
backuppc                 | [INFO] ** [zabbix] Starting Zabbix Agent
backuppc                 | [INFO] ** [fcgiwrap] Starting fcgiwrap
backuppc                 | [INFO] ** [nginx] Starting nginx 1.17.9
backuppc                 | [INFO] ** [cron] Starting cron

Note this line:

backuppc                 | tar: can't open 'BackupPC-4.3.1.tar.gz': No such file or directory
backuppc                 | /var/run/s6/etc/cont-init.d/20-backuppc: line 29: cd: /usr/src/BackupPC-4.3.1: No such file or directory

Here is what I see in the web interface:
screenshot_001

Opened shell inside container and checked /usr/src/ dir - it is empty.

Have following content in docker-compose.yml for backuppc:

  backuppc:
    image: tiredofit/backuppc
    container_name: backuppc
    volumes:
      - /home/backup:/var/lib/backuppc
      - ./c-backuppc-data/etc:/etc/backuppc
      - ./c-backuppc-data/home:/home/backuppc
      - /home/backup/logs:/www/logs
      - /etc/localtime:/etc/localtime:ro
    environment:
      - VIRTUAL_HOST=<<HIDDEN>>
      - VIRTUAL_PORT=80
      - ZABBIX_HOSTNAME=backuppc
      - BACKUPPC_ADMIN_USER=<<HIDDEN>>
      - BACKUPPC_ADMIN_PASS=<<HIDDEN>>
      - BACKUPPC_UUID=1111
      - BACKUPPC_GUID=1111
      - AUTHENTICATION_TYPE=BASIC
      - LETSENCRYPT_HOST=<<HIDDEN>>
      - LETSENCRYPT_EMAIL=<<HIDDEN>>

Little problem with BackupPC service "run" files

Hello Dave,

First of all thank you for all this great job you do.
Today I had headaches while trying to run BackupPC docker image based on this Git repo. It failed with:

s6-supervise 20-backuppc: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise 11-fcgiwrap: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: Permission denied
s6-supervise (child): fatal: unable to exec run: Permission denied

After investigation realized that "run" files for 11 and 20 services had no execute permission. I set it manually after the config was already on Docker volume and all ran fine. Please set the permission during Docker image creation or other approach.

Thank you! Keep the good work! :)

Kind regards,
Emil

App crash after first configuration modification in webUI

Summary

App crash after first configuration modification in webUI, especially when you add a new host.

Steps to reproduce

  • Start docker compose
  • Get into webui
  • Try to add an host
  • Press the save button, the app is now crashed

What is the expected correct behavior?

It should not crash the app.

Relevant logs and/or screenshots

After a fresh install, the first time I want to edit configuration via the WebUI and save it, I get this error:

Software error:

Not an ARRAY reference at /usr/local/BackupPC/lib/BackupPC/CGI/Lib.pm line 468.

For help, please send mail to this site's webmaster, giving this error message and the time and date of the error. 

When I diff the two config file, I see it changed in a different structure, mainly replacing [ by ), like this diff shows:

 diff -u conf/etc/config.pl conf/etc/config.pl.old 
--- conf/etc/config.pl	2022-12-20 00:34:51.435645568 +0000
+++ conf/etc/config.pl.old	2022-12-20 00:11:30.109434305 +0000
@@ -113,7 +113,7 @@
 # you want BackupPC_nightly to run (eg: when you don't expect a lot
 # of regular backups to run).
 #
-$Conf{WakeupSchedule} = (
+$Conf{WakeupSchedule} = [
   1,
   2,
   3,
@@ -137,7 +137,7 @@
   21,
   22,
   23
-);
+];
 
After webUI config edit ``` backuppc-backuppc-1 | ,---. backuppc-backuppc-1 | ,--------.,--. ,--. ,---. ,--. ,--------.| | backuppc-backuppc-1 | '--. .--'`--',--.--. ,---. ,-| | ,---. / .-' | | '--. .--'| .' backuppc-backuppc-1 | | | ,--.| .--'| .-. :' .-. | | .-. || `-, | | | | | | backuppc-backuppc-1 | | | | || | \ --.\ `-' | ' '-' '| .-' | |.--.| | `--' backuppc-backuppc-1 | `--' `--'`--' `----' `---' `---' `--' `--''--'`--' .--. backuppc-backuppc-1 | '--' backuppc-backuppc-1 | Image: tiredofit/backuppc | Version 6.0.0 Type 'image_changelog' for details backuppc-backuppc-1 | Repository/Issues/Support: https://github.com/tiredofit/docker-backuppc/ backuppc-backuppc-1 | Sponsor me for development and upkeep: https://www.tiredofit.ca/sponsor backuppc-backuppc-1 | backuppc-backuppc-1 | 2022-12-19.19:42:42 [NOTICE] ** [monitoring] Container configured for monitoring with 'zabbix modern' backuppc-backuppc-1 | 2022-12-19.19:42:42 [NOTICE] ** [scheduling] Container configured for scheduled tasks with 'cron' backuppc-backuppc-1 | 2022-12-19.19:42:43 [NOTICE] ** [messaging] Container configured to route mail via SMTP to 'postfix-relay' backuppc-backuppc-1 | 2022-12-19.19:42:44 [INFO] ** [backuppc] BackupPC 4.4.0 initialization complete, now starting web server on port 80 backuppc-backuppc-1 | 2022-12-19.19:42:44 [STARTING] ** [fcgiwrap] [1] Starting fcgiwrap backuppc-backuppc-1 | 2022-12-19.19:42:44 [STARTING] ** [nginx] [1] Starting nginx 1.23.2 backuppc-backuppc-1 | 2022-12-19.19:42:44 [STARTING] ** [backuppc] [1] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:42:44 [STARTING] ** [monitoring] [1] Starting Zabbix Agent (modern) 6.2.4 backuppc-backuppc-1 | 2022-12-19.19:42:44 [STARTING] ** [scheduling] [1] Starting cron backuppc-backuppc-1 | 2022-12-19.19:47:32 [STARTING] ** [backuppc] [2] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:33 [STARTING] ** [backuppc] [3] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:34 [STARTING] ** [backuppc] [4] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:35 [STARTING] ** [backuppc] [5] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:36 [STARTING] ** [backuppc] [6] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:37 [STARTING] ** [backuppc] [7] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:38 [STARTING] ** [backuppc] [8] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:39 [STARTING] ** [backuppc] [9] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:40 [STARTING] ** [backuppc] [10] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:41 [STARTING] ** [backuppc] [11] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:42 [STARTING] ** [backuppc] [12] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:43 [STARTING] ** [backuppc] [13] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:44 [STARTING] ** [backuppc] [14] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:45 [STARTING] ** [backuppc] [15] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:46 [STARTING] ** [backuppc] [16] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:47 [STARTING] ** [backuppc] [17] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:48 [STARTING] ** [backuppc] [18] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:49 [STARTING] ** [backuppc] [19] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:50 [STARTING] ** [backuppc] [20] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:51 [STARTING] ** [backuppc] [21] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:52 [STARTING] ** [backuppc] [22] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:53 [STARTING] ** [backuppc] [23] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:54 [STARTING] ** [backuppc] [24] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:55 [STARTING] ** [backuppc] [25] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:56 [STARTING] ** [backuppc] [26] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:57 [STARTING] ** [backuppc] [27] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:58 [STARTING] ** [backuppc] [28] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:47:59 [STARTING] ** [backuppc] [29] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:00 [STARTING] ** [backuppc] [30] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:01 [STARTING] ** [backuppc] [31] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:02 [STARTING] ** [backuppc] [32] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:03 [STARTING] ** [backuppc] [33] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:04 [STARTING] ** [backuppc] [34] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:05 [STARTING] ** [backuppc] [35] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:06 [STARTING] ** [backuppc] [36] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:07 [STARTING] ** [backuppc] [37] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:08 [STARTING] ** [backuppc] [38] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:09 [STARTING] ** [backuppc] [39] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:10 [STARTING] ** [backuppc] [40] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:11 [STARTING] ** [backuppc] [41] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:12 [STARTING] ** [backuppc] [42] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:13 [STARTING] ** [backuppc] [43] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:14 [STARTING] ** [backuppc] [44] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:15 [STARTING] ** [backuppc] [45] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:16 [STARTING] ** [backuppc] [46] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:17 [STARTING] ** [backuppc] [47] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:18 [STARTING] ** [backuppc] [48] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:19 [STARTING] ** [backuppc] [49] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:20 [STARTING] ** [backuppc] [50] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:48:21 [ERROR] ** [backuppc] POTENTIAL RUNWAY DETECTECTED: Disabling 20-backuppc service because it has tried restarting '50' times ```

Environment

From inside the container:

[tiredofit/backuppc:6.0.0 19:43:31 /data] $ su -s /bin/bash  backuppc
[tiredofit/backuppc:6.0.0 19:43:37 /data] $ whoami 
backuppc
[tiredofit/backuppc:6.0.0 19:43:40 /data] $ /usr/local/BackupPC/bin/BackupPC --help
/usr/local/BackupPC/bin/BackupPC version [unknown] calling Getopt::Std::getopts (version 1.13 [paranoid]),
running under Perl version 5.36.0.

Usage: BackupPC [-OPTIONS [-MORE_OPTIONS]] [--] [PROGRAM_ARG1 ...]

The following single-character options are accepted:
	Boolean (without arguments): -d

Options may be merged together.  -- stops processing of options.
  [Now continuing due to backward compatibility and excessive paranoia.
   See 'perldoc Getopt::Std' about $Getopt::Std::STANDARD_HELP_VERSION.]
2022-12-19 19:43:56 Another BackupPC is running (pid 1525); quitting...
  • Image version / tag: tiredofit/backuppc:6.0.0
  • Host OS: Debian 11
Before editing config ``` backuppc-backuppc-1 | ,---. backuppc-backuppc-1 | ,--------.,--. ,--. ,---. ,--. ,--------.| | backuppc-backuppc-1 | '--. .--'`--',--.--. ,---. ,-| | ,---. / .-' | | '--. .--'| .' backuppc-backuppc-1 | | | ,--.| .--'| .-. :' .-. | | .-. || `-, | | | | | | backuppc-backuppc-1 | | | | || | \ --.\ `-' | ' '-' '| .-' | |.--.| | `--' backuppc-backuppc-1 | `--' `--'`--' `----' `---' `---' `--' `--''--'`--' .--. backuppc-backuppc-1 | '--' backuppc-backuppc-1 | Image: tiredofit/backuppc | Version 6.0.0 Type 'image_changelog' for details backuppc-backuppc-1 | Repository/Issues/Support: https://github.com/tiredofit/docker-backuppc/ backuppc-backuppc-1 | Sponsor me for development and upkeep: https://www.tiredofit.ca/sponsor backuppc-backuppc-1 | backuppc-backuppc-1 | 2022-12-19.19:42:42 [NOTICE] ** [monitoring] Container configured for monitoring with 'zabbix modern' backuppc-backuppc-1 | 2022-12-19.19:42:42 [NOTICE] ** [scheduling] Container configured for scheduled tasks with 'cron' backuppc-backuppc-1 | 2022-12-19.19:42:43 [NOTICE] ** [messaging] Container configured to route mail via SMTP to 'postfix-relay' backuppc-backuppc-1 | 2022-12-19.19:42:44 [INFO] ** [backuppc] BackupPC 4.4.0 initialization complete, now starting web server on port 80 backuppc-backuppc-1 | 2022-12-19.19:42:44 [STARTING] ** [fcgiwrap] [1] Starting fcgiwrap backuppc-backuppc-1 | 2022-12-19.19:42:44 [STARTING] ** [nginx] [1] Starting nginx 1.23.2 backuppc-backuppc-1 | 2022-12-19.19:42:44 [STARTING] ** [backuppc] [1] Starting BackupPC 4.4.0 backuppc-backuppc-1 | 2022-12-19.19:42:44 [STARTING] ** [monitoring] [1] Starting Zabbix Agent (modern) 6.2.4 backuppc-backuppc-1 | 2022-12-19.19:42:44 [STARTING] ** [scheduling] [1] Starting cron ```

Possible fixes

A possible workaround is to NOT use the web ui to edit the config OR to fix the file with a text editor after each UI modifcation.

I'm not a perl guy, but I'm wondering if the current version of perl (5.36.0) still support backuppc, wich is basically compatible since perl 5.8 (2002!). Should we try with a older perl version ?

In the end, I'm not sure anymore I want to use a software that is not really maintened anymore. It seems you are/were an heavy user of backuppc, do you now use something else ?

Errors and incomplete instalation on unraid

Summary

Hi, an unraid user has been trying to get some assistance with their installation on backuppc-users. It looks like the dockerfile may have a few problems. During installation, the user is getting the following error messages:

chown: unknown user backuppc
chown: unknown user/group backuppc:backuppc
tar: can't open 'BackupPC-4.4.0.tar.gz': No such file or directory
/etc/cont-init.d/20-backuppc: line 33: cd: /usr/src/BackupPC-4.4.0: No such file or directory

The mailing list thread can be browsed here: https://sourceforge.net/p/backuppc/mailman/backuppc-users/thread/CAARZCx8wnHTQ0wk9mU5Wn2xM%3DvuEQO%2BBXxqjQFD8kEdPUVvgDA%40mail.gmail.com/#msg37743113

I'm not a Docker guy, so I may be wrong, but I think that lines 13 &14 of /etc/cont-init.d/20-backuppc might be referencing a file that has moved? The file looks like it might be at /install/assets/defaults/20-backuppc now?

And the tar error might be happening because lines 104 through 118 of the dockerfile are downloading the archive to /usr/src/, and then deleting the contents of /usr/src/ before anything else is able to unpack the archive?

Thanks for making backuppc available to unraid users.

Backupfehler (BackupPC_tarExtract exited with fail status 256)

Summary

I was able to make the last error-free backup on 2022-05-08 15:00

Steps to reproduce

What is the expected correct behavior?

backup successful

Relevant logs and/or screenshots

Environment

unraid Container
tiredofit/backuppc:latest

  • Image version / tag:
  • Host OS:
Any logs | docker-compose.yml

Possible fixes

Fails to start on Truenas SCALE

On Truenas SCALE the following occurs (even with v2.0.6):

2022-12-18 08:28:50.909910+00:00Image:  tiredofit/backuppc | Version  6.0.0 Type 'image_changelog' for details
2022-12-18 08:28:50.909930+00:00Repository/Issues/Support:  https://github.com/tiredofit/docker-backuppc/
2022-12-18 08:28:50.912481+00:00Sponsor me for development and upkeep: https://www.tiredofit.ca/sponsor
2022-12-18 08:28:50.912605+00:002022-12-18T08:28:50.912605878Z
2022-12-18 08:28:51.333534+00:002022-12-18.10:28:51 �[100m[NOTICE]�[49m ** [monitoring] Container configured for monitoring with 'zabbix modern'
2022-12-18 08:28:51.515482+00:002022-12-18.10:28:51 �[100m[NOTICE]�[49m ** [scheduling] Container configured for scheduled tasks with 'cron'
2022-12-18 08:28:51.851491+00:002022-12-18.10:28:51 �[100m[NOTICE]�[49m ** [messaging] Container configured to route mail via SMTP to 'postfix-relay'
2022-12-18 08:28:53.718682+00:002022-12-18.10:28:53 �[42m[INFO]�[49m ** [backuppc] BackupPC 4.4.0 initialization complete, now starting web server on port 80
2022-12-18 08:28:54.011940+00:002022-12-18.10:28:54 �[42m[STARTING]�[49m ** [fcgiwrap] [1] Starting fcgiwrap
2022-12-18 08:28:54.012532+00:002022-12-18.10:28:54 �[42m[STARTING]�[49m ** [nginx] [1] Starting nginx 1.23.2
2022-12-18 08:28:54.022091+00:002022-12-18.10:28:54 �[42m[STARTING]�[49m ** [backuppc] [1] Starting BackupPC 4.4.0
2022-12-18 08:28:54.109819+00:002022-12-18.10:28:54 �[42m[STARTING]�[49m ** [monitoring] [1] Starting Zabbix Agent (modern) 6.2.4
2022-12-18 08:28:54.199495+00:002022-12-18.10:28:54 �[42m[STARTING]�[49m ** [scheduling] [1] Starting cron
2022-12-18 08:28:55.029357+00:002022-12-18.10:28:55 �[42m[STARTING]�[49m ** [backuppc] [2] Starting BackupPC 4.4.0
...
...
2022-12-18 08:29:41.121006+00:002022-12-18.10:29:41 �[42m[STARTING]�[49m ** [backuppc] [48] Starting BackupPC 4.4.0
2022-12-18 08:29:42.121011+00:002022-12-18.10:29:42 �[42m[STARTING]�[49m ** [backuppc] [49] Starting BackupPC 4.4.0
2022-12-18 08:29:43.122099+00:002022-12-18.10:29:43 �[42m[STARTING]�[49m ** [backuppc] [50] Starting BackupPC 4.4.0
2022-12-18 08:29:44.126831+00:002022-12-18.10:29:44 �[101m[ERROR]�[49m ** [backuppc] POTENTIAL RUNWAY DETECTECTED: Disabling 20-backuppc service because it has tried restarting '50' times
2022-12-18 08:40:25.765622+00:00s6-svwait: fatal: supervisor died

missing ports: in docker-compose.yml

Summary

Using the "working" docker-compose.yml in the examples folder doesn't work.

Steps to reproduce

git clone https://github.com/tiredofit/docker-backuppc.git
cd docker-backuppc/examples
docker-compose up --no-start
docker start backuppc-app
telnet localhost 80
#run the next command on humanhost, not localhost
observe --result=telnet: Unable to connect to remote host: Connection refused

What is the expected correct behavior?

#run on humanhost
observe --result=Trying ::1...\n
Connected to localhost.\n
Escape character is '^]'.\n

enter --value=quit

observe --result=HTTP/1.1 400 Bad Request\n
Server: nginx/1.19.9\n
Date: Mon, 20 Apr 2071 17:58:00 GMT\n
Content-Type: text/html\n
Content-Length: 157\n
Connection: close\n
\n \

\\n \ <title>400 Bad Request</title>\\n \ \\n \

400 Bad Request

\\n \
nginx/1.19.9\\n \ \\n \ \\n \ Connection closed by foreign host.

Relevant logs and/or screenshots

Environment

  • Image version / tag: tiredofit/backuppc:latest
  • Host OS: PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
Any logs | docker-compose.yml

Possible fixes

Add:

    ports:
        - "80:80"
        - "1025:1025"
        - "8025:8025"
        - "10050:10050"

to docker-compose.yml

NGINX_AUTHENTICATION_TYPE=BASIC causes "auth_basic" duplicate in /etc/nginx/conf.d/default.conf

Hello,

can you please check if the following problem is a bug within the docker-backuppc or if I am just doing something wrong?

--
I tried the steps from here ( https://hub.docker.com/r/tiredofit/backuppc/ ) by adding these Container Variables

NGINX_AUTHENTICATION_TYPE=BASIC
NGINX_AUTHENTICATION_BASIC_USER1=backuppc
NGINX_AUTHENTICATION_BASIC_PASS1=backuppc

which works perfectly fine until I stop and restart the docker container, then it fails with this log message repeating continuously (full log after restart attached)

[42m[INFO][49m ** [nginx] Starting nginx 1.19.2
nginx: [emerg] "auth_basic" directive is duplicate in /etc/nginx/conf.d/default.conf:4

I figured out, at every restart the following 2 lines are added again to /etc/nginx/conf.d/default.conf

auth_basic "Please login";
auth_basic_user_file /etc/nginx/nginx.conf.d/authentication/basic_authorized_users;

Also in the file /etc/nginx/nginx.conf.d/authentication/basic_authorized_users an new entry for the user and the password is generated on every startup if the Container Variables aboth are set. I did some further digging in the used nginx container but didn't find a solution.

-- WORKAROUND --

My current workaround is to manually add the users and the authentication method within the container after the first start by running lines 170 and 171 from https://github.com/tiredofit/docker-nginx/blob/ba1e3b4c81a5a29aa427ba37f6242c0e06d78053/install/etc/cont-init.d/10-nginx#L170-L171 manually

htpasswd -b -n backuppc backuppc >>/etc/nginx/nginx.conf.d/authentication/basic_authorized_users
sed -i '/ server {/a\ \ \  auth_basic "'"Please login"'";\n\ \ \  auth_basic_user_file /etc/nginx/nginx.conf.d/authentication/basic_authorized_users;' /etc/nginx/conf.d/*.conf

This works fine for running and restarting the container. BUT reconfiguring the container removes (ofc) the changes. I tried mounting the whole etc/nginx/ folder to unraid (where I am running the container), but this does not work. nginx within the container then won't create its config (don't know why).

To keep the user and authentication settings even after changing the container I did the following steps (prob not the best solution, but it works for me right now).

  1. Copying the /conf.d and /authentication folders to my unraid share (paths may be changed or folders created manually)
docker cp --follow-link backuppc:/etc/nginx/nginx.conf.d/authentication /mnt/user/appdata/backuppc/nginx/nginx.conf.d/authentication
docker cp --follow-link backuppc:/etc/nginx/conf.d /mnt/user/appdata/backuppc/nginx/conf.d
  1. reconfiguring the docker container and adding these two mounts
    Host Path: /mnt/user/appdata/backuppc/nginx/conf.d/
    Container Path: /etc/nginx/conf.d

Host Path: /mnt/user/appdata/backuppc/nginx/nginx.conf.d/authentication/
Container Path: /etc/nginx/nginx.conf.d/authentication

msmtp configuration

I am trying to update /home/backuppc/.msmtprc using my gmail credential wth success, anyone can help me? thanks

this is my docker-compose.yml

version: '3.7' services: backuppc-app: image: tiredofit/backuppc container_name: backuppc-app build: context: . dockerfile: ./Dockerfile volumes: - /mnt/TOSHIBA-BACKUP/backuppc/data:/var/lib/backuppc - /mnt/TOSHIBA-BACKUP/backuppc/conf/etc/:/etc/backuppc - /mnt/TOSHIBA-BACKUP/backuppc/conf/home/:/home/backuppc ports: - "8081:80" - "8082:10050" environment: - BACKUPPC_UUID=1000 - BACKUPPC_GUID=1000 restart: always

Then i created a Dockerfile

FROM tiredofit/backuppc COPY ./.msmtprc /home/backuppc/.msmtprc

but the file is not overriden

Issue with starting up backuppc

Summary

BackupPC Web GUI is showing...

Software error:
Not an ARRAY reference at /usr/local/BackupPC/lib/BackupPC/CGI/Lib.pm line 468.
For help, please send mail to this site's webmaster, giving this error message and the time and date of the error.

Relevant logs and/or screenshots

(2023-03-11.02:08:03 [STARTING] ** [backuppc] [48] Starting BackupPC 4.4.0 2023-03-11.02:08:04 [STARTING] ** [backuppc] [49] Starting BackupPC 4.4.0 2023-03-11.02:08:06 [STARTING] ** [backuppc] [50] Starting BackupPC 4.4.0 2023-03-11.02:08:07 [ERROR] ** [backuppc] POTENTIAL RUNWAY DETECTECTED: Disabling 20-backuppc service because it has tried restarting '50' times )

Environment

Running in homelab production
Deployed in Docker

  • Image version / tag: latest
  • Host OS: Unraid Latest

Not an ARRAY reference

Summary

Error message when opening Webinterface:

Not an ARRAY reference at /usr/local/BackupPC/lib/BackupPC/CGI/Lib.pm line 468.

It is not possible to restore or view backups!

Steps to reproduce

The issue happen when i try to open the Webinterface.

Relevant logs and/or screenshots

Lib.pm

Lib.pm

#============================================================= -*-perl-*-
#
# BackupPC::CGI::Lib package
#
# DESCRIPTION
#
#   This library defines a BackupPC::Lib class and a variety of utility
#   functions used by BackupPC.
#
# AUTHOR
#   Craig Barratt  <[email protected]>
#
# COPYRIGHT
#   Copyright (C) 2003-2020  Craig Barratt
#
#   This program is free software: you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#========================================================================
#
# Version 4.4.0, released 20 Jun 2020.
#
# See http://backuppc.sourceforge.net.
#
#========================================================================

package BackupPC::CGI::Lib;

use strict;
use BackupPC::Lib;

require Exporter;

use vars qw( @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS );

use vars qw($Cgi %In $MyURL $User %Conf $TopDir $LogDir $BinDir $bpc);
use vars qw(%Status %Info %Jobs @BgQueue @UserQueue @CmdQueue
  %QueueLen %StatusHost);
use vars qw($Hosts $HostsMTime $ConfigMTime $PrivAdmin);
use vars qw(%UserEmailInfo $UserEmailInfoMTime %RestoreReq %ArchiveReq);
use vars qw($Lang);

@ISA = qw(Exporter);

@EXPORT = qw( );

@EXPORT_OK = qw(
  timeStamp2
  HostLink
  UserLink
  EscHTML
  EscURI
  ErrorExit
  ServerConnect
  GetStatusInfo
  ReadUserEmailInfo
  CheckPermission
  GetUserHosts
  ConfirmIPAddress
  Header
  Trailer
  NavSectionTitle
  NavSectionStart
  NavSectionEnd
  NavLink
  h1
  h2
  $Cgi %In $MyURL $User %Conf $TopDir $LogDir $BinDir $bpc
  %Status %Info %Jobs @BgQueue @UserQueue @CmdQueue
  %QueueLen %StatusHost
  $Hosts $HostsMTime $ConfigMTime $PrivAdmin
  %UserEmailInfo $UserEmailInfoMTime %RestoreReq %ArchiveReq
  $Lang
);

%EXPORT_TAGS = ('all' => [@EXPORT_OK]);

sub NewRequest
{
    $Cgi = new CGI;
    %In  = $Cgi->Vars;

    if ( !defined($bpc) ) {
        ErrorExit($Lang->{BackupPC__Lib__new_failed__check_apache_error_log})
          if ( !($bpc = BackupPC::Lib->new(undef, undef, undef, 1)) );
        $TopDir      = $bpc->TopDir();
        $LogDir      = $bpc->LogDir();
        $BinDir      = $bpc->BinDir();
        %Conf        = $bpc->Conf();
        $Lang        = $bpc->Lang();
        $ConfigMTime = $bpc->ConfigMTime();
        umask($Conf{UmaskMode});
    } elsif ( $bpc->ConfigMTime() != $ConfigMTime ) {
        $bpc->ConfigRead();
        $TopDir      = $bpc->TopDir();
        $LogDir      = $bpc->LogDir();
        $BinDir      = $bpc->BinDir();
        %Conf        = $bpc->Conf();
        $Lang        = $bpc->Lang();
        $ConfigMTime = $bpc->ConfigMTime();
        umask($Conf{UmaskMode});
    }

    #
    # Default REMOTE_USER so in a miminal installation the user
    # has a sensible default.
    #
    $ENV{REMOTE_USER} = $Conf{BackupPCUser} if ( $ENV{REMOTE_USER} eq "" );

    #
    # We require that Apache pass in $ENV{SCRIPT_NAME} and $ENV{REMOTE_USER}.
    # The latter requires .ht_access style authentication.  Replace this
    # code if you are using some other type of authentication, and have
    # a different way of getting the user name.
    #
    $MyURL = $ENV{SCRIPT_NAME};
    $User  = $ENV{REMOTE_USER};

    #
    # Handle LDAP uid=user when using mod_authz_ldap and otherwise untaint
    #
    $User = $1 if ( $User =~ /uid=([^,]+)/i || $User =~ /(.*)/ );

    #
    # Clean up %ENV for taint checking
    #
    delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
    $ENV{PATH} = $Conf{MyPath};

    #
    # Verify we are running as the correct user
    #
    if ( $Conf{BackupPCUserVerify} && $> != (my $uid = getpwnam($Conf{BackupPCUser})) ) {
        ErrorExit(eval("qq{$Lang->{Wrong_user__my_userid_is___}}"), <<EOF);
This script needs to run as the user specified in \$Conf{BackupPCUser},
which is set to $Conf{BackupPCUser}.
<p>
This is an installation problem.  If you are using mod_perl then
it appears that Apache is not running as user $Conf{BackupPCUser}.
If you are not using mod_perl, then most like setuid is not working
properly on BackupPC_Admin.  Check the permissions on
$Conf{CgiDir}/BackupPC_Admin and look at the documentation.
EOF
    }

    if ( !defined($Hosts) || $bpc->HostsMTime() != $HostsMTime ) {
        $HostsMTime = $bpc->HostsMTime();
        $Hosts      = $bpc->HostInfoRead();

        # turn moreUsers list into a hash for quick lookups
        foreach my $host ( keys %$Hosts ) {
            $Hosts->{$host}{moreUsers} =
              {map { $_, 1 } split(",", $Hosts->{$host}{moreUsers})};
        }
    }

    #
    # Untaint the host name
    #
    if ( $In{host} =~ /^([\w.\s-]+)$/ ) {
        $In{host} = $1;
    } else {
        delete($In{host});
    }
}

sub timeStamp2
{
    my $now = $_[0] == 0 ? time : $_[0];
    my($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($now);
    $mon++;
    if ( $Conf{CgiDateFormatMMDD} == 2 ) {
        $year += 1900;
        return sprintf("%04d-%02d-%02d %02d:%02d", $year, $mon, $mday, $hour, $min);
    } elsif ( $Conf{CgiDateFormatMMDD} ) {
        #
        # Add the year if the time is more than 330 days ago
        #
        if ( time - $now > 330 * 24 * 3600 ) {
            $year -= 100;
            return sprintf("$mon/$mday/%02d %02d:%02d", $year, $hour, $min);
        } else {
            return sprintf("$mon/$mday %02d:%02d", $hour, $min);
        }
    } else {
        #
        # Add the year if the time is more than 330 days ago
        #
        if ( time - $now > 330 * 24 * 3600 ) {
            $year -= 100;
            return sprintf("$mday/$mon/%02d %02d:%02d", $year, $hour, $min);
        } else {
            return sprintf("$mday/$mon %02d:%02d", $hour, $min);
        }
    }
}

sub HostLink
{
    my($host) = @_;
    my($s);
    if ( defined($Hosts->{$host}) ) {
        $s = "<a href=\"$MyURL?host=${EscURI($host)}\">$host</a>";
    } else {
        $s = $host;
    }
    return \$s;
}

sub UserLink
{
    my($user) = @_;
    my($s);

    return \$user if ( $user eq "" || $Conf{CgiUserUrlCreate} eq "" );
    if ( $Conf{CgiUserHomePageCheck} eq "" || -f sprintf($Conf{CgiUserHomePageCheck}, $user, $user, $user) ) {
        $s = "<a href=\"" . sprintf($Conf{CgiUserUrlCreate}, $user, $user, $user) . "\">$user</a>";
    } else {
        $s = $user;
    }
    return \$s;
}

sub EscHTML
{
    my($s) = @_;
    $s =~ s/&/&amp;/g;
    $s =~ s/\"/&quot;/g;
    $s =~ s/>/&gt;/g;
    $s =~ s/</&lt;/g;
    ### $s =~ s{([^[:print:]])}{sprintf("&\#x%02X;", ord($1));}eg;
    return \$s;
}

sub EscURI
{
    my($s) = @_;
    $s =~ s{([^\w.\/-])}{sprintf("%%%02X", ord($1));}eg;
    return \$s;
}

sub ErrorExit
{
    my(@mesg) = @_;
    my($head) = shift(@mesg);
    my($mesg) = join("</p>\n<p>", @mesg);

    if ( !defined($ENV{REMOTE_USER}) ) {
        $mesg .= <<EOF;
<p>
Note: \$ENV{REMOTE_USER} is not set, which could mean there is an
installation problem.  BackupPC_Admin expects Apache to authenticate
the user and pass their user name into this script as the REMOTE_USER
environment variable.  See the documentation.
EOF
    }

    $bpc->ServerMesg("log User $User (host=$In{host}) got CGI error: $head")
      if ( defined($bpc) );
    if ( !defined($Lang->{Error}) ) {
        $mesg = <<EOF if ( !defined($mesg) );
There is some problem with the BackupPC installation.
Please check the permissions on BackupPC_Admin.
EOF
        my $content = <<EOF;
${h1("Error: Unable to read config.pl or language strings!!")}
<p>$mesg</p>
EOF
        Header("BackupPC: Error", $content);
        Trailer();
    } else {
        my $content = eval("qq{$Lang->{Error____head}}");
        Header(eval("qq{$Lang->{Error}}"), $content);
        Trailer();
    }
    exit(1);
}

sub ServerConnect
{
    #
    # Verify that the server connection is ok
    #
    return if ( $bpc->ServerOK() );
    $bpc->ServerDisconnect();
    if ( my $err = $bpc->ServerConnect($Conf{ServerHost}, $Conf{ServerPort}) ) {
        if (   CheckPermission()
            && -f $Conf{ServerInitdPath}
            && $Conf{ServerInitdStartCmd} ne "" ) {
            my $content = eval("qq{$Lang->{Admin_Start_Server}}");
            Header(eval("qq{$Lang->{Unable_to_connect_to_BackupPC_server}}"), $content);
            Trailer();
            exit(1);
        } else {
            ErrorExit(
                eval("qq{$Lang->{Unable_to_connect_to_BackupPC_server}}"),
                eval("qq{$Lang->{Unable_to_connect_to_BackupPC_server_error_message}}")
            );
        }
    }
}

sub GetStatusInfo
{
    my($status) = @_;
    ServerConnect();
    %Status     = () if ( $status =~ /\bhosts\b/ );
    %StatusHost = () if ( $status =~ /\bhost\(/ );
    my $reply = $bpc->ServerMesg("status $status");
    $reply = $1 if ( $reply =~ /(.*)/s );
    eval($reply);

    # ignore status related to admin jobs
    if ( $status =~ /\bhosts\b/ ) {
        foreach my $host ( grep(/admin/, keys(%Status)) ) {
            delete($Status{$host}) if ( $bpc->isAdminJob($host) );
        }
        delete($Status{$bpc->scgiJob});
    }
}

sub ReadUserEmailInfo
{
    if ( (stat("$LogDir/UserEmailInfo.pl"))[9] != $UserEmailInfoMTime ) {
        do "$LogDir/UserEmailInfo.pl";
        $UserEmailInfoMTime = (stat("$LogDir/UserEmailInfo.pl"))[9];
    }
}

#
# Check if the user is privileged.  A privileged user can access
# any information (backup files, logs, status pages etc).
#
# A user is privileged if they belong to the group
# $Conf{CgiAdminUserGroup}, or they are in $Conf{CgiAdminUsers}
# or they are the user assigned to a host in the host file.
#
sub CheckPermission
{
    my($host) = @_;
    my $Privileged = 0;

    return 0 if ( $User eq "" && $Conf{CgiAdminUsers} ne "*" || $host ne "" && !defined($Hosts->{$host}) );
    if ( $Conf{CgiAdminUserGroup} ne "" ) {
        for ( split(/\s+/, $Conf{CgiAdminUserGroup}) ) {
            my($n, $p, $gid, $mem) = getgrnam($_);
            $Privileged ||= ($mem =~ /\b\Q$User\E\b/);
            last if ( $Privileged );
        }
    }
    if ( $Conf{CgiAdminUsers} ne "" ) {
        $Privileged ||= ($Conf{CgiAdminUsers} =~ /\b\Q$User\E\b/);
        $Privileged ||= $Conf{CgiAdminUsers} eq "*";
    }
    $PrivAdmin = $Privileged;
    return $Privileged if ( !defined($host) );

    $Privileged ||= $User eq $Hosts->{$host}{user};
    $Privileged ||= defined($Hosts->{$host}{moreUsers}{$User});
    return $Privileged;
}

#
# Returns the list of hosts that should appear in the navigation bar
# for this user.  If $getAll is set, the admin gets all the hosts.
# Otherwise, regular users get hosts for which they are the user or
# are listed in the moreUsers column in the hosts file.
#
sub GetUserHosts
{
    my($getAll) = @_;
    my @hosts;

    if ( $getAll && CheckPermission() ) {
        @hosts = sort keys %$Hosts;
    } else {
        @hosts = sort grep { $Hosts->{$_}{user} eq $User || defined($Hosts->{$_}{moreUsers}{$User}) } keys(%$Hosts);
    }
    return @hosts;
}

#
# Given a host name tries to find the IP address.  For non-dhcp hosts
# we just return the host name.  For dhcp hosts we check the address
# the user is using ($ENV{REMOTE_ADDR}) and also the last-known IP
# address for $host.  (Later we should replace this with a broadcast
# nmblookup.)
#
sub ConfirmIPAddress
{
    my($host) = @_;
    my $ipAddr = $host;

    if ( defined($Hosts->{$host}) && $Hosts->{$host}{dhcp} && $ENV{REMOTE_ADDR} =~ /^(\d+[\.\d]*)$/ ) {
        $ipAddr = $1;
        my($netBiosHost, $netBiosUser) = $bpc->NetBiosInfoGet($ipAddr);
        if ( $netBiosHost ne $host ) {
            my($tryIP);
            GetStatusInfo("host(${EscURI($host)})");
            if ( defined($StatusHost{dhcpHostIP}) && $StatusHost{dhcpHostIP} ne $ipAddr ) {
                $tryIP = eval("qq{$Lang->{tryIP}}");
                ($netBiosHost, $netBiosUser) = $bpc->NetBiosInfoGet($StatusHost{dhcpHostIP});
            }
            if ( $netBiosHost ne $host ) {
                ErrorExit(eval("qq{$Lang->{Can_t_find_IP_address_for}}"), eval("qq{$Lang->{host_is_a_DHCP_host}}"));
            }
            $ipAddr = $StatusHost{dhcpHostIP};
        }
    }
    return $ipAddr;
}

###########################################################################
# HTML layout subroutines
###########################################################################

sub Header
{
    my($title, $content, $noBrowse, $contentSub, $contentPost) = @_;
    my @adminLinks = (
        {link => "?action=status",  name => $Lang->{Status}},
        {link => "?action=summary", name => $Lang->{PC_Summary}},
        {
            link => "?action=editConfig",
            name => $Lang->{CfgEdit_Edit_Config},
            priv => 1
        },
        {
            link => "?action=editConfig&newMenu=hosts",
            name => $Lang->{CfgEdit_Edit_Hosts},
            priv => 1
        },
        {
            link => "?action=adminOpts",
            name => $Lang->{Admin_Options},
            priv => 1
        },
        {
            link => "?action=view&type=LOG",
            name => $Lang->{LOG_file},
            priv => 1
        },
        {
            link => "?action=LOGlist",
            name => $Lang->{Old_LOGs},
            priv => 1
        },
        {
            link => "?action=emailSummary",
            name => $Lang->{Email_summary},
            priv => 1
        },
        {
            link => "?action=queue",
            name => $Lang->{Current_queues},
            priv => 1
        },
        @{$Conf{CgiNavBarLinks} || []},
    );
    my $host = $In{host};

    binmode(select, ":utf8");
    print $Cgi->header(-charset => "utf-8");
    print <<EOF;
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>$title</title>
<link rel=stylesheet type="text/css" href="$Conf{CgiImageDirURL}/$Conf{CgiCSSFile}?version=2" title="CSSFile">

<link rel="apple-touch-icon" sizes="180x180" href="$Conf{CgiImageDirURL}/apple-touch-icon.png?v=2">
<link rel="icon" type="image/png" sizes="32x32" href="$Conf{CgiImageDirURL}/favicon-32x32.png?v=2">
<link rel="icon" type="image/png" sizes="16x16" href="$Conf{CgiImageDirURL}/favicon-16x16.png?v=2">
<link rel="mask-icon" href="$Conf{CgiImageDirURL}/safari-pinned-tab.svg?v=2" color="#5bbad5">
<link rel="shortcut icon" href="$Conf{CgiImageDirURL}/favicon.ico?v=2">

$Conf{CgiHeaders}
<script src="$Conf{CgiImageDirURL}/sorttable.js"></script>
</head><body onLoad="document.getElementById('NavMenu').style.height=document.body.scrollHeight">

<div id="navigation-container">
	<div id="logo-container">
		<a href="https://backuppc.github.io/backuppc/"><img src="$Conf{CgiImageDirURL}/logo320.png"></a>
	</div>
EOF

    if ( defined($Hosts) && defined($host) && defined($Hosts->{$host}) ) {
        print "<div class=\"NavMenu section-title\">";
        NavSectionTitle("${EscHTML($host)}");
        print <<EOF;
</div>
<div class="NavMenu host">
EOF
        NavLink("?host=${EscURI($host)}",               "$host $Lang->{Home}", " class=\"navbar\"");
        NavLink("?action=browse&host=${EscURI($host)}", $Lang->{Browse},       " class=\"navbar\"") if ( !$noBrowse );
        NavLink("?action=view&type=LOG&host=${EscURI($host)}", $Lang->{LOG_file},  " class=\"navbar\"");
        NavLink("?action=LOGlist&host=${EscURI($host)}",       $Lang->{LOG_files}, " class=\"navbar\"");
        if (   -f "$TopDir/pc/$host/SmbLOG.bad"
            || -f "$TopDir/pc/$host/SmbLOG.bad.z"
            || -f "$TopDir/pc/$host/XferLOG.bad"
            || -f "$TopDir/pc/$host/XferLOG.bad.z" ) {
            NavLink(
                "?action=view&type=XferLOGbad&host=${EscURI($host)}",
                $Lang->{Last_bad_XferLOG},
                " class=\"navbar\""
            );
            NavLink(
                "?action=view&type=XferErrbad&host=${EscURI($host)}",
                $Lang->{Last_bad_XferLOG_errors_only},
                " class=\"navbar\""
            );
        }
        if ( $Conf{CgiUserConfigEditEnable} || $PrivAdmin ) {
            NavLink("?action=editConfig&host=${EscURI($host)}", $Lang->{CfgEdit_Edit_Config}, " class=\"navbar\"");
        } elsif ( -f "$TopDir/pc/$host/config.pl" || ($host ne "config" && -f "$TopDir/conf/$host.pl") ) {
            NavLink("?action=view&type=config&host=${EscURI($host)}", $Lang->{Config_file}, " class=\"navbar\"");
        }
        print "</div>\n";
    }
    print <<EOF;
<div class="NavMenu" id="NavMenu">
EOF
    my $hostSelectbox = "<option value=\"#\">$Lang->{Select_a_host}</option>";
    my @hosts         = GetUserHosts($Conf{CgiNavBarAdminAllHosts});
    NavSectionTitle($Lang->{Hosts});
    if ( defined($Hosts) && %$Hosts > 0 && @hosts ) {
        foreach my $host ( @hosts ) {
            NavLink("?host=${EscURI($host)}", $host)
              if ( @hosts < $Conf{CgiNavBarAdminAllHosts} );
            my $sel = " selected" if ( $host eq $In{host} );
            $hostSelectbox .= "<option value=\"?host=${EscURI($host)}\"$sel>$host</option>";
        }
    }
    if ( @hosts >= $Conf{CgiNavBarAdminAllHosts} ) {
        print <<EOF;
<select onChange="document.location=this.value">
$hostSelectbox
</select>
EOF
    }
    if ( $Conf{CgiSearchBoxEnable} ) {
        print <<EOF;
<form action="$MyURL" method="get">
    <input type="text" name="host" size="14" maxlength="64">
    <input type="hidden" name="action" value="hostInfo"><input type="submit" value="$Lang->{Go}" name="ignore">
    </form>
EOF
    }
    NavSectionTitle($Lang->{NavSectionTitle_});
    foreach my $l ( @adminLinks ) {
        if ( $PrivAdmin || !$l->{priv} ) {
            my $txt = $l->{lname} ne "" ? $Lang->{$l->{lname}} : $l->{name};
            NavLink($l->{link}, $txt);
        }
    }

    print <<EOF;
</div>
</div> <!-- end #navigation-container -->
EOF

    print("<div id=\"Content\">\n$content\n");
    if ( defined($contentSub) && ref($contentSub) eq "CODE" ) {
        while ( (my $s = &$contentSub()) ne "" ) {
            print($s);
        }
    }
    print($contentPost) if ( defined($contentPost) );
}

sub Trailer
{
    print <<EOF;
</body></html>
EOF
}

sub NavSectionTitle
{
    my($head) = @_;
    print <<EOF;
<h2 class="NavTitle">$head</h2>
EOF
}

sub NavSectionStart
{
}

sub NavSectionEnd
{
}

sub NavLink
{
    my($link, $text) = @_;
    if ( defined($link) ) {
        my($class);
        $class = " class=\"NavCurrent\""
          if ( length($link) && $ENV{REQUEST_URI} =~ /\Q$link\E$/
            || length($link) && $link =~ /\&host=/ && $ENV{REQUEST_URI} =~ /\Q$link\E/
            || $link eq "" && $ENV{REQUEST_URI} !~ /\?/ );
        $link = "$MyURL$link" if ( $link eq "" || $link =~ /^\?/ );
        print <<EOF;
<a href="$link"$class>$text</a>
EOF
    } else {
        print <<EOF;
$text<br>
EOF
    }
}

sub h1
{
    my($str) = @_;
    return \<<EOF;
    <h1>$str</h1>
EOF
}

sub h2
{
    my($str) = @_;
    return \<<EOF;
    <h2>$str</h2>
EOF
}
Docker Log

Docker Log:

docker-log:

2023-01-11.12:07:59 [STARTING] ** [backuppc] [17] Starting BackupPC 4.4.0
2023-01-11.12:08:00 [STARTING] ** [backuppc] [18] Starting BackupPC 4.4.0
2023-01-11.12:08:01 [STARTING] ** [backuppc] [19] Starting BackupPC 4.4.0
2023-01-11.12:08:02 [STARTING] ** [backuppc] [20] Starting BackupPC 4.4.0
2023-01-11.12:08:03 [STARTING] ** [backuppc] [21] Starting BackupPC 4.4.0
2023-01-11.12:08:04 [STARTING] ** [backuppc] [22] Starting BackupPC 4.4.0
2023-01-11.12:08:05 [STARTING] ** [backuppc] [23] Starting BackupPC 4.4.0
2023-01-11.12:08:06 [STARTING] ** [backuppc] [24] Starting BackupPC 4.4.0
2023-01-11.12:08:07 [STARTING] ** [backuppc] [25] Starting BackupPC 4.4.0
2023-01-11.12:08:08 [STARTING] ** [backuppc] [26] Starting BackupPC 4.4.0
2023-01-11.12:08:09 [STARTING] ** [backuppc] [27] Starting BackupPC 4.4.0
2023-01-11.12:08:10 [STARTING] ** [backuppc] [28] Starting BackupPC 4.4.0
2023-01-11.12:08:11 [STARTING] ** [backuppc] [29] Starting BackupPC 4.4.0
2023-01-11.12:08:12 [STARTING] ** [backuppc] [30] Starting BackupPC 4.4.0
2023-01-11.12:08:13 [STARTING] ** [backuppc] [31] Starting BackupPC 4.4.0
2023-01-11.12:08:14 [STARTING] ** [backuppc] [32] Starting BackupPC 4.4.0
2023-01-11.12:08:15 [STARTING] ** [backuppc] [33] Starting BackupPC 4.4.0
2023-01-11.12:08:16 [STARTING] ** [backuppc] [34] Starting BackupPC 4.4.0
2023-01-11.12:08:17 [STARTING] ** [backuppc] [35] Starting BackupPC 4.4.0
2023-01-11.12:08:18 [STARTING] ** [backuppc] [36] Starting BackupPC 4.4.0
2023-01-11.12:08:19 [STARTING] ** [backuppc] [37] Starting BackupPC 4.4.0
2023-01-11.12:08:20 [STARTING] ** [backuppc] [38] Starting BackupPC 4.4.0
2023-01-11.12:08:21 [STARTING] ** [backuppc] [39] Starting BackupPC 4.4.0
2023-01-11.12:08:22 [STARTING] ** [backuppc] [40] Starting BackupPC 4.4.0
2023-01-11.12:08:23 [STARTING] ** [backuppc] [41] Starting BackupPC 4.4.0
2023-01-11.12:08:24 [STARTING] ** [backuppc] [42] Starting BackupPC 4.4.0
2023-01-11.12:08:25 [STARTING] ** [backuppc] [43] Starting BackupPC 4.4.0
2023-01-11.12:08:26 [STARTING] ** [backuppc] [44] Starting BackupPC 4.4.0
2023-01-11.12:08:27 [STARTING] ** [backuppc] [45] Starting BackupPC 4.4.0
2023-01-11.12:08:28 [STARTING] ** [backuppc] [46] Starting BackupPC 4.4.0
2023-01-11.12:08:29 [STARTING] ** [backuppc] [47] Starting BackupPC 4.4.0
2023-01-11.12:08:30 [STARTING] ** [backuppc] [48] Starting BackupPC 4.4.0
2023-01-11.12:08:31 [STARTING] ** [backuppc] [49] Starting BackupPC 4.4.0
2023-01-11.12:08:32 [STARTING] ** [backuppc] [50] Starting BackupPC 4.4.0
2023-01-11.12:08:33 [ERROR] ** [backuppc] POTENTIAL RUNWAY DETECTECTED: Disabling 20-backuppc service because it has tried restarting '50' times

Environment

  • Image version / tag: tiredofit/backuppc:latest
  • Host OS: Unraid 6.11.1

Email not working.

Summary

Cannot get email delivered from backuppc. Also not seeing any issues in logs.

Steps to reproduce

Review email list in web console of emails that went out. Never received any of these messages.

What is the expected correct behavior?

Relevant logs and/or screenshots

tested from commandline and successfully received the email.

[tiredofit/backuppc:6.0.2 12:57:54 /home] $ /usr/bin/msmtp -t -f mybackuppcfromaddress@mydomain mybackuppcadmin@mydomain
Subject: Test

test

Backuppc service doesn't starts

I am trying to start from latest image at tiredofit/backuppc.

Got the following error when entering web UI:
screenshot_002

I have enabled DEBUG_MODE and see that backuppc service is stuck in the following loop:

...
backuppc                 | [DEBUG] /run/s6/services/20-backuppc/run ** [backuppc] Looking for existence of /tmp/state/11-fcgiwrap-init
backuppc                 | + '[' '!' -f /tmp/state/11-fcgiwrap-init ']'
backuppc                 | + sleep 1
backuppc                 | + print_debug 'Looking for existence of /tmp/state/11-fcgiwrap-init'
backuppc                 | + output_off
backuppc                 | + '[' TRUE = TRUE ']'
backuppc                 | + set +x
backuppc                 | [DEBUG] /run/s6/services/20-backuppc/run ** [backuppc] Looking for existence of /tmp/state/11-fcgiwrap-init
backuppc                 | + '[' '!' -f /tmp/state/11-fcgiwrap-init ']'
backuppc                 | + sleep 1
backuppc                 | + print_debug 'Looking for existence of /tmp/state/11-fcgiwrap-init'
backuppc                 | + output_off
backuppc                 | + '[' TRUE = TRUE ']'
backuppc                 | + set +x
backuppc                 | [DEBUG] /run/s6/services/20-backuppc/run ** [backuppc] Looking for existence of /tmp/state/11-fcgiwrap-init
backuppc                 | + '[' '!' -f /tmp/state/11-fcgiwrap-init ']'
backuppc                 | + sleep 1
backuppc                 | + print_debug 'Looking for existence of /tmp/state/11-fcgiwrap-init'
backuppc                 | + output_off
backuppc                 | + '[' TRUE = TRUE ']'
backuppc                 | + set +x
backuppc                 | [DEBUG] /run/s6/services/20-backuppc/run ** [backuppc] Looking for existence of /tmp/state/11-fcgiwrap-init
...

Any help is appreciated. ^__^

Can't add new host via Web UI

I get "500 Internal Server Error" after navigating to "Edit Hosts" (in left menu) and then clicking "Add" button.

screenshot_001

(on the screenshot you can see there are already some hosts available - I have added them by editing config file).

The same "500 Internal Server Error" also appears in other places, when I am trying to edit configuration o particular hosts.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.