diff --git a/docs/developer.md b/docs/developer.md index fe82eeb5a..480fd1554 100644 --- a/docs/developer.md +++ b/docs/developer.md @@ -65,3 +65,14 @@ func initModule() { ```html content ``` + +2. 支持 SQLite3 + + 默认是不支持 SQLite3 数据库的,如要支持,需要在编译的时候添加 tag `db_sqlite`。 + + 此时使用纯 go 版本的 sqlite 驱动,如欲使用更高性能的 cgo 版本驱动,再次添加 tag `sqlitecgo` 即可 + + 例如: + ```bash + go build -tags db_sqlite,sqlitecgo + ``` \ No newline at end of file diff --git a/go.mod b/go.mod index b4eff9f6f..fe7cd040d 100644 --- a/go.mod +++ b/go.mod @@ -38,7 +38,7 @@ require ( github.com/admpub/copier v0.1.1 github.com/admpub/go-ps v0.0.1 github.com/admpub/regexp2 v1.1.8 - github.com/coscms/webcore v0.6.1 + github.com/coscms/webcore v0.6.2 github.com/nging-plugins/caddymanager v1.7.0 github.com/nging-plugins/collector v1.7.0 github.com/nging-plugins/dbmanager v1.7.0 @@ -104,6 +104,11 @@ require ( github.com/chromedp/sysutil v1.1.0 // indirect github.com/coreos/go-oidc/v3 v3.11.0 // indirect github.com/coscms/captcha v0.1.2 // indirect + github.com/coscms/session-boltstore v0.0.0-20241122060137-861b57ff0116 // indirect + github.com/coscms/session-mysqlstore v0.0.0-20241122060432-e4161cb8f12f // indirect + github.com/coscms/session-redisstore v0.0.0-20241122060113-0376b64193ac // indirect + github.com/coscms/session-sqlitestore v0.0.2 // indirect + github.com/coscms/session-sqlstore v0.0.0-20241122060049-76e1eb3fbdc2 // indirect github.com/coscms/webauthn v0.3.1 // indirect github.com/creack/pty v1.1.23 // indirect github.com/dsnet/compress v0.0.1 // indirect @@ -354,8 +359,8 @@ require ( github.com/webx-top/client v0.9.5 github.com/webx-top/codec v0.3.0 // indirect github.com/webx-top/com v1.3.19 - github.com/webx-top/db v1.28.0 - github.com/webx-top/echo v1.12.12 + github.com/webx-top/db v1.28.1 + github.com/webx-top/echo v1.13.0 github.com/webx-top/image v0.1.1 github.com/webx-top/pagination v0.3.1 // indirect github.com/webx-top/poolx v0.0.0-20210912044716-5cfa2d58e380 // indirect diff --git a/go.sum b/go.sum index 2cfe93db4..08d3655ac 100644 --- a/go.sum +++ b/go.sum @@ -1097,10 +1097,20 @@ github.com/coscms/go-imgparse v0.0.1 h1:RMnw3/VtfTOil3SdukPgdGm4xmO5KoQpyVNtPKuF github.com/coscms/go-imgparse v0.0.1/go.mod h1:FqBNWVAozSee1bB11G8ohGq5artPO7Zz3xLtw3d4Kdk= github.com/coscms/oauth2s v0.4.1 h1:wt8IpmGmI/mwecKwjbdDWsGhecFJtJ2todeTdWWEg+0= github.com/coscms/oauth2s v0.4.1/go.mod h1:O2SoVCCNeStzWkHTQ9/udvGiWI5/tKGR7x7H9rwkN0Q= +github.com/coscms/session-boltstore v0.0.0-20241122060137-861b57ff0116 h1:AMTsoQNYfPthckRWYyvwkXN+fWHhFVUapc1mxf0Utmw= +github.com/coscms/session-boltstore v0.0.0-20241122060137-861b57ff0116/go.mod h1:jdABU4YM0TvD22fXUzcm4O3z8khIDLHN6l+JriMamsE= +github.com/coscms/session-mysqlstore v0.0.0-20241122060432-e4161cb8f12f h1:C7bP4pPurP54AMWNE1+pKNsMj87t7Or6uXOx4q3nTog= +github.com/coscms/session-mysqlstore v0.0.0-20241122060432-e4161cb8f12f/go.mod h1:QBwrP3kiypbsVL1qK4Fc0qedtjJ0V31+rwNx67qKUXU= +github.com/coscms/session-redisstore v0.0.0-20241122060113-0376b64193ac h1:Z8d3PwcCT4GrhnYUuXfUXUTzLMckvoGw306YFEJEJX0= +github.com/coscms/session-redisstore v0.0.0-20241122060113-0376b64193ac/go.mod h1:Xsx2G/5bFv/BDNQFKCfUrpJpASzqVwFzR/3PTzntvHE= +github.com/coscms/session-sqlitestore v0.0.2 h1:kMXal3coV3iXKo+IGPmvwfFQoOOcRqXDOELMRl8XU14= +github.com/coscms/session-sqlitestore v0.0.2/go.mod h1:VxGlOZDbiHOErYHC4SxqH0FDmrfds10DhjqzD9f238Y= +github.com/coscms/session-sqlstore v0.0.0-20241122060049-76e1eb3fbdc2 h1:6hBWArNFTFMoGlYLj3fgvZ0fDP4vgShiQMmRzfIGpBE= +github.com/coscms/session-sqlstore v0.0.0-20241122060049-76e1eb3fbdc2/go.mod h1:61328y9rBexpiQnTv2YjkEES2FAGJot+cHOKPyvJbNk= github.com/coscms/webauthn v0.3.1 h1:ycolyzptBj7d+boEvxw1JAGkgJcR8r6kVSA4wDrahNk= github.com/coscms/webauthn v0.3.1/go.mod h1:nyMNZvFm9cArfyu6RQjrGvI+CCsl9mcC01jT4MsmByQ= -github.com/coscms/webcore v0.6.1 h1:BTvVmcuIxx6wJhlPHo4MuSLRwqvH88QeK88VtwbJqb8= -github.com/coscms/webcore v0.6.1/go.mod h1:CFfc8WAVL4OoF4ooedIEvUrX4E39LHqFYBq3K8fO8oA= +github.com/coscms/webcore v0.6.2 h1:bLc8jGiUvNG7lwNeYWB3YLPDctkOcsXWEK9S3TfP5Rc= +github.com/coscms/webcore v0.6.2/go.mod h1:wTc6op1wihEv7a7A8HPzPgv5AEFP5hsHZekqLYE8uWk= github.com/cpu/goacmedns v0.1.1/go.mod h1:MuaouqEhPAHxsbqjgnck5zeghuwBP1dLnPoobeGqugQ= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -2415,10 +2425,10 @@ github.com/webx-top/com v0.7.0/go.mod h1:DDfATzu1w5+vD5XmG3YRTfLjaIqZWi/yeJ7HQEG github.com/webx-top/com v1.2.13/go.mod h1:DDfATzu1w5+vD5XmG3YRTfLjaIqZWi/yeJ7HQEGsM2Q= github.com/webx-top/com v1.3.19 h1:qaSCEYzHXvzk5RHoW5+gh2g66wIY9uQrTRRbwFt1wlU= github.com/webx-top/com v1.3.19/go.mod h1:Pw5Yr5UU0ZtwZU0xVyfyRdqf77wyzh+oRNYnOpX9Oyc= -github.com/webx-top/db v1.28.0 h1:j/suTAJQT5P0Efv0oMw8AhNQ3gusvMhzYS63dciihl4= -github.com/webx-top/db v1.28.0/go.mod h1:G/MPeF8TVBqUY310V06Eg9F1QaKBOQ00Ang7Gq5Y/eE= -github.com/webx-top/echo v1.12.12 h1:VNmj0qaviGgwi7aPC4wf+gWUdAC8WLZBx/nXg2VJrAo= -github.com/webx-top/echo v1.12.12/go.mod h1:ceprNzPoCPBTJOIU1sDRGMHe5ugyIyfC7BC4HtzI5l8= +github.com/webx-top/db v1.28.1 h1:EIYqK6wVJY/cahvxX0JD4KP+Xr4OSZ6zhF+/ROx6+4k= +github.com/webx-top/db v1.28.1/go.mod h1:G/MPeF8TVBqUY310V06Eg9F1QaKBOQ00Ang7Gq5Y/eE= +github.com/webx-top/echo v1.13.0 h1:w3EOVfIiF8+QqxPw496yakZPktew9bKgSXHoBvlizpw= +github.com/webx-top/echo v1.13.0/go.mod h1:957lQX6Yqj3e8J4RhXTyRIetvcg5QDXBfRqRtzCqOes= github.com/webx-top/echo-prometheus v1.1.2 h1:llHHZFWBxb/n0W2Tnn6UjnrOVNi/YQ+v2ETyOZ1248w= github.com/webx-top/echo-prometheus v1.1.2/go.mod h1:8QYzHq8JjzNGKpRw4q4vopq/zcA87Flwqc4oNXVu2gk= github.com/webx-top/image v0.1.1 h1:g8DMDi5cvmoQW3ZlA73t2cF/ywIp1AAEiy1HeIUTXv0= diff --git a/tool/nging-builder/builder-old.conf b/tool/nging-builder/builder-old.conf index 45ceeda2a..3e9640941 100644 --- a/tool/nging-builder/builder-old.conf +++ b/tool/nging-builder/builder-old.conf @@ -28,7 +28,7 @@ VendorMiscDirs { ] linux : ["vendor/github.com/nging-plugins/firewallmanager/template/"] } -BuildTags : ["bindata", "sqlite"] +BuildTags : ["bindata", "db_sqlite", "sqlitecgo"] CopyFiles : ["config/ua.txt", "config/config.yaml.sample", "data/ip2region", "config/preupgrade.*"] MakeDirs : ["public/upload", "config/vhosts", "data/logs"] BindataIgnore : ["[\\/]combined([\\/].*)?$"] diff --git a/tool/nging-builder/builder.conf b/tool/nging-builder/builder.conf index 5100d9a1d..2f2736582 100755 --- a/tool/nging-builder/builder.conf +++ b/tool/nging-builder/builder.conf @@ -28,7 +28,7 @@ VendorMiscDirs { ] linux : ["vendor/github.com/nging-plugins/firewallmanager/template/"] } -BuildTags : ["bindata", "sqlite"] +BuildTags : ["bindata", "db_sqlite", "sqlitecgo"] CopyFiles : ["config/ua.txt", "config/config.yaml.sample", "data/ip2region", "config/preupgrade.*"] MakeDirs : ["public/upload", "config/vhosts", "data/logs"] BindataIgnore : ["[\\/]combined([\\/].*)?$"] diff --git a/tower.yml b/tower.yml index da400d261..58ebc34fd 100644 --- a/tower.yml +++ b/tower.yml @@ -15,8 +15,8 @@ app { # go build -o 命令生成的二进制文件保存位置 buildDir : "" - # go build所需的其它参数,例如:-tags sqlite,bindata - buildParams : '-tags sqlite' + # go build所需的其它参数,例如:-tags db_sqlite,bindata + buildParams : '-tags db_sqlite,sqlitecgo' # 运行app所需的其它参数,例如:webx.exe -p 8080 -e 90 -d 100 其中的“-e 90 -d 100”就是(注意:内部用[单个]半角空格隔开)。 params : ""