Remove obsolete broken stuff I only kept for reference

This commit is contained in:
ICScaryThings 2022-07-18 19:53:51 -04:00
parent d71669071c
commit 0b31179348
6 changed files with 0 additions and 188 deletions

View file

@ -1,17 +0,0 @@
FROM debian:testing
# TODO: have build and run deps seperate so the container can be made more lean
ENV BUILD_REQ="build-essential libcurl4-gnutls-dev libcjson-dev libpcre3-dev libfcgi-dev git pkgconf"
ENV RUN_REQ="spawn-fcgi fcgiwrap"
RUN apt update && apt upgrade -y
RUN apt install -y $BUILD_REQ $RUN_REQ
ENV TB_BUILD_DIR=/usr/local/src/treebird
COPY treebird $TB_BUILD_DIR
RUN make -C $TB_BUILD_DIR && make -C $TB_BUILD_DIR install
ENV TB_EXEC_BIN=/usr/local/bin/treebird
RUN chmod a+x $TB_EXEC_BIN
CMD fcgiwrap -c 10 -f -s tcp:0.0.0.0:4008

View file

@ -1,54 +0,0 @@
Containerized Treebird FE Build
========================================
This git repo contains the files needed to builder a docker containerized setup
of nekobit's C FCGI based Treebird Front End for Pleroma or other Mastodon compatibles.
## How to build the container image
The build is divided into two parts to allow you to make custom configuration changes.
Run the following to prepare the container build configuration.
./configure_build.sh instance_domain treebird_domain [treebird_fcgi_port (optional)]
options:
- `instance_domain`: domain of the instance for Treebird FE to connect to (ex: sleepy.cafe)
- `treebird_domain`: domain you plan serve Treebird on (ex: treebird.mysite.com)
- `treebird_fcgi_port`: internal FCGI port for your http server to communicate with Treebird
*DO NOT* set this unless you have a port conflict (default: 4008)
The script will generate a folder named `configs/` containing configuration files you
can edit further as needed before starting the build. Once ready, run the following:
./build_container.sh [image_name (optional)] [container_name (optional)]
NOTE: Unless your user is a member of the `docker` group, you will need root for this!
The build _should_ complete without errors and if you run `docker image ls` you should
see `treebird:latest` (or whatever alt image tag you set in the previous command).
## Troubleshooting
Various issues I have seen and solutions
### Random Issue I Saw - I
On older versions of debian you need to install `docker.io` to get docker
(the container software) rather than docker (some utility for docking widgets in GUIs I think).
### Random Issue I Saw - II
If the container build fails and you get the following message:
The key(s) in the keyring /etc/apt/trusted.gpg.d/debian-archive-bullseye-automatic.gpg are ignored as the file is not readable by user '_apt' executing
Try building the container locally or on another system. I saw this when running
from debian stable VPS. I think it is some kind of permission issue due to kernel
or docker version differences because the exact same image runs fine on other host distros.
After building elsewhere you can do the following:
docker save treebird:latest -o treebird.dsave
rsync -avP treebird.dsave name@myserver:~/
ssh name@myserver
docker load -i treebird.dsave
### Random Issue I Saw - III
In the nginx config it handles more than one set of a `fastcgi_param` very poorly
so if you `include fastcgi.conf` and try to set SCRIPTNAME after, it will fail to
update it and you will get the usual fastcgi cryptic error.

View file

@ -1,6 +0,0 @@
IMPORTANT:
- Ensure that the actual FCGI only runs as an unprivileged user
DESIRABLE:
- remove all dev tools from the output container image
- prune any undesired bloat from the image to save space

View file

