Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
9561a29e9d | |||
21023671f5 | |||
c1cb3885d7 | |||
7d1d8453ce | |||
0a7448aec4 | |||
4dfc15fffd | |||
65140c1986 | |||
3c42cff98d | |||
33af52ff54 | |||
5b07f77f53 | |||
6fabfb2aab | |||
19014932d1 | |||
99748c70aa | |||
e9e595ef68 | |||
d05de406f8 | |||
![]() |
1b4ad91a13 |
18
.drone.yml
18
.drone.yml
@ -1,21 +1,17 @@
|
||||
kind: pipeline
|
||||
name: default
|
||||
steps:
|
||||
- name: nginx-conf
|
||||
pipeline:
|
||||
nginx-conf:
|
||||
image: nginx:mainline
|
||||
commands:
|
||||
- cp -r nginx /etc/nginx
|
||||
- nginx -t
|
||||
- name: docker
|
||||
docker:
|
||||
image: plugins/docker
|
||||
repo: repo.shimun.net/shimun/seafile
|
||||
auto_tag: true
|
||||
repo: repo.shimun.net/shimun/seafile:git
|
||||
tag: riffol
|
||||
registry: repo.shimun.net
|
||||
storage_path: /drone/.docker
|
||||
secrets: ["docker_username", "docker_password"]
|
||||
storage_path: /drone/.docker
|
||||
cache_from: ["repo.shimun.net/shimun/seafile", "repo.shimun.net/shimun/seafile:nginx-deb", "repo.shimun.net/shimun/seafile:alpine"]
|
||||
storage_path: /drone/cache/.docker
|
||||
cache_from: ["repo.shimun.net/shimun/seafile:git"]
|
||||
use_cache: true
|
||||
pull_image: false
|
||||
when:
|
||||
event: tag
|
||||
|
29
Dockerfile
29
Dockerfile
@ -1,6 +1,6 @@
|
||||
FROM rust:1.34 AS riffol_build
|
||||
FROM rust:1.36-slim AS riffol_build
|
||||
|
||||
RUN cargo install --git https://github.com/shimunn/riffol.git --branch 32b
|
||||
RUN cargo install --git https://github.com/shimunn/riffol.git --branch print_error --locked
|
||||
|
||||
FROM nginx:mainline
|
||||
|
||||
@ -12,16 +12,21 @@ ENV SEAF=/opt/seafile
|
||||
|
||||
COPY requirements.txt /tmp/requirements.txt
|
||||
|
||||
RUN apt update && apt install locales -y && apt install -y --no-install-recommends procps openssl python3 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 \
|
||||
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 \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/requirements.txt
|
||||
|
||||
#ENV RIFFOL_VERSION libc-2.24
|
||||
#ENV RIFFOL_HASH e6aea0a91abe74dc0892b0814a0485f16ce8b738b4672b4980b15a398c013e974d5d1b6c27eed69899196cc21014e407f7ff74ee5636a8690ebd639fe0ca5abb
|
||||
#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 && \
|
||||
# echo "$RIFFOL_HASH /tmp/riffol-$RIFFOL_VERSION.tar.gz" | sha512sum --check && \
|
||||
# tar -xvzf /tmp/riffol-$RIFFOL_VERSION.tar.gz -C /usr/sbin/ && \
|
||||
# rm /tmp/riffol-$RIFFOL_VERSION.tar.gz
|
||||
RUN python3 -m pip install --upgrade pip && rm -r /root/.cache/pip
|
||||
|
||||
RUN pip3 install --timeout=3600 click termcolor colorlog pymysql \
|
||||
django && rm -r /root/.cache/pip
|
||||
|
||||
ADD https://raw.githubusercontent.com/haiwen/seahub/master/requirements.txt /tmp/hub-requirements.txt
|
||||
|
||||
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/
|
||||
|
||||
@ -40,6 +45,10 @@ COPY scripts/setup.sh /usr/bin/setup
|
||||
RUN ulimit -n 30000 && mkdir -p $SEAF/pids && \
|
||||
chmod +x /usr/local/sbin/upgrade /usr/bin/setup
|
||||
|
||||
RUN pip2 install requests scriptine
|
||||
|
||||
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"]
|
||||
|
@ -1,18 +1,5 @@
|
||||
location /seafdav {
|
||||
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;
|
||||
|
||||
proxy_pass http://webdav;
|
||||
client_max_body_size 0;
|
||||
|
||||
}
|
||||
|
@ -3,6 +3,5 @@ scriptine
|
||||
setuptools
|
||||
simplejson
|
||||
python-memcached
|
||||
pyyaml
|
||||
requests==2.18.4
|
||||
requests_oauthlib==0.8.0
|
||||
urllib3
|
||||
lxml
|
||||
|
@ -21,7 +21,7 @@ function last_update {
|
||||
if [ -e "$LATEST/install_date" ]; then
|
||||
date -d $(cat "$LATEST/install_date") "+%s"
|
||||
else
|
||||
echo 0
|
||||
echo 1000000
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,10 @@ version_re = "seafile-server-?_?([\d\.]*)"
|
||||
seaf_home = os.environ["SEAF"] or "/opt/seafile"
|
||||
|
||||
def available(page):
|
||||
arch = platform.machine()
|
||||
(arch, _) = platform.architecture()
|
||||
if arch == "64bit":
|
||||
arch = "x86-64"
|
||||
else: arch = "i386"
|
||||
link = "http(s?):\/\/[^ \"\(\)\<\>]*%s_?%s.tar.gz" % (version_re ,arch)
|
||||
resp = requests.get(page)
|
||||
available = {}
|
||||
@ -96,8 +99,6 @@ def download(url, version):
|
||||
return 0
|
||||
|
||||
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)
|
||||
tmp = tempfile.mkdtemp()
|
||||
if pkg and call(["/bin/sh", "-c", 'cd %s; tar xzvf %s' % (tmp, pkg)]) == 0:
|
||||
|
Loading…
x
Reference in New Issue
Block a user