This commit is contained in:
kingmo888 2024-03-20 10:31:49 +08:00
parent a8b07cbc35
commit 5020b45962
5 changed files with 124 additions and 6 deletions

119
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,119 @@
name: RustDesk Web Api
on:
workflow_dispatch:
inputs:
docker_username:
description: 'docker user name'
required: true
default: ''
docker_password:
description: 'docker user password'
required: true
default: ''
jobs:
alpine:
runs-on: ubuntu-latest
name: Build Docker Image (Alpine)
steps:
-
name: Checkout
uses: actions/checkout@v3
-
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: Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ github.event.inputs.docker_username }}/rustdesk-api-server
tags: |
type=raw,value=${{ env.app_version }}
type=raw,value=latest
-
name: Set Up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set Up Buildx
uses: docker/setup-buildx-action@v2
-
name: Login DockerHub
uses: docker/login-action@v2
with:
username: ${{ github.event.inputs.docker_username }}
password: ${{ github.event.inputs.docker_password }}
-
name: Build Image
uses: docker/build-push-action@v4
with:
context: docker
file: docker/Dockerfile
platforms: |
linux/amd64
linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
debian:
runs-on: ubuntu-latest
name: Build Docker Image (Debian)
steps:
-
name: Checkout
uses: actions/checkout@v3
-
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}-debian" >> $GITHUB_ENV
- name: Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ github.event.inputs.docker_username }}/rustdesk-api-server
tags: |
type=raw,value=${{ env.app_version }}
type=raw,value=debian
-
name: Set Up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set Up Buildx
uses: docker/setup-buildx-action@v2
-
name: Login DockerHub
uses: docker/login-action@v2
with:
username: ${{ github.event.inputs.docker_username }}
password: ${{ github.event.inputs.docker_password }}
-
name: Build Image
uses: docker/build-push-action@v4
with:
context: docker
file: docker/debian.Dockerfile
platforms: |
linux/amd64
linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

4
.gitignore vendored
View File

@ -26,4 +26,6 @@ dist_py38
LICENSE.rst
db/test_db.sqlite3
job2en.py
job2en.py
新建文本文档.txt

View File

@ -32,7 +32,7 @@ DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
ALLOWED_HOSTS = ["*"]
AUTH_USER_MODEL = 'api.UserProfile' #AppName.自定义user
ALLOW_REGISTRATION = os.environ.get("ALLOW_REGISTRATION", "True") == "True" # 是否允许注册, True为允许False为不允许
ALLOW_REGISTRATION = os.environ.get("ALLOW_REGISTRATION", "True") or os.environ.get("ALLOW_REGISTRATION", "True") == "True" # 是否允许注册, True为允许False为不允许
#==========数据库配置 开始=====================
DATABASE_TYPE = os.environ.get("DATABASE_TYPE", 'SQLITE')

1
version.py Normal file
View File

@ -0,0 +1 @@
APP_VERSION = 'v3.3.15'

View File

@ -1,4 +0,0 @@
python manage.py makemessages -l zh_Hans -i xlwt -i django
python manage.py makemessages -l en -i xlwt -i django
python manage.py compilemessages --pythonpath E:\python_workspace\rustdesk-server-api-python\rustdesk_server_api_github\locale\zh_Hans\LC_MESSAGES