You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
3.8 KiB

seafile-server: Update to 7.1.2, revamp package * Package scripts that are shipped by upstream in their binary download * Includes setup scripts (setup-seafile.sh to use SQLite, setup-seafile-mysql.{sh,py} to use MySQL) and control scripts (seafile.sh, seahub.sh) * Does not include seafile-admin, which is not shipped in upstream's binary download. Combined with the fact that it hasn't been updated to Python 3 suggests the script has been abandoned. * Replace previous init scripts with a simplified script * Previous init scripts (seafile.init, seahub.init) were modified from older versions of seafile.sh and seahub.sh, but they haven't kept up with changes to upstream's scripts * New init script (seafile-server.init) start/stops both Seafile and Seahub (there is no need to control them separately) by calling upstream's control scripts * Replace previous package config file with new config file * Options in previous config file (seafile.conf) were mainly for using Seahub in FastCGI mode. FastCGI was deprecated in Django 1.7 and removed in 1.9; upstream's control script will only start Seahub using Gunicorn. (Options for Gunicorn including port number can be changed by editing /etc/seafile/conf/gunicorn.conf.py.) * New config file (seafile-server.config) has one option that controls where the Seafile/Seahub data directories are stored * Patch scripts/binaries to use standard, system-wide directory locations * Script files (wrappers for binaries) in /usr/bin * Binaries (not meant to be run directly by the user) in /usr/libexec * Config files in /etc/seafile * Pid/socket files in /var/run/seafile * Logs in /var/log/seafile * Include a new script to create the first admin account * With upstream's original scripts, the user is required to interactively create the first admin account when Seahub is started for the first time * The user will now use the new script (create-seafile-admin.sh) to create the first admin account after setup (using setup-seafile.sh or setup-seafile-mysql.sh) and before starting Seafile/Seahub * seahub.sh is patched to only check if there is at least one admin account and exit with an error if there is no admin account * Remove build config options and add seafile-server-fuse package * The console option controls whether the console window is shown when Seafile server is run on Windows. It has no use on Linux. * The fuse option controls whether seaf-fuse is built. (seaf-fuse is a FUSE implementation that allows the Seafile database/file system to be mounted to a local directory.) seaf-fuse is now always built and is available in a separate package (seafile-server-fuse). * Add myself as a maintainer Signed-off-by: Jeffery To <jeffery.to@gmail.com>
5 years ago
  1. --- a/scripts/sqlite2mysql.sh
  2. +++ b/scripts/sqlite2mysql.sh
  3. @@ -1,4 +1,4 @@
  4. -#!/bin/sh
  5. +#!/bin/bash
  6. #
  7. # This shell script and corresponding sqlite2mysql.py are used to
  8. # migrate Seafile data from SQLite to MySQL.
  9. @@ -38,10 +38,10 @@ fi
  10. rm -rf ${CCNET_DB}
  11. -echo "sqlite3 ${USER_MGR_DB} .dump | python sqlite2mysql.py > ${CCNET_DB}"
  12. -sqlite3 ${USER_MGR_DB} .dump | python sqlite2mysql.py > ${CCNET_DB}
  13. -echo "sqlite3 ${GRP_MGR_DB} .dump | python sqlite2mysql.py >> ${CCNET_DB}"
  14. -sqlite3 ${GRP_MGR_DB} .dump | python sqlite2mysql.py >> ${CCNET_DB}
  15. +echo "sqlite3 ${USER_MGR_DB} .dump | python3 sqlite2mysql.py > ${CCNET_DB}"
  16. +sqlite3 ${USER_MGR_DB} .dump | python3 sqlite2mysql.py > ${CCNET_DB}
  17. +echo "sqlite3 ${GRP_MGR_DB} .dump | python3 sqlite2mysql.py >> ${CCNET_DB}"
  18. +sqlite3 ${GRP_MGR_DB} .dump | python3 sqlite2mysql.py >> ${CCNET_DB}
  19. # change ctime from INTEGER to BIGINT in EmailUser table
  20. sed 's/ctime INTEGER/ctime BIGINT/g' ${CCNET_DB} > ${CCNET_DB}.tmp && mv ${CCNET_DB}.tmp ${CCNET_DB}
  21. @@ -53,14 +53,14 @@ sed 's/email TEXT, role TEXT/email VARCH
  22. rm -rf ${SEAFILE_DB}
  23. if [ -f "${SEAFILE_UCI_DATA_DIR-$seafile_path}/seafile-data/seafile.db" ]; then
  24. - echo "sqlite3 ${SEAFILE_UCI_DATA_DIR-$seafile_path}/seafile-data/seafile.db .dump | python sqlite2mysql.py > ${SEAFILE_DB}"
  25. - sqlite3 ${SEAFILE_UCI_DATA_DIR-$seafile_path}/seafile-data/seafile.db .dump | python sqlite2mysql.py > ${SEAFILE_DB}
  26. + echo "sqlite3 ${SEAFILE_UCI_DATA_DIR-$seafile_path}/seafile-data/seafile.db .dump | python3 sqlite2mysql.py > ${SEAFILE_DB}"
  27. + sqlite3 ${SEAFILE_UCI_DATA_DIR-$seafile_path}/seafile-data/seafile.db .dump | python3 sqlite2mysql.py > ${SEAFILE_DB}
  28. else
  29. echo "${SEAFILE_UCI_DATA_DIR-$seafile_path}/seafile-data/seafile.db does not exists."
  30. read -p "Please provide your seafile.db path(e.g. /data/haiwen/seafile-data/seafile.db): " seafile_db_path
  31. if [ -f ${seafile_db_path} ];then
  32. - echo "sqlite3 ${seafile_db_path} .dump | python sqlite2mysql.py > ${SEAFILE_DB}"
  33. - sqlite3 ${seafile_db_path} .dump | python sqlite2mysql.py > ${SEAFILE_DB}
  34. + echo "sqlite3 ${seafile_db_path} .dump | python3 sqlite2mysql.py > ${SEAFILE_DB}"
  35. + sqlite3 ${seafile_db_path} .dump | python3 sqlite2mysql.py > ${SEAFILE_DB}
  36. else
  37. echo "${seafile_db_path} does not exists, quit."
  38. exit 1
  39. @@ -77,14 +77,14 @@ sed 's/user_name TEXT/user_name VARCHAR(
  40. rm -rf ${SEAHUB_DB}
  41. if [ -f "${SEAFILE_UCI_DATA_DIR-$seafile_path}/seahub.db" ]; then
  42. - echo "sqlite3 ${SEAFILE_UCI_DATA_DIR-$seafile_path}/seahub.db .dump | tr -d '\n' | sed 's/;/;\n/g' | python sqlite2mysql.py > ${SEAHUB_DB}"
  43. - sqlite3 ${SEAFILE_UCI_DATA_DIR-$seafile_path}/seahub.db .dump | tr -d '\n' | sed 's/;/;\n/g' | python sqlite2mysql.py > ${SEAHUB_DB}
  44. + echo "sqlite3 ${SEAFILE_UCI_DATA_DIR-$seafile_path}/seahub.db .dump | tr -d '\n' | sed 's/;/;\n/g' | python3 sqlite2mysql.py > ${SEAHUB_DB}"
  45. + sqlite3 ${SEAFILE_UCI_DATA_DIR-$seafile_path}/seahub.db .dump | tr -d '\n' | sed 's/;/;\n/g' | python3 sqlite2mysql.py > ${SEAHUB_DB}
  46. else
  47. echo "${SEAFILE_UCI_DATA_DIR-$seafile_path}/seahub.db does not exists."
  48. read -p "Please prove your seahub.db path(e.g. /data/haiwen/seahub.db): " seahub_db_path
  49. if [ -f ${seahub_db_path} ]; then
  50. - echo "sqlite3 ${seahub_db_path} .dump | tr -d '\n' | sed 's/;/;\n/g' | python sqlite2mysql.py > ${SEAHUB_DB}"
  51. - sqlite3 ${seahub_db_path} .dump | tr -d '\n' | sed 's/;/;\n/g' | python sqlite2mysql.py > ${SEAHUB_DB}
  52. + echo "sqlite3 ${seahub_db_path} .dump | tr -d '\n' | sed 's/;/;\n/g' | python3 sqlite2mysql.py > ${SEAHUB_DB}"
  53. + sqlite3 ${seahub_db_path} .dump | tr -d '\n' | sed 's/;/;\n/g' | python3 sqlite2mysql.py > ${SEAHUB_DB}
  54. else
  55. echo "${seahub_db_path} does not exists, quit."
  56. exit 1