Skip to content

Commit

Permalink
Merge pull request #96 from dappforce/deploy/dot-seller
Browse files Browse the repository at this point in the history
Add domain dot seller
  • Loading branch information
olehmell committed Oct 5, 2023
2 parents bcf1822 + 27f6dc8 commit 1045dec
Show file tree
Hide file tree
Showing 74 changed files with 2,558 additions and 518 deletions.
8 changes: 6 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
---

name: 🐛 Bug Report
about: Template for reporting bugs
title: '<title>'
labels: bug
assignees: ''

---

<!--
Note: Please search to see if an issue already exists for the bug you encountered.
-->

### Current Behavior:

<!-- A concise description of what you're experiencing. -->

### Expected Behavior:

<!-- A concise description of what you expected to happen. -->

### Steps To Reproduce:

<!--
Example: steps to reproduce the behavior:
1. In this environment...
Expand All @@ -28,6 +29,7 @@ Example: steps to reproduce the behavior:
-->

## Environment

<!-- What is the environment that the bug happens?
Example:
- OS: Ubuntu 20.04
Expand All @@ -36,12 +38,14 @@ Example:
-->

## ✔️ Possible solutions

<!-- (This section is optional.)
Any hint on how to solve the issue?
What parts of the code will be affected?
-->

### Anything else:

<!--
Links? References? Anything that will give us more context about the issue that you are encountering!
-->
10 changes: 7 additions & 3 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
---
name: ✨ Feature request
about: Template for requesting new features
title: "<title>"
title: '<title>'
labels: enhancement
assignees: ""
assignees: ''
---

## 📚 Context

<!--
What is the problem that you are trying to solve?
Why is this problem relevant?
-->

## ✔️ Solution

<!--
(This section and the ones below are optional.)
What are the possible solutions?
If there are multiple, what are the benefits and drawbacks of each one?
-->

## 📈 Subtasks

<!--
- [ ] If there is a solution, what are the subtasks for completing this issue?
-->

## 🎯 Definition of Done

<!--
- [ ] If there is a solution, what are the final deliverables?
-->
-->
14 changes: 7 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: 'github-actions'
directory: '/'
reviewers:
- "oap75"
- "olehmell"
- 'oap75'
- 'olehmell'
schedule:
interval: "weekly"
interval: 'weekly'
commit-message:
prefix: "dependabot"
prefix: 'dependabot'
pull-request-branch-name:
separator: "/"
separator: '/'
2 changes: 2 additions & 0 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ jobs:
GH_AMP_ID=2eeca0e8a0163c89e3f023c971e426a6
GH_OFFCHAIN_SIGNER_URL=https://signer.subsocial.network
GH_CONNECTION_KIND=main
GH_SELLER_CLIENT_ID=${{ secrets.SELLER_CLIENT_ID }}
GH_SELLER_TOKEN_SIGNER=${{ secrets.SELLER_TOKEN_SIGNER }}
tags: |
${{ env.image }}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/feature-based.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ jobs:
GH_HCAPTCHA_SITE_KEY=3beeddac-2dce-41cc-8e18-338118426c38
GH_AMP_ID=71bf5a46800fedba5e9a01243b988164
GH_OFFCHAIN_SIGNER_URL=https://signer.subsocial.network
GH_CONNECTION_KIND=dev
GH_CONNECTION_KIND=main
GH_SELLER_CLIENT_ID=${{ secrets.SELLER_CLIENT_ID }}
GH_SELLER_TOKEN_SIGNER=${{ secrets.SELLER_TOKEN_SIGNER }}
tags: |
${{ env.image }}
cache-from: type=local,src=/tmp/.buildx-cache
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ typings/
.yarn-integrity

# dotenv environment variables file
.env*.local
.env
public/env.js

