Skip to content

Commit bd38764

Browse files
feat: use @helia/verified-fetch (#17)
* 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>
1 parent 390ebdf commit bd38764

File tree

120 files changed

+17217
-60168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+17217
-60168
lines changed

.aegir.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/** @type {import('aegir').PartialOptions} */
2+
export default {
3+
lint: {
4+
files: ['src/**/*.ts', 'src/**/*.tsx', 'tests/**/*']
5+
},
6+
dependencyCheck: {
7+
ignore: [
8+
// .jsx files aren't checked properly.
9+
'multiformats',
10+
11+
'react-dom',
12+
13+
// required by webpack
14+
'webpack-cli',
15+
'webpack-dev-server',
16+
'babel-loader',
17+
'style-loader',
18+
'css-loader'
19+
],
20+
productionIgnorePatterns: [
21+
'webpack.config.js',
22+
'.aegir.js',
23+
'/tests',
24+
'dist'
25+
]
26+
}
27+
}

.eslintrc.cjs

-18
This file was deleted.

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
test-build
12
# Created by https://www.toptal.com/developers/gitignore/api/macos,node,windows,linux
23
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,node,windows,linux
34

@@ -215,3 +216,4 @@ $RECYCLE.BIN/
215216
*.lnk
216217

217218
# End of https://www.toptal.com/developers/gitignore/api/macos,node,windows,linux
219+
.vscode

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,26 @@ etc... When your path is valid, you will be shown buttons that will let you load
5757

5858
**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.
5959

60+
### Enabling subdomains
61+
62+
You can enable support for subdomains with a simple nginx configuration:
63+
64+
```nginx
65+
# simple proxy from helia-sw-gateway.localhost to localhost:3000
66+
server {
67+
listen 80;
68+
69+
server_name ~^(?<subdomain>.+)\.ipfs\.helia-sw-gateway.localhost$ ~^(?<subdomain>.+)\.ipns\.helia-sw-gateway.localhost$ .helia-sw-gateway.localhost;
70+
71+
location / {
72+
proxy_pass http://localhost:3000;
73+
proxy_set_header Host $host;
74+
proxy_set_header X-Forwarded-For $remote_addr;
75+
}
76+
}
77+
```
78+
79+
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.
6080

6181
## Demo links
6282

0 commit comments

Comments
 (0)