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

Enhance theme validation #1500

Merged
merged 1 commit into from
Dec 23, 2023

Conversation

ADawidowski
Copy link
Contributor

Makes the web theme name validation dynamic based on the existing theme css file names and applies a regexp sanity check just to be sure.

Description

Modified bash_funcitons.sh:setup_web_theme.sh to replace static web theme name validation with dynamic one in order to make the validation future proof.

Motivation and Context

Adding new themes requires modification of the validation function. This change modifies the validation code so that it accepts every theme that exists in the file system location.
Example: currently the recently-added lcars-picard theme is not accepted by the validation function because it has not been explicitly added to the validation code. This code change fixes that.

How Has This Been Tested?

Ran standalone unit tests on the extracted setup_web_theme function. Added tests to the test suite. Added test fixture that temporarily creates empty theme files during the tests for the purpose of testing new known names.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • [?] My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Makes the validation dynamic based on the existing theme css file names and
applies a regexp sanity check just to be sure.

Signed-off-by: Adam Dawidowski <drake@oomkill.net>
Copy link
Member

@PromoFaux PromoFaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the submission, and thanks for adding comprehensive tests!

I'll accept this as-is for the time being, but there are no major plans to do another release of the v5-based code any time soon.

In the v6 (see branch development-v6 all repos) container, all settings are handled internally by pihole-FTL, and as such are to be configured with an env var like FTLCONF_webserver_interface_theme: 'default-dark' etc.

@PromoFaux PromoFaux merged commit f400bef into pi-hole:dev Dec 23, 2023
7 checks passed
@rdwebdesign rdwebdesign linked an issue Feb 24, 2024 that may be closed by this pull request
5 tasks
truecharts-admin referenced this pull request in truecharts/public Mar 4, 2024
…56 by renovate (#18853)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [pihole/pihole](https://github.com/pi-hole/docker-pi-hole) | patch |
`2024.02.0` -> `2024.02.2` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>pi-hole/docker-pi-hole (pihole/pihole)</summary>

###
[`v2024.02.2`](https://github.com/pi-hole/docker-pi-hole/releases/tag/2024.02.2)

[Compare
Source](https://github.com/pi-hole/docker-pi-hole/compare/2024.02.1...2024.02.2)

Jumped the gun a little with the last tag - didn't realise there were
changes ready to go! Should fix:
[https://github.com/pi-hole/docker-pi-hole/issues/1543](https://github.com/pi-hole/docker-pi-hole/issues/1543)

<!-- Release notes generated using configuration in .github/release.yml
at master -->

#### What's Changed

- Enhance theme validation by
[@&#8203;ADawidowski](https://github.com/ADawidowski) in
[https://github.com/pi-hole/docker-pi-hole/pull/1500](https://github.com/pi-hole/docker-pi-hole/pull/1500)

#### New Contributors

- [@&#8203;ADawidowski](https://github.com/ADawidowski) made their
first contribution in
[https://github.com/pi-hole/docker-pi-hole/pull/1500](https://github.com/pi-hole/docker-pi-hole/pull/1500)

**Full Changelog**:
pi-hole/docker-pi-hole@2024.02.0...2024.02.2

###
[`v2024.02.1`](https://github.com/pi-hole/docker-pi-hole/releases/tag/2024.02.1)

[Compare
Source](https://github.com/pi-hole/docker-pi-hole/compare/2024.02.0...2024.02.1)

Nothing Docker-specific this time around, tagging to include FTL v5.25.1

<!-- Release notes generated using configuration in .github/release.yml
at master -->

#### What's Changed (FTL)

- Fix spurious "resource limit exceeded" messages (v5 backport) by
[@&#8203;DL6ER](https://github.com/DL6ER) in
[https://github.com/pi-hole/FTL/pull/1893](https://github.com/pi-hole/FTL/pull/1893)

**Full Changelog**:
pi-hole/FTL@v5.25...v5.25.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 10pm on monday" in timezone
Europe/Amsterdam, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMjUuMCIsInVwZGF0ZWRJblZlciI6IjM3LjIyNS4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIn0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WEBTHEME not recognizing lcars-picard
2 participants