Added support for subdomain gateways
parent
6e5438d8a4
commit
2799e4135b
|
@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/), and this
|
|||
- Upgraded to Angular 10
|
||||
- Now uses `--chunker=buzhash`
|
||||
- Updated `bootstrap` and `ipfs-css`
|
||||
- Added support for subdomain gateways
|
||||
|
||||
### Deprecated
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div fxLayout="column" fxLayoutAlign="space-evenly center" fxLayoutGap="1em" class="container">
|
||||
<div class="container" fxLayout="column" fxLayoutAlign="space-evenly center" fxLayoutGap="1em">
|
||||
|
||||
<h1>Public IPFS Cacher</h1>
|
||||
|
||||
|
@ -8,11 +8,11 @@
|
|||
<!-- Hash -->
|
||||
<mat-form-field>
|
||||
<mat-label>IPFS</mat-label>
|
||||
<input matInput [(ngModel)]="ipfs" name="ipfs">
|
||||
<input name="ipfs" [(ngModel)]="ipfs" matInput>
|
||||
</mat-form-field>
|
||||
|
||||
<!-- Cache -->
|
||||
<button mat-flat-button color="primary" type="button" (click)="cacheIPFS()">Cache</button>
|
||||
<button (click)="cacheIPFS()" type="button" mat-flat-button color="primary">Cache</button>
|
||||
|
||||
</form>
|
||||
|
||||
|
@ -22,18 +22,18 @@
|
|||
<!-- Hash -->
|
||||
<mat-form-field>
|
||||
<mat-label>IPNS</mat-label>
|
||||
<input matInput [(ngModel)]="ipns" name="ipns">
|
||||
<input name="ipns" [(ngModel)]="ipns" matInput>
|
||||
</mat-form-field>
|
||||
|
||||
<!-- Cache -->
|
||||
<button mat-flat-button color="primary" type="button" (click)="cacheIPNS()">Cache</button>
|
||||
<button (click)="cacheIPNS()" type="button" mat-flat-button color="primary">Cache</button>
|
||||
|
||||
</form>
|
||||
|
||||
<mat-progress-bar *ngIf="subscriptions.length" mode="determinate" [value]="dataSource.data.length / gateways.length * 100">
|
||||
<mat-progress-bar [value]="dataSource.data.length / gateways.length * 100" *ngIf="subscriptions.length" mode="determinate">
|
||||
</mat-progress-bar>
|
||||
|
||||
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8">
|
||||
<table class="mat-elevation-z8" [dataSource]="dataSource" mat-table>
|
||||
|
||||
<!-- Result Column -->
|
||||
<ng-container matColumnDef="error">
|
||||
|
@ -41,7 +41,7 @@
|
|||
<td mat-cell *matCellDef="let element">
|
||||
<div [ngSwitch]="element.error">
|
||||
<div *ngSwitchCase="null">✅</div>
|
||||
<div *ngSwitchDefault [matTooltip]="element.error.statusText">❌</div>
|
||||
<div [matTooltip]="element.error.statusText" *ngSwitchDefault>❌</div>
|
||||
</div>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
@ -52,10 +52,16 @@
|
|||
<td mat-cell *matCellDef="let element">
|
||||
<div [ngSwitch]="element.error">
|
||||
<div *ngSwitchCase="null">
|
||||
<strong><a href="{{ element.gateway }}#x-ipfs-companion-no-redirect" class="aqua"> {{ element.gateway }} </a></strong>
|
||||
<strong>
|
||||
<a class="aqua" href="{{ element.gateway }}#x-ipfs-companion-no-redirect" target="_blank">
|
||||
{{ element.gateway }}
|
||||
</a>
|
||||
</strong>
|
||||
</div>
|
||||
<div *ngSwitchDefault>
|
||||
<a href="{{ element.gateway }}#x-ipfs-companion-no-redirect" class="aqua-muted"> {{ element.gateway }} </a>
|
||||
<a class="aqua-muted" href="{{ element.gateway }}#x-ipfs-companion-no-redirect" target="_blank">
|
||||
{{ element.gateway }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
@ -70,14 +76,15 @@
|
|||
<h3>About</h3>
|
||||
<p>
|
||||
This allows you to cache a specific IPFS hash to a bunch of public gateways.
|
||||
It's inspired from <a href="https://github.com/ipfs/public-gateway-checker">github.com/ipfs/public-gateway-checker</a>.
|
||||
The source code is available at <a
|
||||
It's inspired from <a class="link" href="https://github.com/ipfs/public-gateway-checker">github.com/ipfs/public-gateway-checker</a>.
|
||||
The source code is available at <a class="link"
|
||||
href="https://gitlab.com/NatoBoram/public-gateway-cacher">gitlab.com/NatoBoram/public-gateway-cacher</a>.
|
||||
</p>
|
||||
<p>
|
||||
If you'd like to add a new public gateway,
|
||||
please go to <a href="https://github.com/ipfs/public-gateway-checker">github.com/ipfs/public-gateway-checker</a>,
|
||||
submit a pull request then open an issue <a href="https://gitlab.com/NatoBoram/public-gateway-cacher/issues/new">here</a>.
|
||||
please go to <a class="link" href="https://github.com/ipfs/public-gateway-checker">github.com/ipfs/public-gateway-checker</a>,
|
||||
submit a pull request then open an issue <a class="link"
|
||||
href="https://gitlab.com/NatoBoram/public-gateway-cacher/issues/new">here</a>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -56,10 +56,10 @@ export class PagesComponent implements OnInit {
|
|||
this.gateways.forEach((gateway): void => {
|
||||
this.subscriptions.push(
|
||||
this.gatewayService.get(gateway, type, hash).subscribe((): void => {
|
||||
this.dataSource.data.push({ gateway: `${gateway.replace(':type', type).replace(':hash', hash)}`, error: null });
|
||||
this.dataSource.data.push({ gateway: this.gatewayService.url(gateway, type, hash), error: null });
|
||||
this.matTable.renderRows();
|
||||
}, (error: HttpErrorResponse): void => {
|
||||
this.dataSource.data.push({ gateway: `${gateway.replace(':type', type).replace(':hash', hash)}`, error });
|
||||
this.dataSource.data.push({ gateway: this.gatewayService.url(gateway, type, hash), error });
|
||||
this.matTable.renderRows();
|
||||
})
|
||||
);
|
||||
|
|
|
@ -21,9 +21,15 @@ export class GatewayService {
|
|||
}
|
||||
|
||||
get(gateway: string, type: string, hash: string): Observable<Blob> {
|
||||
return this.http.get<Blob>(`${gateway.replace(':type', type).replace(':hash', hash)}#x-ipfs-companion-no-redirect`, {
|
||||
return this.http.get<Blob>(`${this.url(gateway, type, hash)}#x-ipfs-companion-no-redirect`, {
|
||||
responseType: 'blob' as 'json'
|
||||
});
|
||||
}
|
||||
|
||||
url(gateway: string, type: string, hashpath: string): string {
|
||||
const splits = hashpath.split('/');
|
||||
const url = gateway.replace(':type', type).replace(':hash', splits.shift());
|
||||
return splits.length ? [url, splits.join('/')].join('/') : url;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,22 +1,16 @@
|
|||
[
|
||||
"https://ipfs.io/:type/:hash",
|
||||
"https://:hash.:type.dweb.link",
|
||||
"https://gateway.ipfs.io/:type/:hash",
|
||||
"https://ipfs.infura.io/:type/:hash",
|
||||
"https://rx14.co.uk/:type/:hash",
|
||||
"https://ninetailed.ninja/:type/:hash",
|
||||
"https://ipfs.globalupload.io/:hash",
|
||||
"https://ipfs.jes.xxx/:type/:hash",
|
||||
"https://siderus.io/:type/:hash",
|
||||
"https://eu.siderus.io/:type/:hash",
|
||||
"https://na.siderus.io/:type/:hash",
|
||||
"https://ap.siderus.io/:type/:hash",
|
||||
"https://10.via0.com/:type/:hash",
|
||||
"https://ipfs.eternum.io/:type/:hash",
|
||||
"https://hardbin.com/:type/:hash",
|
||||
"https://ipfs.wa.hle.rs/:type/:hash",
|
||||
"https://gateway.blocksec.com/:type/:hash",
|
||||
"https://ipfs.renehsz.com/:type/:hash",
|
||||
"https://cloudflare-ipfs.com/:type/:hash",
|
||||
"https://:hash.:type.cf-ipfs.com",
|
||||
"https://ipns.co/:hash",
|
||||
"https://ipfs.mrh.io/:type/:hash",
|
||||
"https://gateway.originprotocol.com/:type/:hash",
|
||||
|
@ -33,7 +27,30 @@
|
|||
"https://ipfs.privacytools.io/:type/:hash",
|
||||
"https://ipfs.jeroendeneef.com/:type/:hash",
|
||||
"https://permaweb.io/:type/:hash",
|
||||
"https://ipfs.stibarc.gq/:type/:hash",
|
||||
"https://ipfs.stibarc.com/:type/:hash",
|
||||
"https://ipfs.best-practice.se/:type/:hash",
|
||||
"https://lineageos-on-ipfs.com/:type/:hash"
|
||||
"https://:hash.:type.2read.net",
|
||||
"https://ipfs.2read.net/:type/:hash",
|
||||
"https://storjipfs-gateway.com/:type/:hash",
|
||||
"https://ipfs.runfission.com/:type/:hash",
|
||||
"https://trusti.id/:type/:hash",
|
||||
"https://:hash.:type.cosmos-ink.net",
|
||||
"https://ipfs.overpi.com/:type/:hash",
|
||||
"https://ipfs.lc/:type/:hash",
|
||||
"https://ipfs.leiyun.org/:type/:hash",
|
||||
"https://ipfs.ink/:type/:hash",
|
||||
"https://filecoin.io/:type/:hash",
|
||||
"https://ipfs.jes.xxx/:type/:hash",
|
||||
"https://ipfs.oceanprotocol.com/:type/:hash",
|
||||
"https://d26g9c7mfuzstv.cloudfront.net/:type/:hash",
|
||||
"https://ipfsgateway.makersplace.com/:type/:hash",
|
||||
"https://gateway.ravenland.org/:type/:hash",
|
||||
"https://ipfs.smartsignature.io/:type/:hash",
|
||||
"https://ipfs.funnychain.co/:type/:hash",
|
||||
"https://ipfs.telos.miami/:type/:hash",
|
||||
"https://robotizing.net/:type/:hash",
|
||||
"https://ipfs.mttk.net/:type/:hash",
|
||||
"https://ipfs.fleek.co/:type/:hash",
|
||||
"https://ipfs.jbb.one/:type/:hash",
|
||||
"https://ipfs.yt/:type/:hash"
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue