Skip to content

Commit fd24159

Browse files
authored
Merge pull request #385 from ipfs/specs.ipfs.tech-ipips
Publish IPIPs to specs.ipfs.tech
2 parents 0962486 + 32740aa commit fd24159

23 files changed

+973
-827
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55

66
# global IPIP
77
IPIP/ @ipfs/specs-stewards
8+
src/ipips/ @ipfs/specs-stewards
89

910
# Selected Spec Stewards can be defined below to be automatically requested for
1011
# review when someone opens a pull request that modifies area of their
1112
# interest.
1213

13-
http-gateways/ @lidel
14+
http-gateways/ @lidel
15+
src/http-gateways/ @lidel

IPIP/0000-template.md

Lines changed: 1 addition & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1 @@
1-
# IPIP-0: InterPlanetary Improvement Proposal Template
2-
3-
<!-- IPIP number should match its pull request number. After you open a PR,
4-
please update title and include anqabbreviated title in the filename too:
5-
`0000-draft-title-abbrev.md`. -->
6-
7-
- Start Date: YYYY-MM-DD
8-
- Related Issues:
9-
- (add links here)
10-
11-
## Summary
12-
13-
<!--One paragraph explanation of the IPIP.-->
14-
This is the suggested template for new IPIPs.
15-
16-
## Motivation
17-
18-
AKA Problem Statement
19-
20-
Clearly explain why the existing protocol specification is inadequate
21-
to address the problem that the IPIP solves.
22-
23-
## Detailed design
24-
25-
AKA Solution Proposal
26-
27-
Describe the proposed solution and list all changes made to the specs repository.
28-
29-
The resulting specification should be detailed enough to allow competing,
30-
interoperable implementations.
31-
32-
When modifying an existing specification file, this section should provide a
33-
summary of changes. When adding new specification files, list all of them.
34-
35-
## Test fixtures
36-
37-
List relevant CIDs. Describe how implementations can use them to determine
38-
specification compliance. This section can be skipped if IPIP does not deal
39-
with the way IPFS handles content-addressed data, or the modified specification
40-
file already includes this information.
41-
42-
## Design rationale
43-
44-
The rationale fleshes out the specification by describing what motivated
45-
the design and why particular design decisions were made.
46-
47-
Provide evidence of rough consensus and working code within the community,
48-
and discuss important objections or concerns raised during discussion.
49-
50-
### User benefit
51-
52-
How will end users benefit from this work?
53-
54-
### Compatibility
55-
56-
Explain the upgrade considerations for existing implementations.
57-
58-
### Security
59-
60-
Explain the security implications/considerations relevant to the proposed change.
61-
62-
### Alternatives
63-
64-
Describe alternate designs that were considered and related work.
65-
66-
### Copyright
67-
68-
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
1+
Moved to [../ipip-template.md].
Lines changed: 1 addition & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -1,157 +1,3 @@
11
# IPIP 0001: Lightweight Improvement Process for IPFS Specifications
22

