diff --git a/forgetthis/Dockerfile b/forgetthis/Dockerfile deleted file mode 100644 index eac6d7c..0000000 --- a/forgetthis/Dockerfile +++ /dev/null @@ -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 \ No newline at end of file diff --git a/forgetthis/README.md b/forgetthis/README.md deleted file mode 100644 index fc9f6a5..0000000 --- a/forgetthis/README.md +++ /dev/null @@ -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. diff --git a/forgetthis/TODO b/forgetthis/TODO deleted file mode 100644 index 43c7bc0..0000000 --- a/forgetthis/TODO +++ /dev/null @@ -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 diff --git a/forgetthis/build_container.sh b/forgetthis/build_container.sh deleted file mode 100755 index 2c22a7a..0000000 --- a/forgetthis/build_container.sh +++ /dev/null @@ -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/ diff --git a/forgetthis/configure_build.sh b/forgetthis/configure_build.sh deleted file mode 100755 index 8f886de..0000000 --- a/forgetthis/configure_build.sh +++ /dev/null @@ -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" diff --git a/forgetthis/patches/fix_missing_index_static_include_bug.patch b/forgetthis/patches/fix_missing_index_static_include_bug.patch deleted file mode 100644 index 9f26c00..0000000 --- a/forgetthis/patches/fix_missing_index_static_include_bug.patch +++ /dev/null @@ -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 @@ -+ -+ -+ -+ -+ %s -+ -+ -+ -+ -+
-+
-+
-+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+
-+ %s -+
-+
-+
-+ -+