-
-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embedded lua scripts into FTL #1492
Conversation
Signed-off-by: DL6ER <dl6er@dl6er.de>
…cript is now embedded into FTL Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rockpi@rockpi-4b:~$ pihole-FTL -vv
****************************** FTL **********************************
Version: vDev-395e079
Branch: new/embedded_lua_scripts
Commit: 395e0792 (2022-11-20 13:53:41 +0100)
Architecture: aarch64 (compiled on CI)
Compiler: aarch64-linux-gnu-gcc (Debian 8.3.0-2) 8.3.0
****************************** dnsmasq ******************************
Version: pi-hole-v2.88rc3
Compile options: IPv6 GNU-getopt no-DBus no-UBus no-i18n IDN DHCP DHCPv6 Lua TFTP no-conntrack ipset no-nftset auth cryptohash DNSSEC loop-detect inotify dumpfile
****************************** SQLite3 ******************************
Version: 3.40.0
Compile options: ATOMIC_INTRINSICS=1 COMPILER=gcc-8.3.0 DEFAULT_AUTOVACUUM DEFAULT_CACHE_SIZE=-16384 DEFAULT_FILE_FORMAT=4 DEFAULT_FOREIGN_KEYS DEFAULT_JOURNAL_SIZE_LIMIT=-1 DEFAULT_MEMSTATUS=0 DEFAULT_MMAP_SIZE=0 DEFAULT_PAGE_SIZE=4096 DEFAULT_PCACHE_INITSZ=20 DEFAULT_RECURSIVE_TRIGGERS DEFAULT_SECTOR_SIZE=4096 DEFAULT_SYNCHRONOUS=2 DEFAULT_WAL_AUTOCHECKPOINT=1000 DEFAULT_WAL_SYNCHRONOUS=2 DEFAULT_WORKER_THREADS=0 DQS=0 ENABLE_DBPAGE_VTAB MALLOC_SOFT_LIMIT=1024 MAX_ATTACHED=10 MAX_COLUMN=2000 MAX_COMPOUND_SELECT=500 MAX_DEFAULT_PAGE_SIZE=8192 MAX_EXPR_DEPTH=1000 MAX_FUNCTION_ARG=127 MAX_LENGTH=1000000000 MAX_LIKE_PATTERN_LENGTH=50000 MAX_MMAP_SIZE=0x7fff0000 MAX_PAGE_COUNT=1073741823 MAX_PAGE_SIZE=65536 MAX_SQL_LENGTH=1000000000 MAX_TRIGGER_DEPTH=1000 MAX_VARIABLE_NUMBER=32766 MAX_VDBE_OP=250000000 MAX_WORKER_THREADS=8 MUTEX_PTHREADS OMIT_DEPRECATED OMIT_DESERIALIZE OMIT_LOAD_EXTENSION OMIT_PROGRESS_CALLBACK SYSTEM_MALLOC TEMP_STORE=1 THREADSAFE=1
******************************** LUA ********************************
Lua 5.4.1 Copyright (C) 1994-2020 Lua.org, PUC-Rio
***************************** LIBNETTLE *****************************
Version: 3.8
GMP: Full
Just a thought: can we add which scripts are added (e.g. inspect.lua
) to the LUA
section in the version output?
New
|
…ated Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
f41cf52
to
d066946
Compare
Should we add a test to check if all |
This code can go now: Lines 63 to 65 in 844c8b9
|
@yubiuser This code is already removed in this PR: 6b6c069 I'm not sure a test will be necessary. What the user tries to do simply won't work if you don't include the new scripts. I'd rather like to ask for adding individual library tests very much like we have a test dedicated to test if the |
How did I miss this?
I'm fine with this approach, we only need to make sure we/others don't forget to add a test |
FTL already checks for What happens when there is a |
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/pi-hole-ftl-v5-20-and-web-v5-18-released/59959/1 |
What does this implement/fix?
Add facility to embed
lua
scripts into FTL. This reduces dependency on externally provided infrastructure and is easily extensible for to an arbitrary number of scripts whenever we deem this appropriate.How to add new scripts? Just add them into the
src/lua/scripts/
directory and amendCMakeLists.txt
as well as the code parts of FTL which are responsible for reading the scripts.Related issue or feature (if applicable): N/A
Pull request in docs with documentation (if applicable): N/A
By submitting this pull request, I confirm the following:
git rebase
)Checklist:
developmental
branch.