Skip to content

Commit 58e1b01

Browse files
committed
Rename defaults.ini to config-example.ini
Update docs and changelog. Also remove the `globals` section since the new configuration system ignores them.
1 parent 195c2de commit 58e1b01

File tree

5 files changed

+14
-16
lines changed

5 files changed

+14
-16
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
* Norwegian Bokmål `nb`
7272
* Swedish `sv`
7373
- Wallabag sharer now targets Wallabag 2 by default. This is potentially breaking change but hopefully, no one uses Wallabag 1 any more. ([#1261](https://github.com/fossar/selfoss/pull/1261))
74+
- `defaults.ini` file is no longer used, it is only provided for convenience under a new name `config-example.ini` ([#1261](https://github.com/fossar/selfoss/pull/1261), [#1267](https://github.com/fossar/selfoss/pull/1267))
7475

7576
### Other changes
7677
- The front-end has been modernized using React framework, this will greatly simplify future development. ([#1216](https://github.com/fossar/selfoss/pull/1216))

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ For further questions or on any problem use our support forum: https://selfoss.a
2626

2727
## Configuration
2828

29-
1. Copy `defaults.ini` to `config.ini`.
29+
No configuration is needed to use selfoss but you can customize the settings as follows:
30+
31+
1. Rename `config-example.ini` to `config.ini`.
3032
2. Edit `config.ini` and delete any lines you do not wish to override.
31-
3. Do not delete the `[globals]` line.
32-
4. See <https://selfoss.aditu.de/> for examples.
33+
3. See <https://selfoss.aditu.de/> for examples.
3334

3435

3536
## Update

docs/content/_index.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,21 @@ For further questions or any problems, use our [support forum](forum). For a mor
3535
## Configuring selfoss {#configuration}
3636
<div class="documentation-entry">
3737

38-
All [configuration options](@/docs/administration/options.md) are optional. Any settings in `config.ini` will override the settings in `src/helpers/Configuration.php`. For convenience, the archive includes `defaults.ini` file containing the default configuration exported in INI format. To customize settings follow these instructions:
38+
All [configuration options](@/docs/administration/options.md) are optional. Any settings in `config.ini` will override the settings in `src/helpers/Configuration.php`. For convenience, the archive includes `config-example.ini` file containing the default configuration exported in INI format. To customize settings follow these instructions:
3939

40-
1. Copy `defaults.ini` to `config.ini`.
40+
1. Rename `config-example.ini` to `config.ini`.
4141
2. Edit `config.ini` and delete any lines you do not wish to override.
42-
3. Do not delete the `[globals]` line.
4342

4443
Sample `config.ini` file which provides password protection:
4544

4645
```ini
47-
[globals]
4846
username=secretagent
4947
password=$2y$10$xLurmBB0HJ60.sar1Z38r.ajtkruUIay7rwFRCvcaDl.1EU4epUH6
5048
```
5149

5250
Sample `config.ini` file with a MySQL database connection:
5351

5452
```ini
55-
[globals]
5653
db_type=mysql
5754
db_host=localhost
5855
db_database=selfoss

utils/create-zipball.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ def file(self, name):
107107
logger.info('Building asset bundles…')
108108
subprocess.check_call(['npm', 'run', 'build'])
109109

110-
logger.info('Generating defaults.ini…')
111-
subprocess.check_call(['php', 'utils/generate-defaults-ini.php'])
110+
logger.info('Generating config-example.ini…')
111+
subprocess.check_call(['php', 'utils/generate-config-example.php'])
112112

113113
logger.info('Optimizing PHP dependencies…')
114114
subprocess.check_call(['composer', 'install', '--no-dev', '--optimize-autoloader'])
@@ -137,7 +137,7 @@ def file(self, name):
137137

138138
archive.file('.htaccess')
139139
archive.file('README.md')
140-
archive.file('defaults.ini')
140+
archive.file('config-example.ini')
141141
archive.file('index.php')
142142
archive.file('run.php')
143143
archive.file('cliupdate.php')

utils/generate-defaults-ini.php renamed to utils/generate-config-example.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66

77
$reflection = new ReflectionClass(Configuration::class);
88

9-
$defaults = '; see https://selfoss.aditu.de/docs/administration/options/' . PHP_EOL;
10-
$defaults .= '; for more information about the configuration parameters' . PHP_EOL;
11-
$defaults .= '[globals]' . PHP_EOL;
9+
$example = '; see https://selfoss.aditu.de/docs/administration/options/' . PHP_EOL;
10+
$example .= '; for more information about the configuration parameters' . PHP_EOL;
1211

1312
foreach ($reflection->getProperties() as $property) {
1413
if (strpos($property->getDocComment(), '@internal') !== false) {
@@ -25,7 +24,7 @@
2524
$defaultValue = '0';
2625
}
2726

28-
$defaults .= $configKey . '=' . $defaultValue . PHP_EOL;
27+
$example .= $configKey . '=' . $defaultValue . PHP_EOL;
2928
}
3029

31-
file_put_contents(__DIR__ . '/../defaults.ini', $defaults);
30+
file_put_contents(__DIR__ . '/../config-example.ini', $example);

0 commit comments

Comments
 (0)