$ git clone https://codeberg.org/blenderdumbass/BDServer
$ cd BDServer
$ python3 run.py
BDServer Help
--help - Prints this Help Page.
--run - Run the server.
--set - Use for changing settings.
--account - Manage Accounts.
--create - Start a new article.
--config - Edit config file directly, bypassing --set.
--folder - Open the folder of the website's data.
--federation - Federation settings with other BDServers.
--transfer - Transfers legacy website data to the new format.
$ python3 run.py --run
localhost:8080 and see the damn thing load up. Oh wait a second. I have to explain you what the hell localhost:8080 is.
↩ Reply
localhost is a placeholder name for "this very machine" which what the browser will try to connect to if you try to go to localhost from it. The :8080 is referring to a port on that machine.
↩ Reply
8070 actually. So for me, it is much faster to use the same website, by simply typing localhost:8070 in the browser.
↩ Reply
8070 if it is 8080? Well, here is where the <ul><li>-set commands come into play.
↩ Reply
$ python3 run.py --set BDServer Set Help Set is used for setting up server configurations. --title - Set title of the website. --tagline - Set tagline of the website. --domain - Let the server know the clearnet domain. --tor - Let the server know the tor domain. --email - Set Email SMTP account for internal automatic messages. --account - Set the Main Account, for the footer and stuff. --port - Set port where to run the website. --css - Set a CSS file. --css_edit - edit a CSS file. --favicon - Set a favicon file. --add_tab - Adds a category of articles. --edit_tab - Edit the config of a category. --tab_rows - Set in how many rows to draw the tabs. --editor - Set editor. Default nano. --fc_api - API for software Free Competitors search.
<ul><li>-set in the end instead of --run and get a bunch of other options. All of which are rather useful. The option --port changes the port. So to make it be 8070 as in my case, you do:
↩ Reply
$ python3 run.py --set --port 8070
<ul><li>-title is blenderdumbass . org and --tagline is The elite club for the Ultimate Hackers! while --favicon is this image:
↩ Reply
git pull updates to the source code. If you change the one in the source code, it will work, but every update will be a hassle. Otherwise setting an external one will not be such a hassle.
↩ Reply
~/.local/share/BDServer you will be able to see that it made a bunch of folders there and it probably includes a few files there, such as the config.json file which contains the stuff you set with the <ul><li>-set.
↩ Reply
tabs folder on my computer containing an articles folder, where there is a folder with this very article you are reading.
↩ Reply
.md file with the actual text of it. And a .json file with a bunch of metadata.
↩ Reply
$ python3 run.py --set --add_tab articles
tabs folder besides the config.json called articles. Or if you typed bullshit it will be called bullshit. Basically after the <ul><li>-add_tab type the name of the folder there, okay?
↩ Reply
.json file, where you can set a few things. Here is what the one on my articles looks like:
↩ Reply
{ "icon": "scene", "title": "Articles" }
icon which is what image do you want beside the text. You can choose them from the icons folder in BDServer. In this case I use scene.
↩ Reply
title will govern how to show the text of the tab in the website itself. Basically you can see that the tab is called articles all lowercase, while on the website it is rendered as Articles with an uppercase "A". But you can spell something completely hilarious in there. Or even put some HTML code into there. Do whatever you want.
↩ Reply
$ python3 run.py --account
default.css file that comes with the server software. I suggest you copy that one over, and change that copy to fit your needs.
↩ Reply
:root { --color-important : #ffb800; --color-background : #353849; --color-text: #FFFFFF; --background-color: rgba(53,56,73, 1); --backdrop-filter: blur(8px); --padding: 10px 20px; --margin: 8px 0; --border-radius: 25px; --box-shadow: 0px 0px 15px rgba(0,0,0, 0.40); --box-shadow-focus: 0px 0px 30px rgba(0,0,0, 0.99); --code-string:#3dcf58; --code-variable:#ff64e7; --code-comment:#858899; } @font-face { font-family: "Exo"; src: url("/pictures/Exo2-Medium.ttf"); } html {background-color: var(--color-background); background-image: url("/pictures/new_pattern_whatever.jpg"); background-size: cover; background-attachment: fixed; background-position: center; color: var(--color-text); font-family:"Exo"; font-size:17; }
/pictures/ folder besides the config, is used to store files that the server serves, such as images and stuff. I'm using it also for the font. You probably don't have it. So some of it will be broken.
↩ Reply
git pull all you want and nothing will get dunked.
↩ Reply
/plugins folder into which you can put Python .py files which will be executed by the server when serving. At the moment the only thing possible to do with them, is to edit the HTML code before it is sent. For that the plugin has to have a onHTML() function like this:
↩ Reply
def onHTML(server, html): return html
def onHTML(server, html): print("Hello World") return html
def onHTML(server, html): html = html.replace("Open Source", "Free / Libre Software") return html
server variable that you also get, you can do more interesting stuff. For example server.path will give you the url of the page you are looking at. server.headers will give you headers of the request. Things like User-Agent and stuff like this. Then server.cookie will give you the unique visitor's identifier, useful also to see if the request coming from somebody who is logged in. And server.parsed will give you parsed url variables. You know those things like the you know... ?text=hello&other_text=World thingies and stuff.
↩ Reply
from modules import Render def onHTML(server, html): userdata = Render.validate(server.cookie) # Add something to the page if the user is Blender Dumbass if userdata.get("title") == "Blender Dumbass": html = html + "Something" return html