mirror of
https://github.com/pentoo/pentoo-overlay
synced 2026-04-22 14:51:14 +02:00
seafile-server: massive bump of deps, fixes. WIP
This commit is contained in:
parent
ebb638c29c
commit
5132e15fe8
48 changed files with 2200 additions and 49 deletions
2
dev-python/django-constance/Manifest
Normal file
2
dev-python/django-constance/Manifest
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
DIST bde7f7c.zip 152342 BLAKE2B 15bd764626d7597652289818ed1c47e1fc08885dc9b39d69700d9f663191871af3154cb79820c7236390a41edf0afa639721a5dc5de5e4611956590fcc61156c SHA512 43a8887921a122c48d2350bdc849eb8f81da1120071f41cbc8b30f00c6be6629ba36bf7c68ed881c060ea3e066c3a692bf17a02e5da022e6641c88803eb83bac
|
||||
DIST django-constance-2.4.0.tar.gz 21413 BLAKE2B 87ab61a2ba0ff5176ff337fae5cc8d32b1da33a5018779196e2a3802ae5fabaee0c5a448c994130b26cdc9231dacb2c5ad4f8f8d27a4ba2aa2c00b0961aa37d4 SHA512 8197729efa15cd084160c136107d5f4043fb7324e964e1198cf9875a42eca493e95647f9fbc1ddfe1da43130e638ec0760e28c3088036326df7c00c84b2a9ca0
|
||||
25
dev-python/django-constance/django-constance-1.1.1.ebuild
Normal file
25
dev-python/django-constance/django-constance-1.1.1.ebuild
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Copyright 1999-2017 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="Django live settings with pluggable backends, including Redis"
|
||||
HOMEPAGE="http://github.com/jazzband/django-constance https://django-filter.readthedocs.org"
|
||||
SRC_URI="https://github.com/haiwen/django-constance/archive/bde7f7c.zip"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
#https://django-constance.readthedocs.io/en/latest/
|
||||
IUSE="database +redis"
|
||||
|
||||
CDEPEND=">=dev-python/django-1.8[${PYTHON_USEDEP}]
|
||||
database? ( dev-python/django-picklefield[${PYTHON_USEDEP}] )
|
||||
redis? ( dev-python/django-redis[${PYTHON_USEDEP}] )"
|
||||
|
||||
RDEPEND="${CDEPEND}"
|
||||
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
|
||||
25
dev-python/django-constance/django-constance-2.4.0.ebuild
Normal file
25
dev-python/django-constance/django-constance-2.4.0.ebuild
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Copyright 1999-2017 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="Django live settings with pluggable backends, including Redis"
|
||||
HOMEPAGE="http://github.com/jazzband/django-constance https://django-filter.readthedocs.org"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
#https://django-constance.readthedocs.io/en/latest/
|
||||
IUSE="database +redis"
|
||||
|
||||
CDEPEND=">=dev-python/django-1.8[${PYTHON_USEDEP}]
|
||||
database? ( dev-python/django-picklefield[${PYTHON_USEDEP}] )
|
||||
redis? ( dev-python/django-redis[${PYTHON_USEDEP}] )"
|
||||
|
||||
RDEPEND="${CDEPEND}"
|
||||
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
|
||||
1
dev-python/django-formtools/Manifest
Normal file
1
dev-python/django-formtools/Manifest
Normal file
|
|
@ -0,0 +1 @@
|
|||
DIST django-formtools-2.1.tar.gz 70182 BLAKE2B 955278ba70b469b84e4d94983729ac7669c90cc23fcc2806abac92b2e0ef59870f8466879e2e378fe6699a17374769abc1835e331e675b5ad5dc2e90f9f1f5c2 SHA512 b3a89b0e7dfbfd1ae1ec92bb100fb8d332a4bdfb00e2b25a306dea3863b95e18372919823a9bb4945b367011fd31e89be52b08a916b797ecc508809815622b9e
|
||||
21
dev-python/django-formtools/django-formtools-2.1.ebuild
Normal file
21
dev-python/django-formtools/django-formtools-2.1.ebuild
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# Copyright 1999-2019 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="A set of high-level abstractions for Django forms"
|
||||
HOMEPAGE="https://django-formtools.readthedocs.io/en/latest/ https://django-filter.readthedocs.org"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
CDEPEND=">=dev-python/django-1.11[${PYTHON_USEDEP}]"
|
||||
RDEPEND="${CDEPEND}"
|
||||
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
|
||||
1
dev-python/django-post_office/Manifest
Normal file
1
dev-python/django-post_office/Manifest
Normal file
|
|
@ -0,0 +1 @@
|
|||
DIST django-post_office-3.2.1.tar.gz 60167 BLAKE2B a2a454c81421ff84f842ca8bb3708718c54c21aac833107ae256f83c30e62635300baa2caf523ffad542af7b9ddd04b9a702fcc7848001fae42928ee80bc19cb SHA512 3b9d368216349d5e72feabd3cf918c80b7741311ac2be3773ff800d213695da9c3bd43090f52659aa59c13f21ceff1e23f1bc8825734efbeaed6184be1011090
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
# Copyright 1999-2017 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="A Django app to monitor and send mail asynchronously"
|
||||
HOMEPAGE="https://github.com/ui/django-post_office https://django-filter.readthedocs.org"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
CDEPEND=">=dev-python/django-1.8[${PYTHON_USEDEP}]
|
||||
dev-python/jsonfield[${PYTHON_USEDEP}]
|
||||
"
|
||||
RDEPEND="${CDEPEND}"
|
||||
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
|
||||
|
|
@ -1 +0,0 @@
|
|||
DIST django-rest-framework-3.9.3.tar.gz 9467600 BLAKE2B e87c033acd4a208b2d7cee55e2fe507e15e120513c733faa736d41a1b5abcb2bdc79a0fe7bf1741859c25e9dab3a146250e913309aca8fa5076806dd4307047d SHA512 6dcac4bf6f8318f03c31801225324feebcc161b4b322917386063326654503a178f533b6dcac03d038b8cd3bf14ca994c86ec071729356c8a136b540cd2e7d6a
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
# Copyright 1999-2017 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python2_7 ) # ,3_2,3_4 due to dependency to oauth-plus
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="Powerful and flexible toolkit that makes it easy to build Web APIs using Django"
|
||||
HOMEPAGE="http://django-rest-framework.org/"
|
||||
SRC_URI="https://github.com/tomchristie/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
|
||||
IUSE=""
|
||||
|
||||
RDEPEND=">=dev-python/markdown-2.6.4[${PYTHON_USEDEP}]
|
||||
>=dev-python/pyyaml-3.10[${PYTHON_USEDEP}]
|
||||
>=dev-python/django-guardian-1.4.3[${PYTHON_USEDEP}]
|
||||
>=dev-python/django-filter-1.0.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/coreapi-1.32.0[${PYTHON_USEDEP}]
|
||||
|
||||
"
|
||||
# oauth? (
|
||||
# >=dev-python/django-oauth-plus-2.0[${PYTHON_USEDEP}]
|
||||
# )
|
||||
|
||||
DEPEND="${RDEPEND}
|
||||
>=dev-python/django-1.8[${PYTHON_USEDEP}]
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
"
|
||||
|
||||
# >=dev-python/defusedxml-0.3[${PYTHON_USEDEP}]
|
||||
# >=dev-python/oauth2-1.5.211[${PYTHON_USEDEP}]
|
||||
# python-oauth2
|
||||
|
||||
#RESTRICT="test"
|
||||
1
dev-python/django-simple-captcha/Manifest
Normal file
1
dev-python/django-simple-captcha/Manifest
Normal file
|
|
@ -0,0 +1 @@
|
|||
DIST django-simple-captcha-0.5.11.zip 234570 BLAKE2B b444410a8c13b4ebd1d8a5df0bd71d32851913ad5abc69712b19bdb79d6a8d8fb7bf6b9e3b104a3e0537c8a83008680093f8d124af09cf5e336ec531d99f6038 SHA512 b21500f7710495db06b4f7fbe2cc3fb71f49ecc3322de271d4ad0825a71321f432e187451a3f338c57d42ba3141c42405ceb92ad5fe85e4c1cc33e4b2253b6f8
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
# Copyright 1999-2019 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="A very simple, yet powerful, Django captcha application"
|
||||
HOMEPAGE="https://github.com/mbi/django-simple-captcha https://django-filter.readthedocs.org"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.zip"
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
CDEPEND="dev-python/django[${PYTHON_USEDEP}]"
|
||||
RDEPEND="${CDEPEND}"
|
||||
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
|
||||
1
dev-python/django-statici18n/Manifest
Normal file
1
dev-python/django-statici18n/Manifest
Normal file
|
|
@ -0,0 +1 @@
|
|||
DIST django-statici18n-1.8.3.tar.gz 7785 BLAKE2B 5b0b7f3ab48718c8a006a572296c57a063a1f7c5810504725c4c5ce087a4de27430978c75cce2d73c0ebc8375770a1b312ae05482b4bf2fe9a9105f34604d306 SHA512 ab8c40987afb3b17052ba6d71a2623b7b6ed705cabef2fc347e79b01fb7ad44436518a485f051e8da66f848c9293877fb7fec78ccfd5fa92ddc2230130ccfdbb
|
||||
23
dev-python/django-statici18n/django-statici18n-1.8.3.ebuild
Normal file
23
dev-python/django-statici18n/django-statici18n-1.8.3.ebuild
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# Copyright 1999-2017 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="Django helper for generating Javascript catalog to static files"
|
||||
HOMEPAGE="http://django-statici18n.readthedocs.org/ https://django-filter.readthedocs.org"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
CDEPEND=">=dev-python/django-1.8[${PYTHON_USEDEP}]
|
||||
dev-python/django-appconf[${PYTHON_USEDEP}]
|
||||
dev-python/six[${PYTHON_USEDEP}]"
|
||||
RDEPEND="${CDEPEND}"
|
||||
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
|
||||
1
dev-python/django-webpack-loader/Manifest
Normal file
1
dev-python/django-webpack-loader/Manifest
Normal file
|
|
@ -0,0 +1 @@
|
|||
DIST django-webpack-loader-0.6.0.tar.gz 17385 BLAKE2B 1c41395ddd8ebde9ccab50d3d745df348db3a394d76f397da518f43acb38ce1fae86ba715ce140445873dd7a5169d769614dd43ea3b3c2b79ca6cf2255494bf1 SHA512 a6c68a3f36797fe8f57d6d2e6ed647f17f20e4e4408cb9502cf24f3f39f9c302c9583ddc0faa3ba40d72607018291cc24b2c660c6731ed43c31d4eb9b3237a25
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
# Copyright 1999-2019 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="Transparently use webpack with django"
|
||||
HOMEPAGE="https://github.com/owais/django-webpack-loader https://django-filter.readthedocs.org"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
CDEPEND="dev-python/django[${PYTHON_USEDEP}]"
|
||||
RDEPEND="${CDEPEND}"
|
||||
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
|
||||
1
dev-python/django_compressor/Manifest
Normal file
1
dev-python/django_compressor/Manifest
Normal file
|
|
@ -0,0 +1 @@
|
|||
DIST django_compressor-2.3.tar.gz 110714 BLAKE2B 529274341d6e0805389f92ba2a7e0fce60d9b6b6d0d555c24fbcf31458137a5091d0845d81e46908232a3fade10475e71b012d2a94693f0eb665ca6423831a3b SHA512 ea7b7b897ecd34159839924ff6ac422cb5b3b55858e6d7892903c6dd532d58f0ef75291012f7558a6855994ffb28613eea3550dfa441f431b333eff0bd599bfc
|
||||
25
dev-python/django_compressor/django_compressor-2.3.ebuild
Normal file
25
dev-python/django_compressor/django_compressor-2.3.ebuild
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Copyright 1999-2017 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="Compresses linked and inline JavaScript or CSS into single cached files"
|
||||
HOMEPAGE="https://django-compressor.readthedocs.io/en/latest/ https://django-filter.readthedocs.org"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
CDEPEND=">=dev-python/django-1.8[${PYTHON_USEDEP}]
|
||||
>=dev-python/django-appconf-1.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/rcssmin-1.0.6[${PYTHON_USEDEP}]
|
||||
>=dev-python/rjsmin-1.1.0[${PYTHON_USEDEP}]
|
||||
"
|
||||
RDEPEND="${CDEPEND}"
|
||||
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
|
||||
1
dev-python/djangorestframework/Manifest
Normal file
1
dev-python/djangorestframework/Manifest
Normal file
|
|
@ -0,0 +1 @@
|
|||
DIST djangorestframework-3.9.4.tar.gz 779306 BLAKE2B 9ae955cf0145ad8b80b65d8b6d8f0b947e0e11ecb1b52939a1fd4d209d48d84a4d756d979596180c63f6caf25ff796503b0b3cc8237ec1bbf2d1787fae5a2863 SHA512 bfa269b1ca95c1d35d97f3fcdcf821778f2c2ba14ce79288b776ecff369922603ba9a2292a59ca8ad263eb3eef675420a2bb2e609e11e53e503a78bd365b2913
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="Web APIs with django made easy"
|
||||
HOMEPAGE="https://www.django-rest-framework.org"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
|
||||
RDEPEND=">=dev-python/django-1.11[${PYTHON_USEDEP}]"
|
||||
DEPEND="${RDEPEND}
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]"
|
||||
8
dev-python/djangorestframework/metadata.xml
Normal file
8
dev-python/djangorestframework/metadata.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>williamh@gentoo.org</email>
|
||||
<name>William Hubbs</name>
|
||||
</maintainer>
|
||||
</pkgmetadata>
|
||||
1
dev-python/jsonfield/Manifest
Normal file
1
dev-python/jsonfield/Manifest
Normal file
|
|
@ -0,0 +1 @@
|
|||
DIST jsonfield-2.0.2.tar.gz 10806 BLAKE2B 67638b380f3356390d93a10b2bd432016ca46d525cbac17c4cc4d1ec901b92d7de00e7ddb6610a97e547728e2c60ddab757e705348b8a8f66ff443b34550f0d5 SHA512 9d4a8a483ea7be4c13c272a959666ca73fdf662ca91373ca5787fc86c0366d074e90fccd61d371898f85e5bf6a1a265820bd9b971e5056c800a27c099835eebf
|
||||
21
dev-python/jsonfield/jsonfield-2.0.2.ebuild
Normal file
21
dev-python/jsonfield/jsonfield-2.0.2.ebuild
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# Copyright 1999-2017 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="A reusable Django field that allows you to store validated JSON "
|
||||
HOMEPAGE="https://github.com/dmkoch/django-jsonfield/ https://django-filter.readthedocs.org"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
CDEPEND=">=dev-python/django-1.8[${PYTHON_USEDEP}]"
|
||||
RDEPEND="${CDEPEND}"
|
||||
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
|
||||
1
dev-python/python-cas/Manifest
Normal file
1
dev-python/python-cas/Manifest
Normal file
|
|
@ -0,0 +1 @@
|
|||
DIST python-cas-1.4.0.tar.gz 7163 BLAKE2B 2108d7516fb279996615d66216541811567d008cf789913c697afe2f0fe1a74c1214937e1c2b8940c74801d251a7ae60d38bd692507fc03248fd6b3dd4d6522c SHA512 d00b3d31d1ccb763b0cd70b1d8edc230b24da32dfc97de7332fab558b6329471aa04a3dc709135c4c9cff249cdae185890d48f39c776d6b83c32163785749c67
|
||||
25
dev-python/python-cas/python-cas-1.4.0.ebuild
Normal file
25
dev-python/python-cas/python-cas-1.4.0.ebuild
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Copyright 1999-2019 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="Python CAS client library"
|
||||
HOMEPAGE="https://github.com/python-cas/python-cas"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
#may be required by seafile
|
||||
#git+git://github.com/haiwen/python-cas.git@ffc49235fd7cc32c4fdda5acfa3707e1405881df#egg=python_cas
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
RDEPEND=">=dev-python/lxml-3.4[${PYTHON_USEDEP}]
|
||||
dev-python/six[${PYTHON_USEDEP}]
|
||||
dev-python/requests[${PYTHON_USEDEP}]"
|
||||
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
|
||||
1
dev-python/rcssmin/Manifest
Normal file
1
dev-python/rcssmin/Manifest
Normal file
|
|
@ -0,0 +1 @@
|
|||
DIST rcssmin-1.0.6.tar.gz 582894 BLAKE2B 64fcd9bd9ea96037acfcbb0edf5ddba45f0804cb1862fb60dffaa5b60a0ee2a0927fc237fd04cbf9be438a9468b54dfccb56729a6d191ee323d9ccb819857dbc SHA512 5129a6007755a5b1949256bba7ad3616a08034d7bfcf06a1f9d8143897dddc5d2f6b8a0ebde7abb2e8b12e5b1aee2e46260e59101a78f35026e15f9f6503db77
|
||||
20
dev-python/rcssmin/rcssmin-1.0.6.ebuild
Normal file
20
dev-python/rcssmin/rcssmin-1.0.6.ebuild
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Copyright 1999-2017 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="RCSSmin is a CSS minifier"
|
||||
HOMEPAGE="http://opensource.perlig.de/rcssmin/"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
RDEPEND=""
|
||||
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
|
||||
1
dev-python/rjsmin/Manifest
Normal file
1
dev-python/rjsmin/Manifest
Normal file
|
|
@ -0,0 +1 @@
|
|||
DIST rjsmin-1.1.0.tar.gz 412426 BLAKE2B ac4aed389359b27c6506890da8ec7874536835befff6868b556542489deaadb5557caf688fd959cd2dff1b25d312a8b738ea5f73e00fbb1f705ddeeaea021dd2 SHA512 e89641666f4235e5125e33a8da727a204bd0f263c101833849d8368edb7522a184b0f6d87da39690b7e8c1dad0ae8a40508b019e971393a3ad99440ad8ccc3fc
|
||||
20
dev-python/rjsmin/rjsmin-1.1.0.ebuild
Normal file
20
dev-python/rjsmin/rjsmin-1.1.0.ebuild
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Copyright 1999-2017 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="RCSSmin is a CSS minifier"
|
||||
HOMEPAGE="http://opensource.perlig.de/rjsmin/"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
RDEPEND=""
|
||||
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
|
||||
1
dev-python/social-auth-core/Manifest
Normal file
1
dev-python/social-auth-core/Manifest
Normal file
|
|
@ -0,0 +1 @@
|
|||
DIST social-auth-core-3.2.0.tar.gz 174171 BLAKE2B 7cfb803d2192ed7850c36fa3e6c6f73a7c2c08e3337e610a9b192a6b7042cfd56363a4e86246ed46e7e3a737a190b98f8d43f80c0b23d69efcecfa1505951bda SHA512 5e9e78f5b6a92b7d6dd3b62a224d6b5ec3eb14e687b64528e2b57ff285f07d09637df6669492f1a59cfc453a7724710ab282dc1ccf9274bd98a708ff28130b0f
|
||||
36
dev-python/social-auth-core/social-auth-core-3.2.0.ebuild
Normal file
36
dev-python/social-auth-core/social-auth-core-3.2.0.ebuild
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# Copyright 1999-2019 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python2_7 )
|
||||
# python3_{5,6,7} )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="Python social authentication made simple"
|
||||
HOMEPAGE="https://github.com/python-social-auth/social-core"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
RDEPEND=">=dev-python/requests-2.9.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/oauthlib-1.0.3[${PYTHON_USEDEP}]
|
||||
>=dev-python/requests-oauthlib-0.6.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/six-1.10.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/pyjwt-1.4.0[${PYTHON_USEDEP}]
|
||||
$(python_gen_cond_dep 'dev-python/python-openid[${PYTHON_USEDEP}]' python2_7)"
|
||||
|
||||
# $(python_gen_cond_dep 'dev-python/defusedxml[${PYTHON_USEDEP}]' python3)
|
||||
|
||||
#FIXME:
|
||||
#python2 and saml? python-saml>=2.2.0
|
||||
|
||||
#python3
|
||||
#python3-openid>=3.0.10
|
||||
#saml? python3-saml>=1.2.1
|
||||
|
||||
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
|
||||
|
|
@ -40,9 +40,9 @@ src_prepare() {
|
|||
eapply_user
|
||||
}
|
||||
|
||||
#src_configure() {
|
||||
# econf \
|
||||
src_configure() {
|
||||
econf \
|
||||
--without-mysql \
|
||||
--without-postgresql
|
||||
# --enable-python=no
|
||||
# #--with-mysql \
|
||||
# #--with-postgresql \
|
||||
#}
|
||||
}
|
||||
|
|
|
|||
1
net-misc/seafile-client/Manifest
Normal file
1
net-misc/seafile-client/Manifest
Normal file
|
|
@ -0,0 +1 @@
|
|||
DIST seafile-client-7.0.1.tar.gz 2363581 BLAKE2B aba90b88f469a580264319f4cbaa4303ba55d778caec26cd7c2d6fbe96e3bf293b718038bbee1ff3988040d1829ba7105019dc7f50cd79447226aec214fbe051 SHA512 4b91e64e71a9e503b80bd040400bfe69e5d78153d93fb991b3ee58947e4f8c632aaeb5e802b8357e4f2411124c34a08e80c220a10da102ecce9d2ff2a06ac19e
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 4261fba..24fbbda 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -158,11 +158,8 @@ SET(QT_VERSION_MAJOR 5)
|
||||
# have to keep using QtWebKit on windows because QtWebEngine can't be
|
||||
# compiled in msys2/mingw (QtWebEnigne is based on chrome, which has to be
|
||||
# compiled with MSVC.)
|
||||
-FIND_PROGRAM(qmake_executable NAMES qmake qmake.exe)
|
||||
-EXECUTE_PROCESS(COMMAND
|
||||
- bash -c "${qmake_executable} --version | grep -iE '^using qt version [0-9.]+' | awk '{print $4}'"
|
||||
- OUTPUT_VARIABLE DETECTED_QT_VERSION
|
||||
- OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
+FIND_PACKAGE(Qt5Core)
|
||||
+SET(DETECTED_QT_VERSION ${Qt5Core_VERSION})
|
||||
MESSAGE("qt5 version: ${DETECTED_QT_VERSION}")
|
||||
IF(WIN32 OR DETECTED_QT_VERSION VERSION_LESS 5.6.0)
|
||||
ADD_DEFINITIONS(-DSEAFILE_USE_WEBKIT)
|
||||
17
net-misc/seafile-client/metadata.xml
Normal file
17
net-misc/seafile-client/metadata.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>moschlar@metalabs.de</email>
|
||||
</maintainer>
|
||||
<maintainer type="project">
|
||||
<email>proxy-maint@gentoo.org</email>
|
||||
<name>Proxy Maintainers</name>
|
||||
</maintainer>
|
||||
<use>
|
||||
<flag name="shibboleth">Build support for Shibboleth single sign-on</flag>
|
||||
</use>
|
||||
<upstream>
|
||||
<remote-id type="github">haiwen/seafile-client</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
56
net-misc/seafile-client/seafile-client-7.0.1.ebuild
Normal file
56
net-misc/seafile-client/seafile-client-7.0.1.ebuild
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
# Copyright 1999-2018 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
inherit cmake-utils gnome2-utils
|
||||
|
||||
DESCRIPTION="Seafile desktop client"
|
||||
HOMEPAGE="https://github.com/haiwen/seafile-client/ http://www.seafile.com/"
|
||||
SRC_URI="https://github.com/haiwen/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE="shibboleth test"
|
||||
|
||||
RDEPEND="net-libs/libsearpc
|
||||
~net-misc/seafile-${PV}
|
||||
dev-libs/libevent
|
||||
dev-libs/jansson
|
||||
dev-libs/openssl:0
|
||||
dev-db/sqlite:3
|
||||
dev-qt/qtcore:5
|
||||
dev-qt/qtgui:5
|
||||
dev-qt/qtwidgets:5
|
||||
dev-qt/qtnetwork:5
|
||||
dev-qt/qtdbus:5
|
||||
shibboleth? ( || ( dev-qt/qtwebengine:5[widgets] dev-qt/qtwebkit:5 ) )"
|
||||
DEPEND="${RDEPEND}
|
||||
dev-qt/linguist-tools:5
|
||||
test? ( dev-qt/qttest:5 )"
|
||||
|
||||
src_prepare() {
|
||||
eapply "${FILESDIR}/${PN}-select-qt5.patch"
|
||||
cmake-utils_src_prepare
|
||||
if use shibboleth ; then
|
||||
if ! has_version "dev-qt/qtwebengine:5[widgets]" ; then
|
||||
sed -i -e 's/IF(WIN32 OR DETECTED_QT_VERSION VERSION_LESS 5.6.0)/IF(TRUE)/' CMakeLists.txt || die
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
-DBUILD_SHIBBOLETH_SUPPORT="$(usex shibboleth)"
|
||||
-DBUILD_TESTING="$(usex test)"
|
||||
)
|
||||
cmake-utils_src_configure
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
gnome2_icon_cache_update
|
||||
}
|
||||
|
||||
pkg_postrm() {
|
||||
gnome2_icon_cache_update
|
||||
}
|
||||
382
net-misc/seafile-server/files/check_init_admin.py
Normal file
382
net-misc/seafile-server/files/check_init_admin.py
Normal file
|
|
@ -0,0 +1,382 @@
|
|||
#coding: UTF-8
|
||||
|
||||
'''This script would check if there is admin, and prompt the user to create a new one if non exist'''
|
||||
|
||||
import json
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
import re
|
||||
import shutil
|
||||
import glob
|
||||
import subprocess
|
||||
import hashlib
|
||||
import getpass
|
||||
import uuid
|
||||
import warnings
|
||||
|
||||
from ConfigParser import ConfigParser
|
||||
|
||||
try:
|
||||
import readline # pylint: disable=W0611
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
SERVER_MANUAL_HTTP = 'https://github.com/haiwen/seafile/wiki'
|
||||
|
||||
class Utils(object):
|
||||
'''Groups all helper functions here'''
|
||||
@staticmethod
|
||||
def welcome():
|
||||
'''Show welcome message'''
|
||||
welcome_msg = '''\
|
||||
-----------------------------------------------------------------
|
||||
This script will guide you to setup your seafile server using MySQL.
|
||||
Make sure you have read seafile server manual at
|
||||
|
||||
%s
|
||||
|
||||
Press ENTER to continue
|
||||
-----------------------------------------------------------------''' % SERVER_MANUAL_HTTP
|
||||
print welcome_msg
|
||||
raw_input()
|
||||
|
||||
@staticmethod
|
||||
def highlight(content):
|
||||
'''Add ANSI color to content to get it highlighted on terminal'''
|
||||
return '\x1b[33m%s\x1b[m' % content
|
||||
|
||||
@staticmethod
|
||||
def info(msg):
|
||||
print msg
|
||||
|
||||
@staticmethod
|
||||
def error(msg):
|
||||
'''Print error and exit'''
|
||||
print
|
||||
print 'Error: ' + msg
|
||||
sys.exit(1)
|
||||
|
||||
@staticmethod
|
||||
def run_argv(argv, cwd=None, env=None, suppress_stdout=False, suppress_stderr=False):
|
||||
'''Run a program and wait it to finish, and return its exit code. The
|
||||
standard output of this program is supressed.
|
||||
|
||||
'''
|
||||
with open(os.devnull, 'w') as devnull:
|
||||
if suppress_stdout:
|
||||
stdout = devnull
|
||||
else:
|
||||
stdout = sys.stdout
|
||||
|
||||
if suppress_stderr:
|
||||
stderr = devnull
|
||||
else:
|
||||
stderr = sys.stderr
|
||||
|
||||
proc = subprocess.Popen(argv,
|
||||
cwd=cwd,
|
||||
stdout=stdout,
|
||||
stderr=stderr,
|
||||
env=env)
|
||||
return proc.wait()
|
||||
|
||||
@staticmethod
|
||||
def run(cmdline, cwd=None, env=None, suppress_stdout=False, suppress_stderr=False):
|
||||
'''Like run_argv but specify a command line string instead of argv'''
|
||||
with open(os.devnull, 'w') as devnull:
|
||||
if suppress_stdout:
|
||||
stdout = devnull
|
||||
else:
|
||||
stdout = sys.stdout
|
||||
|
||||
if suppress_stderr:
|
||||
stderr = devnull
|
||||
else:
|
||||
stderr = sys.stderr
|
||||
|
||||
proc = subprocess.Popen(cmdline,
|
||||
cwd=cwd,
|
||||
stdout=stdout,
|
||||
stderr=stderr,
|
||||
env=env,
|
||||
shell=True)
|
||||
return proc.wait()
|
||||
|
||||
@staticmethod
|
||||
def prepend_env_value(name, value, env=None, seperator=':'):
|
||||
'''prepend a new value to a list'''
|
||||
if env is None:
|
||||
env = os.environ
|
||||
|
||||
try:
|
||||
current_value = env[name]
|
||||
except KeyError:
|
||||
current_value = ''
|
||||
|
||||
new_value = value
|
||||
if current_value:
|
||||
new_value += seperator + current_value
|
||||
|
||||
env[name] = new_value
|
||||
|
||||
@staticmethod
|
||||
def must_mkdir(path):
|
||||
'''Create a directory, exit on failure'''
|
||||
try:
|
||||
os.mkdir(path)
|
||||
except OSError, e:
|
||||
Utils.error('failed to create directory %s:%s' % (path, e))
|
||||
|
||||
@staticmethod
|
||||
def must_copy(src, dst):
|
||||
'''Copy src to dst, exit on failure'''
|
||||
try:
|
||||
shutil.copy(src, dst)
|
||||
except Exception, e:
|
||||
Utils.error('failed to copy %s to %s: %s' % (src, dst, e))
|
||||
|
||||
@staticmethod
|
||||
def find_in_path(prog):
|
||||
if 'win32' in sys.platform:
|
||||
sep = ';'
|
||||
else:
|
||||
sep = ':'
|
||||
|
||||
dirs = os.environ['PATH'].split(sep)
|
||||
for d in dirs:
|
||||
d = d.strip()
|
||||
if d == '':
|
||||
continue
|
||||
path = os.path.join(d, prog)
|
||||
if os.path.exists(path):
|
||||
return path
|
||||
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def get_python_executable():
|
||||
'''Return the python executable. This should be the PYTHON environment
|
||||
variable which is set in setup-seafile-mysql.sh
|
||||
|
||||
'''
|
||||
return os.environ['PYTHON']
|
||||
|
||||
@staticmethod
|
||||
def read_config(fn):
|
||||
'''Return a case sensitive ConfigParser by reading the file "fn"'''
|
||||
cp = ConfigParser()
|
||||
cp.optionxform = str
|
||||
cp.read(fn)
|
||||
|
||||
return cp
|
||||
|
||||
@staticmethod
|
||||
def write_config(cp, fn):
|
||||
'''Return a case sensitive ConfigParser by reading the file "fn"'''
|
||||
with open(fn, 'w') as fp:
|
||||
cp.write(fp)
|
||||
|
||||
@staticmethod
|
||||
def ask_question(desc,
|
||||
key=None,
|
||||
note=None,
|
||||
default=None,
|
||||
validate=None,
|
||||
yes_or_no=False,
|
||||
password=False):
|
||||
'''Ask a question, return the answer.
|
||||
@desc description, e.g. "What is the port of ccnet?"
|
||||
|
||||
@key a name to represent the target of the question, e.g. "port for
|
||||
ccnet server"
|
||||
|
||||
@note additional information for the question, e.g. "Must be a valid
|
||||
port number"
|
||||
|
||||
@default the default value of the question. If the default value is
|
||||
not None, when the user enter nothing and press [ENTER], the default
|
||||
value would be returned
|
||||
|
||||
@validate a function that takes the user input as the only parameter
|
||||
and validate it. It should return a validated value, or throws an
|
||||
"InvalidAnswer" exception if the input is not valid.
|
||||
|
||||
@yes_or_no If true, the user must answer "yes" or "no", and a boolean
|
||||
value would be returned
|
||||
|
||||
@password If true, the user input would not be echoed to the
|
||||
console
|
||||
|
||||
'''
|
||||
assert key or yes_or_no
|
||||
# Format description
|
||||
print
|
||||
if note:
|
||||
desc += '\n' + note
|
||||
|
||||
desc += '\n'
|
||||
if yes_or_no:
|
||||
desc += '[ yes or no ]'
|
||||
else:
|
||||
if default:
|
||||
desc += '[ default "%s" ]' % default
|
||||
else:
|
||||
desc += '[ %s ]' % key
|
||||
|
||||
desc += ' '
|
||||
while True:
|
||||
# prompt for user input
|
||||
if password:
|
||||
answer = getpass.getpass(desc).strip()
|
||||
else:
|
||||
answer = raw_input(desc).strip()
|
||||
|
||||
# No user input: use default
|
||||
if not answer:
|
||||
if default:
|
||||
answer = default
|
||||
else:
|
||||
continue
|
||||
|
||||
# Have user input: validate answer
|
||||
if yes_or_no:
|
||||
if answer not in ['yes', 'no']:
|
||||
print Utils.highlight('\nPlease answer yes or no\n')
|
||||
continue
|
||||
else:
|
||||
return answer == 'yes'
|
||||
else:
|
||||
if validate:
|
||||
try:
|
||||
return validate(answer)
|
||||
except InvalidAnswer, e:
|
||||
print Utils.highlight('\n%s\n' % e)
|
||||
continue
|
||||
else:
|
||||
return answer
|
||||
|
||||
@staticmethod
|
||||
def validate_port(port):
|
||||
try:
|
||||
port = int(port)
|
||||
except ValueError:
|
||||
raise InvalidAnswer('%s is not a valid port' % Utils.highlight(port))
|
||||
|
||||
if port <= 0 or port > 65535:
|
||||
raise InvalidAnswer('%s is not a valid port' % Utils.highlight(port))
|
||||
|
||||
return port
|
||||
|
||||
|
||||
class InvalidAnswer(Exception):
|
||||
def __init__(self, msg):
|
||||
Exception.__init__(self)
|
||||
self.msg = msg
|
||||
def __str__(self):
|
||||
return self.msg
|
||||
|
||||
### END of Utils
|
||||
####################
|
||||
|
||||
class RPC(object):
|
||||
def __init__(self):
|
||||
import ccnet
|
||||
ccnet_dir = os.environ['CCNET_CONF_DIR']
|
||||
central_config_dir = os.environ['SEAFILE_CENTRAL_CONF_DIR']
|
||||
self.rpc_client = ccnet.CcnetThreadedRpcClient(
|
||||
ccnet.ClientPool(ccnet_dir, central_config_dir=central_config_dir))
|
||||
|
||||
def get_db_email_users(self):
|
||||
return self.rpc_client.get_emailusers('DB', 0, 1)
|
||||
|
||||
def create_admin(self, email, user):
|
||||
return self.rpc_client.add_emailuser(email, user, 1, 1)
|
||||
|
||||
def need_create_admin():
|
||||
users = rpc.get_db_email_users()
|
||||
return len(users) == 0
|
||||
|
||||
def create_admin(email, passwd):
|
||||
if rpc.create_admin(email, passwd) < 0:
|
||||
raise Exception('failed to create admin')
|
||||
else:
|
||||
print '\n\n'
|
||||
print '----------------------------------------'
|
||||
print 'Successfully created seafile admin'
|
||||
print '----------------------------------------'
|
||||
print '\n\n'
|
||||
|
||||
def ask_admin_email():
|
||||
print
|
||||
print '----------------------------------------'
|
||||
print 'It\'s the first time you start the seafile server. Now let\'s create the admin account'
|
||||
print '----------------------------------------'
|
||||
def validate(email):
|
||||
# whitespace is not allowed
|
||||
if re.match(r'[\s]', email):
|
||||
raise InvalidAnswer('%s is not a valid email address' % Utils.highlight(email))
|
||||
# must be a valid email address
|
||||
if not re.match(r'^.+@.*\..+$', email):
|
||||
raise InvalidAnswer('%s is not a valid email address' % Utils.highlight(email))
|
||||
|
||||
return email
|
||||
|
||||
key = 'admin email'
|
||||
question = 'What is the ' + Utils.highlight('email') + ' for the admin account?'
|
||||
return Utils.ask_question(question,
|
||||
key=key,
|
||||
validate=validate)
|
||||
|
||||
def ask_admin_password():
|
||||
def validate(password):
|
||||
key = 'admin password again'
|
||||
question = 'Enter the ' + Utils.highlight('password again:')
|
||||
password_again = Utils.ask_question(question,
|
||||
key=key,
|
||||
password=True)
|
||||
|
||||
if password_again != password:
|
||||
raise InvalidAnswer('password mismatch')
|
||||
|
||||
return password
|
||||
|
||||
key = 'admin password'
|
||||
question = 'What is the ' + Utils.highlight('password') + ' for the admin account?'
|
||||
return Utils.ask_question(question,
|
||||
key=key,
|
||||
password=True,
|
||||
validate=validate)
|
||||
|
||||
rpc = RPC()
|
||||
|
||||
def main():
|
||||
if not need_create_admin():
|
||||
return
|
||||
|
||||
password_file = os.path.join(os.environ['SEAFILE_CENTRAL_CONF_DIR'], 'admin.txt')
|
||||
if os.path.exists(password_file):
|
||||
with open(password_file, 'r') as fp:
|
||||
pwinfo = json.load(fp)
|
||||
email = pwinfo['email']
|
||||
passwd = pwinfo['password']
|
||||
os.unlink(password_file)
|
||||
else:
|
||||
email = ask_admin_email()
|
||||
passwd = ask_admin_password()
|
||||
|
||||
create_admin(email, passwd)
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
print '\n\n\n'
|
||||
print Utils.highlight('Aborted.')
|
||||
print
|
||||
sys.exit(1)
|
||||
except Exception, e:
|
||||
print
|
||||
print Utils.highlight('Error happened during creating seafile admin.')
|
||||
print
|
||||
|
|
@ -43,7 +43,6 @@ S="${WORKDIR}/${P}-server"
|
|||
src_prepare() {
|
||||
#https://github.com/haiwen/seafile-server/issues/181
|
||||
#https://github.com/haiwen/ccnet-server/issues/19
|
||||
# eapply "${FILESDIR}/7.0.1-ccnet.patch"
|
||||
|
||||
#https://github.com/haiwen/seafile-server/issues/67#issuecomment-337904800
|
||||
eapply "${FILESDIR}/libevhtp-1.2.18.patch"
|
||||
|
|
@ -55,3 +54,4 @@ src_prepare() {
|
|||
vala_src_prepare
|
||||
eapply_user
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
|||
|
||||
RDEPEND="${PYTHON_DEPS}
|
||||
!net-libs/ccnet
|
||||
>=net-libs/libsearpc-3.1[${PYTHON_USEDEP}]
|
||||
net-misc/ccnet-server
|
||||
>=net-libs/libsearpc-3.1[${PYTHON_USEDEP}]
|
||||
dev-libs/glib:2
|
||||
dev-libs/libevent:0
|
||||
dev-libs/jansson
|
||||
|
|
|
|||
1
net-misc/seahub/Manifest
Normal file
1
net-misc/seahub/Manifest
Normal file
|
|
@ -0,0 +1 @@
|
|||
DIST seahub-7.0.1.tar.gz 29250490 BLAKE2B c55cc1010894c24eadd6adfa2f9dc84874e78b9051af8844170e8e4c8f84f33389f21b8848d4c345f2c4ef44b9096c46af04e4dae7d823069857c9f8a8a4140c SHA512 c6e73640fabc406aac3383ad038a3a77a8df4fa234b7459b2a4579dd16f88340fd48f2a19700d0ddce59d87d00176fd0699838aff44126a1c3c4824211577fa7
|
||||
19
net-misc/seahub/files/gunicorn.conf
Normal file
19
net-misc/seahub/files/gunicorn.conf
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import os
|
||||
|
||||
daemon = True
|
||||
workers = 5
|
||||
|
||||
# default localhost:8000
|
||||
bind = "127.0.0.1:8000"
|
||||
|
||||
# Pid
|
||||
pids_dir = '/data/seafile/pids'
|
||||
pidfile = os.path.join(pids_dir, 'seahub.pid')
|
||||
|
||||
# for file upload, we need a longer timeout value (default is only 30s, too short)
|
||||
timeout = 1200
|
||||
|
||||
limit_request_line = 8190
|
||||
|
||||
accesslog = "/data/seafile/logs/guncorn_access.log"
|
||||
errorlog = "/data/seafile/logs/guncorn_error.log"
|
||||
181
net-misc/seahub/files/seafile.sh
Executable file
181
net-misc/seahub/files/seafile.sh
Executable file
|
|
@ -0,0 +1,181 @@
|
|||
#!/bin/bash
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: seafile
|
||||
# Required-Start: $local_fs $remote_fs $network
|
||||
# Required-Stop: $local_fs
|
||||
# Default-Start: 1 2 3 4 5
|
||||
# Default-Stop:
|
||||
# Short-Description: Starts Seafile Server
|
||||
# Description: starts Seafile Server
|
||||
### END INIT INFO
|
||||
|
||||
echo ""
|
||||
|
||||
SCRIPT=$(readlink -f "$0")
|
||||
INSTALLPATH=$(dirname "${SCRIPT}")
|
||||
TOPDIR=$(dirname "${INSTALLPATH}")
|
||||
default_ccnet_conf_dir=${TOPDIR}/ccnet
|
||||
central_config_dir=${TOPDIR}/conf
|
||||
seaf_controller="/usr/bin/seafile-controller"
|
||||
|
||||
|
||||
export PATH=${INSTALLPATH}/seafile/bin:$PATH
|
||||
export ORIG_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
|
||||
export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH}
|
||||
|
||||
script_name=$0
|
||||
function usage () {
|
||||
echo "usage : "
|
||||
echo "$(basename ${script_name}) { start | stop | restart } "
|
||||
echo ""
|
||||
}
|
||||
|
||||
# check args
|
||||
if [[ $# != 1 || ( "$1" != "start" && "$1" != "stop" && "$1" != "restart" ) ]]; then
|
||||
usage;
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
function validate_running_user () {
|
||||
real_data_dir=`readlink -f ${seafile_data_dir}`
|
||||
running_user=`id -un`
|
||||
data_dir_owner=`stat -c %U ${real_data_dir}`
|
||||
|
||||
if [[ "${running_user}" != "${data_dir_owner}" ]]; then
|
||||
echo "Error: the user running the script (\"${running_user}\") is not the owner of \"${real_data_dir}\" folder, you should use the user \"${data_dir_owner}\" to run the script."
|
||||
exit -1;
|
||||
fi
|
||||
}
|
||||
|
||||
function validate_ccnet_conf_dir () {
|
||||
if [[ ! -d ${default_ccnet_conf_dir} ]]; then
|
||||
echo "Error: there is no ccnet config directory."
|
||||
echo "Have you run setup-seafile.sh before this?"
|
||||
echo ""
|
||||
exit -1;
|
||||
fi
|
||||
}
|
||||
|
||||
function validate_central_conf_dir () {
|
||||
if [[ ! -d ${central_config_dir} ]]; then
|
||||
echo "Error: there is no conf/ directory."
|
||||
echo "Have you run setup-seafile.sh before this?"
|
||||
echo ""
|
||||
exit -1;
|
||||
fi
|
||||
}
|
||||
|
||||
function read_seafile_data_dir () {
|
||||
seafile_ini=${default_ccnet_conf_dir}/seafile.ini
|
||||
if [[ ! -f ${seafile_ini} ]]; then
|
||||
echo "${seafile_ini} not found. Now quit"
|
||||
exit 1
|
||||
fi
|
||||
seafile_data_dir=$(cat "${seafile_ini}")
|
||||
if [[ ! -d ${seafile_data_dir} ]]; then
|
||||
echo "Your seafile server data directory \"${seafile_data_dir}\" is invalid or doesn't exits."
|
||||
echo "Please check it first, or create this directory yourself."
|
||||
echo ""
|
||||
exit 1;
|
||||
fi
|
||||
}
|
||||
|
||||
function test_config() {
|
||||
if ! LD_LIBRARY_PATH=$SEAFILE_LD_LIBRARY_PATH ${seaf_controller} --test \
|
||||
-c "${default_ccnet_conf_dir}" \
|
||||
-d "${seafile_data_dir}" \
|
||||
-F "${central_config_dir}" ; then
|
||||
exit 1;
|
||||
fi
|
||||
}
|
||||
|
||||
function check_component_running() {
|
||||
name=$1
|
||||
cmd=$2
|
||||
if pid=$(pgrep -f "$cmd" 2>/dev/null); then
|
||||
echo "[$name] is running, pid $pid. You can stop it by: "
|
||||
echo
|
||||
echo " kill $pid"
|
||||
echo
|
||||
echo "Stop it and try again."
|
||||
echo
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
function validate_already_running () {
|
||||
if pid=$(pgrep -f "seafile-controller -c ${default_ccnet_conf_dir}" 2>/dev/null); then
|
||||
echo "Seafile controller is already running, pid $pid"
|
||||
echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
check_component_running "ccnet-server" "ccnet-server -c ${default_ccnet_conf_dir}"
|
||||
check_component_running "seaf-server" "seaf-server -c ${default_ccnet_conf_dir}"
|
||||
check_component_running "fileserver" "fileserver -c ${default_ccnet_conf_dir}"
|
||||
check_component_running "seafdav" "wsgidav.server.run_server"
|
||||
}
|
||||
|
||||
function start_seafile_server () {
|
||||
validate_already_running;
|
||||
validate_central_conf_dir;
|
||||
validate_ccnet_conf_dir;
|
||||
read_seafile_data_dir;
|
||||
validate_running_user;
|
||||
test_config;
|
||||
|
||||
echo "Starting seafile server, please wait ..."
|
||||
|
||||
mkdir -p $TOPDIR/logs
|
||||
LD_LIBRARY_PATH=$SEAFILE_LD_LIBRARY_PATH ${seaf_controller} \
|
||||
-c "${default_ccnet_conf_dir}" \
|
||||
-d "${seafile_data_dir}" \
|
||||
-F "${central_config_dir}"
|
||||
|
||||
sleep 3
|
||||
|
||||
# check if seafile server started successfully
|
||||
if ! pgrep -f "seafile-controller -c ${default_ccnet_conf_dir}" 2>/dev/null 1>&2; then
|
||||
echo "Failed to start seafile server"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
echo "Seafile server started"
|
||||
echo
|
||||
}
|
||||
|
||||
function stop_seafile_server () {
|
||||
if ! pgrep -f "seafile-controller -c ${default_ccnet_conf_dir}" 2>/dev/null 1>&2; then
|
||||
echo "seafile server not running yet"
|
||||
return 1;
|
||||
fi
|
||||
|
||||
echo "Stopping seafile server ..."
|
||||
pkill -SIGTERM -f "seafile-controller -c ${default_ccnet_conf_dir}"
|
||||
pkill -f "ccnet-server -c ${default_ccnet_conf_dir}"
|
||||
pkill -f "seaf-server -c ${default_ccnet_conf_dir}"
|
||||
pkill -f "fileserver -c ${default_ccnet_conf_dir}"
|
||||
pkill -f "soffice.*--invisible --nocrashreport"
|
||||
pkill -f "wsgidav.server.run_server"
|
||||
return 0
|
||||
}
|
||||
|
||||
function restart_seafile_server () {
|
||||
stop_seafile_server;
|
||||
sleep 2
|
||||
start_seafile_server;
|
||||
}
|
||||
|
||||
case $1 in
|
||||
"start" )
|
||||
start_seafile_server;
|
||||
;;
|
||||
"stop" )
|
||||
stop_seafile_server;
|
||||
;;
|
||||
"restart" )
|
||||
restart_seafile_server;
|
||||
esac
|
||||
|
||||
echo "Done."
|
||||
301
net-misc/seahub/files/seahub.sh
Executable file
301
net-misc/seahub/files/seahub.sh
Executable file
|
|
@ -0,0 +1,301 @@
|
|||
#!/bin/bash
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: seahub
|
||||
# Required-Start: $local_fs $remote_fs $network
|
||||
# Required-Stop: $local_fs
|
||||
# Default-Start: 1 2 3 4 5
|
||||
# Default-Stop:
|
||||
# Short-Description: Starts Seahub
|
||||
# Description: starts Seahub
|
||||
### END INIT INFO
|
||||
|
||||
echo ""
|
||||
|
||||
SCRIPT=$(readlink -f "$0")
|
||||
INSTALLPATH=$(dirname "${SCRIPT}")
|
||||
TOPDIR=$(dirname "${INSTALLPATH}")
|
||||
default_ccnet_conf_dir=${TOPDIR}/ccnet
|
||||
central_config_dir=${TOPDIR}/conf
|
||||
|
||||
manage_py=${INSTALLPATH}/seahub/manage.py
|
||||
gunicorn_conf=${TOPDIR}/conf/gunicorn.conf
|
||||
pidfile=${TOPDIR}/pids/seahub.pid
|
||||
errorlog=${TOPDIR}/logs/gunicorn_error.log
|
||||
accesslog=${TOPDIR}/logs/gunicorn_access.log
|
||||
gunicorn_exe=${INSTALLPATH}/seahub/thirdpart/gunicorn
|
||||
|
||||
script_name=$0
|
||||
function usage () {
|
||||
echo "Usage: "
|
||||
echo
|
||||
echo " $(basename ${script_name}) { start <port> | stop | restart <port> }"
|
||||
echo
|
||||
echo "To run seahub in fastcgi:"
|
||||
echo
|
||||
echo " $(basename ${script_name}) { start-fastcgi <port> | stop | restart-fastcgi <port> }"
|
||||
echo
|
||||
echo "<port> is optional, and defaults to 8000"
|
||||
echo ""
|
||||
}
|
||||
|
||||
# Check args
|
||||
if [[ $1 != "start" && $1 != "stop" && $1 != "restart" \
|
||||
&& $1 != "start-fastcgi" && $1 != "restart-fastcgi" && $1 != "clearsessions" && $1 != "python-env" ]]; then
|
||||
usage;
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
function check_python_executable() {
|
||||
if [[ "$PYTHON" != "" && -x $PYTHON ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if which python2.7 2>/dev/null 1>&2; then
|
||||
PYTHON=python2.7
|
||||
elif which python27 2>/dev/null 1>&2; then
|
||||
PYTHON=python27
|
||||
else
|
||||
echo
|
||||
echo "Can't find a python executable of version 2.7 or above in PATH"
|
||||
echo "Install python 2.7+ before continue."
|
||||
echo "Or if you installed it in a non-standard PATH, set the PYTHON enviroment varirable to it"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function validate_ccnet_conf_dir () {
|
||||
if [[ ! -d ${default_ccnet_conf_dir} ]]; then
|
||||
echo "Error: there is no ccnet config directory."
|
||||
echo "Have you run setup-seafile.sh before this?"
|
||||
echo ""
|
||||
exit -1;
|
||||
fi
|
||||
}
|
||||
|
||||
function read_seafile_data_dir () {
|
||||
seafile_ini=${default_ccnet_conf_dir}/seafile.ini
|
||||
if [[ ! -f ${seafile_ini} ]]; then
|
||||
echo "${seafile_ini} not found. Now quit"
|
||||
exit 1
|
||||
fi
|
||||
seafile_data_dir=$(cat "${seafile_ini}")
|
||||
if [[ ! -d ${seafile_data_dir} ]]; then
|
||||
echo "Your seafile server data directory \"${seafile_data_dir}\" is invalid or doesn't exits."
|
||||
echo "Please check it first, or create this directory yourself."
|
||||
echo ""
|
||||
exit 1;
|
||||
fi
|
||||
}
|
||||
|
||||
function validate_seahub_running () {
|
||||
if pgrep -f "${manage_py}" 2>/dev/null 1>&2; then
|
||||
echo "Seahub is already running."
|
||||
exit 1;
|
||||
elif pgrep -f "seahub.wsgi:application" 2>/dev/null 1>&2; then
|
||||
echo "Seahub is already running."
|
||||
exit 1;
|
||||
fi
|
||||
}
|
||||
|
||||
function validate_port () {
|
||||
if ! [[ ${port} =~ ^[1-9][0-9]{1,4}$ ]] ; then
|
||||
printf "\033[033m${port}\033[m is not a valid port number\n\n"
|
||||
usage;
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ ($1 == "start" || $1 == "restart" || $1 == "start-fastcgi" || $1 == "restart-fastcgi") \
|
||||
&& ($# == 2 || $# == 1) ]]; then
|
||||
if [[ $# == 2 ]]; then
|
||||
port=$2
|
||||
validate_port
|
||||
else
|
||||
port=8000
|
||||
fi
|
||||
elif [[ $1 == "stop" && $# == 1 ]]; then
|
||||
dummy=dummy
|
||||
elif [[ $1 == "clearsessions" && $# == 1 ]]; then
|
||||
dummy=dummy
|
||||
elif [[ $1 == "python-env" ]]; then
|
||||
dummy=dummy
|
||||
else
|
||||
usage;
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function warning_if_seafile_not_running () {
|
||||
if ! pgrep -f "seafile-controller -c ${default_ccnet_conf_dir}" 2>/dev/null 1>&2; then
|
||||
echo
|
||||
echo "Warning: seafile-controller not running. Have you run \"./seafile.sh start\" ?"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function prepare_seahub_log_dir() {
|
||||
logdir=${TOPDIR}/logs
|
||||
if ! [[ -d ${logsdir} ]]; then
|
||||
if ! mkdir -p "${logdir}"; then
|
||||
echo "ERROR: failed to create logs dir \"${logdir}\""
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
export SEAHUB_LOG_DIR=${logdir}
|
||||
}
|
||||
|
||||
function before_start() {
|
||||
prepare_env;
|
||||
warning_if_seafile_not_running;
|
||||
validate_seahub_running;
|
||||
prepare_seahub_log_dir;
|
||||
}
|
||||
|
||||
function start_seahub () {
|
||||
before_start;
|
||||
echo "Starting seahub at port ${port} ..."
|
||||
check_init_admin;
|
||||
$PYTHON $gunicorn_exe seahub.wsgi:application -c "${gunicorn_conf}" --preload
|
||||
|
||||
# Ensure seahub is started successfully
|
||||
sleep 5
|
||||
if ! pgrep -f "seahub.wsgi:application" 2>/dev/null 1>&2; then
|
||||
printf "\033[33mError:Seahub failed to start.\033[m\n"
|
||||
echo "Please try to run \"./seahub.sh start\" again"
|
||||
exit 1;
|
||||
fi
|
||||
echo
|
||||
echo "Seahub is started"
|
||||
echo
|
||||
}
|
||||
|
||||
function start_seahub_fastcgi () {
|
||||
before_start;
|
||||
|
||||
# Returns 127.0.0.1 if SEAFILE_FASTCGI_HOST is unset or hasn't got any value,
|
||||
# otherwise returns value of SEAFILE_FASTCGI_HOST environment variable
|
||||
address=`(test -z "$SEAFILE_FASTCGI_HOST" && echo "127.0.0.1") || echo $SEAFILE_FASTCGI_HOST`
|
||||
|
||||
echo "Starting seahub (fastcgi) at ${address}:${port} ..."
|
||||
check_init_admin;
|
||||
$PYTHON "${manage_py}" runfcgi maxchildren=8 host=$address port=$port pidfile=$pidfile \
|
||||
outlog=${accesslog} errlog=${errorlog}
|
||||
|
||||
# Ensure seahub is started successfully
|
||||
sleep 5
|
||||
if ! pgrep -f "${manage_py}" 1>/dev/null; then
|
||||
printf "\033[33mError:Seahub failed to start.\033[m\n"
|
||||
exit 1;
|
||||
fi
|
||||
echo
|
||||
echo "Seahub is started"
|
||||
echo
|
||||
}
|
||||
|
||||
function prepare_env() {
|
||||
check_python_executable;
|
||||
validate_ccnet_conf_dir;
|
||||
read_seafile_data_dir;
|
||||
|
||||
if [[ -z "$LANG" ]]; then
|
||||
echo "LANG is not set in ENV, set to en_US.UTF-8"
|
||||
export LANG='en_US.UTF-8'
|
||||
fi
|
||||
if [[ -z "$LC_ALL" ]]; then
|
||||
echo "LC_ALL is not set in ENV, set to en_US.UTF-8"
|
||||
export LC_ALL='en_US.UTF-8'
|
||||
fi
|
||||
|
||||
export CCNET_CONF_DIR=${default_ccnet_conf_dir}
|
||||
export SEAFILE_CONF_DIR=${seafile_data_dir}
|
||||
export SEAFILE_CENTRAL_CONF_DIR=${central_config_dir}
|
||||
export PYTHONPATH=${INSTALLPATH}/seafile/lib/python2.6/site-packages:${INSTALLPATH}/seafile/lib64/python2.6/site-packages:${INSTALLPATH}/seahub:${INSTALLPATH}/seahub/thirdpart:$PYTHONPATH
|
||||
export PYTHONPATH=${INSTALLPATH}/seafile/lib/python2.7/site-packages:${INSTALLPATH}/seafile/lib64/python2.7/site-packages:$PYTHONPATH
|
||||
|
||||
}
|
||||
|
||||
function clear_sessions () {
|
||||
prepare_env;
|
||||
|
||||
echo "Start clear expired session records ..."
|
||||
$PYTHON "${manage_py}" clearsessions
|
||||
|
||||
echo
|
||||
echo "Done"
|
||||
echo
|
||||
}
|
||||
|
||||
function stop_seahub () {
|
||||
if [[ -f ${pidfile} ]]; then
|
||||
echo "Stopping seahub ..."
|
||||
pkill -9 -f "thirdpart/gunicorn"
|
||||
sleep 1
|
||||
if pgrep -f "thirdpart/gunicorn" 2>/dev/null 1>&2 ; then
|
||||
echo 'Failed to stop seahub.'
|
||||
exit 1
|
||||
fi
|
||||
rm -f ${pidfile}
|
||||
return 0
|
||||
else
|
||||
echo "Seahub is not running"
|
||||
fi
|
||||
}
|
||||
|
||||
function check_init_admin() {
|
||||
check_init_admin_script=${INSTALLPATH}/check_init_admin.py
|
||||
if ! $PYTHON $check_init_admin_script; then
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function run_python_env() {
|
||||
local pyexec
|
||||
|
||||
prepare_env;
|
||||
|
||||
if which ipython 2>/dev/null; then
|
||||
pyexec=ipython
|
||||
else
|
||||
pyexec=$PYTHON
|
||||
fi
|
||||
|
||||
if [[ $# -eq 0 ]]; then
|
||||
$pyexec "$@"
|
||||
else
|
||||
"$@"
|
||||
fi
|
||||
}
|
||||
|
||||
case $1 in
|
||||
"start" )
|
||||
start_seahub;
|
||||
;;
|
||||
"start-fastcgi" )
|
||||
start_seahub_fastcgi;
|
||||
;;
|
||||
"stop" )
|
||||
stop_seahub;
|
||||
;;
|
||||
"restart" )
|
||||
stop_seahub
|
||||
sleep 2
|
||||
start_seahub
|
||||
;;
|
||||
"restart-fastcgi" )
|
||||
stop_seahub
|
||||
sleep 2
|
||||
start_seahub_fastcgi
|
||||
;;
|
||||
"python-env")
|
||||
shift
|
||||
run_python_env "$@"
|
||||
;;
|
||||
"clearsessions" )
|
||||
clear_sessions
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Done."
|
||||
echo ""
|
||||
777
net-misc/seahub/files/setup-seafile.sh
Executable file
777
net-misc/seahub/files/setup-seafile.sh
Executable file
|
|
@ -0,0 +1,777 @@
|
|||
#!/bin/bash
|
||||
|
||||
SCRIPT=$(readlink -f "$0")
|
||||
INSTALLPATH=$(dirname "${SCRIPT}")
|
||||
TOPDIR=$(dirname "${INSTALLPATH}")
|
||||
default_ccnet_conf_dir=${TOPDIR}/ccnet
|
||||
default_seafile_data_dir=${TOPDIR}/seafile-data
|
||||
default_seahub_db=${TOPDIR}/seahub.db
|
||||
default_conf_dir=${TOPDIR}/conf
|
||||
default_pids_dir=${TOPDIR}/pids
|
||||
default_logs_dir=${TOPDIR}/logs
|
||||
|
||||
export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH}
|
||||
|
||||
use_existing_ccnet="false"
|
||||
use_existing_seafile="false"
|
||||
|
||||
server_manual_http="https://github.com/haiwen/seafile/wiki"
|
||||
|
||||
function welcome () {
|
||||
echo "-----------------------------------------------------------------"
|
||||
echo "This script will guide you to config and setup your seafile server."
|
||||
echo -e "\nMake sure you have read seafile server manual at \n\n\t${server_manual_http}\n"
|
||||
echo -e "Note: This script will guide your to setup seafile server using sqlite3,"
|
||||
echo "which may have problems if your disk is on a NFS/CIFS/USB."
|
||||
echo "In these cases, we suggest you setup seafile server using MySQL."
|
||||
echo
|
||||
echo "Press [ENTER] to continue"
|
||||
echo "-----------------------------------------------------------------"
|
||||
read dummy
|
||||
echo
|
||||
}
|
||||
|
||||
function err_and_quit () {
|
||||
printf "\n\n\033[33mError occured during setup. \nPlease fix possible issues and run the script again.\033[m\n\n"
|
||||
exit 1;
|
||||
}
|
||||
|
||||
function on_ctrl_c_pressed () {
|
||||
printf "\n\n\033[33mYou have pressed Ctrl-C. Setup is interrupted.\033[m\n\n"
|
||||
exit 1;
|
||||
}
|
||||
|
||||
# clean newly created ccnet/seafile configs when exit on SIGINT
|
||||
trap on_ctrl_c_pressed 2
|
||||
|
||||
function check_sanity () {
|
||||
echo `ls ${INSTALLPATH}/seahub`
|
||||
echo `ls ${INSTALLPATH}/seafile`
|
||||
echo `ls ${INSTALLPATH}/runtime`
|
||||
|
||||
if ! [[ -d ${INSTALLPATH}/seahub && -d ${INSTALLPATH}/seafile \
|
||||
&& -d ${INSTALLPATH}/runtime ]]; then
|
||||
echo
|
||||
echo "The seafile-server diretory doesn't contain all needed files."
|
||||
echo "Please make sure you have extracted all files and folders from tarball."
|
||||
err_and_quit;
|
||||
fi
|
||||
}
|
||||
|
||||
function read_yes_no () {
|
||||
printf "[yes|no] "
|
||||
read yesno;
|
||||
while [[ "${yesno}" != "yes" && "${yesno}" != "no" ]]
|
||||
do
|
||||
printf "please answer [yes|no] "
|
||||
read yesno;
|
||||
done
|
||||
|
||||
if [[ "${yesno}" == "no" ]]; then
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
fi
|
||||
}
|
||||
|
||||
function check_existing_ccnet () {
|
||||
if [[ -d ${default_ccnet_conf_dir} ]]; then
|
||||
echo "It seems that you have created a ccnet configuration before. "
|
||||
echo "Would you like to use the existing configuration?"
|
||||
|
||||
if ! read_yes_no; then
|
||||
echo
|
||||
echo "Please remove the existing configuration before continuing."
|
||||
echo "You can do it by running \"rm -rf ${default_ccnet_conf_dir}\""
|
||||
echo
|
||||
exit 1;
|
||||
else
|
||||
echo
|
||||
echo "Existing ccnet configuration is being used."
|
||||
use_existing_ccnet=true
|
||||
fi
|
||||
fi
|
||||
echo
|
||||
}
|
||||
|
||||
function check_python_executable() {
|
||||
if [[ "$PYTHON" != "" && -x $PYTHON ]]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if which python2.7 2>/dev/null 1>&2; then
|
||||
PYTHON=python2.7
|
||||
elif which python27 2>/dev/null 1>&2; then
|
||||
PYTHON=python27
|
||||
else
|
||||
echo
|
||||
echo "Can't find a python executable of version 2.7 or above in PATH"
|
||||
echo "Install python 2.7+ before continue."
|
||||
echo "Or if you installed it in a non-standard PATH, set the PYTHON enviroment varirable to it"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Find python: $PYTHON"
|
||||
echo
|
||||
}
|
||||
|
||||
function check_python_module () {
|
||||
module=$1
|
||||
name=$2
|
||||
hint=$3
|
||||
printf " Checking python module: ${name} ... "
|
||||
if ! $PYTHON -c "import ${module}" 2>/dev/null 1>&2; then
|
||||
echo
|
||||
printf "\033[33m ${name} \033[m is not installed, Please install it first.\n"
|
||||
if [[ "${hint}" != "" ]]; then
|
||||
printf "${hint}"
|
||||
echo
|
||||
fi
|
||||
err_and_quit;
|
||||
fi
|
||||
echo -e "Done."
|
||||
}
|
||||
|
||||
function check_python () {
|
||||
echo "Checking python on this machine ..."
|
||||
check_python_executable
|
||||
if ! which $PYTHON 2>/dev/null 1>&2; then
|
||||
echo "No $PYTHON found on this machine. Please install it first."
|
||||
err_and_quit;
|
||||
else
|
||||
if ($Python --version 2>&1 | grep "3\\.[0-9].\\.[0-9]") 2>/dev/null 1>&2 ; then
|
||||
printf "\033[33m Python version 3.x \033[m detected\n"
|
||||
echo "Python 3.x is not supported. Please use python 2.x."
|
||||
err_and_quit;
|
||||
fi
|
||||
|
||||
if [[ $PYTHON == "python2.6" ]]; then
|
||||
py26="2.6"
|
||||
fi
|
||||
check_python_module sqlite3 python-sqlite3
|
||||
fi
|
||||
echo
|
||||
}
|
||||
|
||||
function check_sqlite3 () {
|
||||
echo -n "Checking for sqlite3 ..."
|
||||
if ! which sqlite3 2>/dev/null 1>&2; then
|
||||
echo -e "\nSqlite3 is not found. install it first.\n"
|
||||
echo "On Debian/Ubuntu: apt-get install sqlite3"
|
||||
echo "On CentOS/RHEL: yum install sqlite"
|
||||
err_and_quit;
|
||||
fi
|
||||
printf "Done.\n\n"
|
||||
}
|
||||
|
||||
function check_system_dependency () {
|
||||
printf "Checking packages needed by seafile ...\n\n"
|
||||
check_python;
|
||||
check_sqlite3;
|
||||
printf "Checking Done.\n\n"
|
||||
}
|
||||
|
||||
function ask_question () {
|
||||
question=$1
|
||||
default=$2
|
||||
key=$3
|
||||
printf "${question}"
|
||||
printf "\n"
|
||||
if [[ "${default}" != "" && "${default}" != "nodefault" ]] ; then
|
||||
printf "[default: ${default} ] "
|
||||
elif [[ "${key}" != "" ]]; then
|
||||
printf "[${key}]: "
|
||||
fi
|
||||
}
|
||||
|
||||
function get_server_name () {
|
||||
question="What would you like to use as the name of this seafile server?\nYour seafile users will be able to see the name in their seafile client."
|
||||
hint="You can use a-z, A-Z, 0-9, _ and -, and the length should be 3 ~ 15"
|
||||
ask_question "${question}\n${hint}" "nodefault" "server name"
|
||||
read server_name
|
||||
if [[ "${server_name}" == "" ]]; then
|
||||
echo
|
||||
echo "server name cannot be empty"
|
||||
get_server_name
|
||||
elif [[ ! ${server_name} =~ ^[a-zA-Z0-9_-]{3,14}$ ]]; then
|
||||
printf "\n\033[33m${server_name}\033[m is not a valid name.\n"
|
||||
get_server_name;
|
||||
fi
|
||||
echo
|
||||
}
|
||||
|
||||
function get_server_ip_or_domain () {
|
||||
question="What is the ip or domain of this server?\nFor example, www.mycompany.com, or, 192.168.1.101"
|
||||
ask_question "${question}\n" "nodefault" "This server's ip or domain"
|
||||
read ip_or_domain
|
||||
if [[ "${ip_or_domain}" == "" ]]; then
|
||||
echo
|
||||
echo "ip or domain cannot be empty"
|
||||
get_server_ip_or_domain
|
||||
fi
|
||||
echo
|
||||
}
|
||||
|
||||
function get_ccnet_server_port () {
|
||||
question="What tcp port do you want to use for ccnet server?"
|
||||
hint="10001 is the recommended port."
|
||||
default="10001"
|
||||
ask_question "${question}\n${hint}" "${default}"
|
||||
read server_port
|
||||
if [[ "${server_port}" == "" ]]; then
|
||||
server_port="${default}"
|
||||
fi
|
||||
if [[ ! ${server_port} =~ ^[0-9]+$ ]]; then
|
||||
echo "\"${server_port}\" is not a valid port number. "
|
||||
get_ccnet_server_port
|
||||
fi
|
||||
echo
|
||||
}
|
||||
|
||||
function get_seafile_server_port () {
|
||||
question="What tcp port would you like to use for seafile server?"
|
||||
hint="12001 is the recommended port."
|
||||
default="12001"
|
||||
ask_question "${question}\n${hint}" "${default}"
|
||||
read seafile_server_port
|
||||
if [[ "${seafile_server_port}" == "" ]]; then
|
||||
seafile_server_port="${default}"
|
||||
fi
|
||||
if [[ ! ${seafile_server_port} =~ ^[0-9]+$ ]]; then
|
||||
echo "\"${seafile_server_port}\" is not a valid port number. "
|
||||
get_seafile_server_port
|
||||
fi
|
||||
echo
|
||||
}
|
||||
|
||||
function get_fileserver_port () {
|
||||
question="What tcp port do you want to use for seafile fileserver?"
|
||||
hint="8082 is the recommended port."
|
||||
default="8082"
|
||||
ask_question "${question}\n${hint}" "${default}"
|
||||
read fileserver_port
|
||||
if [[ "${fileserver_port}" == "" ]]; then
|
||||
fileserver_port="${default}"
|
||||
fi
|
||||
if [[ ! ${fileserver_port} =~ ^[0-9]+$ ]]; then
|
||||
echo "\"${fileserver_port}\" is not a valid port number. "
|
||||
get_fileserver_port
|
||||
fi
|
||||
echo
|
||||
}
|
||||
|
||||
|
||||
function get_seafile_data_dir () {
|
||||
question="Where would you like to store your seafile data?"
|
||||
note="Please use a volume with enough free space."
|
||||
default=${default_seafile_data_dir}
|
||||
ask_question "${question} \n\033[33mNote: \033[m${note}" "${default}"
|
||||
read seafile_data_dir
|
||||
if [[ "${seafile_data_dir}" == "" ]]; then
|
||||
seafile_data_dir=${default}
|
||||
fi
|
||||
|
||||
if [[ -d ${seafile_data_dir} && -f ${seafile_data_dir}/seafile.conf ]]; then
|
||||
echo
|
||||
echo "It seems that you have already existing seafile data in ${seafile_data_dir}."
|
||||
echo "Would you like to use the existing seafile data?"
|
||||
if ! read_yes_no; then
|
||||
echo "You have chosen not to use existing seafile data in ${seafile_data_dir}"
|
||||
echo "You need to specify a different seafile data directory or remove ${seafile_data_dir} before continuing."
|
||||
get_seafile_data_dir
|
||||
else
|
||||
use_existing_seafile="true"
|
||||
fi
|
||||
elif [[ -d ${seafile_data_dir} && $(ls -A ${seafile_data_dir}) != "" ]]; then
|
||||
echo
|
||||
echo "${seafile_data_dir} is an existing non-empty directory. Please specify a different directory"
|
||||
echo
|
||||
get_seafile_data_dir
|
||||
elif [[ ! ${seafile_data_dir} =~ ^/ ]]; then
|
||||
echo
|
||||
echo "\"${seafile_data_dir}\" is not an absolute path. Please specify an absolute path."
|
||||
echo
|
||||
get_seafile_data_dir
|
||||
elif [[ ! -d $(dirname ${seafile_data_dir}) ]]; then
|
||||
echo
|
||||
echo "The path $(dirname ${seafile_data_dir}) does not exist."
|
||||
echo
|
||||
get_seafile_data_dir
|
||||
fi
|
||||
echo
|
||||
}
|
||||
|
||||
function gen_gunicorn_conf () {
|
||||
mkdir -p ${default_conf_dir}
|
||||
gunicorn_conf=${default_conf_dir}/gunicorn.conf
|
||||
if ! $(cat > ${gunicorn_conf} <<EOF
|
||||
import os
|
||||
|
||||
daemon = True
|
||||
workers = 5
|
||||
|
||||
# default localhost:8000
|
||||
bind = "127.0.0.1:8000"
|
||||
|
||||
# Pid
|
||||
pids_dir = '$default_pids_dir'
|
||||
pidfile = os.path.join(pids_dir, 'seahub.pid')
|
||||
|
||||
# for file upload, we need a longer timeout value (default is only 30s, too short)
|
||||
timeout = 1200
|
||||
|
||||
limit_request_line = 8190
|
||||
EOF
|
||||
); then
|
||||
echo "failed to generate gunicorn.conf";
|
||||
err_and_quit
|
||||
fi
|
||||
}
|
||||
|
||||
function gen_seafdav_conf () {
|
||||
mkdir -p ${default_conf_dir}
|
||||
seafdav_conf=${default_conf_dir}/seafdav.conf
|
||||
if ! $(cat > ${seafdav_conf} <<EOF
|
||||
[WEBDAV]
|
||||
enabled = false
|
||||
port = 8080
|
||||
fastcgi = false
|
||||
host = 0.0.0.0
|
||||
share_name = /
|
||||
EOF
|
||||
); then
|
||||
echo "failed to generate seafdav.conf";
|
||||
err_and_quit
|
||||
fi
|
||||
}
|
||||
|
||||
function copy_user_manuals() {
|
||||
src_docs_dir=${INSTALLPATH}/seafile/docs/
|
||||
library_template_dir=${seafile_data_dir}/library-template
|
||||
mkdir -p ${library_template_dir}
|
||||
cp -f ${src_docs_dir}/*.doc ${library_template_dir}
|
||||
}
|
||||
|
||||
function parse_params() {
|
||||
while getopts n:i:p:d arg; do
|
||||
case $arg in
|
||||
n)
|
||||
server_name=${OPTARG}
|
||||
;;
|
||||
i)
|
||||
ip_or_domain=${OPTARG}
|
||||
;;
|
||||
p)
|
||||
fileserver_port=${OPTARG}
|
||||
;;
|
||||
d)
|
||||
seafile_data_dir=${OPTARG}
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
function validate_params() {
|
||||
# server_name default hostname -s
|
||||
if [[ "$server_name" == "" ]]; then
|
||||
server_name=${SERVER_NAME:-`hostname -s`}
|
||||
fi
|
||||
if [[ ! ${server_name} =~ ^[a-zA-Z0-9_-]{3,14}$ ]]; then
|
||||
echo "Invalid server name param"
|
||||
err_and_quit;
|
||||
fi
|
||||
|
||||
# ip_or_domain default hostname -i
|
||||
if [[ "$ip_or_domain" == "" ]]; then
|
||||
ip_or_domain=${SERVER_IP:-`hostname -i`}
|
||||
fi
|
||||
if [[ "$ip_or_domain" != "" && ! ${ip_or_domain} =~ ^[^.].+\..+[^.]$ ]]; then
|
||||
echo "Invalid ip or domain param"
|
||||
err_and_quit;
|
||||
fi
|
||||
|
||||
# fileserver_port default 8082
|
||||
if [[ "${fileserver_port}" == "" ]]; then
|
||||
fileserver_port=${FILESERVER_PORT:-8082}
|
||||
fi
|
||||
if [[ ! ${fileserver_port} =~ ^[0-9]+$ ]]; then
|
||||
echo "Invalid fileserver port param"
|
||||
err_and_quit;
|
||||
fi
|
||||
|
||||
if [[ "${seafile_data_dir}" == "" ]]; then
|
||||
seafile_data_dir=${SEAFILE_DIR:-${default_seafile_data_dir}}
|
||||
fi
|
||||
if [[ -d ${seafile_data_dir} && $(ls -A ${seafile_data_dir}) != "" ]]; then
|
||||
echo "${seafile_data_dir} is an existing non-empty directory. Please specify a different directory"
|
||||
err_and_quit
|
||||
elif [[ ! ${seafile_data_dir} =~ ^/ ]]; then
|
||||
echo "\"${seafile_data_dir}\" is not an absolute path. Please specify an absolute path."
|
||||
err_and_quit
|
||||
elif [[ ! -d $(dirname ${seafile_data_dir}) ]]; then
|
||||
echo "The path $(dirname ${seafile_data_dir}) does not exist."
|
||||
err_and_quit
|
||||
fi
|
||||
}
|
||||
|
||||
function usage() {
|
||||
echo "auto mode:"
|
||||
echo -e "$0 auto\n" \
|
||||
"-n server name\n" \
|
||||
"-i ip or domain\n" \
|
||||
"-p fileserver port\n" \
|
||||
"-d seafile dir to store seafile data"
|
||||
echo ""
|
||||
echo "interactive mode:"
|
||||
echo "$0"
|
||||
}
|
||||
|
||||
# -------------------------------------------
|
||||
# Main workflow of this script
|
||||
# -------------------------------------------
|
||||
|
||||
for param in $@; do
|
||||
if [[ "$param" == "-h" || "$param" == "--help" ]]; then
|
||||
usage;
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
need_pause=1
|
||||
if [[ $# -ge 1 && "$1" == "auto" ]]; then
|
||||
# auto mode, no pause
|
||||
shift
|
||||
parse_params $@;
|
||||
validate_params;
|
||||
need_pause=0
|
||||
fi
|
||||
|
||||
check_sanity;
|
||||
if [[ "${need_pause}" == "1" ]]; then
|
||||
welcome;
|
||||
fi
|
||||
sleep .5
|
||||
check_system_dependency;
|
||||
sleep .5
|
||||
|
||||
check_existing_ccnet;
|
||||
if [[ ${use_existing_ccnet} != "true" ]]; then
|
||||
if [[ "${server_name}" == "" ]]; then
|
||||
get_server_name;
|
||||
fi
|
||||
if [[ "${ip_or_domain}" == "" ]]; then
|
||||
get_server_ip_or_domain;
|
||||
fi
|
||||
# get_ccnet_server_port;
|
||||
fi
|
||||
|
||||
if [[ "$seafile_data_dir" == "" ]]; then
|
||||
get_seafile_data_dir;
|
||||
fi
|
||||
if [[ ${use_existing_seafile} != "true" ]]; then
|
||||
# get_seafile_server_port
|
||||
if [[ "$fileserver_port" == "" ]]; then
|
||||
get_fileserver_port
|
||||
fi
|
||||
fi
|
||||
|
||||
sleep .5
|
||||
|
||||
printf "\nThis is your config information:\n\n"
|
||||
|
||||
if [[ ${use_existing_ccnet} != "true" ]]; then
|
||||
printf "server name: \033[33m${server_name}\033[m\n"
|
||||
printf "server ip/domain: \033[33m${ip_or_domain}\033[m\n"
|
||||
else
|
||||
printf "ccnet config: use existing config in \033[33m${default_ccnet_conf_dir}\033[m\n"
|
||||
fi
|
||||
|
||||
if [[ ${use_existing_seafile} != "true" ]]; then
|
||||
printf "seafile data dir: \033[33m${seafile_data_dir}\033[m\n"
|
||||
printf "fileserver port: \033[33m${fileserver_port}\033[m\n"
|
||||
else
|
||||
printf "seafile data dir: use existing data in \033[33m${seafile_data_dir}\033[m\n"
|
||||
fi
|
||||
|
||||
if [[ "${need_pause}" == "1" ]]; then
|
||||
echo
|
||||
echo "If you are OK with the configuration, press [ENTER] to continue."
|
||||
read dummy
|
||||
fi
|
||||
|
||||
ccnet_init=/usr/bin/ccnet-init
|
||||
seaf_server_init=/usr/bin/seaf-server-init
|
||||
|
||||
# -------------------------------------------
|
||||
# Create ccnet conf
|
||||
# -------------------------------------------
|
||||
if [[ "${use_existing_ccnet}" != "true" ]]; then
|
||||
echo "Generating ccnet configuration in ${default_ccnet_conf_dir}..."
|
||||
echo
|
||||
if ! LD_LIBRARY_PATH=$SEAFILE_LD_LIBRARY_PATH "${ccnet_init}" \
|
||||
-F "${default_conf_dir}" \
|
||||
-c "${default_ccnet_conf_dir}" \
|
||||
--name "${server_name}" \
|
||||
--host "${ip_or_domain}"; then
|
||||
err_and_quit;
|
||||
fi
|
||||
|
||||
echo
|
||||
fi
|
||||
|
||||
sleep 0.5
|
||||
|
||||
# -------------------------------------------
|
||||
# Create seafile conf
|
||||
# -------------------------------------------
|
||||
if [[ "${use_existing_seafile}" != "true" ]]; then
|
||||
echo "Generating seafile configuration in ${seafile_data_dir} ..."
|
||||
echo
|
||||
if ! LD_LIBRARY_PATH=$SEAFILE_LD_LIBRARY_PATH ${seaf_server_init} \
|
||||
--central-config-dir "${default_conf_dir}" \
|
||||
--seafile-dir "${seafile_data_dir}" \
|
||||
--fileserver-port ${fileserver_port}; then
|
||||
|
||||
echo "Failed to generate seafile configuration"
|
||||
err_and_quit;
|
||||
fi
|
||||
|
||||
echo
|
||||
fi
|
||||
|
||||
# -------------------------------------------
|
||||
# Write seafile.ini
|
||||
# -------------------------------------------
|
||||
|
||||
echo "${seafile_data_dir}" > "${default_ccnet_conf_dir}/seafile.ini"
|
||||
|
||||
# -------------------------------------------
|
||||
# Generate gunicorn.conf
|
||||
# -------------------------------------------
|
||||
|
||||
gen_gunicorn_conf;
|
||||
|
||||
# -------------------------------------------
|
||||
# Generate seafevents.conf
|
||||
# -------------------------------------------
|
||||
|
||||
gen_seafdav_conf;
|
||||
|
||||
# -------------------------------------------
|
||||
# generate seahub/settings.py
|
||||
# -------------------------------------------
|
||||
dest_settings_py=${TOPDIR}/conf/seahub_settings.py
|
||||
seahub_secret_keygen=${INSTALLPATH}/seahub/tools/secret_key_generator.py
|
||||
|
||||
if [[ ! -f ${dest_settings_py} ]]; then
|
||||
key=$($PYTHON "${seahub_secret_keygen}")
|
||||
cat > ${dest_settings_py} <<EOF
|
||||
# -*- coding: utf-8 -*-
|
||||
SECRET_KEY = "$key"
|
||||
EOF
|
||||
fi
|
||||
|
||||
# -------------------------------------------
|
||||
# Seahub related config
|
||||
# -------------------------------------------
|
||||
if [[ "${need_pause}" == "1" ]]; then
|
||||
echo "-----------------------------------------------------------------"
|
||||
echo "Seahub is the web interface for seafile server."
|
||||
echo "Now let's setup seahub configuration. Press [ENTER] to continue"
|
||||
echo "-----------------------------------------------------------------"
|
||||
echo
|
||||
read dummy
|
||||
fi
|
||||
|
||||
# echo "Please specify the email address and password for the seahub administrator."
|
||||
# echo "You can use them to login as admin on your seahub website."
|
||||
# echo
|
||||
|
||||
function get_seahub_admin_email () {
|
||||
question="Please specify the email address for the seahub administrator:"
|
||||
ask_question "${question}" "nodefault" "seahub admin email"
|
||||
read seahub_admin_email
|
||||
if [[ "${seahub_admin_email}" == "" ]]; then
|
||||
echo "Seahub admin user name cannot be empty."
|
||||
get_seahub_admin_email;
|
||||
elif [[ ! ${seahub_admin_email} =~ ^.+@.*\..+$ ]]; then
|
||||
echo "${seahub_admin_email} is not a valid email address"
|
||||
get_seahub_admin_email;
|
||||
fi
|
||||
}
|
||||
|
||||
function get_seahub_admin_passwd () {
|
||||
echo
|
||||
question="Please specify the password you would like to use for seahub administrator:"
|
||||
ask_question "${question}" "nodefault" "seahub admin password"
|
||||
read -s seahub_admin_passwd
|
||||
echo
|
||||
question="Please enter the password again:"
|
||||
ask_question "${question}" "nodefault" "seahub admin password again"
|
||||
read -s seahub_admin_passwd_again
|
||||
echo
|
||||
if [[ "${seahub_admin_passwd}" != "${seahub_admin_passwd_again}" ]]; then
|
||||
printf "\033[33mThe passwords didn't match.\033[m"
|
||||
get_seahub_admin_passwd;
|
||||
elif [[ "${seahub_admin_passwd}" == "" ]]; then
|
||||
echo "Password cannot be empty."
|
||||
get_seahub_admin_passwd;
|
||||
fi
|
||||
}
|
||||
|
||||
# get_seahub_admin_email;
|
||||
# sleep .5;
|
||||
# get_seahub_admin_passwd;
|
||||
# seahub_admin_passwd_enc=$(echo -n ${seahub_admin_passwd} | sha1sum | grep -o "[0-9a-f]*")
|
||||
# sleep .5;
|
||||
|
||||
# printf "\n\n"
|
||||
# echo "This is your seahub admin username/password"
|
||||
# echo
|
||||
# printf "admin username: \033[33m${seahub_admin_email}\033[m\n"
|
||||
# printf "admin password: \033[33m**************\033[m\n\n"
|
||||
|
||||
# echo
|
||||
# echo "If you are OK with the configuration, press [ENTER] to continue."
|
||||
# read dummy
|
||||
|
||||
# usermgr_db_dir=${default_ccnet_conf_dir}/PeerMgr/
|
||||
# usermgr_db=${usermgr_db_dir}/usermgr.db
|
||||
|
||||
# if [[ "${use_existing_ccnet}" != "true" ]]; then
|
||||
# # create admin user/passwd entry in ccnet db
|
||||
# if ! mkdir -p "${usermgr_db_dir}"; then
|
||||
# echo "Failed to create seahub admin."
|
||||
# err_and_quit;
|
||||
# fi
|
||||
|
||||
# sql="CREATE TABLE IF NOT EXISTS EmailUser (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, email TEXT, passwd TEXT, is_staff bool NOT NULL, is_active bool NOT NULL, ctime INTEGER)";
|
||||
|
||||
# if ! sqlite3 "${usermgr_db}" "${sql}" ; then
|
||||
# rm -f "${usermgr_db}"
|
||||
# echo "Failed to create seahub admin."
|
||||
# err_and_quit;
|
||||
# fi
|
||||
|
||||
# sql="INSERT INTO EmailUser(email, passwd, is_staff, is_active, ctime) VALUES (\"${seahub_admin_email}\", \"${seahub_admin_passwd_enc}\", 1, 1, 0);"
|
||||
|
||||
# if ! sqlite3 "${usermgr_db}" "${sql}" ; then
|
||||
# rm -f "${usermgr_db}"
|
||||
# echo "Failed to create seahub admin."
|
||||
# err_and_quit;
|
||||
# fi
|
||||
# fi
|
||||
|
||||
echo "Creating database now, it may take one minute, please wait... "
|
||||
echo
|
||||
|
||||
cd ${TOPDIR}/ccnet && mkdir -m 0755 GroupMgr misc OrgMgr PeerMgr && cd -
|
||||
|
||||
ccnet_group_db=${TOPDIR}/ccnet/GroupMgr/groupmgr.db
|
||||
ccnet_group_sql=${INSTALLPATH}/sql/sqlite/groupmgr.sql
|
||||
if ! sqlite3 ${ccnet_group_db} ".read ${ccnet_group_sql}" 2>/dev/null 1>&2; then
|
||||
echo "Failed to sync ccnet groupmgr database."
|
||||
err_and_quit;
|
||||
fi
|
||||
|
||||
ccnet_config_db=${TOPDIR}/ccnet/misc/config.db
|
||||
ccnet_config_sql=${INSTALLPATH}/sql/sqlite/config.sql
|
||||
if ! sqlite3 ${ccnet_config_db} ".read ${ccnet_config_sql}" 2>/dev/null 1>&2; then
|
||||
echo "Failed to sync ccnet config database."
|
||||
err_and_quit;
|
||||
fi
|
||||
|
||||
ccnet_org_db=${TOPDIR}/ccnet/OrgMgr/orgmgr.db
|
||||
ccnet_org_sql=${INSTALLPATH}/sql/sqlite/org.sql
|
||||
if ! sqlite3 ${ccnet_org_db} ".read ${ccnet_org_sql}" 2>/dev/null 1>&2; then
|
||||
echo "Failed to sync ccnet org database."
|
||||
err_and_quit;
|
||||
fi
|
||||
|
||||
ccnet_user_db=${TOPDIR}/ccnet/PeerMgr/usermgr.db
|
||||
ccnet_user_sql=${INSTALLPATH}/sql/sqlite/user.sql
|
||||
if ! sqlite3 ${ccnet_user_db} ".read ${ccnet_user_sql}" 2>/dev/null 1>&2; then
|
||||
echo "Failed to sync ccnet user database."
|
||||
err_and_quit;
|
||||
fi
|
||||
|
||||
seafile_db=${TOPDIR}/seafile-data/seafile.db
|
||||
seafile_sql=${INSTALLPATH}/sql/sqlite/seafile.sql
|
||||
if ! sqlite3 ${seafile_db} ".read ${seafile_sql}" 2>/dev/null 1>&2; then
|
||||
echo "Failed to sync seafile database."
|
||||
err_and_quit;
|
||||
fi
|
||||
|
||||
seahub_db=${TOPDIR}/seahub.db
|
||||
seahub_sqls=${INSTALLPATH}/seahub/sql/sqlite3.sql
|
||||
if ! sqlite3 ${seahub_db} ".read ${seahub_sqls}" 2>/dev/null 1>&2; then
|
||||
echo "Failed to sync seahub database."
|
||||
err_and_quit;
|
||||
fi
|
||||
echo
|
||||
echo "Done."
|
||||
|
||||
# prepare avatar folder
|
||||
|
||||
media_dir=${INSTALLPATH}/seahub/media
|
||||
orig_avatar_dir=${INSTALLPATH}/seahub/media/avatars
|
||||
dest_avatar_dir=${TOPDIR}/seahub-data/avatars
|
||||
|
||||
if [[ ! -d ${dest_avatar_dir} ]]; then
|
||||
mkdir -p "${TOPDIR}/seahub-data"
|
||||
mv "${orig_avatar_dir}" "${dest_avatar_dir}"
|
||||
ln -s ../../../seahub-data/avatars ${media_dir}
|
||||
fi
|
||||
|
||||
# Make a seafile-server symlink, like this:
|
||||
# /data/haiwen/
|
||||
# -- seafile-server-2.0.4
|
||||
# -- seafile-server-latest # symlink to 2.0.4
|
||||
seafile_server_symlink=${TOPDIR}/seafile-server-latest
|
||||
echo
|
||||
echo -n "creating seafile-server-latest symbolic link ... "
|
||||
if ! ln -s $(basename ${INSTALLPATH}) ${seafile_server_symlink}; then
|
||||
echo
|
||||
echo
|
||||
echo "Failed to create symbolic link ${seafile_server_symlink}"
|
||||
err_and_quit;
|
||||
fi
|
||||
echo "done"
|
||||
echo
|
||||
|
||||
chmod 0600 "$dest_settings_py"
|
||||
chmod 0700 "$default_ccnet_conf_dir"
|
||||
chmod 0700 "$seafile_data_dir"
|
||||
chmod 0700 "$default_conf_dir"
|
||||
|
||||
# -------------------------------------------
|
||||
# copy user manuals to library template
|
||||
# -------------------------------------------
|
||||
copy_user_manuals;
|
||||
|
||||
# -------------------------------------------
|
||||
# final message
|
||||
# -------------------------------------------
|
||||
|
||||
sleep 1
|
||||
|
||||
echo
|
||||
echo "-----------------------------------------------------------------"
|
||||
echo "Your seafile server configuration has been completed successfully."
|
||||
echo "-----------------------------------------------------------------"
|
||||
echo
|
||||
echo "run seafile server: ./seafile.sh { start | stop | restart }"
|
||||
echo "run seahub server: ./seahub.sh { start <port> | stop | restart <port> }"
|
||||
echo
|
||||
echo "-----------------------------------------------------------------"
|
||||
echo "If the server is behind a firewall, remember to open these tcp ports:"
|
||||
echo "-----------------------------------------------------------------"
|
||||
echo
|
||||
echo "port of seafile fileserver: ${fileserver_port}"
|
||||
echo "port of seahub: 8000"
|
||||
echo
|
||||
echo -e "When problems occur, refer to\n"
|
||||
echo -e " ${server_manual_http}\n"
|
||||
echo "for more information."
|
||||
echo
|
||||
70
net-misc/seahub/seahub-7.0.1.ebuild
Normal file
70
net-misc/seahub/seahub-7.0.1.ebuild
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
# Copyright 1999-2017 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python2_7 )
|
||||
inherit python-single-r1
|
||||
|
||||
DESCRIPTION="The web end of seafile server"
|
||||
HOMEPAGE="https://github.com/haiwen/seahub/"
|
||||
SRC_URI="https://github.com/haiwen/seahub/archive/v7.0.1-server.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE=""
|
||||
SLOT="0"
|
||||
KEYWORDS="~x86 ~amd64"
|
||||
IUSE=""
|
||||
|
||||
#see with requirements.txt
|
||||
RDEPEND="dev-python/python-dateutil[${PYTHON_USEDEP}]
|
||||
dev-python/python-memcached[${PYTHON_USEDEP}]
|
||||
dev-python/chardet[${PYTHON_USEDEP}]
|
||||
dev-python/six[${PYTHON_USEDEP}]
|
||||
dev-python/pillow[${PYTHON_USEDEP}]
|
||||
=dev-python/django-1.11*[${PYTHON_USEDEP}]
|
||||
dev-python/django_compressor[${PYTHON_USEDEP}]
|
||||
dev-python/django-post_office[${PYTHON_USEDEP}]
|
||||
dev-python/django-statici18n[${PYTHON_USEDEP}]
|
||||
dev-python/djangorestframework[${PYTHON_USEDEP}]
|
||||
dev-python/django-constance[${PYTHON_USEDEP},database]
|
||||
dev-python/openpyxl[${PYTHON_USEDEP}]
|
||||
dev-python/pytz[${PYTHON_USEDEP}]
|
||||
dev-python/django-formtools[${PYTHON_USEDEP}]
|
||||
dev-python/qrcode[${PYTHON_USEDEP}]
|
||||
dev-python/requests[${PYTHON_USEDEP}]
|
||||
dev-python/requests-oauthlib[${PYTHON_USEDEP}]
|
||||
dev-python/django-simple-captcha[${PYTHON_USEDEP}]
|
||||
www-servers/gunicorn
|
||||
dev-python/django-webpack-loader[${PYTHON_USEDEP}]
|
||||
dev-python/python-cas[${PYTHON_USEDEP}]
|
||||
virtual/python-futures[${PYTHON_USEDEP}]
|
||||
dev-python/social-auth-core[${PYTHON_USEDEP}]
|
||||
dev-python/flup[${PYTHON_USEDEP}]"
|
||||
|
||||
#TODO:
|
||||
#django-constance[database] ?
|
||||
#ccnet-server[sqlite] ?
|
||||
|
||||
#git+git://github.com/haiwen/django-post_office.git@2312cf240363721f737b5ac8eb86ab8cb255938f#egg=django-post_office
|
||||
#git+git://github.com/haiwen/django-constance.git@8508ff29141732190faff51d5c2b5474da297732#egg=django-constance[database]
|
||||
#git+git://github.com/haiwen/python-cas.git@ffc49235fd7cc32c4fdda5acfa3707e1405881df#egg=python_cas
|
||||
|
||||
S="${WORKDIR}/${P}-server"
|
||||
|
||||
src_compile() {
|
||||
einfo
|
||||
}
|
||||
|
||||
src_install() {
|
||||
# dodir /opt/Tiredful-API
|
||||
# cp -R "${S}"/Tiredful-API "${D}"/opt/
|
||||
einfo
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
einfo "The GUI server is not ready to be started yet"
|
||||
einfo "Please follow the following steps to complete configuration:"
|
||||
einfo " https://manual.seafile.com/deploy/using_sqlite.html"
|
||||
einfo " https://manual.seafile.com/build_seafile/server.html"
|
||||
einfo "also see ${FILESDIR} for modified scripts"
|
||||
}
|
||||
|
|
@ -389,3 +389,21 @@ dev-python/nessrest
|
|||
|
||||
#sslyze
|
||||
dev-python/dataclasses
|
||||
|
||||
# required by seahub (argument)
|
||||
|
||||
# required by seahub (argument)
|
||||
~dev-python/jsonfield-2.0.2
|
||||
~dev-python/django-redis-4.10.0
|
||||
~dev-python/django-statici18n-1.8.3
|
||||
~dev-python/djangorestframework-3.9.4
|
||||
~dev-python/django_compressor-2.3
|
||||
~dev-python/rcssmin-1.0.6
|
||||
~dev-python/django-post_office-3.2.1
|
||||
~dev-python/django-constance-2.4.0
|
||||
~dev-python/rjsmin-1.1.0
|
||||
dev-python/django-formtools
|
||||
dev-python/django-simple-captcha
|
||||
dev-python/python-cas
|
||||
dev-python/social-auth-core
|
||||
dev-python/django-webpack-loader
|
||||
|
|
|
|||
|
|
@ -121,3 +121,5 @@ net-misc/voipong
|
|||
~net-libs/libsearpc-3.1
|
||||
=net-libs/ccnet-6.1*
|
||||
=net-misc/ccnet-server-7*
|
||||
|
||||
=net-misc/seahub-7*
|
||||
|
|
|
|||
|
|
@ -23,3 +23,5 @@ dev-python/qtconsole -python_targets_python2_7
|
|||
dev-util/androguard -python_targets_python2_7
|
||||
|
||||
dev-python/networkx -python_targets_python2_7
|
||||
|
||||
dev-python/django-constance database
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ IUSE=""
|
|||
|
||||
RDEPEND="dev-python/django[${PYTHON_USEDEP}]
|
||||
dev-python/django-oauth-toolkit[${PYTHON_USEDEP}]
|
||||
dev-python/django-rest-framework[${PYTHON_USEDEP}]
|
||||
dev-python/djangorestframework[${PYTHON_USEDEP}]
|
||||
dev-python/oauth[${PYTHON_USEDEP}]
|
||||
dev-python/oauthlib[${PYTHON_USEDEP}]
|
||||
dev-python/python-oauth2[${PYTHON_USEDEP}]"
|
||||
|
|
|
|||
Loading…
Reference in a new issue