Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed environment variables to be more canonical #304

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ build: java/registry/target/registry.jar
rm -rf java/claim/target/*.jar
cd target && rm -rf * && jar xvf ../java/registry/target/registry.jar && cp ../java/Dockerfile ./ && docker build -t ghcr.io/sunbird-rc/sunbird-rc-core .
make -C java/claim
make -C services/notification-service docker
make -C services/metrics docker
make -C services/id-gen-service docker
make -C services/encryption-service docker
make -C services/identity-service/ docker
make -C services/credential-schema docker
make -C services/credentials-service/ docker

make -C services/notification-service docker
make -C services/metrics docker

java/registry/target/registry.jar: $(SOURCES)
echo $(SOURCES)
Expand Down
216 changes: 116 additions & 100 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,90 +48,94 @@ services:
- ./${SCHEMA_DIR-java/registry/src/main/resources/public/_schemas}:/home/sunbirdrc/config/public/_schemas
- ./${VIEW_DIR-java/registry/src/main/resources/views}:/home/sunbirdrc/config/views/
environment:
- connectionInfo_uri=jdbc:postgresql://db:5432/registry
- connectionInfo_username=postgres
- connectionInfo_password=postgres
- encryption_enabled=${ENCRYPTION_ENABLED-false}
- encryption_health_check_url=http://encryption-service:8013/health
- encryption_uri=http://encryption-service:8013/crypto/v1/_encrypt
- decryption_uri=http://encryption-service:8013/crypto/v1/_decrypt
- encryption_batch_uri=http://encryption-service:8013/crypto/v1/_encrypt
- decryption_batch_uri=http://encryption-service:8013/crypto/v1/_decrypt
- event_enabled=${EVENT_ENABLED-false}
- event_topic=events
- event_providerName=dev.sunbirdrc.registry.service.impl.KafkaEventService
- elastic_search_connection_url=${ELASTIC_SEARCH_CONNECTION_URL-es:9200}
- elastic_search_scheme=${ELASTIC_SEARCH_SCHEME-http}
- elastic_search_auth_enabled=${ELASTIC_SECURITY_ENABLED-false}
- elastic_search_username=${ELASTIC_SEARCH_USERNAME-elastic}
- elastic_search_password=${ELASTIC_SEARCH_PASSWORD}
- search_providerName=${SEARCH_PROVIDER_NAME-dev.sunbirdrc.registry.service.NativeSearchService}
- sunbird_sso_realm=${KEYCLOAK_REALM-sunbird-rc}
- sunbird_sso_url=${sunbird_sso_url-http://keycloak:8080/auth}
- OAUTH2_RESOURCES_0_URI=${oauth2_resource_uri-http://keycloak:8080/auth/realms/sunbird-rc}
- OAUTH2_RESOURCES_0_PROPERTIES_ROLES_PATH=${oauth2_resource_roles_path-realm_access.roles}
- identity_provider=${identity_provider-dev.sunbirdrc.auth.keycloak.KeycloakProviderImpl}
- idgen_enabled=${IDGEN_ENABLED-false}
- idgen_health_check_url=http://id-gen-service:8088/egov-idgen/health
- idgen_generate_url=http://id-gen-service:8088/egov-idgen/id/_generate
- idgen_id_format_url=http://id-gen-service:8088/egov-idgen/id/_format/add
- sunbird_sso_admin_client_id=${KEYCLOAK_ADMIN_CLIENT_ID-admin-api}
- sunbird_sso_client_id=${KEYCLOAK_CLIENT_ID-registry-frontend}
- sunbird_sso_admin_client_secret=${KEYCLOAK_SECRET}
- claims_enabled=${CLAIMS_ENABLED-false}
- claims_url=http://claim-ms:8082
- did_enabled=${DID_ENABLED-false}
- did_health_check_url=http://identity:3332/health
- did_generate_url=http://identity:3332/did/generate
- did_resolve_url=http://identity:3332/did/resolve/{id}
- signature_enabled=${SIGNATURE_ENABLED-false}
- signature_provider=${SIGNATURE_PROVIDER-dev.sunbirdrc.registry.service.impl.SignatureV2ServiceImpl}
- signature_v2_credential_did_method=rcw
- signature_v2_issuer_did_method=issuer
- signature_v2_schema_author=Registry
- signature_v2_schema_author_did_method=author
- signature_v2_health_check_url=http://credential:3000/health
- signature_v2_issue_url=http://credential:3000/credentials/issue
- signature_v2_get_url=http://credential:3000/credentials/{id}
- signature_v2_delete_url=http://credential:3000/credentials/{id}
- signature_v2_verify_url=http://credential:3000/credentials/{id}/verify
- signature_v2_verify_any_url=http://credential:3000/credentials/verify
- signature_v2_revocation_list_url=http://credential:3000/credentials/revocation-list?issuerId={issuerDid}&page={page}&limit={limit}
- signature_v2_schema_health_check_url=http://credential-schema:3333/health
- signature_v2_schema_create_url=http://credential-schema:3333/credential-schema
- signature_v2_schema_update_url=http://credential-schema:3333/credential-schema/{id}/{version}
- signature_v2_schema_get_by_id_and_version_url=http://credential-schema:3333/credential-schema/{id}/{version}
- signature_v2_schema_search_by_tags_url=http://credential-schema:3333/credential-schema?tags={tags}
- sign_url=http://certificate-signer:8079/sign
- verify_url=http://certificate-signer:8079/verify
- sign_health_check_url=http://certificate-signer:8079/health
- certificate_enabled=${CERTIFICATE_ENABLED-false}
- pdf_url=http://certificate-api:8078/api/v1/certificatePDF
- certificate_health_check_url=http://certificate-api:8078/health
- template_base_url=http://registry:8081/api/v1/templates/ #Looks for certificate templates for pdf copy of the signed certificate
- sunbird_keycloak_user_set_password=true
- filestorage_enabled=${FILESSTORAGE_ENABLED-false}
- filestorage_connection_url=http://file-storage:9000
- filestorage_access_key=admin
- filestorage_secret_key=12345678
- filestorage_bucket_key=issuance
- registry_base_apis_enable=false
- sunbird_keycloak_user_password=abcd@123
- logging.level.root=INFO
- enable_external_templates=true
- async_enabled=${ASYNC_ENABLED-false}
- authentication_enabled=${AUTHENTICATION_ENABLED-false}
- kafka_bootstrap_address=kafka:9092
- webhook_enabled=false
- webhook_url=http://localhost:5001/api/v1/callback
- redis_host=redis
- redis_port=6379
- manager_type=${MANAGER_TYPE-DefinitionsManager}
- expand_reference=${EXPAND_REFERENCE-false}
- swagger_title=${SWAGGER_TITLE-Sunbird Registry and Credential}
- notification_async_enabled=${NOTIFICATION_ASYNC_ENABLED-false}
- notification_enabled=${NOTIFICATION_ENABLED-false}
- notification_url=${NOTIFICATION_URL-http://notification-ms:8765/notification-service/v1/notification}
- DATABASE_CONNECTION_INFO_0_URI=${DATABASE_URI-jdbc:postgresql://db:5432/registry}
- DATABASE_CONNECTION_INFO_0_USERNAME=${DATABASE_USERNAME-postgres}
- DATABASE_CONNECTION_INFO_0_PASSWORD=${DATABASE_PASSWORD-postgres}
- DATABASE_CONNECTION_INFO_0_SHARD_ID=shardId1
- DATABASE_CONNECTION_INFO_0_SHARD_LABEL=1
- DATABASE_CONNECTION_INFO_0_MAX_POOL_SIZE=200
- ENCRYPTION_ENABLED=${ENCRYPTION_ENABLED-false}
- ENCRYPTION_HEALTH_CHECK_URL=http://encryption-service:8013/health
- ENCRYPTION_URL=http://encryption-service:8013/crypto/v1/_encrypt
- ENCRYPTION_BATCH_URL=http://encryption-service:8013/crypto/v1/_encrypt
- DECRYPTION_URL=http://encryption-service:8013/crypto/v1/_decrypt
- DECRYPTION_BATCH_URL=http://encryption-service:8013/crypto/v1/_decrypt
- EVENT_ENABLED=${EVENT_ENABLED-false}
- EVENT_TOPIC=events
- EVENT_PROVIDER_NAME=dev.sunbirdrc.registry.service.impl.KafkaEventService
- ELASTIC_SEARCH_CONNECTION_URL=${ELASTIC_SEARCH_CONNECTION_URL-es:9200}
- ELASTIC_SEARCH_SCHEME=${ELASTIC_SEARCH_SCHEME-http}
- ELASTIC_SEARCH_AUTH_ENABLED=${ELASTIC_SEARCH_AUTH_ENABLED-false}
- ELASTIC_SEARCH_USERNAME=${ELASTIC_SEARCH_USERNAME-elastic}
- ELASTIC_SEARCH_PASSWORD=${ELASTIC_SEARCH_PASSWORD}
- SEARCH_PROVIDER_NAME=${SEARCH_PROVIDER_NAME-dev.sunbirdrc.registry.service.NativeSearchService}
- OAUTH2_RESOURCE_0_URI=http://keycloak:8080/auth/realms/sunbird-rc
- OAUTH2_RESOURCE_0_ROLES_PATH=realm_access.roles
- AUTHENTICATION_ENABLED=${AUTHENTICATION_ENABLED-false}
- IDENTITY_PROVIDER_NAME=${IDENTITY_PROVIDER_NAME-dev.sunbirdrc.auth.keycloak.KeycloakProviderImpl}
- IDENTITY_REALM=${IDENTITY_REALM-sunbird-rc}
- IDENTITY_URL=${IDENTITY_URL-http://keycloak:8080/auth}
- IDENTITY_ADMIN_CLIENT_ID=${IDENTITY_ADMIN_CLIENT_ID-admin-api}
- IDENTITY_ADMIN_CLIENT_SECRET=${IDENTITY_ADMIN_CLIENT_SECRET}
- IDENTITY_SET_DEFAULT_PASSWORD=${IDENTITY_SET_DEFAULT_PASSWORD-true}
- IDENTITY_DEFAULT_PASSWORD=${IDENTITY_DEFAULT_PASSWORD-abcd@123}
- IDGEN_ENABLED=${IDGEN_ENABLED-false}
- IDGEN_HEALTH_CHECK_URL=http://id-gen-service:8088/egov-idgen/health
- IDGEN_GENERATE_URL=http://id-gen-service:8088/egov-idgen/id/_generate
- IDGEN_ID_FORMAT_URL=http://id-gen-service:8088/egov-idgen/id/_format/add
- CLAIMS_ENABLED=${CLAIMS_ENABLED-false}
- CLAIMS_URL=http://claim-ms:8082
- DID_ENABLED=${DID_ENABLED-false}
- DID_HEALTH_CHECK_URL=http://identity:3332/health
- DID_GENERATE_URL=http://identity:3332/did/generate
- DID_RESOLVE_URL=http://identity:3332/did/resolve/{id}
- SIGNATURE_ENABLED=${SIGNATURE_ENABLED-false}
- SIGNATURE_PROVIDER_NAME=${SIGNATURE_PROVIDER_NAME-dev.sunbirdrc.registry.service.impl.SignatureV2ServiceImpl}
- SIGNATURE_V2_CREDENTIAL_DID_METHOD=rcw
- SIGNATURE_V2_ISSUER_DID_METHOD=issuer
- SIGNATURE_V2_SCHEMA_AUTHOR=Registry
- SIGNATURE_V2_SCHEMA_AUTHOR_DID_METHOD=author
- SIGNATURE_V2_HEALTH_CHECK_URL=http://credential:3000/health
- SIGNATURE_V2_ISSUE_URL=http://credential:3000/credentials/issue
- SIGNATURE_V2_GET_URL=http://credential:3000/credentials/{id}
- SIGNATURE_V2_DELETE_URL=http://credential:3000/credentials/{id}
- SIGNATURE_V2_VERIFY_URL=http://credential:3000/credentials/{id}/verify
- SIGNATURE_V2_VERIFY_ANY_URL=http://credential:3000/credentials/verify
- SIGNATURE_V2_REVOCATION_LIST_URL=http://credential:3000/credentials/revocation-list?issuerId={issuerDid}&page={page}&limit={limit}
- SIGNATURE_V2_SCHEMA_HEALTH_CHECK_URL=http://credential-schema:3333/health
- SIGNATURE_V2_SCHEMA_CREATE_URL=http://credential-schema:3333/credential-schema
- SIGNATURE_V2_SCHEMA_UPDATE_URL=http://credential-schema:3333/credential-schema/{id}/{version}
- SIGNATURE_V2_SCHEMA_GET_BY_ID_AND_VERSION_URL=http://credential-schema:3333/credential-schema/{id}/{version}
- SIGNATURE_V2_SCHEMA_SEARCH_BY_TAGS_URL=http://credential-schema:3333/credential-schema?tags={tags}
- SIGNATURE_V1_SIGN_URL=http://certificate-signer:8079/sign
- SIGNATURE_V1_VERIFY_URL=http://certificate-signer:8079/verify
- SIGNATURE_V1_HEALTH_CHECK_URL=http://certificate-signer:8079/health
- CERTIFICATE_ENABLED=${CERTIFICATE_ENABLED-false}
- CERTIFICATE_PDF_URL=http://certificate-api:8078/api/v1/certificatePDF
- CERTIFICATE_HEALTH_CHECK_URL=http://certificate-api:8078/health
- TEMPLATE_BASE_URL=http://registry:8081/api/v1/templates/ #Looks for certificate templates for pdf copy of the signed certificate
- TEMPLATE_EXTERNAL_ENABLED=${TEMPLATE_EXTERNAL_ENABLED-false}
- FILE_STORAGE_ENABLED=${FILE_STORAGE_ENABLED-false}
- FILE_STORAGE_CONNECTION_URL=http://file-storage:9000
- FILE_STORAGE_ACCESS_KEY=admin
- FILE_STORAGE_SECRET_KEY=12345678
- FILE_STORAGE_BUCKET_NAME=issuance
- REGISTRY_BASE_APIS_ENABLED=false
- LOGGING_LEVEL_ROOT=INFO
- LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_SECURITY=INFO
- ASYNC_ENABLED=${ASYNC_ENABLED-false}
- KAFKA_BOOTSTRAP_ADDRESS=kafka:9092
- WEBHOOK_ENABLED=false
- WEBHOOK_URL=http://localhost:5001/api/v1/callback
- REDIS_HOST=redis
- REDIS_PORT=6379
- DEFINITIONS_MANAGER_TYPE=${DEFINITIONS_MANAGER_TYPE-DefinitionsManager}
- REGISTRY_EXPAND_REFERENCE=${REGISTRY_EXPAND_REFERENCE-false}
- SWAGGER_TITLE=${SWAGGER_TITLE-Sunbird Registry and Credential}
- NOTIFICATION_ENABLED=${NOTIFICATION_ENABLED-false}
- NOTIFICATION_ASYNC_ENABLED=${NOTIFICATION_ASYNC_ENABLED-false}
- NOTIFICATION_HEALTH_CHECK_URL=http://notification-ms:8765/notification-service/v1/health
- NOTIFICATION_URL=http://notification-ms:8765/notification-service/v1/notification
ports:
- '8081:8081'
depends_on:
Expand Down Expand Up @@ -178,10 +182,11 @@ services:
claim-ms:
image: ghcr.io/sunbird-rc/sunbird-rc-claim-ms:${RELEASE_VERSION}
environment:
- connectionInfo_uri=jdbc:postgresql://db:5432/registry
- connectionInfo_username=postgres
- connectionInfo_password=postgres
- sunbirdrc_url=http://registry:8081
- SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/registry
- SPRING_DATASOURCE_USERNAME=postgres
- SPRING_DATASOURCE_PASSWORD=postgres
- REGISTRY_URL=http://registry:8081
- UUID_PROPERTY_NAME=osid
ports:
- '8082:8082'
depends_on:
Expand Down Expand Up @@ -464,11 +469,17 @@ services:
ports:
- '8088:8088'
environment:
spring.datasource.url: jdbc:postgresql://db:5432/registry
spring.flyway.baseline-on-migrate: "true"
autocreate.new.seq: "true"
idformat.from.mdms: "false"
egov.mdms.provider: org.egov.id.masterdata.provider.DBMasterDataProvider
- SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/registry
- SPRING_DATASOURCE_USERNAME=postgres
- SPRING_DATASOURCE_PASSWORD=postgres
- SPRING_FLYWAY_URL=jdbc:postgresql://db:5432/registry
- SPRING_FLYWAY_USERNAME=postgres
- SPRING_FLYWAY_PASSWORD=postgres
- SPRING_FLYWAY_TABLE=flyway_idgen_history
- SPRING_FLYWAY_BASELINE_ON_MIGRATE=true
- AUTOCREATE_NEW_SEQ=true
- IDFORMAT_FROM_MDMS=false
- EGOV_MDMS_PROVIDER=org.egov.id.masterdata.provider.DBMasterDataProvider
depends_on:
db:
condition: service_healthy
Expand All @@ -477,13 +488,18 @@ services:
ports:
- '8013:8013'
environment:
server.port: 8013
server.servlet.context-path: /
spring.datasource.url: jdbc:postgresql://db:5432/registry
spring.flyway.url: jdbc:postgresql://db:5432/registry
egov.mdms.provider: org.egov.enc.masterdata.provider.DBMasterDataProvider
spring.flyway.baseline-on-migrate: "true"
management.endpoints.web.base-path: /
- SERVER_PORT=8013
- SERVER_SERVLET_CONTEXT_PATH=/
- SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/registry
- SPRING_DATASOURCE_USERNAME=postgres
- SPRING_DATASOURCE_PASSWORD=postgres
- SPRING_FLYWAY_URL=jdbc:postgresql://db:5432/registry
- SPRING_FLYWAY_USERNAME=postgres
- SPRING_FLYWAY_PASSWORD=postgres
- SPRING_FLYWAY_TABLE=flyway_encryption_history
- SPRING_FLYWAY_BASELINE_ON_MIGRATE=true
- EGOV_MDMS_PROVIDER=org.egov.enc.masterdata.provider.DBMasterDataProvider
- MANAGEMENT_ENDPOINTS_WEB_BASE_PATH=/
depends_on:
db:
condition: service_healthy
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class SunbirdRCClient {
private final String sunbirdRCUrl;
RestTemplate restTemplate = new RestTemplate();

public SunbirdRCClient(@Value("${sunbirdrc.url}")String sunbirdRCUrl) {
public SunbirdRCClient(@Value("${registry.url}")String sunbirdRCUrl) {
this.sunbirdRCUrl = sunbirdRCUrl;
}

Expand Down
2 changes: 1 addition & 1 deletion java/claim/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.ddl-auto=update

spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
sunbirdrc.url=${sunbirdrc_url:http://localhost:8081}
registry.url=${sunbirdrc_url:http://localhost:8081}

uuid-property-name=${uuid_property_name:osid}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.ddl-auto=update

spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
sunbirdrc.url=${sunbirdrc_url:http://localhost:8081}
registry.url=${sunbirdrc_url:http://localhost:8081}
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public class RegistryTestBase {
private static final String CONTEXT_CONSTANT = "teacher:";
protected static Type mapType = new TypeToken<Map<String, String>>() {
}.getType();
private static String ssoUrl = System.getenv("sunbird_sso_url");
private static String ssoClientId = System.getenv("sunbird_sso_client_id");
private static String ssoUsername = System.getenv("sunbird_sso_username");
private static String ssoPassword = System.getenv("sunbird_sso_password");
private static String ssoRealm = System.getenv("sunbird_sso_realm");
private static String ssoUrl = System.getenv("IDENTITY_URL");
holashchand marked this conversation as resolved.
Show resolved Hide resolved
private static String ssoClientId = System.getenv("IDENTITY_CLIENT_ID");
private static String ssoUsername = System.getenv("IDENTITY_USERNAME");
private static String ssoPassword = System.getenv("IDENTITY_PASSWORD");
private static String ssoRealm = System.getenv("IDENTITY_REALM");
public static String accessToken = generateAuthToken();
public String jsonld;
protected RestTemplate restTemplate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private static RestHighLevelClient getClient(String indexName) {
* @return
* @throws IOException
*/
@Retryable(value = {IOException.class, ConnectException.class}, maxAttemptsExpression = "#{${service.retry.maxAttempts}}",
@Retryable(value = {IOException.class, ConnectException.class}, maxAttemptsExpression = "#{${service.retry.max-attempts}}",
backoff = @Backoff(delayExpression = "#{${service.retry.backoff.delay}}"))
public static boolean addIndex(String indexName, String documentType) throws IOException {
boolean response = false;
Expand Down Expand Up @@ -215,7 +215,7 @@ public RestStatus addEntity(String index, String entityId, JsonNode inputEntity)
* @return
*/
@Override
@Retryable(value = {IOException.class, ConnectException.class}, maxAttemptsExpression = "#{${service.retry.maxAttempts}}",
@Retryable(value = {IOException.class, ConnectException.class}, maxAttemptsExpression = "#{${service.retry.max-attempts}}",
backoff = @Backoff(delayExpression = "#{${service.retry.backoff.delay}}"))
public Map<String, Object> readEntity(String index, String uuidPropertyValue) throws IOException {
logger.debug("readEntity starts with index {} and entityId {}", index, uuidPropertyValue);
Expand Down Expand Up @@ -276,7 +276,7 @@ public RestStatus deleteEntity(String index, String uuidPropertyValue) {
}

@Override
@Retryable(value = {IOException.class, ConnectException.class}, maxAttemptsExpression = "#{${service.retry.maxAttempts}}",
@Retryable(value = {IOException.class, ConnectException.class}, maxAttemptsExpression = "#{${service.retry.max-attempts}}",
backoff = @Backoff(delayExpression = "#{${service.retry.backoff.delay}}"))
public JsonNode search(String index, SearchQuery searchQuery) throws IOException {
BoolQueryBuilder query = buildQuery(searchQuery);
Expand Down
Loading
Loading