Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ jobs:
uses: sourcemeta/jsonschema@v11.5.1

- name: Validate Service Schema
run: jsonschema validate ./schema.json ./services/*.json
run: jsonschema validate ./schemas/services.schema.json ./services/*.json

- name: Validate Country Schema
run: jsonschema validate ./schemas/countries.schema.json ./countries/*.json
15 changes: 10 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ jobs:
- name: Upload Compiled Services
uses: actions/upload-artifact@v4
with:
name: services-compiled
path: services.json
name: cloud-shield-definitions
path: |
services.json
countries.json
ids.json
retention-days: 90

- name: Create Release and Upload Asset
Expand All @@ -42,7 +45,9 @@ jobs:
echo "Creating release ${TAG_NAME}"

gh release create "${TAG_NAME}" \
--title "Services ${VERSION}" \
--notes "Combined service definitions" \
--title "Definitions ${VERSION}" \
--notes "Combined service and country definitions" \
--latest \
services.json
services.json \
countries.json \
ids.json
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Compiled output
services.json
countries.json

# Node modules (if needed in future)
node_modules/
Expand Down
10 changes: 8 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@
"fileMatch": [
"services/*.json"
],
"url": "./schema.json"
"url": "./schemas/services.schema.json"
},
{
"fileMatch": [
"countries/*.json"
],
"url": "./schemas/countries.schema.json"
}
],
"json.validate.enable": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}
}
56 changes: 39 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,80 @@
</p>


# Securepoint DNS Services
# Securepoint Cloud Shield Definitions

A collection of services with the corresponding domains used in our product "Cloud Shield".
A collection of Cloud Shield definitions, including services with their domains and ISO country definitions.

## Overview

This repository contains JSON definitions for various services and their associated domains that are used by Cloud Shield. Each service is defined in a separate JSON file that follows a standardized schema to ensure consistency and reliability.
This repository contains JSON definitions used by Cloud Shield. Services are defined with their associated domains, and countries are defined by ISO alpha-2 code with English and German display names.

## Repository Structure

```
dns-services/
cloud-shield-definitions/
├── README.md
├── schema.json # JSON schema defining the service structure
├── compile.js # Script to compile all services into a single JSON file
└── services/ # Directory containing all service definitions
├── service1.json
├── service2.json
├── schemas/
│ ├── services.schema.json # JSON schema defining the service structure
│ └── countries.schema.json # JSON schema defining the country structure
├── main.go # Script to compile all definitions into generated JSON files
├── ids.json # Stable numeric IDs grouped by service filename and ISO country code
├── services/ # Directory containing all service definitions
│ ├── service1.json
│ ├── service2.json
│ └── ...
└── countries/ # Directory containing ISO country definitions
├── DE.json
├── FR.json
└── ...
```

## Compiled Services
## Compiled Definitions

All individual service files are automatically compiled into a single `services.json` file through the CI/CD pipeline. This compiled file contains all services in a single JSON object where each key is the filename (without `.json` extension).
All individual definition files are automatically compiled into generated JSON catalogs. Service definitions are compiled into `services.json`, and country definitions are compiled into `countries.json`.

### Downloading the Compiled File

The compiled `services.json` file is available in two ways:
The compiled files are available in two ways:

1. **GitHub Releases**: Automatically published with each push to master branch
2. **GitHub Actions Artifacts**: Available for all CI runs (including pull requests)

### Local Compilation

To compile the services locally:
To compile the definitions locally:

```bash
node compile.js
go run main.go
```

This will generate a `services.json` file in the root directory containing all services.
This will generate:

- `services.json` with the compiled service catalog
- `countries.json` with the compiled country catalog
- `ids.json` with the stable numeric ID registry in the form `{ "services": {...}, "countries": {...} }`

Each compiled service includes an `id` field. Each compiled country includes an `id` and `code` field. Existing IDs are preserved, and only newly added definition files receive the next free number.

## Adding New Services

To add a new service:

1. Create a new JSON file in the `services` directory
2. Follow the structure defined in `schema.json`
2. Follow the structure defined in `schemas/services.schema.json`
3. Include all required fields and adhere to the specified formats
4. Use a descriptive filename that clearly identifies the service
5. Validate your JSON against the schema before submitting

## Adding New Countries

To add a new country definition:

1. Create a new JSON file in the `countries` directory named with the ISO alpha-2 code, for example `DE.json`
2. Follow the structure defined in `schemas/countries.schema.json`
3. Include English and German names in the `name` object
4. Do not rename existing country files after they are merged


> [!WARNING]
> **DO NOT change existing file names once they are merged into the repository.**
Expand All @@ -73,4 +95,4 @@ If you have suggestions for new services or improvements, please open an issue o

## License

MIT License
MIT License
6 changes: 6 additions & 0 deletions countries/AD.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Andorra",
"de": "Andorra"
}
}
6 changes: 6 additions & 0 deletions countries/AE.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "United Arab Emirates",
"de": "Vereinigte Arabische Emirate"
}
}
6 changes: 6 additions & 0 deletions countries/AF.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Afghanistan",
"de": "Afghanistan"
}
}
6 changes: 6 additions & 0 deletions countries/AG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Antigua & Barbuda",
"de": "Antigua und Barbuda"
}
}
6 changes: 6 additions & 0 deletions countries/AI.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Anguilla",
"de": "Anguilla"
}
}
6 changes: 6 additions & 0 deletions countries/AL.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Albania",
"de": "Albanien"
}
}
6 changes: 6 additions & 0 deletions countries/AM.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Armenia",
"de": "Armenien"
}
}
6 changes: 6 additions & 0 deletions countries/AO.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Angola",
"de": "Angola"
}
}
6 changes: 6 additions & 0 deletions countries/AQ.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Antarctica",
"de": "Antarktis"
}
}
6 changes: 6 additions & 0 deletions countries/AR.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Argentina",
"de": "Argentinien"
}
}
6 changes: 6 additions & 0 deletions countries/AS.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "American Samoa",
"de": "Amerikanisch-Samoa"
}
}
6 changes: 6 additions & 0 deletions countries/AT.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Austria",
"de": "Österreich"
}
}
6 changes: 6 additions & 0 deletions countries/AU.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Australia",
"de": "Australien"
}
}
6 changes: 6 additions & 0 deletions countries/AW.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Aruba",
"de": "Aruba"
}
}
6 changes: 6 additions & 0 deletions countries/AX.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Åland Islands",
"de": "Ålandinseln"
}
}
6 changes: 6 additions & 0 deletions countries/AZ.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Azerbaijan",
"de": "Aserbaidschan"
}
}
6 changes: 6 additions & 0 deletions countries/BA.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Bosnia & Herzegovina",
"de": "Bosnien und Herzegowina"
}
}
6 changes: 6 additions & 0 deletions countries/BB.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Barbados",
"de": "Barbados"
}
}
6 changes: 6 additions & 0 deletions countries/BD.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Bangladesh",
"de": "Bangladesch"
}
}
6 changes: 6 additions & 0 deletions countries/BE.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Belgium",
"de": "Belgien"
}
}
6 changes: 6 additions & 0 deletions countries/BF.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Burkina Faso",
"de": "Burkina Faso"
}
}
6 changes: 6 additions & 0 deletions countries/BG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Bulgaria",
"de": "Bulgarien"
}
}
6 changes: 6 additions & 0 deletions countries/BH.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Bahrain",
"de": "Bahrain"
}
}
6 changes: 6 additions & 0 deletions countries/BI.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Burundi",
"de": "Burundi"
}
}
6 changes: 6 additions & 0 deletions countries/BJ.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Benin",
"de": "Benin"
}
}
6 changes: 6 additions & 0 deletions countries/BL.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "St. Barthélemy",
"de": "St. Barthélemy"
}
}
6 changes: 6 additions & 0 deletions countries/BM.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Bermuda",
"de": "Bermuda"
}
}
6 changes: 6 additions & 0 deletions countries/BN.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Brunei",
"de": "Brunei Darussalam"
}
}
6 changes: 6 additions & 0 deletions countries/BO.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Bolivia",
"de": "Bolivien"
}
}
6 changes: 6 additions & 0 deletions countries/BQ.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Caribbean Netherlands",
"de": "Karibische Niederlande"
}
}
6 changes: 6 additions & 0 deletions countries/BR.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Brazil",
"de": "Brasilien"
}
}
6 changes: 6 additions & 0 deletions countries/BS.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Bahamas",
"de": "Bahamas"
}
}
6 changes: 6 additions & 0 deletions countries/BT.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": {
"en": "Bhutan",
"de": "Bhutan"
}
}
Loading