# # # add_file "dbrotate.sh" # content [bf27ecc964991c40d1beac0cbb8eedf5cd4ddd91] # # patch "README" # from [3cff6832c62428446865879c54726de33c770189] # to [470adb2dc7fd2d70bf3c7d2e9db5b69e97679251] # # patch "TODO" # from [35bfbacfdeb69eba0f9c08fde8201265ab532555] # to [c64171bbbd73fbb3a301fd5ada2ceb89f577a8e3] # # patch "skel/monotonerc" # from [f6760ff68af902d1e6ecbde57097b7085fa1de91] # to [994e7d6e0fa4a91b1f507aefffe0af1d1f4b5d5f] # # set "dbrotate.sh" # attr "mtn:execute" # value "true" # ============================================================ --- dbrotate.sh bf27ecc964991c40d1beac0cbb8eedf5cd4ddd91 +++ dbrotate.sh bf27ecc964991c40d1beac0cbb8eedf5cd4ddd91 @@ -0,0 +1,27 @@ +#!/bin/sh + +queue() +{ + if ln -s x rotate_is_queued; then + echo $0 run $1 | at now + 5 minutes + fi +} + +run() +{ + rm rotate_is_queued + PROJ=$(basename $1) + HOST=$(grep '^hostname' ../../hostconfig \ + | sed 's/^[^"]*"\([^"]*\)"[^"]*$/\1/g') + HOSTNAME=$PROJ.$HOST + MONOTONE=$(grep '^monotone' ../../hostconfig \ + | sed 's/^[^"]*"\([^"]*\)"[^"]*$/\1/g') + $MONOTONE pull -d database.transfer $HOSTNAME \* + ln database.viewmtn database.temp + mv database.transfer database.viewmtn + mv database.temp database.transfer +} +cd $2 +if [ "$1" == "queue" ] || [ "$1" == "run" ]; then + $@ >/dev/null 2>&1 +fi ============================================================ --- README 3cff6832c62428446865879c54726de33c770189 +++ README 470adb2dc7fd2d70bf3c7d2e9db5b69e97679251 @@ -1,14 +1,16 @@ make symlinks Set up a couple of symlinks -make usher - Modified usher that uses the project database for a server list, - and uses the same config file as the web interface. make acl user=www-data Give the www-data user (or replace this with whichever user the webserver is) rwx permissions to the directories it stores data in. make owner user=www-data Give the www-data user ownership of some files in www/ that it needs to be able to symlink to. +make setup user=www-data + All of the above. +make usher + Modified usher that uses the project database for a server list, + and uses the same config file as the web interface. createdb psql -f schema.sql setup database, if not done as the webserver user, that user will need ============================================================ --- TODO 35bfbacfdeb69eba0f9c08fde8201265ab532555 +++ TODO c64171bbbd73fbb3a301fd5ada2ceb89f577a8e3 @@ -1,24 +1,7 @@ -script to keep viewmtn database in sync with server database - projects/*/database server database - projects/*/database.viewmtn viewmtn database - projects/*/database.transfer extra database - - pull -d database.transfer - ln database.viewmtn database.temp - mv database.transfer database.viewmtn - mv database.temp database.transfer - - from note_netsync_revision_received, with at(1) and a flag so multiple - times don't get queued at once? - - ...or just be very sure that attempted concurrent access from viewmtn - and the server won't crash the server. - script to remove the oldest files from graphs/ whenever it gets too big www/admin-web* maybe have webspace? www/admin-resources* + more resource types - have links to various things (ml, irc logs, newsgroups, etc) - have these links go in the sidebar? ============================================================ --- skel/monotonerc f6760ff68af902d1e6ecbde57097b7085fa1de91 +++ skel/monotonerc 994e7d6e0fa4a91b1f507aefffe0af1d1f4b5d5f @@ -45,3 +45,7 @@ function get_netsync_read_permitted(foo, bar) return true end + +function note_netsync_revision_received(revid, rdat, rcerts) + execute(get_confdir() .. "/../../dbrotate.sh", "queue", get_confdir()) +end