-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from airgap-it/feat/beacon-v2
Feat/beacon v2
- Loading branch information
Showing
61 changed files
with
9,592 additions
and
7,071 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,43 @@ | ||
#------------------------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. | ||
#------------------------------------------------------------------------------------------------------------- | ||
|
||
FROM node:12 | ||
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.148.1/containers/typescript-node/.devcontainer/base.Dockerfile | ||
|
||
# Avoid warnings by switching to noninteractive | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
# [Choice] Node.js version: 14, 12, 10 | ||
ARG VARIANT="14-buster" | ||
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT} | ||
|
||
# Configure apt and install packages | ||
RUN apt-get update \ | ||
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \ | ||
# | ||
# Verify git and needed tools are installed | ||
&& apt-get -y install git iproute2 procps \ | ||
# | ||
# Install zsh | ||
# [Optional] Uncomment this section to install additional OS packages. | ||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
# && apt-get -y install --no-install-recommends <your-package-list-here> | ||
|
||
RUN apt-get update \ | ||
&& 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 zsh \ | ||
&& wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true \ | ||
# | ||
# Install ionic | ||
&& npm install -g ionic \ | ||
# install libraries | ||
&& apt-get install -yyq libappindicator1 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 libnss3 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 \ | ||
# tools | ||
&& apt-get install -yyq gconf-service lsb-release wget xdg-utils \ | ||
# and fonts | ||
&& apt-get install -yyq fonts-liberation \ | ||
# We install Chrome to get all the OS level dependencies, but Chrome itself | ||
# is not actually used as it's packaged in the node puppeteer library. | ||
# Alternatively, we could could include the entire dep list ourselves | ||
# (https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#chrome-headless-doesnt-launch-on-unix) | ||
# but that seems too easy to get out of date. | ||
&& apt-get install -y google-chrome-stable \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& wget --quiet https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -O /usr/sbin/wait-for-it.sh \ | ||
&& chmod +x /usr/sbin/wait-for-it.sh \ | ||
# | ||
# Clean up | ||
&& apt-get autoremove -y \ | ||
&& apt-get clean -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# [Optional] Uncomment if you want to install an additional version of node using nvm | ||
# ARG EXTRA_NODE_VERSION=10 | ||
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}" | ||
|
||
# Switch back to dialog for any ad-hoc use of apt-get | ||
ENV DEBIAN_FRONTEND=dialog | ||
# [Optional] Uncomment if you want to install more global node packages | ||
# RUN sudo -u node npm install -g <your-package-list -here> | ||
RUN sudo -u node npm install -g @ionic/cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,31 @@ | ||
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or the definition README at | ||
// https://github.com/microsoft/vscode-dev-containers/tree/master/containers/javascript-node-12 | ||
{ | ||
"name": "Node.js 12 - Ionic", | ||
"dockerFile": "Dockerfile", | ||
// | ||
// Use 'settings' to set *default* container specific settings.json values on container create. | ||
// You can edit these settings after create using File > Preferences > Settings > Remote. | ||
"name": "Node.js & TypeScript", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
// Update 'VARIANT' to pick a Node version: 10, 12, 14 | ||
"args": { "VARIANT": "14" } | ||
}, | ||
|
||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/zsh" | ||
}, | ||
// | ||
// Use 'appPort' to create a container with published ports. If the port isn't working, be sure | ||
// your server accepts connections from all interfaces (0.0.0.0 or '*'), not just localhost. | ||
"appPort": ["8103:8100"], | ||
// | ||
// Uncomment the next line to run commands after the container is created. | ||
// "postCreateCommand": "yarn install", | ||
// | ||
// Uncomment the next line to have VS Code connect as an existing non-root user in the container. | ||
// On Linux, by default, the container user's UID/GID will be updated to match your local user. See | ||
// https://aka.ms/vscode-remote/containers/non-root for details on adding a non-root user if none exist. | ||
// "remoteUser": "node", | ||
// | ||
// Add the IDs of extensions you want installed when the container is created in the array below. | ||
|
||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"dbaeumer.vscode-eslint", | ||
// TSLint is included for backwards compatibility, but is deprecated. | ||
// See https://github.com/palantir/tslint/issues/4534 | ||
"ms-vscode.vscode-typescript-tslint-plugin", | ||
"esbenp.prettier-vscode" | ||
] | ||
"angular.ng-template", | ||
"esbenp.prettier-vscode", | ||
"eamodio.gitlens" | ||
], | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "yarn install", | ||
|
||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "node" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Build | ||
|
||
on: push | ||
|
||
jobs: | ||
build_angular: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache node modules | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Node 14 | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14.x | ||
|
||
- name: Prepare | ||
run: npm ci | ||
|
||
# - name: Prettier | ||
# run: npm run actions:prettier | ||
|
||
- name: Build | ||
run: npm run build:prod | ||
|
||
# - name: Unit Tests | ||
# run: npm test -- --configuration=ci | ||
|
||
# - name: E2E Tests | ||
# run: npm run e2e -- --configuration=ci | ||
|
||
- name: Upload | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: beacon-extension | ||
path: www |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ | |
{ | ||
"type": "initial", | ||
"maximumWarning": "2mb", | ||
"maximumError": "12mb" | ||
"maximumError": "18mb" | ||
} | ||
] | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
FROM beevelop/ionic:v5.2.3 | ||
|
||
RUN apt-get update -y && apt-get install -y \ | ||
bzip2 \ | ||
build-essential \ | ||
pkg-config \ | ||
libjpeg-dev \ | ||
libcairo2-dev | ||
|
||
# create app directory | ||
RUN mkdir /app | ||
WORKDIR /app | ||
|
||
# using npm 6.5.0 to fix installing certain cordova/ionic plugins | ||
RUN npm install -g npm@6.5.0 @ionic/cli | ||
RUN npm cache clean -f | ||
RUN npm install -g n | ||
RUN n 10.14.1 | ||
|
||
# Install app dependencies, using wildcard if package-lock exists | ||
COPY package.json /app/package.json | ||
COPY package-lock.json /app/package-lock.json | ||
|
||
# install dependencies | ||
RUN npm ci | ||
|
||
RUN mkdir www | ||
|
||
# Bundle app source | ||
COPY . /app | ||
|
||
# post-install hook, to be safe if it got cached | ||
RUN node scripts/patch-crypto.js | ||
RUN ls | ||
|
||
# set version code | ||
ARG VERSION | ||
ARG CI_PIPELINE_ID | ||
RUN sed -i -e "s/VERSION_NUMBER/$VERSION/g" src/app/services/app-info/app-info.service.ts | ||
RUN sed -i -e "s/VERSION_CODE/$CI_PIPELINE_ID/g" src/app/services/app-info/app-info.service.ts | ||
# RUN sed -i -e "/\"version\"/c\ \"version\" :\"$VERSION\"," src/manifest.json | ||
|
||
# fix crypto libraries | ||
RUN npm run postinstall | ||
|
||
# build ionic | ||
RUN npm run build:prod |
Oops, something went wrong.