diff --git a/.github/workflows/.pre-commit-config.yaml b/.github/workflows/.pre-commit-config.yaml deleted file mode 100644 index 027ab32..0000000 --- a/.github/workflows/.pre-commit-config.yaml +++ /dev/null @@ -1,12 +0,0 @@ -repos: - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.9 - hooks: - - id: ruff - args: [--fix] - - id: ruff-format - - repo: https://github.com/psf/black - rev: 24.8.0 - hooks: - - id: black - args: [--quiet] diff --git a/.github/workflows/buildx.yml b/.github/workflows/buildx.yml index 85a451c..d89eea5 100644 --- a/.github/workflows/buildx.yml +++ b/.github/workflows/buildx.yml @@ -3,7 +3,7 @@ name: buildx on: workflow_run: workflows: ["docker_main"] - branches: [main] + branches: [main, updates] types: - completed push: @@ -50,6 +50,17 @@ jobs: # docker buildx build --push \ # --tag ghcr.io/benbusby/whoogle-search:latest \ # --platform linux/amd64,linux/arm64 . + - name: build and push updates branch (update-testing tag) + if: github.event.workflow_run.head_branch == 'updates' && github.event.workflow_run.conclusion == 'success' && (github.actor == 'benbusby' || github.actor == 'Don-Swanson') + run: | + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + docker buildx ls + docker buildx build --push \ + --tag benbusby/whoogle-search:update-testing \ + --platform linux/amd64,linux/arm/v7,linux/arm64 . + docker buildx build --push \ + --tag ghcr.io/benbusby/whoogle-search:update-testing \ + --platform linux/amd64,linux/arm/v7,linux/arm64 . - name: build and push release (version + latest) if: github.event_name == 'release' && github.event.release.prerelease == false && (github.actor == 'benbusby' || github.actor == 'Don-Swanson') run: | diff --git a/.github/workflows/docker_main.yml b/.github/workflows/docker_main.yml index f369f47..5e30a55 100644 --- a/.github/workflows/docker_main.yml +++ b/.github/workflows/docker_main.yml @@ -3,7 +3,7 @@ name: docker_main on: workflow_run: workflows: ["tests"] - branches: [main] + branches: [main, updates] types: - completed diff --git a/app/models/config.py b/app/models/config.py index ed56af8..3446309 100644 --- a/app/models/config.py +++ b/app/models/config.py @@ -81,7 +81,6 @@ class Config: self.tbs = os.getenv('WHOOGLE_CONFIG_TIME_PERIOD', '') self.theme = os.getenv('WHOOGLE_CONFIG_THEME', 'system') self.safe = read_config_bool('WHOOGLE_CONFIG_SAFE') - self.dark = read_config_bool('WHOOGLE_CONFIG_DARK') # deprecated self.alts = read_config_bool('WHOOGLE_CONFIG_ALTS') self.nojs = read_config_bool('WHOOGLE_CONFIG_NOJS') self.tor = read_config_bool('WHOOGLE_CONFIG_TOR') diff --git a/app/routes.py b/app/routes.py index 59a14f0..b176000 100644 --- a/app/routes.py +++ b/app/routes.py @@ -217,9 +217,7 @@ def index(): translation=app.config['TRANSLATIONS'][ g.user_config.get_localization_lang() ], - logo=render_template( - 'logo.html', - dark=g.user_config.dark), + logo=render_template('logo.html'), config_disabled=( app.config['CONFIG_DISABLE'] or not valid_user_session(session)), @@ -581,7 +579,7 @@ def search(): languages=app.config['LANGUAGES'], countries=app.config['COUNTRIES'], time_periods=app.config['TIME_PERIODS'], - logo=render_template('logo.html', dark=g.user_config.dark), + logo=render_template('logo.html'), query=urlparse.unquote(query), search_type=search_util.search_type, mobile=g.user_request.mobile, diff --git a/app/templates/display.html b/app/templates/display.html index c044512..a742284 100644 --- a/app/templates/display.html +++ b/app/templates/display.html @@ -26,10 +26,12 @@ {% else %} {% endif %} - {% else %} - {% endif %} - + {% if config.style %} + + {% endif %} {{ clean_query(query) }} - Whoogle Search diff --git a/app/templates/error.html b/app/templates/error.html index 839f8bc..c7a41eb 100644 --- a/app/templates/error.html +++ b/app/templates/error.html @@ -7,8 +7,6 @@ {% else %} {% endif %} -{% else %} - {% endif %} {% if bundle_static() %} diff --git a/app/templates/index.html b/app/templates/index.html index d4544fa..c6fe19e 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -41,8 +41,6 @@ {% else %} {% endif %} - {% else %} - {% endif %} {% if not bundle_static() %} @@ -204,10 +202,6 @@ - - - -
diff --git a/app/version.py b/app/version.py index 5e990ac..6a53b0c 100644 --- a/app/version.py +++ b/app/version.py @@ -1,8 +1,8 @@ import os -optional_dev_tag = '' +optional_dev_tag = '-update-testing' if os.getenv('DEV_BUILD'): optional_dev_tag = '.dev' + os.getenv('DEV_BUILD') -__version__ = '1.1.2' + optional_dev_tag +__version__ = '1.2.0' + optional_dev_tag diff --git a/pyproject.toml b/pyproject.toml index 0422ce1..e68ec35 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [tool.ruff] line-length = 100 -target-version = "py311" +target-version = "py312" lint.select = [ "E", "F", "W", # pycodestyle/pyflakes "I", # isort @@ -13,4 +13,4 @@ lint.ignore = [] [tool.black] line-length = 100 -target-version = ['py311'] +target-version = ['py312'] diff --git a/requirements.txt b/requirements.txt index b2a71b1..fae9740 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,13 +4,12 @@ brotli==1.2.0 certifi==2025.8.3 cffi==2.0.0 click==8.3.0 -cryptography==3.3.2; platform_machine == 'armv7l' -cryptography==46.0.1; platform_machine != 'armv7l' +cryptography==46.0.1 cssutils==2.11.1 defusedxml==0.7.1 -Flask==2.3.2 +Flask==3.1.2 idna==3.10 -itsdangerous==2.1.2 +itsdangerous==2.2.0 Jinja2==3.1.6 MarkupSafe==3.0.2 more-itertools==10.8.0 @@ -18,8 +17,7 @@ packaging==25.0 pluggy==1.6.0 pycodestyle==2.14.0 pycparser==2.22 -pyOpenSSL==19.1.0; platform_machine == 'armv7l' -pyOpenSSL==25.3.0; platform_machine != 'armv7l' +pyOpenSSL==25.3.0 pyparsing==3.2.5 pytest==8.3.3 python-dateutil==2.9.0.post0 @@ -32,5 +30,5 @@ h11>=0.16.0 validators==0.35.0 waitress==3.0.2 wcwidth==0.2.14 -Werkzeug==3.0.6 +Werkzeug==3.1.3 python-dotenv==1.1.1 diff --git a/test/conftest.py b/test/conftest.py index bd9017a..28225a1 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -8,7 +8,6 @@ import random demo_config = { 'near': random.choice(['Seattle', 'New York', 'San Francisco']), - 'dark': str(random.getrandbits(1)), 'nojs': str(random.getrandbits(1)), 'lang_interface': random.choice(app.config['LANGUAGES'])['value'], 'lang_search': random.choice(app.config['LANGUAGES'])['value'], diff --git a/test/test_routes.py b/test/test_routes.py index 1f64827..9cfe975 100644 --- a/test/test_routes.py +++ b/test/test_routes.py @@ -75,14 +75,14 @@ def test_config(client): # Test disabling changing config from client app.config['CONFIG_DISABLE'] = 1 - dark_mod = not demo_config['dark'] - demo_config['dark'] = dark_mod + nojs_mod = not bool(int(demo_config['nojs'])) + demo_config['nojs'] = str(int(nojs_mod)) rv = client.post(f'/{Endpoint.config}', data=demo_config) assert rv._status_code == 403 rv = client.get(f'/{Endpoint.config}') config = json.loads(rv.data) - assert config['dark'] != dark_mod + assert config['nojs'] != nojs_mod def test_opensearch(client):