aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-07-27 15:56:24 +0200
committerWojtek Kosior <koszko@koszko.org>2022-08-10 17:25:05 +0200
commit879c41927171efc8d77d1de2739b18e2eb57580f (patch)
treede0e78afe2ea49e58c9bf2c662657392a00139ee /README.md
parent52d12a4fa124daa1595529e3e7008276a7986d95 (diff)
downloadhaketilo-hydrilla-879c41927171efc8d77d1de2739b18e2eb57580f.tar.gz
haketilo-hydrilla-879c41927171efc8d77d1de2739b18e2eb57580f.zip
unfinished partial work
Diffstat (limited to 'README.md')
-rw-r--r--README.md125
1 files changed, 36 insertions, 89 deletions
diff --git a/README.md b/README.md
index c77431b..a3ee090 100644
--- a/README.md
+++ b/README.md
@@ -1,109 +1,56 @@
-# Hydrilla (Python implementation)
+# Hydrilla&Haketilo
-This is the repository of Python incarnation of [Hydrilla](https://hydrillabugs.koszko.org/projects/hydrilla/wiki), a repository software to serve [Haketilo](https://hydrillabugs.koszko.org/projects/haketilo/wiki) packages.
+Haketilo is a tool to modify pages being opened in a web browser. It can block
+pages' scripts and optionally inject user-specified ones.
-The information below is meant to help hack on the codebase. If you're instead looking for some noob-friendly documentation, see the [user manual](https://hydrillabugs.koszko.org/projects/hydrilla/wiki/User_manual).
+Haketilo started as a browser extension (a WebExtension) with a dedicated
+user scripts repository server, Hydrilla. Haketilo is now being rewritten as an
+HTTP proxy. This repository contains combined sources of Hydrilla and Haketilo
+which are going to be distributed together.
-## Dependencies
+This source tree is a work in progress and is thus a complete mess. You can see
+some unused or inadequate source files (and even UML diagrams) flying around.
+The Hydrilla part is currently not functional. You can play with the proxy part
+if you really want (for brave people only 😉).
-### Runtime
-
-* Python3 (>= 3.7)
-* [hydrilla.builder](https://git.koszko.org/hydrilla-builder/)
-* flask
+You're going to need at least Python 3.7 plus the following Python libraries
+* mitmproxy 8 (sadly, not in Debian yet)
+* immutables (also not in Debian but if you are familiar with git-buildpackage,
+ you can utilize [my own packaging of it](https://git.koszko.org/immutables/))
* click
* jsonschema (>= 3.0)
-
-### Build
-
-* setuptools
-* wheel
-* setuptools_scm
+* beautifulsoup4
+* html5lib
* babel
-### Test
-
-* pytest
-* reuse
-
-## Building
-
-We're using setuptools. You can build a wheel under `dist/` with
-``` shell
-python3 -m build
-```
-Optionally, add a `--no-isolation` option to the second command to have it use system packages where possible instead of downloading all dependencies from PyPI.
-
-The generated .whl file can then be used to install Hydrilla either globally or in the current Python virtualenv:
-```shell
-python3 -m pip install dist/put_the_name_of_generated_file_here.whl
-```
-
-### PyPI considerations
-
-Commands like `python3 -m build` and `python3 -m pip` but also `virtualenv` will by default download the dependencies from PyPI repository[^pypi]. Although this is what many people want, it carries along a freedom issue. PyPI is not committed to only hosting libre software packages[^pypi_freeware] and, like any platform allowing upload of code by the public, has lower package standards than repositories of many operating system distributions. For this reason you are encouraged to use the dependencies as provided by your distribution.
-
-To perform the build and installation without PyPI, first install all dependencies system-wide. For example, in Debian-based distributions (including Trisquel):
-``` shell
-sudo apt install python3-flask python3-flask python3-jsonschema \
- python3-setuptools python3-setuptools-scm python3-babel python3-wheel
-```
-
-If you're using `virtualenv` command to create a virtual environment, make sure you invoke it with `--system-site-packages`. This is necessary for packages installed inside the virtualenv to be able to use globally-installed dependencies.
+This project also utilizes flask, reuse, setuptools, setuptools_scm, wheel,
+pytest and mypy but those are either development-only dependencies or just not
+required for the actual Haketilo proxy.
-Now, in unpacked source directories of **both** `hydrilla-builder` and `hydrilla`, run the build and installation commands:
-``` shell
-python3 -m build --no-isolation
-python3 -m pip install dist/hydrilla*.whl # or use the full file name
+Make sure to run
```
-
-[^pypi]: [https://pypi.org/](https://pypi.org/)
-[^pypi_freeware]: [https://pypi.org/search/?c=License+%3A%3A+Freeware](https://pypi.org/search/?c=License+%3A%3A+Freeware)
-
-## Testing
-
-For tests to pass you need compiled message catalogs to be present. If you've performed the build at least once, they're already there. Otherwise, you need to run `./setup.py compile_catalog`. Then you can run the actual tests:
-``` shell
-python3 -m pytest
-```
-
-## Installation from wheels
-
-Instead of building yourself you can use Python wheels provided on [Hydrilla downloads page](https://hydrillabugs.koszko.org/projects/hydrilla/wiki/Releases).
-
-``` shell
-python3 -m pip install \
- path/to/downloaded/hydrilla.builder-1.0-py3-none-any.whl \
- path/to/downloaded/hydrilla-1.0-py3-none-any.whl
+./setup.py compile_catalog
```
+before running anything. A missing message catalog can make things break.
-## Running
+Create directory ~/.haketilo/store/temporary_malcontent/ and put there all the
+[built Haketilo packages](https://hydrillabugs.koszko.org/projects/hydrilla/wiki/Hydrilla_on-disk_data_format) that you'd like to use. You can use
+[hydrilla builder](https://hydrillabugs.koszko.org/projects/hydrilla/wiki/Releases)
+and the [repository of fixes for JS-encumbered websites](https://git.koszko.org/hydrilla-fixes-bundle/).
-### Hydrilla command
-
-Hydrilla includes a `hydrilla` shell command that can be used to quickly and easily spawn a local instance, e.g.:
-```
-hydrilla -m /path/to/where/package/files/to/serve/are/stored -p 10112
+Now, run
```
-This will cause the resources from provided path to be served at [http://127.0.0.1:10112/](http://127.0.0.1:10112/).
-
-The actual packages to serve are made using [Hydrilla builder](https://git.koszko.org/hydrilla-builder/).
-
-For more information about available options, pass the `--help` flag to `hydrilla` command:
-``` shell
-hydrilla --help
+PYTHONPATH=./src/ python3 -m mitmproxy_launcher
```
-If you navigate your POSIX shell to Hydrilla sources directory, you can also consult the included manpage (`man` tool required):
-``` shell
-man ./doc/man/man1/hydrilla.1
-```
-
-Last but not least, you might find it useful to consult the default, internal configuration file of Hydrilla that resides under `src/hydrilla/server/config.json` in the sources repository.
-
-### WSGI
+Next, open your browser, go to settings and import the certificate that got
+generated under ~/.haketilo/mitmproxy/mitmproxy-ca-cert.pem. You can now browse
+to some site for which you configured a Haketilo user script to run. I usually
+visit https://opencores.org/projects for which was the first Haketilo script was
+written...
-If you want to test a more production-suitable deployment option, consult sample Apache2 config files and a WSGI script supplied in `doc/examples` directory.
+There's some work to do before any of this will be usable to normal human
+beings. Help appreciated.
## Copying