and though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here

...
 
Commits (5)
src/
\ No newline at end of file
......@@ -5,7 +5,7 @@ variables)
## How to Patch?
1. Run the `install_patcher.sh` script using the snippet below.
1. Run the `install_patcher.sh` script using the snippet below and follow prompts if needed.
```sh
# Usually most Linux distros have curl, try this first:
curl -o- https://raw.githubusercontent.com/ThePinsTeam-FedSupport/CymaticScanner-LinuxPatch/main/install_patcher.sh | bash
......@@ -14,7 +14,10 @@ curl -o- https://raw.githubusercontent.com/ThePinsTeam-FedSupport/CymaticScanner
wget -qO- https://raw.githubusercontent.com/nvm-sh/CymaticScanner-LinuxPatch/main/install_patcher.sh | bash
```
2. Navigate to the `~/.csLinuxPatch`
2. Once the process is finished, navigate to the `~/.csLinuxPatch` and do the following:
a. Run `bash ./bin/configure-bot` to configure your userbot.
b. Edit `src/Sibyl_System/elevated_users.json` file using your favorite editor.
c. Run `bash ./bin/start-bot` to start the bot up.
## A note of warning
......
#!/bin/bash
UB_DIR="$HOME/.csLinuxPatcher/src"
DEFAULT_UPSTREAM_REPO="https://github.com/AnimeKaizoku/SibylSystem"
cd $UB_DIR
git remote add upstream $DEFAULT_UPSTREAM_REPO || git remote set-url upstream $DEFAULT_UPSTREAM_REPO
git fetch --all
git checkout --
#!/bin/bash
# Currently, this script requires arguments to continue.
# Contributions wanted!
UB_DIR="$HOME/.csLinuxPatcher/src"
DEFAULT_UPSTREAM_REPO="https://github.com/AnimeKaizoku/SibylSystem"
reset-repo-online() {
case $2 in
origin)
cd $UB_DIR
git fetch origin
git reset --hard origin/master
git clean -d --force
;;
upstream)
cd $UB_DIR
git remote add upstream $UPSTREAM_REPO || git remote set-url upstream $UPSTREAM_REPO
git fetch upstream
git reset --hard upstream/master
git clean -d --force
;;
*)
echo "No matches found, fallback to fetching from remote origin"
cd $UB_DIR
git fetch
git reset --hard origin/master
git clean -d --force
;;
esac
}
# https://stackoverflow.com/a/7069755
if [ -z "$1" ]
then
echo "$0: No arguments detected. See the -h flag for usage."
exit 1
fi
while test $# -gt 0; do
case "$1" in
-h|--help)
echo "./bin/remove-patches - Removes Linux UB Patches magically with git reset."
echo " "
echo "Usage: $0 [option]"
echo " "
echo "Options:"
echo "-h, --help show brief help"
echo "--start start the reset process (when prompted, press y to continue)"
echo "-f, --force-reset forcefully resets local repo, hence skipping the prompts"
echo "-l, --local-reset specify a directory to store output in"
echo "-u, --upstream pull commits from upstream repo (defaults to github:AnimeKaizoku/SibylSystem)"
echo "-r, --upstream-repo=<GIT REPO>"
exit 0
;;
-f|--force-reset)
reset-repo-online
;;
--action)
export PROCESS=`echo $1 | sed -e 's/^[^=]*=//g'`
shift
;;
-u)
shift
if test $# -gt 0; then
export OUTPUT=$1
else
echo "no output dir specified"
exit 1
fi
shift
;;
--output-dir*)
export OUTPUT=`echo $1 | sed -e 's/^[^=]*=//g'`
shift
;;
*)
;;
esac
done
......@@ -2,52 +2,8 @@
{
### START KANG FROM https://gitlab.com/friendly-telegram/friendly-telegram/-/blob/master/install.sh ###
if [ ! -n "$BASH" ]; then
echo "Non-bash shell detected, fixing..."
bash -c '. <('"$(command -v curl >/dev/null && echo 'curl -Ls' || echo 'wget -qO-')"' https://gitlab.com/friendly-telegram/friendly-telegram/-/raw/master/install.sh) '"$*"
exit $?
fi
# Modified version of https://stackoverflow.com/a/3330834/5509575
sp='/-\|'
spin() {
printf '\b%.1s' "$sp"
sp=${sp#?}${sp%???}
}
endspin() {
printf '\r%s\n' "$@"
}
runin() {
# Runs the arguments and spins once per line of stdout (tee'd to logfile), also piping stderr to logfile
{ "$@" 2>>../ftg-install.log || return $?; } | while read -r line; do
spin
printf "%s\n" "$line" >> ../ftg-install.log
done
}
runout() {
# Runs the arguments and spins once per line of stdout (tee'd to logfile), also piping stderr to logfile
{ "$@" 2>>ftg-install.log || return $?; } | while read -r line; do
spin
printf "%s\n" "$line" >> ftg-install.log
done
}
errorin() {
endspin "$@"
cat ../ftg-install.log
}
errorout() {
endspin "$@"
cat ftg-install.log
}
### START KANG FROM https://gitlab.com/friendly-telegram/friendly-telegram/-/blob/master/install.sh ###
CSPATCH_HOME="$HOME/.csLinuxPatcher"
CS_SOURCE_REPO="https://github.com/AnimeKaizoku/SibylSystem"
CS_REPO_URL_DEFAULT="https://github.com/AnimeKaizoku/SibylSystem"
CSPATCH_HOME=".csLinuxPatcher"
# Because you're self-hosting, no heroku3 included.
PIP_DEPENDENCY_LIST="telethon aiohttp motor dnspython pillow"
......@@ -57,56 +13,99 @@ echo "-------------------------"
echo "The installer will walk you through downloading the Linux patch repo,"
echo "installing dependencies for the userbot, and magically doing some patches."
echo ""
echo "Please wait for 10 seconds for the installation process will start."
echo "Please wait for 5 seconds for the installation process will start."
echo "IF you never intended to use this script, perhaps you have the patcher repo"
echo "and the userbot is successfully patch or not for now, please abort the script"
echo "by pressing Ctrl+C on your keyboard."
echo "========================="
sleep 10
sleep 5
read -p 'Enter repoistory URL for your fork of Cymatic Scanner UB (leave it blank for default) ' CS_REPO_URL
if echo "$OSTYPE" | grep -qE '^linux-gnu.*' && [ -f '/etc/debian_version' ]; then
PKGMGR="apt-get install -y"
if [ ! "$(whoami)" = "root" ]; then
# Relaunch as root, preserving arguments
if command -v sudo >/dev/null; then
endspin "Restarting as root..."
echo "Relaunching" >>ftg-install.log
sudo "$BASH" -c '. <('"$(command -v curl >/dev/null && echo 'curl -Ls' || echo 'wget -qO-')"' https://gitlab.com/friendly-telegram/friendly-telegram/-/raw/master/install.sh) '"$*"
exit $?
if [ $THEIA_WORKSPACE_ROOT == "/workspace/CymaticScanner-LinuxPatch" ] && [ $PWD == $THEIA_WORKSPACE_ROOT ]; then
echo "Looks like you're on your own copy of the Linux patcher repo on Gitpod."
sleep 3
if [[ $CS_REPO_URL != "" ]]; then
echo "Cloning $CS_REPO_URL in progress..."
git clone $CS_REPO_URL src
else
PKGMGR="true"
echo "Cloning $CS_REPO_URL_DEFAULT in progress..."
git clone $CS_REPO_URL_DEFAULT src
fi
else
runout dpkg --configure -a
runout apt-get update # Not essential
fi
PYVER="3"
elif echo "$OSTYPE" | grep -qE '^linux-gnu.*' && [ -f '/etc/arch-release' ]; then
PKGMGR="pacman -Sy --noconfirm"
if [ ! "$(whoami)" = "root" ]; then
# Relaunch as root, preserving arguments
if command -v sudo >/dev/null; then
endspin "Restarting as root..."
echo "Relaunching" >>ftg-install.log
sudo "$BASH" -c '. <('"$(command -v curl >/dev/null && echo 'curl -Ls' || echo 'wget -qO-')"' https://gitlab.com/friendly-telegram/friendly-telegram/-/raw/master/install.sh) '"$*"
exit $?
CSPATCH_HOME_DIR=$THEIA_WORKSPACE_ROOT
elif [ $THEIA_WORKSPACE_ROOT == "/workspace/CymaticScanner-LinuxPatch" ] && [ $PWD != $THEIA_WORKSPACE_ROOT ]; then
echo "Looks like you're on your own copy of the Linux patcher repo on Gitpod."
sleep 3
if [[ $CS_REPO_URL != "" ]]; then
echo "Cloning $CS_REPO_URL in progress..."
git clone $CS_REPO_URL src
else
PKGMGR="true"
echo "Cloning $CS_REPO_URL_DEFAULT in progress..."
git clone $CS_REPO_URL_DEFAULT src
fi
fi
PYVER="3"
elif echo "$OSTYPE" | grep -qE '^linux-android.*'; then
runout apt-get update
PKGMGR="apt-get install -y"
PYVER=""
elif echo "$OSTYPE" | grep -qE '^darwin.*'; then
if ! command -v brew >/dev/null; then
ruby <(curl -fsSk https://raw.github.com/mxcl/homebrew/go)
fi
PKGMGR="brew install"
PYVER="3"
CSPATCH_HOME_DIR=$THEIA_WORKSPACE_ROOT
elif [ $THEIA_WORKSPACE_ROOT != "/workspace/CymanticScanner-LinuxPatch"];
echo "Looks like you're using Gitpod, but you didn't opened the repo as an new workspace."
sleep 3
cd /workspace
git clone https://git.rip/MadeByThePinsHub/CymaticScanner-LinuxPatch
cd CymaticScanner-LinuxPatch
if [[ $CS_REPO_URL != "" ]]; then
echo "Cloning $CS_REPO_URL in progress..."
git clone $CS_REPO_URL src
else
echo "Cloning $CS_REPO_URL_DEFAULT in progress..."
git clone $CS_REPO_URL_DEFAULT src
fi
CSPATCH_HOME_DIR="/workspace/CymanticScanner-LinuxPatch"
elif [[ $PWD != $HOME ]]; then
cd $HOME
git clone https://git.rip/MadeByThePinsHub/CymaticScanner-LinuxPatch $CSPATCH_HOME
cd $CSPATCH_HOME
if [[ $CS_REPO_URL != "" ]]; then
echo "Cloning $CS_REPO_URL in progress..."
git clone -q $CS_REPO_URL "$CSPATCH_HOME/src"
else
echo "Cloning $CS_REPO_URL_DEFAULT in progress..."
git clone -q $CS_REPO_URL_DEFAULT "$CSPATCH_HOME/src"
fi
CSPATCH_HOME_DIR="$HOME/$CSPATCH_HOME"
else
endspin "Unrecognised OS. Please follow https://friendly-telegram.gitlab.io/installing_advanced"
exit 1
git clone https://git.rip/MadeByThePinsHub/CymaticScanner-LinuxPatch $CSPATCH_HOME
if [[ $CS_REPO_URL != "" ]]; then
echo "Cloning $CS_REPO_URL in progress..."
git clone $CS_REPO_URL "$CSPATCH_HOME/src"
else
echo "Cloning $CS_REPO_URL_DEFAULT in progress..."
git clone $CS_REPO_URL_DEFAULT "$CSPATCH_HOME/src"
fi
CSPATCH_HOME_DIR="$HOME/$CSPATCH_HOME"
fi
case $(uname | tr '[:upper:]' '[:lower:]') in
linux*)
command -v python3 || echo "Python isn't installed. Doing installation with sudo..." && sudo apt-get install python3 python3-pip
command -v pip3 || echo "Wait, what?!? Installing pip3 with sudo..." && sudo apt-get python3-pip
pip3 install $PIP_DEPENDENCY_LIST
;;
darwin*)
command -v python3 || curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh) && brew install python3
pip3 install $PIP_DEPENDENCY_LIST
;;
msys*)
echo "I don't support Windows yet, you need to manually install Python 3 and then install"
echo "the dependencies listed in $PWD/src/requirements.txt without heroku3 with pip."
exit
;;
*)
echo "I don't support other OSes yet, you need to manually install Python3 and then install"
echo "the dependencies listed in $PWD/src/requirements.txt without heroku3 with pip."
exit
;;
esac
if [ -z ${THEIA_WORKSPACE_ROOT+x} ]; then echo $CSPATCH_HOME_DIR > $HOME/.csLinuxPatcherHome ; else echo $CSPATCH_HOME_DIR > /workspace/.csLinuxPatcherHome; fi
echo "✅ Successfully installed the patcher! Now run `bash ./bin/patch` to patch source code. (Not needed if you"
echo " manually patched the code for Linux)"
}
\ No newline at end of file