Skip to content
This repository has been archived by the owner on Oct 5, 2024. It is now read-only.

Commit

Permalink
Updating docs, dependencies, build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
emi420 committed Feb 22, 2024
1 parent b984348 commit d16fa5f
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 19 deletions.
2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ endif
install-data-hook:
$(MKDIR_P) $(DESTDIR)/$(pkglibdir)
$(MKDIR_P) /etc/underpass
cp -rvp $(srcdir)/setup/service/underpass.service /etc/systemd/system/
cp -rvp $(srcdir)/config/priority.geojson /etc/underpass/
cp -rvp $(srcdir)/config/replicator /etc/underpass/
cp -rvp $(srcdir)/config/validate /etc/underpass/
cp -rvp $(srcdir)/config/stats /etc/underpass/
cp -rvp $(srcdir)/config/default.yaml /etc/underpass/
$(MKDIR_P) $(DESTDIR)/$(docdir)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ It **updates a local copy of the OSM database** in near real-time, and provides
We've deployed a rudimentary demo that keeps a database up-to-date for (some country),
rendering buildings and highlighting the ones identified as "un-squared":

[See the development demo](https://underpass.live)
[https://underpass.live](https://underpass.live)

<img width="993" alt="Screenshot 2023-11-22 at 10 32 56" src="https://github.com/hotosm/underpass/assets/1226194/73622131-b69f-4716-bf95-9e195efdbba9">

Expand Down
2 changes: 1 addition & 1 deletion config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ config:
- underpass_db_url:
- underpass:underpass@localhost:5432/underpass
- planet_servers:
- planet.openstreetmap.org
- planet.maps.mail.ru
- destdir_base:
- /usr/local/lib/underpass/data/

2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ if test x"${enable_python}" = x"yes"; then
AX_BOOST_PYTHON
AC_DEFINE(USE_PYTHON, [1], [Enable Python binding])
fi
AM_CONDITIONAL(ENABLE_PYTHON, [ test x"${enable_python}" != x ])
AM_CONDITIONAL(ENABLE_PYTHON, [ test x"${enable_python}" != x"no" ])

AC_PATH_PROG(DOXYGEN, doxygen)
AM_CONDITIONAL(ENABLE_DOXYGEN, [ test x"$DOXYGEN" != x ])
Expand Down
8 changes: 6 additions & 2 deletions docker/underpass-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Underpass config file
config:
- underpass_db_url:
- underpass@postgis/underpass
- underpass_db_url:
- underpass@postgis/underpass
- planet_servers:
- planet.maps.mail.ru
- destdir_base:
- /usr/local/lib/underpass/data/
11 changes: 6 additions & 5 deletions docker/underpass.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ CMD ["make", "check", "-j", "$(nproc)"]
FROM deps as debug
# Local debug with all dev deps
ENV LD_LIBRARY_PATH=/code/build/.libs/
COPY --from=build /usr/local/lib/ /usr/local/lib/
COPY --from=build /usr/local/bin /usr/local/bin
COPY --from=build /code/build/.libs/ \
/code/build/.libs/
COPY --from=build /usr/local/lib/underpass/config \
/usr/local/lib/underpass/config
COPY --from=build /etc/underpass \
/etc/underpass
WORKDIR /code/build
# Add non-root user
RUN useradd -r -u 1001 -m -c "hotosm account" -d /home/appuser -s /bin/false appuser
Expand All @@ -105,10 +106,10 @@ RUN set -ex \
"osm2pgsql" \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /usr/local/bin /usr/local/bin
COPY --from=build /code/build/.libs/ \
COPY --from=build /usr/local/lib/ \
/usr/local/lib/
COPY --from=build /usr/local/lib/underpass/config \
/usr/local/lib/underpass/config
COPY --from=build /etc/underpass \
/etc/underpass
WORKDIR /code/build
# Add non-root user
RUN useradd -r -u 1001 -m -c "hotosm account" -d /home/appuser -s /bin/false appuser
Expand Down
15 changes: 8 additions & 7 deletions docs/get-started/Setup.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Boostrap the database
## Boostraping the database

You can prepare your Underpass installation with data for a specific country.

Expand Down Expand Up @@ -34,17 +34,19 @@ apt install osm2pgsql

### Bootstrap

Now you can go to the `utils` directory and run the boostrap script:
Go to the `setup` directory and run the boostrap script:

cd utils
chmod +x bootstrap.sh
./bootstrap.sh -r south-america -c uruguay -p 5432 -u underpass
./bootstrap.sh -r south-america -c uruguay
```
Use `-p <PORT>` and `-u <USERNAME>` for the database.
Use `-u <USERNAME>` `-h <HOST>` `-d <DATABASE>` `-d <PORT>` for the database connection.
Regions (-r) are:
If you installed Underpass with Docker, you might use the `-p 5439 -k yes` options.
./bootstrap.sh -r south-america -c uruguay -p 5439 -k yes
Regions (-r) are:
africa
asia
australia-oceania
Expand All @@ -58,4 +60,3 @@ Countries (-c) is the name of the country inside the region.
Data is downloaded from GeoFabrik, if you are not sure of what name you need to use, please check there.
For advanced users, check the [boostrap script documentation](/underpass/Dev/bootstrapsh).
2 changes: 1 addition & 1 deletion python/dbapi/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
psycopg2==2.9.6
asyncpg==0.29.0
1 change: 1 addition & 0 deletions python/restapi/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"http://localhost",
"http://localhost:5000",
"http://localhost:3000",
"http://localhost:8080",
"http://127.0.0.1",
"http://127.0.0.1:5000"
]
Expand Down
2 changes: 1 addition & 1 deletion src/underpass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ main(int argc, char *argv[])
("changeseturl", opts::value<std::string>(), "Starting URL path for ChangeSet (ex. 000/075/000), takes precedence over 'timestamp' option")
("frequency,f", opts::value<std::string>(), "Update frequency (hourly, daily), default minutely)")
("timestamp,t", opts::value<std::vector<std::string>>(), "Starting timestamp (can be used 2 times to set a range)")
("import,i", opts::value<std::string>(), "Initialize OSM database with datafile")
// ("import,i", opts::value<std::string>(), "Initialize OSM database with datafile")
("boundary,b", opts::value<std::string>(), "Boundary polygon file name")
("osmnoboundary", "Disable boundary polygon for OsmChanges")
("oscnoboundary", "Disable boundary polygon for Changesets")
Expand Down

0 comments on commit d16fa5f

Please sign in to comment.