Browse Source

seafile: added configuration file to turn fastcgi mode on/off

Signed-off-by: Gergely Kiss <mail.gery@gmail.com>
lilik-openwrt-22.03
Gergely Kiss 10 years ago
parent
commit
b7396c9334
2 changed files with 25 additions and 9 deletions
  1. +7
    -0
      net/seafile-server/Makefile
  2. +18
    -9
      net/seafile-server/files/seafile.init

+ 7
- 0
net/seafile-server/Makefile View File

@ -90,6 +90,13 @@ if ! id -u seafile >/dev/null 2>&1; then
chown -R seafile:seafile /usr/share/seafile/ chown -R seafile:seafile /usr/share/seafile/
chmod -R o-rwx /usr/share/seafile/ chmod -R o-rwx /usr/share/seafile/
if [ ! -f /etc/config/seafile ]; then
cat <<EOF > /etc/config/seafile
# Start Seahub in fastcgi mode - 1 = enable, 0 = disable
SEAHUB_FASTCGI=0
EOF
fi
if [ ! -d "/usr/share/seafile/seafile-data" ] if [ ! -d "/usr/share/seafile/seafile-data" ]
then then
echo "*** Installation completed, running configuration script..." echo "*** Installation completed, running configuration script..."


+ 18
- 9
net/seafile-server/files/seafile.init View File

@ -6,9 +6,13 @@ EXTRA_HELP=" setup Runs the setup script
create_admin Creates the administrative login create_admin Creates the administrative login
reset_admin Alias to create_admin" reset_admin Alias to create_admin"
EXTRA_COMMANDS="setup create_admin reset_admin" EXTRA_COMMANDS="setup create_admin reset_admin"
SEAHUB_FASTCGI=0
export PATH="/usr/share/seafile/seafile-server/seahub/thirdpart:$PATH"
export PYTHONPATH="/usr/share/seafile/seafile-server/seahub/thirdpart:$PYTHONPATH"
[ -f /etc/config/seafile ] && \
. /etc/config/seafile
export PATH="/usr/share/seafile/seafile-server/seahub/thirdpart:${PATH}"
export PYTHONPATH="/usr/share/seafile/seafile-server/seahub/thirdpart:${PYTHONPATH}"
start() { start() {
if [ ! -d /var/run/seafile ] if [ ! -d /var/run/seafile ]
@ -18,27 +22,32 @@ start() {
chmod o-rwx /var/run/seafile chmod o-rwx /var/run/seafile
fi fi
# append parameter "--fastcgi" here to start seahub in fastcgi mode
cd "/usr/share/seafile" && \
sudo PYTHONPATH="$PYTHONPATH" -u seafile -E \
"/usr/bin/seafile-admin" start
if [ ${SEAHUB_FASTCGI} -eq 1 ]; then
cd "/usr/share/seafile" && \
sudo PYTHONPATH="${PYTHONPATH}" -u seafile -E \
"/usr/bin/seafile-admin" start --fastcgi
else
cd "/usr/share/seafile" && \
sudo PYTHONPATH="${PYTHONPATH}" -u seafile -E \
"/usr/bin/seafile-admin" start
fi
} }
stop() { stop() {
cd "/usr/share/seafile" && \ cd "/usr/share/seafile" && \
sudo PYTHONPATH="$PYTHONPATH" -u seafile -E \
sudo PYTHONPATH="${PYTHONPATH}" -u seafile -E \
"/usr/bin/seafile-admin" stop "/usr/bin/seafile-admin" stop
} }
setup() { setup() {
cd "/usr/share/seafile" && \ cd "/usr/share/seafile" && \
sudo PYTHONPATH="$PYTHONPATH" -u seafile -E \
sudo PYTHONPATH="${PYTHONPATH}" -u seafile -E \
"/usr/bin/seafile-admin" setup "/usr/bin/seafile-admin" setup
} }
create_admin() { create_admin() {
cd "/usr/share/seafile" && \ cd "/usr/share/seafile" && \
sudo PYTHONPATH="$PYTHONPATH" -u seafile -E \
sudo PYTHONPATH="${PYTHONPATH}" -u seafile -E \
"/usr/bin/seafile-admin" create-admin "/usr/bin/seafile-admin" create-admin
} }


Loading…
Cancel
Save