Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sickchill: initial version v2020.11.24-1 #4161

Merged
merged 18 commits into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions cross/sickchill/Makefile
Original file line number Diff line number Diff line change
@@ -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
Comment on lines +18 to +22
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if I understand well, there is no source file to cross-compile here, so it does not make sense to have "cross/sickchill".
As a pip package is available, I would directly grab it from spk/sickchill/src/requirements.txt with an explicit tagged version (please do not get "master") https://github.com/SickChill/SickChill/wiki/Pip
If you need file structure in package, you may prepare them in spk/sickchill/Makefile as install target

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to miigotu, using the pip package would render further updating manual only (see: #4161 (comment) ), it seems it was ruled out at that time.

Copy link
Contributor

@zyrill zyrill Jan 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve read through all the comments and it seems that this is indeed the case. What about the configure/compile though, @Nyaran - would be nice to finally get this package merged! Is the WIP flag still required? If not maybe best to delete it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that mean there will be no Synocommunity package for auto-updatable Sickchill ? :-(

Copy link
Contributor

@zyrill zyrill Feb 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that there are still some issues to be solved and some discussion points to close. Then the PR needs to be amended and somebody needs to take care of the process...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I was off for a while...

So, now the only issue is to remove the "cross/compile" part, isn't it? I will try it


.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
2 changes: 2 additions & 0 deletions cross/sickchill/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rsc:share/SickChill
rsc:share/git_data
3 changes: 3 additions & 0 deletions cross/sickchill/digests
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions spk/haproxy/src/app/application/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. }'))
Expand All @@ -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()
41 changes: 41 additions & 0 deletions spk/sickchill/Makefile
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions spk/sickchill/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rsc:share/wheelhouse
88 changes: 88 additions & 0 deletions spk/sickchill/src/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
55 changes: 55 additions & 0 deletions spk/sickchill/src/service-setup.sh
Original file line number Diff line number Diff line change
@@ -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
}
Binary file added spk/sickchill/src/sickchill.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions spk/sickchill/src/wizard/install_uifile
Original file line number Diff line number Diff line change
@@ -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 <b>'sc-download'</b> in DSM.<br>Please read <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> for details."
}]
}]
27 changes: 27 additions & 0 deletions spk/sickchill/src/wizard/install_uifile_spn
Original file line number Diff line number Diff line change
@@ -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 <b>'sc-download'</b> en DSM.<br>Por favor, lea <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Manejo de Permisos (en inglés)</a> para mayor detalle."
}]
}]
6 changes: 6 additions & 0 deletions spk/sickchill/src/wizard/upgrade_uifile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[{
"step_title": "Attention! DSM Permissions",
"items": [{
"desc": "Permissions for all download-related packages are managed with the group <b>'sc-download'</b> in DSM.<br>Please read <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> for details."
}]
}]
6 changes: 6 additions & 0 deletions spk/sickchill/src/wizard/upgrade_uifile_spn
Original file line number Diff line number Diff line change
@@ -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 <b>'sc-download'</b> en DSM.<br>Por favor, lea <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Manejo de Permisos (en inglés)</a> para mayor detalle."
}]
}]