Crates.io | namespaced |
lib.rs | namespaced |
version | 1.0.6 |
created_at | 2025-09-25 02:49:36.939178+00 |
updated_at | 2025-09-25 02:49:36.939178+00 |
description | A modern, API-driven configuration registry for the modern developer. |
homepage | |
repository | https://github.com/canmi21/namespaced |
max_upload_size | |
id | 1854079 |
size | 100,142 |
A modern, API-driven configuration registry for the modern developer. Namespaced provides a simple, scalable way to manage configuration data through a RESTful API, backed by a file-based storage system using Pathmap. It's designed for developers who need a lightweight, configurable registry for applications, services, or microservices.
Clone the repository:
git clone https://github.com/canmi21/namespaced.git
cd namespaced
Build the project:
cargo build --release
Run the binary:
cargo run --release
The server will start on port 19950 by default (configurable via the PORT
environment variable).
Build the Docker image:
docker build -t namespaced .
Run the container:
docker run -p 19950:19950 -v /opt/namespaced:/opt/namespaced namespaced
Alternatively, use Docker Compose for a more managed setup:
docker-compose up -d
This will start the service with persistent volumes and automatic restarts.
Once running, the server exposes a REST API for managing projects and configurations. All operations are performed over HTTP.
PORT
: The port to listen on (default: 19950).LOG_LEVEL
: Logging level (info, debug, warn, error; default: info).Configuration is stored in /opt/namespaced/pathmap.json
by default. This file maps project names to their base storage paths.
Example config:
{
"example_project": "/opt/ns/example"
}
The API is divided into admin routes (for managing projects) and main API routes (for configuration data).
These routes manage projects in the configuration registry. They are prefixed with /_namespaced
.
GET /_namespaced/projects: List all projects.
POST /_namespaced/projects: Create a new project.
{ "name": "project_name", "path": "/base/path" }
PUT /_namespaced/projects/{project}: Update a project's path.
{ "path": "/new/base/path" }
DELETE /_namespaced/projects/{project}: Delete a project.
These routes handle configuration data within projects.
GET /ls/{project}: List all namespaces in a project.
GET /ls/{project}/{path}: List contents (groups and values) at a specific path.
{ "groups": ["group1"], "values": ["value1"] }
.GET /exists/{project}/{path}: Check if a path or key exists.
GET /namespaced/{project}/{path}: Retrieve a value at the path.
POST /namespaced/{project}/{path}: Set a new value (fails if exists).
PUT /namespaced/{project}/{path}: Overwrite a value (creates if not exists).
DELETE /namespaced/{project}/{path}: Delete a value or path.
Errors are returned as JSON with an "error"
field, e.g.:
{ "error": "Project 'unknown' not found" }
Common status codes: 400 Bad Request, 404 Not Found, 409 Conflict, 500 Internal Server Error.
The server watches /opt/namespaced/pathmap.json
for changes. Any modifications (e.g., adding/removing projects) are applied automatically without downtime.
See Cargo.toml
for versions.
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
This project is licensed under the MIT License. See the LICENSE file for details.