Compare commits

...

11 Commits

Author SHA1 Message Date
Luk
de27121fa8 u 2026-02-07 11:36:20 +08:00
Luk
dcb578c6c3 ignore *nogit* and *nosf* 2024-09-22 15:51:50 +08:00
Luk
965e0cf540 improve gitignore and seafile-ignore 2024-04-24 14:18:32 +08:00
Luk
2b97caa457 add an ending comma in console.xxx({_at,...}, '\n,') 2024-02-05 11:40:17 +08:00
Luk
ff499ffa4d console.log({_at, ...}) 2024-02-05 09:50:14 +08:00
Luk
2294243f9d updated .gitignore and seafile-ignore.txt using npm/sysconfig/*-ignore-find2merge.sh 2024-01-28 12:18:32 +08:00
Luk Lu
5aa616583a update seafile-ignore.txt 2023-09-12 14:20:35 +08:00
Luk Lu
16b0de7076 u 2023-03-18 10:18:07 +08:00
Luk Lu
16026ac48e 在运行时检测 my.envar || wo.envar,防止被提前引用导致 my.envar 为空 2023-03-18 10:02:42 +08:00
Luk Lu
b69c154255 u 2023-03-12 21:17:32 +08:00
Luk Lu
87720d48da update .gitignore to ignore *.gitignore.* instead of envar-*.gitignore.js 2023-03-11 08:27:05 +08:00
3 changed files with 122 additions and 68 deletions

33
.gitignore vendored
View File

@@ -1,16 +1,42 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. # 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/ .svn/
.deploy_git/ .deploy_git/
.idea/ .idea/
.sass-cache/ .sass-cache/
.wrangler
/test/unit/coverage/ /test/unit/coverage/
/test/e2e/reports/ /test/e2e/reports/
node_modules/ node_modules/
*.aab
*.apk *.apk
*.ipa
*.min.js *.min.js
*.min.css *.min.css
*.min.html *.min.html
@@ -70,7 +96,6 @@ _desktop.ini
/db.json /db.json
# wo # wo
envar-*.gitignore.js
# 服务端 # 服务端
/_archive/* /_archive/*
/_datastore/* /_datastore/*
@@ -84,5 +109,5 @@ envar-*.gitignore.js
package-lock.json package-lock.json
pages4loader.json5 pages4loader.json5
# 保留 ### .gitignore.local.txt ###
!.gitkeep

View File

@@ -1,58 +1,84 @@
# https://help.seafile.com/syncing_client/excluding_files/ # https://help.seafile.com/syncing_client/excluding_files/
# 注释。通配符:* 匹配0到若干个字符包括代表目录的/。? 匹配1个字符包括/。 # 注释。通配符:* 匹配0到若干个字符包括代表目录的/。? 匹配1个字符包括/。
# seafile-ignore.txt 只能控制在客户端需要忽略哪些文件。你依然可以在 seahub 的 web 界面创建这些被客户端忽略的文件。 # seafile-ignore.txt 只能控制在客户端需要忽略哪些文件。你依然可以在 seahub 的 web 界面创建这些被客户端忽略的文件。
# 在这种情况下, # 在这种情况下,
# 这些文件会被同步到客户端,但是用户在客户端对这些文件的后续修改会被忽略,不会被同步回服务器。 # 这些文件会被同步到客户端,但是用户在客户端对这些文件的后续修改会被忽略,不会被同步回服务器。
# 文件在服务器端的后续更改会被同步到客户端,如果客户端也同时修改了这些文件,系统会生成冲突文件。 # 文件在服务器端的后续更改会被同步到客户端,如果客户端也同时修改了这些文件,系统会生成冲突文件。
# seafile-ignore.txt 只能忽略还没有被同步的文件。对于已经被同步的文件,如果后来把它添加到 seafile-ignore.txt 中,系统只会忽略后续更改,已经上传的版本不会受影响。 # seafile-ignore.txt 只能忽略还没有被同步的文件。对于已经被同步的文件,如果后来把它添加到 seafile-ignore.txt 中,系统只会忽略后续更改,已经上传的版本不会受影响。
# 自定义的后缀名,凡有 sfignore 后缀的都不进行同步 ### seafile-ignore.global.txt ###
*.sfignore
*.sfignore/ # 自定义的后缀名,凡有 sfignore 后缀的都不进行同步
*.sfignore
.DS_Store *.sfignore/
*/.DS_Store *.sfignore.*
*.sfignore.*/
.thumbnails *.sfomit
*/.thumbnails *.sfomit.*
*.sfomit/
Thumbs.db *.sfomit.*/
*/Thumbs.db *.nosf
thumbs.db *.nosf.*
*/thumbs.db *.nosf/
*.nosf.*/
_desktop.ini
*/_desktop.ini ## 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
node_modules/
*/node_modules/ Thumbs.db
package-lock.json */Thumbs.db
thumbs.db
pages4loader.json5 */thumbs.db
.svn/ _desktop.ini
*/.svn/ */_desktop.ini
.deploy_git/ ._*
*/.deploy_git/ */._*
unpackage/dist/ .$*
*/unpackage/dist/ */.$*
unpackage/release/ ~$*
*/unpackage/release/ */~$*
unpackage/cache/ node_modules/
*/unpackage/cache/ */node_modules/
package-lock.json
Icon */package-lock.json
OneDrive/Icon
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

@@ -2,15 +2,15 @@ const JsonWebToken = require('jsonwebtoken')
const crypto = require('crypto') const crypto = require('crypto')
const my = { envar: typeof wo !== 'undefined' ? wo.envar : globalThis.envar || {} } const my = {} // 不要在这里 `my = { envar: wo?.envar || globalThis.envar || {} }`,危险!其他类里如提前引用,可能导致 my.envar 一直是空的
module.exports = { module.exports = {
init (envar) { initMy (envar) {
my.envar = envar my.envar = envar
}, },
createToken (content, key = my.envar.tokenKey) { createToken (content, key = my.envar?.tokenKey || wo?.envar?.tokenKey) {
if (!key) { if (!key) {
console.warn('*** tokenkey is empty! ***') console.warn({ _at: new Date().toJSON(), about: '*** tokenkey is empty! ***' }, '\n,')
} }
// content 可以是数字,非空字符串或非空对象,不可以是数组。 // content 可以是数字,非空字符串或非空对象,不可以是数组。
// key 可以未定义,则默认设为空字符串,再转化为哈希。(jsonwebtoken 要求 key 必须有值) // key 可以未定义,则默认设为空字符串,再转化为哈希。(jsonwebtoken 要求 key 必须有值)
@@ -26,9 +26,12 @@ module.exports = {
return null return null
} }
}, },
verifyToken (token, key = my.envar.tokenKey) { verifyToken (token, key = my.envar?.tokenKey || wo?.envar?.tokenKey) {
if (!key) { if (!key) {
console.warn('*** tokenkey is empty! ***') console.warn({ _at: new Date().toJSON(), about: '*** tokenkey is empty! ***' }, '\n,')
}
if (!token) {
return null
} }
try { try {
return JsonWebToken.verify( return JsonWebToken.verify(