Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

Setup help :) #15

Closed
ghost opened this issue Jul 10, 2016 · 17 comments
Closed

Setup help :) #15

ghost opened this issue Jul 10, 2016 · 17 comments

Comments

@ghost
Copy link

ghost commented Jul 10, 2016

Hi,
i'd really love to use this docker. But i am not used to properly link docker containers. And not familiar with reverse proxy stuff
Can u help me :) ? This is my compose.yml

image: wonderfall/nextcloud
  links:
    - db_nextcloud:db_nextcloud
  environment:
    - UID=1000
    - GID=1000
  ports:
    - "8000:80"
    - "4430:443"
  volumes:
    - /data/media/19ad4901-a651-4001-9306-425956e2c501/Cloud/data:/data
    - /root/.nextcloud/config:/config
    - /root/.nextcloud/apps:/apps2

db_nextcloud:
  image: mariadb:10
  volumes:
    - /root/.nextcloud/db:/var/lib/mysql
  environment:
    - MYSQL_ROOT_PASSWORD=secret
    - MYSQL_DATABASE=nextcloud
    - MYSQL_USER=nextcloud
    - MYSQL_PASSWORD=secret

nginx:
  image: wonderfall/nginx
  container_name: nginx
  links:
    - nextcloud:nextcloud
  ports:
    - "80:8000"
    - "443:4430"
  volumes:
    - /root/.nginx/sites-enabled:/sites-enabled
    - /root/.nginx/conf:/conf.d
    - /root/.nginx/log:/var/log/nginx
    - /root/.nginx/certs:/certs
@ghost ghost changed the title Setu help :) Setup help :) Jul 10, 2016
@Wonderfall
Copy link
Owner

Hi, thanks for your interest.
What are you trying to with the nextcloud container ? It is useless to bind ports here, you can remove this. Concerning the nginx container, supposing you'd like to use this method, all you have to do is create a nextcloud.conf virtual host file at /root/.nginx/sites-enabled. You can find there an example on how to do that : https://github.com/hardware/mailserver/wiki/Reverse-proxy-configuration

@ghost
Copy link
Author

ghost commented Jul 11, 2016

Okay. got it to work!
Now i have a problem with max size.
i cant change it in webgui - it isnt persistance.
i want to access the docker to change .htaccess or php.ini to make it persistant.
but when i run docker exec -it nextcloud_nextcloud_1 /bin/bashi get this error:
rpc error: code = 2 desc = "oci runtime error: exec failed: exec: \"/bin/bash\": stat /bin/bash: no such file or directory"root@NAS:~/

how can i resolve this issue ?

@Wonderfall
Copy link
Owner

There's no bash in the container, instead you can use sh and vi for editing.
To make it simple, for now, I've just increased the max upload size limit to 10 GB. It should be enough in most cases.

@ghost
Copy link
Author

ghost commented Jul 12, 2016

Okay updated and got 10gb in Webui.
Still having client issues
server replied - Request entity too large

@ghost
Copy link
Author

ghost commented Jul 12, 2016

is it the reverse proxy thats causing this issue?

@Wonderfall
Copy link
Owner

Wonderfall commented Jul 12, 2016

I think so, please increase client_max_body_size to 10G for example, if you're using nginx.

@willtho89
Copy link
Contributor

@Wonderfall, just a quick note: Increasing the client_max_body_size to 10G might not be a good idea. This opens a possible vector for a ddos attack.

A better solution would be to default to 513MB (or 1GB) and add an env variable to this container. I can make a PR if you wish

@Wonderfall
Copy link
Owner

Wonderfall commented Jul 12, 2016

Hi @reldeiS, I was talking about the reverse proxy. Since we're using the latter, I don't really see why that would be a security concern with the container. client_max_body_size is also effective on the reverse proxy side, so that's definitely up to you (in his case, it's necessary to increase the default value). Or perhaps I misunderstood you.

@willtho89
Copy link
Contributor

Sorry misunderstanding. You increased the post_max_sizeand upload_max_filesize for nextcloud to 10Gb. I think the default value for uploads should be lower to decrease the attack vector for ddos attacks.

If someone really needs a higher value you could set an ENV like -e UPLOAD_SIZE=10G

@Wonderfall
Copy link
Owner

Wonderfall commented Jul 12, 2016

