From f818dbf03e022571688fc81b0c6cc72b25bea0a9 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Mon, 26 Jul 2021 21:00:13 +0200 Subject: [PATCH] . --- backend/Dockerfile | 2 +- frontend/src/components/home.component.ts | 2 +- frontend/src/components/main.component.ts | 2 +- frontend/src/server.ts | 4 ++++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index da46e92..ad7a742 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -15,5 +15,5 @@ COPY manage.py gunicorn.conf.py ./ COPY tabby tabby COPY start.sh /start.sh -RUN chmod +x /start.sh +RUN ["chmod", "+x", "/start.sh"] CMD ["/start.sh"] diff --git a/frontend/src/components/home.component.ts b/frontend/src/components/home.component.ts index 4ea0ebb..a1311fc 100644 --- a/frontend/src/components/home.component.ts +++ b/frontend/src/components/home.component.ts @@ -118,7 +118,7 @@ export class HomeComponent { const versions = await this.http.get('/api/1/versions').toPromise() versions.sort((a, b) => -semverCompare(a.version, b.version)) this.connector = new DemoConnector(this.iframe.nativeElement.contentWindow, this.commonService, versions[0]) - this.iframe.nativeElement.src = '/terminal.html' + this.iframe.nativeElement.src = '/terminal' } ngOnDestroy (): void { diff --git a/frontend/src/components/main.component.ts b/frontend/src/components/main.component.ts index 7987494..98d1340 100644 --- a/frontend/src/components/main.component.ts +++ b/frontend/src/components/main.component.ts @@ -80,7 +80,7 @@ export class MainComponent { async loadApp (config, version) { this.showApp = true - this.iframe.nativeElement.src = '/terminal.html' + this.iframe.nativeElement.src = '/terminal' await this.http.patch(`/api/1/configs/${config.id}`, { last_used_with_version: version.version, }).toPromise() diff --git a/frontend/src/server.ts b/frontend/src/server.ts index 82025c0..2ce1b2a 100644 --- a/frontend/src/server.ts +++ b/frontend/src/server.ts @@ -39,6 +39,10 @@ function start () { res.render('index', { req }) }) + app.get(['/terminal'], (req, res) => { + res.sendFile(join(DIST_FOLDER, 'terminal.html')) + }) + process.umask(0o002) app.listen(PORT, () => { console.log(`Node Express server listening on http://localhost:${PORT}`)