Skip to content

Commit

Permalink
Merge pull request #13 from dharamveergit/main
Browse files Browse the repository at this point in the history
envs
  • Loading branch information
dharamveergit authored Sep 20, 2024
2 parents 166016f + 368b22a commit cc5beed
Show file tree
Hide file tree
Showing 40 changed files with 3,752 additions and 13,343 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-build-deploy-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
- name: Build the Docker image
if: steps.filter.outputs.deploy-web == 'true'
run: npm run dc:build -- deploy-web
run: npm run dc:build -- --build-arg DEPLOYMENT_ENV=production deploy-web
2 changes: 1 addition & 1 deletion apps/api/env/.env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ SENTRY_TRACES_RATE=1.0
SENTRY_ENABLED=true
BILLING_ENABLED=true
STRIPE_PRICE_ID=price_1Ps0Y0Csz6Fy2xVWVy8GMTA9
STRIPE_CHECKOUT_REDIRECT_URL=https://beta.cloudmos.io
STRIPE_CHECKOUT_REDIRECT_URL=https://console-beta.akash.network
33 changes: 33 additions & 0 deletions apps/api/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# nginx.conf

events {
}

http {
server {
# Redirect HTTP requests to HTTPS.
listen 80;
return 307 https://$host$request_uri;
}

server {
listen 443 ssl;

server_tokens off;

ssl_certificate /etc/nginx/ssl/my_ssl_cert.crt;
ssl_certificate_key /etc/nginx/ssl/my_ssl_key.key;

location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://127.0.0.1:3000;
proxy_buffers 8 16k;
proxy_buffer_size 16k;
proxy_cookie_path / "/; HTTPOnly; Secure";
}
}
}
2 changes: 1 addition & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "console-api",
"version": "2.23.0",
"version": "2.23.2",
"description": "Api providing data to the deploy tool",
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { DepositDeploymentAuthorization } from "@akashnetwork/akash-api/v1beta3"
import { MsgRevoke } from "cosmjs-types/cosmos/authz/v1beta1/tx";
import { BasicAllowance } from "cosmjs-types/cosmos/feegrant/v1beta1/feegrant";
import { MsgGrantAllowance } from "cosmjs-types/cosmos/feegrant/v1beta1/tx";
import addYears from "date-fns/addYears";
import { singleton } from "tsyringe";

export interface SpendingAuthorizationMsgOptions {
Expand Down Expand Up @@ -43,7 +44,7 @@ export class RpcMessageService {
};
}

