ubuntu - Gitosis 和 www 数据

标签 ubuntu gitosis

我目前正在 VPS 上构建一个 ubuntu(10.0.4 LTS)服务器来托管一个基于 WordPress 的网站。

我已经安装了 gitosis 来托管远程存储库,我想做的是插入 post receive当我 git push 时 Hook 更新 WordPress 主题.

我对用户和权限有点困惑。当我们运行 git pull/var/www 中的文件将归 git 用户所有。理想情况下,我希望 /var/www 中的所有文件由同一个用户拥有,因为我认为这会更安全?

我目前有 /var/www文件夹拥有我的 www-data 用户,经过一番阅读后,我意识到这不是最好的做法。我需要一些帮助来制定最好的行动计划吗?

最佳答案

从评论:
我不会将 gitosis 用于那种细粒度的控制:

  • gitosis自 2009 年以来已过时且未移动(尽管一些 fork 仍然有点活跃)
  • 这个commentquestion说明使用 更容易实现大多数功能Gitolite .

  • 因此,使用 Gitolite:umask git 用户在 gitolite 环境中 checkout 的 Git 存储库的使用将在文档部分“most often used/changed variables”中描述

    The default UMASK that gitolite uses makes all the repos and their contents have rwx------ permissions. People who want to run gitweb realise that this will not do.

    The correct way to deal with this is to give this variable a value like 0027 (note the syntax: the leading 0 is required), and then make the user running the webserver (apache, www-data, whatever) a member of the 'git' group.

    If you've already installed gitolite then existing files will have to be fixed up manually (for a umask or 0027, that would be chmod -R g+rX).
    This is because umask only affects permissions on newly created files, not existing ones.


    从那里,您可以关注“install gitolite under "apache"”。

    关于ubuntu - Gitosis 和 www 数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9927981/

    相关文章:

    c - ubuntu 上的段错误,在 debian 上运行

    git - Hudson(Jenkins) 和远程 git 存储库获得权限被拒绝

    git - Windows 上的 Hudson + Git + Gitosis 问题

    git - grep 用于多个 git 存储库中的内容

    linux - 如何确定我的进程是 CPU/内存密集型还是磁盘密集型?

    c - 在另一个文件夹中创建 1000 个文件夹并将文件放在最后一个文件夹中的最快方法

    ubuntu - 在 ubuntu 机器上设置电子邮件服务器

    linux - 在 ubuntu 中自定义 ssh 命令

    ubuntu - git 克隆本地主机?

    linux - 我在哪里可以找到 Gitosis 在 Linux 中管理的存储库的位置