...
 
Commits (552)
image: node:10
image: node:12
variables:
DOCKER_DRIVER: overlay2
......@@ -14,10 +14,14 @@ stages:
test:
stage: test
image: registry.gitlab.com/dasch8/angular-ci:latest
cache:
paths:
- .npm/
script:
- yarn install
- yarn run lint
- yarn test --progress false --watch=false --browsers=Chromium_CI
- apk add git python make g++
- npm ci
- npm run lint
- npm run test -- --progress false --watch=false --browsers=Chromium_CI
build-web-assets:
stage: test
......@@ -39,7 +43,7 @@ build-ext-assets:
script:
- npm ci
- ./set_version.sh
- npm run build:ext --prod --progress false
- npm run build:ext -- --prod --progress false
- bin/remove_eval.sh
- npm run ext:lint
- npm run ext:build
......@@ -50,6 +54,65 @@ build-ext-assets:
- web-ext-artifacts/
- dist-ext/
build_android:
image: runmymind/docker-android-sdk:ubuntu-standalone
variables:
NODE_VERSION: 12.3.1
stage: test
only:
- master
- staging
script:
- wget -q http://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz
- tar -xzf node-v${NODE_VERSION}-linux-x64.tar.gz
- mv node-v${NODE_VERSION}-linux-x64 /opt/node
- rm node-v${NODE_VERSION}-linux-x64.tar.gz
- PATH=${PATH}:/opt/node/bin
- npm install -g nativescript --unsafe-perm
- $ANDROID_HOME/tools/bin/sdkmanager "tools" "platform-tools" "platforms;android-28" "build-tools;28.0.3" "extras;android;m2repository" "extras;google;m2repository" > /dev/null
- npm i --unsafe-perm node-sass karma-webdriver-launcher
- npm i
- echo "build version code $CI_PIPELINE_IID"
- sed -i '/versionCode/c\ android:versionCode="'"$CI_PIPELINE_IID"'"' App_Resources/Android/AndroidManifest.xml
- if [[ -v CI_COMMIT_TAG ]]; then sed -i '/versionName/c\ android:versionName="'"$CI_COMMIT_TAG"'">' App_Resources/Android/AndroidManifest.xml; fi;
- echo $ANDROID_KEY_BASE64 | base64 -d > bsc-release-key.jks
- tns build android --release --env.snapshot --env.aot --env.uglify --aab --key-store-path bsc-release-key.jks --key-store-password $ANDROID_KEY_PASSWORD --key-store-alias-password $ANDROID_KEY_PASSWORD --key-store-alias bsc
artifacts:
paths:
- platforms/android/app/build/outputs/
cache:
paths:
- .npm/
build_android_apk:
image: runmymind/docker-android-sdk:ubuntu-standalone
variables:
NODE_VERSION: 12.3.1
stage: test
only:
- master
script:
- wget -q http://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz
- tar -xzf node-v${NODE_VERSION}-linux-x64.tar.gz
- mv node-v${NODE_VERSION}-linux-x64 /opt/node
- rm node-v${NODE_VERSION}-linux-x64.tar.gz
- PATH=${PATH}:/opt/node/bin
- npm install -g nativescript --unsafe-perm
- $ANDROID_HOME/tools/bin/sdkmanager "tools" "platform-tools" "platforms;android-28" "build-tools;28.0.3" "extras;android;m2repository" "extras;google;m2repository" > /dev/null
- npm i --unsafe-perm node-sass karma-webdriver-launcher
- npm i
- echo "build version code $CI_PIPELINE_IID"
- sed -i '/versionCode/c\ android:versionCode="'"$CI_PIPELINE_IID"'"' App_Resources/Android/AndroidManifest.xml
- if [[ -v CI_COMMIT_TAG ]]; then sed -i '/versionName/c\ android:versionName="'"$CI_COMMIT_TAG"'">' App_Resources/Android/AndroidManifest.xml; fi;
- echo $ANDROID_KEY_BASE64 | base64 -d > bsc-release-key.jks
- tns build android --release --env.snapshot --env.aot --env.uglify --key-store-path bsc-release-key.jks --key-store-password $ANDROID_KEY_PASSWORD --key-store-alias-password $ANDROID_KEY_PASSWORD --key-store-alias bsc
artifacts:
paths:
- platforms/android/app/build/outputs/
cache:
paths:
- .npm/
build-push-docker:
stage: docker
image: docker:stable
......@@ -63,6 +126,7 @@ build-push-docker:
- dev
script:
- VERSION=$(cat package.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]')
- echo "Build version $VERSION ci registry image $CI_REGISTRY_IMAGE commit ref $CI_COMMIT_REF_NAME"
- docker build -f Dockerfile.prod -t ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME} --build-arg PASSIT_VERSION=$VERSION .
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
- docker push ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}
......@@ -102,6 +166,24 @@ deploy-prod:
- docker tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME} ${OPENSHIFT_REGISTRY}/passit-prod/passit-frontend:master
- docker push ${OPENSHIFT_REGISTRY}/passit-prod/passit-frontend:master
deploy-dockerhub:
stage: deploy
image: docker:stable
services:
- docker:dind
only:
- master
environment:
name: production
url: https://app.passit.io
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
- docker pull ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}
- docker login -u ${DOCKER_CI_REGISTRY_USER} -p ${DOCKER_CI_REGISTRY_PASSWORD}
- echo tag image ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME} as ${DOCKER_CI_REGISTRY_IMAGE}
- docker tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME} ${DOCKER_CI_REGISTRY_IMAGE}
- docker push ${DOCKER_CI_REGISTRY_IMAGE}
deploy-chrome-ext:
stage: deploy
image: debian:jessie
......@@ -133,7 +215,7 @@ pages:
- .npm/
script:
- npm ci
- npm run build-storybook -o public
- npm run build-storybook -- -o public
artifacts:
paths:
- public
......
import "@storybook/addon-actions/register";
import "@storybook/addon-knobs/register";
import { configure } from "@storybook/angular";
import { configure } from '@storybook/angular';
// automatically import all files ending in *.stories.ts
const req = require.context("../src/stories", true, /.stories.ts$/);
const req = require.context('../src/stories', true, /\.stories\.ts$/);
function loadStories() {
req.keys().forEach(filename => req(filename));
}
......
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
style="position:absolute; width: 0; height: 0"
>
<symbol viewBox="0 0 1000 1000" id="icon-autofill">
<path
d="M978.21,1000H3.14V393.77H377.57v69.45h-305V930.55H908.76V622.29h69.45ZM833.47,517.13l114.09-82.56L860.41,317l-45.29-22.36,55-1.15,126.7-41.85L953.29,115.24l-129,42.43-39,29.24,18.92-47V0H660.9V139.89l18.92,47-39-29.24-129-42.43L468.26,251.69l127.28,41.85,55,1.15L604.71,317,517.57,434.57l114.09,82.56L718.8,400.75l13.76-55,14.33,55ZM370.63,674.82l-20.86,62.24-2.35-62.24-5.62-126H230l44.89,295L320.42,877l285.74-41.26V715.3l-126.72,36.2-12.79,3.38-34,9-12.5,3.3,39.08-35.71L586.6,576.73,476.86,497.33Z"
/>
</symbol>
<symbol viewBox="0 0 1000 1000" id="icon-copy-username">
<path
d="M854.29,1000H528.77c-59.22,0-99.44-36.13-99.44-96.47,0-84.17,19.74-213.41,128.87-213.41,11.54,0,60.34,51.77,133.34,51.77s121.79-51.77,133.34-51.77c109.13,0,128.87,129.24,128.87,213.41C953.74,963.87,913.51,1000,854.29,1000ZM691.53,663.21a143,143,0,1,1,143-143A143.05,143.05,0,0,1,691.53,663.21ZM359.35,819.75H130.85V115.48h99V30.89h-129a54.6,54.6,0,0,0-54.6,54.59V849.74a54.6,54.6,0,0,0,54.6,54.59H353.24c0-.27,0-.53,0-.8A547.68,547.68,0,0,1,359.35,819.75Zm364-704.27V303.63A217.44,217.44,0,0,1,808,334.87V85.48a54.6,54.6,0,0,0-54.6-54.59h-129v84.58ZM619.74,154.18H556.67V22.48C556.67,10.53,546.12,0,534.18,0H320c-11.94,0-22.49,10.53-22.49,22.48V154.18H234.48c-11.94,0-22.48,10.54-22.48,22.49v78.81c0,11.94,10.53,22.49,22.48,22.49H619.74c11.94,0,22.48-10.54,22.48-22.49V176.67C642.22,164.73,631.68,154.18,619.74,154.18ZM427.11,157A47.93,47.93,0,1,1,475,109.07,47.93,47.93,0,0,1,427.11,157Z"
/>
</symbol>
<symbol viewBox="0 0 1000 1000" id="icon-copy-password">
<path
d="M694.37,870.74l-16.63-63.87-16,63.87L560.64,1005.8,428.24,910,529.37,773.6l53.23-25.95-63.87-1.33L371,697.76l50.56-158.35,149.7,49.23,45.24,33.93-22-54.56V405.68H760.9V568l-22,54.56,45.24-33.93,149.7-49.23,50.56,158.35-147,48.57-63.87,1.33L826.1,773.6,927.23,910l-132.4,95.81Zm-1.71-749.46V329.56H760.9a76.09,76.09,0,0,1,16.35,1.86V91.28a54.6,54.6,0,0,0-54.6-54.59h-129v84.58ZM396.08,825.55h-296V121.28h99V36.69h-129a54.6,54.6,0,0,0-54.6,54.59V855.54a54.6,54.6,0,0,0,54.6,54.59h262.3ZM589,160H528.39V28.28c0-11.94-10.54-22.48-22.49-22.48H291.76c-11.94,0-22.49,10.53-22.49,22.48V160H203.77c-11.94,0-22.48,10.54-22.48,22.49v78.81c0,11.94,10.53,22.49,22.48,22.49H589c11.94,0,22.48-10.54,22.48-22.49V182.47C611.5,170.53,601,160,589,160ZM396.4,162.8a47.93,47.93,0,1,1,47.93-47.93A47.93,47.93,0,0,1,396.4,162.8Z"
/>
</symbol>
<symbol viewBox="0 0 1792 1792" id="icon-check">
<path
d="M1671 566q0 40-28 68l-724 724-136 136q-28 28-68 28t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28 68-28t68 28l294 295 656-657q28-28 68-28t68 28l136 136q28 28 28 68z"
/>
</symbol>
<symbol viewBox="0 0 1792 1792" id="icon-external-link">
<path
d="M1408 928v320q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h704q14 0 23 9t9 23v64q0 14-9 23t-23 9h-704q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113v-320q0-14 9-23t23-9h64q14 0 23 9t9 23zm384-864v512q0 26-19 45t-45 19-45-19l-176-176-652 652q-10 10-23 10t-23-10l-114-114q-10-10-10-23t10-23l652-652-176-176q-19-19-19-45t19-45 45-19h512q26 0 45 19t19 45z"
/>
</symbol>
<symbol viewBox="0 0 1792 1792" id="icon-edit">
<path
d="M888 1184l116-116-152-152-116 116v56h96v96h56zm440-720q-16-16-33 1l-350 350q-17 17-1 33t33-1l350-350q17-17 1-33zm80 594v190q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q63 0 117 25 15 7 18 23 3 17-9 29l-49 49q-14 14-32 8-23-6-45-6h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113v-126q0-13 9-22l64-64q15-15 35-7t20 29zm-96-738l288 288-672 672h-288v-288zm444 132l-92 92-288-288 92-92q28-28 68-28t68 28l152 152q28 28 28 68t-28 68z"
/>
</symbol>
<symbol viewBox="0 0 1408 1792" id="icon-trash">
<path d="M512 736v576q0 14-9 23t-23 9h-64q-14 0-23-9t-9-23v-576q0-14 9-23t23-9h64q14 0 23 9t9 23zm256 0v576q0 14-9 23t-23 9h-64q-14 0-23-9t-9-23v-576q0-14 9-23t23-9h64q14 0 23 9t9 23zm256 0v576q0 14-9 23t-23 9h-64q-14 0-23-9t-9-23v-576q0-14 9-23t23-9h64q14 0 23 9t9 23zm128 724v-948h-896v948q0 22 7 40.5t14.5 27 10.5 8.5h832q3 0 10.5-8.5t14.5-27 7-40.5zm-672-1076h448l-48-117q-7-9-17-11h-317q-10 2-17 11zm928 32v64q0 14-9 23t-23 9h-96v948q0 83-47 143.5t-113 60.5h-832q-66 0-113-58.5t-47-141.5v-952h-96q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h309l70-167q15-37 54-63t79-26h320q40 0 79 26t54 63l70 167h309q14 0 23 9t9 23z"></path>
</symbol>
</svg>
{
"extends": "../src/tsconfig.app.json",
"compilerOptions": {
"types": [
"node",
"jasmine",
"global"
]
},
"exclude": [
"../src/test.ts",
"../src/**/*.tns.ts",
"../src/**/*.spec.ts",
"../projects/**/*.spec.ts"
],
"include": [
"../src/**/*",
"../projects/**/*"
]
}
// Add your native dependencies here:
// Uncomment to add recyclerview-v7 dependency
//dependencies {
dependencies {
compile 'org.slf4j:slf4j-nop:1.7.25'
// compile 'com.android.support:recyclerview-v7:+'
//}
}
android {
defaultConfig {
......
......@@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="__PACKAGE__"
xmlns:tools="http://schemas.android.com/tools"
android:versionCode="1"
android:versionName="1.0">
android:versionCode="7"
android:versionName="1.12.0">
<supports-screens
android:smallScreens="true"
......@@ -18,6 +18,11 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission
android:name="android.permission.RECORD_AUDIO"
tools:node="remove" />
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<application
android:name="com.tns.NativeScriptApplication"
......@@ -31,7 +36,8 @@
android:name="com.tns.NativeScriptActivity"
android:label="@string/title_activity_kimera"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@style/LaunchScreenTheme">
android:theme="@style/LaunchScreenTheme"
android:windowSoftInputMode="adjustResize">
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
......
# 1.12.0 Release
- Updated to angular 8
- Updated to Django 2.2
- Updated to NativeScript 5.4
- Multi-factor authentication in preview mode. Not ready for general usage yet.
# 1.11.2 Patch Release
- Fixed bug where static assets didn't have X-Frame-Options
- Fixed broken link to backup recovery code
# 1.11.1 Patch Release
- Fixed bug where django admin could not be enabled.
# 1.11 Release
- Initial LDAP support
- The Android app now supports import and export.
- The Web extension autofill feature works with more sites (Now based on the browserpass extension. Thanks, browerpass team!)
- 20% faster start up time thanks to Angular module lazy-loading. This is noticable in the web extension popup.
- Self hosted users can now enable the Django Admin interface via environment variable ENABLE_DJANGO_ADMIN.
# 1.9 Release
- Added CSP headers
......
FROM node:10-alpine
FROM node:12-alpine
RUN mkdir /dist
WORKDIR /dist
......
......@@ -4,4 +4,4 @@ ENV PASSIT_VERSION ${PASSIT_VERSION}
COPY dist/ /code/dist
RUN SECRET_KEY=ci ./manage.py collectstatic --noinput
RUN SECRET_KEY=ci ENABLE_DJANGO_ADMIN=True ./manage.py collectstatic --noinput
......@@ -26,60 +26,36 @@ Run any one off commands like `docker-compose run --rm web ng` to execute them i
You may want to run the client without docker. This is helpful when writing unit tests or for quickly adding packages. If you'd like to do this:
1. Start the backend in docker `docker-compose up api`
2. Ensure yarn and node 8 are installed
3. Install node packages `yarn`
4. Run the frontend `yarn start` or use any `yarn ng` command from angular-cli.
2. Ensure node 10 and npm are installed?
3. Install node packages `npm i`
4. Run the frontend `npm start` or use any `npm run ng` command from angular-cli.
5. You can still run the backend with docker using `docker-compose up api`
**Hot Reload**
To enable webpack hot reloading run `npm run hmr` instead of start.
### Rebuilding when changing package.json
If you need to run `yarn install` you'll want to instead run `docker-compose build` and `docker-compose rm -v app` to remove the old container.
If you need to run `npm i` you'll want to instead run `docker-compose build` and `docker-compose rm -v app` to remove the old container.
This is because node_modules are kept in a docker volume.
This is not ideal - if you know how to build node_modules into the container itself instead of a volume please let us know.
## Running unit tests
Run `yarn test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
End-to-end tests are run via [Protractor](http://www.protractortest.org/).
We'll run the backend in docker and the frontend without for simplicity. Ensure you run `yarn` first to install local node modules.
1. Start backend `docker-compose up api`
2. Start dev server `yarn start`
3. Run test `yarn run e2e`
The e2e script will use the existing dev server (so you don't have to wait for it to rebuild each time)
We can also run the e2e tests against firefox, by setting the `FIREFOX` environmental variable to something and we can run them against the web extension
by setting `EXTENSION` env variable to be something (before testing against the extension you have to build it with `build:ext`.
We can also run the tests in docker:
Run `npm test` to execute the unit tests via [Karma](https://karma-runner.github.io).
```bash
docker-compose up -d app selenium-<chrome/firefox>
[docker-compose run app build:ext]
docker-compose run [-e FIREFOX=true] [-e EXTENSION=true] app e2e:docker
```
### end-to-end test structure and how to
## Running storybook
We ensure that each `describe` block can be run in any order.
However each `it` step inside a block actually must run in order - as to minimize set up time which is time consuming due to expensive crypto functions being used when logging in.
We write storybook stories for presentational components instead of unit tests. To run:
* The `describe` blocks do not need to run in order.
* Each `describe` block creates a new user.
* Some `it` statements within a `describe` block depend on state from previous tests and need to run in order.
`npm run storybook`
New users are created in the docker backend with random user names to prevent collisions. This means we don't have to wipe the backend between tests which also saves time (at the expense of this being slightly ugly).
## Coding Style and Linting
## Coding Style and Linting
Follow style and design patterns as seen on the [ngrx example-app](https://github.com/ngrx/platform/blob/master/example-app/README.md) and from angular-cli.
Follow style and design patterns as seen on the [ngrx example-app](https://github.com/ngrx/platform/tree/master/projects/example-app) and from angular-cli.
```bash
yarn lint
npm run lint
```
### Error handling
......@@ -88,12 +64,8 @@ Error and validation can get complex. We have the backend API, js SDK, services,
- Do use ngrx-forms's client side validation
- Only use ngrx-forms async validation for "as you type" server side validation. Do not use it for server errors.
- The SDK should always throw `IPassitSDKError` type errors.
- Services should not handle errors, services are just very thin wrappers around the SDK
- Effects should handle errors by deciding what action to return.
- If the user is submitting a form - handle the error in the effect and show a nice message (Ex: "Server Error"). Let the component display the error as seen fit (instead of a global method of notification)
- If the error is authentication related, do return the HandleAPIErrorAction instead of handling the auth error yourself.
- When not working with a form (ex: refresh groups from server) return the HandleAPIErrorAction. This is a generic error that will run some common checks on the server response (is the user logged in? Email Validated?) and handle those. If the error does not match any way to handle it - it will simply log to the console.
- Services should handle errors and return an Observable. They should throw handled error messages as an error.
- Effects should connect services to the correct action response. Effects are glue code and should avoid complex logic (which should be in a service).
## Development for web extension
......@@ -104,44 +76,22 @@ For development:
We'll run this time without docker (though you could use docker). We want to build the app with aot and watch enabled for auto reload.
Then we'll run web-ext to launch the code as an extension in Firefox.
1. Run backend either in docker (`docker-compose up -d api`) or hosted service
3. `yarn install` (if not done already)
4. `yarn run build:ext --watch`
5. (new term) `yarn web-ext run -s dist/ -a dist/`
1. Run backend either in docker (`docker-compose up api`) or hosted service
2. `npm install` (if not done already)
3. `npm run build:ext -- --watch`
4. (new term) For Firefox `npm run ext:run` and for Chrome go to `dist/manifest.json` and change `"CI_INSERT_VERSION_HERE"` to a number. Open Chrome and go to `chrome://extensions/`. Ensure Developer mode is checked. Click Load unpacked and select the dist folder that is generated by the npm run build:ext step.
This process can be a little slow. You are encouraged to use test driven development or working on the web front end when possible.
Because the app shares the same code, going to routes like `/popup` actually work fine in the web version. However note when not
running as an extension you won't have access to web extension api's like the browser object.
If you'd like to try the extension in Chrome:
1. Do steps 1-4 above
2. Open up Chrome and go to Extensions
3. Check the "Developer Mode" box up top if you haven't already done so.
4. Click "Load unpacked extension..." and select the `dist/` folder.
### Autofill development
Autofill code is injected into the page. It must be compiled but the process is currently very awkward.
Autofill code is injected into the page. It must be compiled.
1. Remove `export` from `extension/form-fill/form-fill.ts`
2. Compile with `yarn build:autofill`
2. Compile with `npm build:autofill`
3. Copy and paste the resulting js file into autofill-compiled.ts as a string.
Open an issue if you know a better way. Only plain js strings and js files can be inserted directly into a web page. Ideally webpack should do all this but I'm not sure how to get webpack to output a plain js file (without the module bootstraping) or how to force it to strip out exports. Note the exports must exist so that it can be used in tests.
### Deploying new extension
We don't distribute the firefox extension on the store, because they won't accept angular code - see #15.
So instead we self host, signing it with the `web-ext` command in CI and creating an update manifest [Firefox knows when to update](https://developer.mozilla.org/en-US/Add-ons/Updates).
1. Change version in `src/manifest.json`
3. Commit those changes
4. Add a git tag in the format `vX.X.X`
5. Push the changes and git tag to Gitlab
6. Once all build steps finish, download the `passit.zip` to upload to the chrome webstore.
It is available as an artifact under the `build-ext-assets` job in the `test` stage.
7. Create a new release on the [Chrome web store](https://chrome.google.com/webstore/developer/dashboard)
# Mobile app
Passit's mobile app runs via Nativescript. It uses a mono-repo approach described [here](https://docs.nativescript.org/angular/code-sharing/intro)
......@@ -155,17 +105,15 @@ Basically a file like something.tns.ts will replace the web version of that file
## Running
Run `tns run android --bundle`
Run `tns run android --bundle` or `tns run android --hmr` for hot reloading.
** Troubleshooting **
- Delete node modules and generated resources `rm -rf hooks platforms node_modules`
- Delete node modules and generated resources `rm -rf hooks platforms node_modules` then `npm i`
- Force a new apk build `tns build android`
### Technologies used
* [Angular](https://angular.io/) with [TypeScript](http://www.typescriptlang.org/) and [ngrx/platform](https://github.com/ngrx/platform/)
* [NativeScript](https://www.nativescript.org/) for mobile
* [Webpack](https://webpack.github.io/)
* [libsodium.js](https://github.com/jedisct1/libsodium.js) for crypto with good defaults
* Testing [Jasmine](http://jasmine.github.io/), [Karma](https://karma-runner.github.io/1.0/index.html), and [Protractor](http://www.protractortest.org/#/)
- [Angular](https://angular.io/) with [TypeScript](http://www.typescriptlang.org/) and [ngrx/platform](https://github.com/ngrx/platform/)
- [NativeScript](https://www.nativescript.org/) for mobile
- [libsodium.js](https://github.com/jedisct1/libsodium.js) for crypto with good defaults
......@@ -24,11 +24,14 @@
"glob": "browser-polyfill.min.js",
"input": "node_modules/webextension-polyfill/dist",
"output": "/"
},
{
"glob": "inject.js",
"input": "src/app/extension/form-fill/dist",
"output": "/"
}
],
"styles": [
"src/styles.scss"
],
"styles": ["src/styles.scss"],
"scripts": []
},
"configurations": {
......@@ -59,14 +62,6 @@
}
]
},
"docker": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.docker.ts"
}
]
},
"extension": {
"optimization": true,
"outputHashing": "all",
......@@ -132,6 +127,10 @@
"production": {
"browserTarget": "passit:build:production"
},
"hmr": {
"hmr": true,
"browserTarget": "passit:build:hmr"
},
"docker": {
"browserTarget": "passit:build:docker"
},
......@@ -154,9 +153,7 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"scripts": [],
"styles": [
"src/styles.scss"
],
"styles": ["src/styles.scss"],
"assets": [
"src/assets",
"src/manifest.json",
......@@ -172,13 +169,8 @@
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**/*"
]
"tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"],
"exclude": ["**/node_modules/**/*"]
}
}
}
......@@ -203,12 +195,8 @@
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": [
"**/node_modules/**/*"
]
"tsConfig": ["e2e/tsconfig.e2e.json"],
"exclude": ["**/node_modules/**/*"]
}
}
}
......@@ -226,11 +214,12 @@
},
"@schematics/angular": {
"component": {
"spec": false
"spec": false,
"changeDetection": "OnPush"
}
}
},
"cli": {
"defaultCollection": "@nativescript/schematics"
}
}
\ No newline at end of file
}
......@@ -7,10 +7,6 @@ rm passit.zip
# Remove unused chrome permission
sed -i '/clipboardWrite/d' manifest.json
sed -i '/activeTab./c\ "activeTab"' manifest.json
# Chrome requires unsafe eval to copile wasm :(
sed -i '/content_security_policy./c\ "content_security_policy": "script-src \x27self\x27 \x27unsafe-eval\x27; object-src \x27self\x27",' manifest.json
# Zip it back up
zip -r passit.zip .
......@@ -19,7 +15,7 @@ cd ..
echo 'Get access token'
ACCESS_TOKEN=$(curl "https://accounts.google.com/o/oauth2/token" -d "client_id=${CLIENT_ID}&client_secret=${CLIENT_SECRET}&refresh_token=${REFRESH_TOKEN}&grant_type=refresh_token&redirect_uri=urn:ietf:wg:oauth:2.0:oob" | jq -r .access_token)
echo "Submit passit.zip to chromewebstore items with app id ${APP_ID}"
echo "Submit passit.zip to chromewebstore items with app id ${APP_ID}"
curl -H "Authorization: Bearer ${ACCESS_TOKEN}" -H "x-goog-api-version: 2" -X PUT -T web-ext-artifacts/passit.zip -v "https://www.googleapis.com/upload/chromewebstore/v1.1/items/${APP_ID}"
echo "Publish to store!"
......
#!/bin/bash
echo "Get access token for client id ${ANDROID_CLIENT_ID}"
ACCESS_TOKEN=$(curl "https://accounts.google.com/o/oauth2/token" -d "client_id=${ANDROID_CLIENT_ID}&client_secret=${ANDROID_CLIENT_SECRET}&refresh_token=${ANDROID_REFRESH_TOKEN}&grant_type=refresh_token&redirect_uri=urn:ietf:wg:oauth:2.0:oob" | jq -r .access_token)
echo "Create new edit for ${packageName}"
EDIT_ID=$(curl -H "Authorization: Bearer ${ANDROID_ACCESS_TOKEN}" -X POST https://www.googleapis.com/androidpublisher/v3/applications/${packageName}/edits | jq -r .id)
echo "Upload apk to Google Play for edit id ${EDIT_ID}"
curl -H "Authorization: Bearer ${ANDROID_ACCESS_TOKEN}" -X POST --header "Content-Type:application/vnd.android.package-archive" -T platforms/android/app/build/outputs/apk/release/app-release.apk -v "https://www.googleapis.com/upload/androidpublisher/v3/applications/${packageName}/edits/${EDIT_ID}/apks?uploadType=media"
echo "Submit apk to Beta Track for edit id ${EDIT_ID}"
curl -H "Authorization: Bearer ${ANDROID_ACCESS_TOKEN}" -X PUT -v "https://www.googleapis.com/androidpublisher/v3/applications/${packageName}/edits/${CI_PIPELINE_IID}/tracks/beta"
echo "Commit edit id ${EDIT_ID}"
curl -H "Authorization: Bearer ${ANDROID_ACCESS_TOKEN}" -X POST https://www.googleapis.com/androidpublisher/v3/applications/${packageName}/edits/${EDIT_ID}:commit
> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11
not samsung 4
not android 4.4.3-4.4.4
not last 2 ie_mob versions
not last 2 op_mini versions
not last 2 op_mob versions
not last 2 baidu versions
not last 2 kaios versions
not last 2 and_uc versions
not last 2 and_qq versions
not last 2 edge versions
not chrome 49
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.