[tor-commits] [flashproxy/master] add reference install scripts and integrate them into the instructions
infinity0 at torproject.org
infinity0 at torproject.org
Thu Nov 21 13:18:46 UTC 2013
commit fc251f7428f77fe51aee751cce031bb720acd961
Author: Ximin Luo <infinity0 at gmx.com>
Date: Thu Sep 12 17:03:20 2013 +0100
add reference install scripts and integrate them into the instructions
---
facilitator/INSTALL | 21 +++++++++++++++++++
facilitator/Makefile.am | 32 ++++++++++++++++++++++++----
facilitator/README | 13 +++++++++---
facilitator/doc/facilitator-howto.txt | 37 ---------------------------------
4 files changed, 59 insertions(+), 44 deletions(-)
diff --git a/facilitator/INSTALL b/facilitator/INSTALL
new file mode 100644
index 0000000..b6e0882
--- /dev/null
+++ b/facilitator/INSTALL
@@ -0,0 +1,21 @@
+Install the dependencies.
+
+ $ apt-get install python-m2crypto make
+ $ apt-get install gnulib # if running from git
+
+Configure and install.
+
+ $ ./autogen.sh # if running from git or ./configure doesn't otherwise exist
+ $ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var && make
+ # make pre-install install post-install
+
+This installs facilitator.cgi, facilitator, facilitator-email-poller,
+facilitator-reg-daemon, facilitator-reg, and fac.py to /usr/bin.
+It also installs System V init files to /etc/init.d/.
+
+The pre/post-install scripts create a user for the daemon to as, and
+sets up the initscripts in the default system runlevels.
+
+Uninstall.
+
+ # make pre-remove uninstall post-remove
diff --git a/facilitator/Makefile.am b/facilitator/Makefile.am
index 58e19b3..b0df18f 100644
--- a/facilitator/Makefile.am
+++ b/facilitator/Makefile.am
@@ -20,7 +20,14 @@ CLEANFILES = $(initscript_SCRIPTS)
# our own targets
-post-install:
+# The {pre,post}-{install,remove} targets are just given as reference, and
+# ought to be separate scripts as part of your distro's installation process.
+# They are intentionally not linked to the install target since they require
+# root access and *must not be run* for fake/staged installs, e.g. when giving
+# non-standard directories to ./configure or DESTDIR to make.
+
+pre-install:
+ id -u $(fpfacilitatoruser) >/dev/null 2>&1 || { \
which adduser >/dev/null 2>&1 && \
adduser --quiet \
--system \
@@ -28,15 +35,32 @@ post-install:
--home $(sysconfdir)/flashproxy \
--no-create-home \
--shell /bin/false \
- --group \
$(fpfacilitatoruser) || \
useradd \
--system \
--home $(sysconfdir)/flashproxy \
-M \
--shell /bin/false \
- $(fpfacilitatoruser)
+ $(fpfacilitatoruser) ; }
+
+post-install:
for i in facilitator facilitator-email-poller facilitator-reg-daemon; do \
update-rc.d $$i defaults; \
- /etc/init.d/$$i start; \
+ invoke-rc.d $$i start; \
done
+
+pre-remove:
+ for i in facilitator facilitator-email-poller facilitator-reg-daemon; do \
+ invoke-rc.d $$i stop; \
+ done
+
+post-remove:
+ id -u $(fpfacilitatoruser) >/dev/null 2>&1 && { \
+ which deluser >/dev/null 2>&1 && \
+ deluser --quiet \
+ --system \
+ $(fpfacilitatoruser) || \
+ userdel \
+ $(fpfacilitatoruser) ; }
+
+.PHONY: pre-install post-install pre-remove post-remove
diff --git a/facilitator/README b/facilitator/README
index 8c0ac29..81b44d5 100644
--- a/facilitator/README
+++ b/facilitator/README
@@ -1,3 +1,10 @@
-This directory contains files needed to run a flash proxy facilitator.
-Normal users don't need any of these files. For instructions on setting
-up a facilitator, see doc/facilitator-howto.txt.
+This package contains files needed to run a flashproxy facilitator.
+Normal users who just want to bypass censorship, should use the
+flashproxy-client package instead.
+
+For instructions on building/installing this package from source, see
+INSTALL. (This should only be necessary if your distro does not already
+integrate this package into its repositories.)
+
+For instructions on setting up and running the facilitator, see
+doc/facilitator-howto.txt.
diff --git a/facilitator/doc/facilitator-howto.txt b/facilitator/doc/facilitator-howto.txt
index 6283cf8..6da8783 100644
--- a/facilitator/doc/facilitator-howto.txt
+++ b/facilitator/doc/facilitator-howto.txt
@@ -85,43 +85,6 @@ Restart servers.
# /etc/init.d/shorewall start
# /etc/init.d/shorewall6 start
-== Facilitator program installation
-
-Install the programs.
-
- # cd
- # apt-get install git python-m2crypto make
- # git clone https://git.torproject.org/flashproxy.git
- # cd flashproxy/facilitator
- # make install
-
-This installs facilitator.cgi, facilitator, facilitator-email-poller,
-facilitator-reg-daemon, facilitator-reg, and fac.py to /usr/local/bin.
-It also installs System V init files to /etc/init.d/.
-
-Do post-installation tasks.
-
- # make postinst
-
-This creates a user for the daemons to run as, and sets up the init.d
-scripts in the default system runlevels.
-
-=== Registration daemon setup
-
-The facilitator-reg-daemon program requires a private RSA key (used to
-decrypt encrypted client registrations).
-
- # mkdir /etc/flashproxy
- # openssl genrsa -out /etc/flashproxy/reg-daemon.key 2048
- # chmod 600 /etc/flashproxy/reg-daemon.key
- # openssl rsa -pubout < /etc/flashproxy/reg-daemon.key > reg-daemon.pub
-
-You will have to edit flashproxy-reg-email and copy the contents of
-reg-daemon.pub into the appropriate place.
-
-Install reg-daemon.key /etc/flashproxy to match what the init script
-expects.
-
== HTTP server setup
Apache is the web server that runs the CGI program.
More information about the tor-commits
mailing list