Compare commits

..

2 Commits
main ... main

Author SHA1 Message Date
Santiago Forero 2c9f80da37 Merge branch 'main' into main 2021-09-02 12:29:47 +00:00
Santiago Forero 9f1b3672c8 add tutorial 2021-09-02 07:27:33 -05:00
22 changed files with 94 additions and 245 deletions

3
.gitignore vendored
View File

@ -1,5 +1,2 @@
.env*
.bundle/
vendor/bundle/
.jekyll-cache/
_site/

View File

@ -1,3 +1,5 @@
source 'https://rubygems.org'
gem 'jekyll'
gem "webrick", "~> 1.7"

View File

@ -5,16 +5,16 @@ GEM
public_suffix (>= 2.0.2, < 5.0)
colorator (1.1.0)
concurrent-ruby (1.1.9)
em-websocket (0.5.3)
em-websocket (0.5.2)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
http_parser.rb (~> 0.6.0)
eventmachine (1.2.7)
ffi (1.15.4)
forwardable-extended (2.6.0)
http_parser.rb (0.8.0)
i18n (1.8.11)
http_parser.rb (0.6.0)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
jekyll (4.2.1)
jekyll (4.2.0)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
@ -49,19 +49,21 @@ GEM
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (3.26.1)
rouge (3.26.0)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.8.0)
unicode-display_width (1.7.0)
webrick (1.7.0)
PLATFORMS
x86_64-darwin-17
ruby
DEPENDENCIES
jekyll
webrick (~> 1.7)
BUNDLED WITH
2.2.24
2.2.26

View File

@ -1,13 +1,8 @@
name: neotilde.tel
name: tel.tilde.org.nz
description: neo-tildetel - a PBX for the tildeverse
url: https://neotilde.tel
url: https://tel.tilde.org.nz
baseurl: ''
smolcaptcha_url: "https://httpbin.org/status/418"
smolcaptcha_client: ""
register_hook: "https://httpbin.org/status/418"
register_hook_secret: ""
kramdown:
smart_quotes: apos,apos,quot,quot
typographic_symbols:

View File

@ -63,9 +63,6 @@ community:
- tilde: tilde.team
ext: 2013116
name: xfnw
- tilde: tilde.team
ext: 2013121
name: kayw
- tilde: tilde.team
ext: 2013123
name: rawktucc
@ -75,18 +72,12 @@ community:
- tilde: tilde.team
ext: 2013125
name: forero
- tilde: tilde.team
ext: 2013126
name: r1k
- tilde: cosmic.voyage
ext: 2023101
name: tomasino
- tilde: tilde.institute
ext: 2033110
name: O4dco
- tilde: tilde.institute
ext: 2033130
name: rnelson
- tilde: thunix.net
ext: 2043110
name: Loki
@ -105,18 +96,12 @@ community:
- tilde: tilde.town
ext: 2063110
name: login
- tilde: tilde.town
ext: 2063120
name: kat
- tilde: tilde.club
ext: 2123103
name: deepend
- tilde: tilde.club
ext: 2123106
name: alex11
- tilde: tilde.club
ext: 2123120
name: dokoissho
- tilde: tilde.org.nz
ext: 2163101
name: darcy

View File

@ -1,8 +1,8 @@
<nav class="main-nav">
<ul class="inline-list">
<li><a href="{{ site.baseurl }}/">☎️ <strong>{{ site.name }}</strong></a></li>
<li><a href="{{ site.baseurl }}/"><strong>{{ site.name }}</strong></a></li>
<li><a href="{{ site.baseurl }}/phonebook/">phonebook</a></li>
<li><a href="{{ site.baseurl }}/the-original/">the original</a></li>
<li><a href="https://tel.tilde.org.nz/register/">request account</a></li>
<li><a href="{{ site.baseurl }}/tutorial/">tutorial</a></li>
</ul>
</nav>

View File

@ -1,12 +1,9 @@
{%- if page.php_session -%}<?php
session_name("neotildetel");
session_start();
?>{%- endif -%}<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% if page.title %}{{ page.title }} &raquo; {% endif %}{{ site.name }}</title>
<title>{% if page.title %}{{ page.title }} &raquo; {% endif %}tel.tilde.org.nz</title>
<link rel="stylesheet" href="{{ site.baseurl }}/styles.css">
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2280%22>☎️</text></svg>">
</head>

View File

@ -1,32 +0,0 @@
.form
{
width: 100%;
margin: 0 0 1rem 0;
}
.form input:not([type = "checkbox"]),
.form select,
.form button,
.form textarea
{
display: block;
width: 100%;
padding: 0.25rem;
margin-bottom: 0.5rem;
border: 1px solid #000;
border-radius: 3px;
}
.form-captcha
{
margin: 1rem 0;
padding: 1rem;
border: 1px solid #000;
border-radius: 3px;
.form-captcha-img
{
display: block;
margin: 1rem 0;
}
}

View File

