From 3ebb3577da9df3f75d38e627087e7a13f43fead6 Mon Sep 17 00:00:00 2001 From: xiaoz Date: Mon, 22 Mar 2021 15:55:48 +0800 Subject: [PATCH 1/5] 0.9.9 --- config.simple.php | 2 +- controller/index.php | 4 ++-- data/index.html | 1 + index.php | 9 +++++---- templates/admin/footer.php | 2 +- templates/default/index.php | 14 +++++++++++--- 6 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 data/index.html diff --git a/config.simple.php b/config.simple.php index 1f3b796..e72ee02 100644 --- a/config.simple.php +++ b/config.simple.php @@ -4,7 +4,7 @@ require 'class/Medoo.php'; use Medoo\Medoo; $db = new medoo([ 'database_type' => 'sqlite', - 'database_file' => 'db/onenav.db3' + 'database_file' => 'data/onenav.db3' ]); //用户名 diff --git a/controller/index.php b/controller/index.php index 00a78a2..cea2a62 100644 --- a/controller/index.php +++ b/controller/index.php @@ -109,8 +109,8 @@ function base64($url){ //获取版本号 $version = get_version(); //载入js扩展 -if( file_exists('templates/admin/static/extend.js') ) { - $onenav['extend'] = ''; +if( file_exists('data/extend.js') ) { + $onenav['extend'] = ''; } else{ $onenav['extend'] = ''; diff --git a/data/index.html b/data/index.html new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/data/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/index.php b/index.php index c5cc33b..8cac64f 100644 --- a/index.php +++ b/index.php @@ -11,16 +11,17 @@ $c = strip_tags($c); //读取版本号 //$version = @file_get_contents("./functions/version.txt"); //载入配置文件 -if( !file_exists('./config.php') ) { +if( !file_exists('./data/config.php') ) { exit('

配置文件不存在,请将config.simple.php复制一份并命名为config.php

'); } //检查数据库是否存在,不存在则复制数据库 -if( !file_exists('./db/onenav.db3') ) { - copy('db/onenav.simple.db3','db/onenav.db3'); +if( !file_exists('./data/onenav.db3') ) { + copy('db/onenav.simple.db3','data/onenav.db3'); + // copy('db/.htaccess','data/.htaccess'); } //载入配置文件 -require("./config.php"); +require("./data/config.php"); //根据不同的请求载入不同的方法 //如果没有请求控制器 diff --git a/templates/admin/footer.php b/templates/admin/footer.php index 0a77d69..3f1286c 100644 --- a/templates/admin/footer.php +++ b/templates/admin/footer.php @@ -1,6 +1,6 @@ diff --git a/templates/default/index.php b/templates/default/index.php index 6c494f9..fde320c 100644 --- a/templates/default/index.php +++ b/templates/default/index.php @@ -34,6 +34,14 @@ --> + +
+
+ + +
+
+ -
+
@@ -153,7 +161,7 @@ From fa71ea60c263c0979807d8268404b838f4cb0488 Mon Sep 17 00:00:00 2001 From: xiaoz Date: Mon, 22 Mar 2021 18:50:11 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=B8=BB=E9=A2=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/default/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/default/index.php b/templates/default/index.php index fde320c..a3632e9 100644 --- a/templates/default/index.php +++ b/templates/default/index.php @@ -35,14 +35,14 @@
--> - From 712db81916da86a04787cd64ae1c22367effb48e Mon Sep 17 00:00:00 2001 From: xiaoz Date: Mon, 22 Mar 2021 21:49:41 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 5e5fae1..751cd38 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v0.9.8-20201224 \ No newline at end of file +v0.9.9-20210322 \ No newline at end of file From 2e0ad72d9db4f528d31a7eebd012a090b33859d7 Mon Sep 17 00:00:00 2001 From: xiaoz Date: Mon, 22 Mar 2021 22:01:28 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 8cac64f..3384187 100644 --- a/index.php +++ b/index.php @@ -12,7 +12,7 @@ $c = strip_tags($c); //$version = @file_get_contents("./functions/version.txt"); //载入配置文件 if( !file_exists('./data/config.php') ) { - exit('

配置文件不存在,请将config.simple.php复制一份并命名为config.php

'); + exit('

配置文件不存在,请将站点目录下的config.simple.php复制为data/config.php

'); } //检查数据库是否存在,不存在则复制数据库 if( !file_exists('./data/onenav.db3') ) { From 7795d3d1ae292f6eade82839f9cf0e9e57516f6c Mon Sep 17 00:00:00 2001 From: xiaoz Date: Mon, 22 Mar 2021 22:15:55 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 74cc037..7b0bc14 100644 --- a/README.md +++ b/README.md @@ -21,13 +21,28 @@ * 支持链接信息自动识别 * 支持API -## 快速开始 +## 安装 + +**常规安装:** 1. 需安装PHP环境,并确保支持SQLite3 2. 下载源码解压到站点根目录 -3. 将`config.simple.php`修改为`config.php`并填写自己的站点信息 +3. 将`config.simple.php`复制为`data/config.php`并填写自己的站点信息 5. 访问后台:`http://IP/index.php?c=login` +**Docker部署:** + +```bash +docker run -itd --name="onenav" -p 80:80 \ + -e USER='xiaoz' -e PASSWORD='xiaoz.me' \ + -v /data/onenav:/data/wwwroot/default/data \ + helloz/onenav +``` + +* `USER`:设置用户名,上述设置为`xiaoz` +* `PASSWORD`:设置密码,上述设置为`xiaoz.me` +* `/data/onenav`:本机挂载目录,用于持久存储Onenav数据 + > 更多说明,请参考帮助文档:https://www.yuque.com/helloz/onenav ## 联系我