-
src
-
- core // 核心/公共类库
-
-
- app.ts // 暴露一个koa application实例对象 和一个由logjs提供的logger工具类
-
-
-
- redis.ts // redis client的封装 promisified by bluebird
-
-
-
- sequelize.ts // 建立数据库链接 实例化数据模型 绑定模型关系
-
-
-
- (mongoose.ts) // 暂时不在库里
-
-
- middlewares // 抽取公用的中间件,例如上传 权限控制 头部检查 passport封装等
-
- models // model层
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <Configuration status="INFO"> | |
| <Appenders> | |
| <Console name="ConsoleStream" target="SYSTEM_OUT"> | |
| <PatternLayout pattern="%d{yyyy-dd-MM HH:mm:ss,SSS XXX}{GMT+0} [%t] %-5level %logger{36} - %msg%n" /> | |
| </Console> | |
| <RollingFile | |
| name="AppStream" | |
| fileName="runtime/logs/app.log" | |
| filePattern="runtime/logs/app-%d{yyyy-MM-dd}.log.gz" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const path = require('path'); | |
| const nodeExternals = require('webpack-node-externals') | |
| module.exports = { | |
| entry: './src/app.ts', | |
| module: { | |
| rules: [ | |
| { | |
| test: /\.tsx?$/, | |
| use: 'ts-loader', |
http://localhost:3000/oauth2/authorize?client_id={app_id}&redirect_uri={redirect_url}&scope=
https://{your_callback_url}?access_token={user_jwt_token}&expires_in=604800&username={username}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0xc3ec90F6475AD5FA990a255844b1B008115f3A95 |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3.4' | |
| secrets: | |
| # Find your registration token at: "Your project" > "Settings" > "CI/CD" > "Runners settings" > "Specific Runners" (look for registration token) | |
| # Register it as `GITLAB_REGISTRATION_TOKEN`: `docker secret create GITLAB_REGISTRATION_TOKEN YOUR_REGISTRATION_TOKEN` | |
| GITLAB_REGISTRATION_TOKEN: | |
| external: true | |
| # Find your personal access token at: "Your user account" > "Settings" > "Access Tokens" > "Create personal access token" (for api) | |
| # Register it as `GITLAB_PERSONAL_ACCESS_TOKEN`: `docker secret create GITLAB_PERSONAL_ACCESS_TOKEN <YOUR ACCESS TOKEN>` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| openssl genrsa -aes256 -out ca-key.pem 4096 | |
| openssl req -new -x509 -days 3650 -key ca-key.pem -sha256 -out ca.pem | |
| openssl genrsa -out server-key.pem 4096 | |
| openssl req -subj "/CN=YOUR_IP_ADDR" -sha256 -new -key server-key.pem -out server.csr | |
| echo subjectAltName = DNS:YOUR_IP_ADDR,IP:YOUR_IP_ADDR,IP:127.0.0.1 > extfile.cnf | |
| echo extendedKeyUsage = serverAuth >> extfile.cnf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // get from `Object.keys(window)` in an empty page | |
| const loaded = 'postMessage|blur|focus|close|parent|opener|top|length|frames|closed|location|self|window|document|name|customElements|history|locationbar|menubar|personalbar|scrollbars|statusbar|toolbar|status|frameElement|navigator|origin|external|screen|innerWidth|innerHeight|scrollX|pageXOffset|scrollY|pageYOffset|visualViewport|screenX|screenY|outerWidth|outerHeight|devicePixelRatio|clientInformation|screenLeft|screenTop|defaultStatus|defaultstatus|styleMedia|onanimationend|onanimationiteration|onanimationstart|onsearch|ontransitionend|onwebkitanimationend|onwebkitanimationiteration|onwebkitanimationstart|onwebkittransitionend|isSecureContext|onabort|onblur|oncancel|oncanplay|oncanplaythrough|onchange|onclick|onclose|oncontextmenu|oncuechange|ondblclick|ondrag|ondragend|ondragenter|ondragleave|ondragover|ondragstart|ondrop|ondurationchange|onemptied|onended|onerror|onfocus|oninput|oninvalid|onkeydown|onkeypress|onkeyup|onload|onloadeddata|onloadedmetadata |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 暂时只支持带spinfocode唤醒小程序首页 近期将提供其他页面或url到达能力 届时path参数可能会变 | |
| wx.navigateToMiniProgram({ | |
| appId: '<APPID>', | |
| path: `pages/index/index`, | |
| extraData: { | |
| spinfocode: '<spinfocode>', | |
| }, | |
| envVersion: "release", | |
| success: () => console.log("jump success"), | |
| fail: (e) => console.log("jump failed", e), |