diff --git a/docs/user-guide/mkdocs.yml b/docs/user-guide/mkdocs.yml index 530084f..b36c841 100644 --- a/docs/user-guide/mkdocs.yml +++ b/docs/user-guide/mkdocs.yml @@ -1,8 +1,7 @@ site_name: User Guide -theme: readthedocs docs_dir: . -site_dir: ../../ipynbsrv/wui/static/docs/user-guide +site_dir: ../../ipynbsrv/web/static/docs/user-guide pages: -- [index.md, Home] +- 'Home' : 'index.md' diff --git a/ipynbsrv/core/models.py b/ipynbsrv/core/models.py index 7d48146..bd959b3 100644 --- a/ipynbsrv/core/models.py +++ b/ipynbsrv/core/models.py @@ -772,7 +772,15 @@ class ContainerImage(models.Model): max_length=255, help_text='The primary key the backend uses to identify this image.' ) - name = models.CharField(max_length=75) + name = models.CharField( + max_length=75, + validators=[ + RegexValidator( + regex='^[A-z][\w\/]*$', + message='Invalid container snapshot name.' + ) + ] + ) description = models.TextField(blank=True, null=True) # TODO: document placeholders command = models.CharField( diff --git a/ipynbsrv/web/templates/web/container_snapshots/modal_create.html b/ipynbsrv/web/templates/web/container_snapshots/modal_create.html index d4ada7c..b87aa5e 100644 --- a/ipynbsrv/web/templates/web/container_snapshots/modal_create.html +++ b/ipynbsrv/web/templates/web/container_snapshots/modal_create.html @@ -14,6 +14,7 @@
+

Allowed pattern: ^[A-z]\w*$

diff --git a/ipynbsrv/web/templates/web/images/modal_create.html b/ipynbsrv/web/templates/web/images/modal_create.html index 57417a8..865e5d3 100644 --- a/ipynbsrv/web/templates/web/images/modal_create.html +++ b/ipynbsrv/web/templates/web/images/modal_create.html @@ -22,6 +22,7 @@
+

Allowed pattern: ^[A-z][\w\/]*$

diff --git a/ipynbsrv/web/templates/web/shares/modal_create.html b/ipynbsrv/web/templates/web/shares/modal_create.html index f00134f..c4bb05b 100644 --- a/ipynbsrv/web/templates/web/shares/modal_create.html +++ b/ipynbsrv/web/templates/web/shares/modal_create.html @@ -12,7 +12,8 @@