Skip to content

Commit

Permalink
Refactored to run with libpqxx version 7.x in addition to 6.x.
Browse files Browse the repository at this point in the history
The `configure` script first looks for an installed version 7 before falling
back to version 6.

- Allow more general use of Vagrant provisioning scripts in other
  environments, e.g. Qemu.  See the `bootstrap.sh` header for brief
  instructions.
- Update Vagrant scripts to use PostgreSQL 15 where available
- Updated to use OpenLayers 9.1.0, Bootstrap 5.3.3 and proj4js 2.11.0.
- Fix fetching inactive shared tracks.
- Only fetch active user shares when fetching nicknames for itinerary map.
- Fix forbidden resources to be handled as forbidden instead of not authorized.
- Fix read-only viewing of itinerary waypoint.
- Handle invalid position/location when editing waypoints.
- Fix previously input values lost from itinerary waypoint when invalid
  position submitted.
- Fix missing validation rules for latitude and longitude values of itinerary
  waypoint.
  • Loading branch information
frankdean committed May 29, 2024
1 parent 7f81073 commit 363cbef
Show file tree
Hide file tree
Showing 140 changed files with 3,145 additions and 2,542 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/Dockerfile
/Dockerfile-postgis
/Dockerfile-tile-server
/Dockerfile-trixie
/INSTALL
/Makefile
/Makefile.in
Expand Down Expand Up @@ -82,8 +83,9 @@
/tests/package.m4
/tests/testsuite
/tests/testsuite.log
/trip-*.sha256sums
/trip-*.tar.?z
/trip-*.tar.bz2
/trip-*.tar.sha256sums
/trip-*.tar.zst
/trip-*.zip
/trip-*.tar.bz2
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

# Changelog

## 2.5.0

Refactored to run with [libpqxx][] version 7.x in addition to 6.x. The
`configure` script first looks for an installed version 7 before falling back
to version 6.

- Allow more general use of Vagrant provisioning scripts in other
environments, e.g. [Qemu][]. See the `bootstrap.sh` header for
brief instructions.
- Update Vagrant scripts to use PostgreSQL 15 where available
- Updated to use [OpenLayers][] 9.1.0, [Bootstrap][] 5.3.3 and [proj4js][]
2.11.0.
- Fix fetching inactive shared tracks.
- Only fetch active user shares when fetching nicknames for itinerary map.
- Fix forbidden resources to be handled as forbidden instead of not authorized.
- Fix read-only viewing of itinerary waypoint.
- Handle invalid position/location when editing waypoints.
- Fix previously input values lost from itinerary waypoint when invalid
position submitted.
- Fix missing validation rules for latitude and longitude values of itinerary
waypoint.

## 2.4.2

- Added a favicon
Expand Down Expand Up @@ -140,3 +162,9 @@ Improved slider control for simplifying paths making it appear more linear.
## 2.0.0

- Initial Release

