summaryrefslogtreecommitdiffstats
path: root/rust/wolfree_patch_libredirect
diff options
context:
space:
mode:
authorname <email@example.com>2023-09-27 13:34:23 +0200
committername <email@example.com>2023-09-27 13:34:23 +0200
commit72d8b4e6bee0ffac79e96dd649a9da2adb86b507 (patch)
tree8d1f37e5d88a598675b1a65128c35323c99825f5 /rust/wolfree_patch_libredirect
parentMerge pull request 'Please consider adding my instance' (#2) from superprivacy/wolfree-dockerfile:main into main (diff)
downloadwolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.tar
wolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.tar.gz
wolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.tar.bz2
wolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.tar.lz
wolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.tar.xz
wolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.tar.zst
wolfree-dockerfile-72d8b4e6bee0ffac79e96dd649a9da2adb86b507.zip
Diffstat (limited to 'rust/wolfree_patch_libredirect')
-rw-r--r--rust/wolfree_patch_libredirect/Cargo.toml28
-rw-r--r--rust/wolfree_patch_libredirect/src/docusaurus/docs/index.mdx81
-rw-r--r--rust/wolfree_patch_libredirect/src/docusaurus/docs/mirror.mdx24
-rw-r--r--rust/wolfree_patch_libredirect/src/docusaurus/docs/source.mdx22
-rw-r--r--rust/wolfree_patch_libredirect/src/docusaurus/static/instances.json14
-rw-r--r--rust/wolfree_patch_libredirect/src/main.rs40
6 files changed, 209 insertions, 0 deletions
diff --git a/rust/wolfree_patch_libredirect/Cargo.toml b/rust/wolfree_patch_libredirect/Cargo.toml
new file mode 100644
index 0000000..cf55e4d
--- /dev/null
+++ b/rust/wolfree_patch_libredirect/Cargo.toml
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: AGPL-3.0-or-later
+
+[package]
+name = "wolfree_patch_libredirect"
+version = "2023.8.31"
+authors = [
+ "See the commit history of the Git repositories.",
+ "https://git.kiwifarms.net/wolfree",
+]
+categories = [
+ "command-line-utilities",
+ "development-tools::build-utils",
+ "web-programming",
+]
+edition = "2021"
+keywords = [
+ "rust",
+ "customize",
+ "Wolfree",
+ "LibRedirect",
+ "write",
+ "remove",
+ "file",
+]
+license = "AGPL-3.0-or-later"
+readme = "README.md"
+repository = "https://git.kiwifarms.net/wolfree"
+description = "Customize Wolfree instances to suit Libredirect."
diff --git a/rust/wolfree_patch_libredirect/src/docusaurus/docs/index.mdx b/rust/wolfree_patch_libredirect/src/docusaurus/docs/index.mdx
new file mode 100644
index 0000000..3cefc82
--- /dev/null
+++ b/rust/wolfree_patch_libredirect/src/docusaurus/docs/index.mdx
@@ -0,0 +1,81 @@
+---
+title: Home page
+hide_title: true
+slug: /
+---
+
+<!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
+
+import FormCTA from "../src/components/FormCTA.tsx";
+import submitMathInputForm from "../src/functions/submitMathInputForm.ts";
+import InputMathProblems from "../src/components/InputMathProblems.tsx";
+import SubmitButton from "../src/components/SubmitButton.tsx";
+import ButtonLink from "../src/components/ButtonLink.tsx";
+
+# Wolfree instances that do not bypass paywalls
+
+Wolfree is a free and open-source software for accessing the calculation results computed by Wolfram Alpha. Wolfree operates through a network of websites known as "instances." Unlike most instances, this instance **does not bypass paywalls**.
+
+<FormCTA autoFocus={true} submitText="Compute Input" />
+
+## How to access the calculation results generated by Wolfram Alpha
+
+<form onSubmit={submitMathInputForm}>
+
+1. Type your math problem in the text box.
+
+ <InputMathProblems autoFocus={false} defaultValue="y'=y" />
+
+2. Click the "Compute Input" button.
+
+ <SubmitButton text="Compute Input" />
+
+3. Explore the calculation result provided. 🎉
+
+</form>
+
+## The problem with other Wolfree instances
+
+Most other Wolfree instances can bypass paywalls, which raises concerns about Microsoft GitHub's [DMCA Takedown Policy](https://docs.github.com/en/site-policy/content-removal-policies/dmca-takedown-policy). Unfortunately, this means that developers of [LibRedirect](https://libredirect.github.io/) cannot redirect users to such instances. For details about this issue, refer to [issue #425](https://github.com/libredirect/browser_extension/issues/425) on Microsoft GitHub.
+
+## How this instance resolves the problem
+
+Unlike most Wolfree instances, this instance prioritizes ethical values and **does not bypass paywalls**.
+
+## Mirror sites
+
+Wolfree operates through a network of mirror sites. If you can't access this web page, visit the [mirror sites](/mirror).
+
+<ButtonLink to="./mirror" text="Access mirror sites" />
+
+## Source code
+
+Wolfree is **free** and **open-source** software built on transparency and openness, welcoming individuals from diverse backgrounds to collaborate on [source code](/source). ❤️
+
+<ButtonLink to="./source" text="Explore source code" />
+
+## How it works
+
+1. Install [LibRedirect](https://libredirect.github.io/) on your web browser.
+2. Enable auto-redirection from Wolfram to this instance.
+3. Enjoy accessing Wolfree instances that **do not bypass paywalls**.
+
+## Key benefits
+
+### Compliance with Microsoft GitHub
+
+This instance **does not bypass paywalls**, resolving [the GitHub issues](https://github.com/libredirect/browser_extension/issues/425) LibRedirect developers encounter.
+
+### Auto-redirection
+
+Once you install LibRedirect on your web browser, you can enable auto-redirection from Wolfram to this instance.
+
+### Cyber Ethics
+
+By accessing this instance, you actively promote ethical practices and support the work of content creators.
+
+## Get started now
+
+Install LibRedirect and enable auto-redirection. Enjoy Wolfree instances that **do not bypass paywalls**.
+
+<ButtonLink to="https://libredirect.github.io/" text="Install LibRedirect" />
diff --git a/rust/wolfree_patch_libredirect/src/docusaurus/docs/mirror.mdx b/rust/wolfree_patch_libredirect/src/docusaurus/docs/mirror.mdx
new file mode 100644
index 0000000..a55cd77
--- /dev/null
+++ b/rust/wolfree_patch_libredirect/src/docusaurus/docs/mirror.mdx
@@ -0,0 +1,24 @@
+---
+title: Mirror site
+hide_title: true
+---
+
+<!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
+
+# Mirror sites: alternative instances
+
+Wolfree operates through a network of mirror sites. If you can't access this web page, visit the mirror sites.
+
+1. https://gqq.gitlab.io/
+2. https://jqq.gitlab.io/
+3. https://rqq.gitlab.io/
+4. https://sqq.gitlab.io/
+5. https://uqq.gitlab.io/
+
+## Fetching JSON list of instances
+
+If you have programming knowledge, you can deserialize the [instances.json](pathname://../instances.json) file.
+
+## Accessing Wolfree in censored countries
+
+If you cannot access any of the mirror sites, we recommend installing the [Tor Browser](https://www.torproject.org/) to bypass censorship.
diff --git a/rust/wolfree_patch_libredirect/src/docusaurus/docs/source.mdx b/rust/wolfree_patch_libredirect/src/docusaurus/docs/source.mdx
new file mode 100644
index 0000000..66e222a
--- /dev/null
+++ b/rust/wolfree_patch_libredirect/src/docusaurus/docs/source.mdx
@@ -0,0 +1,22 @@
+---
+title: Source code
+hide_title: true
+---
+
+<!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
+
+# Accessing the source code of Wolfree
+
+Wolfree is **free** and **open-source** software. You can access and download the source code from the following websites:
+
+1. https://gitea.com/wolfree
+2. https://try.gitea.io/wolfree
+3. https://codeberg.org/wolfree
+4. https://git.disroot.org/wolfree
+5. https://next.forgejo.org/wolfree
+6. https://git.kiwifarms.net/wolfree
+7. http://it7otdanqu7ktntxzm427cba6i53w6wlanlh23v5i3siqmos47pzhvyd.onion/wolfree
+
+## Accessing the source code in censored countries
+
+If you cannot access Gitea or Forgejo, we recommend installing the [Tor Browser](https://www.torproject.org/) to bypass censorship.
diff --git a/rust/wolfree_patch_libredirect/src/docusaurus/static/instances.json b/rust/wolfree_patch_libredirect/src/docusaurus/static/instances.json
new file mode 100644
index 0000000..8cdd008
--- /dev/null
+++ b/rust/wolfree_patch_libredirect/src/docusaurus/static/instances.json
@@ -0,0 +1,14 @@
+{
+ "wolfree": {
+ "clearnet": [
+ "https://gqq.gitlab.io/",
+ "https://jqq.gitlab.io/",
+ "https://rqq.gitlab.io/",
+ "https://sqq.gitlab.io/",
+ "https://uqq.gitlab.io/"
+ ],
+ "tor": [],
+ "i2p": [],
+ "loki": []
+ }
+}
diff --git a/rust/wolfree_patch_libredirect/src/main.rs b/rust/wolfree_patch_libredirect/src/main.rs
new file mode 100644
index 0000000..907dc36
--- /dev/null
+++ b/rust/wolfree_patch_libredirect/src/main.rs
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: AGPL-3.0-or-later */
+
+//! Customize Wolfree instances to suit Libredirect.
+
+#![allow(clippy::blanket_clippy_restriction_lints)]
+#![allow(clippy::implicit_return)]
+#![allow(clippy::question_mark_used)]
+
+use std::error;
+use std::fs;
+
+/// By default, the main function do nothing as most Wolfree users do not use Libredirect.
+#[allow(unreachable_code)]
+fn main() -> Result<(), Box<dyn error::Error>> {
+ // Remove the following line to make the instances Libredirect-compatible.
+ return Ok(());
+ // Remove the previous line to make the instances Libredirect-compatible.
+
+ // Disable the entrypoint of the JavaScript modules.
+ fs::write(
+ "./docusaurus/static/ajax/libs/wolfree/2023.8.31/js/entrypoint.js",
+ "export default () => {};"
+ )?;
+
+ fs::write(
+ "./docusaurus/wolfree.config.js",
+ "module.exports = { config: { libredirect: true } };"
+ )?;
+
+ fs::write(
+ "./docusaurus/static/instances.json",
+ include_str!("./docusaurus/static/instances.json")
+ )?;
+
+ fs::write("./docusaurus/docs/index.mdx", include_str!("./docusaurus/docs/index.mdx"))?;
+ fs::write("./docusaurus/docs/mirror.mdx", include_str!("./docusaurus/docs/mirror.mdx"))?;
+ fs::write("./docusaurus/docs/source.mdx", include_str!("./docusaurus/docs/source.mdx"))?;
+
+ Ok(())
+}