diff --git a/src/main/kotlin/de/fabianonline/telegram_backup/IniSettings.kt b/src/main/kotlin/de/fabianonline/telegram_backup/IniSettings.kt index 0e8c09f..2d96006 100644 --- a/src/main/kotlin/de/fabianonline/telegram_backup/IniSettings.kt +++ b/src/main/kotlin/de/fabianonline/telegram_backup/IniSettings.kt @@ -10,7 +10,7 @@ object IniSettings { init { loadIni(UserManager.getInstance().fileBase + "config.ini") - copySampleIni(UserManager.getInstance().fileBase + "config.ini.sample") + copySampleIni(UserManager.getInstance().fileBase + "config.sample.ini") } fun loadIni(filename: String) { @@ -44,7 +44,9 @@ object IniSettings { } fun copySampleIni(filename: String) { - + val stream = Config::class.java.getResourceAsStream("/config.sample.ini") + File(filename).outputStream().use { stream.copyTo(it) } + stream.close() } fun println() = println(settings) diff --git a/src/main/resources/config.sample.ini b/src/main/resources/config.sample.ini new file mode 100644 index 0000000..d734c61 --- /dev/null +++ b/src/main/resources/config.sample.ini @@ -0,0 +1,23 @@ +# Config file for telegram_backup +# Copy it to config.ini to use it. This sample file be overwritten on every run. +# +# Lines starting with '#' are ignored. +# Settings have the form 'key = value' +# To unset a setting, use 'key =' (or just don't use that key at all) +# Some settings may appear more than once. + + + +## GMaps key to use. Leave empty / don't set a value to use the built in key. +# gmaps_key = mysecretgmapskey + +## Use pagination in the HTML export? +# pagination = true +# pagination_size = 5000 + +## Don't download media files +# no_media = false + +## Don't download supergroups and channels by default +# download_channels = false +# download_supergroups = false