1
0
Fork 0
mirror of https://github.com/Lynnesbian/FediBooks/ synced 2024-11-25 16:48:58 +00:00

Compare commits

..

No commits in common. "d2f11e5fb599d75660d7cc428c0d7296e1438c20" and "80bfca1a4a7edc5b51ce8e1cc3ffc9b10f090680" have entirely different histories.

7 changed files with 4 additions and 146 deletions

View file

@ -1,44 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>FediBooks</title>
{% include 'imports.html' %}
</head>
<body>
<div class="container light">
<h1 class='thin centred'>About FediBooks</h1>
<p class="centred">
<a class="button btn-primary" href="/" role="button"><i class="fas fa-home"></i> Home</a>
</p>
</div>
<div class="container">
<h2 class="thin">What's an ebooks bot?</h2>
<p>An ebooks bot, named after the Twitter account horse_ebooks, is a bot that learns from posts made by users and generates its own posts, similarly to how your phone keyboard predicts what you're about to type next. The results are always messy, frequently nonsensical, and occasionally hilarious.</p>
<h2 class="thin">What happened to the old FediBooks?</h2>
<p>It was too ambitious a project, and I got burned out on it. Progress was slow and the code was messy. I had a ridiculous number of features planned for it, such as complex decision trees, allowing for absurdly specific rules like "only reply to users with a T in their username if it's between 4am and 5pm on a Wednesday". I had too much planned, and additionally, I don't particularly like developing desktop apos.</p>
<p>The source code is still available <a href="https://github.com/Lynnesbian/OldFediBooks">here</a>, although it's of little use to anyone.</p>
<h2 class="thin">Why create FediBooks?</h2>
<p>I've been working on ebooks bots for a long time. My first project, <a href="https://github.com/Lynnesbian/mstdn-ebooks/">mstdn-ebooks</a>, dates back to October 2018. It's a much less ambitious project than FediBooks, but maintaining and developing it has still been a formidable undertaking. It's changed a lot since the initial version, and has worked very well for a long time.</p>
<p>Using mstdn-ebooks is nowhere near as easy as using FediBooks. There's <a href="https://cloud.lynnesbian.space/s/jozbRi69t4TpD95">a long guide</a> you'll need to follow, and you'll have to install some programs like Python and possibly Git to get working. It runs on your own computer, meaning that if you put it into sleep mode, it stops working. Updating it to the latest version is also your responsibility, and the error messages it gives aren't exactly user friendly.</p>
<p>To help with this issue, I decided to create a Patreon where I offered a $2.50 per month tier to host up to three bots for you. I would take care of configuration, maintenance, updating, et cetera. This worked pretty well up until recently.</p>
<p>A new change in Mastodon and Pleroma adds something called <em>authenticated fetches</em>. Reffered to as "authorised mode" by Mastodon, this new feature prevents unauthorised instances and programs from accessing the API. In other words, if instance A blocks instance B, then instance B won't be able to see instance A's public posts anymore. However, this also means mstdn-ebooks can't see your posts. This can be fixed, however, by requesting permission from instance B. So what's the problem?</p>
<p>I would need to ask every single person I run a bot for to click a link I send to them, and then send me back the authentication code they received. This is messy and annoying, and greatly tedious. Furthermore, mstdn-ebooks' code base is starting to show its age (I used to be even worse at programming, believe it or not), and I thought this gave me a good motivation to create a new project.</p>
<p>When FediBooks needs permission from instance B, all you need to do is click "authorise". No copy and pasting codes and sending them in a Patreon DM. This is much cleaner and easier for the end user, which is what this is all about!</p>
<p>FediBooks is one of the biggest projects I've ever taken on, and it's been wonderful working on it. I hope you enjoy it!</p>
<h2 class="thin">You used to charge for hosting ebooks bots for people. Why make it free? Aren't you automating yourself out of a job?</h2>
<p>Yup! I'm making this free because I believe all software should be free, not just in cost, but in distributability, accessibility, and so on. mstdn-ebooks is also free software. I used to provide free hosting for mstdn-ebooks bots, but stopped when it became too much for me to handle. In the end, I was running 108 ebooks bots! The worst moment was when I accidentally wiped all the configuration files for them and had to log in to all 108 accounts and re-authorise them all...</p>
<p>FediBooks should (fingers crossed!) require much less maintenance on my part. All I have to do is make sure the server is running, which it is at all times, and make the occasional change or update to reflect new needs. The real concern is my server, not me - let's hope it can handle all these bots!</p>
<p>FediBooks doesn't display ads. It doesn't have any subscription models, donation bonuses, or cryptocurrency mining JavaScript (as useless as that is). What it does have is a donation link at the bottom of the main page. If you have some money to spare and you want to donate, feel free to do so. Paying for the server will be a little tricky since I've just cut off my main source of income, but I should manage. Hopefully.</p>
<h2 class="thin">I'm concerned about my privacy. If FediBooks learns from my posts, doesn't that mean you have access to all my posts?</h2>
<p>By necessity, yes. FediBooks will have access to all of your <em>public</em> posts. Anything you've set to followers only will not be seen by FediBooks. However, if you delete a post, FediBooks will still have it stored in its database. This is because checking if every single post has been deleted is impractically slow, and your instance would soon tell FediBooks to stop making so many API requests.</p>
<p>If you create two bots that learn from account X, and then delete one of them, account X's posts will still stay in the database. If you delete both bots, and no other bots are learning from account X, then account X's posts will be deleted from the database permanently. If you then add a new bot that learns from account X, FediBooks will need to download all of your posts again, which can take quite a while.</p>
</div>
{% include 'footer.html' %}
</body>
</html>

