QGIS API Documentation  3.24.2-Tisler (13c1a02865)
qgsserversettings.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsserversettings.cpp
3  ---------------------
4  begin : December 19, 2016
5  copyright : (C) 2016 by Paul Blottiere
6  email : paul dot blottiere at oslandia dot com
7 
8 ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 
19 #include "qgsserversettings.h"
20 #include "qgsapplication.h"
21 
22 #include <QSettings>
23 #include <QDir>
24 
26 {
27  load();
28 }
29 
30 void QgsServerSettings::initSettings()
31 {
32  mSettings.clear();
33 
34  // options path
35  const Setting sOptPath = { QgsServerSettingsEnv::QGIS_OPTIONS_PATH,
37  QStringLiteral( "Override the default path for user configuration" ),
38  QString(),
39  QVariant::String,
40  QVariant( "" ),
41  QVariant()
42  };
43  mSettings[ sOptPath.envVar ] = sOptPath;
44 
45  // parallel rendering
48  QStringLiteral( "Activate/Deactivate parallel rendering for WMS getMap request" ),
49  QStringLiteral( "/qgis/parallel_rendering" ),
50  QVariant::Bool,
51  QVariant( false ),
52  QVariant()
53  };
54  mSettings[ sParRend.envVar ] = sParRend;
55 
56  // max threads
57  const Setting sMaxThreads = { QgsServerSettingsEnv::QGIS_SERVER_MAX_THREADS,
59  QStringLiteral( "Number of threads to use when parallel rendering is activated" ),
60  QStringLiteral( "/qgis/max_threads" ),
61  QVariant::Int,
62  QVariant( -1 ),
63  QVariant()
64  };
65  mSettings[ sMaxThreads.envVar ] = sMaxThreads;
66 
67  // log level
68  const Setting sLogLevel = { QgsServerSettingsEnv::QGIS_SERVER_LOG_LEVEL,
70  QStringLiteral( "Log level" ),
71  QString(),
72  QVariant::Int,
73  QVariant::fromValue( Qgis::MessageLevel::NoLevel ),
74  QVariant()
75  };
76  mSettings[ sLogLevel.envVar ] = sLogLevel;
77 
78  // log file
79  const Setting sLogFile = { QgsServerSettingsEnv::QGIS_SERVER_LOG_FILE,
81  QStringLiteral( "Log file" ),
82  QString(),
83  QVariant::String,
84  QVariant( "" ),
85  QVariant()
86  };
87  mSettings[ sLogFile.envVar ] = sLogFile;
88 
89  // log to stderr
90  const Setting sLogStderr = { QgsServerSettingsEnv::QGIS_SERVER_LOG_STDERR,
92  QStringLiteral( "Activate/Deactivate logging to stderr" ),
93  QString(),
94  QVariant::Bool,
95  QVariant( false ),
96  QVariant()
97  };
98  mSettings[ sLogStderr.envVar ] = sLogStderr;
99 
100  // project file
101  const Setting sProject = { QgsServerSettingsEnv::QGIS_PROJECT_FILE,
103  QStringLiteral( "QGIS project file" ),
104  QString(),
105  QVariant::String,
106  QVariant( "" ),
107  QVariant()
108  };
109  mSettings[ sProject.envVar ] = sProject;
110 
111  // cache directory
112  const Setting sCacheDir = { QgsServerSettingsEnv::QGIS_SERVER_CACHE_DIRECTORY,
114  QStringLiteral( "Specify the cache directory" ),
115  QStringLiteral( "/cache/directory" ),
116  QVariant::String,
117  QVariant( QgsApplication::qgisSettingsDirPath() + "cache" ),
118  QVariant()
119  };
120  mSettings[ sCacheDir.envVar ] = sCacheDir;
121 
122  // cache size
123  const Setting sCacheSize = { QgsServerSettingsEnv::QGIS_SERVER_CACHE_SIZE,
125  QStringLiteral( "Specify the cache size" ),
126  QStringLiteral( "/cache/size" ),
127  QVariant::LongLong,
128  QVariant( 256 * 1024 * 1024 ),
129  QVariant()
130  };
131  mSettings[ sCacheSize.envVar ] = sCacheSize;
132 
133  // system locale override
134  const Setting sOverrideSystemLocale = { QgsServerSettingsEnv::QGIS_SERVER_OVERRIDE_SYSTEM_LOCALE,
136  QStringLiteral( "Override system locale" ),
137  QStringLiteral( "/locale/userLocale" ),
138  QVariant::String,
139  QVariant( "" ),
140  QVariant()
141  };
142  mSettings[ sOverrideSystemLocale.envVar ] = sOverrideSystemLocale;
143 
144  // bad layers handling
145  const Setting sIgnoreBadLayers = { QgsServerSettingsEnv::QGIS_SERVER_IGNORE_BAD_LAYERS,
147  QStringLiteral( "Ignore bad layers" ),
148  QString(),
149  QVariant::Bool,
150  QVariant( false ),
151  QVariant()
152  };
153  mSettings[ sIgnoreBadLayers.envVar ] = sIgnoreBadLayers;
154 
155  // trust layer metadata
156  const Setting sTrustLayerMetadata = { QgsServerSettingsEnv::QGIS_SERVER_TRUST_LAYER_METADATA,
158  QStringLiteral( "Trust layer metadata" ),
159  QString(),
160  QVariant::Bool,
161  QVariant( false ),
162  QVariant()
163  };
164  mSettings[ sTrustLayerMetadata.envVar ] = sTrustLayerMetadata;
165 
166  // don't load layouts
167  const Setting sDontLoadLayouts = { QgsServerSettingsEnv::QGIS_SERVER_DISABLE_GETPRINT,
169  QStringLiteral( "Don't load layouts" ),
170  QString(),
171  QVariant::Bool,
172  QVariant( false ),
173  QVariant()
174  };
175  mSettings[ sDontLoadLayouts.envVar ] = sDontLoadLayouts;
176 
177  // show group separator
178  const Setting sShowGroupSeparator = { QgsServerSettingsEnv::QGIS_SERVER_SHOW_GROUP_SEPARATOR,
180  QStringLiteral( "Show group (thousands) separator" ),
181  QStringLiteral( "/locale/showGroupSeparator" ),
182  QVariant::String,
183  QVariant( false ),
184  QVariant()
185  };
186  mSettings[ sShowGroupSeparator.envVar ] = sShowGroupSeparator;
187 
188  // max height
189  const Setting sMaxHeight = { QgsServerSettingsEnv::QGIS_SERVER_WMS_MAX_HEIGHT,
191  QStringLiteral( "Maximum height for a WMS request. The lower one of this and the project configuration is used." ),
192  QStringLiteral( "/qgis/max_wms_height" ),
193  QVariant::LongLong,
194  QVariant( -1 ),
195  QVariant()
196  };
197  mSettings[ sMaxHeight.envVar ] = sMaxHeight;
198 
199  // max width
200  const Setting sMaxWidth = { QgsServerSettingsEnv::QGIS_SERVER_WMS_MAX_WIDTH,
202  QStringLiteral( "Maximum width for a WMS request. The most conservative between this and the project one is used" ),
203  QStringLiteral( "/qgis/max_wms_width" ),
204  QVariant::LongLong,
205  QVariant( -1 ),
206  QVariant()
207  };
208  mSettings[ sMaxWidth.envVar ] = sMaxWidth;
209 
210  // API templates and static override directory
211  const Setting sApiResourcesDirectory = { QgsServerSettingsEnv::QGIS_SERVER_API_RESOURCES_DIRECTORY,
213  QStringLiteral( "Base directory where HTML templates and static assets (e.g. images, js and css files) are searched for" ),
214  QStringLiteral( "/qgis/server_api_resources_directory" ),
215  QVariant::String,
216  QDir( QgsApplication::pkgDataPath() ).absoluteFilePath( QStringLiteral( "resources/server/api" ) ),
217  QString()
218  };
219 
220  mSettings[ sApiResourcesDirectory.envVar ] = sApiResourcesDirectory;
221 
222  // API WFS3 max limit
223  const Setting sApiWfs3MaxLimit = { QgsServerSettingsEnv::QGIS_SERVER_API_WFS3_MAX_LIMIT,
225  QStringLiteral( "Maximum value for \"limit\" in a features request, defaults to 10000" ),
226  QStringLiteral( "/qgis/server_api_wfs3_max_limit" ),
227  QVariant::LongLong,
228  QVariant( 10000 ),
229  QVariant()
230  };
231 
232  mSettings[ sApiWfs3MaxLimit.envVar ] = sApiWfs3MaxLimit;
233 
234  // projects directory for landing page service
235  const Setting sProjectsDirectories = { QgsServerSettingsEnv::QGIS_SERVER_LANDING_PAGE_PROJECTS_DIRECTORIES,
237  QStringLiteral( "Directories used by the landing page service to find .qgs and .qgz projects" ),
238  QStringLiteral( "/qgis/server_projects_directories" ),
239  QVariant::String,
240  QVariant( "" ),
241  QVariant()
242  };
243 
244  mSettings[ sProjectsDirectories.envVar ] = sProjectsDirectories;
245 
246  // postgresql connection string for landing page service
247  const Setting sProjectsPgConnections = { QgsServerSettingsEnv::QGIS_SERVER_LANDING_PAGE_PROJECTS_PG_CONNECTIONS,
249  QStringLiteral( "PostgreSQL connection strings used by the landing page service to find projects" ),
250  QStringLiteral( "/qgis/server_projects_pg_connections" ),
251  QVariant::String,
252  QVariant( "" ),
253  QVariant()
254  };
255 
256  mSettings[ sProjectsPgConnections.envVar ] = sProjectsPgConnections;
257 
258  // landing page base URL prefix
259  const Setting sLandingPageBaseUrlPrefix = { QgsServerSettingsEnv::QGIS_SERVER_LANDING_PAGE_PREFIX,
261  QStringLiteral( "Landing page base URL path prefix" ),
262  QStringLiteral( "/qgis/server_landing_page_base_url_prefix" ),
263  QVariant::String,
264  QVariant( "" ),
265  QVariant()
266  };
267 
268  mSettings[ sLandingPageBaseUrlPrefix.envVar ] = sLandingPageBaseUrlPrefix;
269 
270  // log profile
271  const Setting sLogProfile = { QgsServerSettingsEnv::QGIS_SERVER_LOG_PROFILE,
273  QStringLiteral( "Add detailed profile information to the logs, only effective when QGIS_SERVER_LOG_LEVEL=0" ),
274  QStringLiteral( "/qgis/server_log_profile" ),
275  QVariant::Bool,
276  QVariant( false ),
277  QVariant()
278  };
279 
280  mSettings[ sLogProfile.envVar ] = sLogProfile;
281 
282  // the default service URL.
283  const Setting sServiceUrl = { QgsServerSettingsEnv::QGIS_SERVER_SERVICE_URL,
285  QStringLiteral( "The default service URL" ),
286  QStringLiteral( "/qgis/server_service_url" ),
287  QVariant::String,
288  QVariant( "" ),
289  QVariant()
290  };
291  mSettings[ sServiceUrl.envVar ] = sServiceUrl;
292 
293  // the default WMS service URL.
294  const Setting sWmsServiceUrl = { QgsServerSettingsEnv::QGIS_SERVER_WMS_SERVICE_URL,
296  QStringLiteral( "The default WMS service URL" ),
297  QStringLiteral( "/qgis/server_wms_service_url" ),
298  QVariant::String,
299  QVariant( "" ),
300  QVariant()
301  };
302  mSettings[ sServiceUrl.envVar ] = sWmsServiceUrl;
303 
304  // the default WFS service URL.
305  const Setting sWfsServiceUrl = { QgsServerSettingsEnv::QGIS_SERVER_WFS_SERVICE_URL,
307  QStringLiteral( "The default WFS service URL" ),
308  QStringLiteral( "/qgis/server_wfs_service_url" ),
309  QVariant::String,
310  QVariant( "" ),
311  QVariant()
312  };
313  mSettings[ sServiceUrl.envVar ] = sWfsServiceUrl;
314 
315  // the default WCS service URL.
316  const Setting sWcsServiceUrl = { QgsServerSettingsEnv::QGIS_SERVER_WCS_SERVICE_URL,
318  QStringLiteral( "The default WcS service URL" ),
319  QStringLiteral( "/qgis/server_wcs_service_url" ),
320  QVariant::String,
321  QVariant( "" ),
322  QVariant()
323  };
324  mSettings[ sServiceUrl.envVar ] = sWfsServiceUrl;
325 
326  // the default WMTS service URL.
327  const Setting sWmtsServiceUrl = { QgsServerSettingsEnv::QGIS_SERVER_WMTS_SERVICE_URL,
329  QStringLiteral( "The default WMTS service URL" ),
330  QStringLiteral( "/qgis/server_wmts_service_url" ),
331  QVariant::String,
332  QVariant( "" ),
333  QVariant()
334  };
335  mSettings[ sServiceUrl.envVar ] = sWmtsServiceUrl;
336 }
337 
339 {
340  // init settings each time to take into account QgsApplication and
341  // QCoreApplication configuration for some default values
342  initSettings();
343 
344  // store environment variables
345  QMap<QgsServerSettingsEnv::EnvVar, QString> env = getEnv();
346 
347  // load QSettings if QGIS_OPTIONS_PATH is defined
348  loadQSettings( env[ QgsServerSettingsEnv::QGIS_OPTIONS_PATH ] );
349 
350  // prioritize values: 'env var' -> 'ini file' -> 'default value'
351  prioritize( env );
352 }
353 
354 bool QgsServerSettings::load( const QString &envVarName )
355 {
356  bool rc( false );
357  const QMetaEnum metaEnum( QMetaEnum::fromType<QgsServerSettingsEnv::EnvVar>() );
358  const int value = metaEnum.keyToValue( envVarName.toStdString().c_str() );
359 
360  if ( value >= 0 )
361  {
362  const QString envValue( getenv( envVarName.toStdString().c_str() ) );
363  prioritize( QMap<QgsServerSettingsEnv::EnvVar, QString> { {( QgsServerSettingsEnv::EnvVar ) value, envValue } } );
364  rc = true;
365  }
366 
367  return rc;
368 }
369 
370 QMap<QgsServerSettingsEnv::EnvVar, QString> QgsServerSettings::getEnv() const
371 {
372  QMap<QgsServerSettingsEnv::EnvVar, QString> env;
373 
374  const QMetaEnum metaEnum( QMetaEnum::fromType<QgsServerSettingsEnv::EnvVar>() );
375  for ( int i = 0; i < metaEnum.keyCount(); i++ )
376  {
377  env[( QgsServerSettingsEnv::EnvVar ) metaEnum.value( i )] = getenv( metaEnum.key( i ) );
378  }
379 
380  return env;
381 }
382 
383 QVariant QgsServerSettings::value( QgsServerSettingsEnv::EnvVar envVar, bool actual ) const
384 {
385  if ( actual )
386  {
387  const QString envValue( getenv( name( envVar ).toStdString().c_str() ) );
388 
389  if ( ! envValue.isEmpty() )
390  return envValue;
391  }
392 
393  if ( mSettings[ envVar ].src == QgsServerSettingsEnv::DEFAULT_VALUE )
394  {
395  return mSettings[ envVar ].defaultVal;
396  }
397  else
398  {
399  return mSettings[ envVar ].val;
400  }
401 }
402 
403 void QgsServerSettings::loadQSettings( const QString &envOptPath ) const
404 {
405  if ( ! envOptPath.isEmpty() )
406  {
407  QSettings::setDefaultFormat( QSettings::IniFormat );
408  QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, envOptPath );
409  }
410 }
411 
412 void QgsServerSettings::prioritize( const QMap<QgsServerSettingsEnv::EnvVar, QString> &env )
413 {
414  const auto constKeys( env.keys() );
415  for ( const QgsServerSettingsEnv::EnvVar &e : constKeys )
416  {
417  Setting s = mSettings[ e ];
418 
419  QVariant varValue;
420  if ( ! env.value( e ).isEmpty() )
421  {
422  varValue.setValue( env.value( e ) );
423  }
424 
425  if ( ! varValue.isNull() && varValue.canConvert( s.type ) )
426  {
427  s.val = varValue;
429  }
430  else if ( ! s.iniKey.isEmpty() && QSettings().contains( s.iniKey ) && QSettings().value( s.iniKey ).canConvert( s.type ) )
431  {
432  s.val = QSettings().value( s.iniKey );
434  }
435  else
436  {
437  s.val = QVariant();
439  }
440 
441  // an empty string can be returned from QSettings. In this case, we want
442  // to use the default value
443  if ( s.type == QVariant::String && s.val.toString().isEmpty() )
444  {
445  s.val = QVariant();
447  }
448 
449  mSettings[ e ] = s;
450  }
451 }
452 
454 {
455  const QMetaEnum metaEnumEnv( QMetaEnum::fromType<QgsServerSettingsEnv::EnvVar>() );
456  return metaEnumEnv.valueToKey( env );
457 }
458 
460 {
461  const QMetaEnum metaEnumSrc( QMetaEnum::fromType<QgsServerSettingsEnv::Source>() );
462 
463  QgsMessageLog::logMessage( "QGIS Server Settings: ", "Server", Qgis::MessageLevel::Info );
464  for ( const Setting &s : std::as_const( mSettings ) )
465  {
466  const QString src = metaEnumSrc.valueToKey( s.src );
467  const QString var = name( s.envVar );
468 
469  const QString msg = " - " + var + " / '" + s.iniKey + "' (" + s.descr + "): '" + value( s.envVar ).toString() + "' (read from " + src + ")";
470  QgsMessageLog::logMessage( msg, "Server", Qgis::MessageLevel::Info );
471  }
472 
473  if ( ! iniFile().isEmpty() )
474  {
475  const QString msg = "Ini file used to initialize settings: " + iniFile();
476  QgsMessageLog::logMessage( msg, "Server", Qgis::MessageLevel::Info );
477  }
478 }
479 
480 // getter
482 {
483  return QSettings().fileName();
484 }
485 
487 {
489 }
490 
492 {
493  return value( QgsServerSettingsEnv::QGIS_SERVER_MAX_THREADS ).toInt();
494 }
495 
497 {
498  return value( QgsServerSettingsEnv::QGIS_SERVER_LOG_FILE ).toString();
499 }
500 
502 {
503  return value( QgsServerSettingsEnv::QGIS_SERVER_LOG_STDERR ).toBool();
504 }
505 
507 {
508  return static_cast<Qgis::MessageLevel>( value( QgsServerSettingsEnv::QGIS_SERVER_LOG_LEVEL ).toInt() );
509 }
510 
512 {
513  return value( QgsServerSettingsEnv::QGIS_PROJECT_FILE ).toString();
514 }
515 
517 {
518  return value( QgsServerSettingsEnv::QGIS_SERVER_CACHE_SIZE ).toLongLong();
519 }
520 
522 {
523  return value( QgsServerSettingsEnv::QGIS_SERVER_CACHE_DIRECTORY ).toString();
524 }
525 
527 {
529 }
530 
532 {
534 }
535 
537 {
538  return value( QgsServerSettingsEnv::QGIS_SERVER_WMS_MAX_HEIGHT ).toInt();
539 }
540 
542 {
543  return value( QgsServerSettingsEnv::QGIS_SERVER_WMS_MAX_WIDTH ).toInt();
544 }
545 
547 {
549 }
550 
552 {
554 }
555 
557 {
558  return value( QgsServerSettingsEnv::QGIS_SERVER_LANDING_PAGE_PREFIX, true ).toString();
559 }
560 
562 {
564 }
565 
567 {
568  return value( QgsServerSettingsEnv::QGIS_SERVER_API_WFS3_MAX_LIMIT ).toLongLong();
569 }
570 
572 {
574 }
575 
577 {
579 }
580 
582 {
584 }
585 
587 {
588  return value( QgsServerSettingsEnv::QGIS_SERVER_LOG_PROFILE, false ).toBool();
589 }
590 
591 QString QgsServerSettings::serviceUrl( const QString &service ) const
592 {
593  QString result;
594  if ( service.compare( QLatin1String( "WMS" ) ) )
595  {
596  result = value( QgsServerSettingsEnv::QGIS_SERVER_WMS_SERVICE_URL ).toString();
597  }
598  else if ( service.compare( QLatin1String( "WFS" ) ) )
599  {
600  result = value( QgsServerSettingsEnv::QGIS_SERVER_WFS_SERVICE_URL ).toString();
601  }
602  else if ( service.compare( QLatin1String( "WCS" ) ) )
603  {
604  result = value( QgsServerSettingsEnv::QGIS_SERVER_WCS_SERVICE_URL ).toString();
605  }
606  else if ( service.compare( QLatin1String( "WMTS" ) ) )
607  {
608  result = value( QgsServerSettingsEnv::QGIS_SERVER_WMTS_SERVICE_URL ).toString();
609  }
610 
611  if ( result.isEmpty() )
612  {
613  result = value( QgsServerSettingsEnv::QGIS_SERVER_SERVICE_URL ).toString();
614  }
615 
616  return result;
617 }
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition: qgis.h:107
static QString pkgDataPath()
Returns the common root path of all application data directories.
static QString qgisSettingsDirPath()
Returns the path to the settings directory in user's home dir.
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::MessageLevel::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
EnvVar
Environment variables to configure the server.
@ QGIS_SERVER_WCS_SERVICE_URL
To set the WCS service URL if it's not present in the project. (since QGIS 3.20).
@ QGIS_SERVER_WMTS_SERVICE_URL
To set the WMTS service URL if it's not present in the project. (since QGIS 3.20).
@ QGIS_SERVER_IGNORE_BAD_LAYERS
Do not consider the whole project unavailable if it contains bad layers.
@ QGIS_SERVER_TRUST_LAYER_METADATA
Trust layer metadata. Improves project read time. (since QGIS 3.16).
@ QGIS_SERVER_WFS_SERVICE_URL
To set the WFS service URL if it's not present in the project. (since QGIS 3.20).
@ QGIS_SERVER_OVERRIDE_SYSTEM_LOCALE
Override system locale (since QGIS 3.8)
@ QGIS_SERVER_LANDING_PAGE_PROJECTS_PG_CONNECTIONS
PostgreSQL connection strings used by the landing page service to find projects (since QGIS 3....
@ QGIS_SERVER_API_WFS3_MAX_LIMIT
Maximum value for "limit" in a features request, defaults to 10000 (since QGIS 3.10).
@ QGIS_SERVER_API_RESOURCES_DIRECTORY
Base directory where HTML templates and static assets (e.g. images, js and css files) are searched fo...
@ QGIS_SERVER_WMS_MAX_WIDTH
Maximum width for a WMS request. The most conservative between this and the project one is used (sinc...
@ QGIS_SERVER_WMS_MAX_HEIGHT
Maximum height for a WMS request. The most conservative between this and the project one is used (sin...
@ QGIS_SERVER_WMS_SERVICE_URL
To set the WMS service URL if it's not present in the project. (since QGIS 3.20).
@ QGIS_SERVER_DISABLE_GETPRINT
Disabled WMS GetPrint request and don't load layouts. Improves project read time. (since QGIS 3....
@ QGIS_SERVER_SHOW_GROUP_SEPARATOR
Show group (thousands) separator when formatting numeric values, defaults to false (since QGIS 3....
@ QGIS_SERVER_LANDING_PAGE_PROJECTS_DIRECTORIES
Directories used by the landing page service to find .qgs and .qgz projects (since QGIS 3....
@ QGIS_SERVER_LOG_PROFILE
When QGIS_SERVER_LOG_LEVEL is 0 this flag adds to the logs detailed information about the time taken ...
@ QGIS_SERVER_SERVICE_URL
To set the service URL if it's not present in the project. (since QGIS 3.20).
QString serviceUrl(const QString &service) const
Returns the service URL from the setting.
QString cacheDirectory() const
Returns the cache directory.
bool getPrintDisabled() const
Returns true if WMS GetPrint request is disabled and the project's reading flag QgsProject::ReadFlag:...
QString landingPageProjectsPgConnections() const
Returns the PostgreSQL connection strings used by the landing page service to find projects.
int maxThreads() const
Returns the maximum number of threads to use.
bool logStderr() const
Returns whether logging to stderr is activated.
QgsServerSettings()
Constructor.
QString projectFile() const
Returns the QGS project file to use.
QString apiResourcesDirectory() const
Returns the server-wide base directory where HTML templates and static assets (e.g.
Qgis::MessageLevel logLevel() const
Returns the log level.
int wmsMaxWidth() const
Returns the server-wide max width of a WMS GetMap request.
static QString name(QgsServerSettingsEnv::EnvVar env)
Returns the string representation of a setting.
QString landingPageBaseUrlPrefix() const
Returns the landing page base URL regular expression, defaults to /.
void logSummary() const
Log a summary of settings currently loaded.
QString logFile() const
Returns the log file.
qlonglong apiWfs3MaxLimit() const
Returns the server-wide maximum allowed value for "limit" in a features request.
int wmsMaxHeight() const
Returns the server-wide max height of a WMS GetMap request.
QString landingPageProjectsDirectories() const
Returns the directories used by the landing page service to find .qgs and .qgz projects.
bool parallelRendering() const
Returns parallel rendering setting.
bool showGroupSeparator() const
Show group (thousand) separator.
bool ignoreBadLayers() const
Returns true if the bad layers are ignored and false when the presence of a bad layers invalidates th...
QString iniFile() const
Returns the ini file loaded by QSetting.
bool logProfile()
Returns true if profile information has to be added to the logs, default value is false.
QString overrideSystemLocale() const
Overrides system locale.
bool trustLayerMetadata() const
Returns true if the reading flag trust layer metadata is activated.
void load()
Load settings according to current environment variables.
qint64 cacheSize() const
Returns the cache size.