Fmstrat / ownnote

Notes app for ownCloud
GNU Affero General Public License v3.0
168 stars 42 forks source link

Missing Note folder to import notes from Evernote #231

Open theSmartRed opened 9 years ago

theSmartRed commented 9 years ago

Hi! Thanks for this great app. I like it very much and waiting for the iOs app with much interest. I installed it without issues in OC 8.1 but I cannot find the /Notes folder where to put the notes I am importing into OC. I have created a first note on OC to see if it was going to be created then but with no luck. Any hint?

Fmstrat commented 8 years ago

Is the settings in the admin screen set to "Database and Filesystem", or just "Database"?

FiSh-MoB commented 8 years ago

Same here, Specs: ownnote 1.0.7 OC 9.1 (pre alpha) MySQL 5.6.27 PHP 7.0.4 (CGI) php-info: https://s.itmohr.de/updater/i1.php In settings the option is set to "Database" (only) and it will not save any changes.

realgeek commented 8 years ago

Same as FiSh-MoB, I tried saving "Database and Filesystem" but it keeps reverting to "Database." I'm on ownnote 1.0.7 OC 9.1 sqlite PHP 5.6.17

edit: just wanted to add that I manually inserted the config entry into the DB and now it seems to be working. I think the line for me was: insert into oc_appconfig values ("ownnote", "folder", "Notes");

salfter commented 8 years ago

I ended up writing a script to import the recipes I had exported from Evernote. Maybe others will find this useful. It converts any images into data: URL strings which are then inserted in place of the file references. The only catch I've seen is that of two notes with the same title property, only the first will be imported; this appears to be a limitation of ownNote.

#!/bin/bash
mysql_host="files"
mysql_user="user-with-access-to-owncloud-db"
mysql_pass="super-secret-password"
mysql_db="owncloud"

user="salfter"
grouping="recipes"

cp "$1" "$1.tmp"

# integrate images, if any

if [ -e "${1%.html}_files" ]
then
  for i in "${1%.html}_files"/*
  do
    type=$(echo "$i" | sed "s/.*\.//g")
    if [ "$type" == "jpg" ]
    then
      type="jpeg"
    fi
    (echo -n "data:image/$type;base64,"; 
     base64 "$i" | tr -d "\n") >"$i.base64"
    sed -i "s/\"$(echo "$i" | sed "s/\//\\\\\//g")\"/\n**INSERT*HERE**\n/" "$1.tmp"
    (awk '$0 == "**INSERT*HERE**" {exit} {print}' "$1.tmp";
     echo -n "\"";
     cat "$i.base64";
     echo -n "\"";
     awk 'p == 1 {print} $0 == "**INSERT*HERE**" {p=1}' "$1.tmp") >"$1.tmp2" && mv "$1.tmp2" "$1.tmp" && rm "$i".base64
  done
fi

# add to database

title=`tr -d "\n" < "$1.tmp" | grep -a "<title>" | sed "s/.*<title>//;s/<\/title>.*//" | sed "s/'/''/g"`
id=$((echo "insert into oc_ownnote (uid, name, grouping, mtime) values ('"$user"', '"$title"', '"$grouping"', "$(date +%s)");";
      echo "select max(id) from oc_ownnote;") | mysql -h "$mysql_host" -u "$mysql_user" --password="$mysql_pass" "$mysql_db" | grep -v "max(id)")
(echo "insert into oc_ownnote_parts (id, note) values ("$id", '";
 awk '$0 ~ "</body>" {p=0} p == 1 {print} $0 ~ "<body>" {p=1}' "$1.tmp" | sed "s/'/''/g";
 echo "');") | mysql -h "$mysql_host" -u "$mysql_user" --password="$mysql_pass" "$mysql_db"

# clean up

rm "$1.tmp"
TraceyC77 commented 8 years ago

I have the same problem as the original poster. The ownCloud admin interface will not save settings after choosing "Database and Files", same problem as FiSh-MoB

I tried realgeek's command to try to manually change the setting but received an error:

owncloud # insert into oc_appconfig values ("ownnote", "folder", "Notes");
-bash: syntax error near unexpected token `('

I've been looking forward to an alternative to Evernote that could integrate into OwnCloud. Import of Evernote files is essential on my server.

gdgeorge commented 8 years ago

OC 9.1.0 stable and latest ownNote. I had this issue upon install of ownNote this evening. I created a note and it seems to be saved. Per the above I set the the storage to 'database and folder'. I also entered 'notes' as the name of the folder.

Best, Jerry Echo4Golf