Skip to content

Commit

Permalink
First Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
arho14 committed Jan 23, 2024
0 parents commit 02b4965
Show file tree
Hide file tree
Showing 12 changed files with 139 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/BuildImage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build Image

on: [push, pull_request_target, workflow_dispatch]

env:
GITHUB_REPO: "linuxserver/docker-mods" #don't modify
ENDPOINT: "linuxserver/mods" #don't modify
BASEIMAGE: "emby" #replace
MODNAME: "custom-css-js" #replace

jobs:
set-vars:
runs-on: ubuntu-latest
steps:
- name: Set Vars
id: outputs
run: |
echo "GITHUB_REPO=${{ env.GITHUB_REPO }}" >> $GITHUB_OUTPUT
echo "ENDPOINT=${{ env.ENDPOINT }}" >> $GITHUB_OUTPUT
echo "BASEIMAGE=${{ env.BASEIMAGE }}" >> $GITHUB_OUTPUT
echo "MODNAME=${{ env.MODNAME }}" >> $GITHUB_OUTPUT
# **** If the mod needs to be versioned, set the versioning logic below. Otherwise leave as is. ****
MOD_VERSION=""
echo "MOD_VERSION=${MOD_VERSION}" >> $GITHUB_OUTPUT
outputs:
GITHUB_REPO: ${{ steps.outputs.outputs.GITHUB_REPO }}
ENDPOINT: ${{ steps.outputs.outputs.ENDPOINT }}
BASEIMAGE: ${{ steps.outputs.outputs.BASEIMAGE }}
MODNAME: ${{ steps.outputs.outputs.MODNAME }}
MOD_VERSION: ${{ steps.outputs.outputs.MOD_VERSION }}

build:
uses: linuxserver/github-workflows/.github/workflows/docker-mod-builder.yml@v1
needs: set-vars
secrets:
CR_USER: ${{ secrets.CR_USER }}
CR_PAT: ${{ secrets.CR_PAT }}
DOCKERUSER: ${{ secrets.DOCKERUSER }}
DOCKERPASS: ${{ secrets.DOCKERPASS }}
with:
GITHUB_REPO: ${{ needs.set-vars.outputs.GITHUB_REPO }}
ENDPOINT: ${{ needs.set-vars.outputs.ENDPOINT }}
BASEIMAGE: ${{ needs.set-vars.outputs.BASEIMAGE }}
MODNAME: ${{ needs.set-vars.outputs.MODNAME }}
MOD_VERSION: ${{ needs.set-vars.outputs.MOD_VERSION }}
25 changes: 25 additions & 0 deletions .github/workflows/call_issue_pr_tracker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Issue & PR Tracker

on:
issues:
types: [opened, reopened, labeled, unlabeled, closed]
pull_request_target:
types:
[
opened,
reopened,
review_requested,
review_request_removed,
labeled,
unlabeled,
closed,
]
pull_request_review:
types: [submitted, edited, dismissed]

jobs:
manage-project:
permissions:
issues: write
uses: linuxserver/github-workflows/.github/workflows/issue-pr-tracker.yml@v1
secrets: inherit
10 changes: 10 additions & 0 deletions .github/workflows/permissions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Permission check
on:
pull_request_target:
paths:
- "**/run"
- "**/finish"
- "**/check"
jobs:
permission_check:
uses: linuxserver/github-workflows/.github/workflows/init-svc-executable-permissions.yml@v1
Empty file added .gitignore
Empty file.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM scratch

# copy local files
COPY root/ /
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Emby CustomCssJs 插件 Docker Mod

这个模块将[CustomCssJs](https://github.com/Shurelol/Emby.CustomCssJS)插件安装到 Linuxserver.io 的 emby 中。插件具体使用方法请看作者仓库:[Shurelol/Emby.CustomCssJs](https://github.com/Shurelol/Emby.CustomCssJS)

## 使用方法

在 Emby docker 参数中加入环境变量`DOCKER_MODS=arho14/emby-custom-css-js`,多个模块使用`|`隔开,例如:`DOCKER_MODS=arho14/emby-custom-css-js|linuxserver/mods:emby-second-mod`
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/with-contenv bash

# 设置临时文件夹路径
temp_folder="/config/mods/emby_custom_css_js"

# 设置目标目录路径
plugins_folder="/config/plugins"
modules_folder="/app/emby/dashboard-ui/modules"

# 创建临时文件夹
mkdir -p "$temp_folder"

# 下载GitHub项目的tar文件
curl -L -o "$temp_folder/emby_custom_css_js.tar.gz" https://mirror.ghproxy.com/https://github.com/Shurelol/Emby.CustomCssJS/archive/refs/heads/main.tar.gz

# 检查下载是否成功
if [ $? -eq 0 ]; then
echo "**** CustomCssJS下载成功 ****"
# 解压tar文件
tar -xzf "$temp_folder/emby_custom_css_js.tar.gz" -C "$temp_folder"

# 复制文件到目标目录(覆盖同名文件)
cp -f "$temp_folder/Emby.CustomCssJS-main/src/Emby.CustomCssJS.dll" "$plugins_folder"
cp -f "$temp_folder/Emby.CustomCssJS-main/src/CustomCssJS.js" "$modules_folder"
# 设置文件权限
lsiown -R abc:abc $plugins_folder

# 检查复制是否成功
if [ $? -eq 0 ]; then

# 修改app.js文件
if grep -q "CustomCssJS" "/app/emby/dashboard-ui/app.js"; then
echo "app.js文件已包含指定内容,无需修改。"
else
sed -i 's/Promise.all(list.map(loadPlugin))/list.push(".\/modules\/CustomCssJS.js"),Promise.all(list.map(loadPlugin))/g' /app/emby/dashboard-ui/app.js
fi
echo "**** CustomCssJS安装成功 ****"

# 清理临时文件
rm -rf "$temp_folder"
else
echo "**** CustomCssJS安装失败,请检查目标目录是否存在或具有适当的权限。 ****"
fi
else
echo "**** CustomCssJS下载失败,请检查网络连接或URL是否正确。 ****"
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oneshot
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-mod-emby-custom-css-js-add-package/run
Empty file.
Empty file.

0 comments on commit 02b4965

Please sign in to comment.