Cambios para el documento Instalacion (docker)

Última modificación por dFa el 2025/02/24 10:01

Desde la versión 3.1
editado por dFa
el 2025/02/22 09:29
Cambiar el comentario: No hay comentario para esta versión
Hasta la versión 8.2
editado por dFa
el 2025/02/22 09:45
Cambiar el comentario: No hay comentario para esta versión

Resumen

Detalles

Propiedades de página
Contenido
... ... @@ -8,6 +8,9 @@
8 8  )))
9 9  )))
10 10  
11 +----
12 +
13 +
11 11  {{toc/}}
12 12  
13 13  (% class="row" %)
... ... @@ -14,6 +14,8 @@
14 14  (((
15 15  (% class="col-xs-12 col-sm-8" %)
16 16  (((
20 +----
21 +
17 17  = INICIO =
18 18  
19 19  == Instalación ==
... ... @@ -106,13 +106,231 @@
106 106  
107 107  Además, en este caso, se ha realizado un bind de nuestro disco /datos para que sea utilizado como punto de montaje en nextcloud. Dado que es un contenedor, es necesario mapearlo para que la interfaz web tenga acceso al recurso de alguna manera.
108 108  
114 +Desplegamos los contenedores:
109 109  
116 +[[image:1740216653242-590.png]]
110 110  
111 -
118 +Y vemos que se han creado los volumenes correctamente:
119 +
120 +[[image:1740216641833-376.png]]
121 +
122 +== Configuración ==
123 +
124 +Con los volumenes creados, todavía nextcloud no es accesible, dado que debemos configurar tanto el config.php como como el nginx.conf.
125 +
126 +=== nginx.conf ===
127 +
128 +El fichero nginx.conf se encuentra en el volumen nextcloud_nginx_conf. Realizamos previamente un backup y reemplazamos por el siguiente:
129 +
130 +{{code language="yaml"}}
131 +worker_processes auto;
132 +
133 +error_log /var/log/nginx/error.log warn;
134 +pid /var/run/nginx.pid;
135 +
136 +events {
137 + worker_connections 1024;
138 +}
139 +
140 +http {
141 + include mime.types;
142 + default_type application/octet-stream;
143 + types {
144 + text/javascript mjs;
145 + application/wasm wasm;
146 + }
147 +
148 + log_format main '$remote_addr - $remote_user [$time_local] "$request" '
149 + '$status $body_bytes_sent "$http_referer" '
150 + '"$http_user_agent" "$http_x_forwarded_for"';
151 +
152 + access_log /var/log/nginx/access.log main;
153 +
154 + sendfile on;
155 + keepalive_timeout 65;
156 +
157 + # Define asset_immutable variable properly
158 + map $arg_v $asset_immutable {
159 + default "";
160 + "" ", immutable";
161 + }
162 +
163 + upstream php-handler {
164 + server app:9000;
165 + }
166 +
167 + server {
168 + listen 80;
169 +
170 + client_max_body_size 512M;
171 + client_body_timeout 300s;
172 + fastcgi_buffers 64 4K;
173 +
174 + client_body_buffer_size 512k;
175 +
176 + gzip on;
177 + gzip_vary on;
178 + gzip_comp_level 4;
179 + gzip_min_length 256;
180 + gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
181 + gzip_types application/atom+xml text/javascript application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/wasm application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
182 +
183 + add_header Referrer-Policy "no-referrer" always;
184 + add_header X-Content-Type-Options "nosniff" always;
185 + add_header X-Frame-Options "SAMEORIGIN" always;
186 + add_header X-Permitted-Cross-Domain-Policies "none" always;
187 + add_header X-Robots-Tag "noindex, nofollow" always;
188 + add_header X-XSS-Protection "1; mode=block" always;
189 +
190 + fastcgi_hide_header X-Powered-By;
191 +
192 + root /var/www/html;
193 +
194 + index index.php index.html /index.php$request_uri;
195 +
196 + location = / {
197 + if ( $http_user_agent ~ ^DavClnt ) {
198 + return 302 /remote.php/webdav/$is_args$args;
199 + }
200 + }
201 +
202 + location = /robots.txt {
203 + allow all;
204 + log_not_found off;
205 + access_log off;
206 + }
207 +
208 + location ^~ /.well-known {
209 + location = /.well-known/carddav { return 301 /remote.php/dav/; }
210 + location = /.well-known/caldav { return 301 /remote.php/dav/; }
211 + location /.well-known/acme-challenge { try_files $uri $uri/ =404; }
212 + location /.well-known/pki-validation { try_files $uri $uri/ =404; }
213 + return 301 /index.php$request_uri;
214 + }
215 +
216 + location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/) { return 404; }
217 + location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; }
218 +
219 + location ~ \.php(?:$|/) {
220 + rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|.+\/richdocumentscode(_arm64)?\/proxy) /index.php$request_uri;
221 +
222 + fastcgi_split_path_info ^(.+?\.php)(/.*)$;
223 + set $path_info $fastcgi_path_info;
224 +
225 + try_files $fastcgi_script_name =404;
226 +
227 + include fastcgi_params;
228 + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
229 + fastcgi_param PATH_INFO $path_info;
230 + fastcgi_param HTTPS on;
231 +
232 + fastcgi_param modHeadersAvailable true;
233 + fastcgi_param front_controller_active true;
234 + fastcgi_pass php-handler;
235 +
236 + fastcgi_intercept_errors on;
237 + fastcgi_request_buffering off;
238 +
239 + fastcgi_max_temp_file_size 0;
240 + }
241 +
242 + location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac)$ {
243 + try_files $uri /index.php$request_uri;
244 + add_header Cache-Control "public, max-age=15778463$asset_immutable";
245 + access_log off;
246 + }
247 +
248 + location ~ \.wasm$ {
249 + default_type application/wasm;
250 + }
251 +
252 + location /remote {
253 + return 301 /remote.php$request_uri;
254 + }
255 +
256 + location / {
257 + try_files $uri $uri/ /index.php$request_uri;
258 + }
259 + }
260 +}
261 +{{/code}}
262 +
263 +=== config.php ===
264 +
265 +Hacemos lo mismo con el fichero config.php que se encuentra en el volumen app dentro del directorio config:
266 +
267 +{{code language="php"}}
268 +<?php
269 +$CONFIG = array (
270 + 'memcache.local' => '\\OC\\Memcache\\APCu',
271 + 'apps_paths' =>
272 + array (
273 + 0 =>
274 + array (
275 + 'path' => '/var/www/html/apps',
276 + 'url' => '/apps',
277 + 'writable' => true,
278 + ),
279 + 1 =>
280 + array (
281 + 'path' => '/var/www/html/custom_apps',
282 + 'url' => '/custom_apps',
283 + 'writable' => true,
284 + ),
285 + ),
286 + 'memcache.distributed' => '\\OC\\Memcache\\Redis',
287 + 'memcache.locking' => '\\OC\\Memcache\\Redis',
288 + 'redis' =>
289 + array (
290 + 'host' => 'redis',
291 + 'password' => '',
292 + 'port' => 6379,
293 + ),
294 + 'upgrade.disable-web' => true,
295 + 'instanceid' => 'ocxuwrcpcats',
296 + 'passwordsalt' => 'bFuPjx3NMpliQCtY729Uob2SRp19xe',
297 + 'secret' => 'eFMG77LAdbjw6oPSJM7hL/IDPBnP3qDxE7xlX6/uPMOvQ/kG',
298 + 'trusted_domains' =>
299 + array (
300 + 0 => '10.100.200.35:8080',
301 + 1 => 'dfacloud.ddns.net',
302 +
303 + ),
304 + 'datadirectory' => '/var/nextcloud/data',
305 + 'dbtype' => 'mysql',
306 + 'version' => '30.0.6.2',
307 + 'overwrite.cli.url' => 'https://dfacloud.ddns.net',
308 + 'dbname' => 'nextcloud',
309 + 'dbhost' => 'db',
310 + 'dbport' => '',
311 + 'dbtableprefix' => 'oc_',
312 + 'mysql.utf8mb4' => true,
313 + 'dbuser' => 'nextcloud',
314 + 'dbpassword' => 'Ko5b0sq977j1saaCQ3SD55',
315 + 'installed' => true,
316 +);
317 +{{/code}}
318 +
319 +En este fichero php tendremos que tener en cuenta modificar los valores nuestra dirección ip:puerto y nuestra dns en consecuencia.
320 +
321 +=== Permisos ===
322 +
323 +Es importante tener en cuenta los permisos de los directorios, sobre todo los directorios de datos y perfiles de usuarios.
324 +
325 +En nuestro caso hemos montado el perfil de usuario en un directorio distinto dado que es una recomendación de seguridad de nextcloud, y además hemos expuesto nuestro disco /datos montando en el host anfitrión al contenedor, por lo que es posible que tengamos que revisar los permisos.
326 +
327 +El usuario y grupo desde el host anfitrión en nuestro caso son:
328 +
329 +* user: 33 (www-data)
330 +* group: tape (www-data)
331 +
332 +Hemos ajustado el compose para que se adapten estos permisos de forma automática, no obstante es importante revisarles si nextcloud indica algún problema de permisos.
112 112  )))
113 113  
114 114  
115 115  
337 +
338 +
116 116  (% class="col-xs-12 col-sm-4" %)
117 117  (((
118 118  
1740216568396-284.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.dFa
Tamaño
... ... @@ -1,0 +1,1 @@
1 +19.9 KB
Contenido
1740216585269-265.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.dFa
Tamaño
... ... @@ -1,0 +1,1 @@
1 +19.9 KB
Contenido
1740216587698-323.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.dFa
Tamaño
... ... @@ -1,0 +1,1 @@
1 +19.9 KB
Contenido
1740216603834-462.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.dFa
Tamaño
... ... @@ -1,0 +1,1 @@
1 +21.8 KB
Contenido
1740216641833-376.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.dFa
Tamaño
... ... @@ -1,0 +1,1 @@
1 +4.6 KB
Contenido
1740216653242-590.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.dFa
Tamaño
... ... @@ -1,0 +1,1 @@
1 +19.9 KB
Contenido