This may help someone with Docker and OwnCloud.
My Setup
DL4100 Firmware 2.11.140
Desire
Setup owncloud to bypass WDSync until at such time WD Sync matures.
Docker allows an owncloud setup, see: https://community.wd.com/t/has-anyone-successfully-installed-owncloud-on-the-wd-dl2100-help-is-appreciated/156198
But, if I screw up docker / container / trash an image, etc… I would lose all my files.
(Note, this does not mean I would lose my files stored on the native WD shares. The docker space is in some magical area. Obviously I do not know where… nor do I understand how this all works… but it does… so try this whole thing at your own risk!)
So I wanted to figure out a way to keep the files in a normal partition on the DL4100.
So using Aaron_Lawson’s guide as a go-by, I started to read more. (This would NOT have been attempted had Aaron not posted his helpful how-to.)
I am on a windows machine, so I use PUTTY to SSH.
Enable SSH from My Cloud Network Setting
Configure Password
Created a new share: “ownclouddock”
Remove Public Sharing Give admin permissions
Use Putty.exe (Downloaded from Google Search)
SSH to the IP address of my cloud
Input UN: root
Input Password: Pass given in step 2
The new share is located at “/shares/ownclouddock”
Using Docker to create https://hub.docker.com/r/l3iggs/owncloud/
docker pull l3iggs/owncloud
docker run -v /shares/ownclouddock:/usr/share/webapps/owncloud/data --name oc -p 8080:80 -p 8443:443 -d l3iggs/owncloud
Using a browser, navigate to your WD Drive IP address, https://IPADDRESS:8443/owncloud
This is the first time running, so you need to do an initial setup. You may choose to use the MySQL / Maria DB option. (This was suggested… so I did.)
Input an admin username: e.g. ‘admin’
Input a Password: e.g. ‘f&ORaO6P’
Click on storage and database
Configure the database – choose My SQL / MariaDB
Enter ‘root’ in the Database User Field
Leave password blank
Enter ‘ocd’ in the Database name Field
Click Finish setup
Had an error about file permissions, so using putty and SSH:
cd /shares
chgrp 33 -R ownclouddock
chown 0770 -R ownclouddock
Back to your browser and refresh.
I get an error on files not passing integrity check, “request.php”
I am not sure yet why… but some initial searching showed it may be due to the fact that I have not set up any trusted clients… It also goes away after the upgrade is run.
Upgrading
SSH and run: docker exec -it oc sh -c ‘set-oc-perms upgrade’
Use Browser to start updater from admin menu
SSH and run: docker exec -it oc sh -c ‘set-oc-perms runtime’
Saving your work: (Docker will not keep your work if you do not save it.)
SSH and run: docker stop oc
SSH and run: docker commit oc myname/owncloud
Note: I saved a new one under my name which is not ‘myname!’ You can save it as you want.
SSH and run: docker start oc
I tried to access remotely and get some errors…
SSH and run: docker exec -it oc sh -c ‘SUBJECT=“/C=US/ST=CA/L=CITY/O=ORGANIZATION/OU=UNIT/CN=YOURDOMAINNAME.com” DO_SSL_SELF_GENERATION=true setup-apache-ssl-key’
Then via https://github.com/l3iggs/docker-owncloud/wiki/Access-your-ownCloud-server-from-a-URL-other-than-localhost,
login as admin with browser, and https://YOURDOMAINNAME.com:8443/owncloud/index.php/settings/admin?trustDomain=YOURDOMAINNAME.com
Save Your Work Again… I guess. I did. (Do that commit thing again)
So if something happens, and you need to start the file running, it would ultimately be:
docker run -v /shares/ownclouddock:/usr/share/webapps/owncloud/data --name oc -p 8080:80 -p 8443:443 -d myname/owncloud
(Note that we are now using the one that we ‘saved’ with the commit command.)
You may want to add this: https://github.com/l3iggs/docker-owncloud/wiki/Ensure-your-ownCloud-server-is-always-running
Questions:
I do not plan to do this, but what happens if you add files using the traditional way using the mycloud interface? Does that mess things up?
Will the my cloud mess with the whole chgrp / chown commands?
How can I create a ‘real’ ssl cert, considering that I cannot use port 80 as that is blocked by my ISP?