Go to file
foreverxml 7ddb252548 fix error 2022-05-14 07:46:15 -06:00
flaskring fix error 2022-05-14 07:46:15 -06:00
.gitignore Move to Poetry and app 2022-05-13 16:47:36 -06:00
LICENSE Initial commit 2022-05-13 01:44:08 +02:00
README.md remove comment 2022-05-13 16:49:56 -06:00
poetry.lock Move to Poetry and app 2022-05-13 16:47:36 -06:00
pyproject.toml Move to Poetry and app 2022-05-13 16:47:36 -06:00
sites.example.json README and examples 2022-05-12 22:39:07 -06:00

README.md

Flaskring

A simple webring backend made with Flask.

How to set up

Install the following dependencies:

python3
python3-pip
git

Then, run the following commands:

pip install flask

# Clone the repo
git clone https://codeberg.org/amongtech/flaskring
cd flaskring

# Edit these files as needed
cp flaskring/templates/error.example.html flaskring/templates/error.html
cp flaskring/templates/ringhome.example.html flaskring/templates/ringhome.html
cp sites.example.json sites.json

# Once done, run the run command
FLASK_APP=flaskring flask run

Configuration

Static assets

To make static assets, run the command:

mkdir static

and place all static assets in there. In your files, reference them with static/file.exs.

ringhome.html

ringhome.html is the homepage for your webring. You may use any valid HTML, CSS, JS, anything, but if you want your links to show on the homepage you must include a snippet like so: (the following snippet uses an unordered list to show all URLS, you can use anything):

<ul>
{% for site in sites %}
	<li><a href="https://{{ site.url }}">{{ site.name }}</a></li>
{% endfor %}
</ul>

error.html

error.html is loaded whenever there is an error with the request. The only required template message (to show the error) is {{ text }}.

sites.json

A typical sites.json config would look as follows:

{ "sites": [
	{
		"name": "Example",
		"url": "example.com"
	},
	{
		"name": "Example 2",
		"url": "two.example.com"
	}
]}

These names are loaded into the index page, and the urls must not have an HTTP/HTTPS protocol indicator before them as Flaskring adds them.

Contributions are welcome!