# ngemsite

Nostr site ([nsite](https://nsite.info/learn)) publisher and Gemini gateway server.

This is a Gemini gateway server that serves [nsites](https://nsite.info/learn) (static
[nostr](https://nostr.how) websites hosted on Blossom servers) made of
[gemtext](https://gemini.flounder.online/docs/gemtext.gmi) documents, which
can be browsed with a Gemini browser. The gateway is also able to render HTML
documents.

A ngemsite is simply a nsite that contains gemtext (or Markdown) documents, and it
can be browsed with a Gemini browser.

```sh
cargo install ngemsite
```

ngem is a browser based on Lagrange that can load nsites over Gemini ([AppImage Download](https://gitlab.com/api/v4/projects/81102427/packages/generic/ngem/0.1.4/ngem-0.1.4-x86_64.AppImage)).

## Publish a site

First initialize your site with the create command.

```sh
ngemsite create mysite
```

- Edit the mysite/.ngemsite.toml file to change the configuration.
- Add your files in the mysite/public directory

Publish your site with the deploy command.

```sh
ngemsite deploy mysite
```

Use the --sec argument to pass your private key, otherwise it will be prompted
on the terminal.

## Run a gateway

Initialize configuration and certificates for gateway with id "local" and hostname
"localhost" (the hostname is used to create the TLS certificate). The config file path
will be printed on the console.

```sh
ngemsite gw-init local localhost
```

After editing the config file, run the gateway with the "gw-run" command and pass
the gateway id.

```sh
ngemsite gw-run local
```
