Skip to content

Commit

Permalink
feat: switch hosting to Fleek (ipfs-shipyard#3)
Browse files Browse the repository at this point in the history
* feat:  Fleek publishing
* fix: no raw leaves

We want to reuse pinning provided by Fleek, but atm it uses CIDv0,
which does not support raw leaves.

By disabling raw leaves in CIDv1 add, we get the same underlying dag-pb,
and the same multihash inside of both CIDv1 used in tests and CIDv0
produced by Fleek.

* refactor: reuse /files/ from Fleek

Co-authored-by: RangerMauve <ranger@mauve.moe>
  • Loading branch information
lidel and RangerMauve authored Aug 12, 2021
1 parent fedc020 commit c2ac95b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 17 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,16 @@ Progress: https://github.com/ipfs/community/discussions/573

## Publishing:

This test suite is automatically published on Fleek via CI job.

`HEAD` of the `default` branch is published at https://ipfs-protocol-compliance-suite.on.fleek.co

## Manual publishing:

Manual steps are:

- Set up an IPFS node
- Make sure the `IPNS_DOMAIN` URL in `publish-files.js` is correct
- Make sure the `IPNS_ROOT` URL in `publish-files.js` is correct (or override it via environment variable of the same name)
- Run `publish-files.js`
- Pin the IPFS URL somewhere like Pinata
- Update the DNS domain to point to the IPFS URL using DNSLink
Expand Down
20 changes: 10 additions & 10 deletions constants.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Constants for test files, generated with publish-files.js

// Raw hashes
export const URL_IPFS_MEDIA = 'ipfs://bafybeic5jylb5b4tq66zfxpn6grd2d5eepefoq5kapk4p5e2rcs35nqxoa/'
export const URL_IPFS_TEXT_FILE_RAW = 'ipfs://bafkreigsvbhuxc3fbe36zd3tzwf6fr2k3vnjcg5gjxzhiwhnqiu5vackey/?filename=files/example.txt'
export const URL_IPFS_IMAGE_FILE_RAW = 'ipfs://bafkreicncneocapbypwwe3gl47bzvr3pkpxmmobzn7zr2iaz67df4kjeiq/?filename=files/ipfs-logo.svg'
export const URL_IPFS_VIDEO_FILE_RAW = 'ipfs://bafybeibuad3l4p6g7n3mqywkfshxzorlpkdfzcuaczzruqvudo5eqgarhi/?filename=files/IPFS.mp4'
export const URL_IPFS_AUDIO_FILE_RAW = 'ipfs://bafkreicjcu4fn5n57psz7iefp63jzdtcogd65iwtq33da6mtyvgxfhg7pa/?filename=files/ipfs.mp3'
export const URL_IPFS_JS_FILE_RAW = 'ipfs://bafkreiff66rjfncaw7eynzlpw2cxxcykierusq4v5cs6aurb7o6yc3a2fu/?filename=files/example.js'
export const URL_IPFS_CSS_FILE_RAW = 'ipfs://bafkreifqlxljadxls4doufn5dzdp6zivzowmoqhhvcuf7ldjyprd3v25lm/?filename=files/example.css'
export const URL_IPFS_HTML_FILE_RAW = 'ipfs://bafkreiai7j3f4nibam6n5stzh2ew3s4w7pzjz4npgzvlzfs6m2phgufvhi/?filename=files/example.html'
export const URL_IPFS_REDIRECT_FILE_RAW = 'ipfs://bafkreiehlqlhwhcf2vfert526hjwoizgh3ekdj5hhgn6twt3pyeu6xtoeq/?filename=files/redirect.html'
export const URL_IPFS_MEDIA = 'ipfs://bafybeievhgvy6xq64x32fufpkwkhly32au7pkdmczdgyypg435w6ftmet4/'
export const URL_IPFS_TEXT_FILE_RAW = 'ipfs://bafybeiduiecxoeiqs3gyc6r7v3lymmhserldnpw62qjnhmqsulqjxjmtzi/?filename=files/example.txt'
export const URL_IPFS_IMAGE_FILE_RAW = 'ipfs://bafybeihc4hti5ix4ds2tefhy35qd4c7n5as5cazdmksrxj7ipvcxm64h54/?filename=files/ipfs-logo.svg'
export const URL_IPFS_VIDEO_FILE_RAW = 'ipfs://bafybeifmi5ykqzw4xnyarcx4wltdqid3ivacz3dr5qobskrajprs53uvj4/?filename=files/IPFS.mp4'
export const URL_IPFS_AUDIO_FILE_RAW = 'ipfs://bafybeidwaupi25ngpkvjjn27ae7ct3tmmywbyv5gjagqjldqayfq42ynaa/?filename=files/ipfs.mp3'
export const URL_IPFS_JS_FILE_RAW = 'ipfs://bafybeie6onxucug6vpresqyspluul3dp5ln42copjfckrdjbxvbkslcohe/?filename=files/example.js'
export const URL_IPFS_CSS_FILE_RAW = 'ipfs://bafybeib7jtnjgsqnws3yt2wyw6up54tl2y4h4gwergruhdl4l4ehd57y4y/?filename=files/example.css'
export const URL_IPFS_HTML_FILE_RAW = 'ipfs://bafybeibsjyvcryciw666lqypkbgr4q5bvnmiipdsbw53hratenbvyoeevm/?filename=files/example.html'
export const URL_IPFS_REDIRECT_FILE_RAW = 'ipfs://bafybeigoxuborlvdwjel4xw4w5bxl4ucse5uac3jnhdm34zrhe3ynmev6e/?filename=files/redirect.html'

// Relative paths
export const URL_IPFS_TEXT_FILE = `${URL_IPFS_MEDIA}example.txt`
Expand All @@ -25,7 +25,7 @@ export const URL_IPFS_DIRECTORY_NO_INDEX = `${URL_IPFS_MEDIA}`
export const URL_IPFS_DIRECTORY_WITH_INDEX = `${URL_IPFS_MEDIA}with-index/`
export const URL_IPFS_DIRECTORY_EMPTY = `${URL_IPFS_MEDIA}empty`
export const URL_IPFS_REDIRECT_FILE = `${URL_IPFS_MEDIA}redirect.html`
export const URL_IPNS_MEDIA = `ipns://ipfs-compliance.mauve.moe/`
export const URL_IPNS_MEDIA = `ipns://ipfs-protocol-compliance-suite.on.fleek.co/files/`
export const URL_IPNS_TEXT_FILE = `${URL_IPNS_MEDIA}example.txt`
export const URL_IPNS_IMAGE_FILE = `${URL_IPNS_MEDIA}ipfs-logo.svg`
export const URL_IPNS_VIDEO_FILE = `${URL_IPNS_MEDIA}IPFS.mp4`
Expand Down
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
{
"scripts": {
"lint": "standard",
"build": "node ./publish-files.js"
},
"standard": {
"envs": {
"browser": true,
"node": true
},
"ignore": [
"testharness/",
"constants.js",
"constants-old.js"
"files/js/import-example-dynamic.js",
"testharness/",
"constants.js",
"constants-old.js"
]
}
}
6 changes: 3 additions & 3 deletions publish-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const util = require('util')
const exec = util.promisify(require('child_process').exec)
const fs = require('fs').promises

const IPNS_DOMAIN = 'ipns://ipfs-compliance.mauve.moe/'
const IPNS_ROOT = process.env.IPNS_ROOT || 'ipns://ipfs-protocol-compliance-suite.on.fleek.co/files/'

const FILES_TO_CONSTANTS = new Map([
['files', 'URL_IPFS_MEDIA'],
Expand Down Expand Up @@ -33,7 +33,7 @@ const CONSTANTS = new Map([
['URL_IPFS_DIRECTORY_WITH_INDEX', '${URL_IPFS_MEDIA}with-index/'],
['URL_IPFS_DIRECTORY_EMPTY', '${URL_IPFS_MEDIA}empty'],
['URL_IPFS_REDIRECT_FILE', '${URL_IPFS_MEDIA}redirect.html'],
['URL_IPNS_MEDIA', IPNS_DOMAIN],
['URL_IPNS_MEDIA', IPNS_ROOT],
['URL_IPNS_TEXT_FILE', '${URL_IPNS_MEDIA}example.txt'],
['URL_IPNS_IMAGE_FILE', '${URL_IPNS_MEDIA}ipfs-logo.svg'],
['URL_IPNS_VIDEO_FILE', '${URL_IPNS_MEDIA}IPFS.mp4'],
Expand All @@ -57,7 +57,7 @@ run().catch((e) => {

async function run () {
console.log('Uploading to IPFS')
const { stdout: output } = await exec('ipfs add ./files/ --cid-version=1 -r --raw-leaves=false')
const { stdout: output } = await exec('ipfs add ./files/ --cid-version=1 --raw-leaves=false -r')

const lines = output.split(/\r?\n/)

Expand Down

0 comments on commit c2ac95b

Please sign in to comment.