Skip to content
Commits on Source (4)
......@@ -5,48 +5,116 @@ repos:
hooks:
- id: check-added-large-files
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
files: Pipfile
- id: check-xml
- id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: \.diff$
- repo: https://github.com/Yelp/detect-secrets
rev: v1.1.0
- repo: https://github.com/codespell-project/codespell.git
rev: v2.1.0
hooks:
- id: detect-secrets
exclude: Pipfile\.lock
- id: codespell
- repo: https://github.com/adrienverge/yamllint
rev: v1.26.2
- repo: https://github.com/Yelp/detect-secrets.git
rev: v1.1.0
hooks:
- id: yamllint
- id: detect-secrets
- repo: https://github.com/amperser/proselint/
rev: 0.11.3
- repo: https://github.com/amperser/proselint.git
rev: 0.10.2
hooks:
- id: proselint
types: [plain-text]
exclude: LICENSE
- repo: https://gitlab.com/devopshq/gitlab-ci-linter.git
rev: v1.0.2
hooks:
- id: gitlab-ci-linter
args:
- "--server"
- https://git.shore.co.il
- repo: https://git.shore.co.il/nimrod/yamltool.git
rev: v0.1.2
hooks:
- id: yamltool
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.26.3
hooks:
- id: yamllint
- repo: https://github.com/executablebooks/mdformat.git
rev: 0.7.8
rev: 0.7.10
hooks:
- id: mdformat
- repo: https://git.shore.co.il/nimrod/shell-pre-commit.git
rev: v0.6.0
- repo: https://git.shore.co.il/nimrod/pre-commit-hooks.git
rev: v0.2.0
hooks:
- id: shell-lint
- id: shell-validate
- id: docker-compose
- repo: https://github.com/shellcheck-py/shellcheck-py.git
rev: v0.7.2.1
hooks:
- id: shellcheck
- repo: https://git.shore.co.il/nimrod/docker-pre-commit.git/
rev: v0.3.0
- repo: https://github.com/AleksaC/hadolint-py.git
rev: v2.8.0
hooks:
- id: hadolint
- id: docker-compose
- repo: https://github.com/ambv/black.git
rev: 21.10b0
hooks:
- id: black
args:
- |
--line-length=79
- repo: https://github.com/PyCQA/prospector.git
rev: 1.5.3.1
hooks:
- id: prospector
args:
- |-
--max-line-length=79
- |-
--with-tool=pyroma
- |-
--with-tool=bandit
- |-
--without-tool=pep257
- |-
--doc-warnings
- |-
--test-warnings
- |-
--full-pep8
- |-
--strictness=high
- |-
--no-autodetect
additional_dependencies:
- bandit
- pyroma
- repo: https://gitlab.com/pycqa/flake8.git
rev: 3.9.2
hooks:
- id: flake8
args:
- |-
--doctests
additional_dependencies:
- flake8-bugbear
......@@ -7,7 +7,7 @@ COPY --from=supersonic /usr/local/bin/supersonic /usr/local/bin/
RUN apk add --update --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \
gosu \
;
# hadolint ignore=DL3013
# hadolint ignore=DL3013,DL3059
RUN pip install --no-cache-dir pipenv
WORKDIR /poquita
ENV HOME /poquita
......@@ -20,6 +20,7 @@ RUN apk add --update --no-cache --virtual .lxml-build build-base git libxslt-dev
RUN mkdir --mode 777 db Podcasts
COPY --chown=root:root crontab ./
COPY --chown=root:root poca.xml ./
COPY --chown=root:root kodi_scan /usr/local/bin/
COPY --chown=root:root entrypoint /usr/local/sbin/docker-entrypoint
VOLUME db Podcasts
ENTRYPOINT ["docker-entrypoint"]
......
0 */4 * * * poca --config ./ || wget --spider https://notify.shore.co.il/send?message=Poca%20job%20failed.
0 */4 * * * ( poca --config ./ && kodi_scan ) || wget --spider https://notify.shore.co.il/send?message=Poca%20job%20failed.
#!/usr/bin/env python3
"""Trigger a Kodi audio library update."""
import json
import urllib.request
KODI_RPC_URL = "http://172.18.0.1:8080/jsonrpc"
if __name__ == "__main__":
headers = {"content-type": "application/json"}
request_data = {
"jsonrpc": "2.0",
"id": "transmission",
"method": "AudioLibrary.Scan",
}
req = urllib.request.Request(
KODI_RPC_URL,
headers=headers,
data=json.dumps(request_data).encode(),
)
# pylint: disable-next=consider-using-with
urllib.request.urlopen(req) # nosec
<poca version="0.8">
<!-- Please see detailed configuration documentation online:
https://github.com/brokkr/poca/wiki/Configuration -->
<!-- The meaning of the settings options are briefly as follows:
* base_dir: Directory containing the individual subscription folders
* id3encoding: Encoding to use on metadata (utf8 or latin1)
* id3removev1: Should we remove id3v1, only keeping v2 (yes or no)
* useragent: _Fallback_ user agent if connection is rejected for
default python user agent. Leave empty not to use a fallback.
* email logging setup not included by default, see wiki for details.
-->
<settings>
<base_dir>./Podcasts</base_dir>
<filenames>restrictive</filenames>
<id3encoding>utf8</id3encoding>
<id3removev1>yes</id3removev1>
<useragent/>
</settings>
<!-- Defaults take the same options as any single subscription. A
setting here, e.g. max_number, is applied to all subscriptions but
always overruled by sub-specific settings. Non-overruling settings in
metadata and filters are combined, e.g. a sub-specific 'artist' tag and
a global 'genre' tag -->
<defaults>
</defaults>
<max_number>5</max_number>
</defaults>
<subscriptions>
<!-- The meaning of the subscription options are brifly as follows:
* category: A category attribute on a subscription tag is helpful in
organizing the output of 'poca-subscribe list'.
* state: A state attribute is either 'active' or 'inactive'. inactive
subs are not updated. subs without state attribute are active.
* title: Name used for the folder of the subscription (required)
* url: The address of the rss feed (required)
* max_number: Max number of files to keep in subscription (optional)
* from_the_top: Get oldest files first, not newest (optional)
* metadata: Override id3 header fields with these values
(see https://github.com/brokkr/poca/wiki/ID3-frames for details)
* filters: Contains one or more of following tags (all optional)
* filename: Filename of the entry must match this string/regex
* title: Same as above, only for the title in the rss
* hour: The hour (24h-format) at which the entry was published.
* weekdays: Only entries from one of these weekdays (as integers)
* after_date: Only use entries published after date specified.
-->
<subscription>
<url>https://feeds.twit.tv/floss.xml</url>
<title>Floss Weekly</title>
<max_number>4</max_number>
</subscription>
<subscription>
<title>Bad Voltage</title>
<url>https://www.badvoltage.org/feed/mp3/</url>
<max_number>4</max_number>
</subscription>
<subscription>
<title>BSD Now</title>
<url>https://www.bsdnow.tv/rss</url>
<max_number>4</max_number>
</subscription>
<subscription>
<title>bsdtalk</title>
<url>http://feeds.feedburner.com/Bsdtalk</url>
<max_number>3</max_number>
</subscription>
<subscription>
<title>Hanselminutes</title>
<url>https://hanselminutes.com/subscribe</url>
<max_number>5</max_number>
<rename divider="-" space="-">
<title/>
<date/>
</rename>
</subscription>
<subscription>
<title>No Agenda</title>
<url>http://feed.nashownotes.com/rss.xml</url>
<max_number>8</max_number>
<max_number>10</max_number>
</subscription>
<subscription>
<title>Security Now</title>
<url>https://feeds.twit.tv/sn.xml</url>
<max_number>4</max_number>
</subscription>
<subscription>
<title>The Stack Overflow Podcast</title>
<url>https://feeds.simplecast.com/XA_851k3</url>
<max_number>4</max_number>
<rename divider="-" space="-">
<title/>
<date/>
</rename>
</subscription>
<subscription>
<title>This Developer's Life</title>
<url>http://feeds.feedburner.com/thisdeveloperslife</url>
<max_number>3</max_number>
</subscription>
<subscription>
<title>Reversim</title>
<url>https://feed.reversim.com/</url>
<max_number>5</max_number>
</subscription>
<subscription>
<title>On The Metal</title>
<url>https://feeds.transistor.fm/on-the-metal-0294649e-ec23-4eab-975a-9eb13fd94e06</url>
<max_number>5</max_number>
</subscription>
<subscription>
<title>The Pornhub Podcast with Asa Akira</title>
<url>https://feeds.soundcloud.com/users/soundcloud:users:392064213/sounds.rss</url>
<max_number>5</max_number>
</subscription>
<subscription>
<title>CoRecursive: Coding Stories</title>
......@@ -120,10 +72,15 @@
<subscription>
<title>עושים היסטוריה עם רן לוי Osim Historia With Ran Levi</title>
<url>https://www.spreaker.com/show/4227531/episodes/feed</url>
<max_number>8</max_number>
</subscription>
<subscription>
<title>על הדרך</title>
<url>https://feeds.buzzsprout.com/1738407.rss</url>
</subscription>
<subscription>
<title>The Lunduke Journal of Technology</title>
<url>https://api.substack.com/feed/podcast/462466/private/e8b25eee-6a46-497d-83b4-22142a663296.rss</url>
</subscription>
</subscriptions>
</poca>