Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
carolcoral committed Feb 17, 2023
0 parents commit d4c773e
Show file tree
Hide file tree
Showing 434 changed files with 69,537 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: 问题模板
about: 如发现Bug,请按此模板提交issues,不按模板提交的问题将直接关闭。
提交问题务必描述清楚、附上日志,描述不清导致无法理解和分析的问题也可能会被直接关闭。
---

## 你使用的 NAStool 是什么版本,什么环境?

> NAStool 版本: vx.x.x
>
> 环境: docker or windows or Synology
>
## 你遇到什么问题了?

> 描述一下你遇到的问题
## 是否已经浏览过Issues、Wiki及TG公众号仍无法解决?

> 请搜索Issues列表、查看wiki跟TG公众号的更新说明,已经解释过的问题不要重复提问

## 你期望的结果

> 描述以下你期望的结果
## 给出程序界面截图、后台运行日志或配置文件

> 如UI BUG请提供截图及配置文件截图
> 其它问题提供后台日志,如为Docker请提供docker的日志
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: 功能需求模板
about: 如有新功能需要需要提交,请按此模板创建issues
---

## 你使用的 NAStool 是什么版本,什么环境?

> NAStool 版本: vx.x.x
>
> 环境: docker or windows or synology
## 你想要新增或者改进什么功能?

> 你想要新增或者改进什么功能?
## 这个功能有什么可以参考的资料吗?

> 这个功能有什么可以参考的资料吗?是否可以列举一些,不要引用同类但商业化软件的任何内容.
54 changes: 54 additions & 0 deletions .github/workflows/build-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build NAStool Beta Image
on:
workflow_dispatch:
push:
branches:
- dev
paths:
- version.py
- docker/Dockerfile.beta
- .github/workflows/build-beta.yml
- requirements.txt
jobs:
build:
runs-on: ubuntu-latest
name: Build Docker Image
steps:
-
name: Checkout
uses: actions/checkout@master

