There is seafile (
https://www.seafile.com/en/home/ ) which provides client side encryption.
Easy to install and to upgrade (except a small glitch in the last upgrade).
For the community version, the source code is here : https://github.com/haiwen/seafile (see others haiwen projects).
The Android client could be improved, but it does the job.