Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Modify Dockerfile, Rearrange Configurations and Remove redundancy in start.sh #50

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
160 changes: 160 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
83 changes: 34 additions & 49 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,71 +1,56 @@
FROM ubuntu

RUN apt-get update
RUN apt-get install sudo
RUN sudo apt-get update
# Basic Setup

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone
RUN apt-get install wget -y
RUN apt-get install git -y
RUN apt-get install curl -y
RUN apt-get install unzip -y
RUN sudo apt install python3 -y
RUN sudo apt install python3-dev -y
RUN sudo apt install python3-pip -y
RUN sudo apt install python3-pillow -y

RUN apt-get update && apt-get install -y sudo && sudo apt-get update
RUN sudo apt-get install -y wget git curl unzip python3 python3-dev python3-pip python3-pillow gcc libffi-dev libssl-dev
RUN sudo apt-get install -y tzdata aria2 nginx ffmpeg

# PyPI Packages

RUN sudo apt-get install -y gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils
RUN pip3 install -U pip
RUN pip3 install -U pyrogram tgcrypto telegraph aria2p mutagen requests yt-dlp apscheduler pyromod psutil nest_asyncio pyppeteer ffmpeg-python

RUN apt install tzdata -y
RUN apt-get install aria2 -y
RUN apt-get install nginx -y
RUN sudo apt-get install -y libxml2-dev libxslt-dev
RUN pip3 install -U beautifulsoup4
RUN pip3 install -U lxml
RUN pip3 install -U nhentai
RUN sudo apt-get clean

## install.sh: script to install Rclone and filebrowser
COPY root /
RUN apt install ffmpeg -y
RUN sudo chmod 777 /install.sh
RUN bash install.sh

RUN mv /nginx.conf /etc/nginx/

# Configuration

RUN mkdir /root/.aria2
COPY config /root/.aria2/
RUN pip3 install --upgrade pip

RUN sudo apt-get install gcc libffi-dev libssl-dev -y

RUN pip3 install -U pyrogram tgcrypto
#RUN pip3 install pillow
RUN pip3 install telegraph
RUN pip3 install aria2p
RUN pip3 install mutagen
RUN pip3 install requests
RUN pip3 install -U yt-dlp
RUN pip3 install apscheduler
RUN pip3 install pyromod
RUN pip3 install psutil
RUN pip3 install nest_asyncio
RUN pip3 install pyppeteer
RUN sudo apt-get install gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils -y
#RUN pyppeteer-install
## upload.sh: Use Rclone to upload files after Aria2 download is complete
COPY config/upload.sh /
COPY config/rclone /root/.config/rclone
RUN chmod 0777 /upload.sh

RUN pip3 install nhentai --upgrade
RUN pip3 install beautifulsoup4 --upgrade
RUN apt-get install libxml2-dev libxslt-dev -y
RUN pip3 install lxml --upgrade
## for nginx
COPY config/nginx /etc/nginx

## for AriaNG
RUN mkdir /index
COPY /index.html /index
COPY index.html /index

## for aria2
RUN mkdir /root/.aria2
COPY config/aria2 /root/.aria2/
RUN sudo chmod 777 /root/.aria2/

## Bot
RUN mkdir /bot
COPY bot /bot
RUN chmod 0777 /bot/ -R

RUN sudo chmod 777 /root/.aria2/

COPY /config/upload.sh /
RUN chmod 0777 /upload.sh

COPY /start.sh /
CMD chmod 0777 start.sh && bash start.sh
CMD wget https://raw.githubusercontent.com/666wcy/ARPT-Bot/main/start.sh -O start.sh && chmod 0777 start.sh && bash start.sh
# Start Daemon
COPY start.sh /
CMD chmod 0777 start.sh && bash start.sh
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added config/aria2/aria2.session
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added config/rclone/rclone.conf
Empty file.
119 changes: 0 additions & 119 deletions nginx.conf

This file was deleted.

32 changes: 3 additions & 29 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,38 +1,12 @@
#!/bin/bash




touch /root/.aria2/aria2.session
chmod 0777 /root/.aria2/ -R

nohup filebrowser -r / -p 9184 >> /dev/null 2>&1 &
#nohup ./FolderMagic -aria "http://127.0.0.1:6800/jsonrpc" -auth root:$Aria2_secret -bind :9184 -root / -wd /webdav >> /dev/null 2>&1 &

mkdir /.config/
mkdir /.config/rclone
touch /.config/rclone/rclone.conf

wget git.io/tracker.sh
chmod 0777 /tracker.sh
/bin/bash tracker.sh "/root/.aria2/aria2.conf"

rm -rf /bot
git clone https://github.com/666wcy/ARPT-Bot.git
mkdir /bot/
mv /ARPT-Bot/bot/* /bot/

rm /etc/nginx/nginx.conf
cp /ARPT-Bot/root/nginx.conf /etc/nginx/

rm -rf /ARPT-Bot

#python3 /bot/nginx.py
nginx -c /etc/nginx/nginx.conf
nginx -s reload

/bin/bash /root/.aria2/tracker.sh "/root/.aria2/aria2.conf"

nohup aria2c --conf-path=/root/.aria2/aria2.conf --rpc-listen-port=8080 --rpc-secret=$Aria2_secret &
nohup rclone rcd --rc-addr=127.0.0.1:5572 --rc-user=root --rc-pass=$Aria2_secret --rc-allow-origin="https://elonh.github.io" &
#nohup python3 /bot/web.py &
nohup filebrowser -r / -p 9184 >> /dev/null 2>&1 &

python3 /bot/main.py