From 2cbd50902158a91cb082bcdf97cf3a8d2d56cb0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20M=E4kinen?= Date: Mon, 30 Nov 2009 18:07:17 +0200 Subject: [PATCH] backuppc: added support for deploying ssh keys and changed to use apache module. --- backuppc/plugins/facter/backuppc_sshkey.rb | 13 +++++++++++ backuppc/templates/BackupPC.conf.erb | 26 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 backuppc/plugins/facter/backuppc_sshkey.rb create mode 100644 backuppc/templates/BackupPC.conf.erb diff --git a/backuppc/plugins/facter/backuppc_sshkey.rb b/backuppc/plugins/facter/backuppc_sshkey.rb new file mode 100644 index 0000000..d37da4a --- /dev/null +++ b/backuppc/plugins/facter/backuppc_sshkey.rb @@ -0,0 +1,13 @@ +Facter.add('backuppc_sshkey') do + setcode do + begin + match = File.read('/var/lib/BackupPC/.ssh/id_rsa.pub')[/^ssh-rsa ([^ ]+)/, 1] + if match + data = match + end + rescue + data = '' + end + data + end +end diff --git a/backuppc/templates/BackupPC.conf.erb b/backuppc/templates/BackupPC.conf.erb new file mode 100644 index 0000000..1fe8f21 --- /dev/null +++ b/backuppc/templates/BackupPC.conf.erb @@ -0,0 +1,26 @@ + +# BackupPC requires valid authentication in order for the web interface to +# function properly. One can view the web interface without authentication +# though all functionality is disabled. +# +# htpasswd -c /etc/BackupPC/apache.users yourusername +# + +#order deny,allow +#deny from all +#allow from 127.0.0.1 +#AuthType Basic +#AuthUserFile /etc/BackupPC/apache.users +#AuthName "BackupPC + +<%= backuppc_auth %> + +<% backuppc_adminusers.each do |user| -%> +require user <%= user %> +<% end -%> + + + + +Alias /BackupPC/images /usr/share/BackupPC/html/ +ScriptAlias /BackupPC /usr/share/BackupPC/sbin/BackupPC_Admin