Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename defaults.ini to config-example.ini #1267

Merged
merged 1 commit into from
May 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
* Norwegian Bokmål `nb`
* Swedish `sv`
- 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))
- `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))

### Other changes
- The front-end has been modernized using React framework, this will greatly simplify future development. ([#1216](https://github.com/fossar/selfoss/pull/1216))
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ For further questions or on any problem use our support forum: https://selfoss.a

## Configuration

1. Copy `defaults.ini` to `config.ini`.
No configuration is needed to use selfoss but you can customize the settings as follows:

1. Rename `config-example.ini` to `config.ini`.
2. Edit `config.ini` and delete any lines you do not wish to override.
3. Do not delete the `[globals]` line.
4. See <https://selfoss.aditu.de/> for examples.
3. See <https://selfoss.aditu.de/> for examples.


## Update
Expand Down
7 changes: 2 additions & 5 deletions docs/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,21 @@ For further questions or any problems, use our [support forum](forum). For a mor
## Configuring selfoss {#configuration}
<div class="documentation-entry">

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:
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:

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

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

```ini
[globals]
username=secretagent
password=$2y$10$xLurmBB0HJ60.sar1Z38r.ajtkruUIay7rwFRCvcaDl.1EU4epUH6
```

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

```ini
[globals]
db_type=mysql
db_host=localhost
db_database=selfoss
Expand Down
6 changes: 3 additions & 3 deletions utils/create-zipball.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ def file(self, name):
logger.info('Building asset bundles…')
subprocess.check_call(['npm', 'run', 'build'])

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

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

archive.file('.htaccess')
archive.file('README.md')
archive.file('defaults.ini')
archive.file('config-example.ini')
archive.file('index.php')
archive.file('run.php')
archive.file('cliupdate.php')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

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

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

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

$defaults .= $configKey . '=' . $defaultValue . PHP_EOL;
$example .= $configKey . '=' . $defaultValue . PHP_EOL;
}

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