diff --git a/.eslintrc.yml b/.eslintrc.yml index 19107ad34..c08a6e8f7 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -1,6 +1,9 @@ --- root: true +globals: + $Shape: false plugins: + - flowtype - react - notice extends: @@ -138,3 +141,4 @@ rules: notice/notice: - error - mustMatch: "(// Copyright \\d{4} [a-zA-Z0-9,\\.\\s]+\\n)+//\\n// Licensed under the Apache License, Version 2\\.0 \\(the \"License\"\\);\\n// you may not use this file except in compliance with the License\\.\\n// You may obtain a copy of the License at\\n//\\n//\\s+http://www\\.apache\\.org/licenses/LICENSE-2\\.0\\n//\\n// Unless required by applicable law or agreed to in writing, software\\n// distributed under the License is distributed on an \"AS IS\" BASIS,\\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n// See the License for the specific language governing permissions and\\n// limitations under the License\\.\\n" + diff --git a/.flowconfig b/.flowconfig new file mode 100644 index 000000000..e266f9e33 --- /dev/null +++ b/.flowconfig @@ -0,0 +1,13 @@ +[ignore] +.*/module-deps/test/invalid_pkg/package.json + +[include] + +[libs] + +[lints] + +[options] +esproposal.decorators=ignore + +[strict] diff --git a/.gitignore b/.gitignore index d9452c7e5..0c065f60e 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,7 @@ debian/files # VIM Swap .*.swp + + +# local stuff +config.local.js diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..df972a48b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM node:10.15.3 + +# Create app directory +WORKDIR /opt/stackstorm/static/webui/st2web + +# get files +COPY . /opt/stackstorm/static/webui/st2web +RUN rm /opt/stackstorm/static/webui/st2web/yarn.lock + +# install dependencies +RUN make build-and-install + +# expose your ports +EXPOSE 3000 + +# start it up +CMD [ "npm", "run", "serve" ] diff --git a/Dockerfile-dev b/Dockerfile-dev new file mode 100644 index 000000000..a8b9c91c4 --- /dev/null +++ b/Dockerfile-dev @@ -0,0 +1,17 @@ +FROM node:10.15.3 + +# Create app directory +WORKDIR /opt/stackstorm/static/webui/st2web + +# get files +COPY . /opt/stackstorm/static/webui/st2web +RUN rm /opt/stackstorm/static/webui/st2web/yarn.lock + +# install dependencies +RUN make build-dev + +# expose your ports +EXPOSE 3000 + +# start it up +CMD [ "npm", "run", "serve-dev" ] diff --git a/Dockerfile-nginx b/Dockerfile-nginx new file mode 100644 index 000000000..da404e166 --- /dev/null +++ b/Dockerfile-nginx @@ -0,0 +1,26 @@ +FROM node:10.15.3 as build + +# Create app directory +WORKDIR /opt/stackstorm/static/webui/st2web + +# get files +COPY . /opt/stackstorm/static/webui/st2web +RUN rm /opt/stackstorm/static/webui/st2web/yarn.lock + +# install dependencies +RUN make build-and-install + +# expose your ports +EXPOSE 3000 + + +FROM nginx +RUN rm -f /etc/nginx/conf.d/default.conf +# COPY ./nginx.local.conf /etc/nginx/conf.d/default.conf +COPY ./nginx.local.conf /etc/nginx/conf.d/st2.conf +COPY --from=build /opt/stackstorm/static/webui /opt/stackstorm/static/webui +# Generate self-signed certificate or place your existing certificate under /etc/ssl/st2 +RUN mkdir -p /etc/ssl/st2 +RUN openssl req -x509 -newkey rsa:2048 -keyout /etc/ssl/st2/st2.key -out /etc/ssl/st2/st2.crt \ + -days 365 -nodes -subj "/C=US/ST=California/L=Palo Alto/O=StackStorm/OU=Information \ + Technology/CN=$(hostname)" \ No newline at end of file diff --git a/Dockerfile-nginx-dev b/Dockerfile-nginx-dev new file mode 100644 index 000000000..a1758c255 --- /dev/null +++ b/Dockerfile-nginx-dev @@ -0,0 +1,20 @@ +FROM node:10.15.3 as build + +# Create app directory +WORKDIR /opt/stackstorm/static/webui/st2web + +# get files +COPY . /opt/stackstorm/static/webui/st2web +RUN rm /opt/stackstorm/static/webui/st2web/yarn.lock + +# install dependencies +RUN make build-dev + +# expose your ports +EXPOSE 3000 + + +FROM nginx +RUN rm -f /etc/nginx/conf.d/default.conf +COPY ./nginx.local-dev.conf /etc/nginx/conf.d/st2.conf +COPY --from=build /opt/stackstorm/static/webui /opt/stackstorm/static/webui \ No newline at end of file diff --git a/Makefile b/Makefile index d4cfb36c9..34648b57a 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,29 @@ DEB_DISTRO := $(shell (echo $(PKG_VERSION) | grep -q dev) && echo unstable || ec .PHONY: all build clean install deb rpm all: build +npm-install: + echo "npm install" + npm install -g lerna yarn + +lerna: + echo "lerna" + lerna bootstrap + rm -rf apps/st2-workflows/node_modules + +build-dev: + echo "build-dev" + make npm-install + make lerna + +build-and-install: + make build + make install + build: + echo "build-and-install" + make npm-install + make lerna + echo "run gulp production directly" npm run build clean: @@ -17,7 +39,10 @@ clean: mkdir -p build/ install: + echo "make install" + echo "mkdir -p $(DESTDIR)$(PREFIX)" mkdir -p $(DESTDIR)$(PREFIX) + echo "cp -R $(CURDIR)/build/* $(DESTDIR)$(PREFIX)" cp -R $(CURDIR)/build/* $(DESTDIR)$(PREFIX) deb: diff --git a/README.md b/README.md index 3c6597e26..6e7b3f189 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,31 @@ $ gulp At that point you should be able to point your browser to http://localhost:3000/ and see the the page. +Quick start (docker-compose) +----------- + +> **Note:** docker-compose uses `config.local.js` which is gitignored and should be a copy of `config.js` with your specific values + +Production: +``` +docker-compose up +``` + +Dev: +``` +docker-compose -f docker-compose.dev.yml up --build +``` + +Production with NGINX: +``` +docker-compose -f docker-compose.nginx.yml up --build +``` + +Dev with NGINX: +``` +docker-compose -f docker-compose.nginx-dev.yml up --build +``` + Build system ------------ diff --git a/apps/st2-actions/actions-details.component.js b/apps/st2-actions/actions-details.component.js index 4a774ea21..b0d189d89 100644 --- a/apps/st2-actions/actions-details.component.js +++ b/apps/st2-actions/actions-details.component.js @@ -1,3 +1,4 @@ +// Copyright 2021 The StackStorm Authors. // Copyright 2019 Extreme Networks, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,7 +32,6 @@ import { FlexTableColumn, FlexTableInsert, } from '@stackstorm/module-flex-table'; -import FlowLink from '@stackstorm/module-flow-link'; import Button from '@stackstorm/module-forms/button.component'; import Highlight from '@stackstorm/module-highlight'; import Label from '@stackstorm/module-label'; @@ -213,7 +213,9 @@ export default class ActionsDetails extends React.Component { }, }); } - +setWindowName(e){ + window.name="parent" +} handleRun(e, ...args) { e.preventDefault(); @@ -253,7 +255,14 @@ export default class ActionsDetails extends React.Component {