Commit Graph

116 Commits

Author SHA1 Message Date
Stan Hu 84cfb33fbb Revert "Merge branch 'rs-revert-11842' into 'master'"
This reverts commit ad521bde1b, reversing
changes made to 3a38e5f1ab.
2017-06-19 09:43:01 -07:00
Robert Speicher dbddd69295 Partially revert 1e8dbd46
See https://gitlab.com/gitlab-org/gitlab-ce/issues/33736#note_32561501
2017-06-16 15:13:09 -05:00
Paul Charlton d93352825a redesign caching of application settings 2017-06-06 16:48:10 +00:00
Nick Thomas 23db8409aa Skip loading application settings from the database when migrations are pending
Various Rails initializers (metrics, sentry, etc) are run before migrations,
which can lead to a mismatch between app/models/application_settings.rb and
schema.
2017-06-02 16:02:08 +01:00
Douwe Maan 75f5fa997d Enable Rails/Delegate 2017-02-23 09:32:42 -06:00
Rémy Coutable c446cfcbae Move ApplicationSetting DEFAULTS to `.defaults` instead
This will avoid autoloading issues in the long term.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-27 16:16:55 +01:00
Rémy Coutable 765d57d650
Rescue from ActiveRecord::UnknownAttributeError and fallback to fake settings
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-23 16:58:13 +01:00
Grzegorz Bizon 632c2939bb Revert "Merge branch 'revert-9cac0317' into 'master' "
This reverts commit c20934869f, reversing
changes made to 4b7ec44b91.
2017-01-23 16:35:24 +01:00
Grzegorz Bizon baeaa97ef4 Revert "Merge branch 'dont-persist-application-settings-in-test-env' into 'master'"
This reverts merge request !8573
2017-01-21 22:55:35 +00:00
Stan Hu 8dbac708dc Revert "Merge branch 'backport-fix-load-error' into 'master'"
This reverts merge request !8671
2017-01-21 00:37:04 +00:00
Rémy Coutable aaa986c0d2
Don't define ApplicationSetting defaults in a constant
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-20 20:10:15 +01:00
Rémy Coutable f6cc29ed83 Don't persist ApplicationSetting in test env
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-15 01:07:29 -05:00
Rémy Coutable b038c53073 Move default values to ApplicationSetting::DEFAULTS and use it in CurrentSettings
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-15 01:07:29 -05:00
Horacio Sanson f986b4c4e5 Add support for PlantUML diagrams in Asciidoc.
This MR enables rendering of PlantUML diagrams in Asciidoc documents. To add a
PlantUML diagram all we need is to include a plantuml block like:

```
[plantuml, id="myDiagram", width="100px", height="100px"]
--
bob -> alice : ping
alice -> bob : pong
--
```

The plantuml block is substituted by an HTML img element with *src* pointing to
an external PlantUML server.

This MR also add a PlantUML integration section to the Administrator -> Settings
page to configure the PlantUML rendering service and to enable/disable it.

Closes: #17603
2017-01-12 10:04:52 +00:00
Rémy Coutable 103114e3d7 Rename Gogs to Gitea, DRY the controller and improve views
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-19 17:35:51 +01:00
Kim "BKC" Carlbäcker 5d4531db25 Gogs Importer 2016-12-19 17:35:51 +01:00
Stan Hu 5a65d9d53b Only turn on Sidekiq throttling if application settings exists
If the database has not been migrated properly, the initializer for Sidekiq
will fail to start and cause the whole Rails server to crash. This change
checks the existence for the column and allows Rails to start even
if the setting has not been added as a database column.

Closes #24452
2016-11-12 16:00:21 -08:00
Patricio Cano b95216aaba Allow the Sidekiq queues to throttle and the factor by which to throttle them to be configurable 2016-11-10 11:38:11 -06:00
Patricio Cano 9e2964c15a Allow certain Sidekiq jobs to be throttled 2016-11-10 11:38:10 -06:00
Grzegorz Bizon cee66810f8 Remove use of `USE_DB` environment variable in code 2016-09-23 10:50:46 +02:00
Grzegorz Bizon 52e897dd14 Update `CurrentSettings` class that uses ENV 2016-09-22 17:25:52 +02:00
Z.J. van de Weg 4c8e9a8d27 Remove gitorious 2016-08-25 10:10:10 +01:00
Gokmen Goksel a927a9bf6b Support integration with Koding (online IDE)
Koding: #index: landing page for Koding integration

If enabled it will provide a link to open remote Koding instance url
for now we are also providing the sneak preview video for how
integration works in detail.

Repository: check whether .koding.yml file exists on repository

Projects: landing page: show Run in IDE (Koding) button if repo has stack file

Projects: MR: show Run in IDE Koding button if repo has stack file on active branch

ProjectHelpers: add_koding_stack: stack generator for provided project