View file

@ -1,46 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>FediBooks</title>
{% include 'imports.html' %}
</head>
<body>
<div class="container">
<h1 class="thin centred">Create bot</h1>
<p class="large thin centred">Step {{ session['step'] }}</p>
</div>
<div class="container centred">
<form action="/bot/create" method="POST">
{% if session['step'] == 1 %}
<label for="instance" class="important">What instance will your bot's account be on?</label>
<input type="text" name="instance" class="full-width" placeholder="botsin.space">
<br>
{% elif session['step'] == 2 %}
<h2 class="thin centred">Detected instance type: {{ session['instance_type'] }}</h2>
<p>{{ session['instance'] }} is a {{ session['instance_type'] }} instance. {% if session['instance_type'] == Pleroma %}Unfortunately, bots on Pleroma instances cannot listen for replies yet. This means that your bot will have its reply functionality disabled.{% else %}{{ session['instance_type'] }} instances are fully supported, and your bot will have all functionality available.{% endif %}</p>
{% elif session['step'] == 3 %}
<p>You now need to give your bot access to the {{ session['instance'] }} account you have created for it. If you have not yet created an account on {{ session['instance'] }} for your bot to use, please do so now.</p>
<p>Sign in to the {{ session['instance'] }} account you want your bot to use, then click next to begin the authorisation process.</p>
{% elif session['step'] == 4 %}
<h2 class="thin centred">Congratulations!</h2>
<p>FediBooks has successfully authenticated with {{ session['instance'] }}, and your bot is ready to be configured. Click finish to return to the bot management screen.</p>
<p>To get your bot working, you need to add at least one account for it to learn from. You can do so by clicking the <i class="fas fa-users"></i> button. To configure settings such as posting frequency and content warnings, click the <i class="fas fa-cog"></i> button.</p>
{% endif %}
<div class="container centred">
<button class="button btn-secondary"><i class="fas fa-arrow-left"></i> Back</button>
<button class="button btn-primary"><i class="fas fa-arrow-right"></i> Next</button>
</div>
</form>
</div>
{% include 'footer.html' %}
</body>
</html>

View file

@ -1,28 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>FediBooks</title>
{% include 'imports.html' %}
</head>
<body>
<div class="container centred">
<h1 class="thin centred">Delete bot</h1>
<div class="bot-icon"></div>
</div>
<div class="container centred">
<form>
<div class="container centred">
<p>Are you sure you want to <strong>permanently</strong> delete bot name?</p>
<p>The account on instan.ce will remain open, but your bot will stop posting from it.</p>
<button class="button btn-secondary"><i class="fas fa-times"></i> Cancel</button>
<button class="button btn-dangerous"><i class="fas fa-trash"></i> Delete bot</button>
</div>
</form>
</div>
{% include 'footer.html' %}
</body>
</html>

View file

