{"id":19113096,"url":"https://github.com/haidouks/config-server","last_synced_at":"2025-09-12T00:45:11.240Z","repository":{"id":215239542,"uuid":"253464566","full_name":"haidouks/config-server","owner":"haidouks","description":"Config Server is a git based Cross-Platform key/value store. Using Powershell Pode framework, it dynamically converts yaml files into authenticated rest services.","archived":false,"fork":false,"pushed_at":"2021-02-28T09:22:24.000Z","size":60,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T11:41:20.018Z","etag":null,"topics":["authentication","consul","key-value","pode","powershell","yaml-files"],"latest_commit_sha":null,"homepage":"https://github.com/haidouks/config-server","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haidouks.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-04-06T10:28:03.000Z","updated_at":"2021-02-28T09:22:27.000Z","dependencies_parsed_at":"2024-01-03T10:11:41.165Z","dependency_job_id":"ae50fd98-9316-4732-b5b0-c389b9291e49","html_url":"https://github.com/haidouks/config-server","commit_stats":null,"previous_names":["haidouks/config-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/haidouks/config-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haidouks%2Fconfig-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haidouks%2Fconfig-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haidouks%2Fconfig-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haidouks%2Fconfig-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haidouks","download_url":"https://codeload.github.com/haidouks/config-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haidouks%2Fconfig-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274732497,"owners_count":25339345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","consul","key-value","pode","powershell","yaml-files"],"created_at":"2024-11-09T04:35:11.718Z","updated_at":"2025-09-12T00:45:11.196Z","avatar_url":"https://github.com/haidouks.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# Config Server\n[![Docker Pulls](https://img.shields.io/docker/pulls/cnsn/config-server.svg)](https://hub.docker.com/r/cnsn/config-server)\n\n## What is Config Server?\nConfig Server is a Cross-Platform key/value store which dynamically converts yaml files into rest services. \n\n## How it works?\n\n1. Config server fetchs yaml files from git repo (or any remote)\n2. Hierarchically saves all keys in all yaml files to the state file. In case of restart or crash, first task of config server is reloading this file to cache. \n3. Hierarchically caches each key and it's value. You should take care of cached objects because currently there is no capacity limitation or caching policy like LRU,MRU,etc. \n4. Creates routes for each cached keys and each routes return cached values.\n5. If a new yaml file or key is added it will be remarked by config server and .\n6. If a yaml file or key is deleted, related routes will be deleted from cache and state file. Deleted routes will start to get http 404.\n\n\u003e![config-server](https://user-images.githubusercontent.com/23384662/80245529-8b05de00-8673-11ea-8142-018c7ee5c51f.png)\n\n\n\n## How to store Config Files?\nActually it is up to you.  `schedules/get-repo.ps1` file is responsible from getting yamls from remote and by default, config server assumes that yaml files are kept in a git repository. \n\nBut it is possible to add custom logic to get/sync yaml files or completely disabling and working on existing local yaml files by changing `schedules/get-repo.ps1`.\n\n\n\n## Yaml file Format\nAssume that you have 2 yaml files `test1.yaml` and `test2.yaml`;\n\n* test1.yaml\n``` yaml\nnested:\n  array:\n  - this\n  - is\n  - an\nmyKey: world1\n```\n\n* test2.yaml\n``` yaml\nmyKey2: myValue2\n```\n\nConfig server will convert all keys in all yaml files to the following endpoints:\n* /test1/nested/array\n* /test1/myKey\n* /test2/myKey2\n\n\n## How to run?\n\n### Prerequisites\n\u003eThere is no prerequisites for `cnsn/config-server` base image, all requirements are already installed inside docker image.\n\n\u003eIf you want to run config-server out of container, first thing you need is Powershell Core (PS \u003e 6.0). Also `git` should be installed and finally config-server should be able to reach repos defined in Powershell Gallery. When you start `config-server.ps1` for the first time, following modules will be installed from Powershell Gallery if they are not installed already:\n\n* Powershell-Yaml (Powershell Module)\n* Pode (Powershell Module)\n* PSCache (Powershell Module)\n\n\u003eIf you want to install them manually, you can use following commands:\n\n``` Powershell\nInstall-Module -Name \"powershell-yaml\" -RequiredVersion 0.4.1 -Force -Scope CurrentUser\nInstall-Module -Name \"pode\" -RequiredVersion 1.6.1 -Force -Scope CurrentUser\nInstall-Module -Name \"pscache\" -RequiredVersion 0.1.0 -Force -Scope CurrentUser\n```\n\n\n### Environment Variables\nConfig server will use environment variables during server startup to configure itself. They are:\n* `repo`: Remote git repo address that config server will clone and pull periodically. Default: https://github.com/haidouks/configs\n* `PodePort`: Port that will config server will be listening. Default: 8085\n* `ThreadCount`: Dedicated thread count for all routes. Default: 5\n* `VerbosePreference`: Enable verbose logging. Default: SilentlyContinue\n* `enableAuthentation`: Enable authentication. Default: False\n* `authenticatedRoutes`: List of routes that will be authenticated. Default: Null\n* `defaultAuthToken`: Bearer token for default authencation type. Default:QweAsdZxc123\n\n\n### Examples\nExample 1: Quick start\n``` Docker\ndocker run -d -p 8085:8085 cnsn/config-server:latest\n```\nNow browse `http://localhost:8085/test/myKey`: \n* `test` is the name of yaml file in default source repository: `https://github.com/haidouks/configs`\n* `myKey` is a key in test.yaml\n\nResponse should see something like `{\"value\":\"world1\"}` which is the value of key `myKey`\n\nExample 2: Configure variables\n``` Docker\ndocker run -d -p 8085:8085 \\\n    -e VerbosePreference=Continue \\\n    -e ThreadCount=10 \\\n    -e repo=https://github.com/haidouks/configs \\\n    cnsn/config-server\n```\nExample 3: Authenticate some routes\n``` Docker\ndocker run -d -p 8085:8085 \\\n    -e repo=https://github.com/haidouks/configs \\\n    -e enableAuthentation=true \\\n    -e authenticatedRoutes=test/*:DefaultAuth \\\n    -e defaultAuthToken=Qweasd123 \\\n    cnsn/config-server\n```\n\n## Roadmap\n* Just in time synchronizer -\u003e DONE\n* Configure cache capacity and policy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaidouks%2Fconfig-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaidouks%2Fconfig-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaidouks%2Fconfig-server/lists"}