With this helper we will auto-generate the required stack template
for a given project. For the feature we can request this base template
from the running Koding instance on integration.

Currently this will provide users to create a t2.nano instance on aws
and it'll automatically configures the instance for basic requirements.

Projects: empty state and landing page provide shortcuts to create stack

projects_helper: use branch on checkout and provide an entry point

This ${var.koding_queryString_branch} will be replaced with the branch
provided in query string which will allow us to use same stack template
for different branches of the same repository.

ref: b8c0e43c4c

projects_helper: provide sha info in query string to use existing vms

With this change we'll be able to query existing vms on Koding side
based on the commit id that they've created.

ref: 1d630fadf3

Integration: Docs: Koding documentation added

Disable /koding route if integration is disabled

Use application settings to enable Koding

Projects_helper: better indentation with strip_heredoc usage

Projects_helper: return koding_url as is if there is no project provided

current_settings: set koding_enabled: false by default

Koding_Controller: to render not_found once integration is disabled

Dashboard_specs: update spec for Koding enabled case

Projects_Helper: make repo dynamic

ref: 4d615242f4

Updated documentation to have right format
2016-08-19 12:10:58 -07:00
Patricio Cano c71e658cca Refactor and rename `restricted_signup_domains` to `domain_whitelist` to better conform to its behavior and newly introduced behavior. 2016-07-18 17:53:43 -05:00
Dravere a0a9494e4e Added setting to set new users by default as external
As requested by the issue #14508 this adds an option in the application
settings to set newly registered users by default as external. The
default setting is set to false to stay backward compatible.
2016-07-07 19:21:18 +02:00
Stan Hu d10642a4b8 Handle case when Redis cache returns an empty setting 2016-06-29 14:28:41 -07:00
Stan Hu c600cf8348 Fix database migrations when Redis is not running
If Redis were not running or USE_DB were set to false, the
application settings retrieval would fail completely. This
change only attempts to use the cache if the system actually
wants to connect to the DB and rescues any failures in talking to
Redis.

Closes #17557
2016-06-29 14:04:59 -07:00
James Lopez 2d4556c5d2 a few changes based on MR feedback 2016-06-17 15:47:00 +02:00
James Lopez e83fc684a5 Merge branches 'feature/project-export-ui-experimental' and 'feature/project-import' of gitlab.com:gitlab-org/gitlab-ce into feature/project-export-ui-experimental
# Conflicts:
#	Gemfile.lock
#	app/helpers/todos_helper.rb
#	app/models/todo.rb
#	app/views/projects/edit.html.haml
#	lib/gitlab/import_export/import_service.rb
2016-06-13 14:00:19 +02:00
Sean McGivern 40b6d9064a Allow custom text on 'almost there' page
Add a new application setting, after_sign_up_text. This is text to be
rendered as Markdown and shown on the 'almost there' page after a user
signs up, but before they've confirmed their account.

Tweak the styles for that page so that centered lists look reasonable.
2016-06-08 19:08:53 +01:00
Douwe Maan 4a50e1f051 Merge branch 'current-settings-use-request-store-during-request' 2016-06-01 12:55:00 +02:00
Kamil Trzcinski 846d111f1d Add Application Setting to configure Container Registry token expire delay (default 5min) 2016-05-31 13:23:13 +02:00
DJ Mountney c8eb1dccab Try and use cache for application settings even when the db is not connected 2016-05-29 12:53:30 -07:00
DJ Mountney 78d8458773 Only use RequestStore for current_application_settings during a request
This fixes an issue where the RequestStore was being populated with the settings in the unicorn master
during the rails initializers. Each forked worker would then start their first request with an uncleaned RequestStore.
2016-05-27 14:28:04 -07:00
James Lopez acf297955a gitlab import UI - icon, file selector, etc... Also updated font-awesome and modified import source settings. 2016-04-22 17:44:59 +02:00
Jacob Vosmaer 97f4ffff1e Add a 'circuit breaker' for repo checks 2016-04-12 17:07:54 +02:00
connorshea 85cc172959 Remove "Congratulations!" tweet button on newly-created project.
I’ve removed everything related to the feature based on this commit:
ce08f919f34fd8849834365

Resolves #10857.
2016-03-31 17:09:36 -06:00
Jason Lee e4d276816a Fix CurrentSettings autoload bug in development.
Error: A copy of Gitlab::CurrentSettings has been removed from the module tree but is still active
2016-02-08 15:28:48 +01:00
Stan Hu d20e75a8d8 Support Akismet spam checking for creation of issues via API
Currently any spam detected by Akismet by non-members via API will be logged
in a separate table in the admin page.

Closes #5612
2016-02-02 11:25:44 -02:00
Rémy Coutable 55ab92c00b Use ActiveRecord::Base.connection.active? and rescue any exception in connect_to_db?
This ensures that rake tasks that don't need a DB connection can be run
without one.
2016-01-28 12:23:37 +01:00
Rémy Coutable 869b4d7c6a Only create the defaults ApplicationSetting when DB is fully migrated
Return a fake application settings OpenStruct when this is not the case.
Also, use ActiveRecord::Base.connection_pool.active_connection? instead
of ActiveRecord::Base.connection.active? to avoid driver exception.
2016-01-28 11:26:28 +01:00
Rémy Coutable e6f3fe5d3b Ensure rake tasks that don't need a DB connection can be run without one
When using ActiveRecord::Base.connection.active? without a DB
connection, we get a "PG::ConnectionBad: could not connect to server"
error because ActiveRecord::Base.connection doesn't exist. By using
ActiveRecord::Base.connected? we ensure we don't get this error if
the connection is missing, which is the all point of the
Gitlab::CurrentSettings#connect_to_db? method!
2016-01-26 15:11:15 +01:00
Rémy Coutable cd22da3ebd Fix preventing migration from crashing in very specific cases
See https://gitlab.com/gitlab-org/gitlab-ce/issues/12606 for details
2016-01-25 20:00:59 +01:00
Douglas Barbosa Alexandre bddef293d6 Ensure that doesn't have pending migrations when running the specs 2016-01-19 00:12:30 -02:00
Yorick Peterse 8d7a968d6d Handle missing DBs in connect_to_db?
This ensures CurrentSettings#connect_to_db? returns "false" in the event
of a database not existing, instead of raising an error.
2016-01-08 14:31:39 +01:00
Douglas Barbosa Alexandre ff98c631c1 Make sure that is no pending migrations in Gitlab::CurrentSettings 2015-12-30 14:26:54 -02:00
Kamil Trzcinski 11728b50f9 Expose artifacts path 2015-11-23 13:05:22 +01:00
Kamil Trzcinski d0e3e823a2 Implement Build Artifacts
- Offloads uploading to GitLab Workhorse
- Use /authorize request for fast uploading
- Added backup recipes for artifacts
- Support download acceleration using X-Sendfile
2015-11-10 12:51:50 +01:00
Kamil Trzcinski b18671a1b2 Enable shared runners for all new projects 2015-11-05 17:02:02 +01:00
Marin Jankovski 3a8773fb2f Added USE_DB env var to allow loading fake settings without db running. 2015-09-01 17:49:16 +02:00
Eric Maziade 23aee0ca8a fixed connection detection so settings can be read from the database 2015-08-27 21:21:31 -04:00
Artem Sidorenko 55dca86b98 Import sources: settings in the admin interface 2015-08-20 11:28:27 +02:00
themaze75 1d080f5745 session_expire_seconds => session_expire_delay
delay is in seconds
more legible code in session_store
Added `GitLab restart required` help block to session_expire_delay
2015-06-10 22:10:00 -04:00
Eric Maziade 84a414fe53 Add session expiration delay configuration through UI application
settings
2015-06-05 11:50:37 -04:00
Stan Hu dfd256f29e Support configurable attachment size via Application Settings
Fix bug where error messages from Dropzone would not be displayed on the issues page

Closes #1258
2015-04-02 00:04:08 -07:00
Vinnie Okada cacac147de Move restricted visibility settings to the UI
Add checkboxes to the application settings page for restricted
visibility levels, and remove those settings from gitlab.yml.
2015-03-07 13:11:08 -07:00
Dmitriy Zaporozhets a8a328b151 DB performance improvements to GitLab 2015-02-18 00:16:42 -08:00
Marco Wessel afce47923c actually fix indentation 2015-01-25 18:38:35 +01:00
Marco Wessel b20fc14133 Fix indentation 2015-01-25 18:34:02 +01:00
Marco Wessel aad6ceaef9 Allow configuring protection of the default branch upon first push 2015-01-25 17:09:10 +01:00
DJ Mountney 02d8575a61 Check for database connection before loading current application settings 2015-01-14 16:23:46 -08:00
Marin Jankovski e348af1d4c Rescue database error in application settings if the database still doesn't exist. 2015-01-14 09:03:25 +01:00
Jacob Vosmaer bc95576e2c Rescue missing database errors
While loading the Rails app we cannot assume that the gitlabhq_xxx
database exists already. If we do, `rake gitlab:setup` breaks!

This is a quick hack to make sure that fresh development setups of
GitLab (from master) will work again.
2015-01-09 11:26:26 +01:00
Dmitriy Zaporozhets d0a50985ec Create ApplicationSettings if does not exist in runtime 2015-01-08 11:26:16 -08:00
Dmitriy Zaporozhets 8133e44998 Hack for migrating to new settings 2015-01-08 10:30:35 -08:00
Dmitriy Zaporozhets 57a65ede77 Improve application settings and write tests 2015-01-08 09:53:35 -08:00