apache setup update, new diaspora-init

This commit is contained in:
Alec Leamas 2010-10-06 21:53:24 +02:00
parent 9c14be8b11
commit 8ab97fe3f1
4 changed files with 60 additions and 19 deletions

View file

@ -1,10 +1,13 @@
## Diaspora RPM tools
Creates Fedora 13 RPM packages from diaspora git repository.
Creates RPM packages from diaspora git repository.
An alternative to the capistrano system, providing classic, binary RPM
packages for deployment on Fedora 13.
#### Synopsis:
Prerequisites: rub-1.8, rubygem and other packages as described in
*Prerequisites*: ruby-1.8, rubygem and other packages as described in
http://github.com/diaspora/diaspora/wiki/Rpm-installation-on-fedora
Create source tarballs like dist/diaspora-0.0-1010041233_fade4231.tar.gz
@ -23,10 +26,8 @@ Install
rpm -U ~/rmpbuild/rpms/i686/diaspora-bundle-0.0-1.1010042345_4343fade43.fc13.i686
rpm -U ~/rmpbuild/rpms/noarch/diaspora-0.0-1.1010042345_4343fade43.fc13.noarch
Initiate (as root)
/usr/sbin/diaspora-setup
# Fix hostname afterwards by editing pod_url in
# /usr/share/diaspora/master/config/app_config.yml
Initiate (as root).
/usr/share/diaspora/diaspora-setup
Start development server:
sudo
@ -34,9 +35,12 @@ Start development server:
cd master
./script/server
Start using apache passenger:
See: http://github.com/diaspora/diaspora/wiki/Using-apache
See http://github.com/diaspora/diaspora/wiki/Using-apache for
apache/passenger setup. After configuration, start with:
/sbin/service diaspora-ws start
/sbin/service httpd restart
#### Notes
Routines uses last available version from master branch at github. The
@ -58,3 +62,22 @@ won't start if the .git directories are not included. Needs investigation.
This has been confirmed to start up and provide basic functionality both using
the thin webserver and apache passenger.
#### Implementation
'make_dist.sh source' script checks out latest version of diaspora into the
dist/diaspora directory. This content is, after some patches, the diaspora package.
'make-dir.sh bundle' makes a 'bundle install --deployment' in the diaspora dir.
The resulting bundle is stored in vendor/bundle. This is, after some more
patches, the content of diaspora-bundle.
Here is also support for running the diaspora websocket service as a system
service through /sbin/service and some install scripts.
Diaspora files are stored in /usr/share/diaspora, and owned by diaspora. The
bundle, containing some C extensions, is architecture-dependent and lives
in /usr/lib[64]/diaspora. Log files are in /var/log/diaspora. Symlinks in
/usr/share diaspora makes log and bundle available as expected by diaspora app.
This is more or less as mandated by LSB and Fedora packaging rules.

View file

@ -3,6 +3,9 @@
# Do what's needed to initiate diaspora.
#
# See http://github.com/diaspora/diaspora/issues/issue/395
#
# Note: This is really sort of prototyping. This should be done in ruby,
# on a web page.
test $UID = "0" || {
echo "You need to be root to do this, giving up"
@ -11,19 +14,34 @@ test $UID = "0" || {
cd /usr/share/diaspora/master
if rake --trace db:seed:dev; then
cat <<- EOF
Database config OK, new user tom/evanhort in place.
You might want to edit /usr/share/diaspora/master/config/app_config.yml
and change the pod_url to this host's hostname.
EOF
if rake db:seed:dev; then
echo "Database config OK, new user tom/evankort in place"
else
cat <<- EOF
cat <<- EOF
Database config failed. You might want to remove all db files with
rm -rf /var/lib/mongodb/* and giv it a new try.
rm -rf /var/lib/mongodb/* and/or resetting the config file by
cp config/app_config.yml.example config/app_config.yml before
making a new try.
EOF
exit 1
fi
hostname=$( awk '/pod_url:/ { print $2; exit }' <config/app_config.yml)
while : ; do
echo "Current hostname is \"$hostname\""
echo -n "Enter new hostname [$hostname] :"
read new_hostname garbage
echo -n "Use hostname \"$new_hostname\" (Yes/No) [Yes]? :"
read yesno garbage
test -z "$yesno" && yesno='yes'
test ${yesno:0:1} = 'y' -o ${yesno:0:1} = 'Y' && {
sed -i "/pod_url:/s/$hostname/$new_hostname/g" config/app_config.yml &&
echo "config/app_config.yml updated."
break
}
done

View file

@ -69,6 +69,7 @@ cp diaspora.logconf $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/diaspora
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/diaspora
cp -ar master $RPM_BUILD_ROOT/%{_datadir}/diaspora
cp master/.gitignore $RPM_BUILD_ROOT/%{_datadir}/diaspora/master
cp diaspora-setup $RPM_BUILD_ROOT/%{_datadir}/diaspora
%post
rm -f %{_datadir}/diaspora/master/vendor/bundle

View file

@ -139,8 +139,7 @@ function make_dist
RELEASE_DIR="diaspora-$VERSION-$commit"
rm -rf dist/${RELEASE_DIR}
mkdir dist/${RELEASE_DIR}
cp diaspora-ws dist/${RELEASE_DIR}
cp diaspora.logconf dist/${RELEASE_DIR}
cp diaspora-ws diaspora-setup diaspora.logconf dist/${RELEASE_DIR}
cd dist
mkdir ${RELEASE_DIR}/master
cp -ar diaspora/* diaspora/.git* ${RELEASE_DIR}/master