@@ -100,9 +100,14 @@ export class ActionService {
100100 data : CreateTemplateDto ,
101101 auth : AuthHeader ,
102102 ) : Promise < ActionTemplateDto > {
103- if ( ! data . dockerImage . startsWith ( 'rslethz/' ) ) {
103+ const dockerhub_namespace = process . env [ 'VITE_DOCKER_HUB_NAMESPACE' ] ;
104+ // assert that we only run images from a specified namespace
105+ if (
106+ dockerhub_namespace !== undefined &&
107+ ! data . dockerImage . startsWith ( dockerhub_namespace )
108+ ) {
104109 throw new ConflictException (
105- ' Only images from the rslethz namespace are allowed' ,
110+ ` Only images from the ${ dockerhub_namespace } namespace are allowed` ,
106111 ) ;
107112 }
108113 const exists = await this . actionTemplateRepository . exists ( {
@@ -140,11 +145,11 @@ export class ActionService {
140145 data : UpdateTemplateDto ,
141146 auth : AuthHeader ,
142147 ) : Promise < ActionTemplateDto > {
143- if ( ! data . dockerImage . startsWith ( 'rslethz/' ) ) {
144- throw new ConflictException (
145- 'Only images from the rslethz namespace are allowed' ,
146- ) ;
147- }
148+ // if (!data.dockerImage.startsWith('rslethz/')) {
149+ // throw new ConflictException(
150+ // 'Only images from the rslethz namespace are allowed',
151+ // );
152+ // }
148153 const template = await this . actionTemplateRepository . findOneOrFail ( {
149154 where : { uuid : data . uuid } ,
150155 } ) ;
0 commit comments