diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..d091b1c --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,19 @@ +name: Manually Deploy to Heroku + +on: + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: akhileshns/heroku-deploy@v3.12.12 + with: + heroku_api_key: ${{secrets.HEROKU_API_KEY}} + heroku_app_name: ${{secrets.HEROKU_APP_NAME}} + heroku_email: ${{secrets.HEROKU_EMAIL}} + usedocker: true + docker_heroku_process_type: web + stack: "container" + region: "us" diff --git a/Dockerfile b/Dockerfile index 22ceaa8..dc5018d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,30 @@ -FROM ubuntu:20.04 -ENV DEBIAN_FRONTEND=noninteractive +FROM alpine:edge RUN mkdir -p /app WORKDIR /app COPY . . -RUN chmod +x setup.sh && sh setup.sh +RUN apk add --update --no-cache --update-cache \ + bash python3 nodejs npm \ + curl wget git \ + nano \ + zip unzip p7zip \ + gcc libc-dev g++ python3-dev make -#install megatools -#install required packages to compile source -#install dependencies for megatools experimental 1.11.0 (meson also) -# apt install meson ninja-build libglib2.0-dev libcurl4-openssl-dev build-essential libssl-dev checkinstall pkg-config cmake -# RUN git clone https://megous.com/git/megatools && cd megatools && meson b && ninja -C b && ninja -C b install && rm -rf ~/megatools +RUN apk add --no-cache \ + --repository http://dl-cdn.alpinelinux.org/alpine/edge/community \ + py3-pip yarn cadaver + + +RUN pip3 install --no-cache-dir -r requirements.txt + + +# Install TGrclonebot +RUN git clone https://github.com/Frozen12/TelegramShellBot-Rclone.git && \ + cd TelegramShellBot-Rclone && \ + yarn install + +# Alpine image dependencies are below +# bash gcc libc-dev g++ python3-dev make ( python3 module : pycryptodomex ) CMD ["bash", "start.sh"] diff --git a/Procfile b/Procfile index 8b4228b..3adf142 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -worker: bash.start +worker: bash start.sh diff --git a/requirements.txt b/requirements.txt index b1df116..0e825bb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ yt-dlp +pycryptodomex diff --git a/setup.sh b/setup.sh deleted file mode 100644 index ca2632c..0000000 --- a/setup.sh +++ /dev/null @@ -1,28 +0,0 @@ -#! /bin/bash -apt update && apt upgrade -y && apt install -y software-properties-common && apt update && add-apt-repository universe && add-apt-repository multiverse -apt update && apt install -y --no-install-recommends \ - python3.8 python3-pip curl wget git \ - make python-is-python3 build-essential cmake \ - nano \ - zip unzip p7zip-full p7zip-rar \ - ffmpeg fuse \ - rdfind - -# apt install -y php openssh-server -# install node v14.x including npm -curl -sL https://deb.nodesource.com/setup_14.x | bash - -apt install -y nodejs - -rm -rf /var/lib/apt/lists/* -npm install -g localtunnel yarn -pip3 install --no-cache-dir -r requirements.txt - -# install aria2c -# curl -Oaria2.deb https://tebi.com/7yhtraria2.deb - - -# Install TGrclonebot -git clone https://github.com/Frozen12/TelegramShellBot-Rclone.git -cd TelegramShellBot-Rclone -yarn install - diff --git a/start.sh b/start.sh index bd2297f..47f76d8 100644 --- a/start.sh +++ b/start.sh @@ -1,31 +1,5 @@ #!/bin/bash -# Install rclone static binary -wget -q https://downloads.rclone.org/v1.58.1/rclone-v1.58.1-linux-amd64.zip -unzip -q rclone-*-linux-amd64.zip -export PATH=$PWD/rclone-v1.58.1-linux-amd64:$PATH -echo "Rclone installed successfully" -# remove junk -rm -rf rclone-*-linux-amd64.zip *.txt *yml *.md - -# Create rclone.conf file from base64 -if [[ -n $RCLONE_CONFIG_BASE64 ]]; then - echo "Rclone config detected" - echo "[DRIVE]" > rclone.conf - mkdir -p $HOME/.config/rclone - echo "$(echo $RCLONE_CONFIG_BASE64|base64 -d)" >> $HOME/.config/rclone/rclone.conf - echo "Rclone config placed in position" -fi - -# fetch rclone.conf from url - -if [[ -n $RCLONE_CONFIG_URL ]]; then - echo "Fetching rclone.conf from url" - mkdir -p $HOME/.config/rclone - curl -o$HOME/.config/rclone/rclone.conf "$RCLONE_CONFIG_URL" - -fi - # Set bot token & owner ID if [[ -n $BOT_TOKEN && -n $OWNER_ID ]]; then