-
name: Release version
id: release_version
run: |
app_version=$(cat version.py |sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp")
echo "app_version=$app_version" >> $GITHUB_ENV
-
name: Set Up QEMU
uses: docker/setup-qemu-action@v1

-
name: Set Up Buildx
uses: docker/setup-buildx-action@v1

-
name: Login DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

-
name: Buildx
uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile.beta
platforms: |
linux/amd64
linux/arm64
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/nas-tools:${{ env.app_version }}-beta
54 changes: 54 additions & 0 deletions .github/workflows/build-lite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build NAStool Lite Image
on:
workflow_dispatch:
push:
branches:
- master
paths:
- version.py
- docker/Dockerfile.lite
- .github/workflows/build-lite.yml
- requirements.txt
jobs:
build:
runs-on: ubuntu-latest
name: Build Docker Image
steps:
-
name: Checkout
uses: actions/checkout@master

-
name: Release version
id: release_version
run: |
app_version=$(cat version.py |sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp")
echo "app_version=$app_version" >> $GITHUB_ENV
-
name: Set Up QEMU
uses: docker/setup-qemu-action@v1

-
name: Set Up Buildx
uses: docker/setup-buildx-action@v1

-
name: Login DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

-
name: Build Lite Image
uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile.lite
platforms: |
linux/amd64
linux/arm64
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/nas-tools:${{ env.app_version }}-lite
98 changes: 98 additions & 0 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Build NAStool Windows
on:
workflow_dispatch:
push:
branches:
- master
paths:
- version.py
- .github/workflows/build-windows.yml
- windows/**

jobs:
Windows-build:
runs-on: windows-latest
steps:
- name: init Python 3.10.6
uses: actions/setup-python@v4
with:
python-version: '3.10.6'
- name: install dependent packages
run: |
python -m pip install --upgrade pip
pip install wheel numpy==1.23.5 pyparsing==3.0.9 wxpython==4.2.0 pyinstaller==5.7.0
git clone --depth=1 -b master https://github.com/NAStool/nas-tools --recurse-submodule
cd nas-tools
pip install -r requirements.txt
echo ("NASTOOL_CONFIG=D:/a/nas-tools/nas-tools/nas-tools/config/config.yaml") >> $env:GITHUB_ENV
echo $env:NASTOOL_CONFIG
shell: pwsh
- name: package through pyinstaller
run: |
cd nas-tools
copy .\windows\rely\upx.exe c:\hostedtoolcache\windows\python\3.10.6\x64\Scripts
copy .\windows\rely\hook-cn2an.py c:\hostedtoolcache\windows\python\3.10.6\x64\lib\site-packages\pyinstaller\hooks
copy .\windows\rely\hook-zhconv.py c:\hostedtoolcache\windows\python\3.10.6\x64\lib\site-packages\pyinstaller\hooks
copy .\third_party.txt .\windows
copy .\windows\rely\template.jinja2 c:\hostedtoolcache\windows\Python\3.10.6\x64\lib\site-packages\setuptools\_vendor\pyparsing\diagram
xcopy .\web c:\hostedtoolcache\windows\python\3.10.6\x64\lib\site-packages\web\ /e
xcopy .\config c:\hostedtoolcache\windows\python\3.10.6\x64\lib\site-packages\config\ /e
xcopy .\db_scripts c:\hostedtoolcache\windows\python\3.10.6\x64\lib\site-packages\db_scripts\ /e
cd windows
pyinstaller nas-tools.spec
shell: pwsh
- name: upload windows file
uses: actions/upload-artifact@v3
with:
name: windows
path: D:/a/nas-tools/nas-tools/nas-tools/windows/dist/nas-tools.exe

Create-release_Send-message:
runs-on: ubuntu-latest
needs: [Windows-build]
steps:
- uses: actions/checkout@v2
- name: Release version
id: release_version
run: |
app_version=$(cat version.py |sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp")
echo "app_version=$app_version" >> $GITHUB_ENV
- name: download exe and rename
uses: actions/download-artifact@v3
- name: get release_informations
shell: bash
run: |
pwd
mkdir releases
cd windows
mv nas-tools.exe /home/runner/work/nas-tools/nas-tools/releases/nastool_win_v${{ env.app_version }}.exe
pwd
- name: Create release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.app_version }}
release_name: v${{ env.app_version }}
body: ${{ github.event.commits[0].message }}
draft: false
prerelease: false
- name: Upload release asset
uses: dwenegar/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}
assets_path: |
/home/runner/work/nas-tools/nas-tools/releases/
- name: Send telegram message (release informations)
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: markdown
message: |
*v${{ env.app_version }}*
${{ github.event.commits[0].message }}
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build NAStool Image
on:
workflow_dispatch:
push:
branches:
- master
paths:
- version.py
- docker/Dockerfile
- docker/Dockerfile.lite
- .github/workflows/build.yml
- requirements.txt
jobs:
build:
runs-on: ubuntu-latest
name: Build Docker Image
steps:
-
name: Checkout
uses: actions/checkout@master

-
name: Release version
id: release_version
run: |
app_version=$(cat version.py |sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp")
echo "app_version=$app_version" >> $GITHUB_ENV
-
name: Set Up QEMU
uses: docker/setup-qemu-action@v1

-
name: Set Up Buildx
uses: docker/setup-buildx-action@v1

-
name: Login DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Image
uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile
platforms: |
linux/amd64
linux/arm64
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/nas-tools:latest
${{ secrets.DOCKER_USERNAME }}/nas-tools:${{ env.app_version }}
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
__pycache__
*.sock
*.log
*.pid
test.py

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
gen/
18 changes: 18 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[submodule "third_party/qbittorrent-api"]
path = third_party/qbittorrent-api
url = https://github.com/rmartin16/qbittorrent-api
[submodule "third_party/transmission-rpc"]
path = third_party/transmission-rpc
url = https://github.com/Trim21/transmission-rpc
[submodule "third_party/anitopy"]
path = third_party/anitopy
url = https://github.com/igorcmoura/anitopy
[submodule "third_party/plexapi"]
path = third_party/plexapi
url = https://github.com/pkkid/python-plexapi
[submodule "third_party/slack_bolt"]
path = third_party/slack_bolt
url = https://github.com/slackapi/bolt-python
[submodule "third_party/feapder"]
path = third_party/feapder
url = https://github.com/jxxghp/feapder
Loading

0 comments on commit d4c773e

Please sign in to comment.