Infrastructure/fedorapeople.org/zh-cn

From FedoraProject

< Infrastructure | fedorapeople.org(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
{{admon/important|此页过于陈旧|请立即更新此页到最新版,参照英文版}}
+
{{autolang}}
 
+
{{autolang|base=yes}}
+
  
 
= fedorapeople.org =
 
= fedorapeople.org =
  
此页介绍如何使用的你在[http://fedorapeople.org FedoraPeople.org]的个人空间,那是一些Fedora贡献者为分享给全世界而上传的一些东西。他们可以上传spec文件、srpm、补丁,亦或是个人仓库等等。
+
This page covers the details on how to obtain and use your personal
 +
space on [http://fedorapeople.org fedorapeople.org] , which is a site where Fedora
 +
contributors can upload files for sharing out with the world. It is
 +
perfect for uploading specfiles, srpms, patches, personal repository etc, etc.
  
== 访问你的fedorapeople.org空间 ==
+
== Allowable content ==
  
# 你需要一个活动的[https://admin.fedoraproject.org/accounts/ Fedora帐号]
+
* Do not distribute anything on fedorapeople.org that Fedora itself cannot distribute for legal reasons. Nothing on the [http://fedoraproject.org/wiki/ForbiddenItems ForbiddenItems] list or otherwise non distributable by Fedora.
# 你必须在一个组里贡献(CLA组以外)
+
* Do not upload your private .ssh keys. While Fedora IT works hard on keeping the servers secure, break ins will happen and private keys uploaded can be downloaded and brute-forced easily these days. Private .ssh keys if found during an audit will be deleted.
# 你需要生成一个ssh密钥(使用终端ssh-keygen -t rsa)
+
# 上传密钥到你的Fedora帐号。欲上传,[https://admin.fedoraproject.org/accounts/user/edit 点此] 并选择你使用 ''Public RSA SSH key'' 段的密钥文件。通常,你的密钥会存储在你的主目录下的 ''.ssh/id_rsa.pub''。SSH密钥给你上传The
+
# 欲连接,上传ssh密钥到你的Fedora帐号:<pre>ssh -i ~/.ssh/id_rsa <你的fedora id>@fedorapeople.org</pre>
+
  
这步也可以在[https://admin.fedoraproject.org/accounts/ Fedora 帐号.]完成。
+
== Accessing Your fedorapeople.org Space ==
  
# 当已登陆,点击在侧栏的“我的帐号”。
+
# You need an active [https://admin.fedoraproject.org/accounts/ Fedora account]
# 选择“账户明细”旁的“编辑”链接。
+
# You must be sponsored in a group (other than the CLA groups)
# 键入<pre>~/.ssh/id_rsa.pub</pre>到下面的“公共RSA SSH密钥”区段。
+
# You need to generate a ssh key (ssh-keygen -t rsa).
# 单击“保存!”按钮。
+
# Upload that ssh key into your Fedora account. To upload, [https://admin.fedoraproject.org/accounts/user/edit visit this link] and select your key file using the ''Public RSA SSH key'' field. Normally your key is stored in your home directory under ''.ssh/id_rsa.pub''. The ssh key gets activated an hour after you upload it.
# 验证信息。你会看到在你的账户明细的“公共SSH密钥:”段的“ssh-rsa”和后面的数字和字串。
+
# To connect, use the ssh key you uploaded into your Fedora account:<pre>ssh -i ~/.ssh/id_rsa <your_fedora_id>@fedorapeople.org</pre>
  
== 通用答案 ==
+
This step can also be done via [https://admin.fedoraproject.org/accounts/ Fedora account.]
  
* 每个Fedora贡献者拥有150 MiB的配额控制空间。
+
# While logged in, click on "My Account" on the side bar.
* 如果你用完了空间你应该清除你不需要的文件,然后你应该联系Fedora基础设施以提高你的配额。
+
# Select "edit" link next to "Account Details."
* 要创建一个公开可见空间,请创建一个<code>public_html</code>目录。
+
# Type the following in the "Public RSA SSH Key:" field:<pre>~/.ssh/id_rsa.pub</pre>
* 使用scp、sftp或rsync来上传文件。
+
# Click the "Save!" button.
{{admon/tip | 使用鹦鹉螺 | 如果你使用GNOME,访问[[Infrastructure/fedorapeople.org/Connecting_with_Nautilus | 此页]] 获得一个易行的连接你的fedorapeople.org空间的方法。}}
+
# Verify your success. You will see "ssh-rsa" followed by alpha numeric string in "Public SSH Key:" field of your Account Details.
  
{{admon/tip | 使用 Dolphin 或 Konqueror | 如果你使用KDE,键入 <code>sftp://your_username@fedorapeople.org</code> 到你的文件管理器的地址栏以简易连接你的fedorapeople.org空间。}}
+
== Common Answers ==
  
要从命令行复制文件,请使用scp
+
* Each Fedora contributor has 2000000 KiB (approximately 1954 MiB) of quota-controlled space.
 +
* If you run out of space you should: clean up stuff you don't need. If you cannot clean up anything then you should contact fedora infrastructure to raise your quota.
 +
* To make a publicly viewable space, create a <code>public_html</code> directory.
 +
* Fedora people is NOT to be used for development or creating repositories on. Repositories will need to be created elsewhere and uploaded via scp or rsync.
 +
* DO NOT try to use sudo to install packages you "need." Unless you are in the Infrastructure group, and have gotten approval from sysadmin-main, extra packages are not to be installed on fedorapeople.
 +
* Upload files using scp, sftp, or rsync.
 +
{{admon/tip | Using Nautilus | If you use GNOME, visit [[Infrastructure/fedorapeople.org/Connecting_with_Nautilus | this page]] for an easy way to connect to your fedorapeople.org space.}}
 +
 
 +
{{admon/tip | Using Dolphin or Konqueror | If you use KDE, type <code>sftp://your_username@fedorapeople.org</code> in your file manager address bar for an easy way to connect to your fedorapeople.org space.}}
 +
 
 +
To copy files from the command line, you can use scp
  
 
<pre>
 
<pre>
scp /path/to/file 你的_fedora_用户名@fedorapeople.org:/home/fedora/你的_fedora_用户名/public_html
+
scp /path/to/file your_fedora_username@fedorapeople.org:/home/fedora/your_fedora_username/public_html
 
</pre>
 
</pre>
  
  
 
+
* Once uploaded into the users public_html directory the files are available via http at: http://your_username.fedorapeople.org/.
* 一旦上传文件到用户的public_html目录,可通过http访问:http://你的用户名.fedorapeople.org/.
+
* Give other users access to read/write/etc files by using extended acls. Read man pages for setfacl and getfacl for adding them to your dirs/files. This gives the user jkeating read and write access to <code>file</code>:
* 用拓展ACL给其他用户读写等访问。阅读setfacl和getfacl的man手册,天津它们到你的目录/文件。这使得用户可以读写访问<code>文件</code>
+
  
 
<pre>setfacl -m u:jkeating:rw file</pre>
 
<pre>setfacl -m u:jkeating:rw file</pre>
 +
 +
== ''BETA'' git hosting support ==
 +
 +
fedorapeople.org now has support for hosting git repositories including accessing them via the git:// protocol for anonymous downloads as well as providing gitweb.  ''This should be considered beta.''
 +
 +
Here is a quick rundown of how to get started using git on fedorapeople.org.  It assumes that you are already somewhat familiar with git.  You might want to take a look at the [[Git quick reference]].
 +
 +
=== Create a <code>~/public_git</code> directory on fedorapeople.org ===
 +
 +
<pre>ssh your_fedora_username@fedorapeople.org "mkdir ~/public_git; /sbin/restorecon -Rv ~/public_git"</pre>
 +
 +
=== Creating a new git repository in <code>~/public_git</code> ===
 +
 +
As an example, here is one method to create an empty repository ''on your local system'' and upload it:
 +
 +
<pre>
 +
git init --bare repo.git
 +
scp -r repo.git/ your_fedora_username@fedorapeople.org:~/public_git/
 +
</pre>
 +
 +
This creates a ''bare'' repository (i.e. a repository that has no working directory).  It contains just the files that are part of the <code>.git</code> directory of a ''non-bare'' git repository (the kind most users are accustomed to seeing).
 +
 +
{{admon/important|Repository name must end with .git|Gitweb will not list repos that do not end in <code>.git</code>.|}}
 +
 +
=== Uploading an existing repository to <code>~/public_git</code> ===
 +
 +
If you have an existing repository you want to use on fedorapeople, you can do so easily:
 +
 +
<pre>
 +
git clone --bare /path/to/local/repo repo.git
 +
scp -r repo.git/ your_fedora_username@fedorapeople.org:public_git/
 +
</pre>
 +
 +
The caveats from the previous section apply here as well.
 +
 +
 +
=== Pushing to your repository ===
 +
 +
To push changes from a local repository:
 +
 +
<pre>
 +
cd /path/to/local/repo
 +
git remote add fedorapeople your_fedora_username@fedorapeople.org:public_git/repo.git
 +
git push --mirror fedorapeople
 +
</pre>
 +
 +
This creates a mirror of your local repository.  All of the branches and tags in the local repository will be pushed to the fedorapeople repository.
 +
 +
If you only want to push selected branches, amend the <code>git push</code> example.  For example, to push only your local master branch:
 +
 +
<pre>git push fedorapeople master</pre>
 +
 +
 +
{{admon/tip|Allowing others to push|You can allow other fedorapeople.org users to push to your repository using extended acls (see <code>setfacl(1)</code> for details).  However, if you have many others working on your project, using [http://fedorahosted.org Fedora Hosted] is strongly preferred.}}
 +
 +
 +
=== Cloning your repository ===
 +
 +
To clone your repository, use a command similar to:
 +
 +
<pre>git clone git://fedorapeople.org/~your_fedora_username/repo.git</pre>
 +
 +
 +
It is also possible to clone your project via the http:// protocol.  In order for this to work, you must arrange to have <code>git-update-server-info</code> run whenever you update your repository.  Typically, this is done with a post-update hook script.  However, the user home directories on fedorapeople.org are mounted with the noexec option, which prevents the script from running.  Instead, you may create a symbolic link to <code>git-update-server-info</code> in the hooks directory of your repository:
 +
 +
<pre>
 +
ssh your_fedora_username@fedorapeople.org
 +
cd ~/public_git/repo.git/hooks
 +
ln -svbf $(git --exec-path)/git-update-server-info post-update
 +
git update-server-info
 +
</pre>
 +
 +
 +
You also need to create a link from ~/public_html/git to ~/public_git:
 +
 +
<pre>
 +
cd ~/public_html
 +
ln -svbf ../public_git git
 +
</pre>
 +
 +
 +
You can clone your repository over http:// with a command similar to:
 +
 +
<pre>git clone http://your_fedora_username.fedorapeople.org/git/repo.git/</pre>
 +
 +
 +
{{admon/tip|git:// versus http://|Only clone via http:// if you are behind a firewall that prevents git:// from working.  The git:// protocol is faster and more efficient than the http:// protocol for git usage.}}
 +
 +
=== Browsing your project via gitweb ===
 +
 +
You can see your project listed in [http://fedorapeople.org/gitweb gitweb] once the project list updates.  This happens hourly.  ''Note that the gitweb URL may change.''
 +
 +
 +
{{admon/tip|Repository description|You can set the description for the repository that is displayed in gitweb by editing the <code>description</code> file in your repository.}}
 +
 +
 +
{{admon/tip|Repository URLs|The URLs gitweb shows for your repository by default are incorrect (since the introduction of the service in mid-2008, last checked 2010-08-11). You can work around that by adding a file <code>cloneurl</code> to your repository which contains working URLs.
 +
 +
Default broken URLs:
 +
<pre>
 +
git://fedorapeople.org/home/fedora/your_fedora_username/public_git/repo.git
 +
ssh://fedorapeople.org/home/fedora/your_fedora_username/public_git/repo.git
 +
</pre>
 +
 +
Write these URLs into the <code>cloneurl</code> file to work around that:
 +
<pre>
 +
git://fedorapeople.org/~your_fedora_username/repo.git
 +
ssh://fedorapeople.org/~your_fedora_username/public_git/repo.git
 +
</pre>
 +
 +
}}
 +
 +
=== Shared repository ===
 +
 +
If you want to give access to your repository to other users you can do this with ACLs.
 +
 +
  setfacl -R -m u:<user>:rwX <repo.git>
 +
  find <repo.git> -type d | xargs setfacl -R -m d:u:<user>:rwX
 +
 +
[[Category:Infrastructure]]

Revision as of 04:20, 18 January 2012

Contents

fedorapeople.org

This page covers the details on how to obtain and use your personal space on fedorapeople.org , which is a site where Fedora contributors can upload files for sharing out with the world. It is perfect for uploading specfiles, srpms, patches, personal repository etc, etc.

Allowable content

  • Do not distribute anything on fedorapeople.org that Fedora itself cannot distribute for legal reasons. Nothing on the ForbiddenItems list or otherwise non distributable by Fedora.
  • Do not upload your private .ssh keys. While Fedora IT works hard on keeping the servers secure, break ins will happen and private keys uploaded can be downloaded and brute-forced easily these days. Private .ssh keys if found during an audit will be deleted.

Accessing Your fedorapeople.org Space

  1. You need an active Fedora account
  2. You must be sponsored in a group (other than the CLA groups)
  3. You need to generate a ssh key (ssh-keygen -t rsa).
  4. Upload that ssh key into your Fedora account. To upload, visit this link and select your key file using the Public RSA SSH key field. Normally your key is stored in your home directory under .ssh/id_rsa.pub. The ssh key gets activated an hour after you upload it.
  5. To connect, use the ssh key you uploaded into your Fedora account:
    ssh -i ~/.ssh/id_rsa <your_fedora_id>@fedorapeople.org

This step can also be done via Fedora account.

  1. While logged in, click on "My Account" on the side bar.
  2. Select "edit" link next to "Account Details."
  3. Type the following in the "Public RSA SSH Key:" field:
    ~/.ssh/id_rsa.pub
  4. Click the "Save!" button.
  5. Verify your success. You will see "ssh-rsa" followed by alpha numeric string in "Public SSH Key:" field of your Account Details.

Common Answers

  • Each Fedora contributor has 2000000 KiB (approximately 1954 MiB) of quota-controlled space.
  • If you run out of space you should: clean up stuff you don't need. If you cannot clean up anything then you should contact fedora infrastructure to raise your quota.
  • To make a publicly viewable space, create a public_html directory.
  • Fedora people is NOT to be used for development or creating repositories on. Repositories will need to be created elsewhere and uploaded via scp or rsync.
  • DO NOT try to use sudo to install packages you "need." Unless you are in the Infrastructure group, and have gotten approval from sysadmin-main, extra packages are not to be installed on fedorapeople.
  • Upload files using scp, sftp, or rsync.
Idea.png
Using Nautilus
If you use GNOME, visit this page for an easy way to connect to your fedorapeople.org space.
Idea.png
Using Dolphin or Konqueror
If you use KDE, type sftp://your_username@fedorapeople.org in your file manager address bar for an easy way to connect to your fedorapeople.org space.

To copy files from the command line, you can use scp

scp /path/to/file your_fedora_username@fedorapeople.org:/home/fedora/your_fedora_username/public_html


  • Once uploaded into the users public_html directory the files are available via http at: http://your_username.fedorapeople.org/.
  • Give other users access to read/write/etc files by using extended acls. Read man pages for setfacl and getfacl for adding them to your dirs/files. This gives the user jkeating read and write access to file:
setfacl -m u:jkeating:rw file

BETA git hosting support

fedorapeople.org now has support for hosting git repositories including accessing them via the git:// protocol for anonymous downloads as well as providing gitweb. This should be considered beta.

Here is a quick rundown of how to get started using git on fedorapeople.org. It assumes that you are already somewhat familiar with git. You might want to take a look at the Git quick reference.

Create a ~/public_git directory on fedorapeople.org

ssh your_fedora_username@fedorapeople.org "mkdir ~/public_git; /sbin/restorecon -Rv ~/public_git"

Creating a new git repository in ~/public_git

As an example, here is one method to create an empty repository on your local system and upload it:

git init --bare repo.git
scp -r repo.git/ your_fedora_username@fedorapeople.org:~/public_git/

This creates a bare repository (i.e. a repository that has no working directory). It contains just the files that are part of the .git directory of a non-bare git repository (the kind most users are accustomed to seeing).

Important.png
Repository name must end with .git
Gitweb will not list repos that do not end in .git.

Uploading an existing repository to ~/public_git

If you have an existing repository you want to use on fedorapeople, you can do so easily:

git clone --bare /path/to/local/repo repo.git
scp -r repo.git/ your_fedora_username@fedorapeople.org:public_git/

The caveats from the previous section apply here as well.


Pushing to your repository

To push changes from a local repository:

cd /path/to/local/repo
git remote add fedorapeople your_fedora_username@fedorapeople.org:public_git/repo.git
git push --mirror fedorapeople

This creates a mirror of your local repository. All of the branches and tags in the local repository will be pushed to the fedorapeople repository.

If you only want to push selected branches, amend the git push example. For example, to push only your local master branch:

git push fedorapeople master


Idea.png
Allowing others to push
You can allow other fedorapeople.org users to push to your repository using extended acls (see setfacl(1) for details). However, if you have many others working on your project, using Fedora Hosted is strongly preferred.


Cloning your repository

To clone your repository, use a command similar to:

git clone git://fedorapeople.org/~your_fedora_username/repo.git


It is also possible to clone your project via the http:// protocol. In order for this to work, you must arrange to have git-update-server-info run whenever you update your repository. Typically, this is done with a post-update hook script. However, the user home directories on fedorapeople.org are mounted with the noexec option, which prevents the script from running. Instead, you may create a symbolic link to git-update-server-info in the hooks directory of your repository:

ssh your_fedora_username@fedorapeople.org
cd ~/public_git/repo.git/hooks
ln -svbf $(git --exec-path)/git-update-server-info post-update
git update-server-info


You also need to create a link from ~/public_html/git to ~/public_git:

cd ~/public_html
ln -svbf ../public_git git


You can clone your repository over http:// with a command similar to:

git clone http://your_fedora_username.fedorapeople.org/git/repo.git/


Idea.png
git:// versus http://
Only clone via http:// if you are behind a firewall that prevents git:// from working. The git:// protocol is faster and more efficient than the http:// protocol for git usage.

Browsing your project via gitweb

You can see your project listed in gitweb once the project list updates. This happens hourly. Note that the gitweb URL may change.


Idea.png
Repository description
You can set the description for the repository that is displayed in gitweb by editing the description file in your repository.


Idea.png
Repository URLs
The URLs gitweb shows for your repository by default are incorrect (since the introduction of the service in mid-2008, last checked 2010-08-11). You can work around that by adding a file cloneurl to your repository which contains working URLs.

Default broken URLs:

git://fedorapeople.org/home/fedora/your_fedora_username/public_git/repo.git
ssh://fedorapeople.org/home/fedora/your_fedora_username/public_git/repo.git

Write these URLs into the cloneurl file to work around that:

git://fedorapeople.org/~your_fedora_username/repo.git
ssh://fedorapeople.org/~your_fedora_username/public_git/repo.git

Shared repository

If you want to give access to your repository to other users you can do this with ACLs.

 setfacl -R -m u:<user>:rwX <repo.git>
 find <repo.git> -type d | xargs setfacl -R -m d:u:<user>:rwX