Add support for SSH-style git repo addresses (#835)
This allows nodes to be pulled from git repositories that: 1. Require authentication 2. Are located on a computer that does not have any special software beyond an SSH server to serve up git repos 3. Are hosted on sites that exclusively allow SSH access I have also cleaned up the JavaScript regex for identifying valid HTTP addresses. Due to an unescaped '.' and the lack of a count on the first group, it wasn't doing a whole lot anyway -- just checking that the very first character wasn't invalid.
This commit is contained in:
@@ -34,8 +34,9 @@ function isValidURL(url) {
|
||||
if(url.includes('&'))
|
||||
return false;
|
||||
|
||||
const pattern = /^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/;
|
||||
return pattern.test(url);
|
||||
const http_pattern = /^(https?|ftp):\/\/[^\s$?#]+$/;
|
||||
const ssh_pattern = /^(.+@|ssh:\/\/).+:.+$/;
|
||||
return http_pattern.test(url) || ssh_pattern.test(url);
|
||||
}
|
||||
|
||||
export async function install_pip(packages) {
|
||||
|
||||
Reference in New Issue
Block a user