Expand Down
2 changes: 1 addition & 1 deletion NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ This program is free software: you can redistribute it and/or modify it under th

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License at https://github.com/dappforce/polkaverse/blob/main/LICENSE for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cd polkaverse
Create an `.env` file with settings that allow the app to connect to Subsocial's infrastructure:

```sh
cp dev.env .env
cp dev.env .env.local
```

Install project dependencies:
Expand Down
25 changes: 11 additions & 14 deletions ci.env
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
LOG_LEVEL=info
APP_KIND=subsocial
CONNECTION_KIND='$GH_CONNECTION_KIND'
SUBSTRATE_URL='$GH_SUBSTRATE_URL'
SUBSTRATE_RPC_URL='$GH_SUBSTRATE_RPC_URL'
OFFCHAIN_URL='$GH_OFFCHAIN_URL'
OFFCHAIN_WS='$GH_OFFCHAIN_WS'
IPFS_NODE_URL='$GH_IPFS_NODE_URL'
GA_ID='$GH_GA_ID'
APP_KIND='$GH_APP_KIND'
APP_BASE_URL='$GH_APP_BASE_URL'
HCAPTCHA_SITE_KEY='$GH_HCAPTCHA_SITE_KEY'
OFFCHAIN_SIGNER_URL='$GH_OFFCHAIN_SIGNER_URL'
AMP_ID='$GH_AMP_ID'
NEXT_PUBLIC_LOG_LEVEL=info
NEXT_PUBLIC_APP_KIND=subsocial
NEXT_PUBLIC_CONNECTION_KIND='$GH_CONNECTION_KIND'
NEXT_PUBLIC_GA_ID='$GH_GA_ID'
NEXT_PUBLIC_APP_KIND='$GH_APP_KIND'
NEXT_PUBLIC_APP_BASE_URL='$GH_APP_BASE_URL'
NEXT_PUBLIC_HCAPTCHA_SITE_KEY='$GH_HCAPTCHA_SITE_KEY'
NEXT_PUBLIC_OFFCHAIN_SIGNER_URL='$GH_OFFCHAIN_SIGNER_URL'
NEXT_PUBLIC_AMP_ID='$GH_AMP_ID'
SELLER_CLIENT_ID='$GH_SELLER_CLIENT_ID'
SELLER_CLIENT_TOKEN_SIGNER='$GH_SELLER_TOKEN_SIGNER'
2 changes: 1 addition & 1 deletion deployment/hpa/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
name: memory
target:
type: Utilization
averageUtilization: 90
averageUtilization: 90
- type: Resource
resource:
name: cpu
Expand Down
51 changes: 27 additions & 24 deletions dev.env
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
# Logger level
LOG_LEVEL=debug
NEXT_PUBLIC_LOG_LEVEL=debug

# App kind: 'polkaverse' | 'staging'
APP_KIND=polkaverse
NEXT_PUBLIC_APP_KIND=polkaverse

# Connection kind:
# 'local' - For development in localhost infrastructure (local Substrate, IPFS, etc.)
# 'dev' - For development in betanet/mainnet infrastructure.
# 'staging' - For development in staging infrastructure.
# 'main' - If running this web app on a production server.
CONNECTION_KIND=dev
NEXT_PUBLIC_CONNECTION_KIND=staging

SELLER_CLIENT_ID=''
SELLER_CLIENT_TOKEN_SIGNER=''

# Id for Google Analytics
# GA_ID=
# NEXT_PUBLIC_GA_ID=

# ENABLE_MAINTENANCE_PAGE=true
# MAINTENANCE_TEXT=''
# NEXT_PUBLIC_ENABLE_MAINTENANCE_PAGE=true
# NEXT_PUBLIC_MAINTENANCE_TEXT=''