@ -1,5 +1,10 @@
.index-container
{
height: 100%;
min-height: 100vh;
width: 100%;
max-width: 100vw;
display: flex;
flex-flow: column wrap;
align-items: center;
@ -13,3 +18,8 @@
padding: 0;
}
}
img {
max-width: 80%;
display: block;
}

View File

@ -18,11 +18,3 @@
}
}
}
.banner
{
width: 100%;
padding: 0.5rem 1rem;
border: 1px solid #000;
border-radius: 3px;
}

BIN
img/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
img/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
img/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
img/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -2,12 +2,12 @@
layout: base
---
<main class="container index-container">
<main class="index-container">
<h1>☎️ {{ site.name }} ☎️</h1>
<ul class="inline-list">
<li><a href="/phonebook/">phonebook</a></li>
<li><a href="/the-original/">the original</a></li>
<li><a href="https://tel.tilde.org.nz/register/">request account</a></li>
<li><a href="/tutorial/">tutorial</a></li>
</ul>
</main>

View File

@ -27,10 +27,13 @@ title: phonebook
<h2>The community</h2>
<p>
Want a <code>neotilde.tel</code> number?
<a href="https://neotilde.tel/register/">
Click here for the registration form!
</a>
To get a <code>tel.tilde.org.nz</code> number, please message <code>darcy</code>
in <code>#tildetel</code> on <a href="https://tilde.chat">the tilde.chat IRC</a>.
</p>
<p>
If you had a <code>tilde.tel</code> number, in most cases, you can use that number
on <code>tel.tilde.org.nz</code>! Just let <code>darcy</code> know when asking for
an account.
</p>
<table>
@ -59,7 +62,7 @@ title: phonebook
<h2>PSTN dial-in</h2>
<p>
You can dial in to a <code>neotilde.tel</code> number from the PSTN
You can dial in to a <code>tel.tilde.org.nz</code> number from the PSTN
by calling one of these numbers, then entering an extension.
</p>
<p>

View File

@ -1,12 +0,0 @@
---
layout: page
title: register for neotilde.tel
---
Registrations for `neotilde.tel`
are currently unavailable.
Please check back later,
or ask in `#tildetel`
on [tilde.chat](https://tilde.chat)
for more details.

View File

@ -1,111 +0,0 @@
---
layout: page
title: register for neotilde.tel
php_session: true
---
<?php
function exit_with_banner(?string $message) {
unset($_SESSION['captcha']);
echo '<div class="banner">';
if (!is_null($message)) {
echo "An error occurred: {$message}";
} else {
echo "An unknown error occurred.";
}
echo '</div>';
exit;
}
function verify_captcha(string $result): bool {
$ch = curl_init("{{ site.smolcaptcha_url }}/api/verify");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
"client" => "{{ site.smolcaptcha_client }}",
"captcha" => $_SESSION['captcha'],
"result" => $result,
]);
$resp = curl_exec($ch);
curl_close($ch);
return ($resp !== null && trim($resp) === "ok");
}
if (!array_key_exists("captcha", $_SESSION) || is_null($_SESSION['captcha'])) {
$ch = curl_init("{{ site.smolcaptcha_url }}/api/generate");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
"client" => "{{ site.smolcaptcha_client }}",
]);
$resp = curl_exec($ch);
curl_close($ch);
if ($resp === false) exit_with_banner("CAPTCHA request failed, please alert darcy in <code>#tildetel</code>");
$_SESSION['captcha'] = $resp;
}
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$form_user = array_key_exists('user', $_POST) ? trim($_POST['user']) : null;
$form_tilde = array_key_exists('tilde', $_POST) ? trim($_POST['tilde']) : null;
$form_msg = array_key_exists('msg', $_POST) ? trim($_POST['msg']) : "(no message)";
if ($form_user === null || $form_user === "" || $form_tilde === null || $form_tilde === "") {
exit_with_banner("A required field was not provided.");
}
$captcha = array_key_exists('captcha', $_POST) ? trim($_POST['captcha']) : "";
if (!verify_captcha($captcha)) {
exit_with_banner("CAPTCHA verification failed");
}
$ch = curl_init("{{ site.register_hook }}");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
"secret" => "{{ site.register_hook_secret }}",
"user" => $form_user,
"tilde" => $form_tilde,
"msg" => $form_msg,
]);
$resp = curl_exec($ch);
curl_close($ch);
unset($_SESSION['captcha']);
if (!$resp) {
exit_with_banner("Couldn't submit registration request, please try again");
} else {
echo '<div class="banner">Your registration request was submitted successfully!</div>';
}
} else {
?>
<p>If you had an account on the old <code>tilde.tel</code>, please include your previous number in the message field.</p>
<form method="POST" class="form">
<label for="reg_user">Username:</label>
<input id="reg_user" name="user" type="text" placeholder="Username">
<label for="reg_tilde">Tilde / Pubnix:</label>
<input id="reg_tilde" name="tilde" type="text" placeholder="Tilde / Pubnix">
<label for="reg_msg">Message (optional):</label>
<textarea id="reg_msg" name="msg"></textarea>
<div class="form-captcha">
<label for="reg_captcha">What is the answer to the below equation?</label>
<img class="form-captcha-img" src="{{ site.smolcaptcha_url }}/render/<?php echo $_SESSION['captcha'] ?>">
<input id="reg_captcha" name="captcha" type="text" placeholder="Your answer">
</div>
<button class="button" type="submit">
Submit registration request
</button>
</form>
<?php } ?>

View File

@ -1,27 +0,0 @@
{ pkgs ? import <nixpkgs> {}, lib ? pkgs.lib }:
with lib;
let
neededLibraries = with pkgs; [
curl
libxml2
libxslt
];
in
pkgs.mkShell {
buildInputs = with pkgs; [
ruby
bundler
pkg-config
shared-mime-info
cacert
] ++ neededLibraries;
"LD_LIBRARY_PATH" = makeLibraryPath neededLibraries;
"SSL_CERT_DIR" = "${pkgs.cacert}/etc/ssl/certs";
"SSL_CERT_FILE" = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
"FREEDESKTOP_MIME_TYPES_PATH" = "${pkgs.shared-mime-info}/share/mime/packages/freedesktop.org.xml";
}

View File

@ -16,9 +16,6 @@ body
max-width: 100vw;
width: auto;
display: flex;
flex-direction: column;
margin: 0;
padding: 0;
@ -38,9 +35,10 @@ a
.container
{
height: 100%;
min-height: 100vh;
width: 100%;
max-width: 100vw;
flex: 1;
padding: 1rem;
}
@ -48,6 +46,5 @@ a
@import 'nav';
@import 'footer';
@import 'table';
@import 'form';
@import 'utils';
@import 'index';

View File

@ -25,7 +25,7 @@ title: what happened to tilde.tel?
<p>
If you had a <code>tilde.tel</code> account, you can request an account on
<code>neotilde.tel</code> with the same phone number (all previous ~tel
<code>tel.tilde.org.nz</code> with the same phone number (all previous ~tel
numbers have been reserved), just mention your old ~tel number(s) - or your
tilde and username if you don't remember your number - to have an account
created for you.
@ -33,7 +33,7 @@ title: what happened to tilde.tel?
<p>
cat has (very kindly) handed over control of the <code>#tildetel</code> IRC
channel, so that's the place for <code>neotilde.tel</code> support (and
channel, so that's the place for <code>tel.tilde.org.nz</code> support (and
general chat about telephony and such!)
</p>
</section>

51
tutorial/index.html Normal file
View File

@ -0,0 +1,51 @@
---
layout: page
title: tutorial
---
<h2>What is this?</h2>
tel.tilde.org.nz also known as tildetel is a small PSTN (Public switched telephone network) for the <a href="https://tildeverse.org/">tildeverse</a>. The users can make calls, leave voice mails and participate in a multi-user conference rooms. The numbers are broken down by "area codes", each tilde has its own area code! A phonebook can be found <a href="https://tel.tilde.org.nz/phonebook/">here</a> (:
<h2>How do I get a number?</h2>
To get a <code>tel.tilde.org.nz</code> number, please message <code>darcy</code> in <code>#tildetel</code> on <a href="https://tilde.chat">the tilde.chat IRC</a>.
<h4>SIP</h4>
SIP (Session Initiation Protocol) is a protocol used in VoIP, allowing users to make voice and video calls.
<h2>How do I use this?</h2>
<p>First you are going to need a SIP account (which you get when you get a number) and your credentials that look like this:</p>
<ul>
<li><b>SIP address:</b> 2013125@tel.tilde.org.nz</li>
<li><b>Password:</b>reallysecurepassword</li>
</ul>
<p>Once you get a SIP account you need a SIP client to use it, there are many out there but we suggest these ones:</p>
<ul>
<li><a href="https://www.linphone.org/">Linphone</a></li>
<li><a href="https://www.microsip.org/">Microsip</a> (windows only but works with wine on linux)</li>
</ul>
<p>Now that you have a SIP account and a SIP client we are ready to get started. This step by step guide uses the Linphone client</p>
<ol>
<li>
When you open Linphone for the first time you'll get something like this:
<img src="../img/1.png" alt="1" srcset="">
</li>
<li>
Click on <b>Use a SIP account</b> and fill the fields with your credentials:
<img src="../img/2.png" alt="2">
</li>
<li>
Click on the top left corner and select tel.tilde.org.nz:
<img src="../img/3.png" alt="3">
</li>
<li>
Done! You are now connected and succesfully set up your client, to make a call just search their number on the top search bar:
<img src="../img/4.png" alt="4">
</li>
</ol>
Thanks for reading this tutorial, I hope you found it useful, if you have any questions join <code>#tildetel</code> on <a href="tilde.chat/">tilde.chat</a> and let us know.