# Steps to make CTK publicly available

## Prerequisite

Ensure that all the deployment steps are followed as mentioned in the README.md files of the below repositories:

1. [mosip-compliance-toolkit](https://github.com/mosip/mosip-compliance-toolkit)
2. [mosip/mosip-compliance-toolki-ui](https://github.com/mosip/mosip-compliance-toolkit-ui)

### Additional steps post CTK deployment

Below are details of some additional steps that you may need to follow so as to make CTK publicly available post the regular deployment.

#### DNS Mapping changes

Update the DNS records for the below mentioned domains to point to the public IP of nginx server associated with the corresponding cluster.

`onboarder.sandbox.mosip.net ----> public IP of nginx server for Mosip cluster`

`sandbox.mosip.net ----> public IP of nginx server for Mosip cluster`

`pmp.sandbox.mosip.net ----> public IP of nginx server for Mosip cluster`

`iam.sandbox.mosip.net ----> public IP of nginx server for Observation cluster`

#### Nginx Server changes

Add the below mentioned domains in `server_name` section of pubic nginx server.

1. sandbox.mosip.net
2. api.sandbox.mosip.net
3. compliance.sandbox.mosip.net
4. pmp.sandbox.mosip.net

*Note*: Replace “sandbox” appropriately.

#### Istio changes

1. Update the below mentioned istio ingress gateway to point to public IstioOperator:

   Change **spec.selector.istio: ingressgateway-internal** to **spec.selector.istio: ingressgateway** as shown in the image below.

   ![](/files/bMLKoHWnQtJyGMLsTJTG)

   * pmp-gateaway
   * compliance-toolkit-ui-gateway
   * keycloak
   * landing-page
2. Update below mentioned Istio virtualservice to add public gateway in spec.gateways:

![](/files/ypgFKvjiI3hl1ufAoMZc)

```
* partnermanager
* policymanager
* toolkit-service
```

3\. Update Istio gateway in compliance toolkit EnvoyFilter compliance-toolkit-set-cookie-header to public gateway.

```
  workloadSelector:
    labels:
      istio: ingressgateway
```

### Config map changes for UI

* Update `compliance-toolkit-ui.json to point` to `api.sandbox.mosip.net` instead of `api-internal.sandbox.mosip.net`.
* Update `pmp config.json` to point to `api.sandbox.mosip.net` instead of `api-internal.sandbox.mosip.net`.

### Configuration changes

* Add `mosip.api.external.url=https://${mosip.api.public.host}` property in `compliance-toolkit-default.properties` file.
* Update `mosip.iam.module.redirecturi=${mosip.api.external.url}/v1/toolkit/login-redirect/` property in `compliance-toolkit-default.properties` file.
* Update `mosip.iam.module.redirecturi=${mosip.api.external.url}/v1/partnermanager/login-redirect/` property in `partner-management-default.properties` file.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mosip.io/compliance-tool-kit/how-to-guides/ctk-public-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
