product-os-server 0.0.55

Product OS : Server provides a full functioning advanced server capable of acting as a web server, command and control distributed network, authentication server, crawling server and more. Fully featured with high level of flexibility.
Documentation

Product OS : Server

Crates.io Documentation Rust 1.69+ License: GPL-3.0

Product OS : Server provides a full functioning advanced server capable of acting as a web server, command and control distributed network, authentication server, crawling server and more. Fully featured with high level of flexibility.

What is Product OS?

Product OS is a collection of packages that provide different tools and features that can work together to build products more easily for the Rust ecosystem.

Feature Flags

Core Features

  • core: Basic server functionality with Hyper, Axum, and logging
  • std: Standard library support

Executors

  • executor_tokio: Tokio async runtime support

TLS

  • tls: TLS/HTTPS support with Rustls
  • dual_server: Simultaneous HTTP/HTTPS server

Communication

  • ws: WebSocket support
  • sse: Server-Sent Events support

Security

  • cors: CORS support
  • cspolicy: Content Security Policy
  • csrf: CSRF protection

Middleware & Features

  • middleware: Extensible middleware support
  • compression: Response compression (gzip, deflate, brotli)
  • extract_headers: Header extraction utilities
  • security: Minimal security helpers (headers, config parsing)
  • security_certificates: TLS certificate generation (via tls / controller)
  • controller: Command-and-control stack (store + capabilities)
  • controller_framework_axum: Controller aligned with framework_axum (included in authentication, oidc, etc.)
  • controller_framework_flow: Controller aligned with framework_flow

Data Stores

Store features enable product-os-store on the server. Command-control store backends are forwarded only when controller is also enabled (weak ?/ refs).

  • postgres_store: PostgreSQL database support
  • sqlite_store: SQLite database support
  • redis_key_value_store: Redis key-value store
  • memory_key_value_store: In-memory key-value store
  • file_key_value_store: File-based key-value store
  • redis_queue_store: Redis queue store
  • memory_queue_store: In-memory queue store

Installation

[dependencies]
product-os-server = "0.0.1"

Pin the version to match the crate Cargo.toml when using path or git dependencies.

Documentation

Full API documentation is available at docs.rs/product-os-server.

Usage

Overview

Product OS : Server provides a full functioning advanced server capable of acting as a web server, command and control distributed network, authentication server, crawling server, and more. Fully featured with a high level of flexibility.

Features

  • Web Server: High-performance HTTP/HTTPS server built on Axum and Hyper
  • TLS Support: Secure connections with Rustls
  • Dual Protocol: Simultaneous HTTP and HTTPS on different ports
  • WebSocket Support: Real-time bidirectional communication
  • Server-Sent Events: Streaming updates to clients
  • Compression: Gzip, Deflate, and Brotli response compression
  • CORS: Cross-Origin Resource Sharing support
  • CSRF Protection: Cross-Site Request Forgery protection
  • CSP: Content Security Policy support
  • Middleware: Extensible middleware system
  • Command & Control: Distributed system coordination
  • Multiple Executors: Tokio async runtime support

Installation

Add Product OS : Server to your Cargo.toml:

[dependencies]
product-os-server = { version = "0.0.55", features = ["core", "executor_tokio", "tls"] }
tokio = { version = "1", features = ["full"] }

Quick Start

use product_os_server::{ProductOSServer, ServerConfig};
use product_os_async_executor::TokioExecutor;

#[tokio::main]
async fn main() {
    // Create server with default configuration
    let config = ServerConfig::new();
    let mut server: ProductOSServer<(), TokioExecutor, _> =
        ProductOSServer::new_with_config(config);

    // Add routes and start the server
    // server.start(true).await;
}

Configuration

{
  "environment": "production",
  "rootPath": "/api",
  "network": {
    "protocol": "https",
    "secure": true,
    "host": "0.0.0.0",
    "port": 8443,
    "listenAllInterfaces": true,
    "allowInsecure": true,
    "insecurePort": 8080,
    "insecureUseDifferentPort": true,
    "insecureForceSecure": true
  },
  "certificate": {
    "certFile": "/path/to/cert.pem",
    "keyFile": "/path/to/key.pem"
  },
  "compression": {
    "enable": true,
    "gzip": true,
    "brotli": true
  },
  "security": {
    "enable": true,
    "csrf": true,
    "csp": {
      "defaultSrc": ["'self'"],
      "scriptSrc": ["'self'", "'unsafe-inline'"]
    }
  }
}

Architecture

The server is built on:

  • Hyper: Low-level HTTP implementation
  • Axum: Web framework with routing and middleware
  • Rustls: Modern TLS implementation
  • Tower: Service abstraction for middleware

Integration

Product OS Server integrates with:

  • Product OS Router: Request routing and handlers
  • Product OS Configuration: Configuration management
  • Product OS Security: Certificates and authentication
  • Product OS Command Control: Distributed coordination
  • Product OS Store: Data persistence
  • Product OS Capabilities: Service/feature registration

Testing

# Run all tests
cargo test --all-features

# Run with specific features
cargo test --features "core,executor_tokio,tls"

# Generate documentation
cargo doc --all-features --open

Contributing

Contributions are not currently available but will be available on a public repository soon.

License

This project is licensed under the GNU GPLv3.