Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c4162eb700 | ||
![]() |
35731c0135 | ||
![]() |
54ad7cbcf9 |
@ -6,12 +6,12 @@ pipeline:
|
|||||||
- nginx -t
|
- nginx -t
|
||||||
docker:
|
docker:
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
repo: repo.shimun.net/shimun/seafile:git
|
repo: repo.shimun.net/shimun/seafile
|
||||||
tag: riffol
|
tag: riffol
|
||||||
registry: repo.shimun.net
|
registry: repo.shimun.net
|
||||||
storage_path: /drone/.docker
|
storage_path: /drone/.docker
|
||||||
secrets: ["docker_username", "docker_password"]
|
secrets: ["docker_username", "docker_password"]
|
||||||
storage_path: /drone/cache/.docker
|
storage_path: /drone/.docker
|
||||||
cache_from: ["repo.shimun.net/shimun/seafile:git"]
|
cache_from: ["repo.shimun.net/shimun/seafile", "repo.shimun.net/shimun/seafile:nginx-deb", "repo.shimun.net/shimun/seafile:alpine"]
|
||||||
use_cache: true
|
use_cache: true
|
||||||
pull_image: false
|
pull_image: false
|
||||||
|
29
Dockerfile
29
Dockerfile
@ -1,6 +1,6 @@
|
|||||||
FROM rust:1.36-slim AS riffol_build
|
FROM rust:1.34 AS riffol_build
|
||||||
|
|
||||||
RUN cargo install --git https://github.com/shimunn/riffol.git --branch print_error --locked
|
RUN cargo install --git https://github.com/shimunn/riffol.git --branch 32b
|
||||||
|
|
||||||
FROM nginx:mainline
|
FROM nginx:mainline
|
||||||
|
|
||||||
@ -12,21 +12,16 @@ ENV SEAF=/opt/seafile
|
|||||||
|
|
||||||
COPY requirements.txt /tmp/requirements.txt
|
COPY requirements.txt /tmp/requirements.txt
|
||||||
|
|
||||||
RUN apt update && apt install locales -y && apt install -y procps libmariadb-dev-compat openssl python2.7 sqlite3 python-mysqldb python-pil curl libjansson4 libfuse2 python-pip python-pip-whl python-setuptools python3 sqlite3 python3 python3-pip python3-setuptools python3-ldap \
|
RUN apt update && apt install locales -y && apt install -y --no-install-recommends procps openssl python2.7 sqlite3 python-mysqldb python-pil curl libjansson4 libfuse2 python-pip python-pip-whl python-setuptools \
|
||||||
|
&& pip install -r /tmp/requirements.txt && apt remove -y python-pip \
|
||||||
&& rm -rf /var/lib/apt/lists/* /tmp/requirements.txt
|
&& rm -rf /var/lib/apt/lists/* /tmp/requirements.txt
|
||||||
|
|
||||||
RUN python3 -m pip install --upgrade pip && rm -r /root/.cache/pip
|
#ENV RIFFOL_VERSION libc-2.24
|
||||||
|
#ENV RIFFOL_HASH e6aea0a91abe74dc0892b0814a0485f16ce8b738b4672b4980b15a398c013e974d5d1b6c27eed69899196cc21014e407f7ff74ee5636a8690ebd639fe0ca5abb
|
||||||
RUN pip3 install --timeout=3600 click termcolor colorlog pymysql \
|
#RUN curl -L https://github.com/riboseinc/riffol/releases/download/0.1.0/riffol-$RIFFOL_VERSION.tar.gz -o /tmp/riffol-$RIFFOL_VERSION.tar.gz && \
|
||||||
django && rm -r /root/.cache/pip
|
# echo "$RIFFOL_HASH /tmp/riffol-$RIFFOL_VERSION.tar.gz" | sha512sum --check && \
|
||||||
|
# tar -xvzf /tmp/riffol-$RIFFOL_VERSION.tar.gz -C /usr/sbin/ && \
|
||||||
ADD https://raw.githubusercontent.com/haiwen/seahub/master/requirements.txt /tmp/hub-requirements.txt
|
# rm /tmp/riffol-$RIFFOL_VERSION.tar.gz
|
||||||
|
|
||||||
RUN pip3 install --timeout=3600 -r /tmp/hub-requirements.txt
|
|
||||||
|
|
||||||
ADD https://raw.githubusercontent.com/haiwen/seafdav/master/requirements.txt /tmp/dav-requirements.txt
|
|
||||||
|
|
||||||
RUN pip3 install --timeout=3600 -r /tmp/dav-requirements.txt
|
|
||||||
|
|
||||||
COPY --from=riffol_build /usr/local/cargo/bin/riffol /usr/sbin/
|
COPY --from=riffol_build /usr/local/cargo/bin/riffol /usr/sbin/
|
||||||
|
|
||||||
@ -45,10 +40,6 @@ COPY scripts/setup.sh /usr/bin/setup
|
|||||||
RUN ulimit -n 30000 && mkdir -p $SEAF/pids && \
|
RUN ulimit -n 30000 && mkdir -p $SEAF/pids && \
|
||||||
chmod +x /usr/local/sbin/upgrade /usr/bin/setup
|
chmod +x /usr/local/sbin/upgrade /usr/bin/setup
|
||||||
|
|
||||||
RUN pip2 install requests scriptine
|
|
||||||
|
|
||||||
ENV SEAF_UPGRADE_INTERVAL=3
|
ENV SEAF_UPGRADE_INTERVAL=3
|
||||||
|
|
||||||
HEALTHCHECK --interval=30s --timeout=30s --start-period=30s CMD (curl http://localhost:8000 || (echo "failed seahub"; exit 1)) && (curl http://localhost:8082 || (echo "failed seafhttp"; exit 1)) && (bash -c '[ $(curl --silent --output /dev/null --write-out "%{http_code}" http://localhost:8080) -eq 401 ]' || (echo "failed seafdav"; exit 1)) || exit 1
|
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/sbin/riffol", "-f", "/etc/riffol.conf"]
|
ENTRYPOINT ["/usr/sbin/riffol", "-f", "/etc/riffol.conf"]
|
||||||
|
@ -1,5 +1,18 @@
|
|||||||
location /seafdav {
|
location /seafdav {
|
||||||
proxy_pass http://webdav;
|
fastcgi_pass webdav;
|
||||||
|
fastcgi_keep_conn on;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param PATH_INFO $fastcgi_script_name;
|
||||||
|
|
||||||
|
fastcgi_param SERVER_PROTOCOL $server_protocol;
|
||||||
|
fastcgi_param QUERY_STRING $query_string;
|
||||||
|
fastcgi_param REQUEST_METHOD $request_method;
|
||||||
|
fastcgi_param CONTENT_TYPE $content_type;
|
||||||
|
fastcgi_param CONTENT_LENGTH $content_length;
|
||||||
|
fastcgi_param SERVER_ADDR $server_addr;
|
||||||
|
fastcgi_param SERVER_PORT $server_port;
|
||||||
|
fastcgi_param SERVER_NAME $server_name;
|
||||||
|
|
||||||
client_max_body_size 0;
|
client_max_body_size 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,5 +3,6 @@ scriptine
|
|||||||
setuptools
|
setuptools
|
||||||
simplejson
|
simplejson
|
||||||
python-memcached
|
python-memcached
|
||||||
urllib3
|
pyyaml
|
||||||
lxml
|
requests==2.18.4
|
||||||
|
requests_oauthlib==0.8.0
|
||||||
|
@ -21,7 +21,7 @@ function last_update {
|
|||||||
if [ -e "$LATEST/install_date" ]; then
|
if [ -e "$LATEST/install_date" ]; then
|
||||||
date -d $(cat "$LATEST/install_date") "+%s"
|
date -d $(cat "$LATEST/install_date") "+%s"
|
||||||
else
|
else
|
||||||
echo 1000000
|
echo 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,10 +8,7 @@ version_re = "seafile-server-?_?([\d\.]*)"
|
|||||||
seaf_home = os.environ["SEAF"] or "/opt/seafile"
|
seaf_home = os.environ["SEAF"] or "/opt/seafile"
|
||||||
|
|
||||||
def available(page):
|
def available(page):
|
||||||
(arch, _) = platform.architecture()
|
arch = platform.machine()
|
||||||
if arch == "64bit":
|
|
||||||
arch = "x86-64"
|
|
||||||
else: arch = "i386"
|
|
||||||
link = "http(s?):\/\/[^ \"\(\)\<\>]*%s_?%s.tar.gz" % (version_re ,arch)
|
link = "http(s?):\/\/[^ \"\(\)\<\>]*%s_?%s.tar.gz" % (version_re ,arch)
|
||||||
resp = requests.get(page)
|
resp = requests.get(page)
|
||||||
available = {}
|
available = {}
|
||||||
@ -99,6 +96,8 @@ def download(url, version):
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
def install_command(url, version):
|
def install_command(url, version):
|
||||||
|
if platform.machine() == "armv7l":
|
||||||
|
url = "https://github.com/haiwen/seafile-rpi/releases/download/v%s/seafile-server_%s_stable_pi.tar.gz" % (version,version)
|
||||||
pkg = download(url, version)
|
pkg = download(url, version)
|
||||||
tmp = tempfile.mkdtemp()
|
tmp = tempfile.mkdtemp()
|
||||||
if pkg and call(["/bin/sh", "-c", 'cd %s; tar xzvf %s' % (tmp, pkg)]) == 0:
|
if pkg and call(["/bin/sh", "-c", 'cd %s; tar xzvf %s' % (tmp, pkg)]) == 0:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user