Skip to content

refactor: migrate from deepin-api-device to deepin-daemon user#132

Merged
18202781743 merged 1 commit into
linuxdeepin:masterfrom
18202781743:master
May 15, 2025
Merged

refactor: migrate from deepin-api-device to deepin-daemon user#132
18202781743 merged 1 commit into
linuxdeepin:masterfrom
18202781743:master

Conversation

@18202781743
Copy link
Copy Markdown
Contributor

@18202781743 18202781743 commented May 13, 2025

  1. Removed sysusers configuration file for deepin-api-device
  2. Updated D-Bus policy configuration to use deepin-daemon
  3. Changed service files to run under deepin-daemon user
  4. Removed sysusers installation from debian/rules
  5. This change consolidates service users under deepin-daemon for better
    system management

refactor: 从 deepin-api-device 迁移到 deepin-daemon 用户

  1. 移除了 deepin-api-device 的 sysusers 配置文件
  2. 更新 D-Bus 策略配置使用 deepin-daemon
  3. 修改服务文件以使用 deepin-daemon 用户运行
  4. 从 debian/rules 中移除了 sysusers 安装
  5. 此变更有助于统一服务用户管理,使用 deepin-daemon 提高系统管理效率

pms: BUG-311157

Summary by Sourcery

Migrate service execution and configuration from the deepin-api-device user to deepin-daemon for unified user management

Enhancements:

  • Centralize service execution under deepin-daemon for improved user management
  • Update D-Bus policy to grant ownership of org.deepin.dde.Device1 to deepin-daemon
  • Modify systemd service definitions to run under deepin-daemon

Chores:

  • Remove deepin-api-device sysusers configuration file
  • Delete obsolete deepin-api-device service and sysusers files
  • Remove sysusers installation step from debian/rules

1. Removed sysusers configuration file for deepin-api-device
2. Updated D-Bus policy configuration to use deepin-daemon
3. Changed service files to run under deepin-daemon user
4. Removed sysusers installation from debian/rules
5. This change consolidates service users under deepin-daemon for better
system management

refactor: 从 deepin-api-device 迁移到 deepin-daemon 用户

1. 移除了 deepin-api-device 的 sysusers 配置文件
2. 更新 D-Bus 策略配置使用 deepin-daemon
3. 修改服务文件以使用 deepin-daemon 用户运行
4. 从 debian/rules 中移除了 sysusers 安装
5. 此变更有助于统一服务用户管理,使用 deepin-daemon 提高系统管理效率

pms: BUG-311157
@deepin-ci-robot
Copy link
Copy Markdown

deepin pr auto review

代码审查意见:

  1. 文件删除

    • dde-api.sysusers 文件被删除,需要确认是否有其他地方引用了这个文件,以及是否有必要删除它。如果这个文件不再使用,应该确保没有其他代码依赖于它。
  2. 权限变更

    • org.deepin.dde.Device1.conf 文件中,<policy user="deepin-api-device"> 被更改为 <policy user="deepin-daemon">。需要确认 deepin-daemon 用户是否有足够的权限来执行相关操作,并且这个变更不会影响其他依赖此配置的服务。
  3. 服务用户变更

    • org.deepin.dde.Device1.servicedeepin-api-device.service 文件中,User=deepin-api-device 被更改为 User=deepin-daemon。同样需要确认 deepin-daemon 用户是否有足够的权限来运行这个服务,并且这个变更不会影响服务的正常运行。
  4. 依赖关系

    • 这些变更可能会影响到服务的依赖关系和启动顺序。需要检查是否有其他服务依赖于 deepin-api-device 用户或服务,并确保这些依赖关系在变更后仍然有效。
  5. 安全性

    • 确保所有用户和服务的权限设置都是合理的,避免不必要的权限提升,以减少安全风险。
  6. 文档和注释

    • 如果这些变更会影响其他开发者或用户,应该更新相关的文档和注释,说明变更的原因和影响。
  7. 测试

    • 在进行这些变更后,应该进行充分的测试,确保服务的正常运行,并且没有引入新的问题。

综上所述,这些变更需要仔细检查,确保它们不会对系统的其他部分产生负面影响,并且符合系统的安全策略和权限管理要求。

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @18202781743 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 13, 2025

Reviewer's Guide

This PR consolidates service user management by migrating from the deepin-api-device user to deepin-daemon across D-Bus policies, systemd service units, and Debian packaging scripts.

File-Level Changes

Change Details Files
Removed sysusers configuration and installation for deepin-api-device
  • Deleted the deepin-api-device sysusers config file
  • Removed sysusers installation step from Debian rules
debian/dde-api.sysusers
debian/rules
Updated D-Bus policy to use deepin-daemon user
  • Replaced policy user attribute from deepin-api-device to deepin-daemon
  • Allowed org.deepin.dde.Device1 ownership under the new user
misc/conf/org.deepin.dde.Device1.conf
Modified service unit files to run under deepin-daemon
  • Changed User directives to deepin-daemon
  • Adjusted service definitions accordingly
misc/system-services/org.deepin.dde.Device1.service
misc/systemd/system/deepin-api-device.service

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, mhduiy

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@18202781743 18202781743 merged commit b3908ac into linuxdeepin:master May 15, 2025
14 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants