Skip to content

Commit eeb670a

Browse files
authored
Merge pull request #1995 from tryzealot/release/6.0.4
Release 6.0.4
2 parents 55f03cf + 1900d1b commit eeb670a

18 files changed

Lines changed: 132 additions & 9 deletions

.github/workflows/publish_nighty.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- '.github/*.yml'
77
- '.github/workflows/publish_codespace.yml'
88
- '.github/workflows/publish_release.yml'
9+
- '.github/workflows/publish_preview.yml'
910
- '*.md'
1011
- '.*'
1112
- 'LICENSE'
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Publish Preview Docker Image
2+
on:
3+
push:
4+
paths-ignore:
5+
- '.devcontainer/*'
6+
- '.github/*.yml'
7+
- '.github/workflows/publish_codespace.yml'
8+
- '.github/workflows/publish_release.yml'
9+
- '.github/workflows/publish_nightly.yml'
10+
- '*.md'
11+
- '.*'
12+
- 'LICENSE'
13+
- 'Guardfile'
14+
- Aptfile
15+
- 'Procfile*'
16+
- '*.yaml'
17+
branches:
18+
- 'release/*'
19+
20+
env:
21+
DOCKER_TAG: preview
22+
23+
jobs:
24+
push_to_registry:
25+
name: Push Docker image to multiple registries
26+
runs-on: ubuntu-latest
27+
permissions:
28+
packages: write
29+
contents: read
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
34+
- name: Set up QEMU
35+
uses: docker/setup-qemu-action@v3
36+
37+
- name: Set up Docker Buildx
38+
uses: docker/setup-buildx-action@v3
39+
40+
- name: Get release version
41+
id: release_version
42+
run: |
43+
echo "RELEASE_VERSION=$(grep -oP "VERSION = '\K[^']*" config/application.rb)" >> $GITHUB_OUTPUT
44+
45+
- name: Login to Docker Hub
46+
uses: docker/login-action@v3
47+
with:
48+
username: ${{ secrets.DOCKER_USERNAME }}
49+
password: ${{ secrets.DOCKER_PASSWORD }}
50+
51+
- name: Login to GitHub Container Registry
52+
uses: docker/login-action@v3
53+
with:
54+
registry: ghcr.io
55+
username: ${{ github.actor }}
56+
password: ${{ secrets.GITHUB_TOKEN }}
57+
58+
- name: Docker metadata
59+
id: metadata
60+
uses: docker/metadata-action@v5
61+
with:
62+
images: |
63+
${{ github.repository }}
64+
ghcr.io/${{ github.repository }}
65+
tags: |
66+
type=raw,value=${{ steps.release_version.outputs.RELEASE_VERSION }}-${{ env.DOCKER_TAG }}
67+
68+
- name: Build and Push
69+
uses: docker/build-push-action@v6
70+
with:
71+
context: .
72+
push: true
73+
labels: ${{ steps.metadata.outputs.labels }}
74+
tags: ${{ steps.metadata.outputs.tags }}
75+
annotations: ${{ steps.metadata.outputs.annotations }}
76+
platforms: linux/amd64,linux/arm64
77+
build-args: |
78+
REPLACE_CHINA_MIRROR=false
79+
VCS_REF=${{ github.sha }}
80+
TAG=${{ env.DOCKER_TAG }}
81+
BUILD_DATE=${{ fromJSON(steps.metadata.outputs.json).labels['org.opencontainers.image.created'] }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
- 🚨 **内置多种事件通知**: 数据可自定义 Income WebHook 到任意通知服务
5454
- 🗄 **多渠道分类管理**: 自由划分不同场景不同产品形态的应用渠道管理
5555
- 🎳 **多架构部署**: amd86/arm64 及各种部署方案应有尽有
56-
- 🔑 **第三方登录**: 飞书、Gitlab、Google、LDAP 和 OIDC 一键授权
56+
- 🔑 **第三方登录**: 飞书、Gitlab、Github、Google、LDAP 和 OIDC 一键授权
5757
- 🌑 **黑暗模式**: 黑夜白昼自由切换
5858

5959
## 在线演示

app/controllers/admin/system_info_controller.rb

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,22 @@ def set_file_permissions
6565
paths.each do |path|
6666
real_path = scope == :system ? path : Rails.root.join(path)
6767
health = File.writable?(real_path)
68+
reason = if !File.exist?(real_path)
69+
t('.messages.path_not_exist')
70+
elsif !File.writable?(real_path)
71+
t('.messages.path_not_writable')
72+
elsif !File.readable?(real_path)
73+
t('.messages.path_not_readable')
74+
else
75+
nil
76+
end
6877

6978
@file_permissions[:health] = false if !health
70-
@file_permissions[:permissions].push(path: real_path.to_s, health: health)
79+
@file_permissions[:permissions].push(
80+
path: real_path.to_s,
81+
health: health,
82+
reason: reason
83+
)
7184
end
7285
end
7386

app/controllers/channels_controller.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ def update
5353
raise_if_app_archived!(@scheme.app)
5454

5555
@channel.update(channel_params)
56+
notice = t('activerecord.success.update', key: "#{@channel.scheme.name} #{@channel.name} #{t('channels.title')}")
57+
flash.now.notice = notice
5658
respond_to do |format|
5759
format.html { redirect_back fallback_location: friendly_channel_overview_path(@channel) }
5860
format.turbo_stream
@@ -63,6 +65,8 @@ def destroy
6365
raise_if_app_archived!(@scheme.app)
6466

6567
@channel.destroy
68+
notice = t('activerecord.success.destroy', key: "#{@channel.scheme.name} #{@channel.name} #{t('channels.title')}")
69+
flash.now.notice = notice
6670
respond_to do |format|
6771
format.html { redirect_to app_path(@app) }
6872
format.turbo_stream

app/controllers/schemes_controller.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def create
2525

2626
create_channels(channels)
2727

28-
flash.now.notice = t('activerecord.success.create', key: t('schemes.title'))
28+
flash.now.notice = t('activerecord.success.create', key: "#{@scheme.name} #{t('schemes.title')}")
2929
respond_to do |format|
3030
format.html { redirect_to app_path(@app) }
3131
format.turbo_stream
@@ -41,6 +41,8 @@ def edit
4141
def update
4242
authorize @scheme
4343
@scheme.update(scheme_params)
44+
45+
flash.now.notice = t('activerecord.success.update', key: "#{@scheme.name} #{t('schemes.title')}")
4446
respond_to do |format|
4547
format.html { redirect_to app_path(@app) }
4648
format.turbo_stream
@@ -51,6 +53,7 @@ def destroy
5153
authorize @scheme
5254
@scheme.destroy
5355

56+
flash.now.notice = t('activerecord.success.destroy', key: "#{@scheme.name} #{t('schemes.title')}")
5457
respond_to do |format|
5558
format.html { redirect_to app_path(@app) }
5659
format.turbo_stream

app/policies/metadatum_policy.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class MetadatumPolicy < ApplicationPolicy
44

55
def show?
6-
user_signed_in? && (owner? || any_manage? || app_member?)
6+
user_signed_in_or_guest_mode? || (user_signed_in? && (owner? || any_manage? || app_member?))
77
end
88

99
def new?

app/views/admin/system_info/index.html.slim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@
8585
- if permission[:health]
8686
i.fas.fa-check.text-success
8787
- else
88-
i.fas.fa-exclamation-triangle.text-danger
88+
span title="#{permission[:reason]}" data-bs-toggle="tooltip" data-bs-custom-class="default-tooltip" data-bs-placement="left"
89+
i.fas.fa-exclamation-triangle.text-danger
8990
.card-footer
9091
= t('.messages.file_permissions_tip', icon: '<i class="fas fa-exclamation-triangle text-danger">')
9192

app/views/apps/_channel.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
= link_to channel.name, friendly_channel_overview_path(channel), data: { turbo: false }
44
- if current_user&.manage?(app: app)
55
.p-2.flex-shrink-1
6-
- if !@app.archived
6+
- if !app.archived
77
= button_link_to '', edit_app_scheme_channel_path(app.id, scheme.id, channel.id), 'edit', class: 'btn-box-tool', \
88
data: { turbo_frame: :modal }
99
= button_link_to '', app_scheme_channel_path(app.id, scheme.id, channel.id), 'trash-alt', class: 'btn-box-tool', \

app/views/channels/_channel.html.slim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@
1616
== render 'channels'
1717
== render 'versions'
1818
== render 'metadata'
19+
20+
- if user_signed_in_or_guest_mode?
21+
= link_to app_path(@app), class: 'btn btn-secondary w-100 mt-3', data: { turbo: false } do
22+
i.icon.far.fa-list-alt
23+
= t('channels.show.app_detail')

0 commit comments

Comments
 (0)