chiark / gitweb /
odin-cgi
8 years agoStore Unix timestamps in the database, rather than SQL ones.
Mark Wooding [Fri, 24 Jul 2015 17:33:03 +0000 (18:33 +0100)]
Store Unix timestamps in the database, rather than SQL ones.

This will make doing calculations with them easier, and removes some
really annoying database-portability problems.

8 years agolib/Odin.pm, mason/common/autohandler: Track time of the current job.
Mark Wooding [Fri, 24 Jul 2015 17:35:21 +0000 (18:35 +0100)]
lib/Odin.pm, mason/common/autohandler: Track time of the current job.

8 years agolib/Odin.pm, bin/pastebin.userv: Use our own simple option parser.
Mark Wooding [Fri, 24 Jul 2015 17:00:32 +0000 (18:00 +0100)]
lib/Odin.pm, bin/pastebin.userv: Use our own simple option parser.

Perl's Getopt::Std doesn't let us handle options which are repeated.
Getopt::Long can do this, but it involves a lot of messing about to set
it up, and it has slightly bizarre option-cuddling behaviour.  So we
implement a very simple option parser and use it instead.

8 years agoThe official `plain text' language is `txt'.
Mark Wooding [Fri, 24 Jul 2015 17:41:45 +0000 (18:41 +0100)]
The official `plain text' language is `txt'.

Expunge the various references to our fictional `plain-text' language.

8 years agomason/pastebin/, static/odin.css: Cope if client doesn't send cookies.
Mark Wooding [Mon, 6 Jul 2015 11:36:22 +0000 (12:36 +0100)]
mason/pastebin/, static/odin.css: Cope if client doesn't send cookies.

Previously the edit key would just get lost.  Instead, detect the
situation and show a page with a fierce warning: because we can't hide
the edit key anywhere other than the actual page URL, the link is unsafe
to share, so it's important to make it obvious which link is safe.

8 years agomason/pastebin/dhandler: Some small refactorings.
Mark Wooding [Mon, 6 Jul 2015 11:34:33 +0000 (12:34 +0100)]
mason/pastebin/dhandler: Some small refactorings.

8 years agomason/pastebin/%show: The `edit' argument is never omitted.
Mark Wooding [Mon, 6 Jul 2015 11:29:40 +0000 (12:29 +0100)]
mason/pastebin/%show: The `edit' argument is never omitted.

So there's no point in making it optional.

8 years agouserv.rc: New example Userv configuration file.
Mark Wooding [Sat, 4 Jul 2015 16:57:44 +0000 (17:57 +0100)]
userv.rc: New example Userv configuration file.

8 years agosql/setup-shorturl.sql: Add index by (url, owner).
Mark Wooding [Sat, 4 Jul 2015 17:02:40 +0000 (18:02 +0100)]
sql/setup-shorturl.sql: Add index by (url, owner).

When we're trying to create a new entry, we search for an existing entry
for the same URL and a similar owner.  The index means we avoid having
to do a full scan of the table for this.

8 years agosql/setup-shorturl.sql: Drop old tables if they're missing.
Mark Wooding [Sat, 4 Jul 2015 17:00:45 +0000 (18:00 +0100)]
sql/setup-shorturl.sql: Drop old tables if they're missing.

8 years agosql/setup-pastebin.sql: Missing comma.
Mark Wooding [Sat, 4 Jul 2015 16:57:17 +0000 (17:57 +0100)]
sql/setup-pastebin.sql: Missing comma.

8 years agobin/populate-lang-table: Store description with new language.
Mark Wooding [Sat, 4 Jul 2015 16:56:50 +0000 (17:56 +0100)]
bin/populate-lang-table: Store description with new language.

Stupid bug fix.

8 years agoInitial commit.
Mark Wooding [Fri, 3 Jul 2015 19:23:08 +0000 (20:23 +0100)]
Initial commit.

Seems to work.  Mostly.