diff --git a/config/config.ini b/config/config.ini index f66296a..1a007d5 100644 --- a/config/config.ini +++ b/config/config.ini @@ -2,9 +2,9 @@ # True表示开启站点调试模式,False表示关闭站点调试模式 debug = False -[database] +#[database] # engine,指定数据库类型,接受sqlite、mysql、oracle、postgresql -engine = sqlite +#engine = sqlite # name表示数据库的名称 # name = db_name # user表示数据库用户名 @@ -15,6 +15,14 @@ engine = sqlite # host = db_host # port表示数据库端口 # port = db_port +[database] +engine = mysql +name = note +user = note +password = note843#$. +host = 127.0.0.1 +port = 3306 + [locale] # 默认站点语言为 中文简体,如需使用其他语言,请配置 language 参数; @@ -24,4 +32,4 @@ engine = sqlite # 在Windows环境下测试或使用,请配置driver = Chrome # driver = Chrome # 如果系统无法正确安装或识别chromedriver,请指定chromedriver在计算机上的绝对路径 -# driver_path = driver_path \ No newline at end of file +# driver_path = driver_path diff --git a/delete_note.sh b/delete_note.sh new file mode 100644 index 0000000..d951b0d --- /dev/null +++ b/delete_note.sh @@ -0,0 +1,100 @@ +#!/bin/bash + +PASSWD="Qax318130843#$." +echo ${PASSWD} +MKDIR (){ +for DIR in txt +do +if [ ! -d ./${DIR} ];then +mkdir -p ${DIR} +fi +done +} +GET_NUM_TXT (){ +DAT=`date +%F|awk -F- '{print $1$2}'` +mysql -uroot -p${PASSWD} -e "use note;select pre_content from app_doc_doc;"|grep -Eo "note/media/[0-9]{6}/.{1,40}.[jpne]{2,3}g" >./txt/used.txt +qshell listbucket imbed|awk '{print $1}'|grep "note" >./txt/qn.txt +find ./media/2* -type f |sed 's#\.\/media\/#note\/media\/#g' >./txt/local.txt +rm -rf ./txt/del_qn.txt + +for i in `cat ./txt/qn.txt` +do +grep ${i} ./txt/used.txt >>/dev/null 2>&1 +if [ $? -ne 0 ];then +echo ${i} >>./txt/del_qn.txt +fi +done +rm -rf ./txt/del_local.txt +for j in `cat ./txt/local.txt` +do +grep ${j} ./txt/used.txt >>/dev/null 2>&1 +if [ $? -ne 0 ];then +echo ${j} >>./txt/del_local.txt +fi +done +JDUGE=`mysql -uroot -p${PASSWD} -e "use note;select count(*) from app_doc_doc where pre_content like '%${DAT}//%';"|awk 'NR==2 {print $1}'` +if [ ${JDUGE} -ne 0 ];then +echo "有\"//\"存在" +else +echo "所有连接正常" +fi +QN=`cat ./txt/qn.txt|wc -l` +USED=`cat ./txt/used.txt|wc -l` +if [ -f ./txt/del_qn.txt ];then +DEL=`cat ./txt/del_qn.txt|wc -l` +else +DEL="0" +fi +LOCAL=`cat ./txt/local.txt|wc -l` +echo "本地总数 ${LOCAL}" +echo "七牛总数 ${QN}" +echo "文章使用 ${USED}" +} +UPLOAD (){ +#rm -rf /root/.qshell +#qshell account UZrc4mwvcTQrJUo_XfRONEQtAucbS_BasqWZ1spa rxmxXEZTThYT_UliBp6htJe_NdvIcG63lDDn5n9W 王志珏 +qshell qupload upload.conf +} + +DEL_QN (){ +qshell batchdelete imbed -i ./txt/del_qn.txt +} + +DEL_LOCAL (){ +for i in `cat ./txt/del_local.txt|sed 's#note\/##g'` +do +rm -rf ${i} +done +} +CHANGE (){ +#更换本地图片链接头为七牛云图片连接头 +mysql -uroot -p123456 -e "use note;update app_doc_image set file_path=REPLACE(file_path,'/media/','http://cdn.imbed.liuyan.wang/note/media/') where file_path like '/media/%';" +#设置图片来源为七牛云 +mysql -uroot -p123456 -e "use note;update app_doc_image set remark='七牛云' where file_path like 'http://cdn.imbed.liuyan.wang/note/media/%'" +mysql -uroot -p123456 -e "use note;update app_doc_doc set content=REPLACE(content,'src=\"/media/','src=\"http://cdn.imbed.liuyan.wang/note/media/') where content like '%src=\"/media/%';" +#更换文章内图片链接 +mysql -uroot -p123456 -e "use note;update app_doc_doc set pre_content=REPLACE(pre_content,'(/media/','(http://cdn.imbed.liuyan.wang/note/media/') where pre_content like '%(/media/%';" +mysql -uroot -p123456 -e "use note;update app_doc_doc set pre_content=replace(pre_content,'${DAT}//','${DAT}/') where pre_content like '%${DAT}//%';" +mysql -uroot -p123456 -e "use note;update app_doc_doc set content=replace(content,'${DAT}//','${DAT}/') where content like '%${DAT}//%';" +mysql -uroot -p123456 -e "use note;update app_doc_image set file_path=replace(file_path,'${DAT}//','${DAT}/') where file_path like '%${DAT}//%';" +} +MKDIR +GET_NUM_TXT +cat < - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - + + + image/svg+xml + + background + + + + Layer 1 + + 颜颜笔记 + + \ No newline at end of file diff --git a/static/search/mrdoc_search_logo.svg b/static/search/mrdoc_search_logo.svg index 3fbb3b1..93f66ab 100644 --- a/static/search/mrdoc_search_logo.svg +++ b/static/search/mrdoc_search_logo.svg @@ -1,101 +1,39 @@ - - + + - - - - - - - - - - - - - - - - - - + + background + + + + Layer 1 + + + + + + + + + + + + + + + + + + + + + + - + + \ No newline at end of file diff --git a/static/search/mrdoc_search_logo_2.svg b/static/search/mrdoc_search_logo_2.svg index 3a3a07d..cf42c78 100644 --- a/static/search/mrdoc_search_logo_2.svg +++ b/static/search/mrdoc_search_logo_2.svg @@ -1,111 +1,18 @@ - - + + - - - - - - - - - - - - + + background + + + - - - - - - - - - + + + Layer 1 + + + + + + \ No newline at end of file diff --git a/upload.conf b/upload.conf new file mode 100644 index 0000000..f8d3ebe --- /dev/null +++ b/upload.conf @@ -0,0 +1,7 @@ +{ + "src_dir":"/usr/local/mrdoc/MrDoc/media", + "key_prefix":"note/media/", + "overwrite" : true, + "rescan_local" : true, + "bucket":"imbed" +}