mirror of
https://git.disroot.org/wolfree/wolfree-dockerfile
synced 2025-06-06 00:49:20 +02:00
2023-08-10
This commit is contained in:
21
rust/wolfree_libredirect_patch/Cargo.toml
Normal file
21
rust/wolfree_libredirect_patch/Cargo.toml
Normal file
@ -0,0 +1,21 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# This file is part of Wolfree.
|
||||
# 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.
|
||||
|
||||
[package]
|
||||
name = "wolfree_libredirect_patch"
|
||||
version = "23.7.31"
|
||||
edition = "2021"
|
||||
|
||||
authors = ["See the commit history of the Git repositories: <https://try.gitea.io/wolfree>"]
|
||||
description = "The Rust crate provides lightweight wrappers around the `fs::write` and `fs::remove_dir_all` functions from the standard library's `fs` module."
|
||||
license = "AGPL-3.0-or-later"
|
||||
repository = "https://try.gitea.io/wolfree"
|
||||
readme = "README.md"
|
||||
keywords = ["rust", "wrapper", "write", "remove", "file"]
|
||||
categories = ["command-line-utilities", "development-tools::build-utils", "web-programming"]
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
markdown = "1.0.0-alpha"
|
68
rust/wolfree_libredirect_patch/src/body.md
Normal file
68
rust/wolfree_libredirect_patch/src/body.md
Normal file
@ -0,0 +1,68 @@
|
||||
# Paywall-Respecting Instances: Wolfree instances that do not bypass any paywall
|
||||
|
||||
Welcome to Paywall-Respecting Instances, where we provide Wolfree instances that **do not bypass any paywall**.
|
||||
|
||||
## 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.
|
||||
|
||||
To learn more about this issue, please refer to [issue #425](https://github.com/libredirect/browser_extension/issues/425) on Microsoft GitHub.
|
||||
|
||||
## The Solution: Paywall-Respecting Instances
|
||||
|
||||
Unlike other Wolfree instances, Paywall-Respecting Instances prioritize ethical practices and **do not bypass any paywall**. So developers of LibRedirect can confidently redirect their users to Paywall-Respecting Instances.
|
||||
|
||||
## Instance List
|
||||
|
||||
Here are some Paywall-Respecting Instances you can access:
|
||||
|
||||
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/
|
||||
|
||||
JSON: [instances.json](/instances.json)
|
||||
|
||||
## Source Code
|
||||
|
||||
Paywall-Respecting Instances is free and open-source software. You can access and download its source code from the following websites:
|
||||
|
||||
1. https://try.gitea.io/wolfree
|
||||
2. https://codeberg.org/wolfree
|
||||
3. https://git.disroot.org/wolfree
|
||||
4. https://next.forgejo.org/wolfree
|
||||
5. https://git.kiwifarms.net/wolfree
|
||||
6. http://it7otdanqu7ktntxzm427cba6i53w6wlanlh23v5i3siqmos47pzhvyd.onion/wolfree
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
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.
|
||||
|
||||
## How it Works
|
||||
|
||||
1. Install [LibRedirect](https://libredirect.github.io/) on your web browser.
|
||||
2. LibRedirect automatically redirects you from Wolfram to our instances, safeguarding your privacy.
|
||||
3. Enjoy accessing Wolfree instances that uphold ethical practices and **do not bypass any paywall**.
|
||||
|
||||
## Key Features
|
||||
|
||||
### Compliance with Microsoft GitHub
|
||||
|
||||
Paywall-Respecting Instances **do not bypass any paywall**, empowering LibRedirect developers with the confidence to redirect users to our instances.
|
||||
|
||||
### Protect Your Privacy
|
||||
|
||||
Once you install LibRedirect on your web browser, LibRedirect automatically redirects you from Wolfram to our instances, securing your digital privacy.
|
||||
|
||||
### Ethical Practices
|
||||
|
||||
By accessing our instances, you actively promote ethical practices and support the work of content creators.
|
||||
|
||||
## Get Started Now!
|
||||
|
||||
Install LibRedirect to access Paywall-Respecting Instances. Enjoy Wolfree instances that **do not bypass any paywall**.
|
||||
|
||||
- [Install LibRedirect](https://libredirect.github.io/)
|
43
rust/wolfree_libredirect_patch/src/head.html
Normal file
43
rust/wolfree_libredirect_patch/src/head.html
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description"
|
||||
content="With our seamless integration with LibRedirect, a web browser extension that protects your digital privacy, you can ensure that your access to Wolfree instances preserves your privacy and complies with Microsoft GitHub's DMCA Takedown Policy." />
|
||||
<title>
|
||||
Wolfree instances that do not bypass any paywall | Paywall-Respecting Instances
|
||||
</title>
|
||||
<style>
|
||||
html {
|
||||
margin: 1rem;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
body {
|
||||
max-width: 30rem;
|
||||
margin: 5rem auto;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2 {
|
||||
margin-top: 5rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
p,
|
||||
li {
|
||||
line-height: 2;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
</style>
|
||||
<link rel="icon" href="data:," />
|
||||
</head>
|
||||
|
||||
</html>
|
||||
<!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
|
14
rust/wolfree_libredirect_patch/src/instances.json
Normal file
14
rust/wolfree_libredirect_patch/src/instances.json
Normal file
@ -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": []
|
||||
}
|
||||
}
|
95
rust/wolfree_libredirect_patch/src/main.rs
Normal file
95
rust/wolfree_libredirect_patch/src/main.rs
Normal file
@ -0,0 +1,95 @@
|
||||
//! The Rust crate provides lightweight wrappers around the `fs::write` and `fs::remove_dir_all` functions from the standard library's `fs` module.
|
||||
//! The crate is designed to simplify file writing and directory removal operations by encapsulating the error handling logic and providing a more convenient interface.
|
||||
//! It is particularly useful for tasks that involve writing multiple files or removing directories with their contents.
|
||||
|
||||
#![allow(clippy::blanket_clippy_restriction_lints)]
|
||||
#![allow(clippy::exit)]
|
||||
#![allow(clippy::print_stderr)]
|
||||
#![allow(clippy::implicit_return)]
|
||||
|
||||
/* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
* This file is part of Wolfree.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
use markdown::to_html_with_options;
|
||||
use markdown::Options;
|
||||
use std::fs;
|
||||
|
||||
/// A lightweight wrapper around `fs::write`.
|
||||
fn wolfree_write(file_path: &str, contents: &str) {
|
||||
match fs::write(file_path, contents) {
|
||||
Ok(_) => (),
|
||||
Err(err) => {
|
||||
eprintln!("Error: {err}",);
|
||||
std::process::exit(1);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// A lightweight wrapper around `fs::remove_dir_all`.
|
||||
fn wolfree_remove_dir_all(dir_path: &str) {
|
||||
match fs::remove_dir_all(dir_path) {
|
||||
Ok(_) => (),
|
||||
Err(err) => {
|
||||
eprintln!("Error: {err}",);
|
||||
std::process::exit(1);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// A lightweight wrapper around `markdown::to_html_with_options`.
|
||||
fn wolfree_to_html_with_options(value: &str) -> String {
|
||||
match to_html_with_options(value, &Options::gfm()) {
|
||||
Ok(result) => result,
|
||||
Err(err) => {
|
||||
eprintln!("Error: {err}",);
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Entry point of the program.
|
||||
fn main() {
|
||||
wolfree_write(
|
||||
"./docusaurus/build/ajax/libs/wolfree/23.7.8/js/Entrypoint.js",
|
||||
"export default () => {}",
|
||||
);
|
||||
wolfree_write(
|
||||
"./docusaurus/build/index.html",
|
||||
&format!(
|
||||
"{}{}",
|
||||
include_str!("head.html"),
|
||||
wolfree_to_html_with_options(include_str!("body.md")),
|
||||
),
|
||||
);
|
||||
wolfree_write(
|
||||
"./docusaurus/build/instances.json",
|
||||
include_str!("instances.json"),
|
||||
);
|
||||
wolfree_write(
|
||||
"./docusaurus/build/404.html",
|
||||
"<script>location='/'</script>",
|
||||
);
|
||||
wolfree_write(
|
||||
"./docusaurus/build/acknowledgment/index.html",
|
||||
"<script>location='/'</script>",
|
||||
);
|
||||
wolfree_write(
|
||||
"./docusaurus/build/community/index.html",
|
||||
"<script>location='/'</script>",
|
||||
);
|
||||
wolfree_write(
|
||||
"./docusaurus/build/dmca/index.html",
|
||||
"<script>location='/'</script>",
|
||||
);
|
||||
wolfree_write(
|
||||
"./docusaurus/build/mirror/index.html",
|
||||
"<script>location='/'</script>",
|
||||
);
|
||||
wolfree_write(
|
||||
"./docusaurus/build/source/index.html",
|
||||
"<script>location='/'</script>",
|
||||
);
|
||||
wolfree_remove_dir_all("./docusaurus/build/assets/");
|
||||
}
|
Reference in New Issue
Block a user