ownCloud on DreamObjects

Following on from a discussion in this thread: https://discussion.dreamhost.com/thread-135864

[quote]ownCloud seems to work well so far but the only problem is that you can’t seem to mount the dreamobjects bucket to the root of each user’s directory. It has to mount to a subfolder otherwise there are issues uploading and accessing the files it seems. If anyone has solid success with ownCloud and DreamObjects, I’d greatly appreciate the assistance.

Edit 1: I’ve done some digging and it seems to work ok using Swift. Obviously S3 doesn’t work because you can’t change the hostname in ownCloud (without a fair bit of hassle).

You can’t set the root directory in the mount.php config file like so:
’/$user/files/’ => array ( ‘class’ => ‘OC_Filestorage_SWIFT’, ‘options’ => array ( ‘host’ => ‘objects.dreamhost.com/auth’, ‘user’ => ‘user:subuser’, ‘token’ => ‘token’, ‘root’ => ‘/bucketname’, ‘secure’ => ‘true’, ),),

The only problem with this setup is that the files all go into the same bucket. Each user can only see their own files, but if you log in to the bucket using another application (cyberduck, etc.) all files from all users are visible. This isn’t really an issue in terms of security, but it’s more an issue of tidiness. The other problem is that instead of creating folders in a bucket, for each new folder, ownCloud seems to create a new bucket with backslashes in the name (e.g. bucket1\subfolder). Not sure if this is an issue with the way ownCloud handles new folders or if it is something to do with the DreamObjects Swift API.

Edit 2: So I’ve found that you can use the $user variable in the mount.php config to define new buckets. See below:
’/$user/files/’ => array ( ‘class’ => ‘OC_Filestorage_SWIFT’, ‘options’ => array ( ‘host’ => ‘objects.dreamhost.com/auth’, ‘user’ => ‘user:subuser’, ‘token’ => ‘token’, ‘root’ => ‘/bucketname/$user/’, ‘secure’ => ‘true’, ),),[/quote]

I saw the same behavior with OwnCloud version 5 using both DreamObjects and Rackspace Cloud Storage. OwnCloud connects over Swift successfully and even creates a container but then it just goes to a blank screen when you log in as that user.

I was able to get it working with OwnCloud 4.5, though. Try downloading that older version from their site and setting it up with that one. It worked fine.

Dallas and I both spent some time working on this. I decided to keep working on ownCloud 5.0.

After configuring External Storage to connect using swift, I also saw a blank page when going to the Files section. I also kept seeing the following error in owncloud.log: Integrity constraint violation: 1048 Column 'id' cannot be null

Looking at the oc_storages table, there was definitely an id field and it definitely was not null…

So, I abandoned swift and took a different route - I modified ownCloud 5.0 to use S3 and point to DreamObjects. Here’s what I did:

Where you do this work depends on where you’ve installed ownCloud. I installed mine in a directory called owncloud so the work I did was here

Make a backup copy of amazons3.php

After line 41, add the following 2 lines:

$this->s3->set_hostname('objects.dreamhost.com'); $this->s3->allow_hostname_override(false);

Configure an Amazon S3 bucket in the admin settings

As mentioned, it’s a hack. It’s working well for me in my testing so far. Let me know if you’ve given this a try!

Attempting to do this now. Your setup seems to get halfway there, Justin; after following those steps I get a green light on the admin page with my s3 credentials, and if I add any folders to the syncing folder on my mac the folder shows up on the ownCloud folder page… but nothing shows up in DreamObjects, and no files show up on either ownCloud or DreamObjects.

When checking the status, it seems to show successful uploads of the files repeatedly, though nothing is saved, and no error messages are produced. If you’re saying it “seems to be working” for you, there must be something more to the instructions than provided.

That’s good info - I didn’t test with the sync client, just uploading from the ownCloud files interface. I’ll test some more and see if I’m having the same issues with sync. Let me know if you make any progress.

I tried the web interface as well, and as soon as I refresh the file view after an upload the file disappears - it’s not actually using the external storage.

Although, actually, now I can’t delete the “Folder” which is inside the ownCloud instance - although I don’t see that in DreamObjects either.

Maybe ownCloud is just not robust enough yet for this…
Could usernames be relevant? How about the SSL setup? Any other factors?

Thx it works flawlessly with OC 4.5.8 not the same for OC5.0.0

Having the same trouble as the others - in OC5.X, this gives a green light in admin, but files do not actually get uploaded. Thanks for working it out this far!

I installed 4.5.8, and I am having the same problems. I wonder if this is really related to some other setting that I don’t have configured correctly?

Uploading to the non-external file storage works fine; what could we be missing?

I hope you all don’t mind me in this thread talking to myself :slight_smile:

