Add instructions to update SP setup for custom domains

This commit is contained in:
Prathamesh Musale 2025-01-30 17:48:42 +05:30
parent e42e3d13cc
commit 71aa803de8
2 changed files with 114 additions and 0 deletions

View File

@ -26,6 +26,10 @@ Follow steps in [Upgrade to SAPO testnet](./testnet-onboarding-validator.md#upgr
Follow steps in [service-provider.md](./service-provider.md) to setup / update your service provider
### Support Custom Domains
Follow steps to [Update service provider for custom domains](./service-provider.md#update-service-provider-for-custom-domains)
## Run testnet Nitro Node
Follow steps in [testnet-nitro-node.md](./testnet-nitro-node.md) to run your Nitro node for the testnet

View File

@ -398,3 +398,113 @@ Follow the steps below to point your deployer to the SAPO testnet
```bash
laconic-so deployment --dir webapp-ui logs webapp
```
## Update service provider for custom domains
### Stop webapp deployer
```bash
# In directory where webapp-deployer deployment was created
laconic-so deployment --dir webapp-deployer stop
```
### Update webapp deployer setup
* Fetch latest stack repos:
```bash
# In directory where webapp-deployer deployment was created
laconic-so --stack webapp-deployer-backend setup-repositories --pull
# Confirm latest commit hash in the ~/cerc/webapp-deployment-status-api repo
```
* Rebuild container images:
```bash
laconic-so --stack webapp-deployer-backend build-containers --force-rebuild
```
* Push stack images to the container registry:
* Login to the container registry:
```bash
# Set required variables
# eg: container-registry.pwa.laconic.com
CONTAINER_REGISTRY_URL=
CONTAINER_REGISTRY_USERNAME=
CONTAINER_REGISTRY_PASSWORD=
# login to container registry
docker login $CONTAINER_REGISTRY_URL --username $CONTAINER_REGISTRY_USERNAME --password $CONTAINER_REGISTRY_PASSWORD
# WARNING! Using --password via the CLI is insecure. Use --password-stdin.
# WARNING! Your password will be stored unencrypted in /home/dev2/.docker/config.json.
# Configure a credential helper to remove this warning. See
# https://docs.docker.com/engine/reference/commandline/login/#credential-stores
# Login Succeeded
```
* Push images:
```bash
laconic-so deployment --dir webapp-deployer push-images
```
* Update deployer config (`webapp-deployer/config.env`):
```bash
# Update FQDN policy to "all1ow" for allowing custom domains
export FQDN_POLICY="allow"
# Set IP of your k8s cluster (IP set in DNS records for users)
export DEPLOYMENT_IP="a.b.c.d"
```
### Start webapp deployer
* Start the webapp deployer:
```bash
laconic-so deployment --dir webapp-deployer start
```
* Get the webapp-deployer pod id:
```bash
laconic-so deployment --dir webapp-deployer ps
# Expected output
# Running containers:
# id: default/laconic-096fed46af974a47-deployment-644db859c7-snbq6, name: laconic-096fed46af974a47-deployment-644db859c7-snbq6, ports: 10.42.2.11:9555->9555
# Set pod id
export POD_ID=
# Example:
# export POD_ID=laconic-096fed46af974a47-deployment-644db859c7-snbq6
```
* Copy over GPG keys files to the webapp-deployer container:
```bash
kubie ctx default
# Copy the GPG key files to the pod
kubectl cp <path-to-your-gpg-private-key> $POD_ID:/app
kubectl cp <path-to-your-gpg-public-key> $POD_ID:/app
# Required everytime you stop and start the deployer
```
* Check logs:
```bash
# Deployer
kubectl logs -f $POD_ID
# Deployer auction handler
kubectl logs -f $POD_ID -c cerc-webapp-auction-handler
```