Commit 1b01c63d authored by Michał "rysiek" Woźniak's avatar Michał "rysiek" Woźniak 🔒
Browse files

nomenclature cleanup (gun+ipfs -> gun-ipfs)

parent fd51b541
Pipeline #46528 failed with stage
in 10 minutes and 52 seconds
......@@ -65,7 +65,7 @@ The data provided (per each requested URL handled by the ServiceWorker) is:
- `url` – the URL of the request
- `serviceWorker` – the commit SHA of the ServiceWorker that handled the request
- `fetchError` – `null` if the request completed successfully via regular HTTPS; otherwise the error message
- `method` – the method by which the request was completed: "`fetch`" is regular HTTPS `fetch()`, `gun+ipfs` means Gun and IPFS were used, etc.
- `method` – the method by which the request was completed: "`fetch`" is regular HTTPS `fetch()`, `gun-ipns` means Gun and IPFS were used, etc.
- `state` – the state of the request (`running`, `error`, `success`)
The code in the browser window context is responsible for keeping a more permanent record of the URLs requested, the methods used, and the status of each, if needed.
......
......@@ -12,7 +12,7 @@ self.SamizdatConfig.plugins["gateway-ipns"] = {
// the pubkey of the preconfigured IPNS node
ipnsPubkey: 'QmYGVgGGfD5N4Xcc78CcMJ99dKcH6K6myhd4Uenv5yJwiJ'
}
self.SamizdatConfig.plugins["gun+ipfs"] = {
self.SamizdatConfig.plugins["gun-ipns"] = {
// the pubkey of the preconfigured Gun user
gunPubkey: 'WUK5ylwqqgUorceQRa84qfbBFhk7eNRDUoPbGK05SyE.-yohFhTzWPpDT-UDMuKGgemOUrw_cMMYWpy6plILqrg'
}
......
......@@ -51,7 +51,7 @@ Whenever a resource is being fetched on a Samizdat-enabled site, the `service-wo
1. `fetch`, to use the upstream site directly if it is available,
1. `cache`, to display the site immediately from the cache in case regular `fetch` fails,
1. `gun+ipfs`, in the background if `cache` call succeeded, otherwise as the active fetch handler.
1. `gun-ipns`, in the background if `cache` call succeeded, otherwise as the active fetch handler.
If a background plugin `fetch()` succeeds, the result is added to the cache and will be immediately available on page reload.
......
......@@ -5,7 +5,7 @@
Samizdat deployment is currently mostly a manual process. It involves:
1. getting the code
1. creating a [Gun](https://gun.eco/) account to push content addresses to
1. replacing the Gun account public key in the `gun+ipfs` plugin code
1. replacing the Gun account public key in the `gun-ipns` plugin code
1. deploying the code to your server
This is highly suboptimal; work is being done to design and implement a process that is more user-friendly and automated. In the meantime, you can deploy Samizdat by following these steps.
......
......@@ -149,7 +149,7 @@ When a request is made, plugins are used to handle it in the order defined in co
1. retrieval from local `cache`;
1. any other transport plugins (`IPFS`, or fetching content from other pre-configured endpoints).
It is up to the website admin's to configure the plugins in a way that makes sense. For example, if using the [`gun+ipfs`](./../plugins/gun-ipfs.js) plugin, the admin needs to create a Gun account and populate the plugin's Gun public key variable. If using `IPNS`, the admin needs to populate the `IPNS` public key in the respective plugin. And if alternative HTTPS endpoints are used, it's up to the admin to populate their URLs.
It is up to the website admin's to configure the plugins in a way that makes sense. For example, if using the [`gun-ipns`](./../plugins/gun-ipfs.js) plugin, the admin needs to create a Gun account and populate the plugin's Gun public key variable. If using `IPNS`, the admin needs to populate the `IPNS` public key in the respective plugin. And if alternative HTTPS endpoints are used, it's up to the admin to populate their URLs.
Examples of possible alternative HTTPS locations:
- an IP address or a domain controlled by the admin that is not linked to the original website and thus can be expected not to be blocked;
......@@ -161,7 +161,7 @@ Examples of possible alternative HTTPS locations:
For content to be available for retrieval by transport plugins, it first needs to be published to whatever locations it is going to be retrieved from.
For the `gun+ipfs` plugin, for instance, content needs to first be published in IPFS, and then the IPFS addresses for each file need to be published to Gun. Currently it is an involved process (example is available in the [CI/CD configuration for the project](./../.gitlab-ci.yml)); making it simpler and easier is the focus of current development.
For the `gun-ipns` plugin, for instance, content needs to first be published in IPFS, and then the IPFS addresses for each file need to be published to Gun. Currently it is an involved process (example is available in the [CI/CD configuration for the project](./../.gitlab-ci.yml)); making it simpler and easier is the focus of current development.
For plugins relying on fetching content from alternative HTTPS locations, this can be as simple as deploying the content to the alternative IP address or domain name, pushing the content to WebArchive, putting the content in the Google Drive folder, or uploading it to the CloudFront location.
......
......@@ -40,7 +40,7 @@
<p>The list below contains all resources fetched in relation to this page.</p>
<ul class="samizdat-fetched-resources-list"></ul>
<p class="samizdat-fetched-resources-list-empty">The list is empty, but if the ServiceWorker is running it should be populated soon.</p>
<p class="samizdat-fetched-resources-controls"><button type="button" onclick="samizdat.toggleResourceCheckboxes()">Toggle selection</button><span class="spacer"></span><button type="button" onclick="samizdat.stashOrUnstashResources(true)">Add selected to cache</button><button type="button" onclick="samizdat.stashOrUnstashResources(false)">Clear selected from cache</button><span class="spacer"></span><input type="text" placeholder="Gun username" id="samizdat-gun-user"/><input type="password" placeholder="Gun password" id="samizdat-gun-password"/><button type="button" onclick="samizdat.publishResourcesToGunAndIPFS()">Publish to Gun+IPFS</button></p>
<p class="samizdat-fetched-resources-controls"><button type="button" onclick="samizdat.toggleResourceCheckboxes()">Toggle selection</button><span class="spacer"></span><button type="button" onclick="samizdat.stashOrUnstashResources(true)">Add selected to cache</button><button type="button" onclick="samizdat.stashOrUnstashResources(false)">Clear selected from cache</button><span class="spacer"></span><input type="text" placeholder="Gun username" id="samizdat-gun-user"/><input type="password" placeholder="Gun password" id="samizdat-gun-password"/><button type="button" onclick="samizdat.publishResourcesToGunAndIPFS()">Publish to Gun and IPFS</button></p>
</div>
<p id="footer">ServiceWorker: <span class="samizdat-commit-service-worker">NO_INFO</span>&nbsp;::&nbsp;index.html: <span class="samizdat-commit-index-html">COMMIT_UNKNOWN</span><br/>code: <span id="samizdat-code"><a href="https://0xacab.org/rysiek/samizdat/">here</a></span>&nbsp;::&nbsp;news: <span id="samizdat-news"><a href="https://mastodon.social/tags/Samizdat">on Fediverse</a></span>&nbsp;::&nbsp;license: <span id="samizdat-license"><a href="https://0xacab.org/rysiek/samizdat/blob/master/LICENSE">AGPL</a></span><br/><span id="samizdat-code-of-conduct"><a href="https://0xacab.org/rysiek/samizdat/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a></span></p>
</body>
......
......@@ -27,7 +27,7 @@
}
// merge the defaults with settings from SamizdatConfig
let config = {...defaultConfig, ...self.SamizdatConfig.plugins["gun+ipfs"]}
let config = {...defaultConfig, ...self.SamizdatConfig.plugins["gun-ipns"]}
// reality check: Gun pubkey needs to be set to a non-empty string
if (typeof(config.gunPubkey) !== "string" || config.gunPubkey === "") {
......@@ -211,7 +211,7 @@
'headers': {
'Content-Type': contentType,
'ETag': file.value.path,
'X-Samizdat-Method': 'gun+ipfs',
'X-Samizdat-Method': 'gun-ipns',
'X-Samizdat-ETag': file.value.path
}
}
......@@ -449,7 +449,7 @@
// and add ourselves to it
// with some additional metadata
self.SamizdatPlugins.push({
name: 'gun+ipfs',
name: 'gun-ipns',
description: 'Decentralized resource fetching using Gun for address resolution and IPFS for content delivery.',
version: 'COMMIT_UNKNOWN',
fetch: getContentFromGunAndIPFS,
......
......@@ -168,7 +168,7 @@
'headers': {
'Content-Type': contentType,
'ETag': file.value.path,
'X-Samizdat-Method': 'gun+ipfs',
'X-Samizdat-Method': 'gun-ipns',
'X-Samizdat-ETag': file.value.path
}
}
......
......@@ -406,7 +406,7 @@ samizdat.stashOrUnstashResources = (stash=true) => {
/**
* publishing certain resources to Gun+IPFS
* publishing certain resources to Gun and IPFS
*/
samizdat.publishResourcesToGunAndIPFS = () => {
var user = document.getElementById('samizdat-gun-user').value
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment