Closed (fixed)
Project:
Hosting Site Backup Manager
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
5 Mar 2012 at 08:11 UTC
Updated:
31 Jul 2012 at 14:31 UTC
Aegir has a separation is user privileges. The backups are made by provision running as the aegir user.
Ant to the best of my knowledge the default file permissions do not allow the apache user to access these backup files directly.
My first test to retrieve a backup resulted in the following error:
warning: fopen(/var/aegir/backups/d7minimal-20110922.094045.tar.gz)
[function.fopen]: failed to open stream: Permission denied in
/data/aegir/hostmaster-6.x-1.6/sites/aegirtest.local.initfour.nl/modules/hosting_site_backup_manager/hosting_site_backup_manager.module
on line 262.
Loosening the permission is one option but not preferable to me. I would not want a regular site hosted on my Aegir platform to be able to access these backups.
There must be some creative way to pass the backup over without compromising security too mush.
Comments
Comment #1
miechiel commentedCould you provide some more info about your servers specs, users and groups?
We have tested this module using 2 ubuntu machine (one online hostmaster and one virtual machine) with the automatic installation found on the community Aegir website (http://community.aegirproject.org/content/installing/automatic-installat...)
All the files at the backup location have 644 permissions with user and group both on the Aegir user. And because the files are not in the apache directories the files can only be accessed through the Aegir interface.
Accessing a url to a download file without being logged in to Aegir will give you an Acces denied.
Comment #2
helmo commentedThe backup files indeed get 644 as permission, but my ~aegir/backups/ folder has a permission of 700
On two Debian machines, one using the install script the other using the Debian packages.
Comment #3
miechiel commentedThanks for your fast reply!
Working on it
Comment #4
miechiel commentedUpdated the code. Works on our test Aegir environments.
Could you also test the latest version of the 6.x.1.x branch?
Comment #5
helmo commentedThe directory sites/aegirtest.local/files/site-backups has been created.Creating a symlink is not helping here. As apache just does not have access to the backup file.
What if we created a mini task in drush/provision to provide access to the backup?
This task could either:
Comment #6
miechiel commentedDamn! you got me there.
Seems that our backups folder has 701 permission. Then it works (of course).
What about this...
Comment #7
helmo commentedToo bad we need a separate task but I also don't really see any other way the this two-step process.
I see in Git that Gerben already started to work on this, nice.
We should think of some automatic process to let these files expire after a short amount of time.
Comment #8
helmo commentedThe recent progress from on an export and remove task look really good.
I think we can almost close this issue.
I've opens a new issue about cleaning up in case the download does not happen: #1579800: Auto expire exported backups
Comment #9
helmo commentedClosing this issue as I've finally found some time to address #1579800: Auto expire exported backups