次のエントリ: sarge リリース! [diary]
chalow ラッパー CGI (ChangeLog to HTML)
2005-06-06-1 / カテゴリ: [perl][programming][changelog][CGI][chalow] / [permlink]
[2005-06-03-1] のやつ。
まず、CGI でファイルアップローダ(chlogup.cgi)をテキトーに作成
で、ChangeLog をさくらへ up し、chalow を実行するシェルスクリプト(exec.sh)を作成
CGI を呼ぶ HTML もテキトーに。
さくらのサーバ上の ~/local/chalow 以下に chalow があるのが前提。
あとは、https でアクセスできるサーバにおいて、BASIC認証なりなんなりで制限すればいい(httpsなんでBASIC認証で十分でしょ)
まず、CGI でファイルアップローダ(chlogup.cgi)をテキトーに作成
#!/usr/bin/perl
use CGI;
my $cgi = new CGI;
my $updata = $cgi->param('file');
my $chfile = "ChangeLog";
print $cgi->header('text/plain');
unless (open F, "> $chfile") {
print "open error $chfile: $!\n";
exit 1;
}
while (<$updata>) {
print F;
}
close F;
print "exec chalow start\n";
print `/foo/bar/exec.sh 2>&1`;
print "exec chalow done\n";
で、ChangeLog をさくらへ up し、chalow を実行するシェルスクリプト(exec.sh)を作成
#!/bin/sh /bin/cat ChangeLog | /usr/bin/ssh -i sshの鍵 username@sakura 'cat | env PERL5LIB=local/chalow/ local/chalow/chalow -c local/chalow/cl.conf -o www/changelog -'
CGI を呼ぶ HTML もテキトーに。
<html> <body> <form action="chlogup.cgi" method="post" enctype="multipart/form-data"> <input type="file" name="file"> <input type="submit"> </form> </body> </html>
さくらのサーバ上の ~/local/chalow 以下に chalow があるのが前提。
あとは、https でアクセスできるサーバにおいて、BASIC認証なりなんなりで制限すればいい(httpsなんでBASIC認証で十分でしょ)
[
コメント ]
次のエントリ: sarge リリース! [diary]
2013 : 01 02 03 04 05 06 07 08 09 10 11 12
2012 : 01 02 03 04 05 06 07 08 09 10 11 12
2011 : 01 02 03 04 05 06 07 08 09 10 11 12
2010 : 01 02 03 04 05 06 07 08 09 10 11 12
2009 : 01 02 03 04 05 06 07 08 09 10 11 12
2008 : 01 02 03 04 05 06 07 08 09 10 11 12
2007 : 01 02 03 04 05 06 07 08 09 10 11 12
2006 : 01 02 03 04 05 06 07 08 09 10 11 12
2005 : 01 02 03 04 05 06 07 08 09 10 11 12
2004 : 01 02 03 04 05 06 07 08 09 10 11 12
最終更新時間: 2013-05-02 16:12
