Compare commits

...

11 Commits

Author SHA1 Message Date
Luk
09e9ac6f24 u 2026-02-07 11:35:33 +08:00
luk
268189c972 [package.json] 排序,把 scripts 放到最后 2025-03-25 15:45:00 +08:00
luk
0bfceb637e rename git.faronear.org to git.tic.cc 2025-03-25 15:42:25 +08:00
Luk
fa9fd1a33a ignore *nogit* and *nosf* 2024-09-22 15:51:42 +08:00
Luk
b458856a04 improve gitignore and seafile-ignore 2024-04-24 14:18:22 +08:00
Luk
edff320e2b u 2024-02-23 13:26:14 +08:00
Luk
e6d2820f47 console.xxx({_at,...}) 2024-02-05 11:38:21 +08:00
Luk
23e4b6f4f3 updated .gitignore and seafile-ignore.txt using npm/sysconfig/*-ignore-find2merge.sh 2024-01-28 12:18:15 +08:00
Luk Lu
b7d656afe4 rename deving/preping/proding to serving-* 2023-10-07 11:16:16 +08:00
Luk Lu
717a084e35 update seafile-ignore.txt 2023-09-12 14:20:40 +08:00
Luk Lu
f4e2f87fc9 update .gitignore to ignore *.gitignore.* instead of envar-*.gitignore.js 2023-03-11 08:27:12 +08:00
4 changed files with 139 additions and 91 deletions

33
.gitignore vendored
View File

@@ -1,16 +1,42 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# how to include another gitignore?
# https://stackoverflow.com/questions/7005142/can-i-include-other-gitignore-file-in-a-gitignore-file-like-include-in-c-li
# https://github.com/github/gitignore
# https://github.com/SlideWave/gitignore-include?tab=readme-ov-file#examples
# https://gitignore.io
### 目录 #################################################################
### .gitignore.global.txt ###
# Self defined pattern to ignore
?*.gitignore
?*.gitignore/
?*.gitignore.*
?*.gitignore.*/
*.gitomit
*.gitomit.*
*.gitomit/
*.gitomit.*/
*.nogit
*.nogit.*
*.nogit/
*.nogit.*/
# 保留
!.gitignore
!.gitignore.*
!.gitkeep
# 通用
.svn/
.deploy_git/
.idea/
.sass-cache/
.wrangler
/test/unit/coverage/
/test/e2e/reports/
node_modules/
*.aab
*.apk
*.ipa
*.min.js
*.min.css
*.min.html
@@ -70,7 +96,6 @@ _desktop.ini
/db.json
# wo
envar-*.gitignore.js
# 服务端
/_archive/*
/_datastore/*
@@ -84,5 +109,5 @@ envar-*.gitignore.js
package-lock.json
pages4loader.json5
# 保留
!.gitkeep
### .gitignore.local.txt ###

View File

@@ -4,18 +4,10 @@
"description": "Launch web server",
"main": "webserver.js",
"author": "",
"scripts": {
"preping": "npx cross-env NODE_ENV=development npx nodemon webserver.js",
"preping-pm2": "npx cross-env NODE_ENV=development npx pm2 start webserver.js",
"proding": "npx cross-env NODE_ENV=production npx nodemon webserver.js",
"proding-pm2": "npx cross-env NODE_ENV=production npx pm2 start webserver.js",
"proding-sup": "npx cross-env NODE_ENV=production npx supervisor -i node_modules,_webroot -- webserver.js"
},
"dependencies": {
"body-parser": "^1.18.2",
"compression": "^1.7.3",
"cookie-parser": "^1.4.3",
"deepmerge": "^2.1.1",
"errorhandler": "^1.5.0",
"express": "^4.16.2",
"http-proxy": "^1.17.0",
@@ -23,13 +15,20 @@
"morgan": "^1.9.0",
"serve-favicon": "^2.5.0",
"vhost": "^3.0.2",
"wo-base-envar": "git+https://git.faronear.org/npm/wo-base-envar",
"wo-core-toolkit": "git+https://git.faronear.org/npm/wo-core-toolkit"
"wo-base-envar": "git+https://git.tic.cc/open/wo-base-envar",
"wo-core-toolkit": "git+https://git.tic.cc/open/wo-core-toolkit"
},
"devDependencies": {
"cross-env": "^7.0.2",
"nodemon": "^2.0.2",
"pm2": "^5.1.2",
"supervisor": "^0.12.0"
},
"scripts": {
"serving-dev-nodemon": "npx cross-env NODE_ENV=development npx nodemon webserver.js",
"serving-dev-pm2": "npx cross-env NODE_ENV=development npx pm2 start webserver.js",
"serving-prod-nodemon": "npx cross-env NODE_ENV=production npx nodemon webserver.js",
"serving-prod-pm2": "npx cross-env NODE_ENV=production npx pm2 start webserver.js",
"serving-prod-sup": "npx cross-env NODE_ENV=production npx supervisor -i node_modules,_webroot -- webserver.js"
}
}

View File

@@ -1,58 +1,84 @@
# https://help.seafile.com/syncing_client/excluding_files/
# 注释。通配符:* 匹配0到若干个字符包括代表目录的/。? 匹配1个字符包括/。
# seafile-ignore.txt 只能控制在客户端需要忽略哪些文件。你依然可以在 seahub 的 web 界面创建这些被客户端忽略的文件。
# 在这种情况下,
# 这些文件会被同步到客户端,但是用户在客户端对这些文件的后续修改会被忽略,不会被同步回服务器。
# 文件在服务器端的后续更改会被同步到客户端,如果客户端也同时修改了这些文件,系统会生成冲突文件。
# seafile-ignore.txt 只能忽略还没有被同步的文件。对于已经被同步的文件,如果后来把它添加到 seafile-ignore.txt 中,系统只会忽略后续更改,已经上传的版本不会受影响。
# 自定义的后缀名,凡有 sfignore 后缀的都不进行同步
*.sfignore
*.sfignore/
.DS_Store
*/.DS_Store
.thumbnails
*/.thumbnails
Thumbs.db
*/Thumbs.db
thumbs.db
*/thumbs.db
_desktop.ini
*/_desktop.ini
._*
*/._*
.$*
*/.$*
~$*
*/~$*
node_modules/
*/node_modules/
package-lock.json
pages4loader.json5
.svn/
*/.svn/
.deploy_git/
*/.deploy_git/
unpackage/dist/
*/unpackage/dist/
unpackage/release/
*/unpackage/release/
unpackage/cache/
*/unpackage/cache/
Icon
OneDrive/Icon
# https://help.seafile.com/syncing_client/excluding_files/
# 注释。通配符:* 匹配0到若干个字符包括代表目录的/。? 匹配1个字符包括/。
# seafile-ignore.txt 只能控制在客户端需要忽略哪些文件。你依然可以在 seahub 的 web 界面创建这些被客户端忽略的文件。
# 在这种情况下,
# 这些文件会被同步到客户端,但是用户在客户端对这些文件的后续修改会被忽略,不会被同步回服务器。
# 文件在服务器端的后续更改会被同步到客户端,如果客户端也同时修改了这些文件,系统会生成冲突文件。
# seafile-ignore.txt 只能忽略还没有被同步的文件。对于已经被同步的文件,如果后来把它添加到 seafile-ignore.txt 中,系统只会忽略后续更改,已经上传的版本不会受影响。
### seafile-ignore.global.txt ###
# 自定义的后缀名,凡有 sfignore 后缀的都不进行同步
*.sfignore
*.sfignore/
*.sfignore.*
*.sfignore.*/
*.sfomit
*.sfomit.*
*.sfomit/
*.sfomit.*/
*.nosf
*.nosf.*
*.nosf/
*.nosf.*/
## everything 'git pull or fetch' will update `.git/FETCH_HEAD`, even if the content doesn't change. To avoid too many useless updates of this file in Seafile history:
FETCH_HEAD
*/FETCH_HEAD
.Trash/
.DS_Store
*/.DS_Store
.thumbnails
*/.thumbnails
Thumbs.db
*/Thumbs.db
thumbs.db
*/thumbs.db
_desktop.ini
*/_desktop.ini
._*
*/._*
.$*
*/.$*
~$*
*/~$*
node_modules/
*/node_modules/
package-lock.json
*/package-lock.json
pages4loader.json5
*/pages4loader.json5
.deploy_git/
*/.deploy_git/
# next.js 项目
.next/
*/.next/
# HBuilder 目录
unpackage/
*/unpackage/
Icon
OneDrive/Icon
# wrangler project
.dev.vars*
*/.dev.vars*
.wrangler/
*/.wrangler/
### seafile-ignore.local.txt ###