3-
- Start Date: 2022-06-10
4-
- Related Issues:
5-
- [ipfs/specs/issues/286](https://github.com/ipfs/specs/issues/286)
6-
7-
## Summary
8-
9-
This _InterPlanetary Improvement Proposal_ (IPIP) introduces a lightweight
10-
"request for comments/change" process for the IPFS specifications
11-
[repository][1].
12-
13-
[1]: https://github.com/ipfs/specs/
14-
15-
## Motivation
16-
17-
Today, protocol design discussions often take place in a repository of an IPFS
18-
implementation. These conversations are unintentionally obscured from the useful input of [Specs Stewards], other
19-
implementations, service operators and the wider IPFS Community.
20-
21-
The IPFS Project needs a mechanism for proposing and evaluating specification
22-
improvements that are not tied to a specific programming language
23-
or implementation of IPFS.
24-
25-
## Detailed design
26-
27-
Adopt an informal IPIP process for the [ipfs/specs][1] repository, providing a
28-
minimal structure for opening, reviewing, and merging specification changes.
29-
30-
The purpose of IPIP documents is to **document motivation** behind the change
31-
applied to the spec. **IPIP is not to be the spec itself**.
32-
33-
To illustrate:
34-
- In order to understand how (hypothetical) WebDAV Gateway works, one would
35-
read contents of specs in `ipfs/specs/WEBDAV_GATEWAY.md`.
36-
- IPIP in `ipfs/specs/IPIP/000N-webdav-gateway.md` would only include
37-
**Motivation** and explainer why certain design decisions were made at a
38-
certain point in time. Initial `IPIP/000N-webdav-gateway.md` would explain
39-
why we added WebDAV spec in the first place.
40-
- If we realize the spec has a bug, we will evaluate the impact: adding more
41-
details, test vectors, and editorials/cosmetics can be fixed without IPIP.
42-
- Things that could cause an interop issues require a PR with fix and IPIP in
43-
`ipfs/specs/IPIP/000M-webdav-fix-for-foo.md` explaining why we make the
44-
breaking spec change, compatibility/migration considerations etc.
45-
46-
### IPIP Lifecycle
47-
48-
Up-to-date process and IPIP lifecycle will be published in [`ipfs/specs/IPIP_PROCESS.md`](../IPIP_PROCESS.md).
49-
50-
<details>
51-
<summary>Click to expand the initial (historical) flow</summary>
52-
53-
### Opening an improvement proposal (IPIP)
54-
55-
Changes to IPFS specifications can be proposed by opening a Git pull-request
56-
(PR) against the `ipfs/specs` repository.
57-
58-
In addition to specification changes, such PR must include a short **IPIP
59-
document** based on the template in [`ipfs/specs/IPIP/0000-template.md`](./0000-template.md).
60-
61-
When a new specification file is added to the repo, it should be based on
62-
the template at [`ipfs/specs/template.md`](../template.md).
63-
64-
### Reviewing IPIPs
65-
66-
[Specs Stewards] will review new IPIP PRs during periodical (best-effort) triage.
67-
68-
IPFS Community is encouraged to participate in the review process.
69-
70-
IPIP can be either:
71-
- merged,
72-
- rejected (PR close without merging),
73-
- deferred (converting PR back to a draft).
74-
75-
The final decision belongs to [Specs Stewards].
76-
77-
### Merging IPIPs
78-
79-
PR with a IPIP can be merged only after two [Specs Stewards] approve it and
80-
there are no objections from other Stewards.
81-
82-
IPIP number is assigned before the PR merge.
83-
84-
IPIP author and two approving [Specs Stewards] are added to `CODEOWNERS` file
85-
to be automatically asked to review any future changes to files added or
86-
modified by the IPIP.
87-
88-
</details>
89-
90-
91-
### Long-term plan
92-
93-
[Specs Stewards] will adjust the process based on usage patterns.
94-
95-
## Design rationale
96-
97-
We want to empower IPFS community members and implementers with the ability to propose
98-
changes in a well-known way, without introducing much overhead.
99-
100-
Guiding principles:
101-
- No new tooling
102-
- Reuse Markdown, Git, and existing PR review process
103-
- Convention over Byzantine process
104-
- Proposing a new IPIP should have low cognitive overhead, allowing us to
105-
focus on specs
106-
- Reuse existing GitHub developer accounts and reputation attached to them
107-
- One should be able to create a valid IPIP without reading a long explainer
108-
like this one. Looking at past IPIPs, and then copying a template and
109-
opening a PR with the proposal should be more than enough.
110-
111-
### User benefit
112-
113-
End users will indirectly benefit from a healthy IPIP process being in place:
114-
115-
- IPFS community members will be able to use IPIP drafts for evaluating ideas
116-
before investing time into building new things.
117-
- The bar for creating a brand new IPFS implementation will be lowered, and
118-
existing implementations will be able to propose improvements for others to
119-
adopt. This removes the soft vendor lock-in present when the oldest
120-
implementation is considered as the reference standard and source of truth.
121-
- IPFS implementers will have a better understanding of why certain design
122-
decisions were made, and have both historical context and language-agnostic
123-
specifications with test fixtures ready for use in their project, ensuring
124-
a high level of interoperability.
125-
- More eyes looking at specifications will improve overall quality over time.
126-
127-
As a result, IPFS will become easier to implement, useful in more contexts,
128-
and benefit more people.
129-
130-
### Compatibility
131-
132-
Existing contents of [ipfs/specs][1] repository act as the initial state
133-
against which IPIP PRs can be opened.
134-
135-
### Security
136-
137-
Existing Git-based review infrastructure, user accounts and reputation
138-
system will be reused.
139-
140-
Merging IPIP will require approval from two [Specs Stewards].
141-
142-
### Alternatives
143-
144-
- Maintaining the status quo (no IPIP process) is not acceptable, as we want to
145-
move specification discussions away from repositories of specific
146-
implementations. We need a mechanism for discussing improvements that is not
147-
tied to specific implementation or language.
148-
- Creating more elaborate IPIP process. This comes with increased overhead and
149-
risk. Introducing a complex process requires deeper understanding of
150-
community needs and pitfalls of preexisting processes, and since we don't
151-
have any process in place, starting light, limits the risk.
152-
153-
### Copyright
154-
155-
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
156-
157-
[Specs Stewards]: https://github.com/orgs/ipfs/teams/specs-stewards/members
3+
Moved to https://specs.ipfs.tech/ipips/ipip-0001/
Lines changed: 1 addition & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,3 @@
11
# IPIP 0002: _redirects File Support on Web Gateways
22

3-
- Start Date: 2022-06-15
4-
- Related Issues:
5-
- [ipfs/specs/issues/257](https://github.com/ipfs/specs/issues/257)
6-
- [ipfs/kubo/pull/8890](https://github.com/ipfs/kubo/pull/8890)
7-
- [ipfs-docs/pull/1275](https://github.com/ipfs/ipfs-docs/pull/1275)
8-
9-
## Summary
10-
11-
Provide support for URL redirects and rewrites for web sites hosted on Subdomain or DNSLink Gateways, thus enabling support for [single-page applications (SPAs)](https://en.wikipedia.org/wiki/Single-page_application), and avoiding [link rot](https://en.wikipedia.org/wiki/Link_rot) when moving to IPFS-backed hosting.
12-
13-
## Motivation
14-
15-
Web sites often need to redirect from one URL to another, for example, to change the appearance of a URL, to change where content is located without breaking existing links (see [Cool URIs don't change](https://www.w3.org/Provider/Style/URI), [link rot](https://en.wikipedia.org/wiki/Link_rot)), to redirect invalid URLs to a pretty 404 page, or to enable URL rewriting.
16-
URL rewriting in particular is a critical feature for hosting SPAs, allowing routing logic to be handled by front end code. SPA support is the primary impetus for this RFC.
17-
18-
Currently the only way to handle URL redirects or rewrites is with additional software such as NGINX sitting in front of the Gateway. This software introduces operational complexity and decreases the uniformity of experience when navigating to content hosted on a Gateway, thus decreasing the value proposition of hosting web sites in IPFS.
19-
20-
This IPIP proposes the introduction of redirect support for content hosted on Subdomain or DNSLink Gateways, configured via a `_redirects` file residing underneath the root CID of the web site.
21-
22-
## Detailed design
23-
24-
Allow developers to configure redirect support by adding redirect rules to a file named `_redirects` stored underneath the root CID of their web site.
25-
The format for this file is similar to those of [Netlify](https://docs.netlify.com/routing/redirects/#syntax-for-the-redirects-file) and [Cloudflare Pages](https://developers.cloudflare.com/pages/platform/redirects) but only supporting a subset of their functionality.
26-
27-
The format for the file is `from to [status]`.
28-
29-
- `from` - specifies the path to intercept (can include placeholders and a trailing splat)
30-
- `to` - specifies the path or URL to redirect to (can include placeholders or splat matched in `from`)
31-
- `status` - optional [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) (301 if not specified)
32-
33-
Rules in the file are evaluated top to bottom.
34-
35-
For performance reasons this proposal does not include forced redirect support (i.e. redirect rules that are evaluated even if the `from` path exists). In other word, redirect logic will be evaluated if and only if the requested path does not exist. If the requested path exists, we won't even check for the existence of the `_redirects` file.
36-
37-
If a `_redirects` file exists but is unable to be processed, perhaps not even parsing correctly, errors will be returned to the user viewing the site via the Gateway.
38-
39-
The detailed specification is added in [`http-gateways/REDIRECTS_FILE.md`](../http-gateways/REDIRECTS_FILE.md).
40-
41-
### Test fixtures
42-
43-
`QmQyqMY5vUBSbSxyitJqthgwZunCQjDVtNd8ggVCxzuPQ4`
44-
45-
See spec for testing details.
46-
47-
## Design rationale
48-
49-
Popular services today such as [Netlify](https://docs.netlify.com/routing/redirects/#syntax-for-the-redirects-file) and [Cloudflare Pages](https://developers.cloudflare.com/pages/platform/redirects) allow developers to configure redirect support
50-
using a `_redirects` file hosted at the top level of the web site. While we do not intend to provide all of the same functionality, it seems desirable to use a similar approach to provide a meaningful subset of the functionality offered by these services.
51-
52-
- The format is simple and low on syntax
53-
- Many developers are already familiar with this file name and format
54-
- Using a text file for configuration enables developers to make changes without using other IPFS tools
55-
- The configuration can be easily versioned in both version control systems and IPFS by virtue of the resulting change to the root CID for the content
56-
57-
### User benefit
58-
59-
Provides general URL redirect and rewrite support, which enables three important features:
60-
1. Developers will be able to host single-page applications in IPFS.
61-
2. Same configuration file used for setting up pretty 404 pages.
62-
3. The cost of switching hosting of an existing website to IPFS is lowered by making it possible to keep all legacy URLs working.
63-
64-
### Compatibility
65-
66-
If by some chance developers are already hosting sites that contain a `_redirects` file that does something else, they may need to update the contents of the file to match the new functionality. Errors returned to the user due to parsing errors will guide them regarding the required updates.
67-
68-
### Alternatives
69-
70-
- There was some discussion early on about a [manifest file](https://github.com/ipfs/specs/issues/257) that could be used to configure redirect support in addition to many other things. While the idea of a manifest file has merit, manifest files are much larger in scope and it became challenging to reach agreement on functionality to include.
71-
There is already a large need for redirect support for SPAs, and this proposal allows us to provide that critical functionality without being hampered by further design discussion around manifest files.
72-
In addition, similar to how Netlify allows redirect support to be configured in either a `_redirects` file or a more general [configuration file](https://docs.netlify.com/configure-builds/file-based-configuration/#redirects), there is nothing precluding IPFS from allowing developers to configure redirect support in an app manifest later on.
73-
- There was some discussion with the [n0](https://github.com/n0-computer/) team about potential ways to improve the performance of retrieving metadata such as redirect rules, possibly including it as metadata with the root CID such that it would be included with the request for the CID to begin with.
74-
I believe the performance concerns are alleviated by not providing forced redirect support, and looking for `_redirects` only if the DAG is missing a requested path. Never the less, if a more generic metadata facility were to be introduced in the future, it may make sense to reconsider how redirect rules are specified.
75-
76-
### Copyright
77-
78-
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
3+
Moved to https://specs.ipfs.tech/ipips/ipip-0002/

0 commit comments

Comments
 (0)