owncloud

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
owncloud [24.01.2016 11:09] Pascal Suterowncloud [16.07.2021 00:30] (current) – [synchronize external caldav and carddav sources] Pascal Suter
Line 110: Line 110:
 i created a user "ocr" on owncloud that i used on my server to mount this users folder through davfs and then share it to my windows machine through samba. i then shared a folder that i will use as hotfolder with the user "ocr" and configured ABBY Fine Reader Hot Folders to scan this folder. i then created a second folder called "Originals" and a third called "Done"  i created a user "ocr" on owncloud that i used on my server to mount this users folder through davfs and then share it to my windows machine through samba. i then shared a folder that i will use as hotfolder with the user "ocr" and configured ABBY Fine Reader Hot Folders to scan this folder. i then created a second folder called "Originals" and a third called "Done" 
  
-The ide is: the scanner creates pdf's and saves them into the hot folder. on my HP MFP i can choose to scan to a samba share and i can set the basename for the pdf it generates.. like this i will have a way to later identify where to put the OCR'd file through a bash or php script running as a cron job on my owncloud server.. +The idea is: the scanner creates pdf's and saves them into the hot folder. on my HP MFP i can choose to scan to a samba share and i can set the basename for the pdf it generates.. like this i will have a way to later identify where to put the OCR'd file through a bash or php script running as a cron job on my owncloud server..  
 +**Note** if you want ownclouds serch_lucene app to be able to index the pdf afterwards, use **PDF/A** as output format. files will be larger then with their other PDF format (actually about twice the size) but unfortunately search_lucene can't read those other pdf's
  
 one thing needs to be taken into account here: if finereader encounters any errors while saving the parsed file, it will just not save the output and move the input file to "originals"..  one thing needs to be taken into account here: if finereader encounters any errors while saving the parsed file, it will just not save the output and move the input file to "originals".. 
Line 117: Line 118:
   diff <(cd /mnt/owncloud/OCR/Done; find *) <(cd /mnt/owncloud/OCR/Originals; find *)   diff <(cd /mnt/owncloud/OCR/Done; find *) <(cd /mnt/owncloud/OCR/Originals; find *)
  
 +===== synchronize external caldav and carddav sources =====
 +**UPDATE** I have moved away from python virtualenv as it broke vdirsyncer on almost every os update. I now run vdirsyncer in a docker container based on [[https://github.com/kaergel/docker-vdirsyncer]]. Basically copy the tempalte for the ''docker-compose.yml'' file and adjust to your needs. the ''config'' volume is a single file, so if you have multiple calendars to sync, put them all in one file and then pass this file as ''/config'' volume. I also added a directory which is mounted as volume to ''/status'' and used ''/status'' in the ''general'' section of my config file for the status directory. this seems to work fine. 
  
 +**caution** this has only been done one-way, so that an external calender which is only changed externally gets regularly synced to owncloud. i haven't tired this in a two way mode. 
 +
 +prior to owncloud9 there was a sync script which did exactly that. unfortunately it no longer works with oc9 and the developer has posted that he won't fix it, so we need a new solution. 
 +
 +currently i am using [[https://vdirsyncer.readthedocs.org|vdirsyncer]]. to install in ubuntu 16.04 i did this: 
 +  apt-get install libxml2 libxml2-dev libxslt libxslt-dev zlib1g python python-virtualenv python-pip
 +  pip install pipsi
 +  pipsi --home /opt/owncloud/ install --python python3 vdirsyncer
 +  mkdir /opt/owncloud/vdirsyncer/status
 +  chmod 777 /opt/owncloud/vdirsyncer/status
 +now it's time to configure your vdirsyncer.. in my case i wanted to sync a html read-only source (ical format) to owncloud. here is my config file: 
 +<code>
 +[pair photokiste]
 +a = "photokiste_crm"
 +b = "photokiste_owncloud"
 +collections = null
 +conflict_resolution = "a wins"
 +
 +[storage photokiste_crm]
 +type = "http"
 +url = "https://www.source-server.com/ical.ics"
 +
 +[storage photokiste_owncloud]
 +type = "caldav"
 +url = "https://my.owncloud.server/remote.php/dav/calendars/username/calenarname"
 +username = "myuser"
 +password = "mysecret"
 +</code>
 +the owncloud calendar name can be viewed by hovering over the calendar. it will appear as mouse pointer tooltip. 
 +
 +one thing on the ical format.. i used a library called ''PHP iCalWriter'' which i generated the ical source file with. as it turns out, PHP iCalWriter writes an different DTSTART and DTEND field for whole-day-events than what owncloud accepts. i have no idea who's write and who's wrong, but since i PHP iCalWriter is open source and it is already quite an old version i am using i decided to simply modify it. make sure, that your ical file contians a DTSTART and DTEND that look like this for whole-day-events (that is, events where the start and end date does not contain a time): 
 +  DTSTART;VALUE=DATE:20160903
 +and a line like this for date + time start and end dates: 
 +  DTSTART:19701025T030000
 +(PHP iCalWriter never added the ;VALUE=DATE: portion). 
 +this might be an onwcloud problem, as owncloud exports the "wrongly" specified events but it does not show them on the web-interface.. so maybe the web ui is just messing this up.. 
 +
 +once the config file is written, vdirsyncer needs to be run to initialize the account. as the user who will run vdirsyncer later on run this command: 
 +  VDIRSYNCER_CONFIG=/opt/owncloud/photokiste.conf /opt/owncloud/vdirsyncer/bin/vdirsyncer discover photokiste
 +now vdirsyncer can be run through cron or manually like this: 
 +  VDIRSYNCER_CONFIG=/opt/owncloud/photokiste.conf /opt/owncloud/vdirsyncer/bin/vdirsyncer sync
 +
 +that's it :) .. theoretically vdirsyncer should also support two way sync, but i haven't tried that..  however they seem confident in their solution so it might be worth a try even for two-way syncing :)
 +==== Update Vdirsyncer ====
 +you can run updates using pipsi as well: 
 +  pipsi --home /opt/owncloud/ upgrade
 +==== fix vdirsyncer after OS upgrade ====
 +you might just need to re-install vdirsyncer after a os upgrade because the python version behind the virtualenv changed and is no longer compatible with the environment. in that case just rename the ''/opt/owncloud/vdirsyncer'' directory and start from scratch as listed above. Make sure you keep your configs! 
  
  • owncloud.1453630180.txt.gz
  • Last modified: 24.01.2016 11:09
  • by Pascal Suter