pirania: remove dead code and legacy artifacts
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Read the listed files in packages/pirania/files/ and check the references to client_ip, show_url, change_url, append_nft_rules, and functools.lua; the issue says the Lua module has no imports and the UCI option has no effect. Remove the specified dead artifacts and stale show_url ACL entries, then verify no references to the removed methods remain. Done means all five cleanup items in the issue are addressed.
Written by the indexing model from the issue text.
Description
Summary
While preparing the pirania package for a merge, several dead code items and legacy artifacts were identified that should be cleaned up in a follow-up.
Items
1. Broken CGI endpoint: client_ip
File: packages/pirania/files/www/cgi-bin/pirania/client_ip
This CGI script imports voucher.logic and voucher.db (lines 4-5) — neither module exists. The modules were renamed to voucher.vouchera, voucher.store, etc. long ago. If this endpoint is ever hit, it produces a 500 error. It is not called by any portal page or JS in the current codebase.
Action: Delete the file.
2. Dead portal_url ubus API (legacy, non-functional)
File: packages/pirania/files/usr/libexec/rpcd/pirania (lines 55-64, 102-103)
The show_url and change_url ubus methods read/write pirania.base_config.portal_url, but this UCI key does not exist in the config. The actual portal redirect uses portal_domain + url_auth/url_portal. These methods are effectively no-ops.
Action: Remove show_url and change_url from the rpcd script and the methods table.
3. Stale UCI option: append_nft_rules
File: packages/pirania/files/etc/config/pirania (line 11)
option append_nft_rules '0' # if set to 1, iptables rules will be Appended instead of Inserted
The comment still says "iptables" and the option has no effect in the current nftables implementation. The captive-portal script always recreates the table from scratch.
Action: Remove this option from the UCI config.
4. Dead code: functools.lua is never imported
File: packages/pirania/files/usr/lib/lua/voucher/functools.lua
This 90-line module provides curry, reverse, map, filter, and search functions, but nothing in the entire codebase requires or imports it.
Action: Delete the file.
Context
Identified during review of branch hotfix/pirania before merge. These are safe mechanical cleanups that do not affect any working functionality.
5. Stale ACL references to legacy show_url method
File: packages/pirania/files/usr/share/rpcd/acl.d/pirania.json (lines 6, 14)
The ACL file grants access to the legacy show_url method in both the unauthenticated and lime-app roles. When items 1-2 above are resolved (removing show_url/change_url from rpcd), these ACL entries should also be cleaned up.
Action: Remove show_url from the ACL entries and replace with appropriate current methods if needed.'
- Dominant language
- Lua
- Stars
- 338
- Forks
- 113
- Avg merge
- 8d 3h
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from libremesh/lime-packages
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
libremesh/lime-packages#1302 ·
-
drop dependencies of lime-debug and shared-state on iputils-pingPossibly taken @jay23606 claimed this 7 days ago. Openeasy to solve good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
libremesh/lime-packages#1279 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
libremesh/lime-packages#1304 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
libremesh/lime-packages#1303 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 49/100
libremesh/lime-packages#1295 · 1 comment ·
All issues in libremesh/lime-packages
Similar issues
-
severity: low
Difficulty 1/5 Under an hour Newbie friendliness 72/100
luainkernel/lunatik#2727 ·
Maintainers usually reply within 1 day
-
[Fix Package]: gladPossibly taken @luadebug claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
xmake-io/xmake-repo#11342 ·
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
MalloyTheDev/aseprite-mcp#279 ·
Maintainers usually reply within 1 day
-
Scan progress and ETC undercount retransmissions since 7.99x (stuck at 99.99% with --max-retries 0)Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
zigbeefordomoticz/wiki#391 ·
Maintainers usually reply within 1 day