Blame
Date:
Wed Oct 12 04:00:17 2022
UTC
Message:
Daily backup
11
2021-12-17
text=(:title Create CVS Repo:)%0a%0aThis guide explains how to create a CVS repository.%0a%0a!! Create commit group%0a%0aFirst, you may want to create a new group with commit rights:%0a%0a[@%0a$ doas groupadd commit%0a@]%0a%0aFor each existing user you want to give commit rights to:%0a%0a[@%0a$ doas usermod -G commit $USER%0a@]%0a%0aFor each new user you want to create with commit rights:%0a%0a[@%0a$ doas useradd -G commit $USER%0a@]%0a%0aReplace $USER with the committer's user's name.%0a%0a!! Setting CVSROOT%0a%0aBefore we begin, decide where you want the CVS files to be located. You will want to set CVSROOT.%0a%0aYou can set it for just the current shell:%0a%0a[@%0a$ export CVSROOT=/path/to/CVS%0a@]%0a%0aReplace @@/path/to/CVS@@ with the actual directory. /CVS is recommended:%0a%0a[@%0a$ export CVSROOT=/CVS%0a@]%0a%0aAs a shortcut, you can add this to the bottom of your ~/.profile so you don't have to type it each time:%0a%0a[@%0a$ echo 'CVSROOT="/CVS"' >> ~/.profile%0a@]%0a%0aOnce CVSROOT is set, log out and log in. From now on, you can omit the -d argument when working with cvs.%0a%0a!! Create new repo%0a%0aTo create a new CVS repository, type:%0a%0a[@%0a$ doas mkdir $CVSROOT%0a$ doas chown $USER:commit $CVSROOT%0a$ cvs init%0a@]%0a%0aReplace @@$USER@@ with the maintainer of CVSROOT.%0a%0a!! Import New Module%0a%0aIf you have existing code that you'd like to import to a CVS repository, first change%0ato the folder containing the source code, then type:%0a%0a[@%0a$ cvs import reponame vendortag releasetag%0a@]%0a%0aReplace @@reponame@@, @@vendortag@@, and @@releasetag@@. CVS will put the source files inside a directory named @@reponame@@ inside the CVS root directory. @@vendortag@@ should be replaced with the vendor (the author) of the repository. @@releasetag@@ is the tag for the specific release.%0a%0aFor example:%0a%0a[@%0a$ cd ~/ircnowd/%0a$ cvs import ircnowd ircnow start%0a@]%0a%0a'''Note''': CVS does not automatically transform the imported source code into a working directory. As a result, any changes you make to the original source code directory cannot be committed to the CVS repo.%0a%0aTo fix this, you will need to checkout the source code. Change your directory to somewhere else to place the new working directory, then type:%0a%0a[@%0a$ cd /path/to/new/directory/%0a$ cvs checkout -P reponame%0a@]%0a%0aReplace @@/path/to/new/directory/@@ with the directory you want the working directory to be in. Then, replace @@reponame@@ with the repository name.%0a%0aChange directory to @@reponame@@ to make changes. Afterwards, use cvs to commit them:%0a%0a[@%0a$ cd reponame%0a... work on code ...%0a$ cvs commit%0a@]%0a%0aFor example, suppose you create a new folder for working directories ~/code/ and then checkout the working directory for ircnowd:%0a%0a[@%0a$ mkdir ~/code/%0a$ cd ~/code/%0a$ cvs checkout -P ircnowd%0a$ cd ~/code/ircnowd/%0a... work on code ...%0a$ cvs commit%0a@]%0a%0aNow, ~/code/ircnowd will have the working directory for ircnowd. CVS will track changes so that you can commit changes to the CVS repo.%0a%0aIf checkout works properly, you can safely delete the old source code directory you imported from (since that one is not tracked by CVS).%0a%0a[@%0a$ rm -rf ~/ircnowd/%0a@]%0a%0a!! Granting commit access%0a%0aYou will want to change group ownership and provide group write permissions:%0a%0a[@%0a$ doas chown -R $USER:commit $CVSROOT%0a$ doas chmod -R g+w $CVSROOT%0a@]%0a%0aA sample directory should look like this:%0a%0a[@%0a# ls -lha /CVS%0atotal 28%0adrwxr-xr-x 7 jrmu commit 512B Oct 9 06:19 .%0adrwxr-xr-x 10 root wheel 512B Oct 9 06:10 ..%0adrwxrwxr-x 3 jrmu commit 1.0K Apr 29 06:48 CVSROOT%0adrwxrwxr-x 9 jrmu commit 512B May 8 11:42 acopm%0adrwxrwxr-x 2 jrmu commit 1.0K Aug 26 04:17 botnow%0adrwxrwxr-x 8 jrmu commit 512B May 27 16:57 brogue-ce%0adrwxrwxr-x 6 jrmu commit 512B May 7 06:46 ircnowd%0a@]%0a%0a!! Optional: Prevent Shell Access%0a%0a'''Optional''': If your server is not used to provide shell accounts,%0aand all users who connect via ssh are admins, you can add the following to%0aprevent committers from having shell access:%0a%0aFirst, we create @@/usr/bin/cvs-login.sh@@:%0a%0a[@%0a#!/bin/sh%0a%0aexec /usr/bin/cvs server%0a@]%0a%0aThis simple shell script will be used as the login shell. Any time a committer%0alogs in, cvs will immediately be called.%0a%0aWe set it to be executable:%0a%0a[@%0a$ doas chown root:wheel /usr/bin/cvs-login.sh%0a$ doas chmod +x /usr/bin/cvs-login.sh%0a@]%0a%0aNext, edit @@/etc/ssh/sshd_config@@:%0a%0a[@%0aMatch Group commit,!wheel%0a AllowAgentForwarding no%0a AllowStreamLocalForwarding no%0a DisableForwarding yes%0a PermitListen none%0a PermitOpen none%0a PermitTunnel no%0a PermitUserRC no%0a X11Forwarding no%0a AllowTcpForwarding no%0a PermitTTY no%0a ForceCommand "/usr/bin/cvs-login.sh"%0a@]%0a%0aThis will force all users in the commit group who are not in wheel (not%0aadministrators) to use /usr/bin/cvs-login.sh. Committers therefore never%0aget shell access; they only get cvs access%0a%0aRestart sshd to apply changes:%0a%0a[@%0a$ doas rcctl restart sshd%0a@]%0a%0aSee Also:%0a%0a[[Cvs/Anoncvs|Anoncvs Guide]]%0a[[Cvs/Cvsweb|Cvsweb Guide]]%0a[[Cvs/Intro|CVS Intro]]%0a
15
2021-12-17
diff:1634459530:1634459459:=162d161%0a%3c $ doas chown root:wheel /usr/bin/cvs-login.sh%0a
18
2021-12-17
diff:1634459459:1634459339:=155a156,159%0a> [@%0a> $ doas chmod +x /usr/bin/cvs-login.sh%0a> @]%0a> %0a158,163d161%0a%3c %0a%3c We set it to be executable:%0a%3c %0a%3c [@%0a%3c $ doas chmod +x /usr/bin/cvs-login.sh%0a%3c @]%0a
21
2021-12-17
diff:1634459339:1634459295:=154,157d153%0a%3c @]%0a%3c %0a%3c [@%0a%3c $ doas chmod +x /usr/bin/cvs-login.sh%0a
24
2021-12-17
diff:1634459295:1634458599:=142,149c142,143%0a%3c !! Optional: Prevent Shell Access%0a%3c %0a%3c '''Optional''': If your server is not used to provide shell accounts,%0a%3c and all users who connect via ssh are admins, you can add the following to%0a%3c prevent committers from having shell access:%0a%3c %0a%3c First, we create @@/usr/bin/cvs-login.sh@@:%0a%3c %0a---%0a> Edit @@/etc/ssh/sshd_config@@:%0a> %0a151,161d144%0a%3c #!/bin/sh%0a%3c %0a%3c exec /usr/bin/cvs server%0a%3c @]%0a%3c %0a%3c This simple shell script will be used as the login shell. Any time a committer%0a%3c logs in, cvs will immediately be called.%0a%3c %0a%3c Next, edit @@/etc/ssh/sshd_config@@:%0a%3c %0a%3c [@%0a176,181c159,160%0a%3c This will force all users in the commit group who are not in wheel (not%0a%3c administrators) to use /usr/bin/cvs-login.sh. Committers therefore never%0a%3c get shell access; they only get cvs access%0a%3c %0a%3c Restart sshd to apply changes:%0a%3c %0a---%0a> Create @@/usr/bin/cvs-login.sh@@:%0a> %0a183c162,164%0a%3c $ doas rcctl restart sshd%0a---%0a> #!/bin/sh%0a> %0a> exec /usr/bin/cvs server%0a
27
2021-12-17
diff:1634458599:1634444560:=142,165c142,154%0a%3c Edit @@/etc/ssh/sshd_config@@:%0a%3c %0a%3c [@%0a%3c Match Group commit,!wheel%0a%3c AllowAgentForwarding no%0a%3c AllowStreamLocalForwarding no%0a%3c DisableForwarding yes%0a%3c PermitListen none%0a%3c PermitOpen none%0a%3c PermitTunnel no%0a%3c PermitUserRC no%0a%3c X11Forwarding no%0a%3c AllowTcpForwarding no%0a%3c PermitTTY no%0a%3c ForceCommand "/usr/bin/cvs-login.sh"%0a%3c @]%0a%3c %0a%3c Create @@/usr/bin/cvs-login.sh@@:%0a%3c %0a%3c [@%0a%3c #!/bin/sh%0a%3c %0a%3c exec /usr/bin/cvs server%0a%3c @]%0a---%0a> Match Group cvscommit,!wheel%0a> AllowAgentForwarding no%0a> AllowStreamLocalForwarding no%0a> DisableForwarding yes%0a> PermitListen none%0a> PermitOpen none%0a> PermitTunnel no%0a> PermitUserRC no%0a> X11Forwarding no%0a> AllowTcpForwarding no%0a> PermitTTY no%0a> ForceCommand "/usr/bin/cvs-login.sh"%0a> %0a
30
2021-12-17
diff:1634444560:1634444286:=13,14c13,14%0a%3c For each existing user you want to give commit rights to:%0a%3c %0a---%0a> For each user you want to give commit rights to:%0a> %0a19,24d18%0a%3c For each new user you want to create with commit rights:%0a%3c %0a%3c [@%0a%3c $ doas useradd -G commit $USER%0a%3c @]%0a%3c %0a141,154d134%0a%3c %0a%3c Match Group cvscommit,!wheel%0a%3c AllowAgentForwarding no%0a%3c AllowStreamLocalForwarding no%0a%3c DisableForwarding yes%0a%3c PermitListen none%0a%3c PermitOpen none%0a%3c PermitTunnel no%0a%3c PermitUserRC no%0a%3c X11Forwarding no%0a%3c AllowTcpForwarding no%0a%3c PermitTTY no%0a%3c ForceCommand "/usr/bin/cvs-login.sh"%0a%3c %0a
33
2021-12-17
diff:1634444286:1634443872:=127c127%0a%3c drwxr-xr-x 7 jrmu commit 512B Oct 9 06:19 .%0a---%0a> drwxr-xr-x 7 root wheel 512B Oct 9 06:19 .%0a
36
2021-12-17
diff:1634443872:1634443082:=43c43%0a%3c Once CVSROOT is set, log out and log in. From now on, you can omit the -d argument when working with cvs.%0a---%0a> Once CVSROOT is set, you can then omit the -d argument when working with cvs.%0a
39
2021-12-17
diff:1634443082:1634443082:=1,140d0%0a%3c (:title Create CVS Repo:)%0a%3c %0a%3c This guide explains how to create a CVS repository.%0a%3c %0a%3c !! Create commit group%0a%3c %0a%3c First, you may want to create a new group with commit rights:%0a%3c %0a%3c [@%0a%3c $ doas groupadd commit%0a%3c @]%0a%3c %0a%3c For each user you want to give commit rights to:%0a%3c %0a%3c [@%0a%3c $ doas usermod -G commit $USER%0a%3c @]%0a%3c %0a%3c Replace $USER with the committer's user's name.%0a%3c %0a%3c !! Setting CVSROOT%0a%3c %0a%3c Before we begin, decide where you want the CVS files to be located. You will want to set CVSROOT.%0a%3c %0a%3c You can set it for just the current shell:%0a%3c %0a%3c [@%0a%3c $ export CVSROOT=/path/to/CVS%0a%3c @]%0a%3c %0a%3c Replace @@/path/to/CVS@@ with the actual directory. /CVS is recommended:%0a%3c %0a%3c [@%0a%3c $ export CVSROOT=/CVS%0a%3c @]%0a%3c %0a%3c As a shortcut, you can add this to the bottom of your ~/.profile so you don't have to type it each time:%0a%3c %0a%3c [@%0a%3c $ echo 'CVSROOT="/CVS"' >> ~/.profile%0a%3c @]%0a%3c %0a%3c Once CVSROOT is set, you can then omit the -d argument when working with cvs.%0a%3c %0a%3c !! Create new repo%0a%3c %0a%3c To create a new CVS repository, type:%0a%3c %0a%3c [@%0a%3c $ doas mkdir $CVSROOT%0a%3c $ doas chown $USER:commit $CVSROOT%0a%3c $ cvs init%0a%3c @]%0a%3c %0a%3c Replace @@$USER@@ with the maintainer of CVSROOT.%0a%3c %0a%3c !! Import New Module%0a%3c %0a%3c If you have existing code that you'd like to import to a CVS repository, first change%0a%3c to the folder containing the source code, then type:%0a%3c %0a%3c [@%0a%3c $ cvs import reponame vendortag releasetag%0a%3c @]%0a%3c %0a%3c Replace @@reponame@@, @@vendortag@@, and @@releasetag@@. CVS will put the source files inside a directory named @@reponame@@ inside the CVS root directory. @@vendortag@@ should be replaced with the vendor (the author) of the repository. @@releasetag@@ is the tag for the specific release.%0a%3c %0a%3c For example:%0a%3c %0a%3c [@%0a%3c $ cd ~/ircnowd/%0a%3c $ cvs import ircnowd ircnow start%0a%3c @]%0a%3c %0a%3c '''Note''': CVS does not automatically transform the imported source code into a working directory. As a result, any changes you make to the original source code directory cannot be committed to the CVS repo.%0a%3c %0a%3c To fix this, you will need to checkout the source code. Change your directory to somewhere else to place the new working directory, then type:%0a%3c %0a%3c [@%0a%3c $ cd /path/to/new/directory/%0a%3c $ cvs checkout -P reponame%0a%3c @]%0a%3c %0a%3c Replace @@/path/to/new/directory/@@ with the directory you want the working directory to be in. Then, replace @@reponame@@ with the repository name.%0a%3c %0a%3c Change directory to @@reponame@@ to make changes. Afterwards, use cvs to commit them:%0a%3c %0a%3c [@%0a%3c $ cd reponame%0a%3c ... work on code ...%0a%3c $ cvs commit%0a%3c @]%0a%3c %0a%3c For example, suppose you create a new folder for working directories ~/code/ and then checkout the working directory for ircnowd:%0a%3c %0a%3c [@%0a%3c $ mkdir ~/code/%0a%3c $ cd ~/code/%0a%3c $ cvs checkout -P ircnowd%0a%3c $ cd ~/code/ircnowd/%0a%3c ... work on code ...%0a%3c $ cvs commit%0a%3c @]%0a%3c %0a%3c Now, ~/code/ircnowd will have the working directory for ircnowd. CVS will track changes so that you can commit changes to the CVS repo.%0a%3c %0a%3c If checkout works properly, you can safely delete the old source code directory you imported from (since that one is not tracked by CVS).%0a%3c %0a%3c [@%0a%3c $ rm -rf ~/ircnowd/%0a%3c @]%0a%3c %0a%3c !! Granting commit access%0a%3c %0a%3c You will want to change group ownership and provide group write permissions:%0a%3c %0a%3c [@%0a%3c $ doas chown -R $USER:commit $CVSROOT%0a%3c $ doas chmod -R g+w $CVSROOT%0a%3c @]%0a%3c %0a%3c A sample directory should look like this:%0a%3c %0a%3c [@%0a%3c # ls -lha /CVS%0a%3c total 28%0a%3c drwxr-xr-x 7 root wheel 512B Oct 9 06:19 .%0a%3c drwxr-xr-x 10 root wheel 512B Oct 9 06:10 ..%0a%3c drwxrwxr-x 3 jrmu commit 1.0K Apr 29 06:48 CVSROOT%0a%3c drwxrwxr-x 9 jrmu commit 512B May 8 11:42 acopm%0a%3c drwxrwxr-x 2 jrmu commit 1.0K Aug 26 04:17 botnow%0a%3c drwxrwxr-x 8 jrmu commit 512B May 27 16:57 brogue-ce%0a%3c drwxrwxr-x 6 jrmu commit 512B May 7 06:46 ircnowd%0a%3c @]%0a%3c %0a%3c See Also:%0a%3c %0a%3c [[Cvs/Anoncvs|Anoncvs Guide]]%0a%3c [[Cvs/Cvsweb|Cvsweb Guide]]%0a%3c [[Cvs/Intro|CVS Intro]]%0a