got followers

This commit is contained in:
lesion
2019-07-29 22:40:27 +02:00
parent 64beb39baa
commit c9780ad565
31 changed files with 334 additions and 373 deletions

View File

@@ -30,7 +30,7 @@ html, body {
} }
#admin.el-card { #admin.el-card {
max-width: 850px; max-width: 870px;
} }
.el-dialog { .el-dialog {

View File

@@ -13,7 +13,7 @@ gem "jekyll", "~> 3.8.6"
# This is the default theme for new Jekyll sites. You may change this to anything you like. # This is the default theme for new Jekyll sites. You may change this to anything you like.
#gem "minima", "~> 2.0" #gem "minima", "~> 2.0"
gem "just-the-docs" gem "just-the-docs"
gem "jemoji" gem "mini_magick"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and # If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`. # uncomment the line below. To upgrade, run `bundle update github-pages`.
@@ -22,6 +22,7 @@ gem "jemoji"
# If you have any plugins, put them here! # If you have any plugins, put them here!
group :jekyll_plugins do group :jekyll_plugins do
gem "jekyll-feed", "~> 0.6" gem "jekyll-feed", "~> 0.6"
gem "jemoji"
end end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem # Windows does not include zoneinfo files, so bundle the tzinfo-data gem

View File

@@ -59,6 +59,7 @@ GEM
rb-inotify (~> 0.9, >= 0.9.7) rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2) ruby_dep (~> 1.2)
mercenary (0.3.6) mercenary (0.3.6)
mini_magick (4.9.5)
mini_portile2 (2.4.0) mini_portile2 (2.4.0)
minitest (5.11.3) minitest (5.11.3)
nokogiri (1.10.3) nokogiri (1.10.3)
@@ -93,6 +94,7 @@ DEPENDENCIES
jekyll-feed (~> 0.6) jekyll-feed (~> 0.6)
jemoji jemoji
just-the-docs just-the-docs
mini_magick
tzinfo (~> 1.2) tzinfo (~> 1.2)
tzinfo-data tzinfo-data
wdm (~> 0.1.0) wdm (~> 0.1.0)

View File

@@ -5,38 +5,27 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title> - Gancio</title> <title> - Gancio</title>
<link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css"> <link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css">
<script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script>
<script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.6.1 --> <script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<title>Gancio | A shared agenda for local communities</title>
<meta name="generator" content="Jekyll v3.8.6" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
<meta property="og:title" content="Gancio" /> <script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
<meta property="og:locale" content="en_US" />
<meta name="description" content="A shared agenda for local communities" />
<meta property="og:description" content="A shared agenda for local communities" />
<link rel="canonical" href="https://gancio.org/404.html" />
<meta property="og:url" content="https://gancio.org/404.html" />
<meta property="og:site_name" content="Gancio" />
<script type="application/ld+json">
{"@type":"WebPage","url":"https://gancio.org/404.html","headline":"Gancio","description":"A shared agenda for local communities","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
</head> </head>

View File

@@ -5,38 +5,27 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>Admin - Gancio</title> <title>Admin - Gancio</title>
<link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css"> <link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css">
<script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script>
<script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.6.1 --> <script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<title>Admin | Gancio</title>
<meta name="generator" content="Jekyll v3.8.6" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
<meta property="og:title" content="Admin" /> <script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
<meta property="og:locale" content="en_US" />
<meta name="description" content="A shared agenda for local communities" />
<meta property="og:description" content="A shared agenda for local communities" />
<link rel="canonical" href="https://gancio.org/admin" />
<meta property="og:url" content="https://gancio.org/admin" />
<meta property="og:site_name" content="Gancio" />
<script type="application/ld+json">
{"@type":"WebPage","url":"https://gancio.org/admin","headline":"Admin","description":"A shared agenda for local communities","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
</head> </head>

View File

@@ -5,38 +5,27 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>Configuration - Gancio</title> <title>Configuration - Gancio</title>
<link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css"> <link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css">
<script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script>
<script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.6.1 --> <script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<title>Configuration | Gancio</title>
<meta name="generator" content="Jekyll v3.8.6" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
<meta property="og:title" content="Configuration" /> <script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
<meta property="og:locale" content="en_US" />
<meta name="description" content="A shared agenda for local communities" />
<meta property="og:description" content="A shared agenda for local communities" />
<link rel="canonical" href="https://gancio.org/config" />
<meta property="og:url" content="https://gancio.org/config" />
<meta property="og:site_name" content="Gancio" />
<script type="application/ld+json">
{"@type":"WebPage","url":"https://gancio.org/config","headline":"Configuration","description":"A shared agenda for local communities","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
</head> </head>

View File

@@ -5,38 +5,27 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>Contribute - Gancio</title> <title>Contribute - Gancio</title>
<link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css"> <link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css">
<script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script>
<script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.6.1 --> <script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<title>Contribute | Gancio</title>
<meta name="generator" content="Jekyll v3.8.6" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
<meta property="og:title" content="Contribute" /> <script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
<meta property="og:locale" content="en_US" />
<meta name="description" content="A shared agenda for local communities" />
<meta property="og:description" content="A shared agenda for local communities" />
<link rel="canonical" href="https://gancio.org/contribute" />
<meta property="og:url" content="https://gancio.org/contribute" />
<meta property="og:site_name" content="Gancio" />
<script type="application/ld+json">
{"@type":"WebPage","url":"https://gancio.org/contribute","headline":"Contribute","description":"A shared agenda for local communities","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
</head> </head>

View File

@@ -5,38 +5,27 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>Hacking - Gancio</title> <title>Hacking - Gancio</title>
<link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css"> <link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css">
<script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script>
<script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.6.1 --> <script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<title>Hacking | Gancio</title>
<meta name="generator" content="Jekyll v3.8.6" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
<meta property="og:title" content="Hacking" /> <script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
<meta property="og:locale" content="en_US" />
<meta name="description" content="A shared agenda for local communities" />
<meta property="og:description" content="A shared agenda for local communities" />
<link rel="canonical" href="https://gancio.org/dev" />
<meta property="og:url" content="https://gancio.org/dev" />
<meta property="og:site_name" content="Gancio" />
<script type="application/ld+json">
{"@type":"WebPage","url":"https://gancio.org/dev","headline":"Hacking","description":"A shared agenda for local communities","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
</head> </head>

View File

@@ -5,38 +5,27 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>Migration - Gancio</title> <title>Migration - Gancio</title>
<link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css"> <link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css">
<script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script>
<script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.6.1 --> <script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<title>Migration | Gancio</title>
<meta name="generator" content="Jekyll v3.8.6" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
<meta property="og:title" content="Migration" /> <script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
<meta property="og:locale" content="en_US" />
<meta name="description" content="A shared agenda for local communities" />
<meta property="og:description" content="A shared agenda for local communities" />
<link rel="canonical" href="https://gancio.org/dev/migration" />
<meta property="og:url" content="https://gancio.org/dev/migration" />
<meta property="og:site_name" content="Gancio" />
<script type="application/ld+json">
{"@type":"WebPage","url":"https://gancio.org/dev/migration","headline":"Migration","description":"A shared agenda for local communities","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
</head> </head>

View File

@@ -5,38 +5,27 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>Project Structure - Gancio</title> <title>Project Structure - Gancio</title>
<link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css"> <link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css">
<script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script>
<script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.6.1 --> <script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<title>Project Structure | Gancio</title>
<meta name="generator" content="Jekyll v3.8.6" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
<meta property="og:title" content="Project Structure" /> <script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
<meta property="og:locale" content="en_US" />
<meta name="description" content="A shared agenda for local communities" />
<meta property="og:description" content="A shared agenda for local communities" />
<link rel="canonical" href="https://gancio.org/dev/structure" />
<meta property="og:url" content="https://gancio.org/dev/structure" />
<meta property="og:site_name" content="Gancio" />
<script type="application/ld+json">
{"@type":"WebPage","url":"https://gancio.org/dev/structure","headline":"Project Structure","description":"A shared agenda for local communities","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
</head> </head>

View File

@@ -1 +1 @@
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.6">Jekyll</generator><link href="https://gancio.org/feed.xml" rel="self" type="application/atom+xml" /><link href="https://gancio.org/" rel="alternate" type="text/html" /><updated>2019-07-27T13:03:35+02:00</updated><id>https://gancio.org/feed.xml</id><title type="html">Gancio</title><subtitle>A shared agenda for local communities</subtitle></feed> <?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.6">Jekyll</generator><link href="https://gancio.org/feed.xml" rel="self" type="application/atom+xml" /><link href="https://gancio.org/" rel="alternate" type="text/html" /><updated>2019-07-29T21:13:52+02:00</updated><id>https://gancio.org/feed.xml</id><title type="html">Gancio</title><subtitle>A shared agenda for local communities</subtitle></feed>

View File

@@ -5,40 +5,29 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>Home - Gancio</title> <title>Home - Gancio</title>
<meta name="Description" content="Gancio is a shared agenda for local communities."> <meta name="Description" content="Gancio is a shared agenda for local communities.">
<link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css"> <link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css">
<script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script>
<script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.6.1 --> <script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<title>Home | Gancio</title>
<meta name="generator" content="Jekyll v3.8.6" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
<meta property="og:title" content="Home" /> <script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
<meta property="og:locale" content="en_US" />
<meta name="description" content="Gancio is a shared agenda for local communities." />
<meta property="og:description" content="Gancio is a shared agenda for local communities." />
<link rel="canonical" href="https://gancio.org/" />
<meta property="og:url" content="https://gancio.org/" />
<meta property="og:site_name" content="Gancio" />
<script type="application/ld+json">
{"@type":"WebSite","url":"https://gancio.org/","name":"Gancio","headline":"Home","description":"Gancio is a shared agenda for local communities.","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
</head> </head>
@@ -300,7 +289,11 @@
<p><a href="install" class="btn btn-primary fs-5 mb-4 mb-md-0 mr-2">Get started now</a> <a href="https://demo.gancio.org" class="btn btn-green fs-5 mb-4 mb-md-0">Demo</a> <p><a href="install" class="btn btn-primary fs-5 mb-4 mb-md-0 mr-2">Get started now</a> <a href="https://demo.gancio.org" class="btn btn-green fs-5 mb-4 mb-md-0">Demo</a>
<a href="https://git.lattuga.net/cisti/gancio" class="btn fs-5">Source</a></p> <a href="https://git.lattuga.net/cisti/gancio" class="btn fs-5">Source</a></p>
<p><img src="assets/home1.png" alt="screenshoot"></p> <p><a href="assets/home1.png" data-fancybox="gallery" data-caption="&lt;h2 style='color: white'&gt;Home of first instance of gancio&lt;/h2&gt;"><img src="assets/thumbs/home1.png" alt="diocane"></a>
<a href="assets/mobile1.png" data-fancybox="gallery" data-caption="&lt;h2 style='color: white'&gt;Home of first instance of gancio&lt;/h2&gt;"><img src="assets/thumbs/mobile1.png" alt="diocane"></a>
<a href="assets/mobile2.png" data-fancybox="gallery" data-caption="&lt;h2 style='color: white'&gt;Home of first instance of gancio&lt;/h2&gt;"><img src="assets/thumbs/mobile2.png" alt="diocane"></a>
<a href="assets/admin_users.png" data-fancybox="gallery" data-caption="&lt;h2 style='color: white'&gt;Home of first instance of gancio&lt;/h2&gt;"><img src="assets/thumbs/admin_users.png" alt="diocane"></a>
<a href="assets/login.png" data-fancybox="gallery" data-caption="&lt;h2 style='color: white'&gt;Home of first instance of gancio&lt;/h2&gt;"><img src="assets/thumbs/login.png" alt="diocane"></a></p>
<h3 id="about-the-project">About the project</h3> <h3 id="about-the-project">About the project</h3>

View File

@@ -5,38 +5,27 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>Install - Gancio</title> <title>Install - Gancio</title>
<link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css"> <link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css">
<script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script>
<script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.6.1 --> <script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<title>Install | Gancio</title>
<meta name="generator" content="Jekyll v3.8.6" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
<meta property="og:title" content="Install" /> <script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
<meta property="og:locale" content="en_US" />
<meta name="description" content="A shared agenda for local communities" />
<meta property="og:description" content="A shared agenda for local communities" />
<link rel="canonical" href="https://gancio.org/install" />
<meta property="og:url" content="https://gancio.org/install" />
<meta property="og:site_name" content="Gancio" />
<script type="application/ld+json">
{"@type":"WebPage","url":"https://gancio.org/install","headline":"Install","description":"A shared agenda for local communities","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
</head> </head>
@@ -294,9 +283,9 @@
<h1 id="install">Install</h1> <h1 id="install">Install</h1>
<ul> <ul>
<li><a href="classic">Classic install</a></li> <li><a href="/install/classic">Classic install</a></li>
<li><a href="docker">Using docker</a></li> <li><a href="/install/docker">Using docker</a></li>
<li><a href="nginx">Nginx as a proxy</a></li> <li><a href="/install/nginx">Nginx as a proxy</a></li>
<li><a href="../dev">Hacking &amp; contribute</a></li> <li><a href="../dev">Hacking &amp; contribute</a></li>
</ul> </ul>

View File

@@ -5,38 +5,27 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>Classic - Gancio</title> <title>Classic - Gancio</title>
<link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css"> <link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css">
<script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script>
<script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.6.1 --> <script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<title>Classic | Gancio</title>
<meta name="generator" content="Jekyll v3.8.6" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
<meta property="og:title" content="Classic" /> <script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
<meta property="og:locale" content="en_US" />
<meta name="description" content="A shared agenda for local communities" />
<meta property="og:description" content="A shared agenda for local communities" />
<link rel="canonical" href="https://gancio.org/install/classic" />
<meta property="og:url" content="https://gancio.org/install/classic" />
<meta property="og:site_name" content="Gancio" />
<script type="application/ld+json">
{"@type":"WebPage","url":"https://gancio.org/install/classic","headline":"Classic","description":"A shared agenda for local communities","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
</head> </head>

View File

@@ -5,38 +5,27 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>Docker - Gancio</title> <title>Docker - Gancio</title>
<link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css"> <link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css">
<script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script>
<script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.6.1 --> <script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<title>Docker | Gancio</title>
<meta name="generator" content="Jekyll v3.8.6" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
<meta property="og:title" content="Docker" /> <script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
<meta property="og:locale" content="en_US" />
<meta name="description" content="A shared agenda for local communities" />
<meta property="og:description" content="A shared agenda for local communities" />
<link rel="canonical" href="https://gancio.org/install/docker" />
<meta property="og:url" content="https://gancio.org/install/docker" />
<meta property="og:site_name" content="Gancio" />
<script type="application/ld+json">
{"@type":"WebPage","url":"https://gancio.org/install/docker","headline":"Docker","description":"A shared agenda for local communities","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
</head> </head>

View File

@@ -5,38 +5,27 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>Nginx - Gancio</title> <title>Nginx - Gancio</title>
<link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css"> <link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css">
<script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script>
<script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.6.1 --> <script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<title>Nginx | Gancio</title>
<meta name="generator" content="Jekyll v3.8.6" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
<meta property="og:title" content="Nginx" /> <script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
<meta property="og:locale" content="en_US" />
<meta name="description" content="A shared agenda for local communities" />
<meta property="og:description" content="A shared agenda for local communities" />
<link rel="canonical" href="https://gancio.org/install/nginx" />
<meta property="og:url" content="https://gancio.org/install/nginx" />
<meta property="og:site_name" content="Gancio" />
<script type="application/ld+json">
{"@type":"WebPage","url":"https://gancio.org/install/nginx","headline":"Nginx","description":"A shared agenda for local communities","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
</head> </head>

View File

@@ -5,38 +5,27 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>Instances - Gancio</title> <title>Instances - Gancio</title>
<link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css"> <link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css">
<script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script>
<script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.6.1 --> <script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<title>Instances | Gancio</title>
<meta name="generator" content="Jekyll v3.8.6" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
<meta property="og:title" content="Instances" /> <script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
<meta property="og:locale" content="en_US" />
<meta name="description" content="A shared agenda for local communities" />
<meta property="og:description" content="A shared agenda for local communities" />
<link rel="canonical" href="https://gancio.org/instances" />
<meta property="og:url" content="https://gancio.org/instances" />
<meta property="og:site_name" content="Gancio" />
<script type="application/ld+json">
{"@type":"WebPage","url":"https://gancio.org/instances","headline":"Instances","description":"A shared agenda for local communities","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
</head> </head>

View File

@@ -5,38 +5,27 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>Usage - Gancio</title> <title>Usage - Gancio</title>
<link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="https://gancio.org/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css"> <link rel="stylesheet" href="https://gancio.org/assets/css/just-the-docs.css">
<script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/vendor/lunr.min.js"></script>
<script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script> <script type="text/javascript" src="https://gancio.org/assets/js/just-the-docs.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.6.1 --> <script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<title>Usage | Gancio</title>
<meta name="generator" content="Jekyll v3.8.6" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
<meta property="og:title" content="Usage" /> <script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
<meta property="og:locale" content="en_US" />
<meta name="description" content="A shared agenda for local communities" />
<meta property="og:description" content="A shared agenda for local communities" />
<link rel="canonical" href="https://gancio.org/usage" />
<meta property="og:url" content="https://gancio.org/usage" />
<meta property="og:site_name" content="Gancio" />
<script type="application/ld+json">
{"@type":"WebPage","url":"https://gancio.org/usage","headline":"Usage","description":"A shared agenda for local communities","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
</head> </head>

View File

@@ -15,7 +15,12 @@ A shared agenda for local communities.
[Get started now](install){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 } [Demo](https://demo.gancio.org){: .btn .btn-green .fs-5 .mb-4 .mb-md-0 } [Get started now](install){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 } [Demo](https://demo.gancio.org){: .btn .btn-green .fs-5 .mb-4 .mb-md-0 }
[Source](https://git.lattuga.net/cisti/gancio){: .btn .fs-5 } [Source](https://git.lattuga.net/cisti/gancio){: .btn .fs-5 }
![screenshoot](assets/home1.png)
[![diocane](assets/thumbs/home1.png)](assets/home1.png){: data-fancybox="gallery" data-caption="<h2 style='color: white'>Home of first instance of gancio</h2>" }
[![diocane](assets/thumbs/mobile1.png)](assets/mobile1.png){: data-fancybox="gallery" data-caption="<h2 style='color: white'>Home of first instance of gancio</h2>" }
[![diocane](assets/thumbs/mobile2.png)](assets/mobile2.png){: data-fancybox="gallery" data-caption="<h2 style='color: white'>Home of first instance of gancio</h2>" }
[![diocane](assets/thumbs/admin_users.png)](assets/admin_users.png){: data-fancybox="gallery" data-caption="<h2 style='color: white'>Home of first instance of gancio</h2>" }
[![diocane](assets/thumbs/login.png)](assets/login.png){: data-fancybox="gallery" data-caption="<h2 style='color: white'>Home of first instance of gancio</h2>" }
### About the project ### About the project

View File

@@ -10,7 +10,7 @@ has_toc: false
# Install # Install
- [Classic install](install/classic) - [Classic install](/install/classic)
- [Using docker](install/docker) - [Using docker](/install/docker)
- [Nginx as a proxy](install/nginx) - [Nginx as a proxy](/install/nginx)
- [Hacking & contribute](../dev) - [Hacking & contribute](../dev)

View File

@@ -1,69 +1,68 @@
const fs = require('fs') // const fs = require('fs')
const path = require('path') // const path = require('path')
const moment = require('moment') // const moment = require('moment')
const { event: Event, comment: Comment } = require('../models') // const { event: Event, comment: Comment } = require('../models')
const config = require('config') // const config = require('config')
const Mastodon = require('mastodon-api') // const settingsController = require('./settings')
const settingsController = require('./settings') // const get = require('lodash/get')
const get = require('lodash/get')
const botController = { // const botController = {
bots: null, // bots: null,
async initialize() { // async initialize() {
const access_token = get(settingsController.secretSettings, 'mastodon_auth.access_token') // const access_token = get(settingsController.secretSettings, 'mastodon_auth.access_token')
const instance = get(settingsController.settings, 'mastodon_instance') // const instance = get(settingsController.settings, 'mastodon_instance')
if (!access_token || !instance) return // if (!access_token || !instance) return
botController.bot = new Mastodon({ // botController.bot = new Mastodon({
access_token, // access_token,
api_url: `https://${instance}/api/v1` // api_url: `https://${instance}/api/v1`
}) // })
const listener = botController.bot.stream('/streaming/user') // const listener = botController.bot.stream('/streaming/user')
listener.on('message', botController.message) // listener.on('message', botController.message)
listener.on('error', botController.error) // listener.on('error', botController.error)
}, // },
async post(event) { // async post(event) {
const status = `${event.title} @${event.place.name} ${moment(event.start_datetime).format('ddd, D MMMM HH:mm')} - // const status = `${event.title} @${event.place.name} ${moment(event.start_datetime).format('ddd, D MMMM HH:mm')} -
${event.description.length > 200 ? event.description.substr(0, 200) + '...' : event.description} - ${event.tags.map(t => '#' + t.tag).join(' ')} ${config.baseurl}/event/${event.id}` // ${event.description.length > 200 ? event.description.substr(0, 200) + '...' : event.description} - ${event.tags.map(t => '#' + t.tag).join(' ')} ${config.baseurl}/event/${event.id}`
let media // let media
if (event.image_path) { // if (event.image_path) {
const file = path.resolve(config.upload_path, event.image_path) // const file = path.resolve(config.upload_path, event.image_path)
if (fs.statSync(file)) { // if (fs.statSync(file)) {
media = await botController.bot.post('/media', { file: fs.createReadStream(file) }) // media = await botController.bot.post('/media', { file: fs.createReadStream(file) })
} // }
} // }
return botController.bot.post('/statuses', { status, media_ids: media ? [media.data.id] : [] }) // return botController.bot.post('/statuses', { status, media_ids: media ? [media.data.id] : [] })
}, // },
async message(msg) { // async message(msg) {
const type = msg.event // const type = msg.event
if (type === 'delete') { // if (type === 'delete') {
const activitypub_id = String(msg.data) // const activitypub_id = String(msg.data)
const event = await Comment.findOne({ where: { activitypub_id } }) // const event = await Comment.findOne({ where: { activitypub_id } })
if (event) await event.destroy() // if (event) await event.destroy()
return // return
} // }
const activitypub_id = String(msg.data.status.in_reply_to_id) // const activitypub_id = String(msg.data.status.in_reply_to_id)
if (!activitypub_id) return // if (!activitypub_id) return
let event = await Event.findOne({ where: { activitypub_id } }) // let event = await Event.findOne({ where: { activitypub_id } })
if (!event) { // if (!event) {
// check for comment.. // // check for comment..
const comment = await Comment.findOne( { include: [Event], where: { activitypub_id }}) // const comment = await Comment.findOne( { include: [Event], where: { activitypub_id }})
if (!comment) return // if (!comment) return
event = comment.event // event = comment.event
} // }
await Comment.create({ // await Comment.create({
activitypub_id: String(msg.data.status.id), // activitypub_id: String(msg.data.status.id),
data: msg.data.status, // data: msg.data.status,
eventId: event.id // eventId: event.id
}) // })
}, // },
error(err) { // error(err) {
console.log('error ', err) // console.log('error ', err)
} // }
} // }
setTimeout(botController.initialize, 5000) // setTimeout(botController.initialize, 5000)
module.exports = botController // module.exports = botController

View File

@@ -1,4 +1,3 @@
const Mastodon = require('mastodon-api')
const { setting: Setting } = require('../models') const { setting: Setting } = require('../models')
const config = require('config') const config = require('config')
const consola = require('consola') const consola = require('consola')
@@ -78,39 +77,6 @@ const settingsController = {
} }
res.json(settings) res.json(settings)
}, },
// async getAuthURL(req, res) {
// const instance = req.body.instance
// const callback = `${config.baseurl}/api/settings/oauth`
// const { client_id, client_secret } = await Mastodon.createOAuthApp(`https://${instance}/api/v1/apps`,
// 'gancio', 'read write', callback)
// const url = await Mastodon.getAuthorizationUrl(client_id, client_secret,
// `https://${instance}`, 'read write', callback)
// await settingsController.set('mastodon_instance', instance )
// await settingsController.set('mastodon_auth', { client_id, client_secret }, true)
// res.json(url)
// },
// async code(req, res) {
// const code = req.query.code
// const callback = `${config.baseurl}/api/settings/oauth`
// const client_id = settingsController.secretSettings.mastodon_auth.client_id
// const client_secret = settingsController.secretSettings.mastodon_auth.client_secret
// const instance = settingsController.settings.mastodon_instance
// try {
// const access_token = await Mastodon.getAccessToken(client_id, client_secret, code,
// `https://${instance}`, callback)
// const mastodon_auth = { client_id, client_secret, access_token }
// await settingsController.set('mastodon_auth', mastodon_auth, true)
// const botController = require('./fediverse')
// botController.initialize()
// res.redirect('/admin')
// } catch (e) {
// res.json(e)
// }
// },
} }
setTimeout(settingsController.initialize, 200) setTimeout(settingsController.initialize, 200)

View File

@@ -21,14 +21,15 @@ fs
const model = sequelize.import(path.join(__dirname, file)) const model = sequelize.import(path.join(__dirname, file))
db[model.name] = model db[model.name] = model
}) })
Object.keys(db).forEach(modelName => { Object.keys(db).forEach(modelName => {
if (db[modelName].associate) { if (db[modelName].associate) {
db[modelName].associate(db) db[modelName].associate(db)
} }
}) })
db.sequelize = sequelize db.sequelize = sequelize
db.Sequelize = Sequelize db.Sequelize = Sequelize
module.exports = db module.exports = db

View File

@@ -25,7 +25,11 @@ module.exports = (sequelize, DataTypes) => {
recover_code: DataTypes.STRING, recover_code: DataTypes.STRING,
is_admin: DataTypes.BOOLEAN, is_admin: DataTypes.BOOLEAN,
is_active: DataTypes.BOOLEAN, is_active: DataTypes.BOOLEAN,
rsa: DataTypes.JSONB rsa: DataTypes.JSON,
followers: {
type: DataTypes.JSON,
defaultValue: []
}
}, { }, {
scopes: { scopes: {
withoutPassword: { withoutPassword: {

View File

@@ -174,7 +174,7 @@ async function setup (options) {
await firstrun.setup(config, options.config) await firstrun.setup(config, options.config)
consola.info(`You can edit '${options.config}' to modify your configuration. `) consola.info(`You can edit '${options.config}' to modify your configuration. `)
consola.info(`Run "gancio --config ${options.config}"`) consola.info(`Run "gancio --config ${options.config}"`)
process.exit(0) process.exit(0)
} }
async function upgrade (options) { async function upgrade (options) {

3
server/dbconfig.js Normal file
View File

@@ -0,0 +1,3 @@
const config = require('config')
modules.exports = config.db

View File

@@ -2,6 +2,84 @@ const express = require('express')
const router = express.Router() const router = express.Router()
const { user: User } = require('../api/models') const { user: User } = require('../api/models')
const config = require('config') const config = require('config')
const get = require('lodash/get')
const crypto = require('crypto')
const request = require('request')
function signAndSend(message, usre, domain, req, res, targetDomain) {
// get the URI of the actor object and append 'inbox' to it
let inbox = message.object.actor+'/inbox'
let inboxFragment = inbox.replace('https://'+targetDomain,'')
// get the private key
const privkey = user.rsa.privateKey
const signer = crypto.createSign('sha256')
let d = new Date()
let stringToSign = `(request-target): post ${inboxFragment}\nhost: ${targetDomain}\ndate: ${d.toUTCString()}`
signer.update(stringToSign)
signer.end()
const signature = signer.sign(privkey)
const signature_b64 = signature.toString('base64')
let header = `keyId="https://${domain}/u/${name}",headers="(request-target) host date",signature="${signature_b64}"`
console.error('vado di request accept !')
request({
url: inbox,
headers: {
'Host': targetDomain,
'Date': d.toUTCString(),
'Signature': header
},
method: 'POST',
json: true,
body: message
}, function (error, response){
if (error) {
console.log('Error:', error, response.body)
}
else {
console.log('Response:', response.body)
}
})
return res.status(200);
}
function sendAcceptMessage (body, user, req, res, targetDomain) {
const guid = crypto.randomBytes(16).toString('hex')
let message = {
'@context': 'https://www.w3.org/ns/activitystreams',
'id': `${config.baseurl}/federation/${guid}`,
'type': 'Accept',
'actor': `${config.baseurl}/federation/u/${user.username}`,
'object': body,
}
signAndSend(message, user, domain, req, res, targetDomain)
}
router.post('/inbox', async (req, res) => {
const b = req.body
console.error('> INBOX ', b)
const targetDomain = new URL(b.actor).host
const domain = new URL(config.baseurl).host
switch(b.type) {
case 'Follow':
if (typeof b.object !== 'string') return
const username = b.object.replace(`${config.baseurl}/federation/u/`, '')
console.error('someone wants to follow ' + username)
const user = await User.findOne({ where: { username }})
if (!user) {
console.error('No user found!')
return
}
sendAcceptMessage(b, user, domain, req, res, targetDomain)
console.error('FOLLOWERS ', user.followers)
if (user.followers.indexOf(b.actor) === -1) {
console.error('ok this is a new follower: ', b.actor)
user.followers.push(b.actor)
await user.save()
}
break
}
})
router.get('/u/:name', async (req, res) => { router.get('/u/:name', async (req, res) => {
const name = req.params.name const name = req.params.name
@@ -13,17 +91,40 @@ router.get('/u/:name', async (req, res) => {
'https://www.w3.org/ns/activitystreams', 'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1' 'https://w3id.org/security/v1'
], ],
'id': `${config.baseurl}/federation/u/${name}`, id: `${config.baseurl}/federation/u/${name}`,
'type': 'Person', type: 'Person',
'preferredUsername': name, preferredUsername: name,
'inbox': `${config.baseurl}/federation/inbox`, inbox: `${config.baseurl}/federation/inbox`,
'followers': `${config.baseurl}/federation/u/${name}/followers`, followers: `${config.baseurl}/federation/u/${name}/followers`,
'publicKey': { publicKey: {
'id': `${config.baseurl}/federation/u/${name}#main-key`, id: `${config.baseurl}/federation/u/${name}#main-key`,
'owner': `${config.baseurl}/federation/u/${name}`, owner: `${config.baseurl}/federation/u/${name}`,
'publicKeyPem': user.rsa.publicKey publicKeyPem: get(user, 'rsa.publicKey', '')
} }
} }
res.json(ret) res.json(ret)
}) })
module.exports = router
router.get('/u/:name/followers', async (req, res) => {
const name = req.params.name
if (!name) return res.status(400).send('Bad request.')
const user = await User.findOne({where: { username: name }})
if (!user) return res.status(404).send(`No record found for ${name}`)
const ret = {
'@context': [ 'https://www.w3.org/ns/activitystreams' ],
id: `${config.baseurl}/federation/u/${name}/followers`,
type: 'OrderedCollection',
totalItems: user.followers.length,
first: {
id: `${config.baseurl}/federation/u/${name}/followers?page=1`,
type: 'OrderedCollectionPage',
totalItems: user.followers.length,
partOf: `${config.baseurl}/federation/u/${name}/followers`,
orderedItems: user.followers,
}
}
res.json(ret)
})
module.exports = router

View File

@@ -4,6 +4,7 @@ const { user: User } = require('../api/models')
const config = require('config') const config = require('config')
router.get('/', async (req, res) => { router.get('/', async (req, res) => {
console.error('ma sono dentro webfinger ?!?!')
const resource = req.query.resource const resource = req.query.resource
if (!resource || !resource.includes('acct:')) { if (!resource || !resource.includes('acct:')) {
return res.status(400).send('Bad request. Please make sure "acct:USER@DOMAIN" is what you are sending as the "resource" query parameter.') return res.status(400).send('Bad request. Please make sure "acct:USER@DOMAIN" is what you are sending as the "resource" query parameter.')

View File

@@ -26,8 +26,7 @@ module.exports = {
try { try {
await db.user.findAll() await db.user.findAll()
consola.warn(`⚠️ Non empty db! Please move your current db elsewhere than retry. consola.warn(`⚠️ Non empty db! Please move your current db elsewhere than retry.`)
If you want to `)
return -1 return -1
} catch(e) { } } catch(e) { }
@@ -40,7 +39,10 @@ If you want to `)
// create admin user // create admin user
consola.info('Create admin user', admin) consola.info('Create admin user', admin)
await db.user.create({ await db.user.create({
...admin, email: admin.email,
password: admin.password,
username: admin.email,
display_name: config.title,
is_admin: true, is_admin: true,
is_active: true is_active: true
}) })

View File

@@ -3,7 +3,7 @@
module.exports = { module.exports = {
up: (queryInterface, Sequelize) => { up: (queryInterface, Sequelize) => {
return queryInterface.addColumn('users', 'rsa', { return queryInterface.addColumn('users', 'rsa', {
type: Sequelize.JSONB type: Sequelize.JSON
}) })
/* /*
Add altering commands here. Add altering commands here.

View File

@@ -0,0 +1,26 @@
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.addColumn('users', 'followers', {
type: Sequelize.JSON
})
/*
Add altering commands here.
Return a promise to correctly handle asynchronicity.
Example:
return queryInterface.createTable('users', { id: Sequelize.INTEGER });
*/
},
down: (queryInterface, Sequelize) => {
/*
Add reverting commands here.
Return a promise to correctly handle asynchronicity.
Example:
return queryInterface.dropTable('users');
*/
}
};