Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use Blob protocol #118

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# set these to your upload API service URL and the DID your service is using as its service DID
NEXT_PUBLIC_W3UP_SERVICE_URL=https://staging.up.web3.storage
NEXT_PUBLIC_W3UP_SERVICE_DID=did:web:staging.web3.storage
NEXT_PUBLIC_W3UP_PROVIDER=did:web:staging.web3.storage

# set these to values from Stripe settings
NEXT_PUBLIC_STRIPE_PRICING_TABLE_ID=prctbl_1OCeiEF6A5ufQX5vPFlWRkPm
Expand Down
103 changes: 100 additions & 3 deletions .github/workflows/deploy-storacha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,115 @@ name: Deploy Storacha
on:
push:
branches:
- 'feat/storacha-skin'
- 'main'
pull_request:
branches:
- 'main'
jobs:
test:
uses: ./.github/workflows/test.yml

preview:
name: Preview
needs:
- test
runs-on: ubuntu-latest
permissions:
pull-requests: write
environment:
name: ${{ (github.ref_name == 'main') && 'staging' || format('preview-{0}', github.ref_name) }}
url: ${{ (github.ref_name == 'main') && 'https://staging.console.web3.storage/' || steps.cloudflare_url.outputs.stdout }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- name: create .env from .env.tpl setting env variables used by `pnpm run pages:build`
run: |
# set env vars from template

# omit these because they are added manually in the next step
function excludeDefaultServiceVariables() {
cat - | grep -v NEXT_PUBLIC_W3UP_SERVICE_ | grep -v NEXT_PUBLIC_STRIPE
}

# set .env from .env.tpl with exclusions
cat .env.tpl | excludeDefaultServiceVariables > .env

# add vars configuring console frontend to use staging w3up as backend
echo "NEXT_PUBLIC_W3UP_SERVICE_DID=did:web:staging.web3.storage" >> .env
echo "NEXT_PUBLIC_W3UP_SERVICE_URL=https://staging.up.storacha.network" >> .env
echo "NEXT_PUBLIC_W3UP_PROVIDER=did:web:staging.web3.storage" >> .env
echo "NEXT_PUBLIC_STRIPE_PRICING_TABLE_ID=prctbl_1NzhdvF6A5ufQX5vKNZuRhie" >> .env
echo "NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_51LO87hF6A5ufQX5viNsPTbuErzfavdrEFoBuaJJPfoIhzQXdOUdefwL70YewaXA32ZrSRbK4U4fqebC7SVtyeNcz00qmgNgueC" >> .env
echo "NEXT_PUBLIC_STRIPE_CUSTOMER_PORTAL_LINK=https://billing.stripe.com/p/login/test_6oE29Gff99KO6mk8ww" >> .env
# as long as this uses https://github.com/cloudflare/next-on-pages/blob/dc529d7efa8f8568ea8f71b5cdcf78df89be6c12/packages/next-on-pages/bin/index.js,
# env vars won't get passed through to wrangler, so if wrangler will need them, write them to .env like the previous step
- run: pnpm pages:build
- name: Deploy preview build to Cloudflare Pages
uses: mathiasvr/[email protected]
id: cloudflare
with:
run: npx wrangler pages deploy --project-name "$CLOUDFLARE_PAGES_PROJECT_NAME" --branch "$GITHUB_REF_NAME" --commit-hash "$GITHUB_SHA" .vercel/output/static
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
CLOUDFLARE_PAGES_PROJECT_NAME: ${{ (github.ref_name == 'main') && 'console-web3-storage-staging' || 'console-web3-storage-preview' }}
- name: Find Cloudflare Pages preview URL
uses: mathiasvr/[email protected]
id: cloudflare_url
with:
run: egrep -o 'https?://[^ ]+' <(echo "${{ steps.cloudflare.outputs.stdout }}")
- name: Find Current Pull Request
uses: jwalton/[email protected]
id: finder
- name: Update Preview URLs PR Comment
uses: marocchino/[email protected]
with:
number: ${{ steps.finder.outputs.pr }}
message: |
### Website preview 🔗✨
- ⛅️ ${{ steps.cloudflare_url.outputs.stdout }}

[build log](/${{ github.repository }}/actions/runs/${{ github.run_id }})
- name: Add Preview URLs as Job Summary
run: |
echo "
### Website preview 🔗✨
- ⛅️ ${{ steps.cloudflare_url.outputs.stdout }}

[build log](/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY

changelog:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Changelog
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
releases_created: ${{ steps.tag-release.outputs.releases_created }}
steps:
- uses: GoogleCloudPlatform/release-please-action@v3
id: tag-release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
monorepo-tags: true
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Other Changes","hidden":false}]'

release:
name: Release
if: (github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.changelog.outputs.releases_created) || inputs.force_release
runs-on: ubuntu-latest
environment:
name: production
url: https://console.storacha.network
needs:
- test
- changelog
steps:
- uses: actions/checkout@v3
with:
ref: 'feat/storacha-skin'
ref: 'main'
- uses: ./.github/actions/pnpm
- name: create .env from .env.tpl setting env variables used by `pnpm run pages:build`
run: |
Expand All @@ -29,7 +126,7 @@ jobs:

# add vars configuring console frontend to use staging w3up as backend
echo "NEXT_PUBLIC_W3UP_SERVICE_DID=did:web:web3.storage" >> .env
echo "NEXT_PUBLIC_W3UP_SERVICE_URL=https://up.web3.storage" >> .env
echo "NEXT_PUBLIC_W3UP_SERVICE_URL=https://up.storacha.network" >> .env
echo "NEXT_PUBLIC_W3UP_PROVIDER=did:web:web3.storage" >> .env
echo "NEXT_PUBLIC_STRIPE_PRICING_TABLE_ID=prctbl_1OCJ1qF6A5ufQX5vM5DWg4rA" >> .env
echo "NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_live_51LO87hF6A5ufQX5vQTO5BHyz8y9ybJp4kg1GsBjYuqwluuwtQTkbeZzkoQweFQDlv7JaGjuIdUWAyuwXp3tmCfsM005lJK9aS8" >> .env
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Deploy
on:
push:
branches:
- main
- old-main
pull_request:
branches:
- main
- old-main
jobs:
test:
uses: ./.github/workflows/test.yml
Expand All @@ -18,8 +18,8 @@ jobs:
permissions:
pull-requests: write
environment:
name: ${{ (github.ref_name == 'main') && 'staging' || format('preview-{0}', github.ref_name) }}
url: ${{ (github.ref_name == 'main') && 'https://staging.console.web3.storage/' || steps.cloudflare_url.outputs.stdout }}
name: ${{ (github.ref_name == 'old-main') && 'staging' || format('preview-{0}', github.ref_name) }}
url: ${{ (github.ref_name == 'old-main') && 'https://staging.console.web3.storage/' || steps.cloudflare_url.outputs.stdout }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
CLOUDFLARE_PAGES_PROJECT_NAME: ${{ (github.ref_name == 'main') && 'console-web3-storage-staging' || 'console-web3-storage-preview' }}
CLOUDFLARE_PAGES_PROJECT_NAME: ${{ (github.ref_name == 'old-main') && 'console-web3-storage-staging' || 'console-web3-storage-preview' }}
- name: Find Cloudflare Pages preview URL
uses: mathiasvr/[email protected]
id: cloudflare_url
Expand All @@ -80,7 +80,7 @@ jobs:
[build log](/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY

changelog:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
if: github.event_name == 'push' && github.ref == 'refs/heads/old-main'
name: Changelog
runs-on: ubuntu-latest
permissions:
Expand All @@ -99,7 +99,7 @@ jobs:

release:
name: Release
if: (github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.changelog.outputs.releases_created) || inputs.force_release
if: (github.event_name == 'push' && github.ref == 'refs/heads/old-main' && needs.changelog.outputs.releases_created) || inputs.force_release
runs-on: ubuntu-latest
environment:
name: production
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
uses: mathiasvr/[email protected]
id: cloudflare
with:
run: npx wrangler pages deploy --project-name console-web3-storage --branch "main" --commit-hash "$GITHUB_SHA" .vercel/output/static
run: npx wrangler pages deploy --project-name console-web3-storage --branch "old-main" --commit-hash "$GITHUB_SHA" .vercel/output/static
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,57 @@
# Changelog

## [1.12.0](https://github.com/storacha/console/compare/w3console-v1.11.0...w3console-v1.12.0) (2024-10-02)


### Features

* add old web3 storage migrator ([#129](https://github.com/storacha/console/issues/129)) ([ba45a5f](https://github.com/storacha/console/commit/ba45a5fdebb7651e461f8bf55c93d5fcfc3a2204))

## [1.11.0](https://github.com/storacha/console/compare/w3console-v1.10.0...w3console-v1.11.0) (2024-09-24)


### Features

* share spaces via email ([#123](https://github.com/storacha/console/issues/123)) ([896079b](https://github.com/storacha/console/commit/896079ba93c6b798a4239fa5b317c05654f01435))


### Bug Fixes

* import space preview ([#127](https://github.com/storacha/console/issues/127)) ([1f2acf6](https://github.com/storacha/console/commit/1f2acf64acbf2e603eaf4db06ba91ffdd614a1a4))
* share space via ucan file ([#126](https://github.com/storacha/console/issues/126)) ([ba934a2](https://github.com/storacha/console/commit/ba934a23317aa94703591ef3cb99446aea265b66))

## [1.10.0](https://github.com/storacha/console/compare/w3console-v1.9.1...w3console-v1.10.0) (2024-09-20)


### Features

* change email ([7c7beb7](https://github.com/storacha/console/commit/7c7beb7f9f78e25076bf089878d5e058cd52f680))
* **copy:** Add missing comma ([#115](https://github.com/storacha/console/issues/115)) ([97f1ac3](https://github.com/storacha/console/commit/97f1ac3c455a97df00db2f512a665cd28b241a11))
* Improved layout styling, and other tales ([#114](https://github.com/storacha/console/issues/114)) ([d0a2208](https://github.com/storacha/console/commit/d0a2208d04432b6f3537f2197238ac10bcc5148a))
* more styles ([d4e8efa](https://github.com/storacha/console/commit/d4e8efa489974b4fc3603347142e474ac13c60bc))
* styles for upload page ([6c54798](https://github.com/storacha/console/commit/6c54798b3850e1a7211313012aff7e84d4236b39))
* trigger deploy ([a8f1089](https://github.com/storacha/console/commit/a8f108939fc8e9b399b58525fb5971b70071642f))
* wording ([ffe9b1b](https://github.com/storacha/console/commit/ffe9b1b65ceb24ce7b18bfbf1e7a9a5a79868007))


### Bug Fixes

* apostrophe ([681b9b8](https://github.com/storacha/console/commit/681b9b8430181ef96544848e87d67481aa625d1a))
* check ref ([f406ac9](https://github.com/storacha/console/commit/f406ac985419824308b561a39430a4a38c5e43c1))
* deploy-storacha.yml needs to use the new main branch ([#122](https://github.com/storacha/console/issues/122)) ([65644c8](https://github.com/storacha/console/commit/65644c851272d5920bf1ed22fc6ff4a420f54242))
* deploy.yml needs to use the old-main branch ([#120](https://github.com/storacha/console/issues/120)) ([713af05](https://github.com/storacha/console/commit/713af05572387fcf12cc34cec0dd1db4df0061ff))
* quotes ([bcf209b](https://github.com/storacha/console/commit/bcf209bf830a83b71f0f3f9f61919832a3768057))
* **space-creator:** check provision result before proceeding ([#119](https://github.com/storacha/console/issues/119)) ([5ea5940](https://github.com/storacha/console/commit/5ea59400f274f294e7ffb1aa99efab18ff099a9e))
* use correct branch name ([f81e090](https://github.com/storacha/console/commit/f81e0907fcbed54323995acbb9c13f2c151f6db7))
* use main branch ([698974b](https://github.com/storacha/console/commit/698974b36ff3c4cb0275a25aec4384fecb2723d2))


### Other Changes

* add storacha deploy action ([39345e6](https://github.com/storacha/console/commit/39345e60e639fd11eb9af44766d16fc71ed73945))
* Set `packageManager` ([#117](https://github.com/storacha/console/issues/117)) ([c9436fc](https://github.com/storacha/console/commit/c9436fc323799fe1d5e3d0ced2a8789d3d7001f5))
* update deploy name ([f7c1340](https://github.com/storacha/console/commit/f7c1340858e449e49237c7c40b85cebfa9721a01))

## [1.9.1](https://github.com/storacha-network/console/compare/w3console-v1.9.0...w3console-v1.9.1) (2024-07-15)


Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Console

> Your dashboard for web3.storage
> Your dashboard for storacha.network

Upload files & manage your spaces from your browser.

## Getting Started

To use the production site visit https://console.web3.storage
To use the production site visit https://console.storacha.network

To contribute and customize console, copy `.env.tpl` to `.env` and run the development server:

Expand All @@ -20,18 +20,16 @@ You can start editing the page by modifying `app/page.tsx`. The page auto-update

### Using an alternate w3up service

By default, this app connects to https://up.web3.storage. To use an alternate service, specify
the service URL and DID in your environment variables, like:
By default, this app connects to `https://up.web3.storage`, and uses `did:web:web3.storage` as provider. To use an alternate service and/or provider, specify the service URL, service DID and provider DID in your environment variables, like so:

```
NEXT_PUBLIC_W3UP_SERVICE_URL=https://your.w3up.service
NEXT_PUBLIC_W3UP_SERVICE_DID=did:your-service-did
NEXT_PUBLIC_W3UP_PROVIDER=did:your-provider-did
```

An example `.env.local` file can be found in `.env.tpl`.

If you are using `w3infra`, the service URL will be displayed as the `UploadApiStack`'s `ApiEndpoint` output once `npm start` has successfully set up your development environment.

<p style="text-align:center;padding-top:2rem">⁂</p>


13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "w3console",
"version": "1.9.1",
"version": "1.12.0",
"private": true,
"packageManager": "[email protected]+sha256.7a4261e50d9a44d9240baf6c9d6e10089dcf0a79d0007f2a26985a6927324177",
"scripts": {
"dev": "next dev",
"build": "next build",
Expand All @@ -22,13 +23,13 @@
"@ucanto/core": "^9.0.0",
"@ucanto/interface": "^9.0.0",
"@ucanto/transport": "^9.0.0",
"@w3ui/react": "^2.3.0",
"@w3ui/react": "2.4.0",
"@web3-storage/access": "^19.0.0",
"@web3-storage/capabilities": "^17.1.0",
"@web3-storage/content-claims": "^3.2.1",
"@web3-storage/data-segment": "^5.0.0",
"@web3-storage/did-mailto": "^2.1.0",
"@web3-storage/w3up-client": "^13.1.1",
"@web3-storage/w3up-client": "13.1.1",
"archy": "^1.0.0",
"ariakit-utils": "0.17.0-next.27",
"blueimp-md5": "^2.19.0",
Expand All @@ -52,9 +53,9 @@
"@types/react": "latest",
"@types/react-dom": "latest",
"autoprefixer": "latest",
"eslint": "latest",
"eslint-config-next": "latest",
"eslint-plugin-next-on-pages": "^1.6.3",
"eslint": "8.55.0",
"eslint-config-next": "14.0.4",
"eslint-plugin-next-on-pages": "1.6.3",
"postcss": "latest",
"tailwindcss": "latest",
"typescript": "latest",
Expand Down
Loading
Loading