# SUBSTRATE_URL=
# SUBSTRATE_RPC_URL=
# OFFCHAIN_URL=
# OFFCHAIN_WS=
# GRAPHQL_URL=
# IPFS_NODE_URL=
# NEXT_PUBLIC_SUBSTRATE_URL=
# NEXT_PUBLIC_SUBSTRATE_RPC_URL=
# NEXT_PUBLIC_OFFCHAIN_URL=
# NEXT_PUBLIC_OFFCHAIN_WS=
# NEXT_PUBLIC_GRAPHQL_URL=
# NEXT_PUBLIC_IPFS_NODE_URL=

# UI settings overwrite
# ENABLE_SEARCH=true
# ENABLE_FEED=true
# ENABLE_NOTIFICATIONS=true
# ENABLE_ACTIVITY=true
# ENABLE_SESSION_KEY=true
# ENABLE_EMAIL_SETTINGS=true
# ENABLE_FAUCET=true
# ENABLE_DOWNVOTES=true
# ENABLE_GRAPHQL=true
# ENABLE_CONTRIBUTION_PAGE=true
# ENABLE_ONCHAIN_ACTIVITIES=true
# ENABLE_SQUID_DATA_SOURCE=true
# NEXT_PUBLIC_ENABLE_SEARCH=true
# NEXT_PUBLIC_ENABLE_FEED=true
# NEXT_PUBLIC_ENABLE_NOTIFICATIONS=true
# NEXT_PUBLIC_ENABLE_ACTIVITY=true
# NEXT_PUBLIC_ENABLE_SESSION_KEY=true
# NEXT_PUBLIC_ENABLE_EMAIL_SETTINGS=true
# NEXT_PUBLIC_ENABLE_FAUCET=true
# NEXT_PUBLIC_ENABLE_DOWNVOTES=true
# NEXT_PUBLIC_ENABLE_GRAPHQL=true
# NEXT_PUBLIC_ENABLE_CONTRIBUTION_PAGE=true
# NEXT_PUBLIC_ENABLE_ONCHAIN_ACTIVITIES=true
# NEXT_PUBLIC_ENABLE_SQUID_DATA_SOURCE=true
63 changes: 24 additions & 39 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
FROM dappforce/subsocial-base-polkaverse as builder

ARG GH_SUBSTRATE_URL
ARG GH_SUBSTRATE_RPC_URL
ARG GH_OFFCHAIN_URL
ARG GH_OFFCHAIN_WS
ARG GH_IPFS_NODE_URL
ARG GH_GA_ID
ARG GH_CONNECTION_KIND
ARG GH_APP_KIND
ARG GH_APP_BASE_URL
ARG GH_HCAPTCHA_SITE_KEY
ARG GH_AMP_ID
ARG GH_OFFCHAIN_SIGNER_URL

ENV SUBSTRATE_URL=${GH_SUBSTRATE_URL} \
SUBSTRATE_RPC_URL=${GH_SUBSTRATE_RPC_URL} \
OFFCHAIN_URL=${GH_OFFCHAIN_URL} \
OFFCHAIN_WS=${GH_OFFCHAIN_WS} \
IPFS_NODE_URL=${GH_IPFS_NODE_URL} \
GA_ID=${GH_GA_ID} \
APP_KIND=${GH_APP_KIND} \
APP_BASE_URL=${GH_APP_BASE_URL} \
HCAPTCHA_SITE_KEY=${GH_HCAPTCHA_SITE_KEY} \
AMP_ID=${GH_AMP_ID} \
OFFCHAIN_SIGNER_URL=${GH_OFFCHAIN_SIGNER_URL} \
CONNECTION_KIND=${GH_CONNECTION_KIND}
ARG GH_SELLER_CLIENT_ID
ARG GH_SELLER_TOKEN_SIGNER

