Anon-Planet / thgtoa

The comprehensive guide for online anonymity and OpSec.
https://anonymousplanet.org/
Other
384 stars 41 forks source link

Proposal: add a folder/repo to upload a copy of the Jekyll the built site (server-side if possible) that can then be cloned and mirrored easily #87

Closed ghost closed 2 years ago

ghost commented 2 years ago

First wait for this request I made: https://github.community/t/is-there-a-way-to-make-youtube-also-publish-the-jekyll-build-in-a-repo-folder-when-pushing-commits/259902

We should add a command using Bundler for this

This requires the installation of Bundler and Jekyll.

Detailed Instructions are here: https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/testing-your-github-pages-site-locally-with-jekyll

bundle exec jekyll build

This will create a _site or docs folder with the static html files exactly like online.

The folder should be in .gitignore but another "mirror" repository should be created. The files built in the bundler built site should be copied to the other repository root.

I can then set up gitlab for example to auto-fetch / mirror that "mirror repository" and have a mirror auto-updated without human intervention.

Most of those tasks have to be done by the person able to execute the makefile of course. We can't do much with our permissions.

nopeitsnothing commented 2 years ago

https://github.com/punkave/mirror-website

wget -mkxKE -e robots=off https://anonymousplanet-ng.org/

I don't understand exactly what you're asking here. Assuming you want readers to be able to clone the website?

ghost commented 2 years ago

I want an automatic "fire and forget" mirroring of the Jekyll built website server-side from GitHub to GitLab.

So I need another repo here in anon-planet, and I need an action or something to automatically not only generate the site here but generate a second, clone, in that other repo's root. Let's say naming the repo "thgtota-gitlab-mirror" repo. And another one called "thgtota-tor-mirror".

An action has to be set there to change all the https://anonymousplanet-ng.org/... into https://mirror.anonymousplanet-ng.org/ (and likewise for the Tor one)... at each update of an HTML file ending on a mirror repo. (if any URL is hard-coded in the generated website, which is the case all over).

Then GitLab will then use it's automatic mirroring feature to auto update a copy of the hgtota-gitlab-mirror repo over there. Which will have a GitLab pages setup ending in having a working https://mirror.anonymousplanet-ng.org/

As for Tor, Tor VPS will automatically clone the thgtota-tor-mirror and serve it as a hidden service after replacing the hard-coded versions.

nopeitsnothing commented 2 years ago

Maybe we should build a repository with the web contents so people can mirror the site themselves? I currently use this setup:

_config.yml:

markdown: kramdown
kramdown:
  hard_wrap: false
plugins:
  - jekyll-relative-links
  - jekyll-sitemap
  - jekyll-seo-tag
relative_links:
  enabled: true
  collections: true
title: The Hitchhiker's Guide to Online Anonymity
description: The Hitchhiker's Guide to Online Anonymity
tagline: The Hitchhiker's Guide to Online Anonymity
author: AnonymousPlanet
theme: jekyll-theme-hacker
github:
  home_url: index.html
  pdf_url: export/guide.pdf
  odt_url: export/guide.odt
  guide_url: guide.html
  donations_url: donations.html
  changelog_url: CHANGELOG.html
  license_url: LICENSE.html
  about_url: about.html
  minisign_url: minisign.pub
  links_url: links.html
defaults:
  -
    scope:
      path: ""
    values:
      layout: default
      sitemap: true
locale: "en-US"
author:
  name: AnonymousPlanet
  twitter: AnonyPla
social:
  name: AnonymousPlanet
  links:
    - https://github.com/NobodySpecial256/thgtoa
exclude:
    - Gemfile
    - Gemfile.lock
    - .github
    - .gitignore
include:
    - LICENSE.md
    - about.md
    - legacy.md
    - briar.md
    - .well-known

Gemfile:

source "https://rubygems.org"

gem "jekyll", "~> 4.2.2"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.5"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
  gem "jekyll-feed", "~> 0.12"
end

# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
  gem "tzinfo", "~> 1.2"
  gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]

# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]

gem "jekyll-theme-hacker", "~> 0.2.0"

gem "jekyll-relative-links", "~> 0.6.1"

gem "jekyll-sitemap", "~> 1.4"

gem "webrick", "~> 1.7"

Serve the website locally:

bundle install # install bundled gems using bundler
bundle exec jekyll serve <args> # run the jekyll serve command

But this is ugly and doesn't work well because the CSS is broken.

ghost commented 2 years ago

Edited title

ghost commented 2 years ago

Stale, Unnecessary