Skip to content

Commit

Permalink
0320
Browse files Browse the repository at this point in the history
  • Loading branch information
kingmo888 committed Mar 20, 2024
1 parent a8b07cb commit 5020b45
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 6 deletions.
119 changes: 119 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ dist_py38
LICENSE.rst

db/test_db.sqlite3
job2en.py
job2en.py

新建文本文档.txt
2 changes: 1 addition & 1 deletion rustdesk_server_api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
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')
Expand Down
1 change: 1 addition & 0 deletions version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
APP_VERSION = 'v3.3.15'
4 changes: 0 additions & 4 deletions 新建文本文档.txt

This file was deleted.

0 comments on commit 5020b45

Please sign in to comment.