Add validation for `max_attachment_size` in `ApplicationSetting`
New description:
We should add validator for max_attachment_size
in ApplicationSetting
, currently it is possible to use negative or zero value there.
Old description:
Summary
Unable to post any comment in Gitlab 8.4.3
Steps to reproduce
- Open any issue
- Try to add comment
Expected behavior
- Comment should be saved
Relevant logs and/or screenshots
The response that is being send to http://gitlab/php/some-test-project/notes returns the JSON bellow but there is no attachment added to the comment.
{"valid":false,"award":false,"errors":{"attachment":["is too big (should be at most -8388608 Bytes)"]}}
Post data:
utf8:✓
authenticity_token: *some token* - replaced in case it is a security issue
view:inline
line_type:
target_type:commit
target_id: *some id* - replaced in case it is a security issue
note[commit_id]: *some id* - replaced in case it is a security issue
note[noteable_id]:
note[noteable_type]:Commit
note[note]:Test comment
commit:Add Comment
Output of checks
Results of GitLab Application Check
Checking GitLab Shell ...
GitLab Shell version >= 2.6.10 ? ... OK (2.6.10)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
hooks directories in repos are links: ...
3/2 ... ok
3/3 ... ok
4/4 ... ok
5/5 ... repository is empty
5/6 ... repository is empty
3/8 ... repository is empty
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
/var/opt/gitlab/git-data/repositories: OK
/var/opt/gitlab/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.8.21
Send ping to redis server: PONG
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
LDAP users with access to your GitLab server (only showing the first 100 results)
Server: ldapmain
* user accounts * - removed for privacy issues
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... yes
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ...
3/2 ... yes
3/3 ... yes
4/4 ... yes
5/5 ... yes
5/6 ... yes
3/8 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.1.8)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 1.7.10 ? ... yes (2.6.2)
Active users: 5
Checking GitLab ... Finished
Results of GitLab Environment Info
System information
System:
Current User: git
Using RVM: no
Ruby Version: 2.1.8p440
Gem Version: 2.5.1
Bundler Version:1.10.6
Rake Version: 10.5.0
Sidekiq Version:4.0.1
GitLab information
Version: 8.4.3
Revision: eb6f691
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: http://gitlab
HTTP Clone URL: http://gitlab/some-group/some-project.git
SSH Clone URL: git@gitlab:some-group/some-project.git
Using LDAP: yes
Using Omniauth: no
GitLab Shell
Version: 2.6.10
Repositories: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git: /opt/gitlab/embedded/bin/git
Possible fixes
N/A