Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

142 reject unauthorized #146

Merged
merged 4 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ You can define username and password via envionment variable:

You can disable node-red editor by setting ENABLE_EDITOR to any value.

You can disable docker exec command by settings DISABLE_EXEC to any value.
You can disable docker exec command by setting DISABLE_EXEC to any value.

You can disable SSL checking by setting DISABLE_SSL_CHECK to any value.

## Clean
```
Expand All @@ -39,7 +41,9 @@ docker build -t saashup/netbox-docker-agent .
```
docker run -d -p 1880:1880 -v /var/run/docker.sock:/var/run/docker.sock:rw -v netbox-docker-agent:/data --name netbox-docker-agent saashup/netbox-docker-agent
```
container must have **rw access to the docker unix socket** (/var/run/docker.sock)
Container must have **rw access to the docker unix socket** (/var/run/docker.sock)

A quick and simple way to test is to run `chmod a+rw /var/run/docker.sock`

Default access is *admin/saashup*

Expand Down
98 changes: 90 additions & 8 deletions flows.json
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,13 @@
"pt": "msg",
"to": "{\t \"Authorization\": \"Token \" & $globalContext(\"config\").netbox_token,\t \"Accept\": \"application/json\"\t}",
"tot": "jsonata"
},
{
"t": "set",
"p": "rejectUnauthorized",
"pt": "msg",
"to": "$env(\"DISABLE_SSL_CHECK\") ? false : true",
"tot": "jsonata"
}
],
"action": "",
Expand Down Expand Up @@ -875,6 +882,13 @@
"pt": "msg",
"to": "{\t \"Authorization\": \"Token \" & $globalContext(\"config\").netbox_token,\t \"Accept\": \"application/json\"\t\t}",
"tot": "jsonata"
},
{
"t": "set",
"p": "rejectUnauthorized",
"pt": "msg",
"to": "$env(\"DISABLE_SSL_CHECK\") ? false : true",
"tot": "jsonata"
}
],
"action": "",
Expand Down Expand Up @@ -1248,7 +1262,7 @@
"wires": [
[
"53aaf7026e5a7cee",
"4acdf31cd717543f"
"ae9074b49ecc1248"
]
]
},
Expand Down Expand Up @@ -2235,7 +2249,7 @@
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 350,
"x": 610,
"y": 500,
"wires": [
[
Expand Down Expand Up @@ -3394,6 +3408,33 @@
]
]
},
{
"id": "ae9074b49ecc1248",
"type": "change",
"z": "a827fd671d6a227e",
"name": "set rejectUnauthorized",
"rules": [
{
"t": "set",
"p": "rejectUnauthorized",
"pt": "msg",
"to": "$env(\"DISABLE_SSL_CHECK\") ? false : true",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 360,
"y": 500,
"wires": [
[
"4acdf31cd717543f"
]
]
},
{
"id": "e974d3bd502f614f",
"type": "http in",
Expand All @@ -3403,12 +3444,12 @@
"method": "post",
"upload": false,
"swaggerDoc": "",
"x": 130,
"y": 320,
"x": 140,
"y": 260,
"wires": [
[
"5db8c0db8473ea8e",
"ea738534a1b15332"
"ea738534a1b15332",
"3508df86bd32474e"
]
]
},
Expand Down Expand Up @@ -3542,8 +3583,8 @@
"name": "",
"statusCode": "202",
"headers": {},
"x": 340,
"y": 400,
"x": 360,
"y": 240,
"wires": []
},
{
Expand Down Expand Up @@ -4899,6 +4940,33 @@
[]
]
},
{
"id": "3508df86bd32474e",
"type": "change",
"z": "3ea1a4b04d852f38",
"name": "set rejectUnauthorized",
"rules": [
{
"t": "set",
"p": "rejectUnauthorized",
"pt": "msg",
"to": "$env(\"DISABLE_SSL_CHECK\") ? false : true",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 160,
"y": 320,
"wires": [
[
"5db8c0db8473ea8e"
]
]
},
{
"id": "dcf35b57666a30f9",
"type": "http in",
Expand Down Expand Up @@ -5146,6 +5214,13 @@
"pt": "msg",
"to": "input.data.ContainerID",
"tot": "msg"
},
{
"t": "set",
"p": "rejectUnauthorized",
"pt": "msg",
"to": "$env(\"DISABLE_SSL_CHECK\") ? false : true",
"tot": "jsonata"
}
],
"action": "",
Expand Down Expand Up @@ -7082,6 +7157,13 @@
"pt": "msg",
"to": "payload",
"tot": "msg"
},
{
"t": "set",
"p": "rejectUnauthorized",
"pt": "msg",
"to": "$env(\"DISABLE_SSL_CHECK\") ? false : true",
"tot": "jsonata"
}
],
"action": "",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "netbox-docker-agent",
"version": "0.41.0",
"version": "0.42.0",
"description": "Saashup agent for netbox manager",
"main": "index.js",
"scripts": {
Expand Down