Skip to content

Commit

Permalink
chore(): initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasGassmann committed Aug 23, 2018
0 parents commit 168a3c4
Show file tree
Hide file tree
Showing 196 changed files with 98,019 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
*.tmp
*.tmp.*
.vscode/
npm-debug.log*

.idea/
.sourcemaps/
.sass-cache/
.tmp/
.versions/
coverage/
dist/
node_modules/
tmp/
temp/
hooks/
platforms/
plugins/
plugins/android.json
plugins/ios.json
www/
.DS_Store
Thumbs.db
UserInterfaceState.xcuserstate
*.md5
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
indent_style = space
indent_size = 2

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore

*~
*.sw[mnpcod]
*.log
*.tmp
*.tmp.*
log.txt
*.sublime-project
*.sublime-workspace
.vscode/
npm-debug.log*

.idea/
.sourcemaps/
.sass-cache/
.tmp/
.versions/
coverage/
dist/
node_modules/
tmp/
temp/
hooks/
platforms/
plugins/
plugins/android.json
plugins/ios.json
www/
$RECYCLE.BIN/
e2e-reports/*

airgap_cordova_secure_storage_deploy
airgap_cordova_secure_storage_deploy.pub

.DS_Store
Thumbs.db
UserInterfaceState.xcuserstate
81 changes: 81 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
image: docker:latest

variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE
IMAGE_TAG_CURRENT: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
IMAGE_TAG_LATEST: $CI_REGISTRY_IMAGE:latest
IMAGE_TAG_ANDROID_CURRENT: $CI_REGISTRY_IMAGE:android-$CI_COMMIT_SHA
IMAGE_TAG_ANDROID_LATEST: $CI_REGISTRY_IMAGE:android-latest

stages:
- build
- test
- native_build
- deploy

build_ionic:
stage: build
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- echo "$GITLAB_DEPLOY_SSH_KEY" > airgap_cordova_secure_storage_deploy
- echo "$GITLAB_DEPLOY_SSH_KEY_PUB" > airgap_cordova_secure_storage_deploy.pub
script:
- docker build --cache-from $IMAGE_TAG_LATEST -t $IMAGE_TAG .
- docker tag $IMAGE_TAG $IMAGE_TAG_CURRENT
- docker tag $IMAGE_TAG $IMAGE_TAG_LATEST
- docker push $IMAGE_TAG_CURRENT
- docker push $IMAGE_TAG_LATEST
tags:
- docker

unit:
stage: test
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- docker run $IMAGE_TAG_CURRENT npm run test-ci
tags:
- docker

build_android:
stage: native_build
when: manual
tags:
- docker
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- echo "$GITLAB_DEPLOY_SSH_KEY" > airgap_cordova_secure_storage_deploy
- echo "$GITLAB_DEPLOY_SSH_KEY_PUB" > airgap_cordova_secure_storage_deploy.pub
script:
- docker build -f build/android/Dockerfile -t $IMAGE_TAG_ANDROID_CURRENT --build-arg KEYSTORE_PASSWORD="$KEYSTORE_PASSWORD" --build-arg KEYSTORE_ALIAS="$KEYSTORE_ALIAS" --build-arg BUILD_NR="$CI_PIPELINE_ID" .
- docker run --name $CI_PIPELINE_ID $IMAGE_TAG_ANDROID_CURRENT echo "container ran."
- docker cp $CI_PIPELINE_ID:/app/android-release-unsigned.apk android-release-unsigned-$CI_PIPELINE_ID.apk
- docker cp $CI_PIPELINE_ID:/app/android-debug.apk android-debug-$CI_PIPELINE_ID.apk
after_script:
- docker rm -f $CI_PIPELINE_ID || true
artifacts:
paths:
- android-release-unsigned-$CI_PIPELINE_ID.apk
- android-debug-$CI_PIPELINE_ID.apk


build_ios:
stage: native_build
when: manual
before_script:
- echo "$GITLAB_DEPLOY_SSH_KEY" > airgap_cordova_secure_storage_deploy
- echo "$GITLAB_DEPLOY_SSH_KEY_PUB" > airgap_cordova_secure_storage_deploy.pub
script:
- npm install
- sed -i -e "s/ios-CFBundleVersion=\"1.0.0\"/ios-CFBundleVersion=\"1.0.$CI_PIPELINE_ID\"/g" config.xml
- ionic run build --prod
- ionic cordova platform rm ios
- ionic cordova platform add ios@latest
- find ./resources/ -name "*.png" -exec convert "{}" -alpha off "{}" \;
- fastlane ios beta
artifacts:
paths:
- app-release.ipa
tags:
- ios

53 changes: 53 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
FROM node:8-slim

# See https://crbug.com/795759
RUN apt-get update && apt-get install -yq libgconf-2-4 bzip2 build-essential
RUN apt-get install -yq git

# Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)
# Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer
# installs, work.
RUN apt-get update && apt-get install -y wget --no-install-recommends \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get purge --auto-remove -y curl \
&& rm -rf /src/*.deb

# create app directory
RUN mkdir /app
WORKDIR /app

# Install app dependencies, using wildcard if package-lock exists
COPY package.json /app
COPY package-lock.json /app

# copy deploy keys for pull-access
RUN mkdir -p /root/.ssh

COPY airgap_cordova_secure_storage_deploy /root/.ssh/id_rsa
COPY airgap_cordova_secure_storage_deploy.pub /root/.ssh/id_rsa.pub

RUN chmod 700 /root/.ssh/id_rsa

RUN echo "Host gitlab.papers.tech\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config

# install dependencies
RUN npm install

# install static webserver
RUN npm install node-static -g

# Bundle app source
COPY . /app

# set to production
RUN export NODE_ENV=production

# build
RUN npm run build

CMD ["static", "-p", "8100", "-a", "0.0.0.0", "www"]
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# AirGap.it wallet

An Ionic app to prepare and broadcast signed transaction to the network. This app will never come in touch with your private key. Those are securily managed in the **AirGap Vault** app. Because the phones are never physically connected to each other, we call our system AirGap.

# Prerequisite
`npm install -g ionic`
`npm install -g cordova`

# Install
`npm install`

# Serve local
`ionic serve`

# Build for a mobile platform
`ionic cordova platform run android`
`ionic cordova platform run ios`

# Links

The AirGap Wallet app is available on [Android](https://play.google.com/store/apps/details?id=it.airgap.wallet).

The source code for AirGap Vault can be found [here](https://github.com/airgap-it/airgap-vault)

# Was this App of any help?

We appreciate a gesture of any size. In order to pay for our water, soda or beer as fuel to continue with the development.

## Bitcoin

1F7tRdARVhFSdj7Riw5c9AFiX7cDexfYa1

## Ethereum

0xc29F56Bf3f3978438dc714e83fdb57ea773ACa17
73 changes: 73 additions & 0 deletions build/android/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
FROM agileek/ionic-framework:3.19.1

RUN apt-get update -y
RUN apt-get install -y bzip2 build-essential
RUN apt-get install -y pkg-config libcairo2-dev
RUN apt-get install -y libjpeg-dev

# install fastlane
RUN gem install fastlane -NV

# android build tools version
RUN ["/opt/tools/android-accept-licenses.sh", "android update sdk --all --no-ui --filter build-tools-26.0.2,android-27"]

# create app directory
RUN mkdir /app
WORKDIR /app

# install npm 5.7.0 to fix https://github.com/npm/npm/issues/19356
RUN npm install -g [email protected]

# install ionic
RUN npm install -g [email protected]

# Install app dependencies, using wildcard if package-lock exists
COPY package.json /app/package.json
COPY package-lock.json /app/package-lock.json

# copy deploy keys for pull-access
RUN mkdir -p /root/.ssh

COPY airgap_cordova_secure_storage_deploy /root/.ssh/id_rsa
COPY airgap_cordova_secure_storage_deploy.pub /root/.ssh/id_rsa.pub

RUN chmod 700 /root/.ssh/id_rsa

RUN echo "Host gitlab.papers.tech\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config

# install dependencies
RUN npm install --no-optional

# copy config.xml, ionic configs and resources to allow plugin installation
COPY config.xml /app/config.xml
COPY ionic.config.json /app/ionic.config.json
COPY ./resources /app/resources

RUN mkdir www

# run ionic android build
RUN ionic info

# removing cordova-plugin-airgap-secure-storage from package.json due to https://issues.apache.org/jira/browse/CB-13507
RUN sed -i '/cordova-plugin-airgap-secure-storage/d' ./package.json

# add android platform
RUN ionic cordova platforms add android

# Bundle app source
COPY . /app

# set version code
ARG BUILD_NR
RUN sed -i -e "s/android-versionCode=\"1\"/android-versionCode=\"$BUILD_NR\"/g" config.xml

# build apk
RUN ionic cordova build android --prod --release --no-interactive

# copy release-apk
RUN cp /app/platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk android-release-unsigned.apk

RUN cp android-release-unsigned.apk android-debug.apk

# sign using debug key
RUN jarsigner -verbose -keystore ./build/android/debug.keystore -storepass android -keypass android android-debug.apk androiddebugkey
Binary file added build/android/debug.keystore
Binary file not shown.
Loading

0 comments on commit 168a3c4

Please sign in to comment.