@ -20,7 +20,7 @@
</div> </div>
<div class="row"> <div class="row">
<label for="freq" class="large">Post frequency (minutes)</label> <label for="freq" class="large">Post frequency (minutes)</label>
<input type="number" min="15" max="240" step="5" value="30"> <input type="number" min="5" max="240" step="5" value="30">
</div> </div>
<div class="row"> <div class="row">
<label for="cw" class="large">Content warning (subject)</label> <label for="cw" class="large">Content warning (subject)</label>
@ -31,20 +31,13 @@
<input type="number" min="100" max="5000" value="500"> <input type="number" min="100" max="5000" value="500">
</div> </div>
<div class="row"> <div class="row">
<label for="fake-mentions" class="large">Fake mentions</label> <label for="fake-mentions" class="large">Insert fake mentions</label>
<select name="fake-mentions"> <select>
<option value="full">At any time</option> <option value="full">At any time</option>
<option value="start" default>Only at the start of posts</option> <option value="start" default>Only at the start of posts</option>
<option value="never">Never</option> <option value="never">Never</option>
</select> </select>
</div> </div>
<div class="row">
<label for="fake-mention-style" class="large">Fake mention style</label>
<select name="fake-mention-style">
<option value="full">@user@instan.ce</option>
<option value="brief" default>@user</option>
</select>
</div>
<div class="row"> <div class="row">
<label for="privacy" class="large">Post privacy</label> <label for="privacy" class="large">Post privacy</label>
<select> <select>

View file

@ -12,7 +12,6 @@
<p class="centred" style="margin: 50px 0;"> <p class="centred" style="margin: 50px 0;">
<a class="button btn-primary btn-large" href="/welcome" role="button"><i class="fas fa-play"></i> Get started</a> <a class="button btn-primary btn-large" href="/welcome" role="button"><i class="fas fa-play"></i> Get started</a>
<br> <br>
<a class="button btn-secondary" href="/about" role="button"><i class="fas fa-question"></i> Learn more</a>
<a class="button btn-secondary" href="https://github.com/Lynnesbian/FediBooks" role="button"><i class="fas fa-code"></i> Source code</a> <a class="button btn-secondary" href="https://github.com/Lynnesbian/FediBooks" role="button"><i class="fas fa-code"></i> Source code</a>
</p> </p>
</div> </div>

View file

@ -10,7 +10,7 @@
<h1 class='thin centred'>Home</h1> <h1 class='thin centred'>Home</h1>
<p class="centred large">Hi there! You have 1 bots, all of which are currently active.</p> <p class="centred large">Hi there! You have 1 bots, all of which are currently active.</p>
<p class="centred" style="margin: 50px 0;"> <p class="centred" style="margin: 50px 0;">
<a class="button btn-primary btn-large" href="/bot/create" role="button"><i class="fas fa-robot"></i> New bot</a> <a class="button btn-primary btn-large" href="/bot/new" role="button"><i class="fas fa-robot"></i> New bot</a>
<a class="button btn-secondary btn-large" href="/settings" role="button"><i class="fas fa-cog"></i> Account settings</a> <a class="button btn-secondary btn-large" href="/settings" role="button"><i class="fas fa-cog"></i> Account settings</a>
<a class="button btn-secondary btn-large" href="/do/signout" role="button"><i class="fas fa-sign-out-alt"></i> Sign out</a> <a class="button btn-secondary btn-large" href="/do/signout" role="button"><i class="fas fa-sign-out-alt"></i> Sign out</a>
</p> </p>

View file

@ -6,7 +6,6 @@ app.secret_key = "debug key"
@app.route("/") @app.route("/")
def hello(): def hello():
session['userid'] = 1 session['userid'] = 1
# session.clear()
if 'userid' in session: if 'userid' in session:
return render_template("home.html") return render_template("home.html")
else: else:
@ -16,10 +15,6 @@ def hello():
def welcome(): def welcome():
return render_template("welcome.html") return render_template("welcome.html")
@app.route("/about")
def about():
return render_template("about.html")
@app.route("/login") @app.route("/login")
def show_login_page(): def show_login_page():
return render_template("login.html", signup = False) return render_template("login.html", signup = False)
@ -35,14 +30,3 @@ def settings():
@app.route("/bot/edit/<id>") @app.route("/bot/edit/<id>")
def bot_edit(id): def bot_edit(id):
return render_template("bot_edit.html") return render_template("bot_edit.html")
@app.route("/bot/delete/<id>")
def bot_delete(id):
return render_template("bot_delete.html")
@app.route("/bot/create/")
def bot_create():
session['step'] = 4
session['instance'] = "botsin.space"
session['instance_type'] = "Mastodon"
return render_template("bot_create.html")