@ -1,16 +0,0 @@
#!/bin/sh
# Build the container image and perfom additional steps
IMAGE_NAME=${1:-treebird:latest}
CONTAINER_NAME=${2:-treebird}
RESOURCES_SRC=/usr/local/share/treebird/dist
RESOURCES_DST=./to-webserv
docker build -t $IMAGE_NAME .
# copy out the shared dist files
docker run --rm --name $CONTAINER_NAME -d $IMAGE_NAME
docker cp ${CONTAINER_NAME}:${RESOURCES_SRC} ${RESOURCES_DST}
docker stop $CONTAINER_NAME
cp -r ${RESOURCES_DST} nginx-test/

View file

@ -1,30 +0,0 @@
#!/bin/bash
# Setup steps to preform before the actual build
INSTANCE_HOST=${1:-pl.example.com}
TREEBIRD_HOST=${2:-treebird.example.com}
TREEBIRD_PORT=${3:-4008}
CONFIG_DIR=./configs # user specific config items
mkdir -p $CONFIG_DIR
git submodule init
git submodule update
# apply misc patches to fix compile time bugs
patch -p1 < patches/*.patch
cp -r mastodont-c treebird/
cp treebird/config.def.h treebird/config.h
ln -s ../treebird/config.h ${CONFIG_DIR}
sed -i "/config_instance_url/ s/= .*;/= \"https:\\/\\/${INSTANCE_HOST}\\/\\\";/;\
/config_experimental_lookup/ s/= .*;/= FALSE;/" \
treebird/config.h
# Patch nginx config sample
sed "s/unix:.*;/127.0.0.1:${TREEBIRD_PORT};/g;s/treebird.example.com/${TREEBIRD_HOST}/g" \
treebird/docs/sample/treebird.nginx.conf > ${CONFIG_DIR}/treebird.nginx.conf
echo "Please edit configs/config.h (symlinked for convenience) as needed."
echo "Then run ./build_container.sh"

View file

@ -1,65 +0,0 @@
diff --git a/treebird/static/index.html b/treebird/static/index.html
new file mode 100644
index 0000000..4f12261
--- /dev/null
+++ b/treebird/static/index.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>%s</title>
+ <link rel="icon" type="image/png" href="/favicon.png">
+ <link rel="stylesheet" type="text/css" href="/%s%s.css">
+ </head>
+ <body %s>
+ <div></div>
+ <div id="main-page-container">
+ <div id="main-page">
+ <header id="navbar">
+ <a href="%s/"><img src="/treebird_logo.png" height="42"></a>
+ <span class="info">%s</span>
+ <div id="navbar-right-container">
+ <div id="navbar-right">
+ %s
+ <!-- Searchbox -->
+ <form action="%s/search" method="get">
+ <input type="textbox" class="group group-left group-inputbox" placeholder="%s" id="searchbox" name="q"><!-- i hate HTML
+ --><input type="submit" class="btn group group-right" value="%s">
+ </form>
+ </div>
+ </div>
+ </header>
+ <table id="content" class="ui-table">
+ <!-- Navigation -->
+ <tr>
+ <td id="leftbar" class="sidebar">
+ <ul>
+ <li><a class="sidebarbtn %s" href="%s/">%s</a></li>
+ <li><a class="sidebarbtn %s" href="%s/local/">%s</a></li>
+ <li><a class="sidebarbtn %s" href="%s/federated/">%s</a></li>
+ <li><a class="sidebarbtn %s" href="%s/notifications">%s</a></li>
+ <li><a class="sidebarbtn %s" href="%s/lists">%s</a></li>
+ <li><a class="sidebarbtn %s" href="%s/favourites">%s</a></li>
+ <li><a class="sidebarbtn %s" href="%s/bookmarks">%s</a></li>
+ <li><a class="sidebarbtn %s" href="%s/direct">%s</a></li>
+ <li><a class="sidebarbtn %s" href="%s/config">%s</a></li>
+ </ul>
+ %s
+ </td>
+
+ <!-- Display for posts -->
+ <td id="main">
+ %s
+ </td>
+
+ <!-- Notifications and such -->
+ <td id="rightbar" class="sidebar">
+ %s
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ </body>
+</html>