python-dotenv is a production-grade Python library that reads key-value pairs from .env files and sets them as environment variables, following the 12-factor configuration principles. It is widely used in development and deployment workflows to separate configuration from code. The library provides both programmatic APIs and a command-line interface for managing environment variables without manual file editing. The architecture centers on the `DotEnv` class, which orchestrates parsing, variable interpolation, and environment loading. Parsing is handled by a custom streaming parser (`parser.py`) that uses a `Reader` with position tracking and regex-based tokenization to handle single/double quoted values, comments, escape sequences, and UTF-8 BOM stripping. Variable expansion (`variables.py`) implements POSIX-style `${VAR:-default}` interpolation using an `Atom` abstract base class with `Literal` and `Variable` strategies. The core library has zero external dependencies; the CLI (built on `click`) and IPython integration are optional extras. Key entry points include `load_dotenv()` (loads .env into `os.environ`), `dotenv_values()` (returns a dict without touching the environment), `set_key()`/`unset_key()` for programmatic file manipulation, and `find_dotenv()` for locating .env files. The CLI offers `list`, `get`, `set`, `unset`, and `run` subcommands, with support for JSON/shell/export output formats. The IPython `%dotenv` magic provides interactive loading. Data flows from file or stream through the parser into an ordered dict, with optional interpolation and override control. External dependencies are minimal: `click` for the CLI, `IPython` for the magic extension, and standard library modules (`os`, `io`, `re`, `tempfile`, `pathlib`, etc.). The library supports Python 3.10–3.14 (including free-threaded 3.14t) and PyPy 3.11, with comprehensive CI testing across Linux and Windows.
dotenv.net is a lightweight .NET library for loading environment variables from .env files. It provides both a static API (DotEnv.Load, DotEnv.Read) and a fluent builder (DotEnv.Fluent) for configuring options such as file paths, encoding, trimming, overwrite behavior, directory probing, export syntax support, inline comment stripping, and variable expansion/interpolation. The library supports hierarchical environment cascade loading (e.g., .env, .env.local, .env.{Environment}) and integrates with Microsoft.Extensions.Configuration via a separate package (dotenv.net.Configuration). Internally, it consists of a parser that handles single/double quoted values, multi-line values, and escape sequences; a variable expander that resolves ${VAR}, $VAR, and default fallback syntax with circular dependency detection; and a reader that reads from files or streams, probes parent directories, and merges key-value pairs. The codebase is well-structured with comprehensive unit tests covering edge cases, and targets netstandard2.0/2.1 for broad compatibility.
envrc.el is an Emacs Lisp package that provides buffer-local environment variable management using the direnv tool. It implements a global minor mode (`envrc-global-mode`) that enables a local minor mode (`envrc-mode`) in every buffer, which sets buffer-local `process-environment`, `exec-path`, and related variables based on the nearest `.envrc` file. The package caches direnv results per directory, supports asynchronous direnv execution with configurable blocking behavior, and advises several Emacs shell commands (e.g., `shell-command`, `async-shell-command`, `org-babel-eval`) to propagate the local environment into temporary buffers. It also includes TRAMP support for remote files, a major mode for editing `.envrc` files, and a comprehensive test suite. The architecture is a single-file Emacs package with clean separation of concerns: environment detection, direnv process management, result caching, and application to buffer-local state. The code demonstrates advanced Emacs Lisp patterns including minor modes, process filters and sentinels, advice, and buffer-local variable management.
Infisical is an open-source end-to-end encrypted secrets management platform used to centralize, secure, and sync secrets across teams and infrastructure. The codebase is structured as a multi-service application with a primary Node.js/TypeScript backend (REST API using Fastify) and a newer Go backend implementing core platform services (authentication, permission evaluation, KMS, audit logging, secret manager). The frontend is a React SPA built with Vite and TanStack Router. The system supports self-hosted (Docker, Helm) and cloud-deployed modes. It provides a rich set of capabilities including dynamic secrets, secret rotation, approval workflows, machine identity federation (AWS, Azure, GCP, Kubernetes, OIDC), PKI management (internal and external CAs), privileged access management (PAM), secret scanning, audit logging, and extensive integration syncs. The architecture follows a modular service-oriented pattern with clear separation of concerns, extensive use of dependency injection and factory patterns for extensibility.
react-native-config is a native module library that exposes environment variables from a .env file to React Native applications on iOS, Android, macOS, and Windows. At build time, platform-specific scripts (Ruby for iOS/macOS, Gradle for Android, Node.js for Windows) parse the .env file and inject the key-value pairs as generated constants — BuildConfig fields on Android, a #define'd NSDictionary on iOS, and C++ string constants on Windows. At runtime, a single JavaScript entry point (index.js) calls a synchronous TurboModule method (getConfig()) to retrieve the config object, which is then exported as the default 'Config' constant. The library supports per-environment configurations via ENVFILE or per-build-configuration settings, and includes thorough diagnostics: if the .env file is missing or empty, the runtime logs a detailed message naming exactly which paths were tried. The codebase is well-structured across all four platforms, with a strong test suite for the iOS codegen scripts (Ruby Minitest) and a clean separation between build-time codegen and runtime reading.
phusion/baseimage-docker is a specialized Ubuntu base image optimized for Docker containers. It solves common Docker container problems including the PID 1 zombie reaping issue (via a custom /sbin/my_init process), syslog blackhole problem (using syslog-ng that forwards logs to docker logs), and APT incompatibilities. The image provides service supervision through runit, tools for running processes as different users (setuser), easy SSH access (optional), and environment variable management. It's designed to be used as a base image for Docker applications, offering a minimal but production-ready Ubuntu environment.
This repository provides a Dockerized implementation of RaspAP, a wireless router software for Debian-based devices. The container runs systemd to manage multiple services including hostapd (for Wi-Fi access point), dnsmasq (for DHCP/DNS), and the RaspAP web interface. It uses the host's network stack and requires privileged access to configure network interfaces and firewall rules. The setup process involves installing RaspAP via the official installer script, then applying environment-specific configurations through shell scripts that map environment variables to configuration files. The architecture is a single-container design that leverages systemd for process management inside the container. Key components include an environment setup script (env-setup.sh) that dynamically updates configuration files based on prefixed environment variables, a firewall script (firewall-rules.sh) that configures NAT and forwarding rules, and a simple PHP password generator (password-generator.php) for securely hashing web GUI credentials. The container exposes the RaspAP web interface on port 80 (mapped to 8081 on the host) and relies on the host's wireless and Ethernet interfaces for operation. Notable reusable components demonstrate solid engineering practices: the env-setup.sh script implements a clean pattern for mapping environment variables to configuration file key-value pairs using associative arrays and sed-based updates, which could be adapted to other applications with minimal changes. The password-generator.php correctly uses PHP's password_hash function with BCRYPT, showcasing secure password handling. While the Dockerfile follows common patterns for running systemd in containers and the firewall script contains interface-specific assumptions, the overall maintainability is strong with recent commits, active CI/CD workflows, and no reported dependency issues.