diff --git a/app/src/components/Channels.js b/app/src/components/Channels.js index 6afdea3f..06154465 100644 --- a/app/src/components/Channels.js +++ b/app/src/components/Channels.js @@ -293,7 +293,7 @@ export function ChannelPage({create, header}) { color='violet' onClick={handleTagEditChannel} obeyWROLMode={true} - >Save + >{moveToTagDirectory ? 'Move' : 'Save'} ; } diff --git a/pi-gen/stage2/04-wrolpi/03-run-chroot.sh b/pi-gen/stage2/04-wrolpi/03-run-chroot.sh index 02e855c0..95bcb94a 100755 --- a/pi-gen/stage2/04-wrolpi/03-run-chroot.sh +++ b/pi-gen/stage2/04-wrolpi/03-run-chroot.sh @@ -14,8 +14,8 @@ EOF # Create WROLPi user. This user will own the media directory, API, and App. useradd -md /home/wrolpi wrolpi -s "$(command -v bash)" -# Change default postgresql port to 5432. -sed -i 's/port = 5433/port = 5432/' /etc/postgresql/15/main/postgresql.conf +# Change postgresql "main" cluster port to 5432. +sed -i 's/port =.*/port = 5432/' /etc/postgresql/15/main/postgresql.conf # Install Node console commands. npm i -g serve@12.0.1 single-file-cli@1.1.54 readability-extractor@0.0.6 carto@1.2.0 diff --git a/pi-gen/stage2/04-wrolpi/04-run-chroot.sh b/pi-gen/stage2/04-wrolpi/04-run-chroot.sh index 2616eea9..d95aa058 100755 --- a/pi-gen/stage2/04-wrolpi/04-run-chroot.sh +++ b/pi-gen/stage2/04-wrolpi/04-run-chroot.sh @@ -3,18 +3,24 @@ set -e set -x +# Create postgres cluster for map. +pg_createcluster 15 map --port=5433 + # Create mapnik config. git clone https://github.com/lrnselfreliance/openstreetmap-carto.git /opt/openstreetmap-carto git config --global --add safe.directory /opt/openstreetmap-carto (cd /opt/openstreetmap-carto && git fetch && git checkout master && git reset --hard origin/master && git pull --ff) chown -R wrolpi:wrolpi /opt/openstreetmap-carto -(cd /opt/openstreetmap-carto && carto project.mml >/opt/openstreetmap-carto/mapnik.xml) +# Append port line after dbname configuration line. +sed -i '/dbname: "gis"/a \ port: 5433' /opt/openstreetmap-carto/project.mml +(cd /opt/openstreetmap-carto/ && carto project.mml >mapnik.xml) # All users can access wrolpi and map database. cat >/etc/skel/.pgpass <<'EOF' -127.0.0.1:5432:gis:_renderd:wrolpi +127.0.0.1:5433:gis:_renderd:wrolpi 127.0.0.1:5432:wrolpi:wrolpi:wrolpi EOF +chmod 0600 /etc/skel/.pgpass cat >/etc/skel/.gitconfig <<'EOF' [safe] directory = /opt/wrolpi @@ -48,11 +54,6 @@ chown -R _renderd:_renderd /var/cache/renderd/tiles # Create the media directory for the wrolpi user. echo '/dev/sda1 /media/wrolpi auto defaults,nofail 0 0' | tee -a /etc/fstab mkdir -p /media/wrolpi -cat >/home/wrolpi/.pgpass <<'EOF' -127.0.0.1:5432:gis:_renderd:wrolpi -127.0.0.1:5432:wrolpi:wrolpi:wrolpi -EOF -chmod 0600 /home/wrolpi/.pgpass chown -R wrolpi:wrolpi /media/wrolpi /home/wrolpi /opt/wrolpi* set +x diff --git a/repair.sh b/repair.sh index ff42bf94..b8cc2f73 100755 --- a/repair.sh +++ b/repair.sh @@ -98,11 +98,6 @@ sudo -iu postgres psql -c "alter user wrolpi with superuser" if [ ! -d /opt/openstreetmap-carto ]; then echo "/opt/openstreetmap-carto does not exist! Has install completed?" && exit 1 fi -chown -R _renderd:_renderd /opt/openstreetmap-carto -if [[ ! -f /opt/openstreetmap-carto/mapnik.xml || ! -s /opt/openstreetmap-carto/mapnik.xml ]]; then - (cd /opt/openstreetmap-carto && carto project.mml >/opt/openstreetmap-carto/mapnik.xml) -fi -chown -R _renderd:_renderd /opt/openstreetmap-carto cp /opt/wrolpi/etc/raspberrypios/renderd.conf /etc/renderd.conf # Enable mod_tile. @@ -119,8 +114,8 @@ grep -q 'port: 5433' /opt/openstreetmap-carto/project.mml || ( # Append port line after dbname configuration line. sed -i '/dbname: "gis"/a \ port: 5433' /opt/openstreetmap-carto/project.mml (cd /opt/openstreetmap-carto/ && carto project.mml >mapnik.xml) - chown -R _renderd:_renderd /opt/openstreetmap-carto ) +chown -R _renderd:_renderd /opt/openstreetmap-carto cp /opt/wrolpi/etc/raspberrypios/renderd.conf /etc/renderd.conf # Configure Apache2 to listen on 8084.