xb95 (xb95) wrote in lj_everywhere,
xb95
xb95
lj_everywhere

Getting Changelog Posting to Work

I've been asked how we got posting to changelog working on Plogs.net so I've put together this mini-HOWTO on how to do exactly that. We haven't configured ours all that much, but it does work.

When I reference a file, you can find it here:

http://cvs.livejournal.org/browse.cgi/CVSROOT/

Basically, you should download log_accum and commit_prep. Put those in your CVSROOT directory. You'll probably want to pop into them and make sure that the various directory defines at the top of the files are okay for your installation. It should be fairly self-explanatory.

Then, look at LiveJournal's loginfo and commitinfo files. The last line contains something that looks like this:

DEFAULT somecommandorother parameters etc

You want to copy that line into your own files, respectively. You will want to change around the paths, or make sure you have $CVSROOT set. For example, Plogs.net uses these:


loginfo:
DEFAULT perl /var/lib/cvs/plogs-public/CVSROOT/log_accum.pl -D -j /var/lib/cvs/plogs-public/CVSROOT/journalinfo %{Vvts}

commitinfo:
DEFAULT perl /var/lib/cvs/plogs-public/CVSROOT/commit_prep.pl


Those are minimal. I don't specify an e-mail address to notify of commits, because I don't want to get e-mails. The changelog posts are enough for me.

Now, you will notice that I specified a configuration file journalinfo in the first line. That file looks like this:

host: www.plogs.net
default-dest: changelog
login2lj-user-xb95: xb95
login2lj-user-crschmidt: crschmidt
login2lj-user-cvs: crschmidt


Basically, it defines the host that you will be posting to, the journal to post to, and how to translate CVS users into LJ users. One thing to understand about how the users work: CVS has a set of users, the system has a set of users, and LJ has a set of users. There are three distinct sets of users we're dealing with right now.

CVS maintains a list of translations to go from CVS -> system accounts. However, for some reason, that doesn't carry into this system, unless the user is logged in locally. Of course, that makes no sense, so let me explain.

Plogs.net is setup like this: I do development on the actual CVS server (which is separate from the system's server; cvs.plogs.net runs on queech.com, plogs.net runs on plogs.net). However, crschmidt does development on his own machine, and uses the CVS pserver to actually upload changes.

So, to CVS, I am me, and he is he. However, when log_accum gets run, crschmidt is recognized as user cvs, because he's using the pserver. Kinda dumb. I really don't care enough to try to make it work differently, because we only have two devs, so it works.

Now, if you're still with me, good. I would recommend that each of your developers use the system that CVS is on and have their own accounts, that makes things a lot easier. If not, you can use the hack I've used to define the cvs user to post as someone else, but that's not really a clean solution.

So, now that we've got this step done, we have to move on to the next piece, which is defining the passwords to post with. The changelog posting system isn't magically trusted by LiveJournal, it actually goes through the system like a user and posts. Thus, it needs passwords.

You'll need to create a password file named .log_accum.conf and put in it:

xb95:password
crschmidt:password


For me, this file was expected in /root, but that doesn't seem right. Although, it does make sense since the file really should be protected. It's got plaintext passwords, which is never a good thing, but hey. Security is your job, I won't tell you how to do it.

A few final notes:

- The links to CVS diffs are hardcoded to go to LiveJournal. You will want to edit log_accum to fix those.
- There are several options you can give log_accum, read the top of the file for information. You might be able to use some.

And finally... I don't support this. I can try to help if you have a question, but I figured it out, and you probably can too. ;)
Subscribe
  • Post a new comment

    Error

    Comments allowed for members only

    Anonymous comments are disabled in this journal

    default userpic

    Your IP address will be recorded 

  • 1 comment