View File

@@ -18,7 +18,7 @@ const wo = (global.wo = {
webProtocol: process.env.NODE_ENV === 'production' ? 'httpall' : 'http',
webHostname: process.env.NODE_ENV === 'production' ? 'unknownhost' : 'localhost',
webPort: process.env.NODE_ENV === 'production' ? coretool.PORT_WEB_SERVER_DEV : undefined,
webRoot: process.env.NODE_ENV === 'production' ? '_webroot' : '_webroot', // local path to serve as webroot. 'unpackage/dist/build/h5'
webRoot: process.env.NODE_ENV === 'production' ? '_webroot' : 'unpackage/dist/build/web', // local path to serve as webroot. 'unpackage/dist/build/h5'
webIndex: 'index.html',
webSsl:
process.env.NODE_ENV === 'production'
@@ -44,11 +44,9 @@ const wo = (global.wo = {
if (typeof wo.envar.webSsl === 'string') {
wo.envar.webSsl = eval(`(${wo.envar.webSsl})`)
}
console.log('\n******** Environment Variables ********')
console.log(JSON.parse(coretool.stringify_by_keyorder(wo.envar)))
console.log('******** Environment Variables ********\n')
console.log({ _at: new Date().toJSON(), about: '******** Environment Variables ********', envar: JSON.parse(coretool.stringify_by_keyorder(wo.envar)) })
;(function serve () {
console.log('★★★★★★★★ Starting Server ★★★★★★★★')
console.log({ _at: new Date().toJSON(), about: '★★★★★★★★ Starting Server ★★★★★★★★' })
const server = express()
@@ -107,9 +105,9 @@ console.log('******** Environment Variables ********\n')
.createServer(server)
.listen(portHttp, function (err) {
if (err) {
console.error(err)
console.error({ _at: new Date().toJSON(), err })
} else {
console.log({ time: new Date().toJSON() }, `Server listening on ${wo.envar.webProtocol}://${wo.envar.webHostname}:${portHttp}`)
console.log({ _at: new Date().toJSON(), about: `Server listening on ${wo.envar.webProtocol}://${wo.envar.webHostname}:${portHttp}` })
}
})
} else if ('https' === wo.envar.webProtocol) {
@@ -126,9 +124,9 @@ console.log('******** Environment Variables ********\n')
)
.listen(portHttps, function (err) {
if (err) {
console.error(err)
console.error({ _at: new Date().toJSON(), err })
} else {
console.log({ time: new Date().toJSON() }, `Server listening on ${wo.envar.webProtocol}://${wo.envar.webHostname}:${portHttps}`)
console.log({ _at: new Date().toJSON(), about: `Server listening on ${wo.envar.webProtocol}://${wo.envar.webHostname}:${portHttps}` })
}
})
} else if ('httpall' === wo.envar.webProtocol) {
@@ -136,8 +134,8 @@ console.log('******** Environment Variables ********\n')
let portHttps = wo.envar.webPort?.portHttps || 443
// if (wo.envar.webSsl.type==='greenlock') {
// greenlock.listen(portHttp, portHttps, function (err) {
// if (err) console.error(err)
// else console.log(`Server listening on [${wo.envar.webProtocol}] http=>https://${wo.envar.webHostname}:${portHttp}=>${portHttps} for ${server.settings.env} environment`)
// if (err) console.error({ _at: new Date().toJSON(),err})
// else console.log({ _at: new Date().toJSON(), about: `Server listening on [${wo.envar.webProtocol}] http=>https://${wo.envar.webHostname}:${portHttp}=>${portHttps} for ${server.settings.env} environment`})
// })
// }else {
require('http')
@@ -147,9 +145,9 @@ console.log('******** Environment Variables ********\n')
})
.listen(portHttp, function (err) {
if (err) {
console.error(err)
console.error({ _at: new Date().toJSON(), err })
} else {
console.log({ time: new Date().toJSON() }, `Server redirecting from http://${wo.envar.webHostname}:${portHttp}`)
console.log({ _at: new Date().toJSON(), about: `Server redirecting from http://${wo.envar.webHostname}:${portHttp}` })
}
})
webServer = require('https')
@@ -163,9 +161,9 @@ console.log('******** Environment Variables ********\n')
)
.listen(portHttps, function (err) {
if (err) {
console.error(err)
console.error({ _at: new Date().toJSON(), err })
} else {
console.log({ time: new Date().toJSON() }, `Server listening on https://${wo.envar.webHostname}:${portHttps}`)
console.log({ _at: new Date().toJSON(), about: `Server listening on https://${wo.envar.webHostname}:${portHttps}` })
}
})
// }
@@ -178,9 +176,9 @@ console.log('******** Environment Variables ********\n')
})
.listen(portHttp, function (err) {
if (err) {
console.error(err)
console.error({ _at: new Date().toJSON(), err })
} else {
console.log({ time: new Date().toJSON() }, `Server listening on ${wo.envar.webProtocol}://${wo.envar.webHostname}:${portHttp}`)
console.log({ _at: new Date().toJSON(), about: `Server listening on ${wo.envar.webProtocol}://${wo.envar.webHostname}:${portHttp}` })
}
})
} else if ('proxyHttps2Http' === wo.envar.webProtocol) {
@@ -202,9 +200,9 @@ console.log('******** Environment Variables ********\n')
})
proxy.listen(portHttps, function (err) {
if (err) {
console.error(err)
console.error({ _at: new Date().toJSON(), err })
} else {
console.log({ time: new Date().toJSON() }, `Server listening on ${wo.envar.webProtocol}://${wo.envar.webHostname}:${portHttps}`)
console.log({ _at: new Date().toJSON(), about: `Server listening on ${wo.envar.webProtocol}://${wo.envar.webHostname}:${portHttps}` })
}
})
}