JSON Library Multi-Platform Compatibility (cjson vs dkjson) #108

Closed
opened 2025-09-05 15:31:00 +02:00 by michael · 0 comments
Owner

Problem

furt uses hardcoded require('cjson') but Arch Linux provides lua51-dkjson.

Platform Status

  • OpenBSD: lua-cjson
  • Debian: lua-cjson
  • Arch: lua51-dkjson only

Current Workaround

Manual sed replacement in start.sh and Lua source files.

Solution Needed

Flexible JSON library detection:

local ok, json = pcall(require, 'cjson')
if not ok then
    json = require('dkjson')
end

Files to Change

  • src/main.lua
  • src/routes/mail.lua
  • scripts/start.sh

Success Criteria

furt runs on all platforms without manual JSON library patches.

## Problem furt uses hardcoded require('cjson') but Arch Linux provides lua51-dkjson. ## Platform Status - OpenBSD: lua-cjson ✅ - Debian: lua-cjson ✅ - Arch: lua51-dkjson only ❌ ## Current Workaround Manual sed replacement in start.sh and Lua source files. ## Solution Needed Flexible JSON library detection: ```lua local ok, json = pcall(require, 'cjson') if not ok then json = require('dkjson') end ``` ## Files to Change - src/main.lua - src/routes/mail.lua - scripts/start.sh ## Success Criteria furt runs on all platforms without manual JSON library patches.
michael added the
effort
medium
priority
medium
type
enhancement
labels 2025-09-05 15:31:00 +02:00
michael added this to the v0.1.2 - Gateway Basics milestone 2025-09-05 17:50:04 +02:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: DAW/furt#108
No description provided.