Full Code of Metastem/wikiless for AI

main 64b229e31489 cached
48 files
925.2 KB
302.3k tokens
3 symbols
1 requests
Download .txt
Showing preview only (958K chars total). Download the full file or copy to clipboard to get everything.
Repository: Metastem/wikiless
Branch: main
Commit: 64b229e31489
Files: 48
Total size: 925.2 KB

Directory structure:
gitextract_kle9h_1m/

├── .dockerignore
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   └── feature_request.md
│   ├── dependabot.yml
│   └── workflows/
│       ├── ci.yml
│       └── docker-image.yml
├── .gitignore
├── Chinese.md
├── Dockerfile
├── LICENSE.md
├── Persian.md
├── README.md
├── Russian.md
├── SECURITY.md
├── __tests__/
│   ├── routes.test.js
│   ├── smoketest.test.js
│   └── utils.test.js
├── media/
│   └── .gitignore
├── package.json
├── src/
│   ├── cache_control.js
│   ├── routes.js
│   ├── utils.js
│   └── wikiless.js
├── static/
│   ├── .well-known/
│   │   ├── ai.txt
│   │   ├── dnt-policy.txt
│   │   ├── gpc.json
│   │   └── tdmrep.json
│   ├── about.html
│   ├── ip-ranges.txt
│   ├── mobile.css
│   ├── robots.txt
│   ├── styles.css
│   ├── styles_de.css
│   ├── styles_fr.css
│   ├── styles_ko.css
│   ├── styles_vi.css
│   ├── verify.txt
│   ├── wikipedia_styles_dark.css
│   ├── wikipedia_styles_dark_de.css
│   ├── wikipedia_styles_dark_fr.css
│   ├── wikipedia_styles_dark_ko.css
│   ├── wikipedia_styles_dark_vi.css
│   ├── wikipedia_styles_light.css
│   ├── wikipedia_styles_light_de.css
│   ├── wikipedia_styles_light_fr.css
│   ├── wikipedia_styles_light_ko.css
│   └── wikipedia_styles_light_vi.css
└── wikiless.config

================================================
FILE CONTENTS
================================================

================================================
FILE: .dockerignore
================================================
.git*
docker-compose.yml
node_modules
*.md
.env*


================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
 - OS: [e.g. iOS]
 - Browser [e.g. chrome, safari]
 - Version [e.g. 22]

**Smartphone (please complete the following information):**
 - Device: [e.g. iPhone6]
 - OS: [e.g. iOS8.1]
 - Browser [e.g. stock browser, safari]
 - Version [e.g. 22]

**Additional context**
Add any other context about the problem here.


================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.


================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
# Maintain dependencies for GitHub Actions
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "daily"
      
    # Maintain dependencies for npm
  - package-ecosystem: "npm"
    directory: "/"
    schedule:
      interval: "daily"

  # Docker dependencies
  - package-ecosystem: "docker"
    directory: "/"
    schedule:
      interval: "daily"


================================================
FILE: .github/workflows/ci.yml
================================================
name: CI
permissions:
  contents: read
  pull-requests: write
  
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  test-build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [25.x, 24.x, 22.x]

    steps:
      - name: Checkout code
        uses: actions/checkout@v6

      - name: Setup Node.js
        uses: actions/setup-node@v6
        with:
          node-version: ${{ matrix.node-version }}
          cache: 'npm'

      - name: Install dependencies
        run: npm ci

      - name: Run tests
        run: npm test

      - name: Security audit
        run: npm audit --audit-level=moderate



================================================
FILE: .github/workflows/docker-image.yml
================================================
services:
  wikiless:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: wikiless
    hostname: wikiless
    restart: always
    networks:
      - wikiless_net
    environment:
      REDIS_HOST: redis://wikiless_redis:6379
    ports:
      - "127.0.0.1:8180:8080" # change port if needed
    security_opt:
      - no-new-privileges:true
    cap_drop:
      - ALL
    depends_on:
        - wikiless_redis

  wikiless_redis:
    container_name: wikiless_redis
    hostname: wikiless_redis
    image: redis:latest
    restart: always
    networks:
      - wikiless_net
    user: nobody
    read_only: true
    security_opt:
      - no-new-privileges:true
    tmpfs:
      - /data:size=10M,mode=0770,uid=65534,gid=65534,noexec,nosuid,nodev
    cap_drop:
      - ALL
    cap_add:
      - SETGID
      - SETUID
      - DAC_OVERRIDE

networks:
  wikiless_net:


================================================
FILE: .gitignore
================================================
node_modules/
config.js
docker-compose.yml
*.log


================================================
FILE: Chinese.md
================================================
[English](README.md) | [中文](Chinese.md) | [فارسی](Persian.md) | [Русский](Russian.md)

# Wikiless

