# # # add_file "prunegraphs.sh" # content [963f5d8c8baacab0f48d86a4c193402f3a101736] # # patch "README" # from [470adb2dc7fd2d70bf3c7d2e9db5b69e97679251] # to [846761e92b7854df88c898ef505bff71e65434e6] # # patch "TODO" # from [c64171bbbd73fbb3a301fd5ada2ceb89f577a8e3] # to [2f89d4b97b7d926eda475ff12ba09e7bf2870893] # # patch "hostconfig.dist" # from [63f15af4248fea5e953624f10e5f04391e847d6d] # to [094160cadf511eb392c4949f4b846735a0a87025] # # set "prunegraphs.sh" # attr "mtn:execute" # value "true" # ============================================================ --- prunegraphs.sh 963f5d8c8baacab0f48d86a4c193402f3a101736 +++ prunegraphs.sh 963f5d8c8baacab0f48d86a4c193402f3a101736 @@ -0,0 +1,19 @@ +#!/bin/sh +# remove old files from graphs/ until its less that the specified +# maximum size +# +# run this from the install directory as a cron job + +MAXNUM=$(grep '^graphdir_size' hostconfig \ + | sed 's/^[^"]*"\([^"]*\)"[^"]*$/\1/g') + +NUM=$(du -s graphs/ | awk '{print $1;}') + +for i in $(ls -utr graphs/); do + if ((NUM < MAXNUM)); then + break; + fi + S=$(du -s graphs/$i | awk '{print $1;}') + rm -f graphs/$i + NUM=$((NUM - S)) +done ============================================================ --- README 470adb2dc7fd2d70bf3c7d2e9db5b69e97679251 +++ README 846761e92b7854df88c898ef505bff71e65434e6 @@ -8,17 +8,41 @@ 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 permission to read/insert/update. If you want the reset script to work, you need permission to delete. + +skel/keys + put your server keypair here + cp hostconfig.dist hostconfig and then update to match your local setup +cp www/viewmtn/config.py.example www/viewmtn/config.py + and then update to match your local setup + +* add a cron job to occasionally run prunegraphs.sh in the install + directory + +common.php + make sure that $conffile points to the hostconfig file + +* Make sure all dns addresses *. map to an address that the + usher is listening on. + +usher hostconfig + There's a modified usher that uses the same config file and + takes the server list from a database + + + skel/ Some useful files www/ Make this accessible to your webserver @@ -36,11 +60,3 @@ that are owned by the same user as the target file. hostconfig config file -common.php $conffile must point to the hostconfig file - -Make sure all dns addresses *. map to an address that the -usher is listening on. - -usher hostconfig - There's a modified usher that uses the same config file and - takes the server list from a database ============================================================ --- TODO c64171bbbd73fbb3a301fd5ada2ceb89f577a8e3 +++ TODO 2f89d4b97b7d926eda475ff12ba09e7bf2870893 @@ -1,5 +1,3 @@ -script to remove the oldest files from graphs/ whenever it gets too big - www/admin-web* maybe have webspace? ============================================================ --- hostconfig.dist 63f15af4248fea5e953624f10e5f04391e847d6d +++ hostconfig.dist 094160cadf511eb392c4949f4b846735a0a87025 @@ -7,4 +7,6 @@ hostkey "address@hidden" hostkeypass "address@hidden" monotone "/home/timothy/bin/monotone" + +graphdir_size "10000" comment "parsing is somewhat broken, keep this line at the end"