Skip to content
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

Add HTTP server and JSON API #659

Closed
wants to merge 834 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
834 commits
Select commit Hold shift + click to select a range
eba4b90
Also automatically redirect from login.php to index.php when a user i…
DL6ER Jan 30, 2023
ec31584
Add clients.total and gravity.domains_being_blocked to /stats/summary
DL6ER Jan 30, 2023
da6a1ae
Add {GET,DELETE} /api/info/messages
DL6ER Jan 30, 2023
5e2e6e6
Merge branch 'development' into new/http
DL6ER Feb 1, 2023
2f2b88e
Append target=... when redirecting to the login page on failed authen…
DL6ER Feb 1, 2023
65a31f0
Improvements for the query log filter suggestions (increase default n…
DL6ER Feb 1, 2023
1e83b08
Implement FTL-provided PHP function fileversion()
DL6ER Feb 1, 2023
141b687
Move /api/{dns -> info}/cache
DL6ER Feb 1, 2023
a442f36
Ensure config struct is always initialized (also when reading the leg…
DL6ER Feb 3, 2023
187b0be
Rename config.webserver.{api => }.sessionTimeout and ensure it is als…
DL6ER Feb 3, 2023
cf82495
Create new webtheme() PHP function and make the webtheme an enum
DL6ER Feb 3, 2023
904e1c7
Allow importing teleporter archives from the CLI
DL6ER Feb 3, 2023
39c91f9
Integrate former /api/config/_{topic,servers} into /api/config?detail…
DL6ER Feb 4, 2023
78a09df
Make a few more config values camelCase
DL6ER Feb 5, 2023
9fdecae
Add GET /api/dhcp/leases
DL6ER Feb 5, 2023
ac4c9e7
Add DELETE /api/dhcp/leases/{ip}
DL6ER Feb 5, 2023
9833fe1
Reload gravity database when 'updated' property in table 'info' has c…
DL6ER Feb 5, 2023
8f33706
Ensure no debug output is leaking into the output of pihole-FTL --con…
DL6ER Feb 5, 2023
501455e
Add quiet CLI config mode (e.g., "pihole-FTL --config -q dns.blocking…
DL6ER Feb 5, 2023
42c496e
Add pseudo-element config->webserver.api.password which will compute …
DL6ER Feb 5, 2023
6f72b98
Slightly restructure output from /api/info/sensors and include all se…
DL6ER Feb 5, 2023
08025c1
Add config->webserver.api.password to OpenAPI specs
DL6ER Feb 5, 2023
40739ab
Do not include the high number of sensors that have a temperature of …
DL6ER Feb 6, 2023
b299ca2
Group sensors by the hardware they belong to
DL6ER Feb 6, 2023
4ee054b
Only warn once about disk shortage in case database and log file are …
DL6ER Feb 6, 2023
daa87f2
Rename dns.reply.host.{overwrite_v => force}{4,6}
DL6ER Feb 6, 2023
d7da3f7
Improve disk shortage warning to point out more precisely which files…
DL6ER Feb 6, 2023
49c978a
Add filesystem type in disk usage warning (if available)
DL6ER Feb 7, 2023
5fdf7dd
Include "source" of hwmon items and individual sensor's "max" and "cr…
DL6ER Feb 7, 2023
ad43d2d
Add suggested CPU temperature which can be used by the client to disp…
DL6ER Feb 9, 2023
a1fe32a
Do not wrap strings in quotes for the CLI --config option
DL6ER Feb 11, 2023
b85a14f
Return exit code 2 if specified config type is invalid in --config
DL6ER Feb 11, 2023
37d9c15
Remove leftover debug output when setting the password via CLI
DL6ER Feb 11, 2023
bcda8cc
Add dns.cache.optimizer as option to control the usage of expired/sta…
DL6ER Feb 11, 2023
83195e6
Change /api/info/cache -> /api/info/metrics and add other metrics suc…
DL6ER Feb 11, 2023
e039fd1
Allow removing password by sending a blank value to the magic passwor…
DL6ER Feb 11, 2023
9483ed6
Add new regex extension ";reply=CNAME,target.domain" suitable for def…
DL6ER Feb 11, 2023
5e43631
Invalidate all currently active sessions when password/pwhash are cha…
DL6ER Feb 12, 2023
db0217f
Add GET /api/auth/sessions for listing the currently active sessions
DL6ER Feb 12, 2023
fd8f788
Avoid undefined behaviour with the ctype(3) functions.
Feb 25, 2023
9eaab48
Mark currently active session when listing active sessions
DL6ER Feb 14, 2023
1bb5e26
Add info.ftl.uptime (in ms) and move config.{dns => dhcp}.domain
DL6ER Feb 18, 2023
dd9c4ad
Add special debug.all config option
DL6ER Feb 18, 2023
fe6093f
Remember login timestamp of API sessions
DL6ER Feb 18, 2023
4cc66df
Rename /api/auth/session{ => s}
DL6ER Feb 18, 2023
b0c46dc
Sub-paths in /api/auth are not allowed (except for explicitly existin…
DL6ER Feb 18, 2023
fc6a0d0
Ensure individual config settings areforced to false when debug.all i…
DL6ER Feb 18, 2023
6a19942
Add option dhcp.multiDNS
DL6ER Feb 20, 2023
ce96c5b
Rename config.files.{http_info => log.webserver, ph7_error => log.ph7…
DL6ER Feb 23, 2023
4ea0bf7
Always update last_disk_db_idx after storing queries on disk as sqlit…
DL6ER Feb 25, 2023
9bf6176
Add TOTP 2FA to web interface and API
DL6ER Mar 6, 2023
3c99a35
Add --totp option to help text and always return 0 when no TOTP secre…
DL6ER Mar 7, 2023
10ad7dd
Add fallback randomness generation method for glibc older than 2.25 (…
DL6ER Mar 7, 2023
efa6912
Make webserver.api.temp.unit its own config enum type
DL6ER Mar 8, 2023
ce33f58
Merge changes from https://github.com/civetweb/civetweb/pull/1144 to …
DL6ER Apr 1, 2023
4890e16
Use cryptographic randomness also for te API challenge and the SID ge…
DL6ER Mar 8, 2023
7494862
Add method for deleteing sessions by their IDs
DL6ER Mar 8, 2023
44c3fe4
Merge remote-tracking branch 'origin/development' into new/http
DL6ER Mar 13, 2023
9b32553
Add API documentation for method to delete session by ID
DL6ER Mar 13, 2023
e08b14a
Rely on ENV var STATIC when compiling musl builds to simplify working…
DL6ER Mar 13, 2023
f7a784b
Pass SQLite3 errors when finishing the teleporter transaction commit …
DL6ER Mar 13, 2023
d0e3500
Even when database.network.parseARPcache is set to false, FTL should …
DL6ER Mar 13, 2023
fba171f
Delete only up to 1% of the queries in the database in one go to avoi…
DL6ER Mar 13, 2023
9c3820a
!!! BREAKING CHANGE !!! Reduce default value of database.maxDBdays fr…
DL6ER Mar 13, 2023
3f3cdf5
Do not make any assumptions about sensors being present but simply ch…
DL6ER Mar 13, 2023
40fb31a
Add "cpu_thermal" as CPU temperature sensor indicator
DL6ER Mar 13, 2023
99d64e9
Merge branch 'update/dnsmasq' into new/http
DL6ER Mar 31, 2023
68242de
Improve cache use with --filter-A and --filter-AAAA
simonkelley Mar 20, 2023
875d518
More --filter-AAAA caching improvements.
simonkelley Mar 20, 2023
3c40a98
Add EDE "filtered" extended error when --filter-A or --filter-AAAA act.
simonkelley Mar 20, 2023
fe95fa5
Fold F_NOERR and F_DNSSEC to make space for new F_RR.
simonkelley Mar 20, 2023
ee9564c
Apply necessasry changes to FTL due to most recent dnsmasq commit
DL6ER Mar 31, 2023
4c2090c
Add --cache-rr to enable caching of arbitrary RR types.
simonkelley Mar 23, 2023
bc52372
Apply necessasry changes to FTL due to most recent dnsmasq patch
DL6ER Mar 31, 2023
4288757
Remove code for caching SRV.
simonkelley Mar 28, 2023
91eaa62
Add filtering of arbitrary RR-types.
simonkelley Mar 29, 2023
18a77d3
Optimise no-action case in rrfilter().
simonkelley Mar 30, 2023
8b1d064
Apply necessasry changes to FTL due to most recent dnsmasq patch
DL6ER Mar 31, 2023
fa2aecc
ANY is RRNAME not BLOB after the most recent dnsmasq code changes
DL6ER Mar 31, 2023
06da29d
Merge remote-tracking branch 'origin/update/dnsmasq' into new/http
DL6ER Mar 31, 2023
932d306
Add option for caching all names RRNAMEs that are not already cached …
DL6ER Mar 31, 2023
0da1ae7
inotify.c:event->name is a flexarray and cannot be NULL (fixes RISCV …
DL6ER Mar 31, 2023
064ac81
Add SSL/TLS support (mbedTLS)
DL6ER Mar 31, 2023
ab7bdcd
Optimse memory use for arbitrary-RR caching.
simonkelley Mar 31, 2023
d1b3494
Allow --cache-rr=ANY with the obvious meaning.
simonkelley Mar 31, 2023
a3aaf7c
--domain=# is valid. --synth-domain=# isn't.
simonkelley Mar 31, 2023
d71d0ae
Fix copy-n-paste error in 138e1e2a2d918b37cb0274fe310d53be35acf4cf
simonkelley Mar 31, 2023
879708d
FTL changes related to most recent dnsmasq commits
DL6ER Apr 1, 2023
46bc3c9
Merge remote-tracking branch 'origin/update/dnsmasq' into new/http
DL6ER Apr 1, 2023
a133258
Use new shortcut cache-rr=ANY to enable caching of all query types
DL6ER Apr 1, 2023
c05502f
Reimplement DNS cache metrics in the light of arbitrary RRTYPE caching
DL6ER Apr 1, 2023
efed778
Use v1.27 build containers containing mbed TLS and ZIP
DL6ER Apr 5, 2023
137a151
Now that ZIP is available in the CI environment, use an external tool…
DL6ER Apr 5, 2023
515fe8b
Add certificate generation command (pihole-FTL --gen-x509 ...)
DL6ER Apr 5, 2023
95653e7
Only load TLS certificate when the specified file exists and is readable
DL6ER Apr 5, 2023
020a94f
Generate TLS certificate when not present
DL6ER Apr 5, 2023
705355b
Disable zipinfo test
DL6ER Apr 5, 2023
e79b40d
Simplify EDNS handling code and also interpret replies received from …
DL6ER Apr 7, 2023
a6337b8
Implement EDNS(0) EDE
DL6ER Apr 7, 2023
4b4f113
Use AD bit for IN/SECURE and EDE in SERVFAIL when prox for BOGUSy-dns…
DL6ER Apr 7, 2023
40369b0
Ignore possible EXTRA-TEXT field in EDNS0 EDE data
DL6ER Apr 7, 2023
32d7bfb
Only try to interpret EDNS EDE when EDE data is available
DL6ER Apr 8, 2023
98400b5
Log if EDNS header is NULL and we are in debug mode
DL6ER Apr 8, 2023
77c4f91
Analyse pseudeoheader before it might get stripped off
DL6ER Apr 9, 2023
9c0082f
Explicitly set INSECURE status for replies received either from upstr…
DL6ER Apr 9, 2023
75683b5
Apply the same logic also for reverse lookups (PTR)
DL6ER Apr 9, 2023
677c560
Merge branch 'development' into new/http
DL6ER Apr 11, 2023
9bda9f4
Update CivetWeb to 1.16
DL6ER Apr 11, 2023
db01574
Apply Pi-hole CivetWeb patches
DL6ER Apr 11, 2023
48b0590
Adjust tests for recent EDNS0 changes
DL6ER Apr 11, 2023
49b6bff
Adjust struct sizes
DL6ER Apr 11, 2023
49063e3
Improve cache use with --filter-A and --filter-AAAA
simonkelley Mar 20, 2023
f0ec0f2
More --filter-AAAA caching improvements.
simonkelley Mar 20, 2023
466022e
Add EDE "filtered" extended error when --filter-A or --filter-AAAA act.
simonkelley Mar 20, 2023
4945fab
Fold F_NOERR and F_DNSSEC to make space for new F_RR.
simonkelley Mar 20, 2023
07dec79
Apply necessasry changes to FTL due to most recent dnsmasq commit
DL6ER Mar 31, 2023
5776b74
Add --cache-rr to enable caching of arbitrary RR types.
simonkelley Mar 23, 2023
aa56241
Apply necessasry changes to FTL due to most recent dnsmasq patch
DL6ER Mar 31, 2023
6d9cceb
Remove code for caching SRV.
simonkelley Mar 28, 2023
d7240fa
Add filtering of arbitrary RR-types.
simonkelley Mar 29, 2023
df6b37a
Optimise no-action case in rrfilter().
simonkelley Mar 30, 2023
a530775
Apply necessasry changes to FTL due to most recent dnsmasq patch
DL6ER Mar 31, 2023
bfa4435
ANY is RRNAME not BLOB after the most recent dnsmasq code changes
DL6ER Mar 31, 2023
fe007b7
Optimse memory use for arbitrary-RR caching.
simonkelley Mar 31, 2023
777dc37
Allow --cache-rr=ANY with the obvious meaning.
simonkelley Mar 31, 2023
401e129
--domain=# is valid. --synth-domain=# isn't.
simonkelley Mar 31, 2023
afde359
Fix copy-n-paste error in 138e1e2a2d918b37cb0274fe310d53be35acf4cf
simonkelley Mar 31, 2023
0f764e4
FTL changes related to most recent dnsmasq commits
DL6ER Apr 1, 2023
451bd35
Use a simpler arrangement for the all_addr union to avoid the compile…
simonkelley Apr 1, 2023
28a746b
Fix long-term bug in TCP caching code which would lose NXDOMAIN.
simonkelley Apr 1, 2023
1093470
FTL changes related to most recent dnsmasq commits
DL6ER Apr 2, 2023
0159047
Bump copyrights to 2023.
simonkelley Apr 5, 2023
5f3b789
Make --server=/#/<addr> behave the same as --server=<addr>
simonkelley Apr 5, 2023
e2f7ae6
Missed copyright date.
simonkelley Apr 5, 2023
936703b
Turn "used" member of struct iname into flags in preparation for more.
simonkelley Apr 12, 2023
c093b48
Add --no-dhcpv4-interface and --no-dhcpv6-interface options.
simonkelley Apr 12, 2023
bf5bbb3
If the DHCP lease time is set to "24", it is interpreted as "24h". Th…
DL6ER Apr 15, 2023
b3ef031
Various memory improvements to (a) avoid crash during the final clean…
DL6ER Feb 17, 2023
313c423
Fix not sending domains that have not been seen on the current timefr…
DL6ER Apr 18, 2023
150cb71
Fix paren blunder in aaba66efbd3b4e7283993ca3718df47706a8549b
simonkelley Apr 17, 2023
851a367
Fix crash in dbus code.
pemensik Apr 17, 2023
ffb90c3
Optimization of socket events handling of dbus.
pemensik Apr 17, 2023
a59bbf9
Log failure to determine MAC address in DHCPv6.
simonkelley Apr 17, 2023
fb21b33
Necessary changes due to dnsmasq patch 451bd35ad62c1444b3ef1d204ab606…
DL6ER Apr 20, 2023
7359b49
Move database.maxHistory to webserver.api.maxHistory
DL6ER Apr 25, 2023
c081e9f
Limit data returned by the API for the history endpointy by webserver…
DL6ER Apr 25, 2023
c1d07cb
Add new LUA functions useful for the web interface and define .lp fil…
DL6ER Apr 26, 2023
2b2c02f
Remove PH7
DL6ER Apr 26, 2023
f025598
Simplify webserver logging routines
DL6ER Apr 26, 2023
af1df8a
Add special handling of time_t for 32bit architectures
DL6ER Apr 26, 2023
1d246d5
Log LUA errors into webserver.log. The CivetWeb documentation is wron…
DL6ER Apr 26, 2023
b642bac
Rename the API endpoint from /logs/http to /logs/webserver for consis…
DL6ER Apr 26, 2023
f18c79d
Move Lua-related functions into dedicated source file
DL6ER Apr 26, 2023
5c0dd19
Preserve possible query arguments (GET) when routing throught the log…
DL6ER Apr 26, 2023
e6b46a2
Simplify redirection when user is already authenticated
DL6ER Apr 26, 2023
ec31fd7
Improve RFC3315 para 15 packet validation.
simonkelley Apr 24, 2023
644a37d
Fix issue with stale caching.
simonkelley May 1, 2023
0f51b52
Code tidying.
simonkelley May 1, 2023
87ea7d7
Merge branch 'update/dnsmasq' into new/http
DL6ER May 2, 2023
3f0b8f4
Ensure we always read diagnosis messages from the database
DL6ER May 3, 2023
c9dc537
Also analyze UDP reply headers
DL6ER May 4, 2023
469e73e
Allow deleteing multiple messages at once (provide them comma-separated)
DL6ER May 4, 2023
f31de37
Merge remote-tracking branch 'origin/development' into new/http
DL6ER May 4, 2023
7281da3
Add /api/clients/_suggestions
DL6ER May 5, 2023
7f0bd74
Ensure both type and enabled are returned when requesting domains thr…
DL6ER May 6, 2023
b97d99a
Start timer thread keeping an eye on timed blocking mode changes
DL6ER May 7, 2023
b7b6350
Add method to delete network table entires by their database ID
DL6ER May 7, 2023
c3468b7
Include regex results in domains array when using /search/{domain}
DL6ER May 7, 2023
c12625f
Add global object "took" to all API endpoints
DL6ER May 7, 2023
d4f30e4
Send more gravity-specific quantities in /search/{domain}
DL6ER May 7, 2023
0564d7d
Preserve gravity-specific quantities when updating lists via the API
DL6ER May 7, 2023
507606b
Improve API config handling. Users may now set all config values whet…
DL6ER May 8, 2023
f06b2e5
Add tls boolean to list of sessions to indicate whether this session …
DL6ER May 9, 2023
8c3ed20
Conform internal TLS encryption to TLS NSA Suite B Profile (RFC 6460)…
DL6ER May 9, 2023
dd79cb7
Changing dns.hosts always need a full dnsmasq restart as it is a sing…
DL6ER May 9, 2023
5bcefa3
Type of misc.privacylevel is "enum (unsigned integer)" not "enum (str…
DL6ER May 10, 2023
dba3fa1
Replace test RSA (4096 bit) by ECDSA (521 bit) self-signed certificat…
DL6ER May 10, 2023
391d1c9
Extend /info/metrics to show details also about stale cache records
DL6ER May 11, 2023
0b05860
Fix SQLite3 history + autocompletion
DL6ER May 14, 2023
19efd3e
Always Kepler syntax for Lua server pages
DL6ER May 22, 2023
a02f4eb
Add new Kepler syntax commit to Civetweb-related patch series
DL6ER May 22, 2023
f5cd3b0
Add strict_tls property to list of sessions showing if really every c…
DL6ER May 22, 2023
21ac19b
Merge remote-tracking branch 'origin/development' into new/http
DL6ER May 23, 2023
479fc91
Rely on optimizer to decide whether or not to inline is_term() to re…
DL6ER May 23, 2023
f48683a
Continue to run webserver even when dnsmasq fails to still serve the …
DL6ER May 24, 2023
1083128
Fix OpenAPI definition of /api/dns/blocking
DL6ER May 24, 2023
f133596
Improve request handler. No ".lp" pages are to be served without auth…
DL6ER May 24, 2023
7b72c76
Add dns boolean to /api/auth signalling if the DNS server is up and r…
DL6ER May 24, 2023
3b404ff
Add /api/actions/flush/logs
DL6ER May 24, 2023
b5a6ae4
Add /api/action/flush/arp flushing both the network and network_addre…
DL6ER May 24, 2023
c672120
Add a setting to block possibly harmful actions
DL6ER May 24, 2023
6623700
Allow printing the entire configuration (or parts of it) using, e.g. …
DL6ER May 24, 2023
0aecb57
Add to /api/info/ftl if FTL is allowed to perform destructive operati…
DL6ER May 24, 2023
94a1135
Implement *.lp URI rewriting
DL6ER May 25, 2023
44a0a3a
Add FTL URI rewriting changes to CivetWeb
DL6ER May 25, 2023
182a107
Add new CivetWeb patch needed for URL rewriting
DL6ER May 25, 2023
f785e18
Add mbedTLS debug logging hook
DL6ER May 25, 2023
54cf9ad
Add new debug.tls option logging any mbedTLS debug output to webserve…
DL6ER May 25, 2023
04e9c7e
Enlarge size of FIFO to 512 lines (before 128 lines). As we reduce th…
DL6ER May 26, 2023
d86a2f1
Add pihole.webhome() and add settings + group pages deep URI rewrite
DL6ER May 26, 2023
8966c71
Keep query string when redirecting from /abc.lp to /abc
DL6ER May 27, 2023
69e49d3
Do not lock shm during /api/queries operation
DL6ER May 27, 2023
b88e8d2
Update number of queries in databases when they are changed
DL6ER May 27, 2023
7774e37
Fix GC removing too many queries from the in-memory database
DL6ER May 27, 2023
4f7e347
Simplify GET string parsing and ensure we decode URI components where…
DL6ER May 27, 2023
87a1e4a
Add magic upstream destinations "blocklist" and "cache"
DL6ER May 27, 2023
38c7372
get_blocked_statuslist() and get_cached_statuslist() are pure functions
DL6ER May 27, 2023
fe3ed0b
Add LUA pihole.needLogin(remote_addr)
DL6ER May 28, 2023
13e3421
Write-only property webserver.api.password should reset all sessions …
DL6ER May 28, 2023
73ae7e9
Move password-related functions into a dedicated file
DL6ER May 28, 2023
c5da10a
Use mbedTLS PRNG to generate X.509 certificate serial number
DL6ER May 28, 2023
d42d4be
Add webserver.tls.rev_server boolean useful to tell FTL that unencryp…
DL6ER May 28, 2023
159e6a5
Store certificate-only file during X.509 generation
DL6ER May 28, 2023
19c72d3
!!! BREAKING CHANGE !!! Switch to the proven memory-hard password-has…
DL6ER May 30, 2023
62cfc25
Fix spelling in v6
yubiuser May 30, 2023
40e325d
Fix getrandom() for glibc <2.25
yubiuser May 30, 2023
44e7007
Fix warnings shown when compiling with musl-gcc for 32bit targets
DL6ER May 31, 2023
a4c2e3e
Use new buildx-provided containers
DL6ER May 31, 2023
a3466e4
sizeof(time_t) is 8 on both 32 and 64 bit with musl
DL6ER May 31, 2023
59463db
Modify arch-tests, refine how we detect an already running pihole-FTL…
DL6ER May 31, 2023
d3fac0f
Merge pull request #1571 from pi-hole/fix/spelling_v6
DL6ER Jun 2, 2023
7ad68b7
Fix favicon for API documentation (in the same way we did for the web…
DL6ER Jun 3, 2023
8468e34
Fix off-by-one mistake in query type counters
DL6ER Jun 3, 2023
7cacf66
Fix "Invalid write/read of size 1" possibly leading to a crash in web…
DL6ER Jun 3, 2023
6975a17
Allow fractional delay for blocking mode changes and fix a few smalle…
DL6ER Jun 3, 2023
f5f0354
Generate and store CSRF token in the session
DL6ER Jun 3, 2023
4890e1c
Register CSRF token in conn->request_info
DL6ER Jun 3, 2023
af4ce5c
Add more recent commit to Civetweb patch series
DL6ER Jun 3, 2023
d9c09b6
Use pi-hole/ftl-build:ftl-build-buildx containers
DL6ER Jun 4, 2023
cd5ff54
Add minimum GLIBC version check
DL6ER Jun 7, 2023
8135098
Accept cookie authentication only when CSRF header is provided (and c…
DL6ER Jun 4, 2023
8176254
Merge branch 'new/http-buildx' into new/http
DL6ER Jun 4, 2023
2baa91b
Enforece cookie auth only for API endpoints
DL6ER Jun 7, 2023
b976be2
Update default HTTP headers
DL6ER Jun 8, 2023
ba507ef
Merge branch 'special/CI_development' into new/http
DL6ER Jun 8, 2023
c54a9e2
Verify generated Tleporter ZIP files after creation
DL6ER Jun 8, 2023
1644ef0
Merge branch 'development' into new/http
DL6ER Jun 12, 2023
a7f47a5
The number of entries on a list should be the sum of domains and ABP-…
DL6ER Jun 12, 2023
5e8525e
Rename default theme to auto theme
DL6ER Jun 14, 2023
0002399
Add high-contrast themes to list of available themes)
DL6ER Jun 14, 2023
07f1f7d
Save number of ABP-style entries in adlist table's new column abp_ent…
DL6ER Jun 15, 2023
9f808b9
Pass new abp_entries number to API
DL6ER Jun 15, 2023
16d43a5
Spell-check fixes (RFC 6891 uses requestor with o so I assume this is…
DL6ER Jun 15, 2023
3e10f67
There is a certain level of arbitrariness in how spell-check works ..…
DL6ER Jun 15, 2023
b2ad7af
Add pihole-fTL gravity checkList <file> option
DL6ER Jun 15, 2023
73f9ad0
Allow defining lines to inject into the generated dnsmasq configurati…
DL6ER Jun 15, 2023
61931f9
Add enum values for high-cotnrast theme family
DL6ER Jun 17, 2023
3dcbaf7
Add support for IPv6-only nameserver system configurations
DL6ER Jun 17, 2023
85c797a
Also backup and restore IPv6 ports
DL6ER Jun 17, 2023
d71e174
Fix config output on CLI and add tests for it
DL6ER Jun 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "FTL x86_64 Build Env",
"image": "ghcr.io/pi-hole/ftl-build:x86_64",
"name": "FTL x86_64 Build Env",
"image": "ghcr.io/pi-hole/ftl-build:x86_64-musl",
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
"extensions": [
"jetmartin.bats",
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"eamodio.gitlens"
],
}
]
}
3 changes: 3 additions & 0 deletions .github/.codespellignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ ssudo
tre
ede
nd
doubleclick
requestor
requestors
1 change: 1 addition & 0 deletions .github/.codespellignore_lines
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
self.errors.append("Exception when GETing from FTL: " + str(e))
33 changes: 33 additions & 0 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
ARG BUILDER="alpine"
FROM ghcr.io/pi-hole/ftl-build:ftl-build-buildx-${BUILDER} AS builder

WORKDIR /app

COPY . /app

ARG CI_ARCH="linux/amd64"
ENV CI_ARCH ${CI_ARCH}
ARG GIT_BRANCH="test"
ENV GIT_BRANCH ${GIT_BRANCH}
ARG GIT_TAG="test"
ENV GIT_TAG ${GIT_TAG}

# Build FTL
# Remove possible old build files
RUN rm -rf cmake && \
# Build FTL
bash build.sh "-DSTATIC=${STATIC}" && \
# Run binary architecture tests
bash test/arch_test.sh && \
# Run full test suite
bash test/run.sh && \
# Move FTL binary to root directory
cd / &&\
mv /app/pihole-FTL . && \
# Create tarball of API docs
tar -C /app/src/api/docs/content/ -czvf /api-docs.tar.gz .

# Create final image containing only the FTL binary and API docs
FROM scratch AS result
COPY --from=builder /pihole-FTL /pihole-FTL
COPY --from=builder /api-docs.tar.gz /api-docs.tar.gz
133 changes: 82 additions & 51 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,81 +50,102 @@ jobs:

build:
runs-on: ubuntu-latest

needs: smoke-tests

container: ghcr.io/pi-hole/ftl-build:v1.26-${{ matrix.arch }}

strategy:
fail-fast: false

matrix:
include:
- arch: x86_64
bin_name: pihole-FTL-linux-x86_64
- arch: x86_64
arch_extra: _full
bin_name: pihole-FTL-linux-x86_64_full
- arch: x86_64-musl
bin_name: pihole-FTL-musl-linux-x86_64
- arch: x86_32
bin_name: pihole-FTL-linux-x86_32
- arch: armv4t
bin_name: pihole-FTL-armv4-linux-gnueabi
- arch: armv5te
bin_name: pihole-FTL-armv5-linux-gnueabi
- arch: armv6hf
bin_name: pihole-FTL-armv6-linux-gnueabihf
- arch: armv7hf
bin_name: pihole-FTL-armv7-linux-gnueabihf
- arch: armv8a
bin_name: pihole-FTL-armv8-linux-gnueabihf
- arch: aarch64
bin_name: pihole-FTL-aarch64-linux-gnu
- arch: riscv64
bin_name: pihole-FTL-riscv64-linux-gnu
- platform: linux/amd64
bin_name: pihole-FTL-amd64
builder: alpine
- platform: linux/386
bin_name: pihole-FTL-386
builder: alpine
- platform: linux/arm/v5
bin_name: pihole-FTL-armv4
builder: debian
- platform: linux/arm/v6
bin_name: pihole-FTL-armv5
builder: debian
- platform: linux/arm/v6
bin_name: pihole-FTL-armv6
builder: alpine
- platform: linux/arm/v7
bin_name: pihole-FTL-armv7
builder: alpine
- platform: linux/arm64/v8
bin_name: pihole-FTL-arm64
builder: alpine
- platform: linux/riscv64
bin_name: pihole-FTL-riscv64
builder: alpine

env:
CI_ARCH: ${{ matrix.arch }}${{ matrix.arch_extra }}
CI_ARCH: ${{ matrix.platform }}
GIT_BRANCH: ${{ needs.smoke-tests.outputs.GIT_BRANCH }}
GIT_TAG: ${{ needs.smoke-tests.outputs.GIT_TAG }}

steps:
-
name: Checkout code
uses: actions/[email protected]
-
name: "Fix ownership of repository"
run: chown -R root .
-
name: "Fix ownership of repository"
run: chown -R root .
name: Set up Docker Buildx
uses: docker/[email protected]
-
name: "Build"
env:
GIT_BRANCH: ${{ needs.smoke-tests.outputs.GIT_BRANCH }}
GIT_TAG: ${{ needs.smoke-tests.outputs.GIT_TAG }}
run: |
bash build.sh "-DSTATIC=${STATIC}"
name: Print directory contents
run: ls -l
-
name: "Binary checks"
run: |
bash test/arch_test.sh
-
name: "Test x86_32/64 binaries"
if: matrix.arch == 'x86_64' || matrix.arch == 'x86_64-musl' || matrix.arch == 'x86_32'
name: Build and test FTL in ftl-build container (QEMU)
uses: docker/[email protected]
with:
# tags: ghcr.io/pi-hole/ftl-build:v2.0
platforms: ${{ matrix.platform }}
# Always load latest container image
pull: true
# Do not push anything
push: false
context: .
target: result
file: .github/Dockerfile
outputs: |
type=tar,dest=build.tar
build-args: |
"BUILDER=${{ matrix.builder }}"
"CI_ARCH=${{ matrix.platform }}"
"GIT_BRANCH=${{ needs.smoke-tests.outputs.GIT_BRANCH }}"
"GIT_TAG=${{ needs.smoke-tests.outputs.GIT_TAG }}"
-
name: List files in current directory
run: ls -l
-
name: Extract FTL binary from container
run: |
bash test/run.sh
tar -xf build.tar pihole-FTL
-
name: "Generate checksum file"
run: |
mv pihole-FTL "${{ matrix.bin_name }}"
sha1sum pihole-FTL-* > ${{ matrix.bin_name }}.sha1
-
name: Upload artifacts to job for later processing
name: Store binary artifacts for later deployoment
if: github.event_name != 'pull_request'
uses: actions/[email protected]
with:
name: tmp-binary-storage
name: tmp-storage
path: '${{ matrix.bin_name }}*'
-
name: Extract documentation files from container
if: github.event_name != 'pull_request' && matrix.platform == 'linux/amd64'
run: |
tar -xf build.tar api-docs.tar.gz
-
name: Upload documentation artifacts for deployoment
if: github.event_name != 'pull_request' && matrix.platform == 'linux/amd64'
uses: actions/[email protected]
with:
name: tmp-storage
path: 'api-docs.tar.gz'

deploy:
if: github.event_name != 'pull_request'
Expand All @@ -135,11 +156,11 @@ jobs:
name: Checkout code
uses: actions/[email protected]
-
name: Get Binaries built in previous jobs
name: Get Binaries and documentation built in previous jobs
uses: actions/[email protected]
id: download
with:
name: tmp-binary-storage
name: tmp-storage
path: ftl-builds/
-
name: Display structure of downloaded files
Expand All @@ -151,6 +172,16 @@ jobs:
with:
private-key: ${{ secrets.SSH_KEY }}
known-hosts: ${{ secrets.KNOWN_HOSTS }}
-
name: Untar documentation files
working-directory: ${{steps.download.outputs.download-path}}
run: |
mkdir docs/
tar xzvf api-docs.tar.gz -C docs/
-
name: Display structure of files ready for upload
run: ls -R
working-directory: ${{steps.download.outputs.download-path}}
-
name: Transfer Builds to Pi-hole server for pihole checkout
if: github.actor != 'dependabot[bot]'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ jobs:
uses: codespell-project/actions-codespell@master
with:
ignore_words_file: .github/.codespellignore
skip: ./src/database/sqlite3.c,./src/database/sqlite3.h,./src/database/shell.c,./src/lua,./src/dnsmasq,./src/tre-regex,./.git,./test/libs
skip: ./src/database/sqlite3.c,./src/database/sqlite3.h,./src/database/shell.c,./src/lua,./src/dnsmasq,./src/tre-regex,./.git,./test/libs,./src/webserver/civetweb,./src/zip/miniz,./src/api/docs/content/external
exclude_file: .github/.codespellignore_lines
2 changes: 1 addition & 1 deletion .github/workflows/merge-conflict.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
types: [synchronize]

jobs:
main:
merge-conflict:
runs-on: ubuntu-latest
steps:
- name: Check if PRs are have merge conflicts
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/openapi-validator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: API validation

on: [push]

env:
CI: true

jobs:
openapi-validator:
name: Node
runs-on: ubuntu-latest

steps:
- name: Clone repository
uses: actions/[email protected]

- name: Set Node.js version
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Install npm dependencies
run: npm ci

- name: Run tests
run: npm test
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Generated binary
pihole-FTL
pihole-FTL*

# Versioning files (generated by Makefile)
version*
version.h
version~

# CMake files generated during compilation
/cmake/
Expand All @@ -12,6 +13,7 @@ version*
# IDE files
.idea/
*.sw*
/.vscode
.vscode/
/.vscode/
/build/
Expand All @@ -20,6 +22,9 @@ version*
tools/manuf.data
tools/macvendor.db

# Documentation files generated by cmake
src/api/docs/hex

# Test dependencies
/node_modules/

Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# Please see LICENSE file for your rights under this license.

cmake_minimum_required(VERSION 2.8.12)

project(PIHOLE_FTL C)

set(DNSMASQ_VERSION pi-hole-v2.89-9461807)
Expand Down
Loading