![hidden_dimension](https://github.com/user-attachments/assets/4093053d-a7c4-45aa-8860-ea0f64a841e9)

**Wikiless** 是一个免费、开源的维基百科替代前端,专注于隐私保护。该项目旨在通过最小化数据收集和跟踪,为用户提供更私密和匿名的浏览体验。

### 功能特性
- **隐私优先**:通过限制数据跟踪来增强用户隐私。
- **开源共享**:任何人都可以贡献和改进。
- **替代前端**:提供访问维基百科的另一种界面。
- **抗审查**:在多个被屏蔽的国家提供访问维基百科的途径,实现免翻墙浏览维基百科。

## 安装

运行 Wikiless 的步骤如下:
```
https://github.com/Metastem/Wikiless/wiki
```


## 使用方法

在浏览器中访问 ```http://localhost:8180```,即可本地使用 Wikiless。

## 贡献

欢迎所有形式的贡献!

## TODO

- [x] - 修复点击缩略图后图片无法加载的问题 - [#161](https://github.com/Metastem/Wikiless/issues/161) 和 [#162](https://github.com/Metastem/Wikiless/pull/162)
- [x] - 修复在设置为其他默认语言时,所有语言链接失效的问题 - [#161](https://github.com/Metastem/Wikiless/issues/161)
- [x] - 已修复 [Code Scanning](https://github.com/V4NT-ORG/Wikiless-Reborn/security/code-scanning) 中的 10 个安全问题
- [x] - 进一步加固 ```Dockerfile```
- [x] - 修复了一些小 bug,并在 [```docker-compose.yml```](https://www.baeldung.com/ops/docker-memory-limit) 中添加了内存和 CPU 限制
- [ ] - 支持其他维基百科样式 - [#25](https://github.com/Metastem/Wikiless/issues/25)
- [ ] - 如果某个实例被封锁,则支持条件性跳转 - [#21](https://github.com/Metastem/Wikiless/issues/21)
- [ ] - 修复 MediaWiki CSS 文件循环下载错误
- [ ] - 修复搜索路由错误 - [#166](https://github.com/Metastem/Wikiless/issues/166)
- [ ] - 增加不同语言版本,帮助用户在本国突破政府审查

## 许可证

本项目基于 **GNU Affero General Public License v3.0** 进行授权。


================================================
FILE: Dockerfile
================================================
# For reference to update this file
#https://hub.docker.com/_/node/
#https://github.com/GoogleContainerTools/distroless/blob/main/README.md

# Build stage arguments (needed for npm install permissions)
ARG UID=200003
ARG GID=200003

FROM node:25.2-alpine3.21 AS build

ARG UID=200003
ARG GID=200003

WORKDIR /wikiless
COPY . /wikiless

# Create user in build stage for proper permissions
RUN addgroup -g $GID appgroup && \
    adduser -u $UID -G appgroup -s /bin/sh -D appuser && \
    chown -R appuser:appgroup /wikiless

USER appuser
# Clean npm cache to reduce image size:
RUN npm ci --only=production --omit=optional && npm cache clean --force

# Runtime stage needs redeclared arguments
ARG UID=200003
ARG GID=200003

FROM gcr.io/distroless/nodejs24-debian12

ARG UID=200003
ARG GID=200003

WORKDIR /wikiless

# removing build artifacts (Only copy what's strictly necessary for runtime.)
COPY --from=build --chown=$UID:$GID /wikiless/package.json ./
COPY --from=build --chown=$UID:$GID /wikiless/package-lock.json ./
COPY --from=build --chown=$UID:$GID /wikiless/node_modules ./node_modules
COPY --from=build --chown=$UID:$GID /wikiless/src ./src
COPY --from=build --chown=$UID:$GID /wikiless/media ./media
COPY --from=build --chown=$UID:$GID /wikiless/static ./static

# Distroless doesn't have useradd, so we directly specify UID
USER $UID

# Health Monitoring
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
  CMD ["node", "-e", "require('http').get('http://localhost:8080/health', (res) => process.exit(res.statusCode === 200 ? 0 : 1))"]

COPY --from=build --chown=$UID:$GID /wikiless/wikiless.config ./wikiless.config
CMD ["src/wikiless.js"]


================================================
FILE: LICENSE.md
================================================
                    GNU AFFERO GENERAL PUBLIC LICENSE
                       Version 3, 19 November 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.

  A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate.  Many developers of free software are heartened and
encouraged by the resulting cooperation.  However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.

  The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community.  It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server.  Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.

  An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals.  This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU Affero General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Remote Network Interaction; Use with the GNU General Public License.

  Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software.  This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time.  Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) 2025  Metastem

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published
    by the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source.  For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code.  There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.


================================================
FILE: Persian.md
================================================
[English](README.md) | [中文](Chinese.md) | [فارسی](Persian.md) | [Русский](Russian.md)

# Wikiless

![hidden_dimension](https://github.com/user-attachments/assets/4093053d-a7c4-45aa-8860-ea0f64a841e9)

**Wikiless** یک رابط جایگزین رایگان و متن‌باز برای ویکی‌پدیا است که بر حفاظت از حریم خصوصی تمرکز دارد. هدف این پروژه فراهم کردن تجربه مرور خصوصی‌تر و ناشناس‌تر برای کاربران از طریق به حداقل رساندن جمع‌آوری داده‌ها و ردیابی است.

### ویژگی‌ها
- **اولویت حریم خصوصی**: با محدود کردن ردیابی داده‌ها، حریم خصوصی کاربران افزایش می‌یابد.
- **متن‌باز و اشتراکی**: هر کسی می‌تواند در بهبود و توسعه آن مشارکت کند.
- **رابط جایگزین**: راهی دیگر برای دسترسی به ویکی‌پدیا ارائه می‌دهد.
- **ضد سانسور**: در کشورهایی که ویکی‌پدیا مسدود شده است امکان دسترسی فراهم می‌کند و مرور آزاد را ممکن می‌سازد.

## نصب

برای اجرای Wikiless مراحل زیر را دنبال کنید:
```
https://github.com/Metastem/Wikiless/wiki
```


## روش استفاده

در مرورگر خود به آدرس ```http://localhost:8180``` بروید تا Wikiless را به صورت محلی استفاده کنید.

## مشارکت

از هر نوع مشارکتی استقبال می‌کنیم!

## TODO

- [x] - رفع مشکل بارگذاری نشدن تصاویر پس از کلیک روی بندانگشتی‌ها - [#161](https://github.com/Metastem/Wikiless/issues/161) و [#162](https://github.com/Metastem/Wikiless/pull/162)  
- [x] - رفع مشکل از کار افتادن همه پیوندهای زبانی هنگام تنظیم زبان پیش‌فرض دیگر - [#161](https://github.com/Metastem/Wikiless/issues/161)  
- [x] - برطرف شدن ۱۰ مشکل امنیتی در [Code Scanning](https://github.com/V4NT-ORG/Wikiless-Reborn/security/code-scanning)  
- [x] - تقویت بیشتر ```Dockerfile```  
- [x] - رفع چند باگ کوچک و افزودن محدودیت حافظه و CPU در [```docker-compose.yml```](https://www.baeldung.com/ops/docker-memory-limit)  
- [ ] - پشتیبانی از سبک‌های مختلف ویکی‌پدیا - [#25](https://github.com/Metastem/Wikiless/issues/25)  
- [ ] - پشتیبانی از پرش شرطی در صورت مسدود شدن یک نمونه - [#21](https://github.com/Metastem/Wikiless/issues/21)  
- [ ] - رفع خطای بارگیری حلقه‌ای فایل‌های CSS مدیاویکی  
- [ ] - رفع خطای مسیر جستجو - [#166](https://github.com/Metastem/Wikiless/issues/166)  
- [ ] - افزودن نسخه‌های زبانی مختلف برای کمک به کاربران در دور زدن سانسور دولتی  

## مجوز

این پروژه تحت مجوز **GNU Affero General Public License v3.0** منتشر شده است.


================================================
FILE: README.md
================================================
[English](README.md) | [中文](Chinese.md) | [فارسی](Persian.md) | [Русский](Russian.md)

# Wikiless

![hidden_dimension](https://github.com/user-attachments/assets/4093053d-a7c4-45aa-8860-ea0f64a841e9)


**Wikiless** is a free, open-source alternative Wikipedia front-end focused on privacy. The project aims to provide users with a more private and anonymous browsing experience by minimizing data collection and tracking.

### Features
- **Privacy-Focused:** Designed to enhance user privacy by limiting data tracking.
- **Open Source:** Available for anyone to contribute and improve.
- **Alternative Front-End:** Provides a different interface to access Wikipedia content.
- **Censorship-Resistant:** Provides another way to access Wikipedia in multiple blocked countries, Browse Wikipedia without VPN or socks.

## Installation

To run Wikiless, follow these steps:

```
https://github.com/Metastem/Wikiless/wiki
```

# Usage

Visit ```http://localhost:8180``` in your web browser to use Wikiless locally.

# Contributing

Contributions are welcome! 

# License

This project is licensed under the GNU Affero General Public License v3.0.


================================================
FILE: Russian.md
================================================
[English](README.md) | [中文](Chinese.md) | [فارسی](Persian.md) | [Русский](Russian.md)

# Wikiless

![hidden_dimension](https://github.com/user-attachments/assets/4093053d-a7c4-45aa-8860-ea0f64a841e9)


**Wikiless** — это бесплатный проект с открытым исходным кодом, представляющий собой альтернативный интерфейс для Википедии, ориентированный на конфиденциальность. Цель проекта — предоставить пользователям более приватный и анонимный опыт просмотра за счёт минимизации сбора данных и отслеживания.

### Особенности
- **Ориентация на конфиденциальность:** разработан для защиты приватности пользователей путём ограничения отслеживания данных.  
- **Открытый исходный код:** доступен для вклада и улучшений любым желающим.  
- **Альтернативный интерфейс:** предлагает другой способ доступа к содержимому Википедии.  
- **Устойчивость к цензуре:** позволяет получить доступ к Википедии в странах, где она заблокирована; просматривайте Википедию без VPN или SOCKS.  

## Установка

Чтобы запустить Wikiless, выполните следующие шаги:
```
https://github.com/Metastem/Wikiless/wiki
```

# Использование

Откройте ```http://localhost:8180``` в браузере, чтобы использовать Wikiless локально.

# Участие

Мы приветствуем ваши вклады и предложения!  

# Лицензия

Этот проект распространяется под лицензией GNU Affero General Public License v3.0.


================================================
FILE: SECURITY.md
================================================
# Security Policy

## Supported Versions

We release patches for security vulnerabilities in the following versions:

| Version | Supported          |
| ------- | ------------------ |
| 0.1.5   | :white_check_mark: |

## Reporting a Vulnerability

If you discover a security vulnerability within Wikiless, please take the following steps:

1. **Do not** disclose it publicly until we have addressed it.
2. Report the vulnerability via email to [rufatkiu](mailto:353285560a@gmail.com).
3. Provide a detailed description of the vulnerability, including the steps to reproduce it.

We will respond to your report within 48 hours and will keep you informed of the progress. Once the vulnerability is resolved, we will notify you, and you can confirm the fix.

Thank you for helping us keep Wikiless secure.


================================================
FILE: __tests__/routes.test.js
================================================
const express = require('express');
const request = require('supertest');
const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');

// Mock config
jest.mock('../wikiless.config', () => ({ theme: 'auto', default_lang: 'en' }));

// Stub utils and inject global handlers
jest.mock('../src/utils.js', () => {
  return function() {
    return {
      handleWikiPage: jest.fn((req, res, prefix) => res.status(200).send(`HANDLED_${prefix}`)),
      proxyMedia:     jest.fn(async () => ({ success: true, path: 'DUMMY_PATH' })),
      preferencesPage:jest.fn(() => '<html>PREFERENCES</html>'),
      customLogos:    jest.fn(() => false),
      wikilessLogo:   jest.fn(() => 'LOGO_PATH'),
      wikilessFavicon:jest.fn(() => 'FAVICON_PATH'),
    };
  };
});

// Load utils and assign global functions expected by routes.js
const utilsFactory = require('../src/utils.js');
const utils = utilsFactory();
global.handleWikiPage   = utils.handleWikiPage;
global.proxyMedia       = utils.proxyMedia;
global.preferencesPage  = utils.preferencesPage;
global.customLogos      = utils.customLogos;
global.wikilessLogo     = utils.wikilessLogo;
global.wikilessFavicon = utils.wikilessFavicon;

// Load and mount routes
const routes = require('../src/routes');
let app;
beforeEach(() => {
  app = express();
  app.use(cookieParser());
  app.use(bodyParser.urlencoded({ extended: true }));

  // Stub sendFile to avoid FS I/O
  app.use((req, res, next) => {
    res.sendFile = (filePath) => res.status(200).send(`SENDFILE:${filePath}`);
    next();
  });

  routes(app, utils);
});

describe('Routes wiring', () => {
  it('GET /about -> sendFile about.html', async () => {
    const res = await request(app).get('/about');
    expect(res.status).toBe(200);
    expect(res.text).toMatch(/SENDFILE:.*about\.html$/);
  });

  it('GET /static/favicon/wikipedia.ico -> sendFile favicon', async () => {
    const res = await request(app).get('/static/favicon/wikipedia.ico');
    expect(res.status).toBe(200);
    expect(res.text).toBe('SENDFILE:FAVICON_PATH');
    expect(utils.wikilessFavicon).toHaveBeenCalled();
  });

  it('GET /w/index.php?search=Foo&lang=de -> redirect', async () => {
    const res = await request(app).get('/w/index.php?search=Foo&lang=de');
    expect(res.status).toBe(302);
    expect(res.headers.location).toBe('/wiki/Foo?lang=de');
  });

  it('POST /preferences -> set cookies + redirect', async () => {
    const res = await request(app)
      .post('/preferences?back=/xyz')
      .send('theme=dark&default_lang=fr');
    expect(res.status).toBe(302);
    expect(res.headers.location).toBe('/xyz');
    const ck = res.headers['set-cookie'].join(' ');
    expect(ck).toMatch(/theme=dark/);
    expect(ck).toMatch(/default_lang=fr/);
  });

  it('GET /preferences -> render preferences page', async () => {
    const res = await request(app).get('/preferences');
    expect(res.status).toBe(200);
    expect(res.text).toBe('<html>PREFERENCES</html>');
    expect(utils.preferencesPage).toHaveBeenCalled();
  });

  it('GET /wiki/:page -> handleWikiPage', async () => {
    const res = await request(app).get('/wiki/SomePage');
    expect(res.status).toBe(200);
    expect(res.text).toBe('HANDLED_/wiki/');
    expect(utils.handleWikiPage).toHaveBeenCalledWith(
      expect.any(Object), expect.any(Object), '/wiki/'
    );
  });

  it('GET /w/:file -> handleWikiPage with /w/', async () => {
    const res = await request(app).get('/w/file.png');
    expect(res.status).toBe(200);
    expect(res.text).toBe('HANDLED_/w/');
    expect(utils.handleWikiPage).toHaveBeenCalledWith(
      expect.any(Object), expect.any(Object), '/w/'
    );
  });
});



================================================
FILE: __tests__/smoketest.test.js
================================================
jest.mock('../wikiless.config', () => ({
  redis_url: 'redis://127.0.0.1:6379',
  redis_password: '',
  https_enabled: false,
  redirect_http_to_https: false,
  trust_proxy: false,
  cert_dir: '',
  domain: 'test.local',
  ssl_port: 0,
  nonssl_port: 0,
  http_addr: '127.0.0.1',
}));

const request = require('supertest');
const app = require('../src/wikiless.js');

describe('GET /health', () => {
  it('should respond with 200', async () => {
    const res = await request(app).get('/health');
    expect(res.statusCode).toBe(200);
  });
});


================================================
FILE: __tests__/utils.test.js
================================================
jest.mock('../wikiless.config', () => ({
  default_lang: 'en',
  wikimedia_useragent: 'test-agent',
  domain: 'test.example.org',
  setexs: { wikipage: 3600 },
}));

const path = require('path');
const Utils = require('../src/utils.js');

describe('Utils factory', () => {
  let fakeRedis, utils;

  beforeAll(() => {
    fakeRedis = {
      get:    jest.fn().mockResolvedValue(null),
      setEx:  jest.fn().mockResolvedValue('OK'),
      isOpen: false,
      connect: jest.fn().mockResolvedValue(),
    };
    utils = new Utils(fakeRedis);
  });

  test('download(): missing URL returns proper error', async () => {
    const result = await utils.download('');
    expect(result).toEqual({ success: false, reason: 'MISSING_URL' });
  });

  test('validHtml() recognizes real HTML', () => {
    expect(utils.validHtml('<div>hi</div>')).toBe(true);
    expect(utils.validHtml('')).toBe(false);
    expect(utils.validHtml(null)).toBe(false);
  });

  test('validLang() returns true/false or list', () => {
    expect(utils.validLang('en')).toBe(true);
    expect(utils.validLang('invalid')).toBe(false);
    expect(Array.isArray(utils.validLang('', true))).toBe(true);
  });

  test('wikilessLogo() & wikilessFavicon() point into static/', () => {
    const logo    = utils.wikilessLogo();
    const favicon = utils.wikilessFavicon();
    expect(logo).toContain(path.join('static', 'wikiless-logo.png'));
    expect(favicon).toContain(path.join('static', 'wikiless-favicon.ico'));
  });

  test('getLang() picks query -> cookie -> default', () => {
    expect(utils.getLang()).toBe('en');
    expect(utils.getLang({ query: { lang: 'FR' }, cookies: {} })).toBe('fr');
    expect(utils.getLang({ cookies: { default_lang: 'de' } })).toBe('de');
  });

  test('applyUserMods() injects the right stylesheet tag', () => {
    const html = '<head><meta></head><body/></body>';
    const light = utils.applyUserMods(html, 'white', 'en');
    expect(light).toContain(`href="/wikipedia_styles_light.css"`);

    const dark = utils.applyUserMods(html, 'dark', 'en');
    expect(dark).toContain(`wikipedia_styles_dark.css`);
  });
});



================================================
FILE: media/.gitignore
================================================
# Ignore everything in this directory
*
# Except this file
!.gitignore
!map.png


================================================
FILE: package.json
================================================
{
  "name": "Wikiless",
  "version": "0.1.3",
  "description": "A free open source alternative Wikipedia front-end focused on privacy.",
  "main": "src/wikiless.js",
  "dependencies": {
    "body-parser": "^2.2.2",
    "compression": "^1.8.1",
    "cookie-parser": "^1.4.7",
    "express": "^5.2.1",
    "got": "^15.0.3",
    "node-html-parser": "^7.1.0",
    "redis": "^5.12.1"
  },
  "devDependencies": {
    "jest": "^30.3.0",
    "redis-mock": "^0.56.3",
    "supertest": "^7.2.2"
  },
  "scripts": {
    "test": "jest --coverage",
    "start": "node src/wikiless.js"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/Metastem/wikiless"
  },
  "license": "APGL-3.0"
}


================================================
FILE: src/cache_control.js
================================================
module.exports.removeCacheFiles = function() {
  const config = require('../wikiless.config');

  async function deleteStatic() {
    const fs = require('fs');
    const wiki_files = './media/wikipedia/';

    fs.rm(wiki_files, { recursive: true, force: true }, () => {
      console.log('Cleared cached static media files. You can turn this off by setting the config.cache_control to false.');
    });
  }

  if(config.cache_control) {
    deleteStatic();

    let hours = config.cache_control_interval;
    if (hours < 1 || isNaN(hours)) {
      hours = 24;
    }

    setInterval(() => {
      deleteStatic();
    }, 1000 * 60 * 60 * hours);
  }
}


================================================
FILE: src/routes.js
================================================
module.exports = (app, utils) => {
  const config = require('../wikiless.config')
  const path = require('path')
  const crypto = require('crypto');

  app.all(/.*/, (req, res, next) => {
    let themeOverride = req.query.theme
    if(themeOverride) {
      themeOverride = themeOverride.toLowerCase()
      req.cookies.theme = themeOverride
      res.cookie('theme', themeOverride, { maxAge: 31536000, httpOnly: true })
    } else if(!req.cookies.theme && req.cookies.theme !== '') {
      req.cookies.theme = config.theme
    }

    let langOverride = req.query.default_lang
    if(langOverride) {
      langOverride = langOverride.toLowerCase()
      req.cookies.default_lang = langOverride
      res.cookie('default_lang', langOverride, { maxAge: 31536000, httpOnly: true })
    } else if(!req.cookies.default_lang) {
      req.cookies.default_lang = config.default_lang
    }

    return next()
  })

  app.get(/.*/, async (req, res, next) => {
    if(req.url.startsWith('/w/load.php')) {
      return res.sendStatus(404)
    }

    if(req.url.startsWith('/media')) {
      let media
      let mime = ''

      if(req.url.startsWith('/media/maps_wikimedia_org/')) {
        media = await proxyMedia(req, 'maps.wikimedia.org')
      } else if(req.url.startsWith('/media/api/rest_v1/media')) {
        media = await proxyMedia(req, 'wikimedia.org/api/rest_v1/media')
        if(req.url.includes('render/svg/')) {
          mime = 'image/svg+xml'
        }
      } else {
        media = await proxyMedia(req)
      }

      if(media.success === true) {
        if(mime != '') {
          res.setHeader('Content-Type', mime)
        }

        return res.sendFile(media.path)
      }
      return res.sendStatus(404)
    }

    if(req.url.startsWith('/static/images/project-logos/') || req.url === '/static/images/mobile/copyright/wikipedia.png' || req.url === '/static/apple-touch/wikipedia.png') {
      return res.sendFile(wikilessLogo())
    }

    if(req.url.startsWith('/static/favicon/wikipedia.ico')) {
      return res.sendFile(wikilessFavicon())
    }

    // custom wikipedia logos for different languages
    if(req.url.startsWith('/static/images/mobile/copyright/')) { 
      let custom_lang = ''
      if(req.url.includes('-fr.svg')) {
        custom_lang = 'fr'
      }
      if(req.url.includes('-ko.svg')) {
        custom_lang = 'ko'
      }
      if(req.url.includes('-vi.svg')) {
        custom_lang = 'vi'
      }

      const custom_logo = customLogos(req.url, custom_lang)
      if(custom_logo) {
        return res.sendFile(custom_logo)
      }
    }

    return next()
  })

  function md5HashParts(fileName) {
    const normalized = fileName.replace(/ /g, '_');
    const h = crypto.createHash('md5').update(normalized, 'utf8').digest('hex');
    return [h[0], h.slice(0,2)];
  }


  app.get('/wiki/:page/:sub_page', (req, res, next) => {
    const pageName = req.params.page;
    if (pageName && pageName.startsWith('File:')) {
        const rawName = pageName.split(':')[1];
        const encodedFileName = encodeURIComponent(rawName);
        const [h1, h2] = md5HashParts(rawName);
        const mediaPath = `/media/wikipedia/commons/${h1}/${h2}/${encodedFileName}`;
        return res.redirect(mediaPath)
    }
    return handleWikiPage(req, res, '/wiki/')
  })

  app.get('/wiki/:page', (req, res, next) => {
    const pageName = req.params.page;
    if (pageName && pageName.startsWith('File:')) {
        const rawName = pageName.split(':')[1];
        const encodedFileName = encodeURIComponent(rawName);
        const [h1, h2] = md5HashParts(rawName);
        const mediaPath = `/media/wikipedia/commons/${h1}/${h2}/${encodedFileName}`;
        return res.redirect(mediaPath)
    }
    return handleWikiPage(req, res, '/wiki/')
  })

  // Handle the search request and redirect to the correct wiki page
  app.get('/w/index.php', (req, res, next) => {
    const searchQuery = req.query.search
    if (searchQuery) {
      // Construct the URL to redirect to the proper wiki page
      const lang = req.query.lang || req.cookies.default_lang || config.default_lang
      const redirectUrl = `/wiki/${encodeURIComponent(searchQuery)}?lang=${lang}`
      return res.redirect(redirectUrl)
    }
    return next()
  })

  app.get('/w/:file', (req, res, next) => {
    return handleWikiPage(req, res, '/w/')
  })

  app.get(/^\/wiki\/Special:Map\/.*$/, (req, res, next) => {
    return handleWikiPage(req, res, '/wiki/Map')
  })

  app.get('/api/rest_v1/page/pdf/:page', async (req, res, next) => {
    if(!req.params.page) {
      return res.redirect('/')
    }

    const media = await proxyMedia(req, '/api/rest_v1/page/pdf')

    if(media.success === true) {
      let filename = `${req.params.page}.pdf`
      return res.download(media.path, filename)
    }
    return res.sendStatus(404)
  })

  // handle chinese variants
  app.get(/^\/zh.*$/, (req, res, next) => {
    const pathSplit = req.path.split('/')
    const lang = pathSplit[1]
    const page = pathSplit[2]
    return res.redirect(`/wiki/${page}?lang=${lang}`)
  })

  app.get('/', (req, res, next) => {
    return handleWikiPage(req, res, '/')
  })

  app.get('/about', (req, res, next) => {
    return res.sendFile(path.join(__dirname, '../static/about.html'))
  })

  app.get('/preferences', (req, res, next) => {
    return res.send(preferencesPage(req, res))
  })

  // Helper to validate safe redirect paths
  function isSafeRedirectPath(path) {
    // Must start with a single slash, not double slash, not contain backslash, not contain protocol
    return (
      typeof path === 'string' &&
      path.startsWith('/') &&
      !path.startsWith('//') &&
      !path.includes('\\') &&
      !/^\/(http|https):/.test(path)
    );
  }

  app.post('/preferences', (req, res, next) => {
    const theme = req.body.theme
    const default_lang = req.body.default_lang
    let back = req.url.split('?back=')[1]

    res.cookie('theme', theme, { maxAge: 365 * 24 * 60 * 60 * 1000, httpOnly: true })
    res.cookie('default_lang', default_lang, { maxAge: 365 * 24 * 60 * 60 * 1000, httpOnly: true })

    if (!isSafeRedirectPath(back)) {
      back = '/'
    }

    return res.redirect(back)
  })

  app.post(/DownloadAsPdf/, (req, res, next) => {
    if(!req.body.page) {
      return res.redirect('/')
    }

    const lang = req.body.lang || req.cookies.default_lang || config.default_lang

    return res.redirect(`/w/index.php?title=Special%3ADownloadAsPdf&page=${req.body.page}&action=redirect-to-electron&lang=${lang}`)
  })
}


================================================
FILE: src/utils.js
================================================
module.exports = function(redis) {
  const config = require('../wikiless.config')
  const parser = require('node-html-parser')
  const fs = require('fs').promises
  const { createWriteStream, existsSync } = require('fs')
  const path = require('path')
  const stream = require('stream')
  const { promisify } = require('util')
  const pipeline = promisify(stream.pipeline)

  let _got;

  this.download = async (url, params = '') => {
    if (!url) return { success: false, reason: 'MISSING_URL' };

    if (!_got) {
      const mod = await import('got');
      _got = mod.default;
    }
  
    if (url.includes('?')) {
      const wikipage = url.split('wikipedia.org/wiki/')[1];
      if (wikipage) url = url.replace(wikipage, encodeURIComponent(wikipage));
    }
  
    const u = new URL(url);
    if (params) {
      params.split('&').forEach(p => {
        const [k, v] = p.split('=');
        u.searchParams.set(k, v);
      });
    }
    u.searchParams.set('useskin', 'vector');
    url = u.toString();
  
    const UA = config.wikimedia_useragent;
  
    try {
      if (!redis.isOpen) await redis.connect();
      const cached = await redis.get(url);
      if (cached) {
        console.log(`Got key ${url} from cache.`);
        return { success: true, html: cached, processed: true, url };
      }
    } catch (err) {
      console.error(`Redis GET error for ${url}:`, err);
    }
  
    try {
      const { body } = await _got(url, {
        headers: { 'User-Agent': UA },
        timeout: { request: 10000 }
      });
      console.log(`Fetched ${url} from Wikipedia.`);
      return { success: true, html: body, processed: false, url };
    } catch (err) {
      const status = err.response?.statusCode ?? 'NO_RESPONSE';
      console.error(`Download error for ${url}:`, err.code ?? err.message);
      return {
        success: false,
        reason: status === 404 ? 'REDIRECT' : `INVALID_HTTP_RESPONSE: ${status}`,
        url: status === 404 ? 'https://wikipedia.org/' : undefined
      };
    }
  };

  this.applyUserMods = (data, theme, lang, isMobile=false) => {
    /**
    * Apply user-specific modifications to the processed HTML.
    * This includes theme, language, and mobile-specific adjustments.
    */

    // load custom language specific languages
    let lang_suffix = ''
    let load_custom_styles = ['de', 'fr', 'ko', 'vi']

    
    if(load_custom_styles.includes(lang)) {
      lang_suffix = '_' + lang
    }

    // ensure responsive viewport meta
    if (!data.includes('name="viewport"')) {
      data = data.replace('</head>', `<meta name="viewport" content="width=device-width, initial-scale=1">\r\n</head>`)
    }

    if(theme === 'white') {
      // if the user has chosen the white theme from the preferences
      data = data.replace('</head>', `<link rel="stylesheet" href="/wikipedia_styles_light${lang_suffix}.css"></head>`)
    } else if(theme === 'dark') {
      // if the user has chosen the dark theme from the preferences
      data = data.replace('</head>', `<link rel="stylesheet" href="/wikipedia_styles_light${lang_suffix}.css">\r\n                                      <link rel="stylesheet" href="/wikipedia_styles_dark${lang_suffix}.css"></head>`)
    } else {
      // default, auto theme
      data = data.replace('</head>', `<link rel="stylesheet" href="/styles${lang_suffix}.css"></head>`)
    }

    // if mobile/tablet UA, mark html and load mobile overrides
    if (isMobile) {
      if (!data.includes('class="is-mobile"')) {
        data = data.replace('<html', '<html class="is-mobile"')
      }
      data = data.replace('</head>', `<link rel="stylesheet" href="/mobile.css"></head>`)
    }

    
    return data
  }

  this.processHtml = async (data, url, params, lang) => {
    if(validHtml(data.html)) {
      const decoded_url = url
      url = encodeURI(url)
      if(params) {
        url = `${url}?${params}`
      }

      data.html = parser.parse(data.html)

      // replace default wikipedia top right nav bar links
      let nav = data.html.querySelector('nav#p-personal .vector-menu-content-list')
      if(nav) {
        nav.innerHTML = `
          <li>
            <a href="/about">[ about ]</a>
          </li>
          <li>
            <a href="/preferences?back=${url.split('wikipedia.org')[1]}">[ preferences ]</a>
          </li>

        `
      }

      // append the lang query param to the URLs starting with /wiki/ or /w/
      let links = data.html.querySelectorAll('a')
      for(let i = 0; i < links.length; i++) {
        let href = links[i].getAttribute('href')
        if(href && (href.startsWith('/wiki/') || href.startsWith('/w/'))) {
          href = `${protocol}${config.domain}${href}`
          let u = new URL(href)
          u.searchParams.append('lang', lang)
          href = `${u.pathname}${u.search}`
          links[i].setAttribute('href', href)
        }
      }

      // add the lang query param to forms
      let forms = data.html.querySelectorAll('form')
      for(let i = 0; i < forms.length; i++) {
        forms[i].insertAdjacentHTML('afterbegin', `<input type="hidden" name="lang" value="${lang}">`)
      }
      // remove #p-wikibase-otherprojects
      let wikibase_links = data.html.querySelector('#p-wikibase-otherprojects')
      if(wikibase_links) {
        wikibase_links.remove()
      }
      // remove all <script> elements
      let script_elements = data.html.querySelectorAll('script')
      for(let i = 0; i < script_elements.length; i++) {
        script_elements[i].remove()
      }
      // remove all <iframe> elements
      let iframe_elements = data.html.querySelectorAll('iframe')
      for(let i = 0; i < iframe_elements.length; i++) {
        iframe_elements[i].remove()
      }
      // remove all JavaScript event attributes
      let event_attributes = ['[onAbort]', '[onBlur]', '[onChange]', '[onClick]', '[onDblClick]', '[onError]', '[onFocus]', '[onKeydown]', '[onKeypress]', '[onKeyup]', '[onLoad]'
, '[onMousedown]', '[onMousemove]', '[onMouseout]', '[onMouseover]', '[onMouseUp]', '[onReset]', '[onSelect]', '[onSubmit]', '[onUnload]']
      let elements_with_event_attr = data.html.querySelectorAll(event_attributes.join(','))
      for(let i = 0; i < elements_with_event_attr.length; i++) {
        for(let j = 0; j < event_attributes.length; j++) {
          if(typeof(elements_with_event_attr.removeAttribute) === 'function') {
            elements_with_event_attr.removeAttribute(event_attributes[j])
          }
        }
      }

      /**
      * Process language links in the sidebar:
      * - Remove language subdomains.
      * - Append language as a query parameter.
      */
      let lang_links = data.html.querySelectorAll('#p-lang .interlanguage-link a')
      for(let i = 0; i < lang_links.length; i++) {
        let href = lang_links[i].getAttribute('href')
        let lang_code = href.split('wikipedia.org')[0].split('//')[1]
        href = href.replace(lang_code, '')
        href = `${href}?lang=${lang_code.slice(0, -1)}`
        lang_links[i].setAttribute('href', href)
      }

      data.html = data.html.toString()
      // replace upload.wikimedia.org with /media
      const upload_wikimedia_regx = /((https:|http:|)\/\/?upload\.wikimedia\.org)/gm
      data.html = data.html.replace(upload_wikimedia_regx, '/media')

      // replace maps.wikimedia.org with /media/maps_wikimedia_org
      const maps_wikimedia_regx = /((https:|http:|)\/\/?maps\.wikimedia\.org)/gm
      data.html = data.html.replace(maps_wikimedia_regx, '/media/maps_wikimedia_org')

      // replace wikimedia.org with /media
      const wikimedia_regex = /((https:|http:|)\/\/?wikimedia.org)/gm
      data.html = data.html.replace(wikimedia_regex, '/media')

      // replace wiki links
      const wiki_href_regx = /(href=\"(https:|http:|)\/\/([A-Za-z.-]+\.)?(wikipedia\.org|wikimedia\.org|wikidata\.org|mediawiki\.org))/gm
      data.html = data.html.replace(wiki_href_regx, 'href="')

      try {
        if(redis.isOpen === false) {
          await redis.connect()
        }
        await redis.setEx(data.url, config.setexs.wikipage, data.html)
        return { success: true, html: data.html }
      } catch(error) {
        console.log(`Error setting the ${url} key to Redis. Error: ${error}`)
        return { success: false, reason: 'SERVER_ERROR_REDIS_SET' }
      }
    }

    console.log('Invalid wiki_html.')
    return { success: false, reason: 'INVALID_HTML' }
  }

  this.proxyMedia = async (req, wiki_domain='') => {
    let params = new URLSearchParams(req.query).toString() || ''

    if(params) {
      params = '?' + params
    }

    let path = ''
    let domain = 'upload.wikimedia.org'
    let wikimedia_path = ''
    switch (wiki_domain) {
      case 'maps.wikimedia.org':
        path = req.url.split('/media/maps_wikimedia_org')[1]
        domain = 'maps.wikimedia.org'
        wikimedia_path = path
        break;
      case '/api/rest_v1/page/pdf':
        const lang = req.query.lang || req.cookies.default_lang || config.default_lang
        domain = `${lang}.wikipedia.org`
        wikimedia_path = `/api/rest_v1/page/pdf/${req.params.page}`
        path = `/api/${lang}${wiki_domain}/${req.params.page}`
        break;
      case 'wikimedia.org/api/rest_v1/media':
        domain = 'wikimedia.org'
        wikimedia_path = req.url.replace('/media/api/rest_v1', '/api/rest_v1')
        path = req.url.split('/media/api')[1]
        break;
      default:
        path = req.url.split('/media')[1]
        wikimedia_path = path + params
    }
    url = new URL(`https://${domain}${wikimedia_path}`)
    const file = await saveFile(url, path)

    if(file.success === true) {
      return { success: true, path: file.path }
    }
    return { success: false, reason: file.reason }
  }

  this.saveFile = async (url, file_path) => {
    if (!_got) {
      const mod = await import('got');
      _got = mod.default;
    }

    let media_path = ''
    if(url.href.startsWith('https://maps.wikimedia.org/')) {
      media_path = path.join(__dirname, '../media/maps_wikimedia_org')
    } else if(url.href.startsWith('https://wikimedia.org/media/api/')) {
      media_path = path.join(__dirname, '../media/api')
    } else {
      media_path = path.join(__dirname, '../media')
    }

    const path_with_filename = decodeURI(`${media_path}${file_path}`)
    const path_without_filename = path.dirname(path_with_filename)
    const options = {
      headers: { 'User-Agent': config.wikimedia_useragent }
    }

    if(!existsSync(path_with_filename)) {
      try {
        await fs.mkdir(path_without_filename, { recursive: true })
      } catch(err) {
        return { success: false, reason: 'MKDIR_FAILED' }
      }

      try {
        await pipeline(
          _got.stream(url, options),
          createWriteStream(path_with_filename)
        )
      } catch(err) {
        console.log(`Error while saving ${path_with_filename}. Details:${err}`)
        return { success: false, reason: 'SAVEFILE_ERROR' }
      }
    }

    return { success: true, path: path_with_filename }
  }

  this.handleWikiPage = async (req, res, prefix) => {
    let lang = getLang(req)

    if(lang) {
      if(Array.isArray(lang)) {
        lang = lang[0]
      } else {
        lang = lang.split('?')[0]
      }
    }

    if(!validLang(lang)) {
      return res.status(500).send('invalid lang')
    }

    let url = ''
    let page = ''
    let sub_page = ''

    // Detect mobile/tablet user-agents to enable mobile layout
    const ua = (req.headers && req.headers['user-agent']) || ''
    const isMobile = /Android|iPhone|iPad|iPod|Mobile|Tablet|Windows Phone|webOS|BlackBerry/i.test(ua)

    switch (prefix) {
      case '/wiki/':
        let wiki = 'wiki'
        page = req.params.page || ''
        sub_page = req.params.sub_page || ''
        if(sub_page) {
          sub_page = `/${sub_page}`
        }

        // Ensure the language is mapped to the correct subdomain
        url = `https://${this.mapToWikiSubdomain(lang)}.wikipedia.org/${wiki}/${page}${sub_page}`
        break
      case '/w/':
        let file = req.params.file
        url = `https://${this.mapToWikiSubdomain(lang)}.wikipedia.org/w/${file}`
        break
      case '/wiki/Map':
        page = 'Special:Map'
        sub_page = req.params['0'] || ''
        url = `https://${this.mapToWikiSubdomain(lang)}.wikipedia.org/wiki/${page}/${sub_page}`
        break
      case '/':
        // Ensure the root path redirects to the correct language homepage
        url = `https://${this.mapToWikiSubdomain(lang)}.wikipedia.org/`
        break
    }

    const params = new URLSearchParams(req.query)
    // wikipedia doesn't support 'lang' parameter
    params.delete('lang')
    // set skin
    params.set('useskin', 'vector')
    const up_params = params.toString()
    const result = await download(url, up_params)

    if(result.success !== true) {
      if(result.reason === 'REDIRECT' && result.url) {
        url = result.url.split('wikipedia.org')[1]
        let prefix = ''

        if(url) {
          if(url.startsWith('/w/')) {
            prefix = '/w/'
          } else if(url.startsWith('/wiki/')) {
            prefix = '/wiki/'
          } else if(url.startsWith('/api/rest_v1/page/pdf/')) {
            let page = result.url.split('/').slice(-1)[0]
            let lang_code = result.url.split('.wikipedia.org')[0].split('//')[1]
            return res.redirect(`/api/rest_v1/page/pdf/${page}/?lang=${lang_code}`)
          }

        }

        if(prefix) {
          let redirect_to = `${prefix}${result.url.split(prefix)[1]}`
          return res.redirect(redirect_to)
        }
        return res.redirect(`/?lang=${lang}`)
      }
    }

    if(result.processed === true) {
      return res.send(applyUserMods(result.html, req.cookies.theme, lang, isMobile))
    }

    // wikiless params
    const down_params = new URLSearchParams(req.query).toString()
    const process_html = await processHtml(result, url, down_params, lang, req.cookies)
    if(process_html.success === true) {
      return res.send(applyUserMods(process_html.html.toString(), req.cookies.theme, lang, isMobile))
    }
    return res.status(500).send(process_html.reason)
  }

  this.mapToWikiSubdomain = (lang) => {
    if(!lang) return config.default_lang
    const l = String(lang).toLowerCase()
    const map = {
      'zh-min-nan': 'nan',
      'zh-yue': 'yue',
      'zh-classical': 'lzh'
    }
    if(map[l]) return map[l]
    return l.split('-')[0]
  }

  this.validLang = (lang, return_langs=false) => {
    // Comprehensive list of Wikimedia-supported language codes including variants.
    const valid_langs = [
      'aa','ab','ace','ady','af','ak','als','am','an','ang','ar','arc','arn','aro','ary','arz','as','ast','atj','av','avk','awa','ay','az','azb',
      'ba','bar','bat-smg','bcl','be','be-tarask','bg','bho','bi','bjn','bm','bn','bo','bpy','br','bs','bug','bxr','ca','cbk-zam','cdo','ce','ceb',
      'ch','chr','ckb','co','cr','crh','cs','csb','cu','cv','cy','da','de','din','diq','dsb','dty','dv','dz','ee','el','eml','en','eo','es','et','eu',
      'ext','fa','ff','fi','fiu-vro','fj','fo','fr','frp','frr','fur','fy','ga','gag','gan','gcr','gd','gl','glk','gn','gom','gor','got','gu','gv',
      'ha','hak','haw','he','hi','hif','hr','hsb','ht','hu','hy','hyw','ia','id','ie','ig','ik','ilo','inh','io','is','it','iu','ja','jam','jbo','jv',
      'ka','kaa','kab','kbd','kbp','kg','ki','kk','kl','km','kn','ko','koi','krc','ks','ksh','ku','kv','kw','ky','la','lad','lb','lbe','lez','lfn','lg',
      'li','lij','lld','lmo','ln','lo','lt','ltg','lv','map-bms','mai','mg','mhr','mi','min','mk','ml','mn','mnw','mr','mrj','ms','mt','mwl','my','myv','mzn',
      'na','nah','nap','nds','nds-nl','ne','new','ng','nl','nn','no','nov','nqo','nrm','nso','nv','ny','oc','olo','om','or','os','pa','pag','pam','pap',
      'pcd','pdc','pfl','pi','pih','pl','pms','pnb','pnt','ps','pt','qu','rm','rmy','rn','ro','roa-rup','roa-tara','ru','rue','rw','sa','sah','sc','scn','sco',
      'sd','se','sg','sh','shn','si','simple','sk','skr','sl','sm','smn','sn','so','sq','sr','srn','ss','st','stq','su','sv','sw','szl','szy','ta','tcy','te',
      'tet','tg','th','ti','tk','tl','tn','to','tpi','tr','ts','tt','tum','tw','ty','tyv','udm','ug','uk','ur','uz','ve','vec','vep','vi','vls','vo','wa',
      'war','wo','wuu','xal','xh','xmf','yi','yo','za','zea','zh','zh-classical','zh-min-nan','zh-yue','zu',]

    if(return_langs) {
      return valid_langs
    }

    return valid_langs.includes(lang)
  }

  this.validHtml = (html) => {
    if (!html) return false;
    try {
      // Attempt to parse the HTML, but don't fail on minor issues
      const parsed = parser.parse(html);
      // Additional check for valid structure if needed
      if (parsed && parsed.childNodes.length > 0) {
        return true;
      }
      return false;
    } catch (err) {
      console.error('HTML validation error:', err);
      return false;
    }
  }

  this.wikilessLogo = () => {
    const static_path = path.join(__dirname, '../static')
    return `${static_path}/wikiless-logo.png`
  }

  this.wikilessFavicon = () => {
    const static_path = path.join(__dirname, '../static')
    return `${static_path}/wikiless-favicon.ico`
  }

  this.customLogos = (url, lang) => {
    if(validLang(lang)) {
      return path.join(__dirname, '..', 'static', lang, path.basename(url))
    }
    return false
  }
  
  // Find language code by its display name (reverse of getLanguageDisplayName)
  this.findLangCodeByDisplayName = (name) => {
    if(!name) return null
    const lower = String(name).toLowerCase()
    const langs = this.validLang('', true)
    for(let i = 0; i < langs.length; i++) {
      const dn = String(this.getLanguageDisplayName(langs[i])).toLowerCase()
      if(dn === lower) return langs[i]
    }
    return null
  }

  this.getLang = (req=false) => {
    if(!req) {
      return config.default_lang
    }

    // check query param first
    if(req.query && req.query.lang) {
      const q = String(req.query.lang).toLowerCase()
      if(this.validLang(q)) return q
      const mapped = this.findLangCodeByDisplayName(q)
      if(mapped) return mapped
      return config.default_lang
    }

    // then cookies
    if(req.cookies && req.cookies.default_lang) {
      const c = String(req.cookies.default_lang).toLowerCase()
      if(this.validLang(c)) return c
      const mapped = this.findLangCodeByDisplayName(c)
      if(mapped) return mapped
    }

    return config.default_lang
  }
  
  // Return the language name in its own locale when possible (e.g. 'zh' -> '中文')
  this.getLanguageDisplayName = (code) => {
    if(!code) return code

    // special mapping for Chinese variants as requested
    const specialMap = {
      'zh': '中文',
      'zh-classical': '文言文',
      'zh-min-nan': '閩南語',
      'zh-yue': '粵語'
    }

    if(specialMap[code]) return specialMap[code]

    try {
      // Use base language (before '-') as locale for DisplayNames
      const base = code.split('-')[0]
      if(typeof Intl !== 'undefined' && Intl.DisplayNames) {
        const dn = new Intl.DisplayNames([base], { type: 'language' })
        const name = dn.of(base)
        if(name) return name
      }
    } catch (e) {
      // fall through to return code
    }
    return code
  }

  this.preferencesPage = (req, res) => {
    const { default_lang, theme } = req.cookies
    let lang_select = '<select id="default_lang" name="default_lang">'
    const valid_langs = validLang('', true)

    for(let i = 0; i < valid_langs.length; i++) {
      let selected = ''
      if(valid_langs[i] === default_lang) {
        selected = 'selected'
      }
      
      const displayName = this.getLanguageDisplayName(valid_langs[i])
      lang_select += `<option value="${valid_langs[i]}" ${selected}>${displayName}</option>`
    }

    lang_select += '</select>'

    const back = req.url.split('?back=')[1]

    const html = `
      <!DOCTYPE html>
      <html lang="en">
        <head>
          <meta charset="utf-8">
          <meta name="viewport" content="width=device-width, initial-scale=1">
          <link rel="stylesheet" href="/styles.css"></head>
          <title>Preferences - Wikiless</title>
        </head>
        <body>
          <div id="preferences">
            <h4>Preferences</h4>
            <form method="POST" action="/preferences?back=${back}">
              <div class="setting">
                <div class="label">
                  <label for="theme">Theme:</label>
                </div>
                <div class="option">
                  <select id="theme" name="theme">
                    <option value="" ${(!theme ? 'selected' : '')}>Auto</option>
                    <option value="white" ${(theme == 'white' ? 'selected' : '')}>Light Mode</option>
                    <option value="dark" ${(theme == 'dark' ? 'selected' : '')}>Dark Mode</option>
                  </select>
                </div>
              </div>
              <div class="setting">
                <div class="label">
                  <label for="default_lang">Default language:</label>
                  <br>
                  <small>When you change the default language and visit the Wikiless without the lang parameter in the URL, the page will load with a language from this setting.</small>
                </div>
                <div class="option">
                  ${lang_select}
                </div>
              </div>
              <div class="bottom">
                <small class="notice">Preferences are stored client-side using cookies without any personal information.</small>
                <input type="submit" value="Save preferences">
              </div>
            </form>
          </div>
        </body>
      </html>
    `

    return html
  }
}


================================================
FILE: src/wikiless.js
================================================
const config = require('../wikiless.config')
const compression = require('compression')
const path = require('path')
const express = require('express')
const cookieParser = require('cookie-parser')
const fs = require('fs')
const app = express()
const r = require('redis')
const bodyParser = require('body-parser')

// Health endpoint
app.get('/health', (req, res) => res.sendStatus(200));

const redis = (() => {
  const redisOptions = {
    url: config.redis_url,
    password: config.redis_password
  }

  const client = r.createClient(redisOptions)
  client.on('error', (error) => {
    if(error) {
      console.error(`Redis error: ${error}`)
    }
  })
  return client
})()

const utils = require('./utils.js')(redis)

let https = null
if(config.https_enabled) {
  const privateKey = fs.readFileSync(`${config.cert_dir}/privkey.pem`, 'utf8')
  const certificate = fs.readFileSync(`${config.cert_dir}/cert.pem`, 'utf8')
  const ca = fs.readFileSync(`${config.cert_dir}/fullchain.pem`, 'utf8')
  const credentials = {
	  key: privateKey,
	  cert: certificate,
	  ca
  }
  https = require('https').Server(credentials, app)
  global.protocol = 'https://'
} else {
  global.protocol = 'http://'
}

const http = require('http').Server(app)

app.use((req, res, next) => {
  // set CSP rules and other headers to every request
  res.set({
    'Content-Security-Policy': "default-src 'none'; base-uri 'none'; font-src 'self' data:; img-src 'self' data:; object-src 'none'; script-src 'none'; script-src-attr 'none'; style-src 'self' 'unsafe-inline'; media-src 'self'; form-action 'self'; frame-ancestors 'none'; " + (config.https_enabled ? 'upgrade-insecure-requests;' : '') + " block-all-mixed-content;",
    'Referrer-Policy': 'no-referrer',
    ...(config.https_enabled ? { 'Strict-Transport-Security': 'max-age=31536000' } : {}),
    'X-Content-Type-Options': 'nosniff',
    'X-DNS-Prefetch-Control': 'off',
    'X-Download-Options': 'noopen',
    'X-Frame-Options': 'DENY',
    'X-Permitted-Cross-Domain-Policies': 'none',
    'X-XSS-Protection': '1; mode=block'
  })
  next()
})

if(!config.https_enabled && config.redirect_http_to_https) {
  console.error(`Cannot redirect HTTP=>HTTPS while "https_enabled" is false.`)
}

if(config.redirect_http_to_https) {
  app.use((req, res, next) => {
    if(req.secure) {
      next()
    } else {
      res.redirect(`https://${req.headers.host}${req.url}`)
    }
  })
}

app.use(compression())
app.use(cookieParser())
app.use(bodyParser.urlencoded({ extended: true, limit: '10mb' }))
app.use(express.static(path.join(__dirname, '../static')))
app.use(express.static(path.join(__dirname, '../media')))

if(config.trust_proxy) {
  app.set('trust proxy', config.trust_proxy_address)
}

require('./routes')(app, utils)

const cacheControl = require('./cache_control.js')
cacheControl.removeCacheFiles()

// Export the raw Express app for supertest
module.exports = app;

// Only start servers if called via 'node src/wikiless.js' or 'npm start'
if (require.main === module) {
  if (config.https_enabled) {
    https.listen(config.ssl_port, config.http_addr, () =>
      console.log(
        `Wikiless ${config.domain} running on https://${config.http_addr}:${config.ssl_port}`
      )
    );
  }
  http.listen(config.nonssl_port, config.http_addr, () =>
    console.log(
      `Wikiless ${config.domain} running on http://${config.http_addr}:${config.nonssl_port}`
    )
  );
}


================================================
FILE: static/.well-known/ai.txt
================================================
# Spawning AI
# Prevent datasets from using the following file types

User-Agent: *
Disallow: *.txt
Disallow: *.pdf
Disallow: *.doc
Disallow: *.docx
Disallow: *.odt
Disallow: *.rtf
Disallow: *.tex
Disallow: *.wks
Disallow: *.wpd
Disallow: *.wps
Disallow: *.html
Disallow: *.bmp
Disallow: *.gif
Disallow: *.ico
Disallow: *.jpeg
Disallow: *.jpg
Disallow: *.png
Disallow: *.svg
Disallow: *.tif
Disallow: *.tiff
Disallow: *.webp
Disallow: *.aac
Disallow: *.aiff
Disallow: *.amr
Disallow: *.flac
Disallow: *.m4a
Disallow: *.mp3
Disallow: *.oga
Disallow: *.opus
Disallow: *.wav
Disallow: *.wma
Disallow: *.mp4
Disallow: *.webm
Disallow: *.ogg
Disallow: *.avi
Disallow: *.mov
Disallow: *.wmv
Disallow: *.flv
Disallow: *.mkv
Disallow: *.py
Disallow: *.js
Disallow: *.java
Disallow: *.c
Disallow: *.cpp
Disallow: *.cs
Disallow: *.h
Disallow: *.css
Disallow: *.php
Disallow: *.swift
Disallow: *.go
Disallow: *.rb
Disallow: *.pl
Disallow: *.sh
Disallow: *.sql
Disallow: /
Disallow: *
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@( @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    &@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@       .@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%                                                            @@@@@@@@@ 
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                                                            @@@@@@@@@ 
# @@@@@@@@@@@   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@          *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@(          @@@@@@@@@@@@@@@@@@@@@@@@@@@@    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@@                                %@@@@@/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@@                                %@@@@@  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@,       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@     @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@     @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(       %@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                                                            @@@@@@@@@ 
# @@@@@@@@@@@/@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                                                            @@@@@@@@@ 
# @@@@@@@@@@@    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@          @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@*      @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@,      @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@@           @@@@@@@@@@@@@@@@@@@@@@@@@@@   *@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@@                                %@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@@                                %@@@@&  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@@       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@     @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@     @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@         @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@ .@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                                                            @@@@@@@@@ 
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                                                            @@@@@@@@@ 
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*         @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@      @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ spawning.ai


================================================
FILE: static/.well-known/dnt-policy.txt
================================================
Do Not Track Compliance Policy 

Version 1.0

This domain complies with user opt-outs from tracking via the "Do Not Track"
or "DNT" header  [http://www.w3.org/TR/tracking-dnt/].  This file will always
be posted via HTTPS at https://wwww.example.com/.well-known/dnt-policy.txt
to indicate this fact.

SCOPE

This policy document allows an operator of a Fully Qualified Domain Name
("domain") to declare that it respects Do Not Track as a meaningful privacy
opt-out of tracking, so that privacy-protecting software can better determine
whether to block or anonymize communications with this domain.  This policy is
intended first and foremost to be posted on domains that publish ads, widgets,
images, scripts and other third-party embedded hypertext (for instance on
widgets.example.com), but it can be posted on any domain, including those users
visit directly (such as www.example.com). The policy may be applied to some
domains used by a company, site, or service, and not to others.  Do Not Track
may be sent by any client that uses the HTTP protocol, including websites,
mobile apps, and smart devices like TVs. Do Not Track also works with all
protocols able to read HTTP headers, including SPDY.

NOTE: This policy contains both Requirements and Exceptions. Where possible
terms are defined in the text, but a few additional definitions are included
at the end.

REQUIREMENTS

When this domain receives Web requests from a user who enables DNT by actively
choosing an opt-out setting in their browser or by installing software that is
primarily designed to protect privacy ("DNT User"), we will take the following
measures with respect to those users' data, subject to the Exceptions, also
listed below:  

1. END USER IDENTIFIERS:         

  a. If a DNT User has logged in to our service, all user identifiers, such as
     unique or nearly unique cookies, "supercookies" and fingerprints are 
     discarded as soon as the HTTP(S) response is issued.                                    

     Data structures which associate user identifiers with accounts may be
     employed to recognize logged in users per Exception 4 below, but may not
     be associated with records of the user's activities unless otherwise
     excepted.

  b. If a DNT User is not logged in to our service, we will take steps to ensure 
     that no user identifiers are transmitted to us at all.         

2. LOG RETENTION: 

  a. Logs with DNT Users' identifiers removed (but including IP addresses and
     User Agent strings) may be retained for a period of 10 days or less,
     unless an Exception (below) applies. This period of time balances privacy
     concerns with the need to ensure that log processing systems have time to
     operate; that operations engineers have time to monitor and fix technical
     and performance problems; and that security and data aggregation systems
     have time to operate.

  b. These logs will not be used for any other purposes.         

3. OTHER DOMAINS: 

  a. If this domain transfers identifiable user data about DNT Users to
     contractors, affiliates or other parties, or embeds from or posts data to
     other domains, we will either:         

  b. ensure that the operators of those domains abide by this policy overall
     by posting it at /.well-known/dnt-policy.txt via HTTPS on the domains in
     question,

    OR

     ensure that the recipient's policies and practices require the recipient
     to respect the policy for our DNT Users' data.

    OR  

     obtain a contractual commitment from the recipient to respect this policy
     for our DNT Users' data.

    NOTE: if an “Other Domain” does not receive identifiable user information
    from the domain because such information has been removed, because the
    Other Domain does not log that information, or for some other reason, these
    requirements do not apply.

  c. "Identifiable" means any records which are not Anonymized or otherwise
     covered by the Exceptions below.

4. PERIODIC REASSERTION OF COMPLIANCE: 

  At least once every 12 months, we will take reasonable steps commensurate
  with the size of our organization and the nature of our service to confirm
  our ongoing compliance with this document, and we will publicly reassert our
  compliance.

5. USER NOTIFICATION: 

  a. If we are required by law to retain or disclose user identifiers, we will
     attempt to provide the users with notice (unless we are prohibited or it
     would be futile) that a request for their information has been made in
     order to give the users an opportunity to object to the retention or
     disclosure.

  b. We will attempt to provide this notice by email, if the users have given
     us an email address, and by postal mail if the users have provided a
     postal address.                                   

  c. If the users do not challenge the disclosure request, we may be legally
     required to turn over their information.

  d. We may delay notice if we, in good faith, believe that an emergency
     involving danger of death or serious physical injury to any person
     requires disclosure without delay of information relating to the
     emergency.

EXCEPTIONS

Data from DNT Users collected by this domain may be logged or retained only in
the following specific situations:

1. CONSENT / "OPT BACK IN"         

  a. DNT Users are opting out from tracking across the Web.  It is possible
     that for some feature or functionality, we will need to ask a DNT User to
     "opt back in" to be tracked by us across the entire Web.                                    

  b. If we do that, we will take reasonable steps to verify that the users who
     select this option have genuinely intended to opt back in to tracking.
     One way to do this is by performing scientifically reasonable user
     studies with a representative sample of our users, but smaller
     organizations can satisfy this requirement by other means.         

  c. Where we believe that we have opt back in consent, our server will
     send a tracking value status header "Tk: C" as described in section 6.2
     of the W3C Tracking Preference Expression draft:

     http://www.w3.org/TR/tracking-dnt/#tracking-status-value

2. TRANSACTIONS         

   If a DNT User actively and knowingly enters a transaction with our
   services (for instance, clicking on a clearly-labeled advertisement,
   posting content to a widget, or purchasing an item), we will retain
   necessary data for as long as required to perform the transaction. This
   may for example include keeping auditing information for clicks on
   advertising links; keeping a copy of posted content and the name of the
   posting user; keeping server-side session IDs to recognize logged in
   users; or keeping a copy of the physical address to which a purchased
   item will be shipped.  By their nature, some transactions will require data
   to be retained indefinitely.

3. TECHNICAL AND SECURITY LOGGING:                   

  a. If, during the processing of the initial request (for unique identifiers)
     or during the subsequent 10 days (for IP addresses and User Agent strings),
     we obtain specific information that causes our employees or systems to
     believe that a request is, or is likely to be, part of a security attack,
     spam submission, or fraudulent transaction, then logs of those requests 
     are not subject to this policy.                                   

  b. If we encounter technical problems with our site, then, in rare
     circumstances, we may retain logs for longer than 10 days, if that is
     necessary to diagnose and fix those problems, but this practice will not be
     routinized and we will strive to delete such logs as soon as possible.         

4. AGGREGATION:

  a. We may retain and share anonymized datasets, such as aggregate records of
     readership patterns; statistical models of user behavior; graphs of system
     variables; data structures to count active users on monthly or yearly
     bases; database tables mapping authentication cookies to logged in
     accounts; non-unique data structures constructed within browsers for tasks
     such as ad frequency capping or conversion tracking; or logs with truncated
     and/or encrypted IP addresses and simplified User Agent strings.

  b. "Anonymized" means we have conducted risk mitigation to ensure
     that the dataset, plus any additional information that is in our
     possession or likely to be available to us, does not allow the
     reconstruction of reading habits, online or offline activity of groups of
     fewer than 5000 individuals or devices. 

  c. If we generate anonymized datasets under this exception we will publicly
     document our anonymization methods in sufficient detail to allow outside
     experts to evaluate the effectiveness of those methods.

5. ERRORS: 

From time to time, there may be errors by which user data is temporarily
logged or retained in violation of this policy.  If such errors are
inadvertent, rare, and made in good faith, they do not constitute a breach
of this policy.  We will delete such data as soon as practicable after we
become aware of any error and take steps to ensure that it is deleted by any
third-party who may have had access to the data.

ADDITIONAL DEFINITIONS

"Fully Qualified Domain Name" means a domain name that addresses a computer
connected to the Internet. For instance, davidroker.co is a distinct FQDNs.

"Supercookie" means any technology other than an HTTP Cookie which can be used
by a server to associate identifiers with the clients that visit it.  Examples
of supercookies include Flash LSO cookies, DOM storage, HTML5 storage, or
tricks to store information in caches or etags.

"Risk mitigation" means an engineering process that evaluates the possibility
and likelihood of various adverse outcomes, considers the available methods of
making those adverse outcomes less likely, and deploys sufficient mitigations
to bring the probability and harm from adverse outcomes below an acceptable
threshold.

"Reading habits" includes amongst other things lists of visited DNS names, if
those domains pertain to specific topics or activities, but records of visited
DNS names are not reading habits if those domain names serve content of a very
diverse and general nature, thereby revealing minimal information about the
opinions, interests or activities of the user.


================================================
FILE: static/.well-known/gpc.json
================================================
{

 "gpc": true,
 "lastUpdate": "2025-04-02"

}


================================================
FILE: static/.well-known/tdmrep.json
================================================
[
    {
        "location": "/",
        "tdm-reservation": 1
    }
]


================================================
FILE: static/about.html
================================================
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta name="CCBot" content="nofollow">
    <meta name="robots" content="noai, noimageai">
    <meta name="tdm-reservation" content="1">
    <meta name="robots" content="noarchive">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>About - Wikiless</title>
    <style>
      
    </style>
  </head>
  <body>
    <aside>
      <a href="/" rel="noreferrer" target="_blank">
        <img src="/wikiless-logo.png" alt="Wikiless logo">
      </a>
    </aside>
    <h1>About</h1>
    <p>Wikiless is a free, open-source Wikipedia alternative, focused on privacy. The project aims to deliver a more secure, anonymous browsing experience by minimizing data collection and tracking, ensuring users can explore knowledge with enhanced privacy.</p>
    <p>The source is available at Github <a href="https://github.com/Metastem/wikiless">https://github.com/Metastem/Wikiless</a>.</p>
    <br>
    <p>The original developer that made Wikiless is, <a href="https://codeberg.org/orenom">"Orenom".</a> He has gotten DMCAed' and "Metastem" has forked it to continue keep it maintained.</p>
    <ul>
      <li>No Javascript or ads.</li>
      <li>All requests go through the backend, client never talks to Wikipedia.</li>
      <li>Prevents Wikipedia getting your IP address.</li>
      <li>Self-hostable. Anyone can setup a private or public instance.</li>
    </ul>
    <h2>Metastem</h2>
    <h3>Website:</h3>
    <a href="https://www.wl.ax/">wl.ax</a>
    <hr>
    <a href="/" rel="noreferrer" target="_blank">Go Back</a>
    <h4>Wikiless version</h4>
    <p>0.1.5</p>
  </body>
</html>


================================================
FILE: static/ip-ranges.txt
================================================
# OpenAI - GPTBot 
52.230.152.0/24
52.233.106.0/24

# OpenAI - Plugins
23.102.140.112/28
13.66.11.96/28
104.210.133.240/28

# OpenAI - ChatGPT-User
# https://platform.openai.com/docs/plugins/bot
23.98.142.176/28
40.84.180.224/28
13.65.240.240/28
20.97.189.96/28
20.161.75.208/28
52.225.75.208/28
52.156.77.144/28
40.84.180.64/28


================================================
FILE: static/mobile.css
================================================
html.is-mobile,
html.is-mobile body {
  margin: 0;
  padding: 0;
  font-family: "Helvetica Neue", "Noto Sans SC", sans-serif;
  background: #fff;
  line-height: 1.7;
  overflow-x: hidden;
  font-size: 1.4rem !important;
  color: #111 !important;
}

html.is-mobile #mw-head-base,
html.is-mobile #mw-page-base,
html.is-mobile .vector-column-start,
html.is-mobile .vector-column-end,
html.is-mobile #p-logo,
html.is-mobile .mw-wiki-logo {
  display: none !important;
}

html.is-mobile.home #mw-panel {
  display: block !important;
  position: relative;
  width: auto !important;
  float: none !important;
  margin: 0 auto 12px auto !important;
  padding: 0 14px;
  box-sizing: border-box;
}
html.is-mobile:not(.home) #mw-panel {
  display: none !important;
}

html.is-mobile #mw-head {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background: #fff;
  z-index: 300;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  gap: 10px;
  box-sizing: border-box;
  transition: transform 0.3s ease;
  will-change: transform;
  font-size: 1rem !important;
}

html.is-mobile #searchform {
  flex: 1;
  display: flex;
  align-items: center;
  max-width: 600px;
}
html.is-mobile #searchInput {
  width: 100%;
  font-size: 15px;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

html.is-mobile #p-personal {
  display: flex !important;
  gap: 10px;
  flex-shrink: 0;
  align-items: center;
  font-size: 0.9rem !important;
}
html.is-mobile #p-personal a {
  color: #0366d6;
  text-decoration: none;
  font-size: 0.9rem !important;
  padding: 5px 7px;
  border-radius: 7px;
}
html.is-mobile #p-personal a:hover {
  background: rgba(0, 0, 0, 0.05);
}

html.is-mobile body {
  padding-top: 0 !important;
}
html.is-mobile #content,
html.is-mobile .mw-body,
html.is-mobile .vector-body,
html.is-mobile .mw-content-container,
html.is-mobile .mw-parser-output {
  margin: 0 !important;
  padding: 16px 18px !important;
  max-width: 100% !important;
  overflow-wrap: break-word;
  box-sizing: border-box;
  font-size: 1.4rem !important;
  line-height: 1.7 !important;
  color: #111 !important;
}

html.is-mobile p,
html.is-mobile li,
html.is-mobile ul,
html.is-mobile ol,
html.is-mobile span,
html.is-mobile div {
  font-size: inherit !important;
  line-height: inherit !important;
  color: inherit !important;
}

html.is-mobile #p-lang ul {
  display: flex;
  overflow-x: auto;
  padding: 7px 0;
  gap: 10px;
  white-space: nowrap;
  list-style: none;
}
html.is-mobile #p-lang a {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  background: #f6f6f6;
  border: 1px solid rgba(0,0,0,0.1);
  text-decoration: none;
  color: #000;
  font-size: 1.25rem !important;
}

html.is-mobile table {
  width: 100% !important;
  border-collapse: collapse !important;
  table-layout: auto !important;
}
html.is-mobile th,
html.is-mobile td {
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 9px 12px;
  font-size: 1.4rem !important;
  line-height: 1.7 !important;
}
html.is-mobile .thumb img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 0 auto;
}

html.is-mobile #footer {
  font-size: 1.26rem;
  padding: 24px;
  text-align: center;
  color: #444;
}

html.is-mobile .firstHeading {
  margin-top: 1em !important;
  padding-top: 0.5em !important;
  font-size: 1.7rem !important;
}

html.is-mobile table.infobox,
html.is-mobile table.infobox.vevent,
html.is-mobile table.infobox-vevent,
html.is-mobile .mw-parser-output > table.infobox,
html.is-mobile .mw-parser-output > table.infobox-vevent {
  display: table !important;
  table-layout: fixed !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 1em 0 !important;
  border-collapse: collapse !important;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box !important;
  overflow: hidden;
}
html.is-mobile table.infobox th,
html.is-mobile table.infobox td {
  display: table-cell !important;
  vertical-align: top !important;
  word-wrap: break-word !important;
  white-space: normal !important;
  padding: 12px 14px !important;
  border: none !important;
  box-sizing: border-box !important;
  font-size: 1.4rem !important;
  line-height: 1.7 !important;
  color: #111 !important;
}
html.is-mobile table.infobox caption {
  display: table-caption !important;
  caption-side: top !important;
  text-align: center !important;
  font-weight: 700 !important;
  font-size: 1.5rem !important;
  padding: 9px 14px !important;
  background: #fafafa !important;
}
html.is-mobile table.infobox img {
  display: block !important;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  margin: 10px auto !important;
  border-radius: 6px;
  object-fit: contain !important;
}
html.is-mobile table.infobox th[scope=row] {
  font-weight: 700 !important;
  text-align: left !important;
  display: table-cell !important;
  vertical-align: top !important;
}
html.is-mobile table.infobox [style*="width"] {
  width: auto !important;
  max-width: 100% !important;
}

@media (max-width: 480px) {
  html.is-mobile table.infobox {
    table-layout: auto !important;
  }
}

html.is-mobile .mw-parser-output > p,
html.is-mobile .mw-parser-output > ul,
html.is-mobile .mw-parser-output > ol,
html.is-mobile .mw-parser-output > div:not([class]),
html.is-mobile .mw-parser-output > span:not([class]) {
  font-size: 1.55rem !important;
  line-height: 1.75 !important;
}


================================================
FILE: static/robots.txt
================================================
user-agent: *
Allow: /$
Disallow: /

User-agent: archive.org_bot
Disallow: /

# The example for img2dataset, although the default is *None*
User-agent: img2dataset
Disallow: /

# Brandwatch - "AI to discover new trends"
User-agent: magpie-crawler
Disallow: /

# webz.io - they sell data for training LLMs.
User-agent: Omgilibot
Disallow: /

# Items below were sourced from darkvisitors.com
# Categories included: "AI Data Scraper", "AI Assistant", "AI Search Crawler", "Undocumented AI Agent"

# AI Search Crawler
# https://darkvisitors.com/agents/amazonbot

User-agent: Amazonbot
Disallow: /

# Undocumented AI Agent
# https://darkvisitors.com/agents/anthropic-ai

User-agent: anthropic-ai
Disallow: /

# AI Search Crawler
# https://darkvisitors.com/agents/applebot

User-agent: Applebot
Disallow: /

# AI Data Scraper
# https://darkvisitors.com/agents/applebot-extended

User-agent: Applebot-Extended
Disallow: /

# AI Data Scraper
# https://darkvisitors.com/agents/bytespider

User-agent: Bytespider
Disallow: /

# AI Data Scraper
# https://darkvisitors.com/agents/ccbot

User-agent: CCBot
Disallow: /

# AI Assistant
# https://darkvisitors.com/agents/chatgpt-user

User-agent: ChatGPT-User
Disallow: /

# Undocumented AI Agent
# https://darkvisitors.com/agents/claude-web

User-agent: Claude-Web
Disallow: /

# AI Data Scraper
# https://darkvisitors.com/agents/claudebot

User-agent: ClaudeBot
Disallow: /

# Undocumented AI Agent
# https://darkvisitors.com/agents/cohere-ai

User-agent: cohere-ai
Disallow: /

# AI Data Scraper
# https://darkvisitors.com/agents/diffbot

User-agent: Diffbot
Disallow: /

# AI Data Scraper
# https://darkvisitors.com/agents/facebookbot

User-agent: FacebookBot
Disallow: /

# AI Data Scraper
# https://darkvisitors.com/agents/google-extended

User-agent: Google-Extended
Disallow: /

# AI Data Scraper
# https://darkvisitors.com/agents/gptbot

User-agent: GPTBot
Disallow: /

# AI Data Scraper
# https://darkvisitors.com/agents/omgili

User-agent: omgili
Disallow: /

# AI Search Crawler
# https://darkvisitors.com/agents/perplexitybot

User-agent: PerplexityBot
Disallow: /

# AI Search Crawler
# https://darkvisitors.com/agents/youbot

User-agent: YouBot
Disallow: /


================================================
FILE: static/styles.css
================================================
@import "wikipedia_styles_light.css";
@import "wikipedia_styles_dark.css" (prefers-color-scheme: dark);


================================================
FILE: static/styles_de.css
================================================
@import "wikipedia_styles_light_de.css";
@import "wikipedia_styles_dark_de.css" (prefers-color-scheme: dark);


================================================
FILE: static/styles_fr.css
================================================
@import "wikipedia_styles_light_fr.css";
@import "wikipedia_styles_dark_fr.css" (prefers-color-scheme: dark);


================================================
FILE: static/styles_ko.css
================================================
@import "wikipedia_styles_light_ko.css";
@import "wikipedia_styles_dark_ko.css" (prefers-color-scheme: dark);


================================================
FILE: static/styles_vi.css
================================================
@import "wikipedia_styles_light_vi.css";
@import "wikipedia_styles_dark_vi.css" (prefers-color-scheme: dark);


================================================
FILE: static/verify.txt
================================================
please remove from archive.org


================================================
FILE: static/wikipedia_styles_dark.css
================================================
/**
* Dark theme copied from here:
* https://github.com/StylishThemes/Wikipedia-Dark
* LICENSE: https://github.com/StylishThemes/Wikipedia-Dark/blob/master/LICENSE
*
*/
  /* Global color palette */
  :root {
    --base-color: #4183C4;
    --base-color-rgb: rgb(65, 131, 196);
    --base-color-rgba-3: rgba(var(--base-color-rgb), 3);
    --base-color-rgba-8: rgba(var(--base-color-rgb), 8);
    --tab-color: #e08b26;
    --visited-color: #295887;
    --bg-custom: #2b2b2b;
    --bg-selected: #2f2f2f;
    --bg-attachment: #2f2f2f;
    /* base palette */
    --black: #000;
    --gray-1: #111;
    --gray-2: #222;
    --gray-3: #333;
    --gray-4: #444;
    --gray-5: #555;
    --gray-7: #777;
    --gray-a: #aaa;
    --gray-c: #ccc;
    --gray-d: #ddd;
    --gray-e: #eee;
    --white: #fff;
    --gray-18: #181818;
    --gray-28: #282828;
    --gray-2f: #2f4f4f;
    --gray-69: #696969;
    --gray-9a: #9a9a9a;
    --gray-b9: #b9b9b9;
    --gray-bc: #bcbcbc;
    --blue: #00f;
    --blue-1: #36c;
    --blue-2: #182030;
    --blue-3: #212c43;
    --blue-4: #3c5487;
    --red: #f00;
    --red-0: #400;
    --red-1: #c22;
    --red-2: #d33;
    --red-3: #722;
    --red-rgb: rgba(119, 34, 34, .4);
    --red-4: #ff4242;
    --green: #0f0;
    --green-1: #390;
    --green-2: #165316;
    --green-3: #061;
    --green-4: #002800;
    --brown-1: #321;
    --brown-2: #542;
    --brown-3: #261d08;
    --brown-4: #4b380d;
    --yellow-1: #b28200;
    --yellow-2: #ffdd7f;
    --orange-1: #e53e00;
    --orange-2: #e08b26;
    --orange-3: #4d2b01;
    --purple-d: #241738;
    --purple-0: #312641;
    --purple-1: #382b4a;
    --purple-2: #768;
    --pink-0: #3e243c;
    --pink-1: #6b3e68;
    --pink-2: #965691;
    --pink-3: #ffbefa;
    --cyan-1: #194d41;
    --ores-1: #222800;
    --ores-2: #222000;
    --ores-3: #221800;
    --black_17: rgba(0, 0, 0, .175);
    --black_2: rgba(0, 0, 0, .2);
    --black_25: rgba(0, 0, 0, .25);
    --black_5: rgba(0, 0, 0, .5);
    --black_8: rgba(0, 0, 0, .8);
    --gray-2_75: rgba(34, 34, 34, .75);
    --gray-3_5: rgba(51, 51, 51, .5);
    --gray-5_25: rgba(85, 85, 85, .25);
    --gray-6_5: rgba(100, 100, 100, .5);
    --white_1: rgba(255, 255, 255, .1);
    --white_25: rgba(255, 255, 255, .25);
    --diff-del: #c22;
    --diff-add: #36c;
    --revs-old: #b28200;
    --revs-new: #070;
    /* assessment colors */
    --assess-1: #06c;
    --assess-2: #29c;
    --assess-3: #070;
    --assess-4: #6b0;
    --assess-5: #993;
    --assess-6: #b60;
    --assess-7: #921; /* was #901 */
    --assess-8: #85f;
    --assess-9: #070;
    --assess-10: #0b6;
    --assess-11: #a4c;
    --assess-12: #568;
    /* meta wiki */
    --green-a0: #2f4500;
    --green-a1: #27560f;
    --green-a2: #016101;
    --green-a3: #305229;
    --green-a4: #50612b;
    --green-a5: #676702;
    --bluei-a0: #014523;
    --bluei-a1: #004e4e;
    --bluei-a2: #05493b;
    --bluei-a3: #1b3a2a;
    /* WD query service */
    --cm-0: #141414;
    --cm-1: #27282e;
    --cm-2: #f9ee98;
    --cm-3: #fc0;
    --cm-4: #ca7841;
    --cm-5: #8da6ce;
    --cm-6: #607392;
    --cm-7: #cda869;
    --cm-8: #8f9d6a;
    --cm-9: #bd6b18;
    --cm-10: #f7f7f7;
    --cm-11: #997643;
    --cm-12: #d6bb6d;
    --cm-13: #ff6400;
    --cm-14: #aeaeae;
    --cm-15: #ad9361;
  }
  .cm-comment, .cm-link {
    font-style: italic;
  }
  .CodeMirror {
    background: var(--gray-18);
  }
  .CodeMirror-gutters {
    background: var(--gray-2);
    border-right: 1px solid var(--gray-4);
  }
  .CodeMirror-guttermarker {
    color: var(--white);
  }
  .CodeMirror-guttermarker-subtle, .CodeMirror-linenumber {
    color: var(--gray-a);
  }
  .CodeMirror-cursor {
    border-left: 2px solid var(--white);
  }
  .CodeMirror-activeline-background {
    background: var(--cm-1);
  }
  .CodeMirror-matchingbracket {
    outline: 1px solid var(--gray);
    color: var(--white);
  }
  .CodeMirror-line::selection, .CodeMirror-line > span::selection,
  .CodeMirror-line > span > span::selection {
    background: var(--cm-1);
  }
  .cm-keyword {
    color: var(--cm-2);
  }
  .cm-atom {
    color: var(--cm-3);
  }
  .cm-number {
    color: var(--cm-4);
  }
  .cm-def, .cm-mw-section-header, .cm-mw-link-pagename, .cm-mw-link-bracket,
  .cm-mw-link-delimiter, .cm-mw-indenting, .cm-mw-extlink-bracket, .cm-mw-list,
  .cm-mw-apostrophes-bold, .cm-mw-apostrophes-italic, .cm-mw-link-tosection {
    color: var(--cm-5);
  }
  .cm-mw-skipformatting {
    background-color: var(--cm-6);
  }
  .cm-variable-2, .cm-variable-3, span.cm-def, span.cm-tag,
  .cm-mw-extlink-protocol, .cm-mw-free-extlink-protocol, .cm-mw-extlink,
  .cm-mw-free-extlink {
    color: var(--cm-6);
  }
  .cm-builtin, .cm-operator {
    color: var(--cm-7);
  }
  .cm-comment {
    color: var(--gray-7);
    font-weight: 400;
  }
  .cm-string, .cm-mw-htmltag-name, .cm-mw-htmltag-bracket, .cm-mw-exttag-name,
  .cm-mw-exttag-bracket, .cm-mw-htmltag-attribute, .cm-mw-exttag-attribute,
  .cm-mw-mnemonic {
    color: var(--cm-8);
  }
  .cm-string-2 {
    color: var(--cm-9);
  }
  .cm-meta {
    background-color: var(--gray-18);
    color: var(--cm-10);
  }
  .cm-tag {
    color: var(--cm-11);
  }
  .cm-attribute {
    color: var(--cm-12);
  }
  .cm-header, .cm-mw-table-bracket, .cm-mw-table-definition,
  .cm-mw-table-delimiter {
    color: var(--cm-13);
  }
  .cm-hr {
    color: var(--cm-14);
  }
  .cm-link {
    color: var(--cm-15);
    text-decoration: none;
  }
  .cm-error {
    border-bottom: 1px solid var(--red);
  }
  .cm-mw-template-name, .cm-mw-template-bracket, .cm-mw-template,
  .cm-mw-template-argument-name, .cm-mw-template-delimiter {
    color: var(--cm-10);
  }
  /*# sourceURL=ace/css/ace-tm */
  .ace-tm .ace_gutter {
    background: var(--cm-1);
    color: var(--cm-10);
  }
  .ace-tm .ace_print-margin {
    background: var(--cm-1);
  }
  .ace-tm .ace_fold {
    background-color: var(--cm-6);
  }
  .ace-tm {
    background-color: var(--cm-0);
    color: var(--cm-10);
  }
  .ace-tm .ace_cursor {
    color: var(--cm-10);
  }
  .ace-tm .ace_invisible {
    color: var(--cm-10);
  }
  .ace-tm .ace_storage, .ace-tm .ace_keyword {
    color: var(--cm-5);
  }
  .ace-tm .ace_constant {
    color: var(--cm-13);
  }
  .ace-tm .ace_constant.ace_buildin {
    color: var(--cm-14);
  }
  .ace-tm .ace_constant.ace_language {
    color: var(--cm-14);
  }
  .ace-tm .ace_constant.ace_library {
    color: var(--cm-8);
  }
  .ace-tm .ace_invalid {
    background-color: rgba(255, 0, 0, .1);
    color: var(--cm-13);
  }
  .ace-tm .ace_support.ace_function {
    color: var(--cm-5);
  }
  .ace-tm .ace_support.ace_constant {
    color: var(--cm-8);
  }
  .ace-tm .ace_support.ace_type, .ace-tm .ace_support.ace_class {
    color: var(--cm-14);
  }
  .ace-tm .ace_keyword.ace_operator {
    color: var(--cm-14);
  }
  .ace-tm .ace_string {
    color: var(--cm-8);
  }
  .ace-tm .ace_comment {
    color: var(--cm-14);
  }
  .ace-tm .ace_comment.ace_doc {
    color: var(--cm-5);
  }
  .ace-tm .ace_comment.ace_doc.ace_tag {
    color: var(--cm-14);
  }
  .ace-tm .ace_constant.ace_numeric {
    color: var(--cm-5);
  }
  .ace-tm .ace_variable {
    color: var(--cm-12);
  }
  .ace-tm .ace_xml-pe {
    color: var(--cm-11);
  }
  .ace-tm .ace_entity.ace_name.ace_function {
    color: var(--cm-5);
  }
  .ace-tm .ace_heading {
    color: var(--cm-5);
  }
  .ace-tm .ace_list {
    color: var(--cm-13);
  }
  .ace-tm .ace_meta.ace_tag {
    color: var(--cm-6);
  }
  .ace-tm .ace_string.ace_regex {
    color: var(--cm-13);
  }
  .ace-tm .ace_marker-layer .ace_selection {
    background: var(--cm-1);
  }
  .ace-tm.ace_multiselect .ace_selection.ace_start {
    box-shadow: 0 0 3px 0 var(--cm-10);
  }
  .ace-tm .ace_marker-layer .ace_step {
    background: var(--cm-3);
  }
  .ace-tm .ace_marker-layer .ace_stack {
    background: var(--cm-2);
  }
  .ace-tm .ace_marker-layer .ace_bracket {
    border: 1px solid var(--cm-14);
  }
  .ace-tm .ace_marker-layer .ace_active-line {
    background: rgba(0, 0, 0, .07);
  }
  .ace-tm .ace_gutter-active-line {
    background-color: var(--gray-3);
  }
  .ace-tm .ace_marker-layer .ace_selected-word {
    background: var(--gray-3);
    border: 1px solid var(--cm-11);
  }
  .ace-tm .ace_indent-guide {
    background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;
  }
  .ve-ui-mwAceEditorWidget .ace_editor {
    border-color: var(--cm-6);
  }


  /* transparent background */
  html, body, .mw-body[role="main"], .skin-vector-max-width .mw-page-container,
  .skin-vector #mw-panel, .mw-page-container {
    background-color: var(--gray-2);
    background-image: var(--bg-selected);
    background-clip: border-box;
    background-origin: padding-box;
    background-attachment: var(--bg-attachment);
    /*[[bg-options]]*/
    color: var(--gray-c);
  }
  .mw-body, .parsoid-body, #mp-topbanner,
  span:not(.legend-color):not([class*="wikEd"]):not([style*="background"]):not(.wikibase-toolbar-wrapper):not(.tool),
  .navbox-list, .mw-wsmfinal-content, .mw-body-content,
  .referencetooltip > li + li, div.vectorTabs ul li,
  tr[style*="background:#F5FFFA" i], th[style*="background-color: #fff" i],
  .mw-echo-notifications-badge, .ext-cards-card-list .ext-cards-card,
  .infobox span.plainlinks *, .tracklist, .vertical-navbox th a,
  blockquote[style*="background-color: white" i], .ns-0 ul, .ns-0 ol li,
  table.flextable, table.flextable .invisible, table#noarticletext,
  table#noarticletext table, .metadata.plainlinks.stub,
  .mw-body-content #mw-content-text h2:not([id^="mp-"]),
  .mw-body-content .portal ul, div[style*="background"]:not[style*="#90EE90"],
  .wikitable > tr, .wikitable > tr > th, .wikitable > tr > td,
  .wikitable > * > tr, .wikitable > * > tr > th,
  .wikitable > * > tr > td:not(.break), .wikitable th span[style*="background"],
  .inline-quote-talk, .oo-ui-fieldsetLayout-group .oo-ui-widget,
  .mw-parser-output .mod-gallery .whitebg img,
  .mw-parser-output .mod-gallery .gallerybox div, tt[style="background: white;"] {
    background-color: transparent !important;
  }
  .mw-body, .parsoid-body {
    background-color: transparent !important;
    color: var(--gray-9a);
  }
  .mw-mmv-download-pane .mw-mmv-download-attribution {
    background-color: var(--gray-2);
    color: var(--gray-a);
  }
  .mw-mmv-download-pane .mw-mmv-download-attribution:hover {
    background-color: var(--gray-28);
    color: var(--gray-c);
  }
  .mw-mmv-permission-box, .mw-mmv-info-box {
    border-color: var(--gray-5);
    background-color: transparent !important;
  }
  .mw-mmv-image-metadata, .navbox, .navbox-subgroup, .mwe-pt-article-row-odd,
  .mwe-pt-article-row-even, .ve-ui-mwSaveDialog-options, #mw-page-base,
  .mw-parser-output #siteContainer div:first-child, div.vectorTabs li.selected {
    background-color: transparent;
  }
  .lang-list-button {
    border-color: var(--gray-5);
    outline-color: transparent !important;
  }
  .lang-list-border {
    background-color: var(--gray-5);
  }
  .lang-list-button:focus {
    box-shadow: inset 0 0 0 1px var(--base-color);
  }
  .lang-list-active .lang-list-button {
    outline: 1px solid var(--base-color);
    border-color: var(--base-color) !important;
  }
  /*** Overall ***/
  td, li, th:not([style*="background"]):not([dir]), caption, p code, label code,
  dl code, .oo-ui-widget:not([placeholder]) div, .oo-ui-widget label,
  #pagehistory li.selected, #mwe-popups-settings main form label,
  #pt-anonuserpage, .oo-ui-textInputWidget .oo-ui-inputWidget-input,
  .oo-ui-messageDialog-title, .oo-ui-messageDialog-message,
  .mw-echo-ui-menuItemWidget > .oo-ui-labelElement-label, .mw-mmv-image-desc,
  .oo-ui-tabSelectWidget-framed .oo-ui-tabOptionWidget.oo-ui-optionWidget-selected,
  .guider_content h1, .guider_content p, select#searchLanguage option, dt,
  .tfa-recent, #contentSub, #contentSub2, .central-featured-lang .link-box small,
  .central-featured-lang .link-box small, .other-project-tagline,
  .mw-number-text, .tux-editor-header, .tux-breadcrumb, .mw-mmv-title,
  .ext-translate-language-selector-label, #mw-mwoauth-authorize-form,
  .mw-parser-output > div > blockquote > p, .mw-parser-output,
  .mw-echo-ui-menuItemWidget > .oo-ui-buttonElement-button > .oo-ui-labelElement-label {
    color: var(--gray-c);
  }
  .oo-ui-listToolGroup.oo-ui-widget-disabled,
  .oo-ui-listToolGroup-tools .oo-ui-tool.oo-ui-widget-disabled .oo-ui-tool-title,
  .oo-ui-popupToolGroup-tools .oo-ui-tool-link .oo-ui-tool-accel {
    color: var(--gray-7);
  }
  /* text color fix to black for https://en.wikipedia.org/wiki/Web_colors#Hex_triplet,
	   if this breaks something we need to differenciate specificity */
  .color-chart-x11-table tr[style*="color: black"] > td {
    color: var(--gray-1);
  }
  .wikitable[style*="color:white"] tr[style="color: black;"] td {
    color: var(--gray-1);
  }
  h1, h2, h3, h4, h5, h6, #footer li,
  .infobox th[style*="background"]:not([style*="#eaecf0"]):not([style*="background-color:#b0c4de;"]):not([style*="background-color: #f9f"]):not([style*="background-color:#b0c4de"]):not([style*="background-color:#FFD"]):not([style*="background-color: #91FAFA"]):not([style="background-color: #b0c4de"]):not([style*="background-color: antiquewhite"]),
  div[style*="color"]:not([style*="black;"]):not([style*="back"]):not([style*="966"]):not([style*="red"]),
  input[type="search"], input[type="submit"], .oo-ui-buttonElement-button,
  .oo-ui-buttonElement-button:hover, input[type="number"], select,
  .suggestions-result, input, .central-featured-lang .link-box em,
  div.flaggedrevs_preview, div.plainlinks,
  .table-partial[style*="background: #FFFFBB; color:black;"],
  a[href*="Wikipedia:Wikipedia_Signpost"] span, .vertical-navbox th span,
  span[style*="white-space:nowrap; line-height:120%; font-size:155%; color:#333;"],
  tr[style^="color:black"], span[title="To be announced"],
  div[style*="color: black;"],
  td[style*="color: #000000;"]:not([style^="background"]),
  td[style*="color:#000"]:not([style*="background"]), div[style*="color:black"],
  td[style*="color:darkslategray;"], .mw-mmv-post-image,
  .mw-mmv-permission-box .mw-mmv-permission-text, span[style*="color:#555555"],
  td[style^="background: #FFFFFF" i], td[style^="background:#FFFFFF" i],
  td[style^="background: #F5F" i], td[style^="background:#F5F" i] {
    color: var(--gray-c) !important;
  }
  a, .CategoryTreeToggle, #toc a, #toc a span, body .ui-button, .toctogglelabel,
  #content a:not(.new):not([role="button"]):not(.mw-charinsert-item):not([title="Help:Template"]),
  #mw-navigation li:not(.new) a:not(.new), #mw-panel li:not(.new) a:not(.new),
  #column-one li:not(.new) a:not(.new), #footer a:not(.new),
  .other-project-title, a.wbc-editpage:hover,
  .oo-ui-buttonElement-frameless.oo-ui-widget-enabled.oo-ui-flaggedElement-progressive > .oo-ui-buttonElement-button,
  span[style="color: #002BB8;"], a span[style="color:darkblue;"], .ui-dialog a,
  .langlist a:hover, span[style="color:#002bb8"],
  a:hover span[style="color:#002bb8"],
  #firstHeading div.fastcci-buttonset > .ui-button {
    color: var(--base-color) !important;
  }
  #firstHeading a > span, font[color="#006699"],
  .mw-rcfilters-ui-filterWrapperWidget-showNewChanges .oo-ui-labelElement-label,
  .oo-ui-listToolGroup-tools .oo-ui-tool-active.oo-ui-widget-enabled .oo-ui-tool-link .oo-ui-tool-title,
  .oo-ui-popupToolGroup-tools .oo-ui-tool-active.oo-ui-widget-enabled .oo-ui-tool-link .oo-ui-tool-title,
  .fancycaptcha-reload, .tux-breadcrumb__item--aggregate,
  .ext-translate-language-selector .uls {
    color: var(--base-color);
  }
  .mw-parser-output > div::before, .uls-icon-close,
  .tool-button[style*="Button_underline"],
  .tool-button[style*="Vector_strikeout"] {
    filter: invert(1);
  }
  .wb-langlinks-link > a:link::before, .wb-langlinks-link > a:visited::before,
  .search-container .sprite.svg-arrow-down {
    filter: grayscale(1) brightness(230%);
    opacity: .8;
  }
  .wb-langlinks-link > a:hover::before {
    filter: grayscale(1) brightness(280%);
    opacity: 1 !important;
  }
  .wikitable > tr > th[scope="col"][style*=":#fed1a0;"],
  .wikitable > * > tr > th[scope="col"][style*=":#fed1a0;"] {
    background: var(--gray-3) !important;
  }
  a:visited, #toc a:visited, #toc a:visited span,
  .vectorTabs li.new:not(.selected) a:visited,
  #content a:not(.new):not([role="button"]):not(.mw-charinsert-item):not([title="Help:Template"]):visited,
  #mw-panel li:not(.new) a:not(.new):visited,
  #p-navigation li:not(.new) a:not(.new):visited,
  #p-tb li:not(.new) a:not(.new):visited {
    color: var(--visited-color) !important;
  }
  legend .oo-ui-labelElement-label, .cnotice-message p,
  #mwe-popups-settings header h1, #mwe-popups-settings main form label > span,
  .mwe-popups-settings-help p, font[color="black"],
  #content td[style*="background: #f9f9e9;" i] a {
    color: var(--gray-d) !important;
  }
  a:hover,
  a:not(.mw-redirect):not(.link-box):hover span:not([style*="002"]):not(.oo-ui-tool-title):not(.oo-ui-labelElement-label):not([class*="other-project-"]):not([class*="help"]):not([style*="8DB"]):not(.frb-inline-container *),
  #toc a:hover, .suggestions-result .highlight,
  .suggestions-special .special-query {
    color: var(--white) !important;
  }
  .oo-ui-tool.oo-ui-widget-enabled.oo-ui-flaggedElement-primary.oo-ui-flaggedElement-progressive > .oo-ui-tool-link {
    color: var(--gray-e) !important;
    background-color: var(--base-color);
  }
  .ve-ce-branchNode-blockSlug, .ve-ce-branchNode-newSlug {
    outline: 1px dashed var(--gray-5);
    background-color: var(--gray-3);
  }
  .central-featured-lang a:focus, .other-project a:focus,
  #p-lang .uls-settings-trigger:focus {
    outline: 1px solid var(--base-color);
  }
  .oo-ui-messageDialog-content > .oo-ui-window-foot,
  .oo-ui-processDialog-content .oo-ui-window-head,
  .oo-ui-processDialog-content .oo-ui-window-foot {
    outline: 1px solid var(--gray-5);
  }
  .ve-ce-focusableNode-highlight {
    background: var(--base-color-rgba-3);
    box-shadow: inset 0 0 0 1px var(--base-color-rgba-3);
  }
  .ve-ce-linkAnnotation.ve-ce-annotation-active {
    box-shadow: 0 0 0 1px var(--gray-5);
    background-color: var(--gray-1);
  }
  .ve-ui-desktopContext .ve-ui-linkContextItem .ve-ui-linkContextItem-label {
    border-top-color: var(--gray-4);
  }
  .ve-ce-attachedRootNode::selection, .ve-ce-attachedRootNode ::selection {
    background: var(--base-color);
  }
  .oo-ui-tabSelectWidget-frameless .oo-ui-tabOptionWidget.oo-ui-optionWidget-selected {
    color: var(--base-color);
    box-shadow: inset 0 -2px 0 0 var(--base-color);
  }
  tt, tt[style*="background: white"] {
    background: var(--gray-1) !important;
  }
  div.mw-echo-ui-toggleReadCircleButtonWidget-circle {
    background-color: var(--gray-7) !important;
  }
  .mw-echo-ui-toggleReadCircleButtonWidget-circle.mw-echo-ui-toggleReadCircleButtonWidget-circle-unread {
    background-color: transparent !important;
    border: 1px solid var(--gray-7);
  }
  .mw-echo-ui-toggleReadCircleButtonWidget:hover .mw-echo-ui-toggleReadCircleButtonWidget-circle {
    background-color: var(--gray-69) !important;
  }
  .mw-echo-ui-toggleReadCircleButtonWidget:hover .mw-echo-ui-toggleReadCircleButtonWidget-circle-unread {
    background-color: var(--gray-2f) !important;
  }
  .mw-collapsible:not([class*="navbox-"]):not([class*="wpb"]) th:not(.wikidatainfobox-lcell):not([style*="cfe3ff;"]):not([style*="text"]):not([style*="#fff1d2;"]):not([style*="transparent"]):not([colspan="3"]):not(.mbox-text) {
    background-color: var(--gray-3) !important;
  }
  .oo-ui-toolbar-bar, .oo-ui-window-head, .oo-ui-window-foot,
  .oo-ui-popupToolGroup-tools, #language-settings-dialog {
    background: var(--gray-2) !important;
  }
  table.diff, td.diff-otitle, td.diff-ntitle,
  .oo-ui-menuOptionWidget.oo-ui-optionWidget-highlighted,
  .oo-ui-tool.oo-ui-widget-enabled > .oo-ui-tool-link:hover,
  .oo-ui-tool.oo-ui-widget-enabled > .oo-ui-tool-link:active,
  .oo-ui-tool.oo-ui-widget-enabled > .oo-ui-tool-link:active:focus,
  .oo-ui-tool.oo-ui-widget-enabled.oo-ui-tool-active > .oo-ui-tool-link,
  .oo-ui-tool.oo-ui-widget-enabled.oo-ui-popupToolGroup-active > .oo-ui-tool-link,
  .oo-ui-listToolGroup-tools .oo-ui-tool.oo-ui-widget-enabled:hover {
    background-color: var(--gray-3);
  }
  div[style*="background-color: rgb(249, 249, 249)"] {
    background-color: var(--gray-18) !important;
    border-top-color: var(--gray-5) !important;
  }
  .oo-ui-checkboxInputWidget.oo-ui-widget-enabled [type="checkbox"]:checked + span,
  .oo-ui-checkboxInputWidget.oo-ui-widget-enabled [type="checkbox"]:indeterminate + span {
    background-color: var(--base-color) !important;
    filter: none !important;
  }
  .oo-ui-checkboxInputWidget [type="checkbox"]:hover + span {
    border: 1px solid var(--base-color) !important;
  }
  input[type="checkbox"] {
    background-color: var(--base-color);
  }
  #mw-content-text .errorbox {
    background-color: var(--pink-0);
  }
  .aiv-header table[style*="background-color: #dfd;"] tbody,
  .aiv-header table[style*="background-color: #dfd;"] {
    background: var(--green-a3) !important;
  }
  th[style*="background-color: DarkSeaGreen;"] {
    background-color: var(--green-4) !important;
  }
  th.sidebar-title, th.sidebar-heading {
    background-color: var(--gray-4) !important;
  }
  input#searchButton[type="submit"] {
    border-left-color: var(--gray-a) !important;
    filter: invert(1) !important;
    background-color: var(--cm-10) !important;
  }
  .mw-parser-output > #Vorlage_Alternative,
  .infobox td[style*="border:1px #aaa solid;"],
  .infobox th[style*="background:#d0d0d0;"],
  .mw-parser-output > table.vertical-navbox, .tux-message-item-compact,
  .nomobile.plainlist, .infobox td[style^="background-color:#cfea9e;"],
  tr[style^="border-top:2px solid #aaaaaa"],
  div[style^="z-index"][style*="background:transparent;"][style*="1px solid #CCC"],
  .infobox[style*="border: solid 1px silver"],
  tr[style*="border:1px solid #aaa;"], table[style*="border:1px solid #CCCCCC;"],
  th[style*="border-top:1px solid #aaa;"], td[style*="border-bottom:1px #aaa"] {
    border-color: var(--gray-5) !important;
  }
  .frb-inline-main, .mw-parser-output .wwikipedii td,
  .mw-parser-output .wwikipedii th, .infobox.geography .mergedbottomrow td,
  .infobox.geography .mergedbottomrow th,
  .mw-parser-output .sidebar-collapse .sidebar-above,
  .mw-parser-output .sidebar-collapse .sidebar-below,
  .tux-editor-insert-buttons button,
  .infobox > tbody > tr:not([style]) > th[style*="background: #ccf"],
  .ve-ui-cxDesktopContext .ve-ui-cxLinkContextItem-sourceBody, .sidebar.WSerieV,
  table[style*="border:1px solid #CCCCCC;"],
  .ve-ui-mwTransclusionDialog-addParameterFieldset .ve-ui-mwParameterSearchWidget {
    border-color: var(--gray-5);
  }
  .uls-settings-trigger {
    border-color: var(--gray-2) !important;
  }
  .wikibase-toolbar-container.wikibase-toolbar-container {
    background: transparent !important;
  }
  .mw-parser-output .maf-info, .mw-parser-output .wwikipedii tr {
    background-color: var(--gray-18);
    border-color: var(--gray-5);
  }
  table td > div[style*="background-color: #F0EEFF;"] {
    background-color: var(--gray-18) !important;
    border-color: var(--gray-5) !important;
  }
  .tux-message-proofread, .tux-message-item-compact, .nomobile.plainlist,
  .mw-parser-output td[style*="background-color:#f9f9f9;"],
  .mw-parser-output td[style*="background-color:#FFFFFF;"],
  .mw-parser-output td[style*="background-color:#fbfbfb;"],
  .RMinline[style*="background:#F9F9F9;"] {
    background-color: var(--gray-2) !important;
  }
  .frb-inline-message, .frb-inline-main .cta-container {
    background-color: var(--gray-2);
  }
  table[class="toccolours;"] tr[style*="background:#EEEEEE"],
  .infobox-above[style*="background-color: #D3D3D3"], .sidebar-heading,
  .sidebar-list-title[style*="background-color: #def"],
  .cx-widget-translationtool, .ve-ui-cxDesktopContext .ve-ui-contextItem,
  .ve-ui-cxDesktopContext .ve-ui-cxDesktopContext-inspectors,
  .oo-ui-panelLayout.cx-card,
  .oo-ui-toolbar-tools > .ve-ui-toolbar-group-cx-mt.oo-ui-menuToolGroup,
  .cx-tools-editing-toolbar-container .ve-ui-positionedTargetToolbar > .oo-ui-toolbar-bar,
  td[bgcolor="#eeeeee"], tr[bgcolor="#eeeeee"] > td, .sidebar.WSerieV,
  .infobox-above[style*="background:#ccc"],
  .infobox-above[style*="background: #DEDEE2;"],
  .infobox-above[style*="background-color: #E7DCC3;"],
  .infobox-above[style="background:Silver"], tr[style="background: #DDD;"] {
    background-color: var(--gray-3) !important;
  }
  .ve-ui-mwParameterResultWidget.oo-ui-optionWidget-highlighted,
  .infobox-above[style=""], .infobox-header[style=""] {
    background-color: var(--gray-3);
  }
  table[class="toccolours;"] tr[style*="background:#FAFAFA"],
  .ve-ui-cxDesktopContext .ve-ui-cxLinkContextItem-sourceBody, th.sidebar-title,
  th.sidebar-heading {
    background-color: var(--gray-4) !important;
  }
  .infobox[style^="background:#F5F5F5;"],
  .mw-parser-output > table.vertical-navbox, #uls-settings-block,
  .mw-parser-output td[style*="background-color:#efefef;"],
  .mw-cx-ui-CategoryTagItemWidget.oo-ui-flaggedElement-highlight {
    background-color: var(--gray-18) !important;
  }
  input.languagefilter {
    background-color: var(--gray-2);
  }
  tr td[style="background: #FFFFFF; color:#000000;"],
  .cx-category-listing.oo-ui-icon-tag {
    color: var(--black) !important;
  }
  .userbox tbody tr td, .frb-headline > span,
  .infobox td.infobox-full-data th.infobox-above,
  .infobox-above[style*="background-color:#b0c4de"],
  .infobox-above[style*="background-color:#FFD"],
  .infobox-above[style*="background-color: #91FAFA"],
  .infobox-above[style="background-color: #b0c4de"], .oo-ui-icon-tag,
  .cx-message-widget-message, td[style^="background:  #FFFF"],
  td[style^="background:  #DFDFDF;"], td[style*="background:  #CFCFFF;"],
  td[style*="background:  #EFCFFF;"], td[style*="background:  #DFFFDF;"],
  td[style*="background:  #FFDF9F;"], tr > td[style="background: #FFFFFF;"],
  tr > td[style="background: #CFE8FF;"], tr > td[style="background: #EED8AE;"],
  tr > td[style="background: #FFF8DC;"], tr > td[style="background: #B9D3FF;"],
  tr > td[style="background: #6495ED;"], tr > td[style="background: #607CD2;"],
  tr > td[style="background: #828BD9;"], tr > td[style="background: #F0F8FF;"],
  .infobox tr[style*="background:#F6E5A8;"] td,
  .infobox tr[style*="background:#F6E5A8;"] th, td[style*="background:#AED0F0"],
  #mw-content-text .infobox-above[style*="background-color: lightblue"],
  #mwAg .infobox-above[style*="background-color: lightblue"],
  #mw-content-text .infobox-above[style*="background: #CCCCFF;"],
  #mwAg .infobox-above[style*="background: #CCCCFF;"],
  #mwAg .infobox-above[style*="background-color: lightblue"],
  #mw-content-text .infobox-above[style*="background-color: #e7dcc3;"],
  #mwAg .infobox-above[style*="background-color: #e7dcc3;"],
  #mw-content-text .infobox-above[style*="background-color:  #c9ffd9;"],
  #mw-content-text .infobox-above[style*="background:#F6DA9F"],
  #mw-content-text .infobox tr[style*="background:#F8C9B0;"] td,
  [class*="map"] [style*="font-size"][style*="left"],
  .infobox [style*="position"][style*="width"][style*="top"][style*="font-size"],
  .toccolours [style*="position"][style*="width"][style*="top"][style*="font-size"],
  table[style*="background-color:transparent; "] span[style*="background-color:#FEFEE9;"],
  .thumbimage [style*="position"][style*="width"] [style*="font-size"] {
    color: var(--gray-1) !important;
  }
  tr[style*="background:#B9C5FF;"] > td, td[style*="background: #FFCC66;"],
  td [style="background: #FFFF99;"], td[style="background: #4169E1;"],
  td[style="background: #8AB0FF;"], tr[style*="background:#E5D8C0;"] > td {
    color: var(--gray-1);
  }
  .reference-text span[style^="color:#555"] {
    color: var(--gray-a) !important;
  }
  .userbox tr td, .frb-headline > span, .frb-inline-message,
  .tux-pagemode-translation, .cx-translator__total-translations,
  .cx-translator__header, .tux-editor-insert-buttons button,
  .tux-proofread-translation, .tux-proofread-source,
  .cx-tlitem__details .target-title, .ve-ui-cxLinkContextItem-language,
  .cx-header-draft-status, .oo-ui-labelElement-label, .ve-cx-toolbar-mt-title {
    color: var(--gray-c) !important;
  }
  .cx-tlitem .cx-tlitem__details .last-updated, .cx-tlitem__languages__language,
  .cx-slitem__languages__language, .cx-selected-source-page__license,
  .mw-cx-tools-IssueTracking > .mw-cx-tools-IssueTracking-head .oo-ui-labelWidget,
  .cx-column--language-label, .cx-column-language-label {
    color: var(--gray-c);
  }
  .cx-header__trademark-text, .cx-translationlist__header {
    color: var(--white);
  }
  .cx-translationlist, .cx-dashboard-sidebar__help, .cx-translator {
    box-shadow: 0 1px 1px var(--gray-5);
  }
  .tux-message-editor .messagekey .caret {
    border-top-color: var(--gray-c);
  }
  .tux-message-editor .editor-expand {
    filter: invert(.35);
  }
  #uls-settings-block > button {
    filter: invert(.5);
  }
  .oo-ui-icon-check, .mw-ui-icon-check::before {
    filter: invert(.75);
  }
  .redirectText > li:first-child, .redirectText > li:first-child > a,
  .uls-languagefilter-clear {
    filter: invert(1) !important;
  }
  figure[typeof*="mw"] > figcaption {
    border: 1px solid var(--gray-5);
    background-color: var(--gray-3);
  }
  .oo-ui-menuOptionWidget.oo-ui-widget-enabled.oo-ui-optionWidget,
  .footer-sidebar-text, .site-license {
    color: var(--gray-9a);
  }
  .oo-ui-menuOptionWidget.oo-ui-widget-enabled.oo-ui-optionWidget:hover {
    background-color: var(--gray-3);
  }
  .oo-ui-menuOptionWidget.oo-ui-optionWidget-selected.oo-ui-optionWidget-highlighted:hover {
    color: var(--base-color);
  }
  .oo-ui-menuOptionWidget.oo-ui-optionWidget-selected {
    background-color: var(--blue-2) !important;
    color: var(--gray-c);
  }
  /* text selection */
  ::selection, ::-moz-selection {
    background-color: var(--base-color) !important;
    color: var(--white) !important;
  }
  /*** Background ***/
  .mw-prefs-buttons {
    background-image: var(--bg-selected);
    background-color: var(--gray-2);
  }
  button[type="submit"], .pure-button-primary-progressive,
  .oo-ui-buttonElement-framed.oo-ui-widget-enabled.oo-ui-flaggedElement-primary.oo-ui-flaggedElement-progressive > .oo-ui-buttonElement-button {
    background-color: var(--base-color) !important;
    border-color: transparent !important;
    color: var(--white) !important;
  }
  #languagesettings-panels .mw-ui-pressed {
    background-color: var(--base-color) !important;
    border-color: var(--base-color) !important;
    color: var(--white) !important;
  }
  .mw-ui-button {
    background-color: var(--gray-3) !important;
    color: var(--gray-d);
    border-color: var(--gray-4) !important;
  }
  .mw-ui-button:hover {
    background-color: var(--gray-4) !important;
    color: var(--gray-e) !important;
    border-color: var(--gray-5);
  }
  .oo-ui-buttonElement-framed.oo-ui-widget-enabled.oo-ui-flaggedElement-primary.oo-ui-flaggedElement-destructive > .oo-ui-buttonElement-button {
    background-color: var(--red-2) !important;
    border-color: transparent !important;
    color: var(--white) !important;
  }
  .oo-ui-barToolGroup-tools.oo-ui-toolGroup-enabled-tools .oo-ui-tool.oo-ui-widget-disabled.oo-ui-flaggedElement-primary > .oo-ui-tool-link {
    background-color: var(--gray-7);
  }
  .oo-ui-barToolGroup-tools.oo-ui-toolGroup-disabled-tools .oo-ui-tool.oo-ui-flaggedElement-primary > .oo-ui-tool-link {
    background-color: var(--gray-4);
  }
  .pure-button-primary-progressive:hover,
  .oo-ui-buttonElement-framed.oo-ui-widget-enabled.oo-ui-flaggedElement-primary.oo-ui-flaggedElement-progressive > .oo-ui-buttonElement-button:hover {
    background-image: linear-gradient(var(--white_1), var(--white_1)) !important;
  }
  .oo-ui-outlineOptionWidget.oo-ui-optionWidget-selected,
  .oo-ui-outlineOptionWidget.oo-ui-optionWidget-highlighted {
    background-color: var(--gray-28);
  }
  .mw-ui-button.mw-ui-progressive {
    color: var(--gray-e) !important;
    background-color: var(--base-color) !important;
    border-color: var(--base-color) !important;
  }
  .mw-ui-button.mw-ui-progressive:hover {
    background-color: var(--base-color);
    border-color: var(--base-color);
    opacity: .9;
  }
  .mw-ui-button.mw-ui-progressive:disabled,
  button.mw-ui-button.mw-ui-progressive:active {
    background-color: var(--gray-3) !important;
    color: var(--gray-5) !important;
    border-color: var(--gray-4) !important;
    opacity: .9;
  }
  .suggestions-dropdown,
  .wikibase-sitelinklistview .wikibase-sitelinkview .wikibase-sitelinkview-siteid-container {
    background-color: var(--gray-3);
    border-color: var(--gray-4);
  }
  a.suggestion-link {
    border-color: var(--gray-4);
  }
  .suggestion-title {
    color: var(--gray-c) !important;
  }
  .suggestion-description, .mw-mmv-credit {
    color: var(--gray-b9);
  }
  .suggestion-link.active {
    background-color: var(--blue-4);
  }
  .suggestions-results .suggestions-result:hover,
  .suggestions-result-current:hover, .mw-pulsating-dot::before,
  .mw-pulsating-dot::after {
    background: var(--base-color);
  }
  #mw-page-base, div.vectorTabs, div.vectorTabs *, .wikiEditor-ui-toolbar,
  #p-cactions-label, .client-js #preftoc, .client-js #preftoc li,
  .client-js #preftoc li.selected a, .ui-widget-content,
  .ext-cards-card-list h3::after, #simpleSearch,
  .mw-advancedSearch-fieldContainer {
    background-image: none !important;
  }
  /* hack around sidebar bottom border brightness */
  .portal h3, .vector-menu-portal h3 {
    background-image: linear-gradient(to top, transparent, var(--gray-c));
    background-size: auto 1px;
  }
  .vector-menu-content-list li[id*="ca-"] {
    border-top: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    background-color: var(--bg-selected);
    background-image: none;
  }
  .vector-menu-tabs, .vector-menu-tabs a, .vector-menu-tabs li,
  #mw-head .vector-menu-dropdown h3 {
    background-image: none;
  }
  .vector-menu-dropdown .vector-menu-content-list {
    background-color: var(--gray-2);
    border-color: var(--gray-5);
  }
  .wpb .portal ul, .boilerplate .pullquote, .module-shortcutboxplain,
  .mw-trackedTemplate, .todo-box, .mw-echo-ui-notificationItemWidget-unread {
    background-color: var(--gray-3) !important;
  }
  .mw-body-content .portal, .sistersitebox,
  .boilerplate:not[style*="background-color: #edeaff"], .NavFrame, .divbox,
  div.resolved span, div.unresolved span, div.unsure span, div.stale span,
  div.being_worked_on span, div.stuck span, div.disregard span, div.FYI span,
  .vertical-navbox:not(.nowraplinks),
  .mw-advancedSearch-fieldContainer .oo-ui-labelElement > .oo-ui-fieldsetLayout-header > .oo-ui-labelElement-label {
    background-color: var(--gray-2) !important;
  }
  table[style*="background-color: #f9f9f9; border: 1px solid #aaa;"] {
    background-color: var(--gray-3) !important;
  }
  input[type="search"]#searchInput:focus, #simpleSearch:hover #searchInput:focus {
    -webkit-box-shadow: none;
            box-shadow: none;
    border-color: var(--base-color) !important;
  }
  .oo-ui-inputWidget-input, .oo-ui-checkboxInputWidget-checkIcon {
    background-color: var(--gray-1) !important;
  }
  .help-intro-sidetab.help-intro-sidetab-active[style*="border-left: 1em solid #36c;"] {
    background-color: var(--blue-2) !important;
    border-left: 1em solid var(--blue-4) !important;
  }
  input:not(.languagefilter), input.mw-ui-input {
    background-color: var(--gray-1) !important;
    border-color: var(--gray-4) !important;
  }
  input.mw-ui-input:focus {
    box-shadow: inset 0 0 0 1px var(--base-color) !important;
  }
  .mw-ui-checkbox:not(#noop) [type="checkbox"] + label:hover::before {
    background-color: var(--gray-1);
    border: 1px solid var(--base-color) !important;
  }
  .mw-ui-checkbox:not(#noop) [type="checkbox"] + label::before {
    background-color: var(--gray-1);
    border-color: var(--gray-4);
  }
  .mw-ui-checkbox:not(#noop) [type="checkbox"]:enabled:checked + label::before {
    background-color: var(--base-color);
    border-color: var(--base-color);
  }
  .mw-ui-checkbox:not(#noop) [type="checkbox"]:enabled:checked:hover + label::before {
    background-color: var(--base-color);
    border-color: var(--base-color);
    opacity: .9;
  }
  .mw-ui-checkbox:not(#noop) [type="checkbox"]:enabled:checked:not(:active) + label::before {
    background-color: var(--base-color);
    border-color: var(--base-color);
  }
  input#searchButton {
    border-left: 1px solid var(--gray-5) !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
  }
  #searchButton, #mw-searchButton {
    font-size: .75em;
  }
  textarea {
    border-color: var(--gray-5);
  }
  textarea:not(input):focus, .wikiEditor-ui-text textarea#wpTextbox1:focus {
    border-color: var(--base-color);
  }
  .wikiEditor-ui-text textarea#wpTextbox1:not(input):focus {
    outline: 1px inset var(--base-color) !important;
  }
  .tool.oo-ui-buttonElement-frameless.oo-ui-iconElement:hover {
    outline: 1px solid var(--base-color);
    background-color: inherit !important;
  }
  /* fix clipping to right default is margin: 0; */
  .tool.oo-ui-buttonElement-frameless.oo-ui-iconElement {
    margin: 0 1px;
  }
  .mw-advancedSearch-namespace-selection {
    background: linear-gradient(var(--gray-1), var(--gray-2) .5em);
  }
  .oo-ui-tagItemWidget.oo-ui-widget-enabled,
  .search-container .js-langpicker-label, .uls-input-settings-disable-info,
  .uls-input-settings-no-inputmethods, .languagesettings-menu .menu-section,
  #languagesettings-settings-panel, legend, .vertical-navbox th,
  .wikiEditor-ui-toolbar .group .label, .flow-topic-meta,
  .mw-parser-output .chatheader-description, .ui-widget-content,
  span.mw-redirectedfrom, span.subpages, .mw-parser-output > p,
  .hatnote.navigation-not-searchable, .thumbcaption,
  .oo-ui-fieldLayout-disabled > .oo-ui-fieldLayout-body > .oo-ui-fieldLayout-header > .oo-ui-labelElement-label {
    color: var(--gray-a);
  }
  .oo-ui-tagItemWidget.oo-ui-widget-enabled:not(.oo-ui-tagItemWidget-fixed),
  .mw-revslider-container .mw-revslider-toggle-button.oo-ui-buttonElement-frameless.oo-ui-labelElement {
    background-color: var(--gray-2);
  }
  .oo-ui-tagItemWidget.oo-ui-widget-enabled.oo-ui-flaggedElement-invalid {
    border-color: var(--red-2);
  }
  .oo-ui-tagItemWidget.oo-ui-widget-enabled.oo-ui-flaggedElement-invalid:hover {
    border-color: var(--red-2);
  }
  .oo-ui-tagItemWidget.oo-ui-widget-enabled.oo-ui-flaggedElement-invalid:focus {
    border-color: var(--red-2);
    box-shadow: inset 0 0 0 1px var(--red-2);
  }
  .oo-ui-tagItemWidget.oo-ui-widget-enabled:focus,
  .oo-ui-tagMultiselectWidget.oo-ui-widget-enabled.oo-ui-tagMultiselectWidget-inlined.oo-ui-tagMultiselectWidget-focus .oo-ui-tagMultiselectWidget-handle {
    border-color: var(--base-color);
    box-shadow: inset 0 0 0 1px var(--base-color);
  }
  .languagesettings-menu .menu-section.active, .ui-widget-header, .rt-tooltip,
  .mw-body-content p {
    color: var(--gray-c);
  }
  .languagesettings-menu .menu-section.active,
  .languagesettings-menu .menu-section:focus {
    border-color: var(--base-color);
    background-color: var(--gray-28);
  }
  .settings-title, .checkbox strong, label.uls-font-label strong {
    color: var(--gray-c);
  }
  .languagesettings-menu .menu-section .settings-text, .uls-ui-languages p,
  .checkbox, label.uls-font-label {
    color: var(--gray-9a);
  }
  .uls-font-item {
    background-color: var(--gray-2) !important;
    border-color: var(--gray-5) !important;
  }
  .uls-search-label {
    filter: invert(1);
  }
  /* this is a hack for the display/keybord svg cause both use same selectors,
	 * it causes a slight shift in text when active/inactive toggle.
	 * using filters ddoesnt work on specific svg only, so hack! */
  .languagesettings-menu #display-panel-trigger {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path fill="%23ccc" d="M.002 2.275V15.22h8.405c.535 1.624-.975 1.786-1.902 2.505 0 0 2.293-.024 3.439-.024 1.144 0 3.432.024 3.432.024-.905-.688-2.355-.868-1.902-2.505h8.527V2.275h-20zm6.81 1.84h.797l3.313 8.466H9.879L8.836 9.943H5.462l-1.043 2.638h-.982zm.368 1.104c-.084.369-.211.785-.368 1.227L5.83 9.023h2.699l-.982-2.577c-.128-.33-.234-.747-.368-1.227zm7.117.982c.753 0 1.295.157 1.656.491.365.334.552.858.552 1.595v4.294h-.675l-.184-.859h-.062c-.315.396-.605.655-.92.798-.311.138-.758.184-1.227.184-.626 0-1.115-.168-1.472-.491-.353-.323-.491-.754-.491-1.35 0-1.275 1.028-1.963 3.068-2.025h1.043v-.429c0-.495-.091-.87-.307-1.104-.211-.238-.574-.307-1.043-.307-.526 0-1.115.107-1.779.429l-.307-.675a4.748 4.748 0 0 1 1.043-.429 4.334 4.334 0 0 1 1.104-.123zm.307 3.313c-.761.027-1.318.157-1.656.368-.334.207-.491.54-.491.982 0 .346.1.617.307.798.211.181.544.245.92.245.595 0 1.012-.164 1.35-.491.342-.326.552-.762.552-1.35v-.552z"/></svg>');
  }
  .languagesettings-menu #input-panel-trigger {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path fill="%23ccc" d="M9 1.281c-.124.259-.185.599-.5.688-.55.081-1.133.018-1.688 0-.866-.032-1.733-.148-2.594 0-.588.157-.953.727-1.188 1.25-.178.416-.271.836-.344 1.281H-.002V16h20V4.5H3.654c.109-.52.203-1.057.563-1.469.222-.231.587-.17.875-.188 1.212.003 2.415.179 3.625.063.463-.058.812-.455.969-.875l.188-.438-.875-.313zM1.875 7.125h1.563c.094 0 .188.093.188.188v1.531a.201.201 0 0 1-.188.188H1.875c-.094 0-.156-.093-.156-.188V7.313c0-.094.062-.188.156-.188zm2.844 0h1.563c.094 0 .156.093.156.188v1.531c0 .094-.062.188-.156.188H4.719c-.094 0-.156-.093-.156-.188V7.313c0-.094.062-.188.156-.188zm2.844 0h1.563c.094 0 .156.093.156.188v1.531c0 .094-.062.188-.156.188H7.563a.201.201 0 0 1-.188-.188V7.313c0-.094.093-.188.188-.188zm2.813 0h1.563c.094 0 .188.093.188.188v1.531a.201.201 0 0 1-.188.188h-1.563c-.094 0-.156-.093-.156-.188V7.313c0-.094.062-.188.156-.188zm2.844 0h1.563c.094 0 .156.093.156.188v1.531c0 .094-.062.188-.156.188H13.22c-.094 0-.156-.093-.156-.188V7.313c0-.094.062-.188.156-.188zm2.844 0h1.531c.094 0 .188.093.188.188v1.531a.201.201 0 0 1-.188.188h-1.531a.201.201 0 0 1-.188-.188V7.313c0-.094.093-.188.188-.188zm-12.844 3h1.563c.094 0 .156.093.156.188v1.563c0 .094-.062.156-.156.156H3.22c-.094 0-.156-.062-.156-.156v-1.563c0-.094.062-.188.156-.188zm2.906 0h1.563c.094 0 .188.093.188.188v1.563c0 .094-.093.156-.188.156H6.126c-.094 0-.156-.062-.156-.156v-1.563c0-.094.062-.188.156-.188zm2.938 0h1.531c.094 0 .188.093.188.188v1.563c0 .094-.093.156-.188.156H9.064c-.094 0-.188-.062-.188-.156v-1.563c0-.094.093-.188.188-.188zm2.906 0h1.563c.094 0 .156.093.156.188v1.563c0 .094-.062.156-.156.156H11.97c-.094 0-.188-.062-.188-.156v-1.563c0-.094.093-.188.188-.188zm2.906 0h1.563c.094 0 .156.093.156.188v1.563c0 .094-.062.156-.156.156h-1.563c-.094 0-.156-.062-.156-.156v-1.563c0-.094.062-.188.156-.188zM4.001 13.688h12c.088 0 .156.068.156.156v.844a.154.154 0 0 1-.156.156h-12a.154.154 0 0 1-.156-.156v-.844c0-.088.068-.156.156-.156z"/></svg>') no-repeat 16px 8px;
  }
  /* fading linear gradient */
  .mwe-popups-extract::after {
    background-image: linear-gradient(to right, transparent, var(--gray-2) 50%) !important;
  }
  .mw-mmv-ttf-ellipsis::before {
    background-image: linear-gradient(to right, transparent, var(--gray-2)) !important;
  }
  .mwe-popups-extract .mwe-popups-fade,
  .mw-mmv-permission-box .mw-mmv-permission-text .mw-mmv-permission-text-fader {
    background-image: linear-gradient(to bottom, transparent, var(--gray-2)) !important;
  }
  .ui-widget-overlay {
    background: var(--black_8) !important;
  }
  .oo-ui-windowManager-modal > .oo-ui-dialog {
    background-color: var(--gray-3_5);
  }
  .mw-body-content pre, .mw-body-content code,
  td[style*="border-bottom: 1px solid #eee; background-color:#ffffff"] {
    background-color: var(--gray-1) !important;
    border-color: var(--gray-5) !important;
    color: var(--gray-b9) !important;
  }
  td[style*="background:#FFFFFF" i], .jfk-bubble, .navpopup,
  .popup_drop:hover .popup_menu, .popup_drop .popup_menu:hover, .example-select,
  .mw-parser-output a > span[style*="background"]:not([style*="cedff2"]):not([style*="6c71c4"]):not([style*="color:black"]),
  p[style*="background-color: #EEE;"] {
    background-color: var(--gray-18) !important;
  }
  .mw-widget-dateInputWidget-handle, .mwe-pt-control-gradient,
  .mw-parser-output .quotebox, #languagesettings-settings-panel,
  .uls-language-settings-close-block,
  .uls-input-settings .uls-input-settings-inputmethods-list, .imeselector-menu,
  .uls-ime-menu-settings-item, .ip-label-container, .cbnnr-main, .mw_metadata td,
  .kephir-sagittarius-invite, .infobox, .lang-list-container,
  .mw-parser-output #bottombox-d, .uls-lcd, .uls-search,
  .ns-0 #mw-content-text h1, .wikiEditor-ui-toolbar, .mw-ext-score-popup,
  .oo-ui-tagMultiselectWidget.oo-ui-widget-disabled .oo-ui-tagMultiselectWidget-handle,
  .mw-parser-output .quotebox-title, .mw-parser-output .portal > ul,
  .uls-menu .uls-no-results-view .uls-no-found-more, .mainpage-box-content,
  .mw-echo-ui-notificationItemWidget {
    background-color: var(--gray-2); /* non-important */
  }
  .mw-notification, .mw-pt-languages, div.mw-pt-languages, div.thumbinner {
    background-color: var(--gray-2);
    border-color: var(--gray-5);
  }
  table:not(.mainpage-maintable):not(.floatright):not([style="width:100%; border:0px; border-collapse:collapse"]):not([style*="#f1f5"]):not([style*="#CED"]):not([style*="background:none;"]):not([style*="background:none;"]):not([cellspacing="0"]):not([style="text-align:center; width:100%"]):not([style*="E6F"]):not([style*="ffff"]):not([style*="E9F"]):not([style*="fff5"]):not([style*="E9E"]):not(.authortemplate):not(.fmbox-editnotice):not([style*="Alice"]):not([style*="efe"]):not([style*="transparent"]):not(.tmbox):not(.standard-talk):not(.cmbox-notice):not([style*="e4f2e4"]):not([style*="feeeee"]):not([style*="dfd"]):not(.processheadertemplate):not(.statstable):not([style*="eeeeff"]):not([style*="yellow"]):not([style*="#f7f8ff"]):not(.mw-alerte):not(.mp_header):not([style*="#FFDBDB"]):not([style*="#F0F8FF"]):not([style*="background: transparent"]):not([style*="background-color:transparent"]):not([style*="rgba(0,0,255,0.1)"]):not(.vertical-navbox):not([style*="#F5FAFF"]):not([style*="background color:transparent"]):not(#cite-err-report):not(.tmbox-notice):not([style*="background:transparent"]):not([style*="f5faff"]):not(.messagebox):not(#sisterwikis):not([class*="Caution"]):not(.tmbox-style):not(.ibox2),
  button:not([type="submit"]):not(.tux-editor-save-button):not(.save):not([class*="-settings-block"]):not([class*="mw-mmv-"]):not(.pure-button):not(.wikidialog-button):not(.uls-input-toggle-button),
  select, textarea:not([class*="mw-editfont"]),
  tr[style*="background: antiquewhite" i]:not([style*="color: black" i]), #toc,
  td[style*="background-color"]:not([style*="F9"]):not([style*="FD"]):not([style*="FF"]):not([style*="CF"]):not([style*="fed"]):not([style*="F0F"]):not([style*="F9F"]):not([style*="D4F"]):not([style*="FDB"]):not([style*="FFF"]):not([style*="f4e"]):not([style*="faf"]):not([style*="f1f"]):not([style*="B0C4DE"]):not([style*="cdde"]):not([style*="8"]):not([style*="00"]):not([style*="FF6"]):not([style*="f2f2f4"]):not([style*="fc3"]):not([style*="E6F2FF"]):not([style*="ccccff"]):not([style*="f89b8f"]):not([style*="fba89d"]):not([style*="fecec8"]):not([style*="f68d81"]):not([style*="c1ccf2"]):not([style*="b8c4ef"]):not([style*="fcb5ab"]):not([style*="d33"]):not([style*="fec1b9"]):not([style*="fedbd7"]):not([style*="f0f0ff"]):not([style*="a8b4ea"]):not([style*="b1bced"]):not([style*="c9d4f5"]):not([style*="d2dbf7"]):not([style*="9fade8"]):not([style*="eaf3ff"]):not([style*="e2ebfc"]):not([style*="f8f8ff"]):not([style*="f8fff8"]):not([style*="ddddff"]):not([style*="eeeeff"]),
  #mw-content-text div[style*="background:"]:not([style*="BF4"]):not([style*="468"]):not([style*="CED"]):not([style*="008"]):not([style*="ffe"]):not([style*="ffdb"]):not([style*="fafc"]):not([style*="ffe4"]):not([style*="3ff"]):not([style*="ffee"]):not([style*="bce1"]):not([style*="ebb"]):not([style*="EDD"]):not([style*="bff"]):not([style*="f7f7"]):not([style*="444"]):not([style*="fdf6e3"]):not([style*="CCF"]):not([style*="F9FCFF"]):not([style*="2a4b8d"]):not([style*="E0EEE0"]):not([style*="E8F1FF"]):not([style*="EEF"]):not([style*="7DC2F5"]):not([style*="CCC"]):not([style*="F16633"]):not([style*="F0F0FF"]):not([style*="336"]):not([style*="D33"]):not([style*="F0F8FF"]):not([style*="00AF89"]):not([style*="36C"]):not([style*="006699"]):not([style*="990000"]):not([style*="#e7eff5;"]):not([style*="#90EE90;"]):not([class*="-active"]):not([style*="#339966"]):not([style*="FFF"]):not([style*="2E0"]):not([style*="14866d"]):not([style*="transparent"]):not([style*="F5FAFF"]):not([style*="A3B1BF"]):not([style*="fff5fa"]):not([style*="faf5ff"]):not([style^="overflow:hidden;background:#e44"]):not([style*="width"][style*="height"][style*="bottom"]:not([style*="opacity"])),
  .vevent td:not(.fileinfo-paramfield), .referencetooltip li, .suggestions,
  .mw-ui-button[style*="background"]:not([style*="d33682"]):not([style*="6c71c4"]):not([style*="268bd2"]),
  .mw-ui-button[style*="background"] *, .wikiEditor-ui, .mw-search-results li,
  table.navbox.collapsible tr:nth-child(2) > td, div.menu, ul.menu,
  .oo-ui-popupWidget-popup, .mwe-popups, .mwe-popups-is-not-tall,
  .mwe-popups-is-tall, .ui-widget-content, .oo-ui-window-body,
  #pagehistory li.selected, .tracklist tr,
  .mw-searchresults-has-iw .iw-resultset, .cx-callout-content,
  .oo-ui-widget:not([id*="advancedSearchField-"]):not(.wbmi-link-notice):not([aria-disabled]):not(.oo-ui-tabOptionWidget):not(.flow-ui-boardDescriptionWidget):not(.oo-ui-buttonWidget):not(.oo-ui-tabSelectWidget-framed):not(.oo-ui-optionWidget-selected):not(span):not(.ve-ui-cxTargetSurface):not(.ve-ui-cxSourceSurface),
  tr[style*="background:#f2f2f2" i], th[style*="background:#EDF1F1" i],
  td[style*="background:#EDF1F1" i], tr[style*="background-color:white" i],
  tr[style*="background:#f9f9f9" i], td[bgcolor="#FFFFFF" i],
  tr[style*="background:#ddd" i], td[style*="background: #F2F2F2" i],
  tr[style*="background-color:#F2F2F2" i],
  tr[style*="background-color:#FFF5EE" i], tr[bgcolor="FFF5EE" i],
  td[bgcolor="FFF5EE" i], tr[style*="background-color:#f0f0f0" i],
  .wikitable.charts-zebragrey > tbody > tr:nth-of-type(odd),
  td > span[style*="background-color:#eee" i], table.flextable th,
  tr[style*="background-color:#FFF" i], td[style*="background:#eee" i],
  #mw-searchoptions, .mw-advancedSearch-namespace-selection,
  td[style*="background:#fff2e6" i], td[style*="background:#F9F9F0"],
  td[style*="background:#F4F9F0"], td[style*="background:#F9F0F0"],
  td[style*="background:#f0f0f0"], #mwe-popups-settings,
  th[style*="border-bottom: 1px solid #eee; background-color:#ffffff;"],
  .table-na[style*="background:#ececec;"], #js-lang-lists .text, div.arcProg,
  .infoboks.biografi tr.overskrift th, .infoboks tr.rad td,
  .infoboks tr.bilde td, .infoboks tr.overskrift td,
  table[style*="background:#f9f9f9;"], table[style*="background:#F7F8FF" i],
  table[style*="background-color: white; font-size:100%; border:1px solid #CCC" i] th,
  td[style*="background:#F5F5F5"], td[bgcolor="f5f5f5"] {
    background-color: var(--gray-2) !important;
  }
  #advancedSearchField-plain, #advancedSearchField-not, #advancedSearchField-or,
  #advancedSearchField-deepcategory, #advancedSearchField-hastemplate {
    background-color: var(--gray-1) !important;
  }
  .mw-parser-output table.floatright[width="35%"] {
    background: none;
  }
  div[style*="background-color: #f0f0f0" i],
  table[style*="background: transparent"],
  table[style*="background-color:transparent"],
  table.navbox-inner[style*="background:transparent"],
  .mw-advancedSearch-fieldContainer .oo-ui-labelElement > .oo-ui-fieldsetLayout-header > .oo-ui-labelElement-label {
    background: transparent !important;
    background-color: transparent !important;
  }
  body .ui-button, caption[style*="background-color:#f2f2f2"],
  table[style*="background:#f8f9fa"] {
    background: var(--gray-28) !important;
    border-color: var(--gray-5) !important;
  }
  td[style*="background: White;"] {
    background: var(--gray-18) !important;
    border-color: var(--gray-18) !important;
  }
  span[style*="background-color:white; color:black;"],
  span[style="background-color:white; color:#808080;"] {
    background: transparent !important;
    color: var(--gray-c) !important;
  }
  table:not(.wikitable) td[bgcolor]:not([bgcolor="fcf"]),
  table:not(.wikitable) tr[bgcolor]:not([bgcolor="D0D8DD"]),
  .app-badges .footer-sidebar-content,
  .languagesettings-menu .menu-section:hover {
    background-color: var(--gray-28);
  }
  #mw-sidebar-button:focus {
    border-color: var(--base-color);
    box-shadow: inset 0 0 0 1px var(--base-color);
  }
  table[style*="background-color:#fff;" i], .search-form fieldset, table.ambox,
  tr[style*="background-color: #fff;" i],
  .mw-ui-button[style*="background-color:#008B6D" i],
  tr[style*="background-color: #f5faff;" i], tr[style*="background:#E9E9E9" i],
  th[style*="background:#E9E9E9" i],
  table.infobox.hproduct > tbody > tr[style*="background: #F0F0F0;" i],
  tr[style*="background:#f0f0f0;" i], td[style*="background:lightyellow" i],
  td[style*="background:#eeeeff" i], td[style*="background:#ddddff" i],
  .oo-ui-buttonElement-button:not(.flow-ui-boardDescriptionWidget-editButton):hover,
  .tracklist tr[style*="background-color:#f7f7f7" i],
  td[style*="background:#F9F9F9" i], th[style*="background:gainsboro" i],
  td[style*="background:gainsboro" i], h2[style*="background:#eeeeee" i],
  h2[style*="background:#efefef" i], tr[bgcolor*="#eee" i],
  tr[style*="background-color:#eee" i],
  div[style*="background-color:#eee" i]:not([style*="8aa"]),
  .wikitable.charts-zebragrey > tbody > tr:nth-of-type(even),
  tr[style*="background:#fbf8d6" i], table.flextable td,
  table.nmbox td:not(.mbox-text), tr[style*="background-color:#f7f7f7"],
  .mw-changeslist-line tr.mw-rcfilters-ui-changesListWrapperWidget-enhanced-grey td:not(:nth-child(-n+2)),
  div[style*="background-color: #fff"]:not([style*="ff3"]):not([style*="fff5"]):not([style*="fffd"]),
  div[style*="background:#FFF;"] {
    background-color: var(--gray-28) !important;
  }
  .oo-ui-tabSelectWidget-framed, .flaggedrevs-color-1 {
    background-color: var(--gray-3);
  }
  .oo-ui-tabSelectWidget-framed .oo-ui-tabOptionWidget.oo-ui-optionWidget-selected,
  .oo-ui-tabSelectWidget-framed .oo-ui-tabOptionWidget.oo-ui-widget-enabled.oo-ui-optionWidget-selected:hover {
    background-color: var(--gray-2);
    color: var(--gray-a);
  }
  .oo-ui-tabSelectWidget-framed .oo-ui-tabOptionWidget.oo-ui-widget-enabled:hover {
    background-color: var(--gray-28);
    color: var(--gray-a);
  }
  .oo-ui-tabSelectWidget-framed .oo-ui-tabOptionWidget.oo-ui-optionWidget-selected .oo-ui-labelElement-label {
    border-bottom-color: var(--gray-2);
  }
  div.barbox > table > tbody > tr > th, .cx-campaign-contributionsmenu li:hover,
  .suggestions-results, .suggestions-special, #mwe-pt-list-more,
  .fr-watchlist-pending-notice, div.flaggedrevs_notice,
  .imeselector-menu .selectable-row:hover, .guider, .mw-pt-languages-label,
  .mw_metadata th, .uls-language-block > ul > li:hover, th[bgcolor],
  .wikEdDiffBlock, .installerMessage, .styled-select:hover,
  .rt-settingsLink:hover, .mw-echo-ui-notificationItemWidget:hover {
    background-color: var(--gray-3); /* don't include !important flag */
  }
  .imeselector {
    background-color: var(--gray-18);
  }
  .imeselector:not(.imeselector-open):hover {
    background-color: var(--gray-18);
  }
  .uls-ime-more-settings-link:hover {
    filter: brightness(130%);
  }
  body .ui-dialog .ui-icon-closethick, .vectorMenu h3::after, .oo-ui-icon-add,
  .mw-ui-icon-add::before {
    filter: invert(1) brightness(80%);
  }
  .oo-ui-icon-highlight {
    filter: grayscale(1) brightness(250%);
  }
  .ui-state-hover, .ui-widget-content .ui-state-hover,
  .ui-widget-header .ui-state-hover, .ui-state-focus,
  .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {
    border: 1px solid var(--gray-4) !important;
    background: var(--gray-5);
  }
  .ui-state-default, .ui-widget-content .ui-state-default,
  .ui-widget-header .ui-state-default {
    border: 1px solid var(--blue-3);
    background: var(--blue-3);
    color: var(--base-color);
  }
  .client-js .mw-ui-radio:not(#noop) [type="radio"]:enabled:checked + label::before {
    border-color: var(--base-color);
  }
  .client-js .mw-ui-radio:not(#noop) [type="radio"] + label::before {
    background-color: var(--gray-1);
    border: 1px solid var(--gray-4);
  }
  .uls-no-found-more {
    border-top: 1px solid var(--gray-4);
    color: var(--gray-c);
  }
  table.wikitable > tr > th,
  table.wikitable > * > tr > th:not([style*="#ABC;"]):not([style*="#fdb"]):not([style*="#fed"]):not([style*="#fef"]):not([style*="#d4f"]):not([style*="0; color:#000000"]):not([style*="FF; color:#000000"]),
  td[style*="background: #ececec;" i], th[style*="background:#eee" i],
  th[style*="background-color: #eee" i], tr[style*="background: #dddddd" i],
  tr[style*="background-color: #f7f7f7;" i], th[style*="background:#F2F2F2" i],
  #filetoc, th[style*="background:#F9F9F9" i],
  th[style*="background-color: lightgrey" i], th[style*="background:#ddd" i],
  .infobox th[style*="background"]:not([style*="green"]):not([style*="background:#dfc;"]):not(.infobox-above):not([style*="lavender"]):not([style*="cfe3ff"]):not([style*="rgb(235,235,210)"]):not([style*="antiquewhite"]),
  .infobox tr[style*="background-color"]:not([style*="cedff2"]),
  .infobox td[style*="background"]:not([style*="D8B"]):not([style*="cdde"]):not([style*="e8dbae"]):not([style*="FE4"]):not([style*="301"]):not([style*="722"]):not([style*="781"]):not([style*="702"]):not([style*="6C3"]):not([style*="880"]):not([style*="866"]):not([style*="512"]):not([style*="DE6"]):not([style*="C54"]):not([style*="B76"]):not([style*="9A4"]):not([style*="4E2"]):not([style*="DF0"]):not([style*="DA7"]):not([style*="DF7"]):not([style*="9F00"]):not([style*="FAE6"]):not([style*="E0B0"]):not([style*="800080"]):not([style*="66023C"]):not([style*="7851A9"]):not([style*="C71585"]):not([style*="BF00FF"]):not([style*="A020F0"]):not([style*="9370DB"]):not([style*="663399"]),
  td[style*="background:#F2F2F2" i],
  table.wikitable > tbody > tr[style*="background-color:#F6F6F6" i], .tlheader,
  th[style*="background:whitesmoke" i], td[style*="background:whitesmoke" i],
  th[style*="#FFEBAD" i], table.nmbox th:not([style*="#EEF"]),
  tr[style*="#eaecf0" i], td[style*="#eaecf0" i],
  p[style*="background-color:#F7FAFC" i],
  .infobox.standard-talk tr[style*="#e8dbae"], th[style="background:lightgrey"],
  div[style*="background-color: #dddddd" i] {
    background-color: var(--gray-3) !important;
  }
  .plainlinks.mw-trackedTemplate {
    background: var(--gray-3) !important;
  }
  .licensetpl.fileinfotpl tbody th {
    background-color: var(--gray-4) !important;
  }
  .navbox-abovebelow, .navbox-group, .navbox-subgroup .navbox-title {
    background-color: var(--gray-5);
  }
  .mw-revslider-revision, .cbnnr-close {
    background-color: var(--gray-7);
  }
  .mw-revslider-revision-wrapper:hover, .mw-revslider-revision-wrapper-hovered {
    background-color: var(--black_5);
  }
  /* remove background image/gradient */
  .keyboard-key, kbd, div#editpage-specialchars a,
  body div.ui-dialog .ui-widget-header {
    background: var(--gray-3) !important;
    border-color: var(--gray-5) !important;
  }
  .catlinks {
    background: var(--gray-28);
  }
  body .ui-button:hover {
    background: var(--gray-4) !important;
    border-color: var(--gray-5) !important;
  }
  /* white background to wikEd - see #24 */
  .wikEdFrameBodySyntax, #wpTextbox1 {
    background: var(--gray-18);
  }
  #wmhu-tax-banner-text {
    color: var(--base-color);
  }
  #wmhu-tax-banner {
    background-color: var(--gray-18);
    border: 0;
  }
  img[src*="Check_mark_23x20_02.svg"],
  img[resource*="OOjs_UI_icon_userTalk-ltr.svg"] {
    filter: invert(100%) brightness(80%);
  }
  img[src*="76px-Wikimedia_Research_Newsletter_Logo.png"],
  img[src*="OOjs_UI_icon_download-ltr-progressive.svg.png"],
  .mw-rcfilters-ui-filterWrapperWidget-showNewChanges .oo-ui-iconElement-icon {
    filter: invert(100%) hue-rotate(180deg);
  }
  div[style="float:right; border:1px solid #CCC"] {
    border-color: var(--gray-2) !important;
  }
  a img[src*="WRN_header.png"] {
    filter: invert(88%);
  }
  .keyboard-key, kbd {
    box-shadow: .1em .2em .2em var(--gray-4) !important;
  }
  .mw-mmv-ttf-ellipsis, .navpopup, .oo-ui-popupWidget-popup, input + span,
  .pure-form input[type=search], .searchbox .mw-ui-input {
    box-shadow: none !important;
  }
  .mw-ui-input {
    box-shadow: inset 0 0 0 .1em var(--gray-5);
  }
  .pure-button-primary-progressive:focus,
  .oo-ui-buttonElement-framed.oo-ui-widget-enabled.oo-ui-flaggedElement-primary.oo-ui-flaggedElement-progressive > .oo-ui-buttonElement-button:focus:not(:active),
  .mw-ui-button.mw-ui-progressive:focus:not(:active) {
    box-shadow: inset 0 0 0 1px var(--base-color), inset 0 0 0 2px var(--gray-a) !important;
  }
  .oo-ui-popupToolGroup-tools .oo-ui-tool.oo-ui-widget-enabled .oo-ui-tool-link:focus {
    outline: 0;
    box-shadow: inset 0 0 0 2px var(--base-color);
  }
  .oo-ui-popupToolGroup.oo-ui-widget-enabled > .oo-ui-popupToolGroup-handle:focus,
  .oo-ui-tool.oo-ui-widget-enabled > .oo-ui-tool-link:focus {
    outline: 1px solid var(--base-color);
    box-shadow: inset 0 0 0 1px var(--base-color);
  }
  .oo-ui-popupToolGroup.oo-ui-popupToolGroup-active > .oo-ui-popupToolGroup-handle:hover {
    background-color: rgba(41, 98, 204, .1);
    color: var(--base-color);
  }
  .oo-ui-popupToolGroup.oo-ui-popupToolGroup-active > .oo-ui-popupToolGroup-handle {
    background-color: var(--gray-3);
    color: var(--base-color);
  }
  .oo-ui-buttonElement-framed.oo-ui-widget-enabled.oo-ui-flaggedElement-primary.oo-ui-flaggedElement-progressive > .oo-ui-buttonElement-button:focus {
    border-color: var(--base-color) !important;
  }
  .oo-ui-textInputWidget.oo-ui-widget-enabled .oo-ui-inputWidget-input:focus {
    box-shadow: inset 0 0 0 1px var(--base-color);
    border-color: var(--base-color);
  }
  .oo-ui-textInputWidget.oo-ui-widget-enabled textarea.oo-ui-inputWidget-input:focus {
    outline: 1px solid var(--base-color);
  }
  strong, em {
    text-shadow: none !important;
  }
  hr {
    background-color: transparent !important;
    border-color: var(--gray-5) !important;
  }
  .mw-editfont-monospace {
    background-color: var(--gray-2);
    color: var(--gray-b9);
  }
  .mw-rcfilters-ui-changesListWrapperWidget .mw-changeslist-legend {
    background-color: var(--gray-2);
  }
  .mw-parser-output .mainpage-welcome-slogan,
  .flow-topic-summary-container .flow-topic-summary .flow-topic-summary-author,
  .flow-topic-summary-container .flow-ui-editTopicSummaryWidget .flow-topic-summary-author,
  .mw-mmv-options-text-header, .imeselector a,
  .languagesettings-menu .menu-section:hover .settings-text, .ime-disable-link,
  span[style="white-space:nowrap;"], .mw-history-legend, #mw-content-text,
  .mw-mmv-options-text-body {
    color: var(--gray-c);
  }
  .mw-body pre, .mw-body code, .mw-body .mw-code {
    background-color: var(--gray-1) !important;
    border-color: var(--gray-5) !important;
    color: var(--gray-b9) !important;
  }
  .messagebox, .errorbox, .warningbox, .successbox,
  .suggestions-special .special-label, .reference-text,
  .mwe-popups .mwe-popups-container, #viewsourcetext {
    color: var(--gray-c);
  }
  .mwe-popups .mwe-popups-container {
    background-color: var(--gray-2) !important;
  }
  .mwe-popups .mwe-popups-container .mwe-popups-thumbnail {
    background-color: var(--white) !important;
  }
  span[style="color:black"], span[style*="color: black"],
  span[style*="color:black"], td[style*="color: black"],
  td[style*="color: #2C2C2C"], .mwe-popups-container a {
    color: var(--gray-c) !important;
  }
  span[style*="color: #000"], .wikiEditor-ui-toolbar .page-table td,
  sup[style*="color:#000"], div[style*="color:#000"], .editOptions {
    color: var(--gray-c) !important;
  }
  .flow-component.flow-board-page.flow-full-height-side-rail .flow-board-header::before {
    background-color: var(--gray-3);
  }
  div[style*="background: #FFF;"], div[style*="background:gainsboro;"],
  div[style*="background:#eee"] {
    background: var(--gray-4) !important;
  }
  .mw-ui-icon.mw-ui-icon-before::before, .mw-ui-icon.mw-ui-icon-element::before,
  .mw-parser-output .helpContents-icon, img[src*="9px-AnonEditWarning"],
  a img[src*="OOjs_UI_icon"] {
    filter: invert(80%);
  }
  .k-player .control-bar {
    filter: invert(1) brightness(80%) contrast(135%);
    background: var(--gray-b9);
    border: 1px solid var(--gray-7);
  }
  .k-player .credits_box, .lButton:hover, .rButton:not(.k-options):hover,
  .ui-icon-comment:hover {
    background-color: var(--gray-2);
    border: 0 !important;
  }
  .k-player .lButton, .k-player .rButton {
    border: medium none;
  }
  .k-player .volume-slider a.ui-slider-handle.ui-state-hover,
  .k-player .volume-slider a.ui-slider-handle.ui-state-focus {
    border: 0 !important;
  }
  .k-player .k-options:hover {
    border-bottom: 1px solid transparent !important;
  }
  .k-player .ui-widget-content {
    color: var(--gray-c);
  }
  div > .flow-menu li a, .mw-mmv-post-image,
  .mw-mmv-permission-box .mw-mmv-permission-text .mw-mmv-permission-text-fader a {
    background-color: var(--gray-2) !important;
  }
  .mw-mmv-download-button, .mw-mmv-reuse-button, .mw-mmv-options-button,
  .mw-mmv-close, .mw-mmv-fullscreen, .mw-mmv-next-image, .mw-mmv-prev-image,
  .mw-page-container, #mw-panel {
    background-color: transparent !important;
    border: none !important;
  }
  .mw-rcfilters-ui-filterMenuHeaderWidget-header,
  .mw-rcfilters-ui-menuSelectWidget-footer,
  .oo-ui-tagMultiselectWidget.oo-ui-widget-enabled .oo-ui-tagMultiselectWidget-handle,
  .oo-ui-tagMultiselectWidget.oo-ui-widget-enabled.oo-ui-tagMultiselectWidget-outlined .oo-ui-tagMultiselectWidget-handle,
  .flaggedrevs_reviewform, .mw-specialCiteThisPage-bibliographic {
    background-color: transparent;
  }
  .oo-ui-tagMultiselectWidget-focus {
    box-shadow: inset 0 0 0 1px var(--base-color) !important;
  }
  .mw-enhanced-rc.mw-changeslist-line,
  .mw-collapsible.mw-enhanced-rc.mw-changeslist-line,
  .mw-collapsible.mw-enhanced-rc.mw-changeslist-line td,
  .oo-ui-widget-enabled.mw-rcfilters-ui-changesListWrapperWidget,
  .oo-ui-widget-enabled.mw-rcfilters-ui-filterWrapperWidget,
  .oo-ui-widget-enabled.mw-rcfilters-ui-rcTopSectionWidget,
  .oo-ui-widget-enabled.oo-ui-tagMultiselectWidget,
  .oo-ui-widget-enabled.mw-rcfilters-ui-watchlistTopSectionWidget {
    background-color: transparent !important;
  }
  tr[style*="background"]:not([style*="ABCDEF"]):not([style*="cedff2"]):not([style*="E4F2E4"]):not([style*="ccccff"]):not([style*="white"]) {
    background-color: transparent;
  }
  #mw-fr-watchlist-pending-notice {
    background-color: var(--red-3) !important;
    border-color: var(--red-0) !important;
  }
  table[style*="border:1px solid #a2a9b1"] {
    border: 1px solid var(--gray-4) !important;
  }
  table[style*="border:1px solid #a2a9b1"] td,
  .mw-rcfilters-ui-changesListWrapperWidget .mw-changeslist-legend {
    border-color: var(--gray-4) !important;
  }
  .oo-ui-tagItemWidget, .wikiEditor-ui-toolbar .page-table td {
    border-color: var(--gray-5);
  }
  .mw-rcfilters-ui-filterTagMultiselectWidget.oo-ui-widget-enabled .oo-ui-tagMultiselectWidget-handle,
  .mw-rcfilters-ui-filterTagMultiselectWidget-views-select-widget.oo-ui-widget,
  .ui-dialog, .mw-parser-output table.dmbox {
    border-color: var(--gray-4);
  }
  .oo-ui-buttonElement-framed.oo-ui-widget-enabled > .oo-ui-buttonElement-button,
  .oo-ui-buttonElement-framed.oo-ui-widget-disabled > .oo-ui-buttonElement-button {
    background-color: var(--gray-2);
    border-color: var(--gray-3) !important;
  }
  /*** Background Color Styles ***/
  div[style*="background-color:white; border"] {
    background-color: transparent !important;
    border: 1px solid var(--green-3) !important;
  }
  .mw-highlight .gh {
    color: var(--cm-5) !important;
  }
  /* ORES highlight colors */
  .mw-rcfilters-ui-highlights-color-none {
    background-color: var(--gray-7);
  }
  .mw-rcfilters-ui-highlights-color-c1,
  .mw-rcfilters-ui-tagItemWidget-highlight[data-color="c1"]::before {
    background-color: var(--blue-2);
  }
  .mw-rcfilters-ui-changesListWrapperWidget li.mw-rcfilters-highlight-color-c1,
  .mw-rcfilters-ui-changesListWrapperWidget .mw-rcfilters-highlight-color-c1 tr:first-child,
  .mw-rcfilters-ui-changesListWrapperWidget tr.mw-rcfilters-highlight-color-c1.mw-rcfilters-ui-highlights-enhanced-toplevel:not(.mw-rcfilters-ui-changesListWrapperWidget-enhanced-grey) td:not(:nth-child(-n+2)),
  .mw-rcfilters-ui-changesListWrapperWidget tr.mw-rcfilters-highlight-color-c1.mw-rcfilters-ui-highlights-enhanced-nested:not(.mw-rcfilters-ui-changesListWrapperWidget-enhanced-grey) td:not(:nth-child(-n+4)) {
    background-color: var(--blue-2) !important;
  }
  .mw-rcfilters-ui-highlights-color-c2,
  .mw-rcfilters-ui-tagItemWidget-highlight[data-color="c2"]::before {
    background-color: var(--cyan-1) !important;
  }
  .mw-rcfilters-ui-changesListWrapperWidget li.mw-rcfilters-highlight-color-c2,
  .mw-rcfilters-ui-changesListWrapperWidget .mw-rcfilters-highlight-color-c2 tr:first-child,
  .mw-rcfilters-ui-changesListWrapperWidget tr.mw-rcfilters-highlight-color-c2.mw-rcfilters-ui-highlights-enhanced-toplevel:not(.mw-rcfilters-ui-changesListWrapperWidget-enhanced-grey) td:not(:nth-child(-n+2)),
  .mw-rcfilters-ui-changesListWrapperWidget tr.mw-rcfilters-highlight-color-c2.mw-rcfilters-ui-highlights-enhanced-nested:not(.mw-rcfilters-ui-changesListWrapperWidget-enhanced-grey) td:not(:nth-child(-n+4)) {
    background-color: var(--cyan-1);
  }
  .mw-rcfilters-ui-highlights-color-c3,
  .mw-rcfilters-ui-tagItemWidget-highlight[data-color="c3"]::before {
    background-color: var(--ores-1);
  }
  .mw-rcfilters-ui-changesListWrapperWidget li.mw-rcfilters-highlight-color-c3,
  .mw-rcfilters-ui-changesListWrapperWidget .mw-rcfilters-highlight-color-c3 tr:first-child,
  .mw-rcfilters-ui-changesListWrapperWidget tr.mw-rcfilters-highlight-color-c3.mw-rcfilters-ui-highlights-enhanced-toplevel:not(.mw-rcfilters-ui-changesListWrapperWidget-enhanced-grey) td:not(:nth-child(-n+2)),
  .mw-rcfilters-ui-changesListWrapperWidget tr.mw-rcfilters-highlight-color-c3.mw-rcfilters-ui-highlights-enhanced-nested:not(.mw-rcfilters-ui-changesListWrapperWidget-enhanced-grey) td:not(:nth-child(-n+4)) {
    background-color: var(--ores-1) !important;
  }
  .mw-rcfilters-ui-highlights-color-c4,
  .mw-rcfilters-ui-tagItemWidget-highlight[data-color="c4"]::before {
    background-color: var(--ores-2);
  }
  .mw-rcfilters-ui-changesListWrapperWidget li.mw-rcfilters-highlight-color-c3.mw-rcfilters-highlight-color-c4,
  .mw-rcfilters-ui-changesListWrapperWidget .mw-rcfilters-highlight-color-c3.mw-rcfilters-highlight-color-c4 tr:first-child,
  .mw-rcfilters-ui-changesListWrapperWidget tr.mw-rcfilters-highlight-color-c3.mw-rcfilters-highlight-color-c4.mw-rcfilters-ui-highlights-enhanced-toplevel:not(.mw-rcfilters-ui-changesListWrapperWidget-enhanced-grey) td:not(:nth-child(-n+2)),
  .mw-rcfilters-ui-changesListWrapperWidget tr.mw-rcfilters-highlight-color-c3.mw-rcfilters-highlight-color-c4.mw-rcfilters-ui-highlights-enhanced-nested:not(.mw-rcfilters-ui-changesListWrapperWidget-enhanced-grey) td:not(:nth-child(-n+4)) {
    background-color: var(--ores-2) !important;
  }
  .mw-rcfilters-ui-highlights-color-c5,
  .mw-rcfilters-ui-tagItemWidget-highlight[data-color="c5"]::before {
    background-color: var(--ores-3);
  }
  .mw-rcfilters-ui-changesListWrapperWidget li.mw-rcfilters-highlight-color-c3.mw-rcfilters-highlight-color-c4.mw-rcfilters-highlight-color-c5,
  .mw-rcfilters-ui-changesListWrapperWidget .mw-rcfilters-highlight-color-c3.mw-rcfilters-highlight-color-c4.mw-rcfilters-highlight-color-c5 tr:first-child,
  .mw-rcfilters-ui-changesListWrapperWidget tr.mw-rcfilters-highlight-color-c3.mw-rcfilters-highlight-color-c4.mw-rcfilters-highlight-color-c5.mw-rcfilters-ui-highlights-enhanced-toplevel:not(.mw-rcfilters-ui-changesListWrapperWidget-enhanced-grey) td:not(:nth-child(-n+2)),
  .mw-rcfilters-ui-changesListWrapperWidget tr.mw-rcfilters-highlight-color-c3.mw-rcfilters-highlight-color-c4.mw-rcfilters-highlight-color-c5.mw-rcfilters-ui-highlights-enhanced-nested:not(.mw-rcfilters-ui-changesListWrapperWidget-enhanced-grey) td:not(:nth-child(-n+4)) {
    background-color: var(--ores-3) !important;
  }
  .mw-rcfilters-ui-filterMenuOptionWidget.oo-ui-flaggedElement-muted .mw-rcfilters-ui-itemMenuOptionWidget-label-title,
  .mw-rcfilters-ui-filterMenuOptionWidget.oo-ui-flaggedElement-muted .mw-rcfilters-ui-itemMenuOptionWidget-label-desc,
  .ve-ui-mwHelpPopupTool-version-label, .ve-ui-mwHelpPopupTool-version-link,
  .ve-ui-mwHelpPopupTool-version-date {
    color: var(--gray-7);
  }
  /* Red
  ** Red links (non-existant pages) */
  div.vectorTabs li.new:not(.selected) a, .mw-plusminus-neg,
  span[style="color:darkred"] {
    color: var(--red-1) !important;
  }
  table.xambox.xambox-type-serious {
    border-left: 1em solid var(--red-2);
  }
  .mw-translate-fuzzy {
    background-color: var(--red-3);
  }
  td[style*="background:#ff9292;"] {
    background-color: var(--red-2) !important;
    color: var(--gray-e);
    filter: contrast(130%);
  }
  td[style="background-color: #FDB3AB;"],
  th[style*="background:#fdb3ab;"][colspan="3"],
  th[style*="background:#fdb3ab;"][colspan="4"] {
    background-color: var(--red-3) !important;
    color: var(--gray-c);
  }
  span[style*="border:1px solid #AAAAAA; padding:1px .6em; background-color:#fdb3ab;"] {
    background-color: var(--red-3) !important;
    border: 1px solid var(--red-3) !important;
  }
  span[style*="border-left: 1.2em solid #FDB3AB;"] {
    border-left: 1.2em solid var(--red-3) !important;
  }
  .wikitable td[style*="background:#ffdbdb;"] {
    background-color: var(--red-2) !important;
    color: var(--gray-e);
    filter: contrast(120%);
  }
  td[style*="background:#fff;"] {
    background-color: var(--gray-28) !important;
  }
  div[style*="background:#ffdbdb"] {
    background-color: var(--red-0) !important;
  }
  span[style*="color:black;background:white;border:3px solid red;"] {
    background-color: var(--gray-2) !important;
    border-color: var(--red-3) !important;
    color: var(--gray-a) !important;
  }
  div.mw-warning-with-logexcerpt, div.mw-lag-warn-high,
  div.mw-cascadeprotectedwarning, div#mw-protect-cascadeon,
  div.titleblacklist-warning, div.locked-warning {
    background-color: var(--red-0);
    border-color: var(--red-1);
  }
  div[style*="border-right:1px solid #FFFFFF; padding:0.1em; background-color:#FFFAF5"] {
    background: var(--red-0) !important;
    border-color: var(--red-0) !important;
  }
  div[style*="border-bottom:2px solid #FFFFFF; padding:0.1em; background-color:#FFF2E6;"] {
    background: var(--red-3) !important;
    border-color: var(--red-3) !important;
  }
  th[style="color:white;background:red"],
  caption[style="color:white;background:red"] {
    background: var(--red-2) !important;
    color: var(--gray-d) !important;
  }
  th[style*="background:#fdb3ab;"] {
    background: var(--red-2) !important;
  }
  td[style*="background: #FDD;" i], .table-no, td[style*="background:#fdd" i],
  td[style*="background: #ffdddd" i], tr[style*="background:#FFDDDD" i],
  tr[style*="background:#fbb" i] {
    background: var(--red-3) !important;
    color: var(--gray-d) !important;
  }
  td.projects[style*="border:1px solid #C66; background: #FCC;"],
  table[style="background-color: #FFDBDB; border-color: #BB7070"],
  div[style*="border:solid 1px #282; background:#ebb;"] {
    background: var(--red-0) !important;
    border-color: var(--red-3) !important;
  }
  td[style="background-color: #d33"] {
    background-color: var(--red-3) !important;
    color: var(--gray-a);
  }
  td[style="background-color: #fedbd7"] {
    background-color: var(--red-0) !important;
    color: var(--gray-a);
  }
  td[style="background-color: #f68d81"], td[style="background-color: #fecec8"],
  td[style="background-color: #fba89d"], td[style="background-color: #f89b8f"] {
    background-color: var(--red-3) !important;
    color: var(--gray-a);
  }
  td[style="background-color: #fec1b9"], td[style="background-color: #fcb5ab"],
  td[style*="background:#fcc"] {
    background-color: var(--red-3) !important;
  }
  table[style="background-color: #fee;"] {
    background-color: var(--red-0) !important;
  }
  tbody td[style*="border:1px solid #6BB; background-color: #CFF;"] {
    background-color: var(--blue-2) !important;
    border: 1px solid var(--blue-3) !important;
  }
  .plainlinks span[style*="background-color: #36c;"],
  .plainlinks span[style*="border: 1px solid #36c;"] {
    background-color: var(--base-color) !important;
    border: 1px solid var(--base-color) !important;
  }
  body .ui-button.ui-button-blue {
    border-color: var(--base-color) !important;
    background: var(--base-color) !important;
    background: linear-gradient(to bottom, var(--base-color) 0%, var(--base-color) 90%) !important;
  }
  body .ui-button.ui-button-blue:hover {
    border-color: var(--base-color) !important;
    background: var(--base-color) !important;
    background: linear-gradient(to bottom, var(--base-color) 0%, var(--base-color) 90%) !important;
    color: var(--gray-e) !important;
    opacity: .9;
  }
  .plainlinks span[style="color:white;"], body a span .ui-button-text b,
  div[style*="background-color:#f8f9fa;"] b, span[style="color:#4F4F4F;"] {
    color: var(--gray-d) !important;
  }
  td[style*="border:1px solid #BF4D40; padding:5px; background:#D9948C; color:#FFFFFF" i] {
    border: 1px solid var(--red-3) !important;
    background: var(--red-3) !important;
    color: var(--gray-e) !important;
  }
  div[style*="border:1px solid #BF4D40; background:#BF4D40"] {
    border: 1px solid var(--red-3) !important;
    background: var(--red-3) !important;
  }
  div[style*="background:#F2DBD9"] {
    background: var(--red-rgb) !important;
  }
  td[style*="border:1px solid #BF4D40"], div[style*="border: 1px solid #BF4D40"] {
    border: 1px solid var(--red-3) !important;
  }
  /* Green */
  .mw-parser-output .MainPage__column--left {
    border: 1px solid var(--green-1);
    color: var(--gray-e);
    background-color: var(--green-4);
  }
  .resolved span[style*="border:1px solid #aaa" i],
  div[style*="border-color: #50C878"] {
    border-color: var(--green-2) !important;
  }
  .resolved span[style*="background:#f9fcf9" i],
  div[style*="background-color: #ECFCF4"] {
    background-color: var(--green-4) !important;
  }
  .mw-plusminus-pos, span[style*="color: darkgreen" i] {
    color: var(--green-1) !important;
  }
  .mw-parser-output .documentation, .mw-parser-output .documentation-metadata,
  .template-documentation {
    background-color: var(--green-4);
    border-color: var(--green-2);
  }
  .footertemplate, #navigationHeader div[style*="background-color:#E6F2E6" i] {
    background-color: var(--green-4) !important;
    border: 1px solid var(--green-2) !important;
  }
  th[style*="background:#EEF3E2" i] {
    background-color: var(--green-3) !important;
  }
  td[style="background-color: #D4F4B4;"], th[style*="background:#d4f4b4;"] {
    background-color: var(--green-2) !important;
  }
  span[style*="border-left: 1.2em solid #D4F4B4" i] {
    border-left: 1.2em solid var(--green-2) !important;
  }
  span[style*="border:1px solid #AAAAAA; padding:1px .6em; background-color:#d4f4b4" i] {
    background-color: var(--green-2) !important;
    border: 1px solid var(--green-2) !important;
  }
  th[style*="background:palegreen;"] {
    background-color: var(--green-2) !important;
    color: var(--gray-e) !important;
  }
  td.mbox-text[style*="border: 1px solid #AAA;"],
  tr[style*="background-color: #E4F2E4;"], div[style*="background:#00af89;"] {
    background-color: var(--green-4) !important;
  }
  td[style*="background-color:#98FB98" i],
  td[style*="background-color: #98FB98" i] {
    background-color: var(--green-2) !important;
  }
  td[style*="background-color:#CFC" i], td[style*="background-color: #CFC" i] {
    background-color: var(--green-3) !important;
  }
  u[style*="color:#087643;"] {
    color: var(--green-1) !important;
    text-shadow: none !important;
  }
  div[style*="background-color: #E5FFE5; border: 0.2em light green;"] {
    background-color: var(--green-4) !important;
    border: .1em solid var(--green-1) !important;
  }
  td[style="border:1px solid #9f8f9f; padding: .5em 1em 1em; color: #000; background-color: #f8fff8"],
  table[style*="border: #9BF solid 1px; background: #F1F8F1;"],
  table[style*="border: 1px solid #060; background: #dfd;"],
  table[style*="background-color: #e4f2e4; border: 1px solid #ada;"] {
    border-color: var(--green-2) !important;
    background: var(--green-4) !important;
  }
  div[style*="background:#CEF2E0"] {
    border-color: var(--green-1) !important;
    background: var(--green-2) !important;
  }
  div[style*="background-color:#cef2e0"], th[style*="background: #CFC;"] {
    background: var(--green-2) !important;
  }
  div[style*="background:#E6FFF2"], div[style*=";background:#14866d"] {
    background: var(--green-3) !important;
  }
  div[style*="background:#E0EEE0"],
  th.navbox-title[style="background:lightgreen;"],
  th.navbox-title[style="background:lightgreen;"] * {
    background: var(--green-3) !important;
  }
  th.navbox-title[style="background:#3EB489;"],
  th.navbox-title[style="background:#3EB489;"] * {
    background: var(--green-2) !important;
  }
  div[style*="background:#F5FFFA"] {
    background: var(--green-4) !important;
    border-color: var(--green-1) !important;
    color: var(--gray-9a) !important;
  }
  div[style*="border-bottom:1px solid #A3BFB1"] {
    border-bottom: 1px solid var(--green-1) !important;
    border: 0 solid var(--green-1) !important;
  }
  div[style*="background:#F5FFFA; border-style:solid; border-width:1px; border-color: #A3BFB1"],
  div[style*="border: 1px solid #ffc9c9; background-color: #fffff3;"] {
    background: var(--green-4) !important;
    border: 1px solid var(--green-1) !important;
  }
  div[style*="border:1px solid #A3BFB1; background-color:#E6FFF2;"] {
    background: var(--green-2) !important;
    border-color: var(--green-1) !important;
  }
  div[style*="border-bottom:2px solid #FFFFFF; padding:0.1em; background-color:#E0F2CE;"] {
    background: var(--green-2) !important;
    border-color: var(--green-2) !important;
  }
  div[style="float:left; box-sizing:border-box; margin:0.2em 0; width:50%; border-left:1px solid #FFFFFF; border-right:1px solid #FFFFFF; padding:0.1em; background-color:#F2FFE6"] {
    background: var(--green-4) !important;
  
Download .txt
gitextract_kle9h_1m/

├── .dockerignore
├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   └── feature_request.md
│   ├── dependabot.yml
│   └── workflows/
│       ├── ci.yml
│       └── docker-image.yml
├── .gitignore
├── Chinese.md
├── Dockerfile
├── LICENSE.md
├── Persian.md
├── README.md
├── Russian.md
├── SECURITY.md
├── __tests__/
│   ├── routes.test.js
│   ├── smoketest.test.js
│   └── utils.test.js
├── media/
│   └── .gitignore
├── package.json
├── src/
│   ├── cache_control.js
│   ├── routes.js
│   ├── utils.js
│   └── wikiless.js
├── static/
│   ├── .well-known/
│   │   ├── ai.txt
│   │   ├── dnt-policy.txt
│   │   ├── gpc.json
│   │   └── tdmrep.json
│   ├── about.html
│   ├── ip-ranges.txt
│   ├── mobile.css
│   ├── robots.txt
│   ├── styles.css
│   ├── styles_de.css
│   ├── styles_fr.css
│   ├── styles_ko.css
│   ├── styles_vi.css
│   ├── verify.txt
│   ├── wikipedia_styles_dark.css
│   ├── wikipedia_styles_dark_de.css
│   ├── wikipedia_styles_dark_fr.css
│   ├── wikipedia_styles_dark_ko.css
│   ├── wikipedia_styles_dark_vi.css
│   ├── wikipedia_styles_light.css
│   ├── wikipedia_styles_light_de.css
│   ├── wikipedia_styles_light_fr.css
│   ├── wikipedia_styles_light_ko.css
│   └── wikipedia_styles_light_vi.css
└── wikiless.config
Download .txt
SYMBOL INDEX (3 symbols across 2 files)

FILE: src/cache_control.js
  function deleteStatic (line 4) | async function deleteStatic() {

FILE: src/routes.js
  function md5HashParts (line 88) | function md5HashParts(fileName) {
  function isSafeRedirectPath (line 174) | function isSafeRedirectPath(path) {
Condensed preview — 48 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (986K chars).
[
  {
    "path": ".dockerignore",
    "chars": 49,
    "preview": ".git*\ndocker-compose.yml\nnode_modules\n*.md\n.env*\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "chars": 834,
    "preview": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Describe the b"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "chars": 595,
    "preview": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Is your fea"
  },
  {
    "path": ".github/dependabot.yml",
    "chars": 403,
    "preview": "version: 2\nupdates:\n# Maintain dependencies for GitHub Actions\n  - package-ecosystem: \"github-actions\"\n    directory: \"/"
  },
  {
    "path": ".github/workflows/ci.yml",
    "chars": 664,
    "preview": "name: CI\npermissions:\n  contents: read\n  pull-requests: write\n  \non:\n  push:\n    branches: [ main ]\n  pull_request:\n    "
  },
  {
    "path": ".github/workflows/docker-image.yml",
    "chars": 879,
    "preview": "services:\n  wikiless:\n    build:\n      context: .\n      dockerfile: Dockerfile\n    container_name: wikiless\n    hostname"
  },
  {
    "path": ".gitignore",
    "chars": 49,
    "preview": "node_modules/\nconfig.js\ndocker-compose.yml\n*.log\n"
  },
  {
    "path": "Chinese.md",
    "chars": 1426,
    "preview": "[English](README.md) | [中文](Chinese.md) | [فارسی](Persian.md) | [Русский](Russian.md)\n\n# Wikiless\n\n![hidden_dimension](h"
  },
  {
    "path": "Dockerfile",
    "chars": 1688,
    "preview": "# For reference to update this file\n#https://hub.docker.com/_/node/\n#https://github.com/GoogleContainerTools/distroless/"
  },
  {
    "path": "LICENSE.md",
    "chars": 34510,
    "preview": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C)"
  },
  {
    "path": "Persian.md",
    "chars": 2212,
    "preview": "[English](README.md) | [中文](Chinese.md) | [فارسی](Persian.md) | [Русский](Russian.md)\n\n# Wikiless\n\n![hidden_dimension](h"
  },
  {
    "path": "README.md",
    "chars": 1141,
    "preview": "[English](README.md) | [中文](Chinese.md) | [فارسی](Persian.md) | [Русский](Russian.md)\n\n# Wikiless\n\n![hidden_dimension](h"
  },
  {
    "path": "Russian.md",
    "chars": 1340,
    "preview": "[English](README.md) | [中文](Chinese.md) | [فارسی](Persian.md) | [Русский](Russian.md)\n\n# Wikiless\n\n![hidden_dimension](h"
  },
  {
    "path": "SECURITY.md",
    "chars": 803,
    "preview": "# Security Policy\n\n## Supported Versions\n\nWe release patches for security vulnerabilities in the following versions:\n\n| "
  },
  {
    "path": "__tests__/routes.test.js",
    "chars": 3684,
    "preview": "const express = require('express');\nconst request = require('supertest');\nconst cookieParser = require('cookie-parser');"
  },
  {
    "path": "__tests__/smoketest.test.js",
    "chars": 545,
    "preview": "jest.mock('../wikiless.config', () => ({\n  redis_url: 'redis://127.0.0.1:6379',\n  redis_password: '',\n  https_enabled: f"
  },
  {
    "path": "__tests__/utils.test.js",
    "chars": 2123,
    "preview": "jest.mock('../wikiless.config', () => ({\n  default_lang: 'en',\n  wikimedia_useragent: 'test-agent',\n  domain: 'test.exam"
  },
  {
    "path": "media/.gitignore",
    "chars": 80,
    "preview": "# Ignore everything in this directory\n*\n# Except this file\n!.gitignore\n!map.png\n"
  },
  {
    "path": "package.json",
    "chars": 695,
    "preview": "{\n  \"name\": \"Wikiless\",\n  \"version\": \"0.1.3\",\n  \"description\": \"A free open source alternative Wikipedia front-end focus"
  },
  {
    "path": "src/cache_control.js",
    "chars": 651,
    "preview": "module.exports.removeCacheFiles = function() {\n  const config = require('../wikiless.config');\n\n  async function deleteS"
  },
  {
    "path": "src/routes.js",
    "chars": 6532,
    "preview": "module.exports = (app, utils) => {\n  const config = require('../wikiless.config')\n  const path = require('path')\n  const"
  },
  {
    "path": "src/utils.js",
    "chars": 21837,
    "preview": "module.exports = function(redis) {\n  const config = require('../wikiless.config')\n  const parser = require('node-html-pa"
  },
  {
    "path": "src/wikiless.js",
    "chars": 3417,
    "preview": "const config = require('../wikiless.config')\nconst compression = require('compression')\nconst path = require('path')\ncon"
  },
  {
    "path": "static/.well-known/ai.txt",
    "chars": 4444,
    "preview": "# Spawning AI\n# Prevent datasets from using the following file types\n\nUser-Agent: *\nDisallow: *.txt\nDisallow: *.pdf\nDisa"
  },
  {
    "path": "static/.well-known/dnt-policy.txt",
    "chars": 10480,
    "preview": "Do Not Track Compliance Policy \n\nVersion 1.0\n\nThis domain complies with user opt-outs from tracking via the \"Do Not Trac"
  },
  {
    "path": "static/.well-known/gpc.json",
    "chars": 48,
    "preview": "{\n\n \"gpc\": true,\n \"lastUpdate\": \"2025-04-02\"\n\n}\n"
  },
  {
    "path": "static/.well-known/tdmrep.json",
    "chars": 70,
    "preview": "[\n    {\n        \"location\": \"/\",\n        \"tdm-reservation\": 1\n    }\n]\n"
  },
  {
    "path": "static/about.html",
    "chars": 1679,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta name=\"CCBot\" content=\"nofollow\">\n    <meta name=\"robots\" content=\"no"
  },
  {
    "path": "static/ip-ranges.txt",
    "chars": 329,
    "preview": "# OpenAI - GPTBot \n52.230.152.0/24\n52.233.106.0/24\n\n# OpenAI - Plugins\n23.102.140.112/28\n13.66.11.96/28\n104.210.133.240/"
  },
  {
    "path": "static/mobile.css",
    "chars": 5578,
    "preview": "html.is-mobile,\nhtml.is-mobile body {\n  margin: 0;\n  padding: 0;\n  font-family: \"Helvetica Neue\", \"Noto Sans SC\", sans-s"
  },
  {
    "path": "static/robots.txt",
    "chars": 2206,
    "preview": "user-agent: *\nAllow: /$\nDisallow: /\n\nUser-agent: archive.org_bot\nDisallow: /\n\n# The example for img2dataset, although th"
  },
  {
    "path": "static/styles.css",
    "chars": 104,
    "preview": "@import \"wikipedia_styles_light.css\";\n@import \"wikipedia_styles_dark.css\" (prefers-color-scheme: dark);\n"
  },
  {
    "path": "static/styles_de.css",
    "chars": 110,
    "preview": "@import \"wikipedia_styles_light_de.css\";\n@import \"wikipedia_styles_dark_de.css\" (prefers-color-scheme: dark);\n"
  },
  {
    "path": "static/styles_fr.css",
    "chars": 110,
    "preview": "@import \"wikipedia_styles_light_fr.css\";\n@import \"wikipedia_styles_dark_fr.css\" (prefers-color-scheme: dark);\n"
  },
  {
    "path": "static/styles_ko.css",
    "chars": 110,
    "preview": "@import \"wikipedia_styles_light_ko.css\";\n@import \"wikipedia_styles_dark_ko.css\" (prefers-color-scheme: dark);\n"
  },
  {
    "path": "static/styles_vi.css",
    "chars": 110,
    "preview": "@import \"wikipedia_styles_light_vi.css\";\n@import \"wikipedia_styles_dark_vi.css\" (prefers-color-scheme: dark);\n"
  },
  {
    "path": "static/verify.txt",
    "chars": 31,
    "preview": "please remove from archive.org\n"
  },
  {
    "path": "static/wikipedia_styles_dark.css",
    "chars": 218943,
    "preview": "/**\n* Dark theme copied from here:\n* https://github.com/StylishThemes/Wikipedia-Dark\n* LICENSE: https://github.com/Styli"
  },
  {
    "path": "static/wikipedia_styles_dark_de.css",
    "chars": 337,
    "preview": "@import \"wikipedia_styles_dark.css\";\n\n/* slightly increasing readability of top-left wikipedia logo */\n#p-logo .mw-wiki-"
  },
  {
    "path": "static/wikipedia_styles_dark_fr.css",
    "chars": 2630,
    "preview": "@import \"wikipedia_styles_dark.css\";\n\n/* the logo section at the left side at the top of the French page header */\nimg.m"
  },
  {
    "path": "static/wikipedia_styles_dark_ko.css",
    "chars": 1243,
    "preview": "@import \"wikipedia_styles_dark.css\";\n\n/* the logo section at the left side at the top of the Korean page header */\nimg.m"
  },
  {
    "path": "static/wikipedia_styles_dark_vi.css",
    "chars": 2283,
    "preview": "@import \"wikipedia_styles_dark.css\";\n\n/* the logo section at the left side at the top of the Korean page header */\nimg.m"
  },
  {
    "path": "static/wikipedia_styles_light.css",
    "chars": 303568,
    "preview": "/* START PREFERENCES CSS */\n#preferences {\n  text-align: center;\n  max-width: 600px;\n  min-width: 400px;\n  margin: 0 aut"
  },
  {
    "path": "static/wikipedia_styles_light_de.css",
    "chars": 39,
    "preview": "@import \"wikipedia_styles_light.css\";\n\n"
  },
  {
    "path": "static/wikipedia_styles_light_fr.css",
    "chars": 160982,
    "preview": ".mw-tag-markers {\n  font-style: italic;\n  font-size: 90%;\n}\n.allpagesredirect > a,\n.watchlistredir > a {\n  color: #0b0;\n"
  },
  {
    "path": "static/wikipedia_styles_light_ko.css",
    "chars": 143567,
    "preview": ".mw-tag-markers {\n  font-style: italic;\n  font-size: 90%;\n}\n.allpagesredirect > a,\n.watchlistredir > a {\n  color: #0b0;\n"
  },
  {
    "path": "static/wikipedia_styles_light_vi.css",
    "chars": 40,
    "preview": "@import \"wikipedia_styles_light_fr.css\";"
  },
  {
    "path": "wikiless.config",
    "chars": 2249,
    "preview": "const config = {\n  /**\n  * Set these configs below to suite your environment.\n  */\n  domain: process.env.DOMAIN || '', /"
  }
]

About this extraction

This page contains the full source code of the Metastem/wikiless GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 48 files (925.2 KB), approximately 302.3k tokens, and a symbol index with 3 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!