1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2024-12-26 17:38:21 +01:00
antd-web-apps/get/shs/antos.sh

115 lines
3.1 KiB
Bash
Raw Normal View History

2020-11-19 18:09:39 +01:00
#! /bin/bash
set -e
2020-11-19 18:54:09 +01:00
2021-03-15 20:52:18 +01:00
V_ANTD="1.0.6b"
V_LUA="0.5.2b"
2022-07-06 10:50:44 +02:00
#V_WTERM="1.0.0b"
2022-02-23 09:59:38 +01:00
V_TUNNEL="0.1.3b"
2022-07-06 10:50:44 +02:00
#V_CGI="1.0.0b"
2022-02-23 09:59:38 +01:00
V_PUBS="0.1.2a"
2022-07-06 10:50:44 +02:00
V_ANTOS=$(wget -qO- https://github.com/lxsang/antos/raw/1.2.1/release/latest)
2021-03-15 20:52:18 +01:00
2020-11-19 18:09:39 +01:00
mkdir -p /opt/www/htdocs
2020-12-25 22:34:21 +01:00
if [ "$1" = "full" ]; then
# base server
2021-03-15 20:52:18 +01:00
wget -O- https://get.iohub.dev/antd | bash -s "$V_ANTD"
2020-12-25 22:34:21 +01:00
# base plugin
2021-03-15 20:52:18 +01:00
wget -O- https://get.iohub.dev/antd_plugin | bash -s "lua-$V_LUA"
2022-07-06 10:50:44 +02:00
#wget -O- https://get.iohub.dev/antd_plugin | bash -s "wterm-$V_WTERM"
2021-03-15 20:52:18 +01:00
wget -O- https://get.iohub.dev/antd_plugin | bash -s "tunnel-$V_TUNNEL"
2022-07-06 10:50:44 +02:00
#wget -O- https://get.iohub.dev/antd_plugin | bash -s "cgi-$V_CGI"
2020-12-25 22:34:21 +01:00
# install antos
[ -d /tmp/apub ] && rm -r /tmp/apub
mkdir -p /tmp/apub
cd /tmp/apub
2021-03-15 20:52:18 +01:00
wget --no-check-certificate "https://github.com/lxsang/antd-tunnel-publishers/raw/master/dist/antd-publishers-$V_PUBS.tar.gz"
tar xvzf antd-publishers-$V_PUBS.tar.gz
cd antd-publishers-$V_PUBS
2020-12-25 22:34:21 +01:00
./configure --prefix=/opt/www && make && make install
cd /opt/www
# create the configuration file
cat << EOF > config.ini
2020-11-19 18:54:09 +01:00
[SERVER]
plugins=/opt/www/lib/
plugins_ext=.so
database=/opt/www/database/
tmpdir=/opt/www/tmp/
statistic_fifo=/opt/www/tmp/antd_stat
maxcon=200
backlog=5000
workers = 4
max_upload_size = 10000000
ssl.cert=/opt/www/server.crt
ssl.key=/opt/www/server.key
ssl.cipher=ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256
gzip_enable = 1
gzip_types = text\/.*,.*\/css,.*\/json,.*\/javascript
[PORT:443]
htdocs=/opt/www/htdocs
ssl.enable=1
^\/os\/+(.*)$ = /os/router.lua?r=<1>&<query>
[AUTOSTART]
plugin = tunnel
2020-11-19 18:09:39 +01:00
2020-11-19 18:54:09 +01:00
[MIMES]
image/bmp=bmp
image/jpeg=jpg,jpeg
text/css=css
text/markdown=md
text/csv=csv
application/pdf=pdf
image/gif=gif
text/html=html,htm,chtml
application/json=json
application/javascript=js
image/png=png
image/x-portable-pixmap=ppm
application/x-rar-compressed=rar
image/tiff=tiff
application/x-tar=tar
text/plain=txt
application/x-font-ttf=ttf
application/xhtml+xml=xhtml
application/xml=xml
application/zip=zip
image/svg+xml=svg
application/vnd.ms-fontobject=eot
application/x-font-woff=woff,woff2
application/x-font-otf=otf
audio/mpeg=mp3,mpeg
[FILEHANDLER]
ls = lua
lua = lua
EOF
2020-12-25 22:34:21 +01:00
# generate cert
openssl genrsa -des3 -passout pass:1234 -out keypair.key 2048
openssl rsa -passin pass:1234 -in keypair.key -out server.key
openssl req -new -subj '/C=FR' -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
fi
2020-11-19 18:54:09 +01:00
cd /opt/www/htdocs
2020-11-19 18:09:39 +01:00
wget --no-check-certificate "https://github.com/lxsang/antd-web-apps/raw/master/dist/antd_web_apps.tar.gz"
tar xvzf antd_web_apps.tar.gz
2020-11-19 18:54:09 +01:00
rm antd_web_apps.tar.gz
2021-03-15 20:52:18 +01:00
rm -r blog doc index.ls info talk get
2020-11-19 18:54:09 +01:00
cd /opt/www/htdocs/os
2022-07-06 10:50:44 +02:00
wget --no-check-certificate "https://github.com/lxsang/antos/raw/1.2.1/release/antos-$V_ANTOS.tar.gz"
2021-03-15 20:52:18 +01:00
tar xvzf antos-$V_ANTOS.tar.gz
rm antos-$V_ANTOS.tar.gz
2020-11-19 18:54:09 +01:00
2021-03-17 18:46:12 +01:00
echo "Install done..."