diff --git a/docker/develop/armv7/Dockerfile b/docker/develop/armv7/Dockerfile index 7a60b4dbd..0b600022b 100644 --- a/docker/develop/armv7/Dockerfile +++ b/docker/develop/armv7/Dockerfile @@ -85,11 +85,8 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ cp -r /etc/skel/.config /root/.config && \ /scripts/install-go.sh && \ /scripts/install-go-tools.sh && \ - echo 'alias go=richgo ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ - echo 'export PATH="$PATH:$HOME/.local/bin"' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ cp /scripts/convert/policy.xml /etc/ImageMagick-6/policy.xml && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ diff --git a/docker/develop/bookworm-slim/Dockerfile b/docker/develop/bookworm-slim/Dockerfile index bf4eb1459..3641b3760 100644 --- a/docker/develop/bookworm-slim/Dockerfile +++ b/docker/develop/bookworm-slim/Dockerfile @@ -67,11 +67,9 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ libmatroska-dev libdvdread-dev libebml5 libgav1-bin libatomic1 \ iputils-ping dnsutils binutils binutils-gold \ && \ - echo 'alias ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ echo "ALL ALL=(ALL) NOPASSWD:SETENV: /scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ /photoprism/originals \ diff --git a/docker/develop/bookworm/Dockerfile b/docker/develop/bookworm/Dockerfile index 54657e597..75a5ca2ec 100644 --- a/docker/develop/bookworm/Dockerfile +++ b/docker/develop/bookworm/Dockerfile @@ -95,11 +95,8 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ /scripts/install-hadolint.sh && \ /scripts/install-osv-scanner.sh && \ /scripts/install-gitleaks.sh && \ - echo 'alias go=richgo ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ - echo 'export PATH="$PATH:$HOME/.local/bin"' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ cp /scripts/convert/policy.xml /etc/ImageMagick-6/policy.xml && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ diff --git a/docker/develop/bullseye-slim/Dockerfile b/docker/develop/bullseye-slim/Dockerfile index 8e0147b1f..5f196b32e 100644 --- a/docker/develop/bullseye-slim/Dockerfile +++ b/docker/develop/bullseye-slim/Dockerfile @@ -87,11 +87,9 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ && \ /scripts/install-mariadb.sh mariadb-client && \ /scripts/install-darktable.sh && \ - echo 'alias ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ echo "ALL ALL=(ALL) NOPASSWD:SETENV: /scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ /photoprism/originals \ diff --git a/docker/develop/bullseye/Dockerfile b/docker/develop/bullseye/Dockerfile index c49965223..9c09de975 100644 --- a/docker/develop/bullseye/Dockerfile +++ b/docker/develop/bullseye/Dockerfile @@ -129,11 +129,8 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ /scripts/install-darktable.sh && \ /scripts/install-go-tools.sh && \ echo "ALL ALL=(ALL) NOPASSWD:SETENV: ALL" >> /etc/sudoers.d/all && \ - echo 'alias go=richgo ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ - echo 'export PATH="$PATH:$HOME/.local/bin"' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ /photoprism/originals \ diff --git a/docker/develop/buster/Dockerfile b/docker/develop/buster/Dockerfile index a44a199d2..cfdfbde71 100644 --- a/docker/develop/buster/Dockerfile +++ b/docker/develop/buster/Dockerfile @@ -125,11 +125,8 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ /scripts/install-darktable.sh && \ /scripts/install-go-tools.sh && \ echo "ALL ALL=(ALL) NOPASSWD:SETENV: ALL" >> /etc/sudoers.d/all && \ - echo 'alias go=richgo ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ - echo 'export PATH="$PATH:$HOME/.local/bin"' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ /photoprism/originals \ diff --git a/docker/develop/impish/Dockerfile b/docker/develop/impish/Dockerfile index 7002af3b0..840156f2a 100644 --- a/docker/develop/impish/Dockerfile +++ b/docker/develop/impish/Dockerfile @@ -123,11 +123,9 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ /scripts/install-chrome.sh && \ /scripts/install-go.sh && \ /scripts/install-go-tools.sh && \ - echo 'alias go=richgo ll="ls -alh"' >> /etc/skel/.bashrc && \ echo "ALL ALL=(ALL) NOPASSWD:SETENV: ALL" >> /etc/sudoers.d/all && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ /photoprism/originals \ diff --git a/docker/develop/jammy-slim/Dockerfile b/docker/develop/jammy-slim/Dockerfile index b93345cd9..d463e5d3d 100644 --- a/docker/develop/jammy-slim/Dockerfile +++ b/docker/develop/jammy-slim/Dockerfile @@ -72,11 +72,9 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ /scripts/install-yt-dlp.sh && \ /scripts/install-libvips.sh && \ /scripts/install-libheif.sh && \ - echo 'alias ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ echo "ALL ALL=(ALL) NOPASSWD:SETENV: /scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ /photoprism/originals \ diff --git a/docker/develop/jammy/Dockerfile b/docker/develop/jammy/Dockerfile index a51071ca0..a5ef97d21 100644 --- a/docker/develop/jammy/Dockerfile +++ b/docker/develop/jammy/Dockerfile @@ -108,11 +108,8 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ /scripts/install-hadolint.sh && \ /scripts/install-osv-scanner.sh && \ /scripts/install-gitleaks.sh && \ - echo 'alias go=richgo ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ - echo 'export PATH="$PATH:$HOME/.local/bin"' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ cp /scripts/convert/policy.xml /etc/ImageMagick-6/policy.xml && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ diff --git a/docker/develop/lunar-slim/Dockerfile b/docker/develop/lunar-slim/Dockerfile index 857e8c229..6bcd4dd39 100644 --- a/docker/develop/lunar-slim/Dockerfile +++ b/docker/develop/lunar-slim/Dockerfile @@ -66,11 +66,9 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ /scripts/install-mariadb.sh mariadb-client && \ /scripts/install-darktable.sh && \ /scripts/install-libheif.sh && \ - echo 'alias ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ echo "ALL ALL=(ALL) NOPASSWD:SETENV: /scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ /photoprism/originals \ diff --git a/docker/develop/lunar/Dockerfile b/docker/develop/lunar/Dockerfile index c8380cf0f..8fe24e4b8 100644 --- a/docker/develop/lunar/Dockerfile +++ b/docker/develop/lunar/Dockerfile @@ -91,11 +91,8 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ /scripts/install-go.sh && \ /scripts/install-go-tools.sh && \ echo "ALL ALL=(ALL) NOPASSWD:SETENV: ALL" >> /etc/sudoers.d/all && \ - echo 'alias go=richgo ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ - echo 'export PATH="$PATH:$HOME/.local/bin"' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ cp /scripts/convert/policy.xml /etc/ImageMagick-6/policy.xml && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ diff --git a/docker/develop/mantic-slim/Dockerfile b/docker/develop/mantic-slim/Dockerfile index 4b7f06533..495155ddd 100644 --- a/docker/develop/mantic-slim/Dockerfile +++ b/docker/develop/mantic-slim/Dockerfile @@ -66,11 +66,9 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ /scripts/install-mariadb.sh mariadb-client && \ /scripts/install-darktable.sh && \ /scripts/install-libheif.sh && \ - echo 'alias ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ echo "ALL ALL=(ALL) NOPASSWD:SETENV: /scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ /photoprism/originals \ diff --git a/docker/develop/mantic/Dockerfile b/docker/develop/mantic/Dockerfile index e2997baae..71d89cfac 100644 --- a/docker/develop/mantic/Dockerfile +++ b/docker/develop/mantic/Dockerfile @@ -91,11 +91,8 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ /scripts/install-go.sh && \ /scripts/install-go-tools.sh && \ echo "ALL ALL=(ALL) NOPASSWD:SETENV: ALL" >> /etc/sudoers.d/all && \ - echo 'alias go=richgo ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ - echo 'export PATH="$PATH:$HOME/.local/bin"' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ cp /scripts/convert/policy.xml /etc/ImageMagick-6/policy.xml && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ diff --git a/docker/develop/noble-slim/Dockerfile b/docker/develop/noble-slim/Dockerfile index 7c5f41c84..3a0891e81 100644 --- a/docker/develop/noble-slim/Dockerfile +++ b/docker/develop/noble-slim/Dockerfile @@ -68,11 +68,9 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ /scripts/install-mariadb.sh mariadb-client && \ /scripts/install-darktable.sh && \ /scripts/install-libheif.sh && \ - echo 'alias ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ echo "ALL ALL=(ALL) NOPASSWD:SETENV: /scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ /photoprism/originals \ diff --git a/docker/develop/noble/Dockerfile b/docker/develop/noble/Dockerfile index 1955331e1..cfd941373 100644 --- a/docker/develop/noble/Dockerfile +++ b/docker/develop/noble/Dockerfile @@ -96,11 +96,8 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ cp -r /etc/skel/.config /root/.config && \ /scripts/install-go.sh && \ /scripts/install-go-tools.sh && \ - echo 'alias go=richgo ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ - echo 'export PATH="$PATH:$HOME/.local/bin"' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ cp /scripts/convert/policy.xml /etc/ImageMagick-6/policy.xml && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ diff --git a/docker/develop/oracular-slim/Dockerfile b/docker/develop/oracular-slim/Dockerfile index 43201a4eb..1e5d67bb1 100644 --- a/docker/develop/oracular-slim/Dockerfile +++ b/docker/develop/oracular-slim/Dockerfile @@ -71,11 +71,9 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ /scripts/install-mariadb.sh mariadb-client && \ /scripts/install-darktable.sh && \ /scripts/install-libheif.sh && \ - echo 'alias ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ echo "ALL ALL=(ALL) NOPASSWD:SETENV: /scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ /photoprism/originals \ diff --git a/docker/develop/oracular/Dockerfile b/docker/develop/oracular/Dockerfile index ed4025267..f18f7fb73 100644 --- a/docker/develop/oracular/Dockerfile +++ b/docker/develop/oracular/Dockerfile @@ -99,11 +99,8 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ cp -r /etc/skel/.config /root/.config && \ /scripts/install-go.sh && \ /scripts/install-go-tools.sh && \ - echo 'alias go=richgo ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ - echo 'export PATH="$PATH:$HOME/.local/bin"' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ cp /scripts/convert/policy.xml /etc/ImageMagick-6/policy.xml && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ diff --git a/docker/develop/plucky-slim/Dockerfile b/docker/develop/plucky-slim/Dockerfile index 10170cfaa..a43ade159 100644 --- a/docker/develop/plucky-slim/Dockerfile +++ b/docker/develop/plucky-slim/Dockerfile @@ -72,11 +72,9 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ /scripts/install-darktable.sh && \ /scripts/install-yt-dlp.sh && \ /scripts/install-libheif.sh && \ - echo 'alias ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ echo "ALL ALL=(ALL) NOPASSWD:SETENV: /scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ /photoprism/originals \ diff --git a/docker/develop/plucky/Dockerfile b/docker/develop/plucky/Dockerfile index 0e7fa2b52..caa52f941 100644 --- a/docker/develop/plucky/Dockerfile +++ b/docker/develop/plucky/Dockerfile @@ -109,11 +109,8 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ cp -r /etc/skel/.config /root/.config && \ /scripts/install-go.sh && \ /scripts/install-go-tools.sh && \ - echo 'alias go=richgo ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ - echo 'export PATH="$PATH:$HOME/.local/bin"' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ cp /scripts/convert/policy.xml /etc/ImageMagick-7/policy.xml && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ diff --git a/docker/photoprism/armv7/Dockerfile b/docker/photoprism/armv7/Dockerfile index abb932b92..d057cfae3 100644 --- a/docker/photoprism/armv7/Dockerfile +++ b/docker/photoprism/armv7/Dockerfile @@ -115,11 +115,9 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ && \ /scripts/install-yt-dlp.sh && \ /scripts/install-libheif.sh && \ - echo 'alias ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ echo "ALL ALL=(ALL) NOPASSWD:SETENV: /scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ /photoprism/originals \ diff --git a/docker/photoprism/buster/Dockerfile b/docker/photoprism/buster/Dockerfile index 6e3276fef..918371019 100644 --- a/docker/photoprism/buster/Dockerfile +++ b/docker/photoprism/buster/Dockerfile @@ -118,11 +118,9 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ libavcodec-extra \ && \ /scripts/install-darktable.sh && \ - echo 'alias ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ echo "ALL ALL=(ALL) NOPASSWD:SETENV: /scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ /photoprism/originals \ diff --git a/docker/photoprism/impish/Dockerfile b/docker/photoprism/impish/Dockerfile index 4a305bb1a..ffd7b3d50 100644 --- a/docker/photoprism/impish/Dockerfile +++ b/docker/photoprism/impish/Dockerfile @@ -117,11 +117,9 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \ libavcodec-extra \ && \ /scripts/install-darktable.sh && \ - echo 'alias ll="ls -alh"' >> /etc/skel/.bashrc && \ - echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ + /scripts/install-bashrc.sh && \ echo "ALL ALL=(ALL) NOPASSWD:SETENV: /scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \ /scripts/install-dircolors.sh && \ - cp /etc/skel/.bashrc /root/.bashrc && \ /scripts/create-users.sh && \ install -d -m 0777 -o 1000 -g 1000 \ /photoprism/originals \ diff --git a/scripts/dist/create-users.sh b/scripts/dist/create-users.sh index af215f2f6..253119162 100755 --- a/scripts/dist/create-users.sh +++ b/scripts/dist/create-users.sh @@ -39,16 +39,23 @@ echo "✅ Added group photoprism (1000)." # add existing www-data user to groups usermod -a -G photoprism,video,davfs2,renderd,render,ssl-cert,videodriver www-data +# a directory that will be used as a custom skeleton when creating users +SKELETON="/tmp/custom-skeleton" +mkdir --parents "${SKELETON}" + +# copy the .config/ directory from the default skeleton +cp -r /etc/skel/.config/ ${SKELETON}/.config/ + # create user 'videodriver' userdel -r -f videodriver >/dev/null 2>&1 -useradd -u 937 -r -N -g 937 -G photoprism,www-data,video,davfs2,renderd,render,ssl-cert -s /bin/bash -m -d "/home/videodriver" videodriver +useradd -u 937 -r -N -g 937 -G photoprism,www-data,video,davfs2,renderd,render,ssl-cert -s /bin/bash -m -d "/home/videodriver" --skel "${SKELETON}" videodriver echo "✅ Added user videodriver (937)." # create user 'photoprism' userdel -r -f ubuntu >/dev/null 2>&1 userdel -r -f photoprism >/dev/null 2>&1 userdel -r -f 1000 >/dev/null 2>&1 -useradd -u 1000 -N -g photoprism -G www-data,video,davfs2,renderd,render,ssl-cert,videodriver -s /bin/bash -m -d "/home/photoprism" photoprism +useradd -u 1000 -N -g photoprism -G www-data,video,davfs2,renderd,render,ssl-cert,videodriver -s /bin/bash -m -d "/home/photoprism" --skel "${SKELETON}" photoprism echo "✅ Added user photoprism (1000)." add_user() @@ -56,7 +63,7 @@ add_user() userdel -r -f "user-$1" >/dev/null 2>&1 groupdel -f "group-$1" >/dev/null 2>&1 groupadd -f -g "$1" "group-$1" - useradd -u "$1" -g "$1" -G photoprism,www-data,video,davfs2,renderd,render,ssl-cert,videodriver -s /bin/bash -m -d "/home/user-$1" "user-$1" 2>/dev/null + useradd -u "$1" -g "$1" -G photoprism,www-data,video,davfs2,renderd,render,ssl-cert,videodriver -s /bin/bash -m -d "/home/user-$1" --skel "${SKELETON}" "user-$1" 2>/dev/null printf "." } @@ -73,4 +80,7 @@ printf " ✔\n" chgrp -f -R 1000 /home +# remove the custom skeleton +rm -rf "${SKELETON}" + echo "Done." diff --git a/scripts/dist/install-bashrc.sh b/scripts/dist/install-bashrc.sh new file mode 100755 index 000000000..588dce0d8 --- /dev/null +++ b/scripts/dist/install-bashrc.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# Add go alias and custom prompt in /etc/bash.bashrc: +# bash <(curl -s https://raw.githubusercontent.com/photoprism/photoprism/develop/scripts/dist/install-profile.sh) + +# Abort if not executed as root. +if [[ $(id -u) != "0" ]]; then + echo "Usage: run ${0##*/} as root" 1>&2 + exit 1 +fi + +set -e + +echo "Add ll alias and custom prompt in /etc/bash.bashrc" + +echo 'alias ll="ls -alh"' >> /etc/bash.bashrc +echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/bash.bashrc + +echo "Add alias of go to richgo if it's available" + +# Source: https://stackoverflow.com/questions/592620/how-can-i-check-if-a-program-exists-from-a-bash-script/677212#677212 +if command -v richgo >/dev/null 2>&1; then + echo 'alias go=richgo' >> /etc/bash.bashrc +fi + +echo "Remove the unnecessary custom .bashrc for the root user" + +rm /root/.bashrc diff --git a/scripts/dist/install-dircolors.sh b/scripts/dist/install-dircolors.sh index 3485a2cea..a12fe3025 100755 --- a/scripts/dist/install-dircolors.sh +++ b/scripts/dist/install-dircolors.sh @@ -298,13 +298,13 @@ EOF # Make sure file only writable by root, but readable by everyone chmod 644 /etc/dir_colors -# Activate colors in /etc/skel/.bashrc, if not done yet -if ! grep -q 'export SHELL=/bin/bash' /etc/skel/.bashrc; then - echo 'export SHELL=/bin/bash' >> /etc/skel/.bashrc +# Activate colors in /etc/bash.bashrc, if not done yet +if ! grep -q 'export SHELL=/bin/bash' /etc/bash.bashrc; then + echo 'export SHELL=/bin/bash' >> /etc/bash.bashrc fi # shellcheck disable=SC2016 -if ! grep -q 'eval "$(dircolors /etc/dir_colors)"' /etc/skel/.bashrc; then - echo 'eval "$(dircolors /etc/dir_colors)"' >> /etc/skel/.bashrc +if ! grep -q 'eval "$(dircolors /etc/dir_colors)"' /etc/bash.bashrc; then + echo 'eval "$(dircolors /etc/dir_colors)"' >> /etc/bash.bashrc fi echo "Done."