[Bootstrap]: https://getbootstrap.com "Powerful, extensible, and feature-packed frontend toolkit"
[OpenLayers]: https://openlayers.org "OpenLayers makes it easy to put a dynamic map in any web page"
[Qemu]: https://www.qemu.org "A generic and open source machine emulator and virtualizer"
[libpqxx]: https://pqxx.org/libpqxx/ "The official C++ client API for PostgreSQL"
[proj4js]: https://github.com/proj4js/proj4js "JavaScript library to transform coordinates from one coordinate system to another, including datum transformations"
90 changes: 90 additions & 0 deletions Dockerfile-trixie.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# -*- mode: dockerfile; -*- vim: set ft=dockerfile:
FROM debian:trixie-20240513 AS build
RUN groupadd --gid 1000 trip \
&& useradd --uid 1000 --gid trip --shell /bin/bash --create-home trip
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
procps locales coreutils tar xz-utils ca-certificates tzdata \
make g++ gawk \
libboost-locale-dev libpqxx-dev libpugixml-dev libyaml-cpp-dev \
nlohmann-json3-dev uuid-dev cairomm-1.0-dev libgdal-dev libcmark-dev \
texlive texinfo \
&& rm -rf /var/lib/apt/lists/*

RUN sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# es_ES.UTF-8 UTF-8/es_ES.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen && \
export LC_ALL=en_GB.utf8 && \
localedef -i en_GB -c -f UTF-8 -A /usr/share/locale/locale.alias en_GB.UTF-8 && \
update-locale LANG LANGUAGE && \
ln -fs /usr/share/zoneinfo/Europe/London /etc/localtime && \
dpkg-reconfigure tzdata --frontend=noninteractive
ENV LANG en_GB.utf8
ARG TRIP_SERVER_VERSION=@PACKAGE_VERSION@
ARG TRIP_SERVER_FILENAME=trip-${TRIP_SERVER_VERSION}.tar.gz
RUN chgrp trip /usr/local/src && \
chmod g+w /usr/local/src

USER trip
WORKDIR /usr/local/src
# ADD --chown=trip:trip https://www.fdsd.co.uk/trip-server-2/download/${TRIP_SERVER_FILENAME} .
# ARG TRIP_SERVER_SHA256=49fec7ba5d0df588594eee4e39c7afeaf5a61b2467f3c8ee62e94541eaddc3ad
# RUN echo "$TRIP_SERVER_SHA256 *${TRIP_SERVER_FILENAME}" | sha256sum -c -

COPY ./${TRIP_SERVER_FILENAME} .
RUN tar -xf $TRIP_SERVER_FILENAME
WORKDIR "/usr/local/src/trip-${TRIP_SERVER_VERSION}"

RUN ./configure --enable-cairo && make check
RUN make html pdf

USER root
RUN make install install-html install-pdf

WORKDIR /usr/local/etc

FROM debian:trixie-20240513
LABEL uk.co.fdsd.tripserver.version="@PACKAGE_VERSION@"

RUN groupadd --gid 1000 trip \
&& useradd --uid 1000 --gid trip --shell /bin/bash --create-home trip

RUN apt-get update \
&& apt-get full-upgrade --yes --allow-change-held-packages \
&& apt-get install -y --no-install-recommends \
locales tzdata \
libboost-locale1.74.0 libpugixml1v5 libyaml-cpp0.7 \
uuid libpqxx-6.4 libcairomm-1.0-1v5 libcmark0.30.2 \
postgresql postgresql-contrib postgis

RUN sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# es_ES.UTF-8 UTF-8/es_ES.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen && \
export LC_ALL=en_GB.utf8 && \
localedef -i en_GB -c -f UTF-8 -A /usr/share/locale/locale.alias en_GB.UTF-8 && \
update-locale LANG LANGUAGE && \
ln -fs /usr/share/zoneinfo/Europe/London /etc/localtime && \
dpkg-reconfigure tzdata --frontend=noninteractive
ENV LANG en_GB.utf8

COPY --from=build /usr/local/bin/ /usr/local/bin/
COPY --from=build /usr/local/etc/ /usr/local/etc/
COPY --from=build /usr/local/share/ /usr/local/share/

COPY --chmod=755 docker-entrypoint.sh /usr/local/bin/

WORKDIR /usr/local/etc
RUN rm -f trip-server.yaml && touch trip-server.yaml && \
chown trip:trip trip-server.yaml && chmod 0640 trip-server.yaml

USER trip

EXPOSE 8080

ENTRYPOINT ["docker-entrypoint.sh"]

CMD ["trip-server"]
2 changes: 1 addition & 1 deletion Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure tzdata --frontend=noninteractive
ENV LANG en_GB.utf8
ARG TRIP_SERVER_VERSION=@PACKAGE_VERSION@
ARG TRIP_SERVER_FILENAME=trip-${TRIP_SERVER_VERSION}.tar.xz
ARG TRIP_SERVER_FILENAME=trip-${TRIP_SERVER_VERSION}.tar.gz
RUN chgrp trip /usr/local/src && \
chmod g+w /usr/local/src

Expand Down
4 changes: 2 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ SUBDIRS = src po tests doc

# When running `distcheck` build with additional features that are normally
# disabled by default
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-cairo --enable-directory-listing
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-cairo --enable-directory-listing --enable-tui

EXTRA_DIST = m4/ChangeLog .gitignore \
EXTRA_DIST = m4/ChangeLog .gitignore stamp-h1 \
RELEASE_PROCEDURE.md \
Vagrantfile \
doc/trip-server-ref.sgml \
Expand Down
Loading

0 comments on commit 363cbef

Please sign in to comment.