Phabricator: setup local-disk upload limit? - phabricator

I'm going to upload files in Phabricator according to this manual. But I find there's a limit 8M for local-disk storage engine in "$your_site/applications/view/PhabricatorFilesApplication/" .
I've already set client_max_body_size 64M in vhost server block for nginx.
Also, post_max_size = 64M, upload_max_filezie = 64M for php.
Then, restart nginx, php-fpm service.
But Phabricator still prints out
No configured storage engine can store this file. See "Configuring File Storage" in the documentation for information on configuring storage engines.
when I upload a file which size exceeds 8M.
Also, there's no storage.local-disk.max-size configuration key.
How can I custom local-disk upload limit?
Phabricator 535c1a5, libphutil aa6cd8f

None of the engines support more than 8MB. Larger files are stored by chunking them client-side and uploading the chunks (the chunk size is currently 4MB).
Apparently, chunking only works with drag-and-drop - try that instead of using the file upload form.

According to the guideline: https://secure.phabricator.com/book/phabricator/article/configuring_file_storage/
After configure nginx and php, you need enable Engine: MySQL and Engine: Local Disk:
First of all go to the phabricator directory which you clone from https://github.com/phacility/phabricator.git
1. Engine: MySQL
phabricator/ $ ./bin/config set storage.mysql-engine.max-size 8388608
2. Engine: Local Disk
phabricator/ $ ./bin/config set storage.local-disk.path /path/to/store/phabricator/files

Related

Nginx always return Empty reply from server during creating cache file

Nginx i am trying to use fast_cgi_cache, but it always returns empty reply from server during make some cache files.
If there aren't cache file then return always empty reply from server, and after a few seconds, then make some cache file(in tmp directory) and works corretly.
There are ways to remove empty reply with cache?
I solved this prbolem.
just added use_temp_path=off to nginx fastcgi cache path.
NGINX first writes files that are destined for the cache to a temporary storage
area, and the use_temp_path=off directive instructs NGINX to write them to the
same directories where they will be cached. We recommend that you set this
parameter to off to avoid unnecessary copying of data between file systems.
use_temp_path was introduced in NGINX version 1.7.10 and NGINX Plus R6.
https://www.nginx.com/blog/nginx-caching-guide/

Trying to set file upload limit in mup/nginx-proxy

I am running into a file upload error with files > 10M. I have followed the advice here: http://meteor-up.com/docs.html#advanced-configuration which says how to set it in the nginx proxy by setting the clientUploadLimit: '50M'
I pushed the changes using mup proxy reconfig-shared, and it told me it had restarted the proxy. It didn't work, I still get the 413 (Request Entity Too Large) error.
I checked inside the nginx-proxy docker instance, and the file /etc/nginx/conf.d/my_proxy.conf has the correct entry client_max_body_size 50M. I restarted the EC2 box to make sure, but it's still not working.
This article https://www.tecmint.com/limit-file-upload-size-in-nginx/ suggests that the setting needs to go inside a http block, like this:
By default, Nginx has a limit of 1MB on file uploads. To set file upload size, you can use the client_max_body_size directive, which is part of Nginx’s ngx_http_core_module module. This directive can be set in the http, server or location context.
http {
client_max_body_size 100M;
}
I can't see how to achieve this, as the .conf file is read only and somehow locked.
Any ideas on how to proceed?
I suppose I could try a custom nginx.conf file, but I'm not sure what should go in there, and in fact whether it will even improve the situation.
Any help is appreciated :)
I'm happy to report that I solved it... I will explain how.
I was setting the limit in the nginx reverse proxy in the mup.js file
proxy: {
domains: 'website.com,www.website.com',
shared: { clientUploadLimit: '50M' }
}
But it turns out that there is an option to set it for each independent server like this:
proxy: {
domains: 'website.com,www.website.com',
clientUploadLimit: '50M'
}
The limit was being set to 10M by default. I found it by shelling into the nginx-proxy docker image and doing a search with the command grep -R client_max_body_size /etc/nginx and it showed me all the places where it was set (for each vhost)
So I changed the mup.js file for my server, did a mup stop, and a mup setup (to re-do the settings) and then a mup deploy
Now this is speculation but have you tried going to the docker container's root shell changed the permissions to give write permission to root or your user chmod 760 /etc/nginx/nginx.conf and edit the nginx file there?

Docker Per-Container Disk Quota on Bind Mounted Volumes

