Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Mart Somermaa <[email protected]>
  • Loading branch information
mrts committed Dec 18, 2020
1 parent 97395ff commit afb605c
Show file tree
Hide file tree
Showing 35 changed files with 4,733 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 120

[*.md]
trim_trailing_whitespace = false
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bin
node_modules
dist
*.mjs
30 changes: 30 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module.exports = {
env: {
"browser": true,
"es6": true,
"webextensions": true,
"node": true
},
root: true,
parser: "@typescript-eslint/parser",
plugins: [
"@typescript-eslint",
],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
],
rules: {
"quotes": "error",
"semi": "off",
"key-spacing": ["error", { "align": "value" }],
"comma-dangle": ["error", "always-multiline"],
"object-curly-spacing": ["error", "always"],
"array-bracket-spacing": "error",
"indent": "off",
"@typescript-eslint/indent": ["error", 2],
"@typescript-eslint/semi": ["error"],
"@typescript-eslint/no-explicit-any": "off",
},
};
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn.lock*

# Dependency directories
node_modules/

# Parcel related files
dist/
.cache/

# Windows
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
[Dd]esktop.ini

# macOS
.DS_Store
.AppleDouble
.LSOverride
._*

# Python
__pycache__

# Vim
*.swp
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@web-eid:registry=https://gitlab.com/api/v4/packages/npm
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Web-eID WebExtension

![European Regional Development Fund](https://github.com/e-gov/RIHA-Frontend/raw/master/logo/EU/EU.png)

The Web eID extension for the Chrome, Edge, Firefox and Opera web browsers is
built using the WebExtensions API, a cross-browser system for developing
extensions. The extension communicates with the Web eID native application
using Native messaging. Native messaging enables an extension to exchange
messages with a native application installed on the user's computer to enable
the extension to access resources that are not accessible through WebExtension
APIs, like the smart card subsystem.

## Setup (for developers/testers)

1. Install the latest LTS version of Node.js - [https://nodejs.org](https://nodejs.org)

2. Clone the project
```bash
git clone [email protected]:web-eid/webextension/web-eid-webextension.git
```

3. Install dependencies
```bash
cd web-eid-webextension
npm install
```

4. Build the project with zip packages
```bash
npm run clean build package
```

For reproducible builds, set the `SOURCE_DATE_EPOCH` environment variable.
See [https://reproducible-builds.org/docs/source-date-epoch](https://reproducible-builds.org/docs/source-date-epoch) for details.
```bash
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) npm run clean build package
```

Alternatively, for reproducible builds, the `SOURCE_DATE_EPOCH` value can be taken from the `SOURCE_DATE_EPOCH` file of a previous build.
```bash
SOURCE_DATE_EPOCH=$(cat ../previous-build/dist/firefox/SOURCE_DATE_EPOCH) npm run clean build package
```

5. Load in Firefox as a Temporary Extension
1. Open [about:debugging#/runtime/this-firefox](about:debugging#/runtime/this-firefox)
2. Click "Load temporary Add-on..." and open `/web-eid-webextension/dist/manifest.json`

### Configuration

Make sure the `NATIVE_APP_NAME` value in `src/config.ts` matches the one in
the Web-eID native application manifest file.

Loading

0 comments on commit afb605c

Please sign in to comment.