getDepositDeploymentGrantMsg({ denom, limit, expiration, granter, grantee }: SpendingAuthorizationMsgOptions) {
getDepositDeploymentGrantMsg({ denom, limit, expiration = addYears(new Date(), 10), granter, grantee }: SpendingAuthorizationMsgOptions) {
return {
typeUrl: "/cosmos.authz.v1beta1.MsgGrant",
value: {
Expand Down
6 changes: 5 additions & 1 deletion apps/deploy-web/env/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
AUTH0_AUDIENCE=https://api.cloudmos.io
AUTH0_SCOPE=openid profile email offline_access
AUTH0_SCOPE=openid profile email offline_access

NEXT_PUBLIC_SENTRY_DSN="https://[email protected]/4504656428204032"
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID="2b2b3e1d953d33bd3b3e2c864edd2dea"
NEXT_PUBLIC_SENTRY_APPLICATION_KEY="AKASH-CONSOLE-WEB"
5 changes: 4 additions & 1 deletion apps/deploy-web/env/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_BASE_API_MAINNET_URL

BASE_API_MAINNET_URL=$NEXT_PUBLIC_BASE_API_MAINNET_URL
BASE_API_TESTNET_URL=$NEXT_PUBLIC_BASE_API_TESTNET_URL
BASE_API_SANDBOX_URL=$NEXT_PUBLIC_BASE_API_SANDBOX_URL
BASE_API_SANDBOX_URL=$NEXT_PUBLIC_BASE_API_SANDBOX_URL

NEXT_PUBLIC_SENTRY_ENABLED="true"
NEXT_PUBLIC_GA_MEASUREMENT_ID="G-LFRGN2J2RV"
1 change: 1 addition & 0 deletions apps/deploy-web/env/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ NEXT_PUBLIC_BASE_API_MAINNET_URL=
NEXT_PUBLIC_BASE_API_SANDBOX_URL=
NEXT_PUBLIC_BASE_API_TESTNET_URL=
NEXT_PUBLIC_API_BASE_URL=
NEXT_PUBLIC_SENTRY_APPLICATION_KEY=
NEXT_PUBLIC_SENTRY_DSN=
NEXT_PUBLIC_SENTRY_SERVER_NAME=
NEXT_PUBLIC_GA_MEASUREMENT_ID=
Expand Down
4 changes: 3 additions & 1 deletion apps/deploy-web/env/.env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_BASE_API_MAINNET_URL

BASE_API_MAINNET_URL=$NEXT_PUBLIC_BASE_API_MAINNET_URL
BASE_API_TESTNET_URL=$NEXT_PUBLIC_BASE_API_TESTNET_URL
BASE_API_SANDBOX_URL=$NEXT_PUBLIC_BASE_API_SANDBOX_URL
BASE_API_SANDBOX_URL=$NEXT_PUBLIC_BASE_API_SANDBOX_URL

NEXT_PUBLIC_SENTRY_ENABLED="true"
5 changes: 4 additions & 1 deletion apps/deploy-web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ const sentryWebpackPluginOptions = {

silent: true, // Suppresses all logs,
dryRun: true,
release: require("./package.json").version
release: require("./package.json").version,
unstable_sentryWebpackPluginOptions: {
applicationKey: process.env.NEXT_PUBLIC_SENTRY_APPLICATION_KEY
}

// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options.
Expand Down
6 changes: 2 additions & 4 deletions apps/deploy-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "akash-console",
"version": "2.14.0",
"version": "2.15.0",
"private": true,
"description": "Web UI to deploy on the Akash Network and view statistic about network usage.",
"license": "Apache-2.0",
Expand Down Expand Up @@ -35,8 +35,6 @@
"@emotion/server": "^11.4.0",
"@emotion/styled": "^11.8.1",
"@hookform/resolvers": "^3.9.0",
"@leapwallet/elements": "^1.3.4",
"@leapwallet/name-matcha": "^1.7.1",
"@monaco-editor/react": "^4.6.0",
"@mui/icons-material": "^5.11.11",
"@mui/material": "^5.4.4",
Expand All @@ -47,7 +45,7 @@
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-slot": "^1.0.2",
"@react-spring/web": "^9.3.1",
"@sentry/nextjs": "^7.80.0",
"@sentry/nextjs": "^8.30.0",
"@stripe/react-stripe-js": "^1.12.0",
"@stripe/stripe-js": "^1.41.0",
"@tanstack/react-table": "^8.13.2",
Expand Down
2 changes: 1 addition & 1 deletion apps/deploy-web/public/sw.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/deploy-web/public/sw.js.map

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions apps/deploy-web/sentry.client.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ Sentry.init({
dsn: SENTRY_DSN,
// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 0.01,
serverName: process.env.NEXT_PUBLIC_SENTRY_SERVER_NAME,
enabled: process.env.NODE_ENV === "production"
enabled: process.env.NEXT_PUBLIC_SENTRY_ENABLED === "true",
integrations: [
Sentry.thirdPartyErrorFilterIntegration({
filterKeys: [process.env.NEXT_PUBLIC_SENTRY_APPLICATION_KEY],
behaviour: "drop-error-if-contains-third-party-frames"
})
]
// ...
// Note: if you want to override the automatic release value, do not set a
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
Expand Down
9 changes: 7 additions & 2 deletions apps/deploy-web/sentry.edge.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ Sentry.init({
dsn: SENTRY_DSN,
// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 0.01,
serverName: process.env.NEXT_PUBLIC_SENTRY_SERVER_NAME,
enabled: process.env.NODE_ENV === "production"
enabled: process.env.NEXT_PUBLIC_SENTRY_ENABLED === "true",
integrations: [
Sentry.thirdPartyErrorFilterIntegration({
filterKeys: [process.env.NEXT_PUBLIC_SENTRY_APPLICATION_KEY],
behaviour: "drop-error-if-contains-third-party-frames"
})
]
// ...
// Note: if you want to override the automatic release value, do not set a
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
Expand Down
9 changes: 7 additions & 2 deletions apps/deploy-web/sentry.server.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ Sentry.init({
dsn: SENTRY_DSN,
// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 0.01,
serverName: process.env.NEXT_PUBLIC_SENTRY_SERVER_NAME,
enabled: process.env.NODE_ENV === "production"
enabled: process.env.NEXT_PUBLIC_SENTRY_ENABLED === "true",
integrations: [
Sentry.thirdPartyErrorFilterIntegration({
filterKeys: [process.env.NEXT_PUBLIC_SENTRY_APPLICATION_KEY],
behaviour: "drop-error-if-contains-third-party-frames"
})
]
// ...
// Note: if you want to override the automatic release value, do not set a
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
Expand Down
30 changes: 4 additions & 26 deletions apps/deploy-web/src/components/get-started/GetStartedStepper.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
"use client";
import React, { useEffect, useState } from "react";
import { MdRestartAlt } from "react-icons/md";
import { Button, buttonVariants, CustomTooltip, Spinner } from "@akashnetwork/ui/components";
import { Button, buttonVariants, CustomTooltip } from "@akashnetwork/ui/components";
import Step from "@mui/material/Step";
import StepContent from "@mui/material/StepContent";
import StepLabel from "@mui/material/StepLabel";
import Stepper from "@mui/material/Stepper";
import { Check, HandCard, Rocket, WarningCircle, XmarkCircleSolid } from "iconoir-react";
import dynamic from "next/dynamic";
import Link from "next/link";

import { LoginRequiredLink } from "@src/components/user/LoginRequiredLink";
Expand All @@ -21,32 +20,11 @@ import { udenomToDenom } from "@src/utils/mathHelpers";
import { uaktToAKT } from "@src/utils/priceUtils";
import { cn } from "@src/utils/styleUtils";
import { UrlService } from "@src/utils/urlUtils";
import LiquidityModal from "../liquidity-modal";
import { ExternalLink } from "../shared/ExternalLink";
import { ConnectWalletButton } from "../wallet/ConnectWalletButton";
import { QontoConnector, QontoStepIcon } from "./Stepper";

const LiquidityModal = dynamic(
() =>
import("../liquidity-modal")
.then(m => {
console.log("done");
return m;
})
.catch(e => {
console.log("error loading liquidity modal", e);
throw e;
}),
{
ssr: false,
loading: () => (
<Button variant="default" disabled size="sm">
<Spinner size="small" className="mr-2" />
<span>Get More</span>
</Button>
)
}
);

export const GetStartedStepper: React.FunctionComponent = () => {
const [activeStep, setActiveStep] = useState(0);
const { isWalletConnected, address, isManaged: isManagedWallet, isTrialing } = useWallet();
Expand Down Expand Up @@ -173,7 +151,7 @@ export const GetStartedStepper: React.FunctionComponent = () => {
<CustomTooltip
title={
<>
If you don't have {minDeposit.akt} AKT or {minDeposit.usdc} USDC, you can request authorization for some tokens to get started on our{" "}
If you don&apos;t have {minDeposit.akt} AKT or {minDeposit.usdc} USDC, you can request authorization for some tokens to get started on our{" "}
<ExternalLink href="https://discord.gg/akash" text="Discord" />.
</>
}
Expand All @@ -190,7 +168,7 @@ export const GetStartedStepper: React.FunctionComponent = () => {
You have <strong>{aktBalance}</strong> AKT and <strong>{usdcBalance}</strong> USDC
</span>
)}
{!isManagedWallet && <LiquidityModal address={address} aktBalance={aktBalance} refreshBalances={refetchBalances} />}
{!isManagedWallet && isWalletConnected && <LiquidityModal address={address} aktBalance={aktBalance} refreshBalances={refetchBalances} />}
</div>
)}
</StepContent>
Expand Down
2 changes: 1 addition & 1 deletion apps/deploy-web/src/components/home/YourAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { usePricing } from "@src/context/PricingProvider";
import { useWallet } from "@src/context/WalletProvider";
import { useUsdcDenom } from "@src/hooks/useDenom";
import useTailwind from "@src/hooks/useTailwind";
import { WalletBalance, useWalletBalance } from "@src/hooks/useWalletBalance";
import { useWalletBalance,WalletBalance } from "@src/hooks/useWalletBalance";
import sdlStore from "@src/store/sdlStore";
import { DeploymentDto, LeaseDto } from "@src/types/deployment";
import { ApiProviderList } from "@src/types/provider";
Expand Down
2 changes: 1 addition & 1 deletion apps/deploy-web/src/components/layout/WalletStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import { ConnectManagedWalletButton } from "@src/components/wallet/ConnectManage
import { browserEnvConfig } from "@src/config/browser-env.config";
import { useWallet } from "@src/context/WalletProvider";
import { useLoginRequiredEventHandler } from "@src/hooks/useLoginRequiredEventHandler";
import { useManagedEscrowFaqModal } from "@src/hooks/useManagedEscrowFaqModal";
import { useWalletBalance } from "@src/hooks/useWalletBalance";
import { udenomToDenom } from "@src/utils/mathHelpers";
import { uaktToAKT } from "@src/utils/priceUtils";
import { UrlService } from "@src/utils/urlUtils";
import { FormattedDecimal } from "../shared/FormattedDecimal";
import { LinkTo } from "../shared/LinkTo";
import { ConnectWalletButton } from "../wallet/ConnectWalletButton";
import { useManagedEscrowFaqModal } from "@src/hooks/useManagedEscrowFaqModal";

const goToCheckout = () => {
window.location.href = "/api/proxy/v1/checkout";
Expand Down
Loading

0 comments on commit cc5beed

Please sign in to comment.