diff --git a/Client/helper.js b/Client/helper.js deleted file mode 100644 index 5b4484f..0000000 --- a/Client/helper.js +++ /dev/null @@ -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, ' ')); -}; - diff --git a/Client/index.html b/Client/index.html index 6a292f9..48f46c0 100644 --- a/Client/index.html +++ b/Client/index.html @@ -179,7 +179,9 @@ function getUrlParameter(name) { <h3 x-text="name"></h3> <div class="interverse-connection-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'] !=''"> <div class='interverse-connection-preview' x-on:click="initialize(link)"> @@ -206,7 +208,9 @@ function getUrlParameter(name) { </div> <div id="interverse-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']"> <div x-on:click="initialize(connection)" class='interverse-connection-preview'> <h3 x-text="Alpine.store(connection)['name']"></h3> @@ -254,7 +258,7 @@ Alpine.store('data',data['main']) function initialize(url) { Alpine.store("data", {}); - fetchback("https://"+url+'/.well-known/interverse',function(data){ + fetchback("http://"+url.replace("https://",'').replace('http://','').replace('/','')+'/.well-known/interverse',function(data){ if (data['name']){ Alpine.store('data',data); } diff --git a/Docs/getting-started.md b/Docs/getting-started.md new file mode 100644 index 0000000..1115443 --- /dev/null +++ b/Docs/getting-started.md @@ -0,0 +1,32 @@ +# 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. + diff --git a/Docs/instance.md b/Docs/instance.md new file mode 100644 index 0000000..6194427 --- /dev/null +++ b/Docs/instance.md @@ -0,0 +1,17 @@ +# 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]() or for displaying previews of sites not serving the CORS header you'll want to setup \ No newline at end of file diff --git a/Docs/readme.md b/Docs/readme.md index 7f5c827..5b3762e 100644 --- a/Docs/readme.md +++ b/Docs/readme.md @@ -1,9 +1,6 @@ +# Interverse v0.1 ## 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. @@ -14,7 +11,8 @@ No breaking changes are anticipated * _Avoid leaving slashes `/` at the end_ -## Fields +## Fields: +--- ### version *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 \ No newline at end of file diff --git a/media/interverse.gif b/media/interverse.gif new file mode 100644 index 0000000..e32fb7a Binary files /dev/null and b/media/interverse.gif differ diff --git a/media/interverse.mp4 b/media/interverse.mp4 new file mode 100644 index 0000000..2e55e17 Binary files /dev/null and b/media/interverse.mp4 differ diff --git a/readme.md b/readme.md index 9df23a0..f9a78ab 100644 --- a/readme.md +++ b/readme.md @@ -1,9 +1,8 @@ # 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) @@ -11,35 +10,29 @@ * Scalable * Extensible + + +[Try it out!](https://libresolutions.network/interverse) + +[Demo video](https://libresolutions.network/videos/interverse-demo-1/) + ### Protocol neutrality Clients should be able to easily be ported to TOR/Gemini/IPFS/ect ### Can I join? -You don't need my permission! +You don't need permission! 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) -2) [Check out the docs](Docs/readme.md) -3) Modify it with your data -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 +Check out [getting started](Docs/getting-started.md). -### How do I run the client myself? -1) `git clone https://codeberg.org/gabe/Interverse.git` -2) `cd Interverse/Client` -3) `python -m http.server` -4) Hack away! -### Can I create my own client? -Please do! +### Can I create my own client/Server? +**Please do!** -If you need any help getting started feel free to get in touch with me by e-mailing gabriel@libresolutions.network +If you need any help getting started feel free to get in touch at gabriel@libresolutions.network --- - -Compatible with [Discover](https://codeberg.org/onasaft/Discover) +Now Compatible with [Discover](https://codeberg.org/onasaft/Discover)!