diff --git a/cross/sickchill/Makefile b/cross/sickchill/Makefile new file mode 100644 index 00000000000..79d50f96591 --- /dev/null +++ b/cross/sickchill/Makefile @@ -0,0 +1,30 @@ +PKG_NAME = SickChill +PKG_VERS = 2021.03.10-1 +PKG_EXT = tar.gz +PKG_DIST_NAME = v$(PKG_VERS).$(PKG_EXT) +PKG_DIST_SITE = https://github.com/SickChill/SickChill/archive +PKG_DIR = $(PKG_NAME)-$(PKG_VERS) + +SC_GIT_BRANCH=master +SC_GIT_COMMIT_HASH=1e656000415b1e32dee9e04dabc53a3636045c02 +SC_GIT_COMMIT_BRANCH=v$(PKG_VERS) + +DEPENDS = + +HOMEPAGE = https://sickchill.github.io/ +COMMENT = Automatic Video Library Manager for TV Shows. It watches for new episodes of your favorite shows, and when they are posted it does its magic. +LICENSE = GPL + +CONFIGURE_TARGET = nop +COMPILE_TARGET = nop +INSTALL_TARGET = sickchill_install + +include ../../mk/spksrc.cross-cc.mk + +.PHONY: sickchill_install +sickchill_install: + mkdir -p $(STAGING_INSTALL_PREFIX)/share/$(PKG_NAME) + tar -cf - -C $(WORK_DIR)/$(PKG_DIR) . | tar -xf - -C $(STAGING_INSTALL_PREFIX)/share/$(PKG_NAME) + echo SC_GIT_BRANCH=${SC_GIT_BRANCH} > $(STAGING_INSTALL_PREFIX)/share/git_data + echo SC_GIT_COMMIT_HASH=${SC_GIT_COMMIT_HASH} >> $(STAGING_INSTALL_PREFIX)/share/git_data + echo SC_GIT_COMMIT_BRANCH=${SC_GIT_COMMIT_BRANCH} >> $(STAGING_INSTALL_PREFIX)/share/git_data diff --git a/cross/sickchill/PLIST b/cross/sickchill/PLIST new file mode 100644 index 00000000000..d5a341925f2 --- /dev/null +++ b/cross/sickchill/PLIST @@ -0,0 +1,2 @@ +rsc:share/SickChill +rsc:share/git_data diff --git a/cross/sickchill/digests b/cross/sickchill/digests new file mode 100644 index 00000000000..4a4e8305c02 --- /dev/null +++ b/cross/sickchill/digests @@ -0,0 +1,3 @@ +v2021.03.10-1.tar.gz SHA1 117436062e18350df570cd92565b2c15243bcc8f +v2021.03.10-1.tar.gz SHA256 a92d0a42704682412bcf9b6509bbf73a5a3597586deaf24764f52b88f0bc495d +v2021.03.10-1.tar.gz MD5 50ce8b411632870b9a17c8890a023eb3 diff --git a/spk/haproxy/src/app/application/db.py b/spk/haproxy/src/app/application/db.py index f5dbee89d80..63f41328e6b 100644 --- a/spk/haproxy/src/app/application/db.py +++ b/spk/haproxy/src/app/application/db.py @@ -89,6 +89,7 @@ def default_config(): session.add(Backend(id=17, name=u'file', servers=u'file localhost:7000 check')) session.add(Backend(id=18, name=u'haproxy', servers=u'haproxy localhost:8280 check')) session.add(Backend(id=19, name=u'deluge', servers=u'deluge localhost:8112 check')) + session.add(Backend(id=20, name=u'sickchill', servers=u'sickchill localhost:8081 check')) session.add(Frontend(id=1, name=u'http', binds=u':5080', default_backend_id=1, options=ur'option http-server-close,option forwardfor')) session.add(Frontend(id=2, name=u'https', binds=u':5443 ssl crt /usr/local/haproxy/var/crt/default.pem ciphers AESGCM+AES128:AES128:AESGCM+AES256:AES256:RSA+RC4+SHA:!RSA+AES:!CAMELLIA:!aECDH:!3DES:!DSS:!PSK:!SRP:!aNULL no-sslv3', options=ur'option http-server-close,option forwardfor,rspirep ^Location:\ http://(.*)$ Location:\ https://\1, rspadd Strict-Transport-Security:\ max-age=31536000;\ includeSubDomains', default_backend_id=1)) session.add(Association(frontend_id=2, backend_id=2, condition=u'if { hdr_beg(Host) -i dsm. }')) @@ -109,4 +110,5 @@ def default_config(): session.add(Association(frontend_id=2, backend_id=17, condition=u'if { hdr_beg(Host) -i file. }')) session.add(Association(frontend_id=2, backend_id=18, condition=u'if { hdr_beg(Host) -i haproxy. }')) session.add(Association(frontend_id=2, backend_id=19, condition=u'if { hdr_beg(Host) -i deluge. }')) + session.add(Association(frontend_id=2, backend_id=20, condition=u'if { hdr_beg(Host) -i sickchill. }')) session.commit() diff --git a/spk/sickchill/Makefile b/spk/sickchill/Makefile new file mode 100644 index 00000000000..84e2bd79ea1 --- /dev/null +++ b/spk/sickchill/Makefile @@ -0,0 +1,41 @@ +SPK_NAME = sickchill +SPK_VERS = $(shell date +%Y%m%d) +SPK_REV = 1 +SPK_ICON = src/sickchill.png + +DEPENDS = cross/$(SPK_NAME) +SPK_DEPENDS = "python3>=3.6:git" +PIP=pip3 + +WHEELS = src/requirements.txt + +MAINTAINER = Nyaran +DESCRIPTION = Automatic Video Library Manager for TV Shows. It watches for new episodes of your favorite shows, and when they are posted it does its magic. +DESCRIPTION_SPN = Gestor automático para bibliotecas de series. Busca nuevos episodios de tus series favoritas, y cuando son publicados hace su magia. +STARTABLE = yes +DISPLAY_NAME = SickChill +CHANGELOG = "Initial SickChill version" + +HOMEPAGE = https://sickchill.github.io/ +LICENSE = GPL + +SERVICE_USER = auto +SERVICE_SETUP = src/service-setup.sh +SERVICE_PORT = 8081 +SERVICE_PORT_TITLE = $(DISPLAY_NAME) + +# Admin link for in DSM UI +ADMIN_PORT = $(SERVICE_PORT) + +WIZARDS_DIR = src/wizard/ + +POST_STRIP_TARGET = sickchill_extra_install + +# Pure Python package, make sure ARCH is not defined +override ARCH= + +include ../../mk/spksrc.spk.mk + +.PHONY: sickchill_extra_install +sickchill_extra_install: + install -m 755 -d $(STAGING_DIR)/var diff --git a/spk/sickchill/PLIST b/spk/sickchill/PLIST new file mode 100644 index 00000000000..4cfaf73a12c --- /dev/null +++ b/spk/sickchill/PLIST @@ -0,0 +1 @@ +rsc:share/wheelhouse diff --git a/spk/sickchill/src/requirements.txt b/spk/sickchill/src/requirements.txt new file mode 100644 index 00000000000..09ac88c85a7 --- /dev/null +++ b/spk/sickchill/src/requirements.txt @@ -0,0 +1,88 @@ +appdirs==1.4.4 +attrdict==2.0.1 +babelfish==0.5.5 +beautifulsoup4==4.9.3 +###beekeeper==0.9.2 +bencode.py==4.0.0 +CacheControl==0.12.6 +certifi==2020.11.8 +###cffi==1.14.3 +chardet==3.0.4 +click==7.1.2 +cloudscraper==1.2.48 +configobj==5.0.6 +###cryptography==3.2.1 +decorator==4.4.2 +deluge-client==1.9.0 +Deprecated==1.2.10 +dogpile.cache==1.0.2 +enzyme==0.4.1 +feedparser==6.0.2 +future==0.18.2 +gntp==1.0.3 +guessit==3.1.1 +html5lib==1.1 +httplib2==0.18.1 +idna==2.10 +ifaddr==0.1.7 +imagesize==1.2.0 +IMDbPY==2020.9.25 +ipaddress==1.0.23 +Js2Py==0.70 +jsonrpclib-pelix==0.4.2 +###kodipydent==0.3.1 +###lxml==4.6.1 +Mako==1.1.3 +markdown2==2.3.10 +MarkupSafe==1.1.1 +msgpack==1.0.0 +new-rtorrent-python==1.0.1a0 +oauthlib==3.1.0 +packaging==20.4 +pbr==5.5.1 +profilehooks==1.12.0 +putio.py==8.7.0 +pyaes==1.6.1 +pycparser==2.20 +PyGithub==1.53 +pyjsparser==2.7.1 +PyJWT==1.7.1 +pymediainfo==4.3 +PyNMA==1.0 +pyOpenSSL==19.1.0 +pyparsing==2.4.7 +PySocks==1.7.1 +pysrt==1.1.2 +python-dateutil==2.8.1 +python-slugify==4.0.1 +python-twitter==3.5 +python3-fanart==2.0.0 +pytz==2020.4 +qbittorrent-api==2020.10.11 +rarfile==4.0 +rebulk==2.0.1 +requests==2.24.0 +requests-oauthlib==1.3.0 +requests-toolbelt==0.9.1 +Send2Trash==1.5.0 +sgmllib3k==1.0.0 +six==1.15.0 +soupsieve==2.0.1 +SQLAlchemy==1.3.20 +stevedore==3.2.2 +subliminal==2.1.0 +text-unidecode==1.3 +timeago==1.0.14 +tmdbsimple==2.6.6 +tornado==6.1 +tus.py==1.3.4 +tvdbsimple==1.0.6 +twilio==6.47.0 +tzlocal==2.1 +Unidecode==1.1.1 +urllib3==1.26.0 +validators==0.18.1 +webencodings==0.5.1 +win-inet-pton==1.1.0 +wrapt==1.12.1 +xmltodict==0.10.1 diff --git a/spk/sickchill/src/service-setup.sh b/spk/sickchill/src/service-setup.sh new file mode 100644 index 00000000000..62a55d85174 --- /dev/null +++ b/spk/sickchill/src/service-setup.sh @@ -0,0 +1,55 @@ +PYTHON_DIR="/usr/local/python3" +PIP=${SYNOPKG_PKGDEST}/env/bin/pip3 +PATH="${SYNOPKG_PKGDEST}/bin:${SYNOPKG_PKGDEST}/env/bin:${PYTHON_DIR}/bin:${PATH}" +HOME="${SYNOPKG_PKGDEST}/var" +VIRTUALENV="${PYTHON_DIR}/bin/virtualenv" +PYTHON="${SYNOPKG_PKGDEST}/env/bin/python3" +SC_INSTALL_DIR="${SYNOPKG_PKGDEST}/share/SickChill" +SC_BINARY="${SC_INSTALL_DIR}/SickChill.py" +SC_DATA_DIR="${SYNOPKG_PKGDEST}/var/data" +SC_CFG_FILE="${SC_DATA_DIR}/config.ini" + + +GROUP="sc-download" + +SERVICE_COMMAND="${PYTHON} ${SC_BINARY} --daemon --nolaunch --pidfile ${PID_FILE} --config ${SC_CFG_FILE} --datadir ${SC_DATA_DIR}" + +set_config() { + . ${SYNOPKG_PKGDEST}/share/git_data + + if [ -f "${SC_CFG_FILE}" ]; then + if [ -n "${wizard_username}" ] && [ -n "${wizard_password}" ]; then + sed -i "/^\s*web_username\s*=/s/\s*=\s*.*/ = ${wizard_username}/" ${SC_CFG_FILE} + sed -i "/^\s*web_password\s*=/s/\s*=\s*.*/ = ${wizard_password}/" ${SC_CFG_FILE} + fi + sed -i "/^\s*branch\s*=/s/\s*=\s*.*/ = ${SC_CONFIG_GIT_BRANCH}/" ${SC_CFG_FILE} + sed -i "/^\s*cur_commit_hash\s*=/s/\s*=\s*.*/ = ${SC_CONFIG_GIT_COMMIT_HASH}/" ${SC_CFG_FILE} + sed -i "/^\s*cur_commit_branch\s*=/s/\s*=\s*.*/ = ${SC_CONFIG_GIT_COMMIT_BRANCH}/" ${SC_CFG_FILE} + else + mkdir -p ${SC_DATA_DIR} + cat << EOF > ${SC_CFG_FILE} +[General] +web_username = ${wizard_username} +web_password = ${wizard_password} +branch = ${SC_GIT_BRANCH} +cur_commit_hash = ${SC_GIT_COMMIT_HASH} +cur_commit_branch = ${SC_GIT_COMMIT_BRANCH} +EOF + fi +} + +service_postinst() { + # Create a Python virtualenv + ${VIRTUALENV} --system-site-packages ${SYNOPKG_PKGDEST}/env >>${INST_LOG} + + # Install the wheels + ${PIP} install --no-deps --no-index -U --force-reinstall -f ${SYNOPKG_PKGDEST}/share/wheelhouse ${SYNOPKG_PKGDEST}/share/wheelhouse/*.whl >> ${INST_LOG} 2>&1 + + if [ "${SYNOPKG_PKG_STATUS}" == "INSTALL" ]; then + set_config + fi +} + +service_postupgrade() { + set_config +} diff --git a/spk/sickchill/src/sickchill.png b/spk/sickchill/src/sickchill.png new file mode 100644 index 00000000000..36cdce1a0f3 Binary files /dev/null and b/spk/sickchill/src/sickchill.png differ diff --git a/spk/sickchill/src/wizard/install_uifile b/spk/sickchill/src/wizard/install_uifile new file mode 100644 index 00000000000..58a5bb8e67b --- /dev/null +++ b/spk/sickchill/src/wizard/install_uifile @@ -0,0 +1,27 @@ +[{ + "step_title": "Setup credentials (You can edit these after install in the application settings)", + "items": [{ + "type": "textfield", + "desc": "HTTP username (set blank for no login)", + "subitems": [{ + "key": "wizard_username", + "desc": "User name", + "validator": { + "allowBlank": true + } + }] + },{ + "type": "password", + "desc": "HTTP password (blank = no authentication)", + "subitems": [{ + "key": "wizard_password", + "desc": "Password", + "validator": { + "allowBlank": true + } + }] + }, + { + "desc": "Permissions for all download-related packages are managed with the group 'sc-download' in DSM.
Please read Permission Management for details." + }] +}] diff --git a/spk/sickchill/src/wizard/install_uifile_spn b/spk/sickchill/src/wizard/install_uifile_spn new file mode 100644 index 00000000000..bded43dc707 --- /dev/null +++ b/spk/sickchill/src/wizard/install_uifile_spn @@ -0,0 +1,27 @@ +[{ + "step_title": "Configurar credenciales (Puede editarlas tras la instalación desde la propia aplicación)", + "items": [{ + "type": "textfield", + "desc": "Nombre de usuario HTTP (deje en blanco para no requerir usuario)", + "subitems": [{ + "key": "wizard_username", + "desc": "Usuario", + "validator": { + "allowBlank": true + } + }] + },{ + "type": "password", + "desc": "Contraseña HTTP (en blanco = sin autenticación)", + "subitems": [{ + "key": "wizard_password", + "desc": "Contraseña", + "validator": { + "allowBlank": true + } + }] + }, + { + "desc": "Los permisos para los paquetes relacionados con descargas son manejados por el grupo 'sc-download' en DSM.
Por favor, lea Manejo de Permisos (en inglés) para mayor detalle." + }] +}] diff --git a/spk/sickchill/src/wizard/upgrade_uifile b/spk/sickchill/src/wizard/upgrade_uifile new file mode 100644 index 00000000000..2b75143ffe1 --- /dev/null +++ b/spk/sickchill/src/wizard/upgrade_uifile @@ -0,0 +1,6 @@ +[{ + "step_title": "Attention! DSM Permissions", + "items": [{ + "desc": "Permissions for all download-related packages are managed with the group 'sc-download' in DSM.
Please read Permission Management for details." + }] +}] diff --git a/spk/sickchill/src/wizard/upgrade_uifile_spn b/spk/sickchill/src/wizard/upgrade_uifile_spn new file mode 100644 index 00000000000..7708d6ea98a --- /dev/null +++ b/spk/sickchill/src/wizard/upgrade_uifile_spn @@ -0,0 +1,6 @@ +[{ + "step_title": "¡Atención! Permisos DSM", + "items": [{ + "desc": "Los permisos para los paquetes relacionados con descargas son manejados por el grupo 'sc-download' en DSM.
Por favor, lea Manejo de Permisos (en inglés) para mayor detalle." + }] +}]