]> git.openstreetmap.org Git - nominatim.git/commitdiff
switch documentation to describing dotenv
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 20 Dec 2020 11:09:27 +0000 (12:09 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 20 Dec 2020 11:09:27 +0000 (12:09 +0100)
docs/admin/Advanced-Installations.md
docs/admin/Faq.md
docs/admin/Import.md
docs/admin/Update.md
docs/develop/Import.md
docs/develop/Ranking.md

index 5b0275b32728ea445e102ddf3eb799f09a672143..5701992cfd2d255d590ae88b2579a3f3e7b5443d 100644 (file)
@@ -162,11 +162,11 @@ PostgreSQL server process.
 
 On the client side you now need to configure the import to point to the
 correct location of the library **on the database server**. Add the following
-line to your your `settings/local.php` file:
+line to your your `.env` file:
 
 ```php
-@define('CONST_Database_Module_Path', '<directory on the database server where nominatim.so resides>');
+NOMINATIM_DATABASE_MODULE_PATH="<directory on the database server where nominatim.so resides>"
 ```
 
-Now change the `CONST_Database_DSN` to point to your remote server and continue
+Now change the `NOMINATIM_DATABASE_DSN` to point to your remote server and continue
 to follow the [standard instructions for importing](/admin/Import).
index bca6b49ddd6c6fae26da3df26ce6611c7e179c62..6203959dccdfe9544c784701139b33142860ab55 100644 (file)
@@ -211,11 +211,3 @@ for more information.
 ### Can I import negative OSM ids into Nominatim?
 
 See [this question of Stackoverflow](https://help.openstreetmap.org/questions/64662/nominatim-flatnode-with-negative-id).
-
-### Missing XML or text declaration
-
-The website might show: `XML Parsing Error: XML or text declaration not at start of entity Location.`
-
-Make sure there are no spaces at the beginning of your `settings/local.php` file.
-
-
index 792070e4a754a10bcab5d6c50cba985a917d3abb..41942d6f474207ff73b2a3676cc3eae3db55e00b 100644 (file)
@@ -5,18 +5,17 @@ from an OSM planet file and how to keep the database up to date. It
 is assumed that you have already successfully installed the Nominatim
 software itself, if not return to the [installation page](Installation.md).
 
-## Configuration setup in settings/local.php
+## Configuration setup in `.env`
 
-The Nominatim server can be customized via the file `settings/local.php`
-in the build directory. Note that this is a PHP file, so it must always
-start like this:
-
-    <?php
-
-without any leading spaces.
+The Nominatim server can be customized via a `.env` in the build directory.
+This is a file in [dotenv](https://symfony.com/doc/4.3/components/dotenv.html) format
+which looks the same as variable settings in a standard shell environment.
+You can also set the same configuration via environment variables. All
+settings have a `NOMINATIM_` prefix to avoid conflicts with other environment
+variables.
 
 There are lots of configuration settings you can tweak. Have a look
-at `settings/default.php` for a full list. Most should have a sensible default.
+at `settings/env.default` for a full list. Most should have a sensible default.
 
 #### Flatnode files
 
@@ -24,9 +23,9 @@ If you plan to import a large dataset (e.g. Europe, North America, planet),
 you should also enable flatnode storage of node locations. With this
 setting enabled, node coordinates are stored in a simple file instead
 of the database. This will save you import time and disk storage.
-Add to your `settings/local.php`:
+Add to your `.env`:
 
-    @define('CONST_Osm2pgsql_Flatnode_File', '/path/to/flatnode.file');
+    NOMINATIM_FLATNODE_FILE="/path/to/flatnode.file"
 
 Replace the second part with a suitable path on your system and make sure
 the directory exists. There should be at least 75GB of free space.
@@ -124,7 +123,7 @@ import styles available which only read selected data:
   Like the full style but also adds most of the OSM tags into the extratags
   column.
 
-The style can be changed with the configuration `CONST_Import_Style`.
+The style can be changed with the configuration `NOMINATIM_IMPORT_STYLE`.
 
 To give you an idea of the impact of using the different styles, the table
 below gives rough estimates of the final database size after import of a
@@ -269,9 +268,9 @@ entire US adds about 10GB to your database.
 
         ./utils/setup.php --import-tiger-data
 
-  3. Enable use of the Tiger data in your `settings/local.php` by adding:
+  3. Enable use of the Tiger data in your `.env` by adding:
 
-         @define('CONST_Use_US_Tiger_Data', true);
+         NOMINATIM_USE_US_TIGER_DATA=yes
 
   4. Apply the new settings:
 
index 4ddfc9de2cbda4c492cf415e0b6349aaf02c9c63..98f5244afd51c6f7bad6563a3c69566e17cd0c0a 100644 (file)
@@ -19,9 +19,9 @@ pip3 install --user osmium
 
 Nominatim needs a tool called `pyosmium-get-changes` which comes with
 Pyosmium. You need to tell Nominatim where to find it. Add the
-following line to your `settings/local.php`:
+following line to your `.env`:
 
-    @define('CONST_Pyosmium_Binary', '/home/user/.local/bin/pyosmium-get-changes');
+    NOMINATIM_PYOSMIUM_BINARY=/home/user/.local/bin/pyosmium-get-changes
 
 The path above is fine if you used the `--user` parameter with pip.
 Replace `user` with your user name.
@@ -32,15 +32,15 @@ Next the update needs to be initialised. By default Nominatim is configured
 to update using the global minutely diffs.
 
 If you want a different update source you will need to add some settings
-to `settings/local.php`. For example, to use the daily country extracts
+to `.env`. For example, to use the daily country extracts
 diffs for Ireland from Geofabrik add the following:
 
-    // base URL of the replication service
-    @define('CONST_Replication_Url', 'https://download.geofabrik.de/europe/ireland-and-northern-ireland-updates');
-    // How often upstream publishes diffs
-    @define('CONST_Replication_Update_Interval', '86400');
-    // How long to sleep if no update found yet
-    @define('CONST_Replication_Recheck_Interval', '900');
+    # base URL of the replication service
+    NOMINATIM_REPLICATION_URL="https://download.geofabrik.de/europe/ireland-and-northern-ireland-updates"
+    # How often upstream publishes diffs
+    NOMINATIM_REPLICATION_UPDATE_INTERVAL=86400
+    # How long to sleep if no update found yet
+    NOMINATIM_REPLICATION_RECHECK_INTERVAL=900
 
 To set up the update process now run the following command:
 
index b3e268f39965933349469e90416de65f17ff8027..c9612bb3c67319041b16ae11cf0c8ddd202b097c 100644 (file)
@@ -29,7 +29,7 @@ once with `class` of `highway` and once with a `class` of `bridge`. Thus the
 ## Configuring the Import
 
 How tags are interpreted and assigned to the different `place` columns can be
-configured via the import style configuration file (`CONST_Import_style`). This
+configured via the import style configuration file (`NOMINATIM_IMPORT_STYLE`). This
 is a JSON file which contains a list of rules which are matched against every
 tag of every object and then assign the tag its specific role.
 
index 3caeb50ecf16aa6e16195cf6c1436c7b57a01933..5b1ca1915ca653624261278c04adffa65cbc9882 100644 (file)
@@ -87,9 +87,9 @@ into the database. There are a few hard-coded rules for the assignment:
     * highway nodes
     * landuse that is not an area
 
-Other than that, the ranks can be freely assigned via the JSON file
-defined with `CONST_Address_Level_Config` according to their type and
-the country they are in.
+Other than that, the ranks can be freely assigned via the JSON file according
+to their type and the country they are in. The name of the config file to be
+used can be changed with the setting `NOMINATIM_ADDRESS_LEVEL_CONFIG`.
 
 The address level configuration must consist of an array of configuration
 entries, each containing a tag definition and an optional country array: