Indie Web Server issueshttps://source.small-tech.org/hypha/tools/web-server/-/issues2019-06-08T14:52:47Zhttps://source.small-tech.org/hypha/tools/web-server/-/issues/23Enhancement: watch dynamic routes for changes and reload them2019-06-08T14:52:47ZAral BalkanEnhancement: watch dynamic routes for changes and reload them## Use case
While developing, changes to dynamic routes are not reflected as the routes are currently only loaded in at launch.
## Suggested implementation
- [ ] Add a file watcher for the dynamic routes folder that reloads the rout...## Use case
While developing, changes to dynamic routes are not reflected as the routes are currently only loaded in at launch.
## Suggested implementation
- [ ] Add a file watcher for the dynamic routes folder that reloads the routes on changes.Aral BalkanAral Balkanhttps://source.small-tech.org/hypha/tools/web-server/-/issues/22Add an --original option to the proxy command2019-06-08T14:52:47ZAral BalkanAdd an --original option to the proxy command## Use case
e.g., You are proxying the output of a Hugo development server. In your site source, you have dynamic routes (which, in the case of Hugo, you’ve placed in your `.dynamic` folder in your static assets folder, so that the fold...## Use case
e.g., You are proxying the output of a Hugo development server. In your site source, you have dynamic routes (which, in the case of Hugo, you’ve placed in your `.dynamic` folder in your static assets folder, so that the folder is copied to the root of your site on build) and you want them to be loaded and watched for changes. To do this, we need to know the original path of the files being served so we can load the dynamic paths and watch them for changes.
## Suggested implementation
- [ ] Add --original option to proxy command that expects the path to the original web content being served by the server being proxiedAral BalkanAral Balkanhttps://source.small-tech.org/hypha/tools/web-server/-/issues/21When running as a child process, do not display name/version again2019-06-08T14:52:47ZAral BalkanWhen running as a child process, do not display name/version again![Screenshot_from_2019-05-14_21-33-29](/uploads/769ba93b5be60dfd3df96b926d8eb2f0/Screenshot_from_2019-05-14_21-33-29.png)![Screenshot_from_2019-05-14_21-33-29](/uploads/769ba93b5be60dfd3df96b926d8eb2f0/Screenshot_from_2019-05-14_21-33-29.png)Aral BalkanAral Balkanhttps://source.small-tech.org/hypha/tools/web-server/-/issues/19Implement /web-server/version endpoint on Indie Web Site and update it on deploy2019-06-08T14:52:47ZAral BalkanImplement /web-server/version endpoint on Indie Web Site and update it on deploy## Use case
We need an endpoint we can query to find out the latest version of Indie Web Server that’s available for use in the auto-update script (see #15).
## Suggested implementation
* [x] Add _web-server/version_ endpoint to ht...## Use case
We need an endpoint we can query to find out the latest version of Indie Web Server that’s available for use in the auto-update script (see #15).
## Suggested implementation
* [x] Add _web-server/version_ endpoint to https://ind.ie
* [x] Update deployment script to update the endpoint (simple text file should do but check mime-type so it’s served properly) with the versionAral BalkanAral Balkanhttps://source.small-tech.org/hypha/tools/web-server/-/issues/18Feature: --version-number2019-06-08T14:52:47ZAral BalkanFeature: --version-number## Use case
A pure data version number output that can be used from shell scripts (e.g., #17), etc.
## Suggested implementation
Returns the version number and exits.## Use case
A pure data version number output that can be used from shell scripts (e.g., #17), etc.
## Suggested implementation
Returns the version number and exits.Aral BalkanAral Balkanhttps://source.small-tech.org/hypha/tools/web-server/-/issues/17Install script should check for existing installation and perform an update2019-06-08T14:52:48ZAral BalkanInstall script should check for existing installation and perform an update## Use case
Indie Web Server is already installed and the install script is run.
## Suggested implementation
The install script should check for an existing installation. If one exists, it should ask it for its version and compare tha...## Use case
Indie Web Server is already installed and the install script is run.
## Suggested implementation
The install script should check for an existing installation. If one exists, it should ask it for its version and compare that to its own version. If the latest version is already installed, the install script should let the person know that and exit. If it is not, it should continue with the installation, informing the person that they are upgrading from _older version_ to _latest version_.Aral BalkanAral Balkanhttps://source.small-tech.org/hypha/tools/web-server/-/issues/15Add auto update for production servers2019-06-08T14:52:48ZAral BalkanAdd auto update for production servers## Use case
You have a production server that’s set to run long term. You should always be running latest Indie Web Server.
## Suggested implementation
By default, the server should check everyday for updates and install the update if...## Use case
You have a production server that’s set to run long term. You should always be running latest Indie Web Server.
## Suggested implementation
By default, the server should check everyday for updates and install the update if there is one.
You should be able to turn this off using a flag. e.g.,
```shell
web-server enable --no-auto-update
```Aral BalkanAral Balkanhttps://source.small-tech.org/hypha/tools/web-server/-/issues/14Add update command2019-06-08T14:52:48ZAral BalkanAdd update command## Use case
You want to update the web server to the latest version manually.
## Suggested syntax
```shell
web-server update
```
## Suggested implementation
1. [ ] Checks https://ind.ie/web-server/version and compares it with curren...## Use case
You want to update the web server to the latest version manually.
## Suggested syntax
```shell
web-server update
```
## Suggested implementation
1. [ ] Checks https://ind.ie/web-server/version and compares it with currently-installed version
2. [ ] If there is a new version, downloads it and replaces the binary in _/usr/local/bin_.
3. [ ] If web server is enabled, disables the old version and enables the new version.Aral BalkanAral Balkanhttps://source.small-tech.org/hypha/tools/web-server/-/issues/12Status command should display the directory being served and any other releva...2019-06-08T14:52:48ZAral BalkanStatus command should display the directory being served and any other relevant optionsThe status command should show the directory being served.
## Implementation suggestion
Parse `/etc/systemd/system/web-server.service` for `ExecStart` line.
e.g.,
```
ExecStart=/usr/local/bin/web-server global /home/aral
```
And di...The status command should show the directory being served.
## Implementation suggestion
Parse `/etc/systemd/system/web-server.service` for `ExecStart` line.
e.g.,
```
ExecStart=/usr/local/bin/web-server global /home/aral
```
And display it:
```
✔ Indie Web Server is active and enabled. Serving /home/aral at https://<hostname>:[port]
```Aral BalkanAral Balkanhttps://source.small-tech.org/hypha/tools/web-server/-/issues/11Feature: Anonymous and ephemeral realtime statistics2019-06-08T14:52:48ZAral BalkanFeature: Anonymous and ephemeral realtime statistics## Use case
It would be good to have a means to see how your site is being accessed – which pages are most popular, etc.
## Suggested implementation
1. On server start, you get a cryptographically-secure URL for your statistics page
2...## Use case
It would be good to have a means to see how your site is being accessed – which pages are most popular, etc.
## Suggested implementation
1. On server start, you get a cryptographically-secure URL for your statistics page
2. When you visit that URL in the browser, you see a live view of the following statistics since you last started the server:
* Number of “unique” visitors (approximated by counting unique IP addresses – this is never hugely accurate but it is informative)
* Number of hits
* Most popular pages
* Most popular referrers
* Possibly a list of suspicious looking requests and/or unusually high requests from certain places.
This is emphemeral in that the statistics are kept entirely in memory and lost on server restart.
This is anonymous in that statistics are kept only in aggregate form.Aral BalkanAral Balkanhttps://source.small-tech.org/hypha/tools/web-server/-/issues/10Proxy: usability: reverse display of live url and proxy url in CLI2019-06-08T14:52:49ZAral BalkanProxy: usability: reverse display of live url and proxy url in CLICurrently, output for the proxy command looks like this:
```shell
🚚 [Indie Web Server] Proxying: HTTPS/WSS on localhost:443 ←→ HTTP/WS on localhost:1313
🔁 [HPM] Proxy created: / -> ws://localhost:1313
🔁 [HPM] Proxy created: / -> ...Currently, output for the proxy command looks like this:
```shell
🚚 [Indie Web Server] Proxying: HTTPS/WSS on localhost:443 ←→ HTTP/WS on localhost:1313
🔁 [HPM] Proxy created: / -> ws://localhost:1313
🔁 [HPM] Proxy created: / -> http://localhost:1313
```
This is confusing and people could expect to click on the only URLs they see to access their site.
Instead, let’s make it read:
```shell
🚚 [Indie Web Server] Proxy set up:
http://localhost:1313 will be served from https://localhost
ws://localhost:1313 will be served from wss://localhost
You can access your web site from https://localhost
🔁 [HPM] Proxy created: / -> ws://localhost:1313
🔁 [HPM] Proxy created: / -> http://localhost:1313
```Aral BalkanAral Balkanhttps://source.small-tech.org/hypha/tools/web-server/-/issues/9Feature: Aliases2019-06-08T14:52:49ZAral BalkanFeature: Aliases## Use case
I have a site at _laurakalbag.com_. I also have _laurakalbag.co.uk_ that I want to point to the same site (perhaps it was my previous domain and I don’t want links to break). I want both accessible over TLS.
## Suggested sy...## Use case
I have a site at _laurakalbag.com_. I also have _laurakalbag.co.uk_ that I want to point to the same site (perhaps it was my previous domain and I don’t want links to break). I want both accessible over TLS.
## Suggested syntax
```shell
web-server enable --aliases=laurakalbag.co.uk
```
For multiple aliases:
```shell
web-server enable --aliases=my-first.site,my-second.site
```
## Suggested implementation
1. Add _laurakalbag.co.uk_ and _www.laurakalbag.co.uk_ to _/etc/hosts_ so they resolve locally.
2. Automatically request Let’s Encrypt certificates for _laurakalbag.co.uk_ and _www.laurakalbag.co.uk_ so they are served via TLS
## Looking ahead
If/when we implement [vhost](https://github.com/expressjs/express/blob/master/examples/vhost/index.js) support, we need to ensure we are aware of aliases and do not treat the aliases via find in _/etc/hosts_ as vhosts.Aral BalkanAral Balkanhttps://source.small-tech.org/hypha/tools/web-server/-/issues/4IPv6/DNS-propagation-related issue with ACME-TLS and Let’s Encrypt certificates2019-06-08T14:52:50ZAral BalkanIPv6/DNS-propagation-related issue with ACME-TLS and Let’s Encrypt certificatesTry to reproduce with clean install on dev and investigate.
Console output follows:
```sh
root@my-demo:~# web-server site --global
💖 Indie Web Server v6.0.2
🌍 [Indie Web Server] Using globally-trusted certificates.
👉 [Indie Web Se...Try to reproduce with clean install on dev and investigate.
Console output follows:
```sh
root@my-demo:~# web-server site --global
💖 Indie Web Server v6.0.2
🌍 [Indie Web Server] Using globally-trusted certificates.
👉 [Indie Web Server] HTTP → HTTPS redirection active.
🎉 Serving site on https://my-demo.site
[acme-v2] handled(?) rejection as errback:
Error: account error: {"termsOfServiceAgreed":true,"onlyReturnExisting":false,"contact":["mailto: "]}
at /usr/lib/node_modules/@ind.ie/web-server/node_modules/acme-v2/node.js:186:19
at process._tickCallback (internal/process/next_tick.js:68:7)
Error loading/registering certificate for 'my-demo.site':
Error: account error: {"termsOfServiceAgreed":true,"onlyReturnExisting":false,"contact":["mailto: "]}
at /usr/lib/node_modules/@ind.ie/web-server/node_modules/acme-v2/node.js:186:19
at process._tickCallback (internal/process/next_tick.js:68:7)
```
Old title of issue: Server with --global option failing on clean install on Scaleway VPSAral BalkanAral Balkanhttps://source.small-tech.org/hypha/tools/web-server/-/issues/3(Optional) Ursa installation can fail (ACME TLS) – is it necessary?2019-06-08T14:52:50ZAral Balkan(Optional) Ursa installation can fail (ACME TLS) – is it necessary?```sh
> ursa-optional@0.9.10 install /usr/lib/node_modules/@ind.ie/web-server/node_modules/ursa-optional
> node rebuild.js
ursaNative bindings compilation fail. This is not an issue. Modules that depend on it will use fallbacks.
fs.js:1...```sh
> ursa-optional@0.9.10 install /usr/lib/node_modules/@ind.ie/web-server/node_modules/ursa-optional
> node rebuild.js
ursaNative bindings compilation fail. This is not an issue. Modules that depend on it will use fallbacks.
fs.js:114
throw err;
^
Error: EACCES: permission denied, open './stdout.log'
at Object.openSync (fs.js:438:3)
at Object.writeFileSync (fs.js:1189:35)
at Object.<anonymous> (/usr/lib/node_modules/@ind.ie/web-server/node_modules/ursa-optional/rebuild.js:13:10)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
```Aral BalkanAral Balkanhttps://source.small-tech.org/hypha/tools/web-server/-/issues/2Remove telemetry entirely from ACME TLS fork of Greenlock2019-06-08T14:52:50ZAral BalkanRemove telemetry entirely from ACME TLS fork of GreenlockMy ACME TLS fork of Greenlock already removes the email address requirement and disabled the telemetry but the modules are still being installed. Remove them and update this project.
Installation console output:
```sh
> rsa-compat@2.0....My ACME TLS fork of Greenlock already removes the email address requirement and disabled the telemetry but the modules are still being installed. Remove them and update this project.
Installation console output:
```sh
> rsa-compat@2.0.3 postinstall /usr/lib/node_modules/@ind.ie/web-server/node_modules/rsa-compat
> node lib/telemetry.js event:install
> rsa-compat@1.9.2 postinstall /usr/lib/node_modules/@ind.ie/web-server/node_modules/@ind.ie/acme-v2/node_modules/rsa-compat
> node lib/telemetry.js event:install
> rsa-compat@1.9.2 postinstall /usr/lib/node_modules/@ind.ie/web-server/node_modules/acme-v2/node_modules/rsa-compat
> node lib/telemetry.js event:install
```Aral BalkanAral Balkanhttps://source.small-tech.org/hypha/tools/web-server/-/issues/1Startup fails if sudo is not present on the system2019-06-08T14:52:50ZAral BalkanStartup fails if sudo is not present on the systemWhile testing deployment on a VPS that defaults to the root account (this is not how you should deploy a live server ever but still), ran into this. We should handle this more gracefully.
Output follows:
```sh
root@my-demo:~# web-serve...While testing deployment on a VPS that defaults to the root account (this is not how you should deploy a live server ever but still), ran into this. We should handle this more gracefully.
Output follows:
```sh
root@my-demo:~# web-server site
💖 Indie Web Server v6.0.2
/bin/sh: 1: sudo: not found
Error: could not get privileges for Node.js to bind to port 443. { Error: Command failed: sudo setcap 'cap_net_bind_service=+ep' $(which node)
/bin/sh: 1: sudo: not found
at checkExecSyncError (child_process.js:616:11)
at Object.execSync (child_process.js:653:13)
at WebServer._ensureWeCanBindToPort (/usr/lib/node_modules/@ind.ie/web-server/index.js:185:24)
at WebServer.serve (/usr/lib/node_modules/@ind.ie/web-server/index.js:84:10)
at Object.<anonymous> (/usr/lib/node_modules/@ind.ie/web-server/bin/web-server.js:61:11)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
status: 127,
signal: null,
output:
[ null,
<Buffer >,
<Buffer 2f 62 69 6e 2f 73 68 3a 20 31 3a 20 73 75 64 6f 3a 20 6e 6f 74 20 66 6f 75 6e 64 0a> ],
pid: 3441,
stdout: <Buffer >,
stderr:
<Buffer 2f 62 69 6e 2f 73 68 3a 20 31 3a 20 73 75 64 6f 3a 20 6e 6f 74 20 66 6f 75 6e 64 0a> }
/usr/lib/node_modules/@ind.ie/web-server/index.js:192
throw error
^
Error: Command failed: sudo setcap 'cap_net_bind_service=+ep' $(which node)
/bin/sh: 1: sudo: not found
at checkExecSyncError (child_process.js:616:11)
at Object.execSync (child_process.js:653:13)
at WebServer._ensureWeCanBindToPort (/usr/lib/node_modules/@ind.ie/web-server/index.js:185:24)
at WebServer.serve (/usr/lib/node_modules/@ind.ie/web-server/index.js:84:10)
at Object.<anonymous> (/usr/lib/node_modules/@ind.ie/web-server/bin/web-server.js:61:11)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
```Aral BalkanAral Balkan