Fix pubs page and add separate endpoint to generate invites

This commit is contained in:
Rogerio Chaves 2020-05-02 22:06:51 +02:00
parent aa341188fe
commit f63e2e42ab
No known key found for this signature in database
GPG Key ID: E6AF5440509B1D94
3 changed files with 8 additions and 10 deletions

View File

@ -517,10 +517,15 @@ router.post("/profile/:id(*)/publish_secret", async (req, res) => {
});
router.get("/pubs", async (_req, res) => {
const invite = await ssb.client().invite.create({ uses: 10 });
const peers = await ssb.client().gossip.peers();
res.render("desktop/pubs", { invite, peers });
res.render("desktop/pubs", { peers });
});
router.get("/pub_invite", async (_req, res) => {
const invite = await ssb.client().invite.create({ uses: 1 });
res.json({ invite });
});
router.post("/pubs/add", async (req, res) => {

View File

@ -7,7 +7,7 @@ module.exports = configInject(process.env.CONFIG_FOLDER || "ssb", {
{
scope: "public",
host: "0.0.0.0",
external: ["lvh.me"],
external: "pub.feedless.social",
transform: "shs",
port: process.env.SSB_PORT || 8008,
},

View File

@ -13,13 +13,6 @@
</ul>
</div>
<h2>Your Pub</h2>
<div>
<p>Here is your pub address, copy and send to friends:</p>
<code style="width: 80%; word-wrap: break-word;"><%= invite %></code>
</div>
<h2>Connect to Pub</h2>
<div>