Skip to content

Commit

Permalink
fix: aas-server renamed to aas-node
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfaron committed Dec 25, 2024
1 parent e962ac9 commit be90233
Show file tree
Hide file tree
Showing 264 changed files with 428 additions and 428 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ NEXTCLOUD_ADMIN_PASSWORD=5w0vmrkzrwDIDyZs
NEXTCLOUD_TRUSTED_DOMAINS=localhost

NODE_ENV=production
NODE_SERVER_PORT=1337
AAS_NODE_PORT=1337
AAS_INDEX=mysql://aas-server:60PYRe6Vd8C99u4n@aasportal-index:3306
USER_STORAGE=mongodb://aas-server:bObXJWW6e8Nh78YF@aasportal-users:27017/aasportal-users
TEMPLATE_STORAGE=http://aas-server:5w0vmrkzrwDIDyZs@aasportal-cloud:8080/templates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ jobs:
push: true
tags: fraunhoferiosb/aasportal_aasportal:${{env.IMAGE_TAG}}

- name: Build and push AASServer (backend) image
- name: Build and push AASNode (backend) image
uses: docker/build-push-action@v5
with:
file: ./Dockerfile.aas-server
file: ./Dockerfile.aas-node
context: .
push: true
tags: fraunhoferiosb/aasportal_aasserver:${{env.IMAGE_TAG}}
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ jobs:
name: code-coverage-report
path: |
reports/aas-portal.xml
reports/aas-server.xml
reports/aas-node.xml
reports/common.xml
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ temp
*-audit.json
swagger.json
swagger.yaml
/projects/aas-server/src/app/routes
/projects/ass-server/src/assets/app-info.json
/projects/aas-node/src/app/routes
/projects/ass-node/src/assets/app-info.json

# System files
.DS_Store
Expand Down
8 changes: 4 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ test:
artifacts:
paths:
- reports/aas-portal.xml
- reports/aas-server.xml
- reports/aas-node.xml
- reports/aas-core.xml
reports:
junit: [reports/aas-portal.xml, reports/aas-server.xml, reports/aas-core.xml]
junit: [reports/aas-portal.xml, reports/aas-node.xml, reports/aas-core.xml]
coverage_report:
coverage_format: cobertura
path: reports/**/cobertura-coverage.xml

deploy_aas-server-app:
deploy_aas-node-app:
stage: deploy
only:
refs:
Expand All @@ -66,7 +66,7 @@ deploy_aas-server-app:
- >-
/kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile.aas-server"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile.aas-node"
--destination "${CI_REGISTRY_IMAGE}:node.${CI_COMMIT_BRANCH}"
deploy_aas-web-app:
Expand Down
32 changes: 16 additions & 16 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,46 @@
"webRoot": "${workspaceFolder}"
},
{
"name": "Start aas-server",
"name": "Start aas-node",
"type": "node",
"args": ["--security-revert=CVE-2023-46809"],
"request": "launch",
"preLaunchTask": "build-aas-server",
"program": "${workspaceFolder}/projects/aas-server/build/aas-server.js",
"preLaunchTask": "build-aas-node",
"program": "${workspaceFolder}/projects/aas-node/build/aas-node.js",
"cwd": "${workspaceFolder}",
"outFiles": [
"${workspaceFolder}/projects/aas-server/build/**/*.js"
"${workspaceFolder}/projects/aas-node/build/**/*.js"
],
"skipFiles": [
"<node_internals>/**"
],
"env": {
"NODE_ENV": "development",
"NODE_SERVER_PORT": "1337",
"CONTENT_ROOT": "projects/aas-server/build",
"AAS_NODE_PORT": "1337",
"CONTENT_ROOT": "projects/aas-node/build",
"WEB_ROOT": "projects/aas-portal/dist",
"ASSETS": "projects/aas-server/src/assets",
"ASSETS": "projects/aas-node/src/assets",
"ENDPOINTS": "[\"file:///endpoints/samples?name=Samples\"]",
// "USER_STORAGE": "mongodb://aas-server:bObXJWW6e8Nh78YF@localhost:27017/aasportal-users",
"TEMPLATE_STORAGE": "http://aas-server:5w0vmrkzrwDIDyZs@localhost:8080/templates",
"AAS_INDEX": "mysql://aas-server:60PYRe6Vd8C99u4n@localhost:3306",
}
},
{
"name": "Run aas-server",
"name": "Run aas-node",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/projects/aas-server/dist/aas-server.js",
"program": "${workspaceFolder}/projects/aas-node/dist/aas-node.js",
"cwd": "${workspaceFolder}",
"skipFiles": [
"<node_internals>/**"
],
"env": {
"NODE_ENV": "development",
"NODE_SERVER_PORT": "1337",
"CONTENT_ROOT": "projects/aas-server/dist",
"AAS_NODE_PORT": "1337",
"CONTENT_ROOT": "projects/aas-node/dist",
"WEB_ROOT": "projects/aas-portal/dist",
"ASSETS": "projects/aas-server/src/assets",
"ASSETS": "projects/aas-node/src/assets",
"ENDPOINTS": "[\"file:///endpoints/samples?name=Samples\"]"
}
},
Expand All @@ -68,7 +68,7 @@
"url": "http://localhost:9876/debug.html",
},
{
"name": "Test aas-server",
"name": "Test aas-node",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
Expand All @@ -77,11 +77,11 @@
"run-script",
"test",
"-w",
"aas-server"
"aas-node"
],
},
{
"name": "Debug aas-server test",
"name": "Debug aas-node test",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
Expand All @@ -90,7 +90,7 @@
"run-script",
"test",
"-w",
"aas-server",
"aas-node",
"--testPathPattern",
"${fileBasename}"
],
Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
"jestCommandLine": "node --experimental-vm-modules --no-warnings ../../node_modules/jest/bin/jest.js",
},
{
"name": "aas-server",
"rootPath": "./projects/aas-server",
"name": "aas-node",
"rootPath": "./projects/aas-node",
"runMode": "on-demand",
"jestCommandLine": "node --experimental-vm-modules --no-warnings ../../node_modules/jest/bin/jest.js"
}
Expand Down
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
}
},
{
"label": "build-aas-server",
"label": "build-aas-node",
"type": "typescript",
"tsconfig": "projects/aas-server/tsconfig.app.json",
"tsconfig": "projects/aas-node/tsconfig.app.json",
"problemMatcher": [
"$tsc"
],
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ RUN npm run build
FROM node:20.11.1-alpine AS aasportal
RUN apk upgrade --update-cache --available && apk add openssl && rm -rf /var/cache/apk/*
WORKDIR /usr/src/app
COPY --from=build /usr/src/app/projects/aas-server/package.json package.json
COPY --from=build /usr/src/app/projects/aas-node/package.json package.json
RUN npm install --omit=dev
COPY --from=build /usr/src/app/projects/aas-server/src/assets assets/
COPY --from=build /usr/src/app/projects/aas-server/dist/ .
COPY --from=build /usr/src/app/projects/aas-node/src/assets assets/
COPY --from=build /usr/src/app/projects/aas-node/dist/ .
COPY --from=build /usr/src/app/projects/aas-core/dist/ node_modules/aas-core/dist/
COPY --from=build /usr/src/app/projects/aas-core/package.json node_modules/aas-core/package.json
COPY --from=build /usr/src/app/projects/aas-portal/dist/browser/ wwwroot/
ENV NODE_LOG=./log/debug.log
ENV NODE_SERVER_PORT=80
ENV AAS_NODE_PORT=80
ENV ENDPOINTS=["\"file:///endpoints/samples?name=Samples\""]
ENV NODE_ENV=production

EXPOSE 80
CMD ["node", "aas-server.js" ]
CMD ["node", "aas-node.js" ]
14 changes: 7 additions & 7 deletions Dockerfile.aas-server → Dockerfile.aas-node
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ WORKDIR /usr/src/app
COPY . .
RUN npm install
RUN node --no-warnings --loader ts-node/esm create-app-info.ts
RUN npm run aas-server:build
RUN npm run aas-node:build

FROM node:20.11.1-alpine AS aas-server
FROM node:20.11.1-alpine AS aas-node
RUN apk upgrade --update-cache --available && apk add openssl && rm -rf /var/cache/apk/*
WORKDIR /usr/src/app
COPY --from=build /usr/src/app/projects/aas-server/package.json package.json
COPY --from=build /usr/src/app/projects/aas-node/package.json package.json
RUN npm install --omit=dev
COPY --from=build /usr/src/app/projects/aas-server/src/assets assets/
COPY --from=build /usr/src/app/projects/aas-server/dist/ .
COPY --from=build /usr/src/app/projects/aas-node/src/assets assets/
COPY --from=build /usr/src/app/projects/aas-node/dist/ .
COPY --from=build /usr/src/app/projects/aas-core/dist/ node_modules/aas-core/dist/
COPY --from=build /usr/src/app/projects/aas-core/package.json node_modules/aas-core/package.json
ENV NODE_LOG=./log/debug.log
ENV NODE_SERVER_PORT=1337
ENV AAS_NODE_PORT=1337
ENV ENDPOINTS=["\"file:///endpoints/samples?name=Samples\""]
ENV NODE_ENV=production

EXPOSE 1337
CMD ["node", "aas-server.js" ]
CMD ["node", "aas-node.js" ]

6 changes: 3 additions & 3 deletions aasportal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2484,11 +2484,11 @@
<value name="bounds">252,259,242,63</value>
</value-owner>
<value-owner id="lqY8aVKmw0y8fbPhvmf2FA">
<value name="name">get AASServer messages</value>
<value name="name">get AASNode messages</value>
<value name="order">1</value>
</value-owner>
<value-owner id="gHsFnW2hWE+x0RHgidRcFw">
<value name="rendering">{&quot;bounds&quot;: &quot;371,156,172,63&quot;,&quot;model&quot;: &quot;lqY8aVKmw0y8fbPhvmf2FA&quot;,&quot;name&quot;: &quot;get AASServer messages&quot;,&quot;render&quot;: [{&quot;bounds&quot;: &quot;386,206,143,13&quot;,&quot;fontStyle&quot;: &quot;2&quot;,&quot;text&quot;: &quot;get AASServer messages&quot;,&quot;type&quot;: &quot;Text&quot;},{&quot;bounds&quot;: &quot;407,156,99,46&quot;,&quot;path&quot;: &quot;shapes/usecase.png&quot;,&quot;preserveRatio&quot;: &quot;true&quot;,&quot;type&quot;: &quot;Image&quot;}],&quot;type&quot;: &quot;UMLUseCaseView&quot;}</value>
<value name="rendering">{&quot;bounds&quot;: &quot;371,156,172,63&quot;,&quot;model&quot;: &quot;lqY8aVKmw0y8fbPhvmf2FA&quot;,&quot;name&quot;: &quot;get AASNode messages&quot;,&quot;render&quot;: [{&quot;bounds&quot;: &quot;386,206,143,13&quot;,&quot;fontStyle&quot;: &quot;2&quot;,&quot;text&quot;: &quot;get AASNode messages&quot;,&quot;type&quot;: &quot;Text&quot;},{&quot;bounds&quot;: &quot;407,156,99,46&quot;,&quot;path&quot;: &quot;shapes/usecase.png&quot;,&quot;preserveRatio&quot;: &quot;true&quot;,&quot;type&quot;: &quot;Image&quot;}],&quot;type&quot;: &quot;UMLUseCaseView&quot;}</value>
<value name="bounds">371,156,172,63</value>
</value-owner>
<value-owner id="TEIhKc3InkSnmIlzpo5sOA">
Expand Down Expand Up @@ -2901,7 +2901,7 @@
<value name="bounds">371,206,166,80</value>
</value-owner>
<value-owner id="xhl6qZPr8kuzihQSWvmyGg">
<value name="name">aas-server</value>
<value name="name">aas-node</value>
<value name="stereotype">node.js</value>
<value name="order">6</value>
</value-owner>
Expand Down
2 changes: 1 addition & 1 deletion copyright-header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const htmlHeader = [

checkFilesAsync([
'./projects/aas-portal/src',
'./projects/aas-server/src',
'./projects/aas-node/src',
'./projects/aas-lib/src',
'./projects/aas-core/src',
]);
Expand Down
2 changes: 1 addition & 1 deletion coverage-summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ main();

function main() {
const aasCoreSummary = read('./reports/aas-core/coverage-summary.json');
const aasServerSummary = read('./reports/aas-server/coverage-summary.json');
const aasServerSummary = read('./reports/aas-node/coverage-summary.json');
const aasLibSummary = read('./reports/aas-lib/coverage-summary.json');
const aasPortalSummary = read('./reports/aas-portal/coverage-summary.json');

Expand Down
4 changes: 2 additions & 2 deletions create-app-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const replacements = new Map<string, string>([
['@ngx-translate/http-loader', 'oss/@ngx-translate/http-loader/LICENSE.txt'],
]);

const exclude = new Set(['aas-core', 'aas-lib', 'aas-portal', 'aas-server', 'fhg-jest']);
const exclude = new Set(['aas-core', 'aas-lib', 'aas-portal', 'aas-node', 'fhg-jest']);

await main();

Expand All @@ -85,7 +85,7 @@ async function main(): Promise<void> {
libraries: await readLibrariesAsync(project),
};

const file = join(__dirname, 'projects/aas-server/src/assets/app-info.json');
const file = join(__dirname, 'projects/aas-node/src/assets/app-info.json');
try {
await writeFile(file, JSON.stringify(appInfo, undefined, 2));
console.info(`File ${file} read.`);
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ services:
- NEXTCLOUD_ADMIN_PASSWORD=${NEXTCLOUD_ADMIN_PASSWORD}
- NEXTCLOUD_TRUSTED_DOMAINS=${NEXTCLOUD_TRUSTED_DOMAINS}

aas-server:
container_name: aas-server
aas-node:
container_name: aas-node
build:
context: .
dockerfile: ./Dockerfile.aas-server
dockerfile: ./Dockerfile.aas-node
environment:
- USER_STORAGE=${USER_STORAGE}
- AAS_INDEX=${AAS_INDEX}
Expand Down
6 changes: 3 additions & 3 deletions docs/source/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ AASPortal is an Angular based WEB application. The UI is implemented with the Bo

![aas-portal-dependencies](./images/aas-portal-dependencies.png "AASPortal main dependencies")

## AASServer
AASServer is a Node.js WEB application. The REST API provided by AASServer is realized with the WEB framework *Express*. For authentication the concept JSON Web Tokens is used. The implementation uses the module *jsonwebtoken*. The AASServer provides an OpenAPI-compliant REST API. To create the living documentation of the REST API the module *swagger-ui-express* is used.
## AASNode
AASNode is a Node.js WEB application. The REST API provided by AASNode is realized with the WEB framework *Express*. For authentication the concept JSON Web Tokens is used. The implementation uses the module *jsonwebtoken*. The AASNode provides an OpenAPI-compliant REST API. To create the living documentation of the REST API the module *swagger-ui-express* is used.

For the access to Asset Administration Shells in an OPC UA server the *node-opcua* framework is used.

![aas-server-dependencies](./images/aas-server-dependencies.png "AASServer main dependencies")
![aas-node-dependencies](./images/aas-node-dependencies.png "AASNode main dependencies")
26 changes: 13 additions & 13 deletions docs/source/gettingstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@

*AASPortal* is a mono-repository project. It is implemented using the *npm workspaces* concept. The project consists of four workspaces:
- aas-portal: The browser app of *AASPortal*.
- aas-server: The Node.js server app of *AASPortal*.
- aas-node: The Node.js app of *AASPortal*.
- aas-lib: UI components and services in an Angular library.
- common: Types and functions used by aas-portal and aas-server.
- common: Types and functions used by aas-portal and aas-node.

```txt
aasportal
├── projects
│ ├── aas-portal
│ │ └── package.json
│ ├── aas-server
│ ├── aas-core
│ │ └── package.json
│ ├── aas-lib
│ │ └── package.json
│ └── common
│ ├── aas-node
│ │ └── package.json
│ └── aas-portal
│ └── package.json
└── package.json
Expand Down Expand Up @@ -69,16 +69,16 @@ or the name (idShort) of the AAS

http://localhost/?id=Bosch_NexoPistolGripNutrunner

## AASServer
AASServer is a Node.js server application based on the Express framework. The main feature of AASServer is the provision of Asset Administration Shells from different data sources (AASX server, OPC UA server, file system). AASServer can read Asset Administration Shells in JSON, XML and OPC UA format. An Asset Administration Shell is always provided to a web client (AASPortal) in JSON version 3 format.
## AASNode
AASNode is a Node.js server application based on the Express framework. The main feature of AASNode is the provision of Asset Administration Shells from different data sources (AASX server, OPC UA server, file system). AASNode can read Asset Administration Shells in JSON, XML and OPC UA format. An Asset Administration Shell is always provided to a web client (AASPortal) in JSON version 3 format.

AASServer provides a user management. Authentication of a user is based on Json Web Token.
AASNode provides a user management. Authentication of a user is based on Json Web Token.

## Environment Variables
| Name | | default |
| ---------------- | --------------------------------------------------------------------- | ---------------------------------------------- |
| ASSETS | AASServer root directory local endpoints and templates. | './assets' |
| CONTENT_ROOT | The root directory where AASServer is located. | './' |
| ASSETS | AASNode root directory local endpoints and templates. | './assets' |
| CONTENT_ROOT | The root directory where AASNode is located. | './' |
| CORS_ORIGIN | | '*' |
| ENDPOINTS | The URLs of the initial AAS container endpoints. | ['file:///samples'] |
| HTTPS_CERT_FILE | Certification file to enable HTTPS. | |
Expand All @@ -87,7 +87,7 @@ AASServer provides a user management. Authentication of a user is based on Json
| JWT_PUBLIC_KEY | Public key file for RS256 encryption. | |
| JWT_SECRET | Secret for HS256 encryption or private key file for RS256 encryption. | 'The quick brown fox jumps over the lazy dog.' |
| MAX_WORKERS | Number of background worker that scan AAS containers. | 8 |
| NODE_SERVER_PORT | The port number where AASServer is listening. | 80 |
| AAS_NODE_PORT | The port number where AASNode is listening. | 80 |
| USER_STORAGE | URL of the user database. | './users' |
| TEMPLATE_STORAGE | URL of the template storage | |
| TIMEOUT | Timeout until a new scan starts (ms). | 5000 |
Expand Down Expand Up @@ -119,7 +119,7 @@ templates
```

## OpenAPI (Swagger)
The AASServer provides an OpenAPI-compliant REST API. The Swagger UI is accessible via the URL:
The AASNode provides an OpenAPI-compliant REST API. The Swagger UI is accessible via the URL:

`http://localhost/api-docs`

Expand Down
Loading

0 comments on commit be90233

Please sign in to comment.