Skip to content

Commit edbed1a

Browse files
committed
Adds tests for settings endpoints
and reenables dns cert test and fixes problems with schema
1 parent 8497022 commit edbed1a

File tree

15 files changed

+160
-40
lines changed

15 files changed

+160
-40
lines changed

backend/internal/nginx.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ const internalNginx = {
181181
* @param {Object} host
182182
* @returns {Promise}
183183
*/
184-
generateConfig: (host_type, host) => {
184+
generateConfig: (host_type, host_row) => {
185+
// Prevent modifying the original object:
186+
let host = JSON.parse(JSON.stringify(host_row));
185187
const nice_host_type = internalNginx.getFileFriendlyHostType(host_type);
186188

187189
if (config.debug()) {

backend/schema/components/proxy-host-object.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
"locations",
2424
"hsts_enabled",
2525
"hsts_subdomains",
26-
"certificate",
27-
"use_default_location",
28-
"ipv6"
26+
"certificate"
2927
],
3028
"additionalProperties": false,
3129
"properties": {
@@ -151,12 +149,6 @@
151149
"$ref": "./access-list-object.json"
152150
}
153151
]
154-
},
155-
"use_default_location": {
156-
"type": "boolean"
157-
},
158-
"ipv6": {
159-
"type": "boolean"
160152
}
161153
}
162154
}

backend/schema/components/setting-object.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@
4646
},
4747
"meta": {
4848
"description": "Extra metadata",
49-
"example": {},
49+
"example": {
50+
"redirect": "http://example.com",
51+
"html": "<h1>404</h1>"
52+
},
5053
"type": "object"
5154
}
5255
}

backend/schema/paths/nginx/dead-hosts/hostID/put.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@
9494
"avatar": "",
9595
"roles": ["admin"]
9696
},
97-
"certificate": null,
98-
"use_default_location": true,
99-
"ipv6": true
97+
"certificate": null
10098
}
10199
}
102100
},

backend/schema/paths/nginx/dead-hosts/post.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@
7979
"nickname": "Admin",
8080
"avatar": "",
8181
"roles": ["admin"]
82-
},
83-
"use_default_location": true,
84-
"ipv6": true
82+
}
8583
}
8684
}
8785
},

backend/schema/paths/nginx/proxy-hosts/hostID/put.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,7 @@
129129
"roles": ["admin"]
130130
},
131131
"certificate": null,
132-
"access_list": null,
133-
"use_default_location": true,
134-
"ipv6": true
132+
"access_list": null
135133
}
136134
}
137135
},

backend/schema/paths/nginx/proxy-hosts/post.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,7 @@
114114
"avatar": "//www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?default=mm",
115115
"roles": ["admin"]
116116
},
117-
"access_list": null,
118-
"use_default_location": true,
119-
"ipv6": true
117+
"access_list": null
120118
}
121119
}
122120
},

backend/schema/paths/nginx/redirection-hosts/hostID/put.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,7 @@
114114
"avatar": "",
115115
"roles": ["admin"]
116116
},
117-
"certificate": null,
118-
"use_default_location": true,
119-
"ipv6": true
117+
"certificate": null
120118
}
121119
}
122120
},

backend/schema/paths/nginx/redirection-hosts/post.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,7 @@
9999
"nickname": "Admin",
100100
"avatar": "",
101101
"roles": ["admin"]
102-
},
103-
"use_default_location": true,
104-
"ipv6": true
102+
}
105103
}
106104
}
107105
},

backend/schema/paths/nginx/streams/streamID/put.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,7 @@
129129
"roles": ["admin"]
130130
},
131131
"certificate": null,
132-
"access_list": null,
133-
"use_default_location": true,
134-
"ipv6": true
132+
"access_list": null
135133
}
136134
}
137135
},

0 commit comments

Comments
 (0)