Skip to content

Commit

Permalink
chore: merge branch 'release/v5.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuthor committed Nov 18, 2022
2 parents 67addaa + 093e11a commit 7cc4dfb
Show file tree
Hide file tree
Showing 37 changed files with 1,837 additions and 1,012 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ site/*.js
dist/
pgdata/
package-lock.json
demo/demo.tar
49 changes: 29 additions & 20 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,10 @@ build:
- npm test

example_vuejs:
image: gitlab.cosmian.com:5000/core/ci-puppeteer:latest
extends: .services
stage: test
script:
- apt update && apt install -y gconf-service libgbm-dev libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1
libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1
libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3
lsb-release xdg-utils wget
- cd examples/vuejs
- npm install
- npm run build
Expand All @@ -57,13 +54,10 @@ example_vuejs:
expire_in: 1 week

example_reactjs:
image: gitlab.cosmian.com:5000/core/ci-puppeteer:latest
extends: .services
stage: test
script:
- apt update && apt install -y gconf-service libgbm-dev libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1
libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1
libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3
lsb-release xdg-utils wget
- cd examples/reactjs
- npm install
- npm run build
Expand Down Expand Up @@ -109,15 +103,30 @@ publish:
- npm publish
rules:
- if: $CI_COMMIT_TAG =~ /^v\d+.\d+.\d+$/
# deploy:
# image: docker:19.03.15
# stage: publish
# script:
# - ssh cosmian@demo-cloudproof.cosmian.com 'mv ~/demo_cloudproof/demo.tar ~/demo_cloudproof/demo.tar.old'
# - docker build -f demo/Dockerfile -t demo .
# - docker save demo > demo/demo.tar
# - scp demo/* cosmian@demo-cloudproof.cosmian.com:~/demo_cloudproof/
# - ssh cosmian@demo-cloudproof.cosmian.com 'bash ~/demo_cloudproof/run.sh'
# rules:
# - if: $CI_COMMIT_TAG =~ /^v\d+.\d+.\d+$/
# when: manual

deploy:
image: docker
stage: publish
script:
- docker build -f demo/Dockerfile -t demo .
- docker save demo > demo/demo.tar
- scp demo/docker-compose.yml demo/demo.tar demo/run.sh cosmian@demo-cloudproof.cosmian.com:~/demo_cloudproof/
- ssh cosmian@demo-cloudproof.cosmian.com 'bash ~/demo_cloudproof/run.sh'
rules:
- if: $CI_COMMIT_TAG =~ /^v\d+.\d+.\d+$/

check_deploy:
image: gitlab.cosmian.com:5000/core/ci-puppeteer:latest
needs:
- deploy
extends: .services
stage: publish
script:
- node examples/test/chrome.mjs https://demo-cloudproof.cosmian.com/ https://demo-cloudproof.cosmian.com/kms
artifacts:
paths:
- error.png
when: on_failure
expire_in: 1 week
rules:
- if: $CI_COMMIT_TAG =~ /^v\d+.\d+.\d+$/
95 changes: 61 additions & 34 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,67 @@ exclude: tests/wasm_lib
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v2.1.1
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: [] # optional: list of Conventional Commits types to allow e.g. [feat, fix, ci, chore, test]

- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
rev: v1.1.2
hooks:
- id: htmlhint
- id: dockerfile_lint
- id: markdown-toc

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.4
hooks:
- id: prettier
types_or: [bash, bib, c, css, dart, dockerfile, html, java, javascript, jsx, json, python3, sql, ts, tsx, sh]
args: [--semi=false]

- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.2
hooks:
- id: yamlfmt
args: [--mapping, '2', --sequence, '4', --offset, '2']

- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.27.0
hooks:
- id: eslint
args: [src, --fix]

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.3.1
hooks:
- id: forbid-crlf
- id: remove-crlf
- id: forbid-tabs
- id: remove-tabs

- repo: https://github.com/sirosen/texthooks
rev: 0.4.0
hooks:
- id: fix-smartquotes
- id: fix-ligatures
- id: fix-spaces
- id: forbid-bidi-controls
- id: macro-expand

- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
# - id: git-check
- id: shellcheck

- repo: https://github.com/Cretezy/flutter-format-pre-commit
rev: 4a1df675bb74dea371c17934933e257e46f8dd98
hooks:
- id: flutter-format

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
Expand Down Expand Up @@ -38,37 +99,3 @@ repos:
- id: requirements-txt-fixer
- id: sort-simple-yaml
- id: trailing-whitespace

- repo: https://github.com/compilerla/conventional-pre-commit
rev: v2.1.1
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: [] # optional: list of Conventional Commits types to allow e.g. [feat, fix, ci, chore, test]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.4
hooks:
- id: prettier
types_or: [css, javascript, jsx, ts, markdown, bash, sh]
args: [--semi=false]

- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.27.0
hooks:
- id: eslint
args: [src, --fix]

- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.2
hooks:
- id: yamlfmt
args: [--mapping, '2', --sequence, '4', --offset, '2']

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.3.1
hooks:
- id: forbid-crlf
- id: remove-crlf
- id: forbid-tabs
- id: remove-tabs
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.

---

## [5.1.0] - 2022-11-17

### Added

- Cosmian cloudproof Javascript demonstration

### Changed

- update `cover_crypt` to 7.1.0

### Fixed
- fix TypeScript 4.9
- fix E2E test and small HTML tweaks
---

## [5.0.1] - 2022-11-15

### Added
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@


<!-- toc -->

- [Cloudproof Javascript Lib](#cloudproof-javascript-lib)
* [Getting started](#getting-started)
* [Using in Javascript projects](#using-in-javascript-projects)
* [Using in WebPack (not in Node)](#using-in-webpack-not-in-node)
* [Versions Correspondence](#versions-correspondence)
* [npm version](#npm-version)

<!-- tocstop -->

# Cloudproof Javascript Lib

The library provides a Typescript-friendly API to the **Cloudproof Encryption** product of the [Cosmian Ubiquitous Encryption platform](https://cosmian.com).
Expand Down
11 changes: 7 additions & 4 deletions demo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
FROM node:alpine
FROM node:alpine AS builder

RUN mkdir -p /app
COPY . /app

WORKDIR /app
RUN npm install

WORKDIR /app/examples/reactjs

RUN npm install
RUN npm run build

EXPOSE 8080

CMD ["npm", "run", "serve"]
FROM nginx:alpine
COPY --from=builder /app/examples/reactjs/build/ /usr/share/nginx/html/
COPY ./demo/nginx.conf /etc/nginx/conf.d/default.conf
4 changes: 2 additions & 2 deletions demo/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3"
services:
kms:
image: gitlab.cosmian.com:5000/core/kms:3.0.1_ci
image: cosmian/kms:3.0.1
environment:
- KMS_HOSTNAME=0.0.0.0
- KMS_PUBLIC_PATH=/tmp
Expand All @@ -13,4 +13,4 @@ services:
demo:
image: demo:latest
ports:
- 8090:8080
- 8080:8080
7 changes: 7 additions & 0 deletions demo/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
server {
listen 8080;
root /usr/share/nginx/html;

location / {
}
}
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version: '3'
services:
kms:
container_name: kms
image: gitlab.cosmian.com:5000/core/kms:3.0.0_ci
image: gitlab.cosmian.com:5000/core/kms:3.0.2_ci
environment:
- KMS_HOSTNAME=0.0.0.0
- KMS_PUBLIC_PATH=/tmp
Expand Down
Binary file modified examples/reactjs/public/database_encrypted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed examples/reactjs/public/favicon.ico
Binary file not shown.
17 changes: 7 additions & 10 deletions examples/reactjs/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@

<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="https://cosmian.com/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand All @@ -25,7 +17,7 @@
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">

<title>React App</title>
<title>Cosmian Cloudproof JS Demo</title>
</head>

<body>
Expand All @@ -41,6 +33,11 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3"
crossorigin="anonymous"></script>

</body>

</html>
Binary file removed examples/reactjs/public/logo.png
Binary file not shown.
19 changes: 19 additions & 0 deletions examples/reactjs/public/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed examples/reactjs/public/logo192.png
Binary file not shown.
Binary file removed examples/reactjs/public/logo512.png
Binary file not shown.
25 changes: 0 additions & 25 deletions examples/reactjs/public/manifest.json

This file was deleted.

Loading

0 comments on commit 7cc4dfb

Please sign in to comment.