mirror of
https://github.com/Lynnesbian/FediBooks/
synced 2024-11-25 16:48:58 +00:00
Compare commits
13 commits
d2f11e5fb5
...
743066cb3d
Author | SHA1 | Date | |
---|---|---|---|
743066cb3d | |||
44451b87bf | |||
e8fed0cd2f | |||
29e935f64f | |||
5a419376fd | |||
e5ba2258e2 | |||
72e5b56401 | |||
e0a5cff3a7 | |||
bb37f226b2 | |||
12d34a0a8a | |||
aea1cc7ccc | |||
bc0dcfb754 | |||
7f6f18cc14 |
7 changed files with 55 additions and 4 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
|||
__pycache__
|
||||
config.json
|
||||
planning.txt
|
||||
|
|
|
@ -3,3 +3,5 @@ markovify==0.7.1
|
|||
beautifulsoup4==4.7.1
|
||||
requests==2.22.0
|
||||
Flask==1.1.1
|
||||
mysql-connector-python==8.0.17
|
||||
bcrypt == 3.1.7
|
||||
|
|
44
setup.sql
Normal file
44
setup.sql
Normal file
|
@ -0,0 +1,44 @@
|
|||
CREATE TABLE IF NOT EXISTS `users` (
|
||||
`id` BINARY(64) PRIMARY KEY,
|
||||
`email` VARCHAR(128) UNIQUE NOT NULL,
|
||||
`password` BINARY(60) NOT NULL
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS `contact_settings` (
|
||||
FOREIGN KEY (`user_id`) REFERENCES users(id) ON DELETE CASCADE,
|
||||
`fetch` ENUM('always', 'once', 'never') DEFAULT 'once',
|
||||
`submit` ENUM('always', 'once', 'never') DEFAULT 'once',
|
||||
`generation` ENUM('always', 'once', 'never') DEFAULT 'once',
|
||||
`reply` ENUM('always', 'once', 'never') DEFAULT 'once'
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS `bots` (
|
||||
`id` BINARY(64) PRIMARY KEY,
|
||||
FOREIGN KEY (`user_id`) REFERENCES users(id) ON DELETE CASCADE,
|
||||
`enabled` BOOLEAN DEFAULT 1,
|
||||
`replies_enabled` BOOLEAN DEFAULT 1,
|
||||
`post_frequency` SMALLINT UNSIGNED DEFAULT 30,
|
||||
`content_warning` VARCHAR(128),
|
||||
`length` SMALLINT UNSIGNED DEFAULT 500,
|
||||
`fake_mentions` ENUM('always', 'start', 'never') DEFAULT 'start',
|
||||
`fake_mentions_full` BOOLEAN DEFAULT 0,
|
||||
`post_privacy` ENUM('public', 'unlisted', 'followers_only') DEFAULT 'unlisted',
|
||||
`learn_from_cw` BOOLEAN DEFAULT 0,
|
||||
`last_post` DATETIME DEFAULT 0,
|
||||
FOREIGN KEY (`credentials_id`) REFERENCES credentials(id) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS `credentials` (
|
||||
`id` INT AUTO_INCREMENT PRIMARY KEY,
|
||||
`client_id` VARCHAR(128) NOT NULL,
|
||||
`client_secret` VARCHAR(128) NOT NULL,
|
||||
`secret` VARCHAR(128) NOT NULL
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS `fedi_account` (
|
||||
`outbox` VARCHAR(256) PRIMARY KEY,
|
||||
`instance` VARCHAR(256) NOT NULL,
|
||||
FOREIGN KEY (`credentials_id`) REFERENCES credentials(id) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS `posts` (
|
||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||
`post_id` VARCHAR(64) NOT NULL,
|
||||
`content` VARCHAR(65535) NOT NULL,
|
||||
`cw` BOOLEAN NOT NULL
|
||||
);
|
|
@ -33,7 +33,7 @@
|
|||
<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>
|
||||
<p>FediBooks doesn't display ads. It doesn't have any subscription models, donation bonuses, or cryptocurrency mining JavaScript (as useless as that is). It will never have any of these things. 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>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<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>
|
||||
<a class="button btn-secondary" href="/"><i class="fas fa-times"></i> Cancel</a>
|
||||
<button class="button btn-dangerous"><i class="fas fa-trash"></i> Delete bot</button>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="thin centred">Edit bot</h1>
|
||||
<h1 class="thin centred">Configure bot</h1>
|
||||
<p class="large centred">@botname@example.com</p>
|
||||
</div>
|
||||
|
||||
|
|
5
webui.py
5
webui.py
|
@ -1,7 +1,10 @@
|
|||
from flask import Flask, render_template, session
|
||||
import json
|
||||
|
||||
cfg = json.load(open("config.json"))
|
||||
|
||||
app = Flask(__name__)
|
||||
app.secret_key = "debug key"
|
||||
app.secret_key = cfg['secret_key']
|
||||
|
||||
@app.route("/")
|
||||
def hello():
|
||||
|
|
Loading…
Reference in a new issue