Skip to content

Commit e5403f4

Browse files
author
d1ngx
committed
add custom contents
1 parent 0b60ccb commit e5403f4

File tree

5 files changed

+76
-3
lines changed

5 files changed

+76
-3
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fonts/
2+
officeData/
3+
*.zip

Dockerfile

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=nonint
1010
ARG ONLYOFFICE_VALUE=onlyoffice
1111

1212
RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \
13+
sed -i 's/archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list && \
1314
apt-get -y update && \
1415
apt-get -yq install wget apt-transport-https gnupg locales lsb-release && \
1516
locale-gen en_US.UTF-8 && \
@@ -49,7 +50,10 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \
4950
supervisor \
5051
ttf-mscorefonts-installer \
5152
xvfb \
52-
zlib1g && \
53+
zlib1g \
54+
vim \
55+
php-fpm \
56+
php-curl && \
5357
if [ $(ls -l /usr/share/fonts/truetype/msttcorefonts | wc -l) -ne 61 ]; \
5458
then echo 'msttcorefonts failed to download'; exit 1; fi && \
5559
echo "SERVER_ADDITIONAL_ERL_ARGS=\"+S 1:1\"" | tee -a /etc/rabbitmq/rabbitmq-env.conf && \
@@ -96,7 +100,18 @@ RUN PACKAGE_FILE="${COMPANY_NAME}-${PRODUCT_NAME}${PRODUCT_EDITION}${PACKAGE_VER
96100
chmod 755 /app/ds/*.sh && \
97101
rm -f /tmp/$PACKAGE_FILE && \
98102
rm -rf /var/log/$COMPANY_NAME && \
99-
rm -rf /var/lib/apt/lists/*
103+
rm -rf /var/lib/apt/lists/* && \
104+
# rm -rf /var/www/onlyoffice/documentserver/{core-fonts,fonts,sdkjs,sdkjs-plugins,web-apps}
105+
rm -rf /var/www/onlyoffice/documentserver/core-fonts && \
106+
rm -rf /var/www/onlyoffice/documentserver/fonts && \
107+
rm -rf /var/www/onlyoffice/documentserver/sdkjs && \
108+
rm -rf /var/www/onlyoffice/documentserver/sdkjs-plugins && \
109+
rm -rf /var/www/onlyoffice/documentserver/web-apps
110+
111+
COPY officeData/web/ /var/www/onlyoffice/documentserver/
112+
COPY Fonts/ /var/www/onlyoffice/documentserver/core-fonts/
113+
COPY nginx/ds-kod-include.conf /etc/nginx/includes/
114+
COPY nginx/ds-kod-server.conf /etc/nginx/conf.d/
100115

101116
VOLUME /var/log/$COMPANY_NAME /var/lib/$COMPANY_NAME /var/www/$COMPANY_NAME/Data /var/lib/postgresql /var/lib/rabbitmq /var/lib/redis /usr/share/fonts/truetype/custom
102117

nginx/ds-kod-include.conf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
location ^~ /web/ {
2+
proxy_pass http://localhost:85/;
3+
proxy_http_version 1.1;
4+
proxy_cache_key $host$uri$is_args$args;
5+
proxy_set_header Host $host;
6+
proxy_set_header X-Real-IP $remote_addr;
7+
proxy_set_header X-Forwarded-Proto $scheme;
8+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
9+
proxy_set_header Range $http_range;
10+
proxy_set_header If-Range $http_if_range;
11+
proxy_set_header Upgrade $http_upgrade;
12+
proxy_set_header Connection "upgrade";
13+
}

nginx/ds-kod-server.conf

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
## 覆盖 /etc/nginx/includes/ds-kod-include.conf /etc/nginx/conf.d/ds-kod-server.conf
3+
server {
4+
listen 85;
5+
index index.html index.htm index.php;
6+
root /var/www/onlyoffice/documentserver;
7+
sendfile off;
8+
location ~ .*\.(gif|jpg|png|htm|html|css|js|flv|ico|swf|wasm|xml)$ {
9+
proxy_cache_key $host$uri$is_args$args;
10+
access_log off;
11+
gzip on;
12+
gzip_static off;
13+
gzip_min_length 1k;
14+
gzip_buffers 4 16k;
15+
gzip_comp_level 2;
16+
gzip_types text/plain application/x-javascript text/css application/xml text/javascript image/jpeg image/gif image/png application/json application/javascript application/wasm;
17+
gzip_vary on;
18+
gzip_disable "MSIE [1-6]\.";
19+
expires 30d;
20+
}
21+
location ~ \.php$ {
22+
#fastcgi_split_path_info ^(.+\.php)(/.+)$;
23+
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
24+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
25+
fastcgi_index index.php;
26+
include fastcgi_params;
27+
}
28+
}
29+

run-document-server.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1}
7676
# Limiting the maximum number of simultaneous connections due to possible memory shortage
7777
[ $(ulimit -n) -gt 1048576 ] && NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-1048576} || NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)}
7878

79-
JWT_ENABLED=${JWT_ENABLED:-true}
79+
JWT_ENABLED=${JWT_ENABLED:-false}
8080

8181
# validate user's vars before usinig in json
8282
if [ "${JWT_ENABLED}" == "true" ]; then
@@ -111,6 +111,7 @@ JSON_BIN=${APP_DIR}/npm/json
111111
JSON="${JSON_BIN} -q -f ${ONLYOFFICE_DEFAULT_CONFIG}"
112112
JSON_LOG="${JSON_BIN} -q -f ${ONLYOFFICE_LOG4JS_CONFIG}"
113113
JSON_EXAMPLE="${JSON_BIN} -q -f ${ONLYOFFICE_EXAMPLE_CONFIG}"
114+
JSON_DEFAULT="${JSON_BIN} -q -f /etc/onlyoffice/documentserver/default.json"
114115

115116
LOCAL_SERVICES=()
116117

@@ -331,6 +332,17 @@ update_ds_settings(){
331332
${JSON} -I -e "this.services.CoAuthoring.token.inbox.inBody = ${JWT_IN_BODY}"
332333
${JSON} -I -e "this.services.CoAuthoring.token.outbox.inBody = ${JWT_IN_BODY}"
333334

335+
${JSON_DEFAULT} -I -e "this.services.CoAuthoring.server.savetimeoutdelay = 5000"
336+
${JSON_DEFAULT} -I -e "this.services.CoAuthoring.server.limits_tempfile_upload = 504857600"
337+
338+
${JSON_DEFAULT} -I -e "this.FileConverter.converter.downloadTimeout.connectionAndInactivity = '10m'"
339+
${JSON_DEFAULT} -I -e "this.FileConverter.converter.downloadTimeout.wholeCycle = '10m'"
340+
${JSON_DEFAULT} -I -e "this.FileConverter.converter.idownloadAttemptMaxCount = 10"
341+
${JSON_DEFAULT} -I -e "this.FileConverter.converter.inputLimits[0].zip.uncompressed = '500MB'"
342+
${JSON_DEFAULT} -I -e "this.FileConverter.converter.inputLimits[1].zip.uncompressed = '500MB'"
343+
${JSON_DEFAULT} -I -e "this.FileConverter.converter.inputLimits[2].zip.uncompressed = '500MB'"
344+
${JSON_DEFAULT} -I -e "this.services.CoAuthoring['request-filtering-agent'].allowPrivateIPAddress = true"
345+
334346
if [ -f "${ONLYOFFICE_EXAMPLE_CONFIG}" ]; then
335347
${JSON_EXAMPLE} -I -e "this.server.token.enable = ${JWT_ENABLED}"
336348
${JSON_EXAMPLE} -I -e "this.server.token.secret = '${JWT_SECRET}'"
@@ -649,6 +661,7 @@ fi
649661
documentserver-static-gzip.sh ${ONLYOFFICE_DATA_CONTAINER}
650662

651663
echo "${JWT_MESSAGE}"
664+
service php8.1-fpm restart
652665

653666
tail -f /var/log/${COMPANY_NAME}/**/*.log &
654667
wait $!

0 commit comments

Comments
 (0)