Dockerized OwnCloud CLI Client
There is also an RPI image availabe. Config stays the same, just use :rpi with all images below. eg. toughiq/owncloud-client:rpi
docker build -t toughiq/owncloud-client .
docker build -f Dockerfile.rpi -t toughiq/owncloud-client:rpi .
docker run -d \
--name occlient \
-e OC_USER=owncloud_username \
-e OC_PASS=owncloud_password \
-e OC_SERVER=myowncloud.com \
-v ${PWD}/ocdata:/ocdata \
toughiq/owncloud-client
I also added a docker-compose.yml
file with all available parameters, so its easier to setup your proper environment. Change values to match your environment and run with docker-compose up -d
Run with docker-compose -f docker-compose.rpi.yml up -d
Run a docker logs -f <YourContainerID>
to see what is happening.
Username to connect to OwnCloud
Password or App-Token for Owncloud User. I recommend using an App-Token. This can be created in your Personal settings in OwnCloud Webinterface. Its called App passwords.
Defaults to https
. If you know what you are doing, you could change it to http
. Not recommended!
OwnCloud Server URL. eg. myowncloud.com
Since this is used for .netrc
creation and CLI URL, just give the servername here. The protocol and path information is added by other variables.
If you need to specify a different port, eg. 8443 instead of default 443, please specify like myowncloud.com:8443
Use this parameter to add a path to your OwnCloud instance. Like https://myserver.com__/owncloud__. In this case the value would be /owncloud/
.
This variable is fixed with most OwnCloud installations, so it might not be changed in normal usecases. It defaults to remote.php/webdav
You can append a filepath, so the client will only sync from this path and below. eg. /Photos
will only sync everything in the Photos directory of your OwnCloud.
To ignore errors from selfsigned certificates, set value to 1
.
Default: 0
SYNC_HIDDEN
If this parameter is set to 1
, it will also sync all hidden files within the specified ownCloud directory (equivalent to owncloudcmd -h
)
Default: 0
If this parameter is set to 0
, output will be more verbose and might create huge log files, if it is set to 1
output will be silenced.
Default: 1
This specifies the interval in seconds at which the client will run and check for changes.
This is needed to ensure, that the data written to the mounted directory, is written as your user and not as root. There will be a user with this exact UID created within the container and owncloudcmd
is executed as that user.
Defaults to UID 1000
which is the common UID for desktop linux users. You can find your current UID by id -u
on the commandline.
Currently the usage of UID 0
for root is not supported, since it would collide with the usercreation within the container. Will be changed later on.
Do this at your own risk, only when know what you are doing and if the OwnCloud you test against belongs to you!
Using this container in combination with Docker Swarm Mode can simulate concurrent clients and load/traffic patterns.
- Set up a Swarm by
docker swarm init
- Optional add additional worker nodes
docker swarm join --token XXX <MasterIP>:<MasterPort>
- Create/Prepare one or more Testusers in your OwnCloud.
Start one Container client:
docker service create \
--name occlients \
--env OC_SERVER=owncloud.yourdomain.com \
--env OC_USER=YourOCuser \
--env OC_PASS=YourOCpassword \
toughiq/owncloud-client
See environment variables section, if you need to add some more values. Like OC_URLPATH or OC_FILEPATH. Mounting of a volume is not needed, since we dont want to write the data on the local host. For this tests its just fine, if the data only resides within the containers.
Scale the number of running containers up or down.
docker service scale occlients=<NUMBER>
If you want to change files and folders, which get synced to OwnCloud, you can use the webinterface and connect as the user specified in this test.
Or you could exec into one of the running containers and change data within. docker exec -it <ContainerID> bash
To stop/remove the containers, just issue docker service rm occlients
.