I haven’t posted in ages due to being generally slammed with work but this little piece I threw together was too good to forget about so I wanted to put it down.
If you work with a larger owncloud deployment and have a lot of users and allow file sharing, you may be curious to occasionally take a look at how many shares there are, who owns them, who they are shared with. This isn’t easy to get from the Web GUI but via the command line and mysql it isn’t bad at all.
So, login to mysql on the command line and then use your owncloud database; ie. (if your db name is “owncloud”)
Then run the following:
select id, share_with, uid_owner, item_type, file_target from oc_share
INTO OUTFILE '/var/lib/mysql-files/shares.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';
Exit mysql command line and go to /var/lib/mysql-files and you will find a nicely formatted CSV file with a list of all shares and who they are shared with. The columns from left to right…
ID, Who it is shared with (one line per person/group), the person that owns the share, whether or not it is a file or folder, the name/location of the file/folder that is shared
If you run a custom theme for your Owncloud distribution, one of the things you know is that whenever you run an update of your Owncloud server it will automatically disable your theme as part of the update process. This is to keep things from blowing up in the event you have made a modification to a file that will break the updated version of Owncloud.
Themes can be used for more than just visual changes. For example, if you want to disable the “change password” button for users, this can be done by modifying some PHP files and dropping them in your theme. In my case, I added Piwik tracking code in several of my Owncloud files. I want to keep those modifications but I also want the updated code.
This has historically been a pain point during every Owncloud update. Every time I have run an update it has been a laborious process of comparing my theme files to the new stock files and looking for changes and then merging appropriately. So today, I decided to script part of that comparison process… (more…)
Owncloud supports several different types of “cache” mechanisms for increasing application performance and, in one particular case, expanding functionality (enabling File Locking).
The two types of caches I am going to discuss today are Redis and APCU. We will start with APCU.
If you have a stand-alone Owncloud installation and just need to optimize for better performance, then APCU is the way to go. It is very simple to get setup, with one small caveat on Ubuntu 14.04 (if you are running the latest LTS distro then this is where you live…).
The PHP5-APCU module is “out of date” relative to what owncloud will accept. So if you just install it with apt and then enable it in your owncloud config file you will get error messages in you logs at best or a more likely just a blank screen when you try to load your site.
So… here is a quick answer on how to fix this issue: (more…)
If you aren’t familiar with Owncloud, it is a very cool open-source software package that runs on Linux Apache (or Nginx) that provides “dropbox like” functionality that you can host yourself.
This is a big deal for the tech-savvy average-Joe that is worried about keeping private data private (i.e. he doesn’t want all of his personal documents stored by Microsoft, or Dropbox, or Google, etc.) but still wants the “cloud-like” functionality of being able to securely access and sync files across multiple devices.
It is also a big deal for any enterprise that wants to use “cloud storage” but has to worry about all of the above due to data security requirements. It is self-hosted, so you know exactly where all of the data is and you have control over the security components protecting it. Citrix, Dropbox, and others have realized a growing need for this and have “enterprise” products that are in the same vein. They just cost a good bit of money, don’t always meet all of the stringent security requirements imposed on some types of data, and tend to be complex/cumbersome systems.
Owncloud also has an enterprise version of their software offering which runs upwards of $10k/year. When I did a comparison of the “enterprise” vs. “open-source” the only value I could see in going enterprise was support, and one additional module that does granular file-activity-logging (i.e. user jdoe, shared this file, on this date). Obviously support is support, you aren’t going to get enterprise support without paying an enterprise price. Writing that off, that just leaves the enhanced logging.
I don’t have the requisite skill-set to build my own logging module. But Owncloud is ultimately just a web application running on Apache, so why not track it like we would any other web application? Namely, using a site analytics tool and the Apache access log. (more…)