CreateImageWizard: fix systemd validator
The naming of systemd services don't follow the RFC in the comments. See `man systemd.unit` for the specification.
This commit is contained in:
parent
8dd85a3c1e
commit
b574a7cabc
1 changed files with 3 additions and 4 deletions
|
|
@ -143,11 +143,10 @@ export const isServiceValid = (service: string) => {
|
|||
return true;
|
||||
}
|
||||
|
||||
// Restraints taken from service name syntax reference
|
||||
// https://www.rfc-editor.org/rfc/rfc6335#section-5.1
|
||||
// see `man systemd.unit` for the exact specification
|
||||
return (
|
||||
service.length <= 15 &&
|
||||
/^[a-zA-Z0-9]([a-zA-Z0-9-.]*[a-zA-Z0-9])?$/.test(service) &&
|
||||
service.length <= 256 &&
|
||||
/^[a-zA-Z0-9]([a-zA-Z0-9.\-_:@]*[a-zA-Z0-9])?$/.test(service) &&
|
||||
!/--/.test(service) && // does not contain more hyphens in a row
|
||||
/[a-zA-Z]+/.test(service) // contains at least one letter
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue