Skip to content

Commit

Permalink
Merge pull request #141 from SaaShup/volume_size_step1
Browse files Browse the repository at this point in the history
🧪 Volume size step1
  • Loading branch information
fanshan authored Oct 18, 2024
2 parents e2ec2b5 + 417ea94 commit fde409f
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 73 deletions.
179 changes: 132 additions & 47 deletions flows.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@
"once": false,
"onceDelay": "1",
"topic": "",
"x": 160,
"y": 680,
"x": 170,
"y": 720,
"wires": [
[
"3f489e8a5d253765",
Expand Down Expand Up @@ -217,8 +217,8 @@
"createDir": false,
"overwriteFile": "true",
"encoding": "none",
"x": 510,
"y": 780,
"x": 520,
"y": 820,
"wires": [
[]
]
Expand All @@ -240,8 +240,8 @@
"topic": "",
"payload": "",
"payloadType": "date",
"x": 140,
"y": 780,
"x": 150,
"y": 820,
"wires": [
[
"55c03f8643b324ae"
Expand All @@ -259,8 +259,8 @@
"syntax": "plain",
"template": "data = require(\"./package.json\")\n\nmodule.exports = {\n credentialSecret: \"saashup\",\n flowFile: \"flows.json\",\n flowFilePretty: true,\n adminAuth: {\n type: \"credentials\",\n users: [{\n username: process.env.ADMIN_USERNAME || \"admin\",\n password: process.env.ADMIN_PASSWORD || \"$2a$08$s.NFdSn4Gm4d7gHErya//e6O8RO1/3f7TZ7zflXJ9jfFV0cI6jGwK\",\n permissions: \"*\"\n }]\n },\n /*https: {\n key: require(\"fs\").readFileSync('/data/privkey.pem'),\n cert: require(\"fs\").readFileSync('/data/cert.pem')\n },\n requireHttps: true,*/\n httpNodeAuth: {\n user: process.env.API_USERNAME || \"admin\",\n pass: process.env.API_PASSWORD || \"$2a$08$s.NFdSn4Gm4d7gHErya//e6O8RO1/3f7TZ7zflXJ9jfFV0cI6jGwK\"\n },\n uiPort: process.env.PORT || 1880,\n disableEditor: 'ENABLE_EDITOR' in process.env ? false : true,\n httpStatic: [\n { path: '/usr/src/node-red/public', root: '/' },\n { path: '/usr/src/node-red/public/doc.html', root: '/doc' },\n { path: '/usr/src/node-red/public/openapi.yml', root: '/openapi' }\n ],\n httpAdminRoot: '/nodered',\n diagnostics: {\n enabled: true,\n ui: true,\n },\n runtimeState: {\n enabled: false,\n ui: false,\n },\n logging: {\n console: {\n level: \"info\",\n metrics: false,\n audit: false,\n handler: function(settings) {\n return function(msg) {\n const level = {\n 20: 'error',\n 30: 'warn',\n 40: 'info'\n };\n const lvl = \"level\" in msg ? msg.level : \"40\";\n\n delete msg.type;\n delete msg.z;\n delete msg.path;\n delete msg.name;\n delete msg.id;\n\n let line = `${data.name} level=${level[lvl]} version=${data.version}`;\n\n if (typeof msg.msg === 'object') {\n for (const key of Object.keys(msg.msg)) {\n line += ` ${key}=${JSON.stringify(msg.msg[key])}`;\n }\n } else {\n line += ` msg=` + JSON.stringify(msg.msg);\n }\n\n if (lvl <= 20) {\n return console.error(line);\n }\n\n return console.log(line);\n }\n }\n }\n },\n exportGlobalContextKeys: false,\n externalModules: {\n },\n editorTheme: {\n tours: false,\n palette: {\n },\n projects: {\n enabled: false,\n workflow: {\n mode: \"manual\"\n }\n },\n codeEditor: {\n lib: \"monaco\",\n options: {\n }\n },\n markdownEditor: {\n mermaid: {\n enabled: true\n }\n },\n },\n functionExternalModules: true,\n functionTimeout: 0,\n functionGlobalContext: {\n },\n debugMaxLength: 1000,\n mqttReconnectTime: 15000,\n serialReconnectTime: 15000\n}\n",
"output": "str",
"x": 330,
"y": 780,
"x": 340,
"y": 820,
"wires": [
[
"deb89a9f64f32d7e"
Expand All @@ -279,8 +279,8 @@
"winHide": false,
"oldrc": false,
"name": "Events",
"x": 340,
"y": 880,
"x": 350,
"y": 920,
"wires": [
[
"7c210c45ea82059e"
Expand All @@ -306,8 +306,8 @@
"topic": "",
"payload": "",
"payloadType": "date",
"x": 150,
"y": 880,
"x": 160,
"y": 920,
"wires": [
[
"b3814c680815a25b"
Expand All @@ -329,8 +329,8 @@
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 640,
"y": 860,
"x": 650,
"y": 900,
"wires": [
[
"8e555efa2728d8b8"
Expand All @@ -348,8 +348,8 @@
"arraySpltType": "len",
"stream": false,
"addname": "",
"x": 500,
"y": 860,
"x": 510,
"y": 900,
"wires": [
[
"06b0b14f4b337cfe"
Expand Down Expand Up @@ -386,8 +386,8 @@
"checkall": "true",
"repair": false,
"outputs": 4,
"x": 960,
"y": 860,
"x": 970,
"y": 900,
"wires": [
[],
[],
Expand All @@ -403,8 +403,8 @@
"property": "payload",
"action": "",
"pretty": false,
"x": 800,
"y": 860,
"x": 810,
"y": 900,
"wires": [
[
"da696e53c1c7431f"
Expand Down Expand Up @@ -437,8 +437,8 @@
"from": "",
"to": "",
"reg": false,
"x": 380,
"y": 660,
"x": 390,
"y": 700,
"wires": [
[
"d216b6ee68a71932"
Expand All @@ -456,8 +456,8 @@
"createDir": false,
"overwriteFile": "true",
"encoding": "none",
"x": 570,
"y": 660,
"x": 580,
"y": 700,
"wires": [
[]
]
Expand Down Expand Up @@ -621,7 +621,8 @@
"y": 440,
"wires": [
[
"2b9a4a79e583d72a"
"2b9a4a79e583d72a",
"964f77c37875401b"
]
]
},
Expand All @@ -636,8 +637,8 @@
"once": true,
"onceDelay": "5",
"topic": "",
"x": 150,
"y": 520,
"x": 160,
"y": 560,
"wires": [
[
"b96bd464463004a6"
Expand All @@ -663,8 +664,8 @@
"from": "",
"to": "",
"reg": false,
"x": 350,
"y": 580,
"x": 360,
"y": 620,
"wires": [
[
"af0f2ce79605a0a7"
Expand All @@ -676,8 +677,8 @@
"type": "subflow:0455d311f0e53c09",
"z": "216db6efc0df9bc0",
"name": "",
"x": 550,
"y": 580,
"x": 560,
"y": 620,
"wires": []
},
{
Expand Down Expand Up @@ -720,8 +721,8 @@
"from": "",
"to": "",
"reg": false,
"x": 1140,
"y": 520,
"x": 1150,
"y": 560,
"wires": [
[
"63761b3c0cd6b725"
Expand All @@ -744,8 +745,8 @@
"authType": "",
"senderr": false,
"headers": [],
"x": 1350,
"y": 520,
"x": 1360,
"y": 560,
"wires": [
[]
]
Expand All @@ -765,8 +766,8 @@
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 330,
"y": 520,
"x": 340,
"y": 560,
"wires": [
[
"53727c59b9fece10",
Expand Down Expand Up @@ -800,8 +801,8 @@
"from": "",
"to": "",
"reg": false,
"x": 540,
"y": 520,
"x": 550,
"y": 560,
"wires": [
[
"9c7b8352b86756cb"
Expand All @@ -824,8 +825,8 @@
"authType": "",
"senderr": false,
"headers": [],
"x": 750,
"y": 520,
"x": 760,
"y": 560,
"wires": [
[
"975ed88ff7efae09"
Expand All @@ -847,8 +848,8 @@
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 930,
"y": 520,
"x": 940,
"y": 560,
"wires": [
[
"9d463861f76ab37d"
Expand Down Expand Up @@ -1145,8 +1146,8 @@
"from": "",
"to": "",
"reg": false,
"x": 380,
"y": 720,
"x": 390,
"y": 760,
"wires": [
[
"8d225e4335f4ab51"
Expand All @@ -1164,8 +1165,71 @@
"createDir": false,
"overwriteFile": "true",
"encoding": "none",
"x": 580,
"y": 720,
"x": 590,
"y": 760,
"wires": [
[]
]
},
{
"id": "964f77c37875401b",
"type": "exec",
"z": "216db6efc0df9bc0",
"command": "curl -X GET --unix-socket /var/run/docker.sock http://localhost/info",
"addpay": "",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "docker api request: get api info",
"x": 430,
"y": 500,
"wires": [
[
"5d8c9841f540054a"
],
[],
[]
]
},
{
"id": "5d8c9841f540054a",
"type": "json",
"z": "216db6efc0df9bc0",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 670,
"y": 500,
"wires": [
[
"e8808ecee2ee7aba"
]
]
},
{
"id": "e8808ecee2ee7aba",
"type": "change",
"z": "216db6efc0df9bc0",
"name": "",
"rules": [
{
"t": "set",
"p": "dockerinfo",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 880,
"y": 500,
"wires": [
[]
]
Expand Down Expand Up @@ -2539,6 +2603,13 @@
"to": "payload",
"tot": "msg"
},
{
"t": "set",
"p": "output.dockerInfo",
"pt": "msg",
"to": "dockerinfo",
"tot": "global"
},
{
"t": "set",
"p": "payload",
Expand Down Expand Up @@ -3768,13 +3839,27 @@
"to": "payload",
"tot": "msg"
},
{
"t": "set",
"p": "dockerDriver",
"pt": "msg",
"to": "dockerinfo.Driver",
"tot": "global"
},
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\t \"Name\": msg.input.data.name,\t \"Driver\": msg.input.data.driver\t}",
"tot": "jsonata"
},
{
"t": "set",
"p": "payload.DriverOpts",
"pt": "msg",
"to": "msg.dockerDriver != \"overlay2\" and $number(msg.input.data.max_size) > 0 ? \t {\t \"o\": \"size=\" & msg.input.data.max_size & \"m\"\t}",
"tot": "jsonata"
},
{
"t": "set",
"p": "post",
Expand Down
Loading

0 comments on commit fde409f

Please sign in to comment.