I am trying to create a simple hosting platform for my clients. I am deploying all of my apps via docker on a VPS behind nginx-proxy. For wordpress applications I want to be able to limit disk-space so that my clients do not use too much and affect other applications. I bind mount all volumes to a single directory so that I can back-up easily with cron.
I've change the file system to overlay2 and am on centos 7.
[root#my-ip ~]# docker info
Server:
Containers: 12
Running: 12
Paused: 0
Stopped: 0
Images: 11
Server Version: 19.03.1
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
When I run a wordpress container with the --storage-opt size=10G I get the following error:
docker: Error response from daemon: --storage-opt is supported only for overlay over xfs with 'pquota' mount option.
This is an example of the bind mount I am using:
-v /DOCKER_VOLUMES/wordpress/appname/www/html:/var/www/html
How do I fix this? Can you please provide a full list of instructions to enable it?
from the Docs:
This (size) will allow to set the container rootfs size to 120G at creation time. This option is only available for the devicemapper, btrfs, overlay2, windowsfilter and zfs graph drivers. For the devicemapper, btrfs, windowsfilter and zfs graph drivers, user cannot pass a size less than the Default BaseFS Size. For the overlay2 storage driver, the size option is only available if the backing fs is xfs and mounted with the pquota mount option. Under these conditions, user can pass any size less than the backing fs size.
so the pquota should be enabled on your system
you can edit the file /etc/default/grub like so, and restart your machine:
GRUB_CMDLINE_LINUX_DEFAULT="rootflags=uquota,pquota"
and try to rerun your command with --storage-opt size=10G

Alternate max_post_size and upload_max_filesize for different subdomains and/or directories php.ini nginx fastcgi php-fpm

I have nginx and php5-fpm working wonderfully, and www.mysite.com, this.mysite.com, and that.mysite.com all go to different directories elegantly. I have been working on a site for uploading files. I'd like the maximum file size to be 10 GB. For this to work, I have to tell php.ini that max_post_size and upload_max_filesize are 10240 MB instead of the default 2 MB.
I am well aware of the security implications. I would therefore like those php.ini values of 10240 MB to apply ONLY to one or both of:
upload.mysite.com
and/or
www.mysite.com/upload
One option is to also install Apache to listen on a different port, do some redirect/rewrite magic, and have mod_php's php.ini file with the 10240 MB values handle only the uploads site. I'd prefer to not do that.
WITHOUT having a separate web server handle requests to my upload page, how can I accomplish this in a single instance of nginx?
Use client_max_body_size and set it to the desired value in your server blocks. Nginx will directly drop the handling of the request if the request body exceeds the size specified in this directive. Please note that you won't get any POST submitted in that case.
With php-fpm you can have several pools running, one for each website.
Then you can alter any php.ini setting inside the pool configuration (but be carefull, you cannot use MB or G shortcuts), using this syntax inside the pool:
; UPLOAD
php_admin_flag[file_uploads] =1
php_admin_value[upload_tmp_dir]="/some/path/var/tmp"
;Maximum allowed size for uploaded files. 10240MB *1024 *1024 -> 10737418240
php_value[upload_max_filesize] ="10737418240"
php_admin_value[max_input_time] = (...)
php_admin_value[post_max_size] (...)
This is really near the available syntax for Apache virtualhosts. PHP configuration has never been stuck in php.ini files.
As you can see you can use php_value or php_admin_value, the big difference is that when using php_value the setting can later be altered by the application, using ini_set command. So you could use a low value for upload_max_filesize and alter it in the application only on the upload script.

Internal Server Error in nginx when uploading bigger files greater than 15MB

I am using parallel plesk 11 , and there is service of nginx as reverse proxy server and i am using that , Whenever i try to upload the file size greater than 15MB it gives internal server error. I am not able to find out the problem that is causing this issue.
I am providing the php.ini settings. After checking do tell me any solution, its very urgent to know it is affecting my server services.
I am running php as fastcgi and
settings are
post_max_size 200M
upload_max_filesize 450M
memeory_limit 32M
safe_mode on
The error happened due to httpmaxrequest length error . Which was due to mod_fcgid of apache,
so i changed the fcgid.conf present in /etc/apache2/mods-available/fcgid.conf
Also this file has to be changed for proper working of uploading in parallel plesk.
MaxRequestLen in /usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php
And After that reconfigure the domain Reconfigure domains: /usr/local/psa/admin/bin/httpdmng --reconfigure-all
Restart Both nginx and apache
service nginx restart
service apache2 restart
Than everything will work fine , Uploading this way can be done. And this is major problem which happens in ubuntu 10.10 running parallel plesk 11.

Resources