@@ -181,20 +181,22 @@ func runDump(ctx *cli.Context) error {
181
181
}
182
182
fileName += "." + outType
183
183
}
184
- setting .LoadFromExisting ()
184
+ setting .InitProviderFromExistingFile ()
185
+ setting .LoadCommonSettings ()
185
186
186
187
// make sure we are logging to the console no matter what the configuration tells us do to
187
- if _ , err := setting .Cfg .Section ("log" ).NewKey ("MODE" , "console" ); err != nil {
188
+ // FIXME: don't use CfgProvider directly
189
+ if _ , err := setting .CfgProvider .Section ("log" ).NewKey ("MODE" , "console" ); err != nil {
188
190
fatal ("Setting logging mode to console failed: %v" , err )
189
191
}
190
- if _ , err := setting .Cfg .Section ("log.console" ).NewKey ("STDERR" , "true" ); err != nil {
192
+ if _ , err := setting .CfgProvider .Section ("log.console" ).NewKey ("STDERR" , "true" ); err != nil {
191
193
fatal ("Setting console logger to stderr failed: %v" , err )
192
194
}
193
195
if ! setting .InstallLock {
194
196
log .Error ("Is '%s' really the right config path?\n " , setting .CustomConf )
195
197
return fmt .Errorf ("gitea is not initialized" )
196
198
}
197
- setting .NewServices () // cannot access session settings otherwise
199
+ setting .LoadSettings () // cannot access session settings otherwise
198
200
199
201
stdCtx , cancel := installSignals ()
200
202
defer cancel ()
@@ -322,7 +324,7 @@ func runDump(ctx *cli.Context) error {
322
324
log .Info ("Packing data directory...%s" , setting .AppDataPath )
323
325
324
326
var excludes []string
325
- if setting .Cfg . Section ( "session" ). Key ( "PROVIDER" ). Value () == "file" {
327
+ if setting .SessionConfig . OriginalProvider == "file" {
326
328
var opts session.Options
327
329
if err = json .Unmarshal ([]byte (setting .SessionConfig .ProviderConfig ), & opts ); err != nil {
328
330
return err
@@ -339,7 +341,7 @@ func runDump(ctx *cli.Context) error {
339
341
excludes = append (excludes , setting .LFS .Path )
340
342
excludes = append (excludes , setting .Attachment .Path )
341
343
excludes = append (excludes , setting .Packages .Path )
342
- excludes = append (excludes , setting .LogRootPath )
344
+ excludes = append (excludes , setting .Log . RootPath )
343
345
excludes = append (excludes , absFileName )
344
346
if err := addRecursiveExclude (w , "data" , setting .AppDataPath , excludes , verbose ); err != nil {
345
347
fatal ("Failed to include data directory: %v" , err )
@@ -378,12 +380,12 @@ func runDump(ctx *cli.Context) error {
378
380
if ctx .IsSet ("skip-log" ) && ctx .Bool ("skip-log" ) {
379
381
log .Info ("Skip dumping log files" )
380
382
} else {
381
- isExist , err := util .IsExist (setting .LogRootPath )
383
+ isExist , err := util .IsExist (setting .Log . RootPath )
382
384
if err != nil {
383
- log .Error ("Unable to check if %s exists. Error: %v" , setting .LogRootPath , err )
385
+ log .Error ("Unable to check if %s exists. Error: %v" , setting .Log . RootPath , err )
384
386
}
385
387
if isExist {
386
- if err := addRecursiveExclude (w , "log" , setting .LogRootPath , []string {absFileName }, verbose ); err != nil {
388
+ if err := addRecursiveExclude (w , "log" , setting .Log . RootPath , []string {absFileName }, verbose ); err != nil {
387
389
fatal ("Failed to include log: %v" , err )
388
390
}
389
391
}
0 commit comments