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. "743066cb3d5bfd420cc51782d74a76a7560e873a" and "d2f11e5fb599d75660d7cc428c0d7296e1438c20" have entirely different histories.

7 changed files with 4 additions and 55 deletions

2
.gitignore vendored
View file

@ -1,3 +1 @@
__pycache__ __pycache__
config.json
planning.txt

View file

@ -3,5 +3,3 @@ markovify==0.7.1
beautifulsoup4==4.7.1 beautifulsoup4==4.7.1
requests==2.22.0 requests==2.22.0
Flask==1.1.1 Flask==1.1.1
mysql-connector-python==8.0.17
bcrypt == 3.1.7

View file

@ -1,44 +0,0 @@
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
);

View file

@ -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> <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>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 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). 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> <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> <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>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>

View file

@ -17,7 +17,7 @@
<div class="container centred"> <div class="container centred">
<p>Are you sure you want to <strong>permanently</strong> delete bot name?</p> <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> <p>The account on instan.ce will remain open, but your bot will stop posting from it.</p>
<a class="button btn-secondary" href="/"><i class="fas fa-times"></i> Cancel</a> <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> <button class="button btn-dangerous"><i class="fas fa-trash"></i> Delete bot</button>
</div> </div>
</form> </form>

View file

@ -8,7 +8,7 @@
<body> <body>
<div class="container"> <div class="container">
<h1 class="thin centred">Configure bot</h1> <h1 class="thin centred">Edit bot</h1>
<p class="large centred">@botname@example.com</p> <p class="large centred">@botname@example.com</p>
</div> </div>

View file

@ -1,10 +1,7 @@
from flask import Flask, render_template, session from flask import Flask, render_template, session
import json
cfg = json.load(open("config.json"))
app = Flask(__name__) app = Flask(__name__)
app.secret_key = cfg['secret_key'] app.secret_key = "debug key"
@app.route("/") @app.route("/")
def hello(): def hello():