Skip to content

Commit

Permalink
feat: use @helia/verified-fetch (#17)
Browse files Browse the repository at this point in the history
* chore: update deps

* feat: use verified-fetch

* feat: remove unused code and helia options

* chore: update deps

* feat: remove unused code

* fix: use @helia/verified-fetch RC and update deps

* feat: use latest @helia/verified-fetch

* feat: allow configuring custom routers/gateways

* feat: handle css font-face urls

* tmp: subdomain works

* docs: subdomain support

* fix: cleanup app entry

* fix: subdomain dashes instead of dot support

* fix: proper handling of dns-link labels

* feat: use idb block&data stores

* chore: always use service-worker

* chore: only trustless-gateway.link gateway

* fix: do not force charset for html

* feat: replace level config with indexedDB

* test: add tests for pathOrSubdomain check

* test: shore-up path-or-subdomain check

---------

Co-authored-by: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com>
  • Loading branch information
aschmahmann and SgtPooki authored Feb 21, 2024
1 parent 390ebdf commit bd38764
Show file tree
Hide file tree
Showing 120 changed files with 17,217 additions and 60,168 deletions.
27 changes: 27 additions & 0 deletions .aegir.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/** @type {import('aegir').PartialOptions} */
export default {
lint: {
files: ['src/**/*.ts', 'src/**/*.tsx', 'tests/**/*']
},
dependencyCheck: {
ignore: [
// .jsx files aren't checked properly.
'multiformats',

'react-dom',

// required by webpack
'webpack-cli',
'webpack-dev-server',
'babel-loader',
'style-loader',
'css-loader'
],
productionIgnorePatterns: [
'webpack.config.js',
'.aegir.js',
'/tests',
'dist'
]
}
}
18 changes: 0 additions & 18 deletions .eslintrc.cjs

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
test-build
# Created by https://www.toptal.com/developers/gitignore/api/macos,node,windows,linux
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,node,windows,linux

Expand Down Expand Up @@ -215,3 +216,4 @@ $RECYCLE.BIN/
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/macos,node,windows,linux
.vscode
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,26 @@ etc... When your path is valid, you will be shown buttons that will let you load

**NOTE:** There is no way to confirm the validity of an `/ipns/` path without actually querying for it, which is not currently done until you attempt to load the content.

### Enabling subdomains

You can enable support for subdomains with a simple nginx configuration:

```nginx
# simple proxy from helia-sw-gateway.localhost to localhost:3000
server {
listen 80;
server_name ~^(?<subdomain>.+)\.ipfs\.helia-sw-gateway.localhost$ ~^(?<subdomain>.+)\.ipns\.helia-sw-gateway.localhost$ .helia-sw-gateway.localhost;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
```

You can then run `npm start` and your nginx server, and then visit `http://specs.ipfs.tech.ipns.helia-sw-gateway.localhost` in your browser to load the `specs.ipfs.tech` website via Helia, completely from the service worker.

## Demo links

Expand Down
Loading

0 comments on commit bd38764

Please sign in to comment.