I meant that somehow, client_max_body_size (set on the reverse proxy) set the limit and prevent the problem. So if someone needs a value, he just needs to increase client_max_body_size on the reverse proxy. Usually, that value is low by default (at least with nginx).

Your solution is easy to make. I just wonder if it's worth it and not redundant.

@willtho89
Copy link
Contributor

Sure if everyone is using a sane proxy config, the proxy should handle it.

But in my limited experience its best to keep potentially "dangerous" settings to default for the average user. E.g. someone might use a different proxy and may rely on owncloud/nextcloud default settings. Or uploading gigabytes of data to a raspberry with encryption enabled would slow it down noticeably.

But as you said, an environment setting with a default value is not hard to implement and gives users an easy way to fit nextcloud better to their needs. In the end its your call 😊

@ghost
Copy link
Author

ghost commented Jul 12, 2016

another issue now.
sabre/dav/exception forbidden

@Wonderfall
Copy link
Owner

@reldeiS : Okay. I'm gonna do this.

@Gutz-Pilz : Where did you get this one?

@ghost
Copy link
Author

ghost commented Jul 12, 2016

on my mac owncloud client.
when i am trying to sync
12.07.16 20:48:49,01_Cloud/Studium/3. Semester/Character/xxx,Blacklisting fortsetzen: Error downloading server replied sabre/dav/exception forbidden

@Wonderfall
Copy link
Owner

Wonderfall commented Jul 12, 2016

Please send a paste of the following files :

  • reverse-proxy virtual host
  • owncloud.log (under /data)

I'll try to reproduce using OS X and a nextcloud client (replace the owncloud one with the latter just in case).

@ghost
Copy link
Author

ghost commented Jul 12, 2016

u mean proxy-params ?

proxy_set_header        Host                 $host;
proxy_set_header        X-Real-IP            $remote_addr;
proxy_set_header        X-Forwarded-For      $proxy_add_x_forwarded_for;
proxy_set_header        X-Remote-Port        $remote_port;
proxy_set_header        X-Forwarded-Proto    $scheme;
proxy_redirect          off;

nextcloud.conf in sites-enabled

server {

  listen 8000;
  server_name cl..xxx.com;
  return 301 https://$host$request_uri;
  client_max_body_size 20G;

}

server {

  listen 4430 ssl http2;
  server_name cxxcxxc.com;
  client_max_body_size 20G;
  ssl_certificate /certs/fullchain.pem;
  ssl_certificate_key /certs/privkey.pem;

  include /conf.d/ssl_params.conf;
  include /conf.d/headers.conf;

  location / {
    proxy_pass http://nextcloud;
    include /conf.d/proxy-params.conf;
  }

}

snippet of owncloud.log
{"reqId":"NEyyfK8f8w6xGJr6CQ7g","remoteAddr":"172.17.0.6","app":"webdav","message":"Exception: {\"Message\":\"HTTP\\\/1.1 400 expected filesize 553231 got 229376\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\BadRequest\",\"Code\":0,\"Trace\":\"#0 \\\/nextcloud\\\/apps\\\/dav\\\/lib\\\/connector\\\/sabre\\\/directory.php(134): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File->put(Resource id #47)\\n#1 \\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(1036): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Directory->createFile('IMG_1256.JPG', Resource id #47)\\n#2 \\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(523): Sabre\\\\DAV\\\\Server->createFile('10_iPhone-Bilde...', Resource id #47, NULL)\\n#3 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpPut(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#4 \\\/nextcloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#5 \\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(459): Sabre\\\\Event\\\\EventEmitter->emit('method:PUT', Array)\\n#6 \\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(248): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#7 \\\/nextcloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(55): Sabre\\\\DAV\\\\Server->exec()\\n#8 \\\/nextcloud\\\/remote.php(138): require_once('\\\/nextcloud\\\/apps...')\\n#9 {main}\",\"File\":\"\\\/nextcloud\\\/apps\\\/dav\\\/lib\\\/connector\\\/sabre\\\/file.php\",\"Line\":149,\"User\":\"Hannes\"}","level":4,"time":"2016-07-12T10:14:44+00:00","method":"PUT","url":"\/remote.php\/webdav\/10_iPhone-Bilder\/IMG_1256.JPG","user":"Hannes"}

@Wonderfall
Copy link
Owner

Couldn't reproduce it. Is is resolved?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants