From 64f8bc67dd6de781fa6d6b8bbf22edacca61d305 Mon Sep 17 00:00:00 2001 From: Ivan Simatupang <31027300+iv1310@users.noreply.github.com> Date: Mon, 18 Mar 2024 22:08:58 +0700 Subject: [PATCH 1/5] Update README.md --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index 5013ea38b..bf98aef17 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,43 @@ PolkaVerse is a niche social site built on the Subsocial network. It focuses on Visit Subsocial's [website](https://subsocial.network) to learn more about the project. +## Guide to build and deploy polkaverse + +1. Prepare the dockerfile and adjust the config if needed. +2. Build the image in local with this command and please ensure to add build argument. +```bash +$ docker build --build-arg GH_GA_ID=valueREDACTED --build-arg GH_APP_KIND=valueREDACTED --build-arg GH_HCAPTCHA_SITE_KEY=valueREDACTED --build-arg GH_AMP_ID=valueREDACTED --build-arg GH_OFFCHAIN_SIGNER_URL=valueREDACTED --build-arg GH_CONNECTION_KIND=valueREDACTED --build-arg GH_SELLER_CLIENT_ID=valueREDACTED --build-arg GH_SERVER_MNEMONIC==valueREDACTED --build-arg GH_SELLER_TOKEN_SIGNER=valueREDACTED --build-arg GH_NEXT_PUBLIC_DATAHUB_QUERY_URL=valueREDACTED --build-arg GH_NEXT_PUBLIC_DATAHUB_SUBSCRIPTION_URL=valueREDACTED --build-arg GH_DATAHUB_QUEUE_URL=valueREDACTED --build-arg GH_DATAHUB_QUEUE_TOKEN=valueREDACTED -t polkaverse-docker-image:v1.0.0 . +``` +Notes: +Please execute the build process with theses build arguments, you need to specify the value. +* [x] GH_GA_ID=valueREDACTED +* [x] GH_APP_KIND=valueREDACTED +* [x] GH_HCAPTCHA_SITE_KEY=valueREDACTED +* [x] GH_AMP_ID=valueREDACTED +* [x] GH_OFFCHAIN_SIGNER_URL=valueREDACTED +* [x] GH_CONNECTION_KIND=valueREDACTED +* [x] GH_SELLER_CLIENT_ID=valueREDACTED +* [x] GH_SELLER_TOKEN_SIGNER=valueREDACTED +* [x] GH_SERVER_MNEMONIC=valueREDACTED +* [x] GH_NEXT_PUBLIC_DATAHUB_QUERY_URL=valueREDACTED +* [x] GH_NEXT_PUBLIC_DATAHUB_SUBSCRIPTION_URL=valueREDACTED +* [x] GH_DATAHUB_QUEUE_URL=valueREDACTED +* [x] GH_DATAHUB_QUEUE_TOKEN=valueREDACTED +3. Then check the docker images that has been builded. +```bash +$ docker images +``` +4. To run the docker images with docker-compose, please prepare the docker-compose.yaml config file at first. +```bash +$ docker-compose -f docker-compose.yaml up -d +``` +5. Check the running container with this command. +```bash +$ docker-compose ps +$ docker-compose logs +``` + + ## Run locally Clone this repo: From 7ec5d7fb047b770813c6a2b59dafa3ecb90659dd Mon Sep 17 00:00:00 2001 From: iv1310 Date: Mon, 18 Mar 2024 22:39:50 +0700 Subject: [PATCH 2/5] chore: Adjust readme content. --- README.md | 58 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index bf98aef17..ee3df58da 100644 --- a/README.md +++ b/README.md @@ -6,41 +6,61 @@ PolkaVerse is a niche social site built on the Subsocial network. It focuses on Visit Subsocial's [website](https://subsocial.network) to learn more about the project. -## Guide to build and deploy polkaverse +## Guide to build and deploy polkaverse -1. Prepare the dockerfile and adjust the config if needed. +### Build the docker images +1. Prepare the [dockerfile](./docker/Dockerfile) and adjust the config if needed. 2. Build the image in local with this command and please ensure to add build argument. ```bash -$ docker build --build-arg GH_GA_ID=valueREDACTED --build-arg GH_APP_KIND=valueREDACTED --build-arg GH_HCAPTCHA_SITE_KEY=valueREDACTED --build-arg GH_AMP_ID=valueREDACTED --build-arg GH_OFFCHAIN_SIGNER_URL=valueREDACTED --build-arg GH_CONNECTION_KIND=valueREDACTED --build-arg GH_SELLER_CLIENT_ID=valueREDACTED --build-arg GH_SERVER_MNEMONIC==valueREDACTED --build-arg GH_SELLER_TOKEN_SIGNER=valueREDACTED --build-arg GH_NEXT_PUBLIC_DATAHUB_QUERY_URL=valueREDACTED --build-arg GH_NEXT_PUBLIC_DATAHUB_SUBSCRIPTION_URL=valueREDACTED --build-arg GH_DATAHUB_QUEUE_URL=valueREDACTED --build-arg GH_DATAHUB_QUEUE_TOKEN=valueREDACTED -t polkaverse-docker-image:v1.0.0 . +$ docker build --build-arg GH_GA_ID=valueREDACTED --build-arg GH_APP_KIND=valueREDACTED --build-arg GH_HCAPTCHA_SITE_KEY=valueREDACTED --build-arg GH_AMP_ID=valueREDACTED --build-arg GH_OFFCHAIN_SIGNER_URL=valueREDACTED --build-arg GH_CONNECTION_KIND=valueREDACTED --build-arg GH_SELLER_CLIENT_ID=valueREDACTED --build-arg GH_SERVER_MNEMONIC==valueREDACTED --build-arg GH_SELLER_TOKEN_SIGNER=valueREDACTED --build-arg GH_NEXT_PUBLIC_DATAHUB_QUERY_URL=valueREDACTED --build-arg GH_NEXT_PUBLIC_DATAHUB_SUBSCRIPTION_URL=valueREDACTED --build-arg GH_DATAHUB_QUEUE_URL=valueREDACTED --build-arg GH_DATAHUB_QUEUE_TOKEN=valueREDACTED -t polkaverse-docker-image:latest . ``` Notes: Please execute the build process with theses build arguments, you need to specify the value. -* [x] GH_GA_ID=valueREDACTED -* [x] GH_APP_KIND=valueREDACTED -* [x] GH_HCAPTCHA_SITE_KEY=valueREDACTED -* [x] GH_AMP_ID=valueREDACTED -* [x] GH_OFFCHAIN_SIGNER_URL=valueREDACTED -* [x] GH_CONNECTION_KIND=valueREDACTED -* [x] GH_SELLER_CLIENT_ID=valueREDACTED -* [x] GH_SELLER_TOKEN_SIGNER=valueREDACTED -* [x] GH_SERVER_MNEMONIC=valueREDACTED -* [x] GH_NEXT_PUBLIC_DATAHUB_QUERY_URL=valueREDACTED -* [x] GH_NEXT_PUBLIC_DATAHUB_SUBSCRIPTION_URL=valueREDACTED -* [x] GH_DATAHUB_QUEUE_URL=valueREDACTED -* [x] GH_DATAHUB_QUEUE_TOKEN=valueREDACTED +* GH_GA_ID=valueREDACTED +* GH_APP_KIND=valueREDACTED +* GH_HCAPTCHA_SITE_KEY=valueREDACTED +* GH_AMP_ID=valueREDACTED +* GH_OFFCHAIN_SIGNER_URL=valueREDACTED +* GH_CONNECTION_KIND=valueREDACTED +* GH_SELLER_CLIENT_ID=valueREDACTED +* GH_SELLER_TOKEN_SIGNER=valueREDACTED +* GH_SERVER_MNEMONIC=valueREDACTED +* GH_NEXT_PUBLIC_DATAHUB_QUERY_URL=valueREDACTED +* GH_NEXT_PUBLIC_DATAHUB_SUBSCRIPTION_URL=valueREDACTED +* GH_DATAHUB_QUEUE_URL=valueREDACTED +* GH_DATAHUB_QUEUE_TOKEN=valueREDACTED 3. Then check the docker images that has been builded. ```bash -$ docker images +$ docker images | grep "polkaverse" +``` + +### Run the container with docker-compose +1. To run the docker images with docker-compose, please prepare the docker-compose.yaml config file at first. +```yaml +# docker-compose.yml +version: "3" +services: + web-ui: + image: polkaverse-docker-image:latest + ports: + - "3002:3002" + - "3003:3003" + container_name: polkaverse-web-app + restart: on-failure ``` -4. To run the docker images with docker-compose, please prepare the docker-compose.yaml config file at first. ```bash $ docker-compose -f docker-compose.yaml up -d ``` -5. Check the running container with this command. +2. Check the running container with this command. ```bash $ docker-compose ps $ docker-compose logs ``` +3. Test to connect to the application. +```bash +$ curl -I http://localhost:3002 +$ curl -I http://localhost:3003 +``` ## Run locally From 97e905a6101ce6531e5a037596c810b7a98b7aed Mon Sep 17 00:00:00 2001 From: iv1310 Date: Mon, 18 Mar 2024 23:02:56 +0700 Subject: [PATCH 3/5] chore: Adjust readme content. --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index ee3df58da..73efdac9b 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,7 @@ services: web-ui: image: polkaverse-docker-image:latest ports: - - "3002:3002" - - "3003:3003" + - "3003:3003" # Application port container_name: polkaverse-web-app restart: on-failure ``` @@ -58,7 +57,6 @@ $ docker-compose logs ``` 3. Test to connect to the application. ```bash -$ curl -I http://localhost:3002 $ curl -I http://localhost:3003 ``` From 6f21c2e0c5631fdde525abdd6d01bb5f67870121 Mon Sep 17 00:00:00 2001 From: iv1310 Date: Mon, 18 Mar 2024 23:35:54 +0700 Subject: [PATCH 4/5] chore: remove unused files. --- docker/docker-compose.yml | 7 ------- docker/nginx/Dockerfile | 9 --------- docker/nginx/default.conf | 16 ---------------- 3 files changed, 32 deletions(-) delete mode 100644 docker/nginx/Dockerfile delete mode 100644 docker/nginx/default.conf diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 9bccc0272..1efa720e6 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -9,10 +9,3 @@ services: container_name: subsocial-web-ui restart: on-failure network_mode: "host" - - nginx: - build: ./nginx - container_name: subsocial-proxy - image: dappforce/subsocial-proxy:latest - restart: on-failure - network_mode: "host" diff --git a/docker/nginx/Dockerfile b/docker/nginx/Dockerfile deleted file mode 100644 index 954ed60ea..000000000 --- a/docker/nginx/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM nginx:alpine - -RUN rm /etc/nginx/conf.d/* - -COPY ./default.conf /etc/nginx/conf.d/ - -EXPOSE 80 - -CMD [ "nginx", "-g", "daemon off;" ] \ No newline at end of file diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf deleted file mode 100644 index 0eaee85be..000000000 --- a/docker/nginx/default.conf +++ /dev/null @@ -1,16 +0,0 @@ -server { - listen 80 default_server; - - server_name _; - - server_tokens off; - - location / { - proxy_pass http://localhost:3003; - } - - location /bc/ { - rewrite ^/bc(.*) /$1 break; - proxy_pass http://localhost:3002; - } -} From d7a4577a588931c79ec7f121524d93931fcf4d3c Mon Sep 17 00:00:00 2001 From: teodorus-nathaniel Date: Tue, 19 Mar 2024 17:32:48 +0700 Subject: [PATCH 5/5] Fix disabled publish button not working --- src/components/posts/editor/FullEditor.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/posts/editor/FullEditor.tsx b/src/components/posts/editor/FullEditor.tsx index 47a20bef3..42ce7529e 100644 --- a/src/components/posts/editor/FullEditor.tsx +++ b/src/components/posts/editor/FullEditor.tsx @@ -291,8 +291,8 @@ const FullEditor = ({ type='primary' block className='mt-3' - disabled={publishIsDisable} {...txProps} + disabled={publishIsDisable || txProps.disabled} /> {!totalStake?.hasStakedEnough && (