ENV NEXT_PUBLIC_GA_ID=${GH_GA_ID} \
NEXT_PUBLIC_APP_KIND=${GH_APP_KIND} \
NEXT_PUBLIC_APP_BASE_URL=${GH_APP_BASE_URL} \
NEXT_PUBLIC_HCAPTCHA_SITE_KEY=${GH_HCAPTCHA_SITE_KEY} \
NEXT_PUBLIC_AMP_ID=${GH_AMP_ID} \
NEXT_PUBLIC_OFFCHAIN_SIGNER_URL=${GH_OFFCHAIN_SIGNER_URL} \
NEXT_PUBLIC_CONNECTION_KIND=${GH_CONNECTION_KIND} \
SELLER_CLIENT_ID=${GH_SELLER_CLIENT_ID} \
SELLER_CLIENT_TOKEN_SIGNER=${GH_SELLER_TOKEN_SIGNER}

COPY package.json yarn.lock* ./
RUN yarn install --no-optional
Expand All @@ -35,37 +29,28 @@ COPY . .
RUN yarn

COPY ci.env .env
RUN yarn export-env \
&& NODE_ENV=production yarn build \
&& yarn export-env \
&& yarn patch
RUN NODE_ENV=production yarn build

FROM gcr.io/distroless/nodejs:16 AS runner

ARG GH_SUBSTRATE_URL
ARG GH_SUBSTRATE_RPC_URL
ARG GH_OFFCHAIN_URL
ARG GH_OFFCHAIN_WS
ARG GH_IPFS_NODE_URL
ARG GH_GA_ID
ARG GH_CONNECTION_KIND
ARG GH_APP_KIND
ARG GH_APP_BASE_URL
ARG GH_HCAPTCHA_SITE_KEY
ARG GH_AMP_ID
ARG GH_OFFCHAIN_SIGNER_URL

ENV SUBSTRATE_URL=${GH_SUBSTRATE_URL} \
SUBSTRATE_RPC_URL=${GH_SUBSTRATE_RPC_URL} \
OFFCHAIN_URL=${GH_OFFCHAIN_URL} \
OFFCHAIN_WS=${GH_OFFCHAIN_WS} \
IPFS_NODE_URL=${GH_IPFS_NODE_URL} \
GA_ID=${GH_GA_ID} \
APP_KIND=${GH_APP_KIND} \
APP_BASE_URL=${GH_APP_BASE_URL} \
AMP_ID=${GH_AMP_ID} \
OFFCHAIN_SIGNER_URL=${GH_OFFCHAIN_SIGNER_URL} \
CONNECTION_KIND=${GH_CONNECTION_KIND}
ARG GH_SELLER_CLIENT_ID
ARG GH_SELLER_TOKEN_SIGNER

ENV NEXT_PUBLIC_GA_ID=${GH_GA_ID} \
NEXT_PUBLIC_APP_KIND=${GH_APP_KIND} \
NEXT_PUBLIC_APP_BASE_URL=${GH_APP_BASE_URL} \
NEXT_PUBLIC_AMP_ID=${GH_AMP_ID} \
NEXT_PUBLIC_OFFCHAIN_SIGNER_URL=${GH_OFFCHAIN_SIGNER_URL} \
NEXT_PUBLIC_CONNECTION_KIND=${GH_CONNECTION_KIND} \
SELLER_CLIENT_ID=${GH_SELLER_CLIENT_ID} \
SELLER_CLIENT_TOKEN_SIGNER=${GH_SELLER_TOKEN_SIGNER}

WORKDIR /opt/subsocial/app

Expand Down
14 changes: 7 additions & 7 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
const path = require('path')
const Dotenv = require('dotenv-webpack')
// const path = require('path')
// const Dotenv = require('dotenv-webpack')

// Required by Docker
require('dotenv').config()
Expand Down Expand Up @@ -31,11 +31,11 @@ const nextConfig = {
config.plugins = [
...config.plugins,

// Read the .env file
new Dotenv({
path: path.join(__dirname, '.env'),
systemvars: true, // Required by Docker
}),
// // Read the .env file
// new Dotenv({
// path: path.join(__dirname, '.env'),
// systemvars: true, // Required by Docker
// }),
]

config.module.rules.push(
Expand Down
Loading

0 comments on commit 1045dec

Please sign in to comment.