Skip to content

Commit

Permalink
Merge pull request #63 from AvadoDServer/0.1.89
Browse files Browse the repository at this point in the history
fix up wizard
  • Loading branch information
sponnet authored Apr 10, 2024
2 parents 6f39023 + 796088c commit 1df39c4
Show file tree
Hide file tree
Showing 39 changed files with 18,866 additions and 12,162 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ build_*
data
build/Dockerfile
releases.json
build/wizard_old
63 changes: 34 additions & 29 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 golang:1.20.3-bullseye as builder
FROM --platform=linux/amd64 golang:1.22.2-bookworm as builder

ARG VERSION
WORKDIR /
Expand All @@ -10,49 +10,54 @@ RUN mv avalanchego-$VERSION/* /app
RUN echo "contents of /app in builder"
#RUN ls -l /app

FROM --platform=linux/amd64 node:16-buster as build-deps-wallet
# FROM --platform=linux/amd64 node:16-buster as build-deps-wallet

RUN apt-get update && apt-get install -y openssl
# RUN apt-get update && apt-get install -y openssl

# Download initial SSL certs
RUN mkdir -p /etc/nginx/certs/
RUN wget -O /etc/nginx/certs/my.ava.do.crt http://iso.ava.do/my.ava.do.crt
RUN wget -O /etc/nginx/certs/my.ava.do.key http://iso.ava.do/my.ava.do.key
# # Download initial SSL certs
# RUN mkdir -p /etc/nginx/certs/
# RUN wget -O /etc/nginx/certs/my.ava.do.crt http://iso.ava.do/my.ava.do.crt
# RUN wget -O /etc/nginx/certs/my.ava.do.key http://iso.ava.do/my.ava.do.key

# # build wallet UI
# WORKDIR /usr/src/app/wallet
# RUN npm -v
# RUN git clone https://github.com/ava-labs/avalanche-wallet.git
# RUN cd avalanche-wallet
# WORKDIR /usr/src/app/wallet/avalanche-wallet
# RUN yarn install

# build wallet UI
WORKDIR /usr/src/app/wallet
RUN npm -v
RUN git clone https://github.com/ava-labs/avalanche-wallet.git
RUN cd avalanche-wallet
WORKDIR /usr/src/app/wallet/avalanche-wallet
RUN yarn install
# # Patch the endpoint to that it connects to AVADO by default
# COPY files/wallet.patch .
# RUN git apply wallet.patch

# Patch the endpoint to that it connects to AVADO by default
COPY files/wallet.patch .
RUN git apply wallet.patch
# RUN cat src/store/modules/network/network.ts

RUN cat src/store/modules/network/network.ts
# RUN yarn build

RUN yarn build
FROM --platform=linux/amd64 node:18 as build-deps

FROM --platform=linux/amd64 node:15.14.0-buster as build-deps-wizard
# RUN apt-get update && apt-get install -y openssl

# build wallet UI
# Download initial SSL certs
RUN mkdir -p /etc/nginx/certs/
RUN wget -O /etc/nginx/certs/my.ava.do.crt http://iso.ava.do/my.ava.do.crt
RUN wget -O /etc/nginx/certs/my.ava.do.key http://iso.ava.do/my.ava.do.key

# build wizard
WORKDIR /usr/src/app/wizard
COPY wizard .
RUN yarn
RUN yarn build

RUN npm i
RUN npm run build

# Build final image
FROM --platform=linux/amd64 golang:1.20.3-bullseye
FROM --platform=linux/amd64 golang:1.22.2-bookworm

USER root

# Copy wallet UI
COPY --from=builder /app /usr/local/app
COPY --from=build-deps-wallet /usr/src/app/wallet/avalanche-wallet/dist /usr/local/wallet
COPY --from=build-deps-wizard /usr/src/app/wizard/build /usr/local/wizard
# COPY --from=build-deps-wallet /usr/src/app/wallet/avalanche-wallet/dist /usr/local/wallet
COPY --from=build-deps /usr/src/app/wizard/build /usr/local/wizard

RUN chmod +x /usr/local/app/avalanchego

Expand All @@ -65,7 +70,7 @@ COPY files/dlcerts.sh /bin/dlcerts
RUN chmod +x /bin/dlcerts
COPY files/nginx.conf /etc/nginx/
RUN mkdir -p /etc/nginx/certs/
COPY --from=build-deps-wallet /etc/nginx/certs/* /etc/nginx/certs/
COPY --from=build-deps /etc/nginx/certs/* /etc/nginx/certs/

# copy config files
COPY files/config /config
Expand Down
66 changes: 33 additions & 33 deletions build/files/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,39 @@ http {
gzip_disable "MSIE [1-6]\.(?!.*SV1)";


server {
listen 443 ssl;
ssl_certificate /etc/nginx/certs/my.ava.do.crt;
ssl_certificate_key /etc/nginx/certs/my.ava.do.key;

add_header Strict-Transport-Security "max-age=0";

location /api/price {
proxy_ssl_server_name on;
proxy_set_header Host wallet.avax.network;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host-Real-IP $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_hide_header Strict-Transport-Security;
proxy_headers_hash_max_size 512;
proxy_headers_hash_bucket_size 128;
proxy_pass https://wallet.avax.network;
proxy_read_timeout 90;
}

location / {
root /usr/local/wallet;
index index.html index.htm;
try_files $uri /index.html =404;
}

# Don't cache the homepage
location = /index.html {
internal;
add_header Cache-Control 'no-cache, no-store, must-revalidate';
}
# server {
# listen 443 ssl;
# ssl_certificate /etc/nginx/certs/my.ava.do.crt;
# ssl_certificate_key /etc/nginx/certs/my.ava.do.key;

# add_header Strict-Transport-Security "max-age=0";

# location /api/price {
# proxy_ssl_server_name on;
# proxy_set_header Host wallet.avax.network;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto $scheme;
# proxy_set_header Host-Real-IP $http_host;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_hide_header Strict-Transport-Security;
# proxy_headers_hash_max_size 512;
# proxy_headers_hash_bucket_size 128;
# proxy_pass https://wallet.avax.network;
# proxy_read_timeout 90;
# }

# location / {
# root /usr/local/wallet;
# index index.html index.htm;
# try_files $uri /index.html =404;
# }

# # Don't cache the homepage
# location = /index.html {
# internal;
# add_header Cache-Control 'no-cache, no-store, must-revalidate';
# }

}

Expand Down
2 changes: 1 addition & 1 deletion build/files/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

[program:main]
command=/usr/local/app/avalanchego --network-peer-list-num-validator-ips=10 --network-peer-list-validator-gossip-size=10 --network-peer-list-non-validator-gossip-size=10 --http-host=0.0.0.0 --http-tls-enabled=true --http-tls-cert-file=/etc/nginx/certs/my.ava.do.crt --http-tls-key-file=/etc/nginx/certs/my.ava.do.key --public-ip-resolution-service=opendns --chain-config-dir=/config --http-allowed-hosts="*"
command=/usr/local/app/avalanchego --network-peer-list-num-validator-ips=10 --http-host=0.0.0.0 --http-tls-enabled=true --http-tls-cert-file=/etc/nginx/certs/my.ava.do.crt --http-tls-key-file=/etc/nginx/certs/my.ava.do.key --public-ip-resolution-service=opendns --chain-config-dir=/config --http-allowed-hosts="*"
autostart=false
autorestart=true
stdout_logfile=/dev/fd/1
Expand Down
70 changes: 70 additions & 0 deletions build/wizard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

The page will reload when you make changes.\
You may also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can't go back!**

If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.

You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)

### Analyzing the Bundle Size

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)

### Making a Progressive Web App

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)

### Advanced Configuration

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)

### Deployment

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)

### `npm run build` fails to minify

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
Loading

0 comments on commit 1df39c4

Please sign in to comment.