From edbf964ea71c7015068fdbbff976dfe70744a949 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Sun, 2 Jan 2022 13:18:58 +0800 Subject: [PATCH] u --- config-debian.sh | 3 +++ install-seafile.sh | 21 +++++++++++---------- nginx-seafile-http.conf | 2 +- nginx-seafile-https.conf | 8 ++++---- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/config-debian.sh b/config-debian.sh index cca171d..8e37ec3 100755 --- a/config-debian.sh +++ b/config-debian.sh @@ -88,9 +88,11 @@ read -p "<<< Set hostname = " NewHostname if [ $NewHostname ] then sudo hostnamectl set-hostname $NewHostname + echo "127.0.0.1 $NewHostName" >> /etc/hostname else echo 'Nothing changed >>>' fi +echo echo "<<< autologin for Xfce: /etc/lightdm/lightdm.conf" read -p "<<< Enable xfce autologin as ($NewUser for autologin or anything else for no change): " XfceAutologinUsername @@ -102,6 +104,7 @@ then else echo 'Nothing changed >>>' fi +echo echo "<<< Configure autostart" if [ -f /etc/rc.local ] diff --git a/install-seafile.sh b/install-seafile.sh index dbb4aaa..feca27e 100755 --- a/install-seafile.sh +++ b/install-seafile.sh @@ -1,14 +1,15 @@ #!/bin/bash -# seafile 7/8 requires python3 +## seafile 7/8 requires python3 sudo apt-get update sudo apt-get install python3 python3-setuptools python3-pip python3-ldap sqlite3 -y sudo pip3 install --timeout=3600 django==2.2.* future Pillow pylibmc captcha jinja2 sqlalchemy==1.4.3 psd-tools django-pylibmc django-simple-captcha -# for seafile 9.*: sudo pip3 install --timeout=3600 django==2.2.* future Pillow pylibmc captcha jinja2 sqlalchemy==1.4.3 psd-tools django-pylibmc django-simple-captcha pycryptodome==3.12.0 +## for seafile 9.*: +# sudo pip3 install --timeout=3600 django==2.2.* future Pillow pylibmc captcha jinja2 sqlalchemy==1.4.3 psd-tools django-pylibmc django-simple-captcha pycryptodome==3.12.0 pushd /faronear -sudo mkdir bin.seafile -cd bin.seafile +sudo mkdir bin-seafile +cd bin-seafile sudo wget https://seafile-downloads.oss-cn-shanghai.aliyuncs.com/seafile-server_8.0.8_x86-64.tar.gz sudo tar -xzf seafile-server_* cd seafile-server-* @@ -18,16 +19,16 @@ ln -s seafile-server-8.0.8 sea sudo ./seafile.sh start -# changed "127.0.0.1:8000" to "0.0.0.0:8000", otherwise it can only be accessed on the localhost, unless using nginx/apache to proxy -sudo sed -i "s/127\.0\.0\.1/0.0.0.0/g" ../conf/gunicorn.conf.py -# to change seahub port, to edit gunicorn.conf.py, it works although it still promts "Starting seahub at port 8000 ...". -# (Directly `./seahub.sh start ` prompts "Starting seahub at port ..." but it actually doesn't listen on .) +## changed "127.0.0.1:8000" to "0.0.0.0:8000", otherwise it can only be accessed on the localhost, unless using nginx/apache to proxy +# sudo sed -i "s/127\.0\.0\.1/0.0.0.0/g" ../conf/gunicorn.conf.py +## to change seahub port, to edit gunicorn.conf.py, it works although it still promts "Starting seahub at port 8000 ...". +## (Directly `./seahub.sh start ` prompts "Starting seahub at port ..." but it actually doesn't listen on .) sudo ./seahub.sh start popd sudo apt install nginx -y rm /etc/nginx/sites-enabled/default -cp /faronear/fon/sysconfig/nginx-seafile-https.conf /faronear/bin.seafile/ -ln -s /faronear/bin.seafile/nginx-seafile-https.conf /etc/nginx/sites-enabled/ +cp /faronear/fon/sysconfig/nginx-seafile-http.conf /faronear/bin-seafile/ +ln -s /faronear/bin-seafile/nginx-seafile-http.conf /etc/nginx/sites-enabled/ service nginx restart diff --git a/nginx-seafile-http.conf b/nginx-seafile-http.conf index f1711f0..b68a442 100644 --- a/nginx-seafile-http.conf +++ b/nginx-seafile-http.conf @@ -1,6 +1,6 @@ server { listen 80; - server_name cloud.faronear.org; + server_name pan.farinear.cn; proxy_set_header X-Forwarded-For $remote_addr; diff --git a/nginx-seafile-https.conf b/nginx-seafile-https.conf index 27d8d34..421788d 100644 --- a/nginx-seafile-https.conf +++ b/nginx-seafile-https.conf @@ -1,15 +1,15 @@ server { listen 80; - server_name cloud.faronear.org; + server_name pan.farinear.cn; rewrite ^ https://$http_host$request_uri? permanent; # force redirect http to https server_tokens off; # Enables or disables emitting nginx version on error pages and in the "Server" response header field. } server { listen 443 ssl; - ssl_certificate /etc/letsencrypt/live/cloud.faronear.org/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/cloud.faronear.org/privkey.pem; - server_name cloud.faronear.org; + ssl_certificate /etc/letsencrypt/live/pan.farinear.cn/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/pan.farinear.cn/privkey.pem; + server_name pan.farinear.cn; server_tokens off;