diff --git a/.env.test b/.env.test index 9ada07a09666ff9e7d52abec690c81295990c1d0..65bb8cad8571620c363c668c1e2d19c58136b937 100644 --- a/.env.test +++ b/.env.test @@ -1,3 +1,3 @@ REACT_APP_SERVER_ADDRESS=https://localhost/api -REACT_APP_API_BASE_ENDPOINT=/ccce-api +REACT_APP_API_BASE_ENDPOINT=/api/spec REACT_APP_TOKEN_RENEW_INTERVAL=180000 \ No newline at end of file diff --git a/.storybook/preview-head.html b/.storybook/preview-head.html index d78c6722c6f9c03290ae11906292563c9ea2189d..73cb7f6b9fcc68b5f89f30af0f5d23c011101684 100644 --- a/.storybook/preview-head.html +++ b/.storybook/preview-head.html @@ -1,6 +1,6 @@ <script> window.SERVER_ADDRESS='' - window.API_BASE_ENDPOINT='/ccce-api' + window.API_BASE_ENDPOINT='/api/spec' window.TOKEN_RENEW_INTERVAL=180000 window.CCDB_ADDRESS='https://ccdb.esss.lu.se' window.ENVIRONMENT_TITLE = '' diff --git a/Dockerfile b/Dockerfile index 63571eec6f01a92173b7e85d6e6c0250e9978027..bc65b333abd6aa06733230d717ef5451690526f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# build CCCE Frontend +# build CE deployment Frontend FROM node:16.14.0 as builder RUN mkdir /usr/src/app WORKDIR /usr/src/app diff --git a/README.md b/README.md index f47e2962a2b30b89cfbabe3f120d7c693ace547e..e9dbf4b03ebd948c5ce896ddc6f6529d97f5395e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# CCCE deployment tool web UI +# CE deployment tool web UI -This project is meant to be the web User Interface for the CCCE Deployment tool. The project is written in ReactJS. +This project is meant to be the web User Interface for the CE Deployment tool. The project is written in ReactJS. ## Developing environment * NodeJS and npm @@ -36,7 +36,8 @@ The following values can be set in the file: | Environment variable | Description | | -------------------------|-------------| | SERVER_ADDRESS | The backend server base URL _(host:port)_ (if backend server is running natively on the same host as the UI then the value has to be empty, and proxy has to be set!)| -| API_BASE_ENDPOINT | The context path of the application's REST API _(e.g. /ccce-api)_ | +| API_BASE_ENDPOINT | The context path of the application's REST API _(e.g. /api/spec)_ | +| SWAGGER_UI_URL | The URL for the backend Swagger-ui interface _(e.g./api/docs)_ | | TOKEN_RENEW_INTERVAL | Time interval to renew JWT auth token _(in milliseconds)_ | | CCDB_ADDRESS | CCDB service base URL (used for IOC name CCDB reference feature) | | ENVIRONMENT_TITLE | Adds a (sub)text to the HTLM title, and also for the appBar header. Supposed to show information to the user which environment they are using. The default value is empty. _Optional field!_ | diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 970728c4ada4ea4641f29458bd0d303f2fa2ec69..9142c316628df2d362f0d4ff284a8bf569764166 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -23,4 +23,4 @@ // // -- This will overwrite an existing command -- // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) -Cypress.Commands.add("login", () => {cy.setCookie("ccce-auth", "DEADBEEF")}); \ No newline at end of file +Cypress.Commands.add("login", () => {cy.setCookie("ce-deploy-auth", "DEADBEEF")}); \ No newline at end of file diff --git a/cypress/support/index.js b/cypress/support/index.js index 29c8062024bf07822dea225fbe439cf6cdd556b3..b89509f3913d83bea6f9b8c67eedb20c9b5b70d7 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -25,7 +25,7 @@ import { interceptAPI } from './interceptAPI' // but copying is bad // maybe we need to rethink how we do config window.SERVER_ADDRESS='' -window.API_BASE_ENDPOINT='/ccce-api' +window.API_BASE_ENDPOINT='/api/spec' window.TOKEN_RENEW_INTERVAL=180000 window.CCDB_ADDRESS='https://ccdb.esss.lu.se' window.ENVIRONMENT_TITLE = '' diff --git a/public/config.js b/public/config.js index 35fd3da172ec8109cb3af842634024d0094e756f..aea675ebf37627cb9c89b82c0bbcde15434f461f 100644 --- a/public/config.js +++ b/public/config.js @@ -1,9 +1,10 @@ SERVER_ADDRESS='' -API_BASE_ENDPOINT='/ccce-api' +API_BASE_ENDPOINT='/api/spec' +SWAGGER_UI_URL='/api/docs' TOKEN_RENEW_INTERVAL=180000 CCDB_ADDRESS='https://ccdb.esss.lu.se' ENVIRONMENT_TITLE = '' BACKEND_VERSION='1.0.0-rc9' BACKEND_REPOSITORY_TAGS='https://gitlab.esss.lu.se/ccce/dev/ce-deploy-backend/-/tags/' FRONTEND_VERSION='1.0.0-rc6' -FRONTEND_REPOSITORY_TAGS='https://gitlab.esss.lu.se/ccce/dev/ce-dploy-ui/-/tags/' +FRONTEND_REPOSITORY_TAGS='https://gitlab.esss.lu.se/ccce/dev/ce-deploy-ui/-/tags/' diff --git a/src/App.js b/src/App.js index 265bc29483acee3338bb0b8c0e3b8356dd140412..d8e38bbd053b85e14bc5541656f3c283717cc69b 100644 --- a/src/App.js +++ b/src/App.js @@ -31,7 +31,7 @@ import { AppErrorBoundary } from "./components/navigation/ErrorBoundary/ErrorBou //setting up the application (TAB)title function App() { useEffect(() => { - document.title = "CCCE" + applicationSubTitle(); + document.title = "CE deployment" + applicationSubTitle(); }, []); return ( diff --git a/src/__tests__/browse-host-test.js b/src/__tests__/browse-host-test.js index 6588d91672ca9e5f326edcfcfe316cd511cd3d71..428e5bfcf38bdb913510d6453d2ff621610ce38d 100644 --- a/src/__tests__/browse-host-test.js +++ b/src/__tests__/browse-host-test.js @@ -26,11 +26,11 @@ defineFeature(feature, (test) => { }); when('the user navigates to the hosts page', async () => { - await screen.findByText('CCCE / IOC hosts'); + await screen.findByText('CE deployment / IOC hosts'); }); then('they should be presented with a table of hosts from the iocs group in CSEntry', async () => { - expect(await screen.findByText('CCCE / IOC hosts')).toBeInTheDocument() + expect(await screen.findByText('CE deployment / IOC hosts')).toBeInTheDocument() expect(await screen.findByText('Status')).toBeInTheDocument() expect(await screen.findByText('Host')).toBeInTheDocument() expect(await screen.findByText('Network')).toBeInTheDocument() diff --git a/src/api/APIProvider.spec.js b/src/api/APIProvider.spec.js index 938e452ebed281e7dcbbfdacb2e753a08634015b..f9f84ccc4f9c570238b1aae89add096bd81dc623 100644 --- a/src/api/APIProvider.spec.js +++ b/src/api/APIProvider.spec.js @@ -16,7 +16,7 @@ function mountIntoHarness(children) { } function checkAPIDisplayed() { - cy.get('#api').contains('CCCE API'); + cy.get('#api').contains('CE API'); } function DisplayAPISpecification({api}) { diff --git a/src/components/auth/TokenRenew.spec.js b/src/components/auth/TokenRenew.spec.js index 85edde7af48284ccbec31842d78d2cf0670d29e2..806dcfcbe0f9026265e256ca0bf9a2c9d229d929 100644 --- a/src/components/auth/TokenRenew.spec.js +++ b/src/components/auth/TokenRenew.spec.js @@ -31,7 +31,7 @@ describe("TokenRenew", () => { mountIntoHarness(<TokenRenew />); cy.tick(window.TOKEN_RENEW_INTERVAL); cy.wait("@renew", {responseTimeout: 1000}) - cy.getCookie('ccce-auth').should('have.property', 'value', 'FADEDEAD'); + cy.getCookie('ce-deploy-auth').should('have.property', 'value', 'FADEDEAD'); }) }) }) \ No newline at end of file diff --git a/src/components/navigation/GlobalAppBar/GlobalAppBar.js b/src/components/navigation/GlobalAppBar/GlobalAppBar.js index 34636877790fa12b45891e59de580b55dbe3104f..5aa78c6f04e8cf3f268921b47cffdfabec9fbc6f 100644 --- a/src/components/navigation/GlobalAppBar/GlobalAppBar.js +++ b/src/components/navigation/GlobalAppBar/GlobalAppBar.js @@ -154,7 +154,7 @@ export function ButtonAppBar({ homeUrl, homeClick, title, button, profileButton, ); } -const defaultTitle = "CCCE" +const defaultTitle = "CE deployment" export const GlobalAppBarContext = createContext({ title: defaultTitle, setButton: () => { console.log("default GlobalAppBarContext.setButton does nothing.") }, @@ -457,7 +457,7 @@ export function useGlobalAppBar(initTitle, initButton) { const appBar = useContext(GlobalAppBarContext); useEffect(() => { appBar.setButton(button); - appBar.setTitle('CCCE ' + applicationSubTitle() + ' / ' + title ); + appBar.setTitle('CE deployment ' + applicationSubTitle() + ' / ' + title ); }, [appBar, title, button]); return { setButton, setTitle }; } \ No newline at end of file diff --git a/src/mocks/fixtures/ccce-api.json b/src/mocks/fixtures/ccce-api.json index 732689d46e489d4c2029a20f7d65b93a83eba775..c5fe2d47e0311fc9adc344b92d541328deb2d368 100644 --- a/src/mocks/fixtures/ccce-api.json +++ b/src/mocks/fixtures/ccce-api.json @@ -1,14 +1,14 @@ { "openapi": "3.0.1", "info": { - "title": "CCCE API", - "description": "CCCE backend", + "title": "CE API", + "description": "CE backend", "version": "0.0.5" }, "servers": [ { "url": "http://localhost:8080", - "description": "CCCE Deployment Backend" + "description": "CE Deployment Backend" } ], "tags": [ diff --git a/src/mocks/mockAPI.js b/src/mocks/mockAPI.js index 86b1cb62b2b6a17d784db922dd340a93bf05dd73..ed708bfbd751c26dd4f9e86f69ef3a644c194499 100644 --- a/src/mocks/mockAPI.js +++ b/src/mocks/mockAPI.js @@ -23,17 +23,17 @@ function login(req) { return { body: { token }, headers: { - "Set-Cookie": `ccce-auth=${token}` + "Set-Cookie": `ce-deploy-auth=${token}` } } } function isLoggedIn(req) { if (req.cookies) { - return Boolean(req.cookies["ccce-auth"]); + return Boolean(req.cookies["ce-deploy-auth"]); } else { - return (req.headers?.cookie ?? "").includes("ccce-auth="); + return (req.headers?.cookie ?? "").includes("ce-deploy-auth="); } } @@ -68,7 +68,7 @@ function renew(req) { return { body: { token }, headers: { - "Set-Cookie": `ccce-auth=${token}` + "Set-Cookie": `ce-deploy-auth=${token}` } } } @@ -202,7 +202,7 @@ const qRegExp = (pattern) => RegExp(pattern + queryPattern) // Handlers for our whole API export const apiHandlers = [ // api spec - makeHandler("GET", qRegExp(".*/ccce-api"), mockAPI.spec), + makeHandler("GET", qRegExp(".*/api/spec"), mockAPI.spec), // authentication makeHandler("POST", qRegExp(".*/authentication/login"), mockAPI.authentication.login), diff --git a/src/setupTests.js b/src/setupTests.js index de4eb696f1907f02809ef9086e15f260c0b02cdf..a1be421b5095768586149ead4ed1b5e5a37c9889 100644 --- a/src/setupTests.js +++ b/src/setupTests.js @@ -17,7 +17,7 @@ global.console = { beforeAll(() => { window.SERVER_ADDRESS = ''; - window.API_BASE_ENDPOINT = '/ccce-api'; + window.API_BASE_ENDPOINT = '/api/spec'; window.TOKEN_RENEW_INTERVAL=180000; // Enable the mocking in tests. server.listen({onUnhandledRequest: "warn"}) diff --git a/src/views/about/AboutView.js b/src/views/about/AboutView.js index ae25dc59ce56e481e890e011ddc132281f507323..4c549fa6187c898d9be7f5bdff6655f7a5711e2f 100644 --- a/src/views/about/AboutView.js +++ b/src/views/about/AboutView.js @@ -25,7 +25,7 @@ export function AboutView() { <Paper className={classes.paper}> <Typography variant="body1"> - This is the <Link href="https://confluence.esss.lu.se/x/CVGQFg" target="_blank" rel="noreferrer">beta</Link> version of the deployment part of the CCDB ecosystem (working name CCCE). It is a tool that manages IOCs on host machines, using Ansible to perform the necessary configuration management. This tool will set up IOC-hosts and deploy IOC(s) in a consistent manner, and will configure all necessary services towards this purpose. The tool also integrates with various other systems to enable monitoring of IOCs and hosts, and enables some limited remote execution features. Please note that this is a developmental version, and that + This is the <Link href="https://confluence.esss.lu.se/x/CVGQFg" target="_blank" rel="noreferrer">final</Link> version of the deployment part of the CCDB ecosystem (working name CE deployment). It is a tool that manages IOCs on host machines, using Ansible to perform the necessary configuration management. This tool will set up IOC-hosts and deploy IOC(s) in a consistent manner, and will configure all necessary services towards this purpose. The tool also integrates with various other systems to enable monitoring of IOCs and hosts, and enables some limited remote execution features. Please note that this is a developmental version, and that <ol> <li>we do not guarantee data (about deployments) to persist</li> <li>we offer only minimal support</li> @@ -39,7 +39,7 @@ export function AboutView() { <p>Users without access can only access a subset of the features of the application.</p> <p>If you wish to visualise or interact directly with the REST API, you can use the <Link - href={`${window.SERVER_ADDRESS}${window.API_BASE_ENDPOINT}.html`} target="_blank" rel="noreferrer">Swagger UI</Link>.</p> + href={`${window.SERVER_ADDRESS}${window.SWAGGER_UI_URL}`} target="_blank" rel="noreferrer">Swagger UI</Link>.</p> <hr /> diff --git a/src/views/help/HelpView.js b/src/views/help/HelpView.js index a65d130bf071ec74545d51f23525198e9f0dda1c..18341dc20c31792b735ccb9801a3142d82375ec9 100644 --- a/src/views/help/HelpView.js +++ b/src/views/help/HelpView.js @@ -31,7 +31,7 @@ export function HelpView() { <li>have your IOC in a ESS Gitlab repository in the <Link href="https://gitlab.esss.lu.se/iocs" target="_blank" rel="noreferrer">IOCs</Link> group (you can use <Link href="https://gitlab.esss.lu.se/ics-cookiecutter/cookiecutter-e3-ioc" target="_blank" rel="noreferrer">cookiecutter</Link> to create the repository, or you can create it by hand - you can find an example IOC repository <Link href="https://gitlab.esss.lu.se/ccce/dev/e3-ioc-ccce-example" target="_blank" rel="noreferrer">here</Link>)</li> <li>have an IOC host registered in <Link href="https://csentry.esss.lu.se/" target="_blank" rel="noreferrer">CSEntry</Link> (physical or virtual).</li> </ul> - Deployments shall be done on blank (formatted) machines set up with CSEntry - some configuration is done during OS installation. Deployments made on old hosts, or hosts which make use mixed deployment methods (e.g. with both manually and CCCE-deployed IOCs) are not supported by the CCCE team. + Deployments shall be done on blank (formatted) machines set up with CSEntry - some configuration is done during OS installation. Deployments made on old hosts, or hosts which make use mixed deployment methods (e.g. with both manually and CE-deployed IOCs) are not supported by the CE team. Note that we currently only support deployments on CentOS 7.</p>