Still using version 4.5.8, I was able to get SWIFT working correctly - a file uploaded, woohoo! When I attempted SWIFT with 5.x, I got the white screen problem. Would love to eventually upgrade to 5.x, if someone figures out what’s going wrong with either SWIFT or S3 - or if ownCloud offers a DreamObjects external storage option?

Tried to use ownCloud sync to send files from my desktop to the storage bucket on DreamObjects and ran into a problem: each sub-folder on my desktop is creating a new bucket on DreamObjects. This is using SWIFT on 4.5.8 - I don’t think this is the intended behavior, as I’ve created subfolders in other buckets successfully. I think this has something to do with the folder separator being a backslash instead of a forward slash… unfortunately, I think this means back to the drawing board!

I’m new to DreamObjects and the cloud, so I’m sorry if I don’t understand exactly how this works. I installed ownCloud 4.5.9 and modified the amazons3.php file as noted in a previous post. I then mounted my DreamObjects bucket as an Amazon S3 bucket. This seemed to work, but since there are no objects stored in my bucket yet, I cannot confirm this. I went into the mounted directory and proceeded to upload an image. The image uploaded successfully, but after reloading the page the image no longer appears in the files list. I even logged into the DreamHost control panel and found that the file does not exist in my bucket.

I then decided to try using SWIFT as the previous poster noted. I used objects.dreamhost.com/auth as the URL, my key as the username, my secret key as the token, and the root as the name of my bucket. I’m able to open the mounted folder, and ownCloud indicates that it was last modified years ago (not sure why). I uploaded the same image, and it appeared in my bucket when viewing it in the DreamHost control panel!

The previous poster noted that when creating a directory, a new bucket seems to be created. The same thing seems to be happening to me. A new bucket is created name YOUR-BUCKET-NAME/FOLDER-NAME. I do not think that this is the expected behavior. At least not from my limited experience with Amazon S3. Then when I try and delete the newly created bucket I get “Network Error Please Try Again Later.”

If it helps, I had the same problem if trying to delete the new bucket from the dreamObjects interface - I was able to delete the folder/bucket when deleting from ownCloud. I think this is related to the fact that SWIFT uses a “sub user”, so maybe the main control panel login in the dreamhost panel no longer has permission to remove/view a bucket, even though it’s the “parent” user?

I went back to try and figure out what’s wrong with the s3 protocol - I am still not sure what’s wrong, but I have two other notes:

I found in the DreamObjects docs that this needs to be set in the constructor as well:


After turning this on, uploads still did not work, but I assume it is supposed to be on.

After dumping the $response variable from the ‘create_object’ s3 function call, I am seeing this error:

<title>400 Bad Request</title>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />

I have no idea if this is a response coming back from the DreamObjects server, or if it’s something else, but I am once again stuck.

Any progress on this, Im trying to use dream objects with owncloud5 also, I have modified the s3 php and it turns green, but still doesnt work.

is there any other way to do this

I’ve been trying to get this to work for a few days now. On my Windows 7 machine using IIS and PHP 5.3 ownCloud 5 works perfectly with a few changes to s3.php, but on Dreamhost it results in a 400 Bad Request on file upload (folder creation does work fine though.). I recently decided to give upgrading my VPS to Wheezy a try (I manage everything myself and don’t use Dreamhosts’ configuration), and now it seems to work just fine. So I’m pretty much completely confused as to why it wasn’t working before now, perhaps a bug in php/curl?

I’ve been having trouble making this work too. I’ve been in contact with ownCloud and we’re discussing adding support for DreamObjects. I’ll post more info when I know more.

Thank you! Looking forward to having support added, but I’d love to know if there’s a server fix we can implement right now that will make it work with the s3 hack as well. Awesome!

I noticed this same thing with not being able to delete the buckets with backslashes from the DreamObjects web interface. The backslash isn’t a valid bucket name character in S3 (though it is in Swift). I think the DreamHost web panel is probably using S3 and failing when trying to delete (or view) those buckets. It’s possible to delete them using Cyberduck, though.

To connect over Swift using Cyberduck you have to change the authentication context to “/auth” using this terminal command (on OS X):

defaults write ch.sudo.cyberduck cf.authentication.context /auth

More info here:


Any update on this? I have owncloud 5 installed and have been unable to get owncloud to mount to DreamObjects.

Actually, I did the following and I think I got it to work:
After line 41, in the s3 config file add the following 2 lines:


It worked!! I added files into my local folder and they all showed up on DreamObjects. Now I am testing to see how to handle multiple users, multiple folders, etc. I’m trying to run a dropbox like system for my extended family (primarily to share family photos) on my server but backed up in the cloud.

Could I get a brief walk-though of what needs to be done to get this working, if it is now.
I have my Owncloud install on dreamhost, I just updated to 5.0.7 and its still a no go for me with the modified amazons3.php, but I didnt restart apache as on on the shared hosting plan…