Skip to content

Commit

Permalink
Merge pull request #106 from SUNET/lint.prettify
Browse files Browse the repository at this point in the history
Lint.prettify
  • Loading branch information
indy-independence committed May 8, 2024
2 parents e0f8f59 + 88d8de0 commit 22f90dd
Show file tree
Hide file tree
Showing 61 changed files with 4,044 additions and 2,948 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# prettify
2d0b68a89b7572b62161fd342c3ce0ecc1c50bb4
24 changes: 13 additions & 11 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: "18.x"
- run: npm ci
- run: npm run build
- run: npm test
3 changes: 1 addition & 2 deletions .jenkins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ slack:
extra_jobs:
- name: cnaas-front
git:
branch: develop
branch: develop
builders:
- docker
docker_name: cnaas/front
docker_context_dir: docker/front
docker_tags:
- "latest"

12 changes: 6 additions & 6 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ Copyright 2019 SUNET. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
1. Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.
2. Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.

THIS SOFTWARE IS PROVIDED BY SUNET ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
Expand All @@ -22,4 +22,4 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those of the
authors and should not be interpreted as representing official policies, either expressed
or implied, of SUNET.
or implied, of SUNET.
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
5. run: `npm start` to bundle the js files
6. navigate to `http://localhost:1234` in browser


## full interactive dev setup with docker-compose

This guide will show you how to set up cnaas-nms on your local machine for development.
Expand All @@ -18,15 +17,13 @@ The components will run in Docker-containers.
The cnaas-nms frontend will also run inside a Docker container and update interactively with
every code change.


### clone the repositories

Clone the source code for frontend and API. Both should be in the same parent directory.

git clone https://github.com/SUNET/cnaas-front.git cnaas-front
git clone https://github.com/SUNET/cnaas-nms.git cnaas-nms


### setup and run docker-compose

Navigate to `cnaas-front/`.
Expand All @@ -41,7 +38,6 @@ This file is used to run docker-compose and build all containers. This takes for

As soon as the built is finished, docker-compose will start the containers.


### set up the auth container

A script will set up the auth container for you.
Expand All @@ -52,7 +48,6 @@ It will also create a user named "cnaas" with password "cnaascnaascnaas".
docker exec -t cnaas-front_auth_1 /bin/chmod u+x /opt/auth-server-poc/setup_auth.sh
docker exec -t cnaas-front_auth_1 /opt/auth-server-poc/setup_auth.sh


### copy the key for JWT authentication

The public key file is used to verify JWTokens between the auth server and the API.
Expand All @@ -71,20 +66,17 @@ Alternatively, you can restart the whole API container.

docker-compose restart api


### add some devices to the database

docker exec -i cnaas-front_postgres_1 /usr/bin/psql -U cnaas cnaas < docker/front-dev/cnaas.pgdump

Some errors and warnings will appear. You can ignore those.


### check it's all working

On the host system (that's your computer), you can now run the following commands to ensure that
everything is working: auth, API and frontend.


#### auth

curl -ks https://localhost:2443/api/v1.0/auth -X POST -u cnaas -p
Expand All @@ -102,7 +94,6 @@ exceedingly.ridiculouslyrandomlylookinglongstring without the JSON wrapper) as `

echo 'JWT_AUTH_TOKEN="exceedingly.ridiculouslyrandomlylookinglongstring"' > .env


#### API

Next, load the token into the `JWT_AUTH_TOKEN` environment variable with `source` and define an
Expand All @@ -117,7 +108,6 @@ alias command that allows you to authenticate with the cnaas-nms REST API using

This should return a list of two test devices.


#### frontend

Point your browser to http://127.0.0.1:8083.
Expand Down
13 changes: 4 additions & 9 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
version: '3.7'
version: "3.7"
services:

#
# CNaaS NMS interactive frontend development setup
#


front:
build: .
ports:
Expand Down Expand Up @@ -73,17 +71,14 @@ services:
target: /opt/cnaas/cacert

httpd:
image:
docker.sunet.se/cnaas/httpd
image: docker.sunet.se/cnaas/httpd
ports:
- 80:1180
networks:
- cnaas
environment:
- GITREPO_TEMPLATES



#
# Databases
#
Expand All @@ -98,7 +93,7 @@ services:
- POSTGRES_DB=cnaas
networks:
- cnaas

redis:
build: ../cnaas-nms/docker/redis/
networks:
Expand All @@ -124,7 +119,7 @@ networks:
name: cnaas
ipam:
config:
- subnet: 172.30.0.0/24
- subnet: 172.30.0.0/24
driver_opts:
com.docker.network.bridge.name: br-cnaas

Expand Down
3 changes: 1 addition & 2 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3.7'
version: "3.7"
services:
cnaas_front:
build: ./front/
Expand All @@ -19,4 +19,3 @@ services:
volumes:
cnaas-front-cert:
external: true

12 changes: 7 additions & 5 deletions docker/front/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
Expand All @@ -9,17 +9,19 @@
/>
<link rel="stylesheet" type="text/css" href="styles/main.css" />
<link rel="stylesheet" type="text/css" href="styles/prism.css" />
<link rel="stylesheet" type="text/css" href="styles/react-semantic-alert.css" />
<link
rel="stylesheet"
type="text/css"
href="styles/react-semantic-alert.css"
/>
<link
href="https://fonts.googleapis.com/css?family=Karla:400,700|Montserrat&display=swap"
rel="stylesheet"
/>
<title>CNaaS NMS</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<noscript> You need to enable JavaScript to run this app. </noscript>
<div id="root">
<!-- react components are rendered here -->
</div>
Expand Down
Loading

0 comments on commit 22f90dd

Please sign in to comment.