Initial commit

This commit is contained in:
Oscar Blue 2022-08-20 18:49:37 +01:00
commit 6eef1d760d
4 changed files with 87 additions and 0 deletions

23
Dockerfile Normal file
View file

@ -0,0 +1,23 @@
FROM python:3.10.4
# set version label
ARG PLUGET_VERSION=v1.7.2
LABEL maintainer="oscar@oscarpo.co"
ENV HOME="/config"
RUN curl -LO https://github.com/Neocky/pluGET/releases/download/$PLUGET_VERSION/pluGET-$PLUGET_VERSION.zip
RUN unzip -d config pluGET-$PLUGET_VERSION.zip
COPY /run.py $HOME
WORKDIR $HOME
RUN pip install -r requirements.txt
# allow non-interactive creation of config file
RUN sed -i '/input("Press any key + enter to exit...")/d' $HOME/src/handlers/handle_config.py
RUN python3 pluget.py
CMD python3 run.py && python3 pluget.py

4
README.md Normal file
View file

@ -0,0 +1,4 @@
# pluGET
A powerful package manager which updates [Plugins](https://www.spigotmc.org/resources/) and Server Software for minecraft servers.
For the original project license check: https://github.com/Neocky/pluGET

20
docker-compose.yml Normal file
View file

@ -0,0 +1,20 @@
version: "3"
services:
pluget:
build:
context: .
dockerfile: Dockerfile
image: noble/pluget
environment:
- CONNECTION=local
- LOCAL_PLUGIN_FOLDER=C:/Users/USER/Desktop/plugins
- LOCAL_ENABLE_SEPERATE_DOWNLOAD_PATH=false
- LOCAL_SEPERATE_DOWNLOAD_PATH=C:/Users/USER/Desktop/plugins
- REMOTE_SERVER=0.0.0.0
- REMOTE_USERNAME=user
- REMOTE_PASSWORD=password
- REMOTE_SFTP_PORT=22
- REMOTE_FTP_PORT=21
- REMOTE_PLUGIN_FOLDER=/plugins
- REMOTE_ENABLE_SEPERATE_DOWNLOAD_PATH=false
- REMOTE_SEPERATE_DOWNLOAD_PATH=/plugins/updated

40
run.py Normal file
View file

@ -0,0 +1,40 @@
import os
import sys
import ruamel.yaml
yaml = ruamel.yaml.YAML()
with open("pluGET_config.yaml", "r") as config_file:
data = yaml.load(config_file)
# Connection (local, sftp, ftp)
if "CONNECTION" in os.environ:
data['Connection'] = os.environ["CONNECTION"]
# LOCAL
if "LOCAL_PLUGIN_FOLDER" in os.environ:
data['Local']['PathToPluginFolder'] = os.environ["LOCAL_PLUGIN_FOLDER"]
if "LOCAL_ENABLE_SEPERATE_DOWNLOAD_PATH" in os.environ:
data['Local']['SeperateDownloadPath'] = os.environ[""]
if "LOCAL_SEPERATE_DOWNLOAD_PATH" in os.environ:
data['Local']['PathToSeperateDownloadPath'] = os.environ["LOCAL_SEPERATE_DOWNLOAD_PATH"]
# REMOTE
if "REMOTE_SERVER" in os.environ:
data['Remote']['Server'] = os.environ["REMOTE_SERVER"]
if "REMOTE_USERNAME" in os.environ:
data['Remote']['Username'] = os.environ["REMOTE_USERNAME"]
if "REMOTE_PASSWORD" in os.environ:
data['Remote']['Password'] = os.environ["REMOTE_PASSWORD"]
if "REMOTE_SFTP_PORT" in os.environ:
data['Remote']['SFTP_Port'] = os.environ["REMOTE_SFTP_PORT"]
if "REMOTE_FTP_PORT" in os.environ:
data['Remote']['FTP_Port'] = os.environ["REMOTE_FTP_PORT"]
if "REMOTE_PLUGIN_FOLDER" in os.environ:
data['Remote']['PluginFolderOnServer'] = os.environ["REMOTE_PLUGIN_FOLDER"]
if "REMOTE_ENABLE_SEPERATE_DOWNLOAD_PATH" in os.environ:
data['Remote']['SeperateDownloadPath'] = os.environ["REMOTE_ENABLE_SEPERATE_DOWNLOAD_PATH"]
if "REMOTE_SEPERATE_DOWNLOAD_PATH" in os.environ:
data['Remote']['PathToSeperateDownloadPath'] = os.environ["REMOTE_SEPERATE_DOWNLOAD_PATH"]
with open("pluGET_config.yaml", "w") as config_file:
yaml.dump(data, config_file)