开发者 fzakaria 推出了 SELF 格式,该格式将可执行文件本身设计为 SQLite 数据库 1。通过 binfmt_misc 触发解释器执行,程序在运行时可通过 SQL 读写自身状态与内容 1。程序通过 argv 获取自身文件路径并打开 SQLite 连接进行读写 1。
fzakaria 发布了 self-httpd 概念验证项目,这是一个单文件 Web 服务器 1。该服务器将程序、网站内容、路由与访问日志全部存储在同一个 SQLite 文件中 1。运行中的服务器可通过 SQL UPDATE 事务性编辑自身内容,无需重启或重新部署 1。部署可通过 scp 单文件完成,重新部署时通过 INSERT ... SELECT 迁移数据 1。代码仓库位于 fzakaria/selfdb,示例站点部署于 https://selfdb.exe.xyz 1。
Developer fzakaria has introduced the SELF format, which designs executable files as SQLite databases 1. This allows programs to read and write their own state and content via SQL during runtime 1. As a proof-of-concept, the author presented self-httpd, a single-file web server that stores the program, website content, routing, and access logs entirely within a single SQLite file 1.
The format implements executables as SQLite databases and triggers the interpreter for execution via binfmt_misc 1. Once running, the program retrieves its own file path through argv to open a SQLite connection for reading and writing 1. The running server can transactionally edit its own content using SQL UPDATE without requiring a restart or redeployment 1. Deployment can be completed by transferring a single file via scp, while redeployment is handled by migrating data using INSERT ... SELECT 1. The source code is available in the fzakaria/selfdb repository, and an example site is deployed at https://selfdb.exe.xyz 1.
评论
还没有评论,欢迎留下第一条。