Compare commits

..

10 commits

Author SHA1 Message Date
a7620d9d35 wording and links 2022-10-12 06:27:56 -04:00
35d9611fdd fixing link 2022-10-12 06:22:14 -04:00
0adb7561d9 typo 2022-10-12 06:21:26 -04:00
559ad1fecb client docs 2022-10-12 06:20:03 -04:00
521619df38 Client docs 2022-10-12 06:20:00 -04:00
4f512480ea Server docs 2022-10-12 06:15:39 -04:00
8a121f00a4 server docs 2022-10-12 06:15:30 -04:00
50b1fa78f6 documentation + links optimization 2022-10-12 06:02:00 -04:00
a16c9c87e6 https 2022-10-12 05:07:34 -04:00
2b85654732 missing intended effect 2022-10-12 04:56:26 -04:00
15 changed files with 117 additions and 67 deletions

View file

@ -17,12 +17,7 @@
"description": "" "description": ""
} }
], ],
"Interverse Info": [{ "Interverse Info": [
"label": "An introduction to Interverse",
"icon": "",
"location": "https://libresolutions.network/articles/7-interverse.html",
"description": ""
},
{ {
"label": "Demo video", "label": "Demo video",
"icon": "", "icon": "",
@ -45,7 +40,6 @@
], ],
"Known Interverse": [ "Known Interverse": [
"https://jamespearson.xyz", "https://jamespearson.xyz",
"https://tomfasano.net",
"https://retroedge.tech" "https://retroedge.tech"
] ]

View file

@ -1,23 +0,0 @@
function fetchback(url,cback){
fetch(url).then((request)=>request.json()).then((data)=>cback(data));
}
function interverse_data(url,cback){
url = interverse_proxy+"/initial?url="+url
fetch(url).then((response)=> {
if (!response.ok){
return {}
}
return response.json();
}).then((data)=>cback(data))
}
// https://davidwalsh.name/query-string-javascript
function getUrlParameter(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
};

View file

@ -179,7 +179,9 @@ function getUrlParameter(name) {
<h3 x-text="name"></h3> <h3 x-text="name"></h3>
<div class="interverse-connection-group"> <div class="interverse-connection-group">
<template x-for="link in group"> <template x-for="link in group">
<div class="interverse-connection" x-data="{connected:false"> <div class="interverse-connection" x-init="fetchback(link+'/.well-known/interverse',function(data){
Alpine.store(data['location'],data);
});">
<template x-if="Alpine.store(link)['name'] !=''"> <template x-if="Alpine.store(link)['name'] !=''">
<div class='interverse-connection-preview' <div class='interverse-connection-preview'
x-on:click="initialize(link)"> x-on:click="initialize(link)">
@ -206,7 +208,9 @@ function getUrlParameter(name) {
</div> </div>
<div id="interverse-connections"> <div id="interverse-connections">
<template x-for="connection in Alpine.store('data')['connections']"> <template x-for="connection in Alpine.store('data')['connections']">
<div class="interverse-connection"> <div class="interverse-connection" x-init="fetchback(connection+'/.well-known/interverse',function(data){
Alpine.store(data['location'],data);
});">
<template x-if="Alpine.store(connection)['name']"> <template x-if="Alpine.store(connection)['name']">
<div x-on:click="initialize(connection)" class='interverse-connection-preview'> <div x-on:click="initialize(connection)" class='interverse-connection-preview'>
<h3 x-text="Alpine.store(connection)['name']"></h3> <h3 x-text="Alpine.store(connection)['name']"></h3>
@ -254,15 +258,10 @@ Alpine.store('data',data['main'])
function initialize(url) { function initialize(url) {
Alpine.store("data", {}); Alpine.store("data", {});
fetchback(url+'/.well-known/interverse',function(data){ fetchback("http://"+url.replace("https://",'').replace('http://','').replace('/','')+'/.well-known/interverse',function(data){
if (data['name']){ if (data['name']){
Alpine.store('data',data); Alpine.store('data',data);
} }
for(c in data['connections']){
fetchback(data['connections'][c]['location']+'/.well-known/interverse',function(data){
Alpine.store[data['location'],data]
});
}
}); });
interverse_data(url.replace("https://",'').replace('http://','').replace('/',''), function (data) { interverse_data(url.replace("https://",'').replace('http://','').replace('/',''), function (data) {
console.log("Initializing interverse...") console.log("Initializing interverse...")

4
Client/readme.md Normal file
View file

@ -0,0 +1,4 @@
# Client
You can simply serve the client with `python -m http.sever` in this folder.

33
Docs/getting-started.md Normal file
View file

@ -0,0 +1,33 @@
# Getting started
## Create your interverse file
This file is essentially your 'listing'.
1. Grab the [example file](../interverse-example.json) or modify the [Libre Solutions Network](https://libresolutions.network/.well-known/interverse) one.
2. Make your changes, feel free to reference the [format](readme.md)
3. Ensure that the file is formatted as valid [JSON](https://www.json.org/json-en.html).
Any errors will fail completely.
## Getting online
### Option A (ideal)
* You must serve valid JSON from `/.well-known/interverse`
* The header `access-control-allow-origin *` must also be [added](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).
### Option B (simple)
* Serve valid JSON from either:
* `/.well-known/interverse`
* `/interverse.json`
Omitting the CORS header means that the client needs to ask a server to load the data, this can have performance impacts.
## How do I see my listing?
Interverse is a fully-decentralized system. You can [setup your instance]() or preview yourself at `https://libresolutions.network/interverse?url={your.domain}`.
*Note: libresolutions.network uses a fairly long cache value when no results are returned.*
If you want to see your changes reflected immediately, consider adding the CORS header.
You can also run your own [instance](instance.md)

20
Docs/instance.md Normal file
View file

@ -0,0 +1,20 @@
# Running your own instance
The reference instance is running at [libresolutions.network](https://libresolutions.network/interverse)
If all your connections are adding the [CORS header](getting-started.md) all you need is to serve the content of [Client/index.html](../Client/index.html) from your page.
That file is written so that it can be easily pasted into an existing page, or used as a hugo shortcode.
Known instances:
* [jamespearson.xyz](https://jamespearson.xyz/interverse/)
## interverse-proxy
For compatibility with [Discover](https://codeberg.org/onasaft/Discover) or for displaying previews of sites not serving the CORS header you'll want to setup the [server](../Server/)
### Can I create my own client/Server?
**Please do!**

View file

@ -1,9 +1,6 @@
# Interverse v0.1
## Requirements ## Requirements
* You must serve valid JSON from `/.well-known/interverse`
* The header `access-control-allow-origin *` must also be [added](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).
# Interverse v0.1
Interverse is currently an open alpha. Interverse is currently an open alpha.
@ -14,7 +11,8 @@ No breaking changes are anticipated
* _Avoid leaving slashes `/` at the end_ * _Avoid leaving slashes `/` at the end_
## Fields ## Fields:
---
### version ### version
*float* *float*
@ -105,4 +103,12 @@ Any contact information you wish to share.
--- ---
### onion
*a Tor onion address*
You can add your sites onion address.
---
If you have any questions don't hesitate to e-mail gabriel@libresolutions.network If you have any questions don't hesitate to e-mail gabriel@libresolutions.network

26
Server/readme.md Normal file
View file

@ -0,0 +1,26 @@
# Interverse-proxy
A very simple flask server that caches interverse requests
## Endpoints:
Both require an `url` parameter
`example.com` for example
`/inital`
Returns the data from a specified site.
Searches the following locations:
* `/.well-known/interverse`
* `/interverse.json`
* `/.well-known/discover.json` (for [Discover](https://codeberg.org/onasaft/Discover) compatibility)
Has to change `preview_connections` into `connection_groups`
`/complete`
Returns initial in the `main` object then connection data in the `connections` object
## Running
The server can be run with [uwsgi](https://uwsgi-docs.readthedocs.io/en/latest/) with `start.sh`

View file

@ -20,7 +20,7 @@
"Interverse Info": [{ "Interverse Info": [{
"label": "An introduction to Interverse", "label": "An introduction to Interverse",
"icon": "", "icon": "",
"location": "https://libresolutions.network/articles/7-interverse.html", "location": "hhttps://libresolutions.network/videos/interverse-demo-1/",
"description": "" "description": ""
}, },
{ {

BIN
media/interverse.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

BIN
media/interverse.mp4 Normal file

Binary file not shown.

View file

@ -1,9 +1,8 @@
# Interverse # Interverse
[Try it out!](https://libresolutions.network/interverse)
[Demo video](https://libresolutions.network/videos/interverse-demo-1/)
## A decentralized discovery service that allows you to easily discover like-minded sites. ## A decentralized discovery service that allows you to easily discover sites and services.
* No complicated software to run (beyond an existing website) * No complicated software to run (beyond an existing website)
@ -11,35 +10,27 @@
* Scalable * Scalable
* Extensible * Extensible
![](media/interverse.gif)
[Try it out!](https://libresolutions.network/interverse)
[Demo video](https://libresolutions.network/videos/interverse-demo-1/)
### Protocol neutrality ### Protocol neutrality
Clients should be able to easily be ported to TOR/Gemini/IPFS/ect Clients should be able to easily be ported to TOR/Gemini/IPFS/ect
### Can I join? ### Can I join?
You don't need my permission! You don't need permission!
Simply follow these steps and you're online! Simply follow these steps and you're online!
1) Grab the [example file](https://codeberg.org/gabe/Interverse/src/branch/main/interverse-example.json) or you can grab the one from [the Libre Solutions Network](https://libresolutions.network/.well-known/interverse) 1. Check out [getting started](Docs/getting-started.md) to create your listing
2) [Check out the docs](Docs/readme.md) 2. You can also throw the [web client](Client/) on your webserver
3) Modify it with your data 3. If your connections require it the [interverse-proxy](Server/) is a useful fallback
4) Serve that file from **your.website/.well-known/interverse**
5) Ensure that the webserver also adds the correct header: `access-control-allow-origin *`
6) Feel free to test your setup by visiting:
https://libresolutions.network/Interverse?url=your.website
### How do I run the client myself?
1) `git clone https://codeberg.org/gabe/Interverse.git` If you need any help getting started feel free to get in touch at gabriel@libresolutions.network!
2) `cd Interverse/Client`
3) `python -m http.server`
4) Hack away!
### Can I create my own client?
Please do!
If you need any help getting started feel free to get in touch with me by e-mailing gabriel@libresolutions.network
--- ---
Now Compatible with [Discover](https://codeberg.org/onasaft/Discover)!
Compatible with [Discover](https://codeberg.org/onasaft/Discover)