hellgate/readme.md

93 lines
3.7 KiB
Markdown
Raw Permalink Normal View History

2021-04-23 23:45:16 +00:00
![hellgate logo](mandatory-js-project-logo.png)
2021-04-25 04:51:02 +00:00
----
2021-04-27 04:58:28 +00:00
An extensible, general purpose http-\>gemini mirror with full
2021-04-25 05:23:12 +00:00
javascript support
2021-04-25 04:51:02 +00:00
2021-04-28 07:12:58 +00:00
## Requirements - If you are using Docker
- docker
## Requirements - If you are not using Docker
2021-04-23 23:43:02 +00:00
- nodejs
- npm
- electron
- openssh
- sh
- libgtk-2-0
- libgconf-2-4
2021-04-28 01:01:24 +00:00
- libxshmfence1
2021-04-28 01:14:05 +00:00
- libnss3
- libatk-bridge2.0-0
- libdrm2
- libgtk-3-0
- libgbm
- libasound2
2021-04-23 23:43:02 +00:00
- xvfb (if you're running it headless)
2021-04-28 07:12:58 +00:00
## Setup - If you are using Docker
- `docker pull sose/hellgate`
- `docker run -p 1965:1965 sose/hellgate`
- the server will listen on `localhost:1965`
- If you are using port 1965 on the host machine, you can bind a different port
by running `docker run -p {PORT}:1965 sose/hellgate` instead
## Setup - If you are not using Docker
- `sudo apt install npm nodejs libgtk2.0-0 libgconf-2-4 libxshmfence1 libnss3
libatk-bridge2.0-0 libdrm2 libgtk-3-0 libgbm1 libasound2` (if you're on
debian, other
2021-04-23 23:43:02 +00:00
distros idk)
- `sudo apt install xvfb` (again, on debian)
- `git clone https://tildegit.org/sose/hellgate`
- `cd hellgate`
- `sudo npm install -g electron --unsafe-perm=true`
- `npm install`
- `./gen_cert`
- `npm start` or `xvfb-run npm start`
2021-04-27 04:58:07 +00:00
- The server will listen on `[::1]:1965` by default
2021-04-23 23:43:02 +00:00
2021-04-28 07:44:40 +00:00
## Using
2021-04-28 07:45:13 +00:00
- Supply a full url in the query string in a request to the server and it will be rendered in Gemtext
2021-04-28 07:44:40 +00:00
- ex. `gemini://localhost?https://tilde.town`
- You have to include the scheme or Hellgate will not recognize it
2021-04-25 05:23:12 +00:00
## Sigils
2021-04-25 05:45:36 +00:00
- By default, more complex sites that are rendered by hellgate are not very
2021-04-25 05:23:12 +00:00
pretty, and sometimes downright unreadable
- For this, users can create website specific 'sigils' to display content in a
2021-04-25 05:26:29 +00:00
certain way, or to automate certain actions on a website
2021-04-25 05:23:12 +00:00
- Sigils are located in the `sigils` dir and are titled with the domain name of
2021-04-23 23:43:02 +00:00
their corresponding website
2021-04-25 05:23:12 +00:00
- See [writing sigils](writing_sigils.md) for more info on how to write sigils
and how they work
- If you write a new sigil for a specific website, don't hesitate to send it as
2021-04-23 23:43:02 +00:00
a pull request to this repo
2021-04-24 04:46:36 +00:00
2021-04-28 07:12:58 +00:00
## Security
2021-04-28 07:14:14 +00:00
- Obviously, executing arbitrary Javascript from around the web is never going
2021-04-28 07:12:58 +00:00
to be completely safe, however the following steps have been taken to ensure
the saftey of the host machine:
2021-04-28 07:37:22 +00:00
- All websites have a maximum time in which they have to load their
2021-04-28 07:12:58 +00:00
content (default 2s) and execute any scripts (default 2s)
2021-04-28 07:37:22 +00:00
- When running outside of a Docker container, all renderer processes
2021-04-28 07:12:58 +00:00
will be run inside the Chromium sandbox
(https://github.com/chromium/chromium/blob/master/docs/linux/sandboxing.md)
2021-04-28 07:37:22 +00:00
- When running inside of a Docker container, the entire program is
2021-04-28 07:12:58 +00:00
running inside a Docker container (as an unprivileged user).
2021-04-28 07:37:22 +00:00
- Nodejs integration is disabled in all renderer processes
- Context isolation is enabled in all reneder processes
- Any request for browser permissions is automatically denied
- Any request to create a new window is automatically denied
2021-04-28 07:12:58 +00:00
- Essentially, in theory, the machine hosting hellgate should not be at any
more risk than a regular web broser. However, security vulnerabilities
exists, and no software is perfect, not Docker, not Chromium, not Linux not
Electron and *certainly* not Hellgate. If you have valuable things on your
server I would suggest running all of this in a VM, just in case.
## Other Notes
2021-04-28 19:35:30 +00:00
- This isn't a proxy meant to be run on the user's machine, rather many users
are meant to connect to a single hosted version, such as
2021-04-28 19:36:02 +00:00
gemini://illegaldrugs.net/cgi-bin/hellgate. I would never want you to install
2021-04-28 19:35:30 +00:00
npm on your machine :)
2021-04-25 05:23:12 +00:00
- As of right now the npm version of gemini-server is broken, use the version
2021-04-28 07:12:58 +00:00
from github or this will not work.
- If you are using the docker container this is already done for you.