Skip to content

Commit 19cdcfe

Browse files
authored
build(update images): update my and mycron to current debian and node versions (#674)
* build(update images): update my and mycron to current debian and node versions - Allows to fix numerous security issues - Allows to rely upon an offical node image with known build steps - Allows to fix the test env that was not usable locally * fix(upgrade images): Adapt templates for ldap-utils compatibility - The new ldap-utils versions disable the usage of ldapadd -h and replace it by ldapadd -H. This commit adapt the templates to use the new argument. - Facilitates local usage of the repo for dev and test by allowing the usage of newer ldap-utils versions. * docs(upgrade images): Update dev env manual setup instructions for new LDAP templates * ops(upgrade images): Standardize my and mycron image name
1 parent 50057a0 commit 19cdcfe

17 files changed

Lines changed: 29 additions & 51 deletions

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
npm install
2525
eslint routes
2626
eslint core
27-
sudo docker build -t osallou/my .
28-
cd $GITHUB_WORKSPACE/cron && sudo docker build -f Dockerfile-cron -t osallou/mycron .
27+
sudo docker build -t quay.io/genouest/my .
28+
cd $GITHUB_WORKSPACE/cron && sudo docker build -f Dockerfile-cron -t genouest/mycron .
2929
cd $GITHUB_WORKSPACE/tests && sudo docker-compose up -d
3030
cd $GITHUB_WORKSPACE/tests && for i in {10..0}; do echo Try $i; sleep 30; sudo docker-compose logs my-app | grep "Server listening on port 3000"; if [ $? -eq 0 ] ; then echo Server is started; nb_done=$(sudo docker-compose exec -T my-app ls -l /opt/my/scripts/ | grep admin | grep 'update.done' | wc -l); if [ $nb_done -eq 2 ] ; then echo Admin user created; break; fi; fi; if [ $i -eq 0 ]; then echo Server does not start; exit 1; fi; done
3131
cd $GITHUB_WORKSPACE && sudo docker ps && mocha -b -t 20000 --full-trace

.travis.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
FROM quay.io/genouest/node:16.13-buster
1+
FROM node:jod-trixie
22
RUN npm install -g @angular/cli@10.2.0
33
ARG APIURL
44
ARG SENTRY
55
ARG UITHEME=cerulean
6+
# This line is used because the project use old version of Angular.
7+
# If someday the Angular version is updated, please delete this line.
8+
ENV NODE_OPTIONS='--openssl-legacy-provider --no-experimental-fetch'
69
COPY manager2 /root/genouestaccountmanager/manager2
710
RUN cd /root/genouestaccountmanager/manager2/src/assets/css && cp ${UITHEME}.min.css theme.css
811
RUN cd /root/genouestaccountmanager/manager2/src/environments && sed -i 's;apiUrl: "";apiUrl: "'"$SAPIURL"'";' environment.prod.ts
912
RUN cd /root/genouestaccountmanager/manager2/src/environments && sed -i 's;sentry: "";sentry: "'"$SENTRY"'";' environment.prod.ts
1013
RUN cd /root/genouestaccountmanager/manager2 && npm ci && ng build --base-href /manager2/ --prod --source-map && rm -rf src && rm -rf node_modules && rm -f dist/my-ui/*.gz && npm run compress || true
1114

12-
13-
FROM quay.io/osallou/node:16.13-buster
14-
RUN apt-get update && apt-get install -y ldap-utils vim openssh-client putty-tools
15+
FROM node:jod-trixie
16+
RUN apt-get update && apt-get install -y ldap-utils vim openssh-client putty-tools libldap2-dev uuid-dev
1517
COPY cron/gomngr.sh /opt/gomngr.sh
16-
1718
RUN mkdir -p /root/genouestaccountmanager
1819
WORKDIR /root/genouestaccountmanager
1920

dev_quickstart/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ Genouestaccountmanager is fairly modular, so it will not fit a deployment for pr
2727

2828
* Install node > 18.0 (using nvm, or by hand)
2929
* Install ldap-utils
30-
* /!\ Depending on your ldap-utils version, the '-h' option might not exists anymore. (Check the `ldapadd` command)
31-
* If that's the case, you'll need to edit the scripts in templates/default/user/, and remplace `-h {{ CONFIG.ldap.host }}` by `-H ldap://{{ CONFIG.ldap.host }}`
30+
* /!\ If you use an old ldap-utils version, the '-H' option might not exists. (Check the `ldapadd` command)
31+
* If that's the case, you'll need to edit the scripts in templates/default/user/, and remplace `-H ldap://{{ CONFIG.ldap.host }}` by `-h {{ CONFIG.ldap.host }}`.
3232
* Export the following env variables:
3333

3434

templates/default/user/add_group.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ echo "Start add_group.sh in $0 ..."
44

55
set -e
66

7-
ldapadd -h {{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} -f "{{ CONFIG.general.script_dir }}/{{ group.name }}.{{ fid }}.ldif"
7+
ldapadd -H ldap://{{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} -f "{{ CONFIG.general.script_dir }}/{{ group.name }}.{{ fid }}.ldif"
88

99

1010
echo "End add_group.sh in $0 ..."

templates/default/user/add_user.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ echo "Start add_user.sh in $0 ..."
44

55
set -e
66

7-
ldapadd -h {{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} -f "{{ CONFIG.general.script_dir }}/{{ user.uid }}.{{ fid }}.ldif"
7+
ldapadd -H ldap://{{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} -f "{{ CONFIG.general.script_dir }}/{{ user.uid }}.{{ fid }}.ldif"
88

99
if [ -e "{{ CONFIG.general.script_dir }}/group_{{ user.group }}_{{ user.uid }}.{{ fid }}.ldif" ]
1010
then
11-
ldapmodify -h {{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} -f "{{ CONFIG.general.script_dir }}/group_{{ user.group }}_{{ user.uid }}.{{ fid }}.ldif"
11+
ldapmodify -H ldap://{{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} -f "{{ CONFIG.general.script_dir }}/group_{{ user.group }}_{{ user.uid }}.{{ fid }}.ldif"
1212
fi
1313

1414
{% include "user/add_readme.sh" %}

templates/default/user/change_group.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ echo "Start change_group.sh in $0 ..."
44

55
set -e
66

7-
ldapmodify -h {{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} -f "{{ CONFIG.general.script_dir }}/{{ user.uid }}.{{ fid }}.ldif"
7+
ldapmodify -H ldap://{{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} -f "{{ CONFIG.general.script_dir }}/{{ user.uid }}.{{ fid }}.ldif"
88

99
echo "End change_group.sh in $0 ..."

templates/default/user/create_extra_user.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ echo "Start create_extra_user.sh in $0 ..."
44

55
set -e
66

7-
ldapadd -h {{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} -f "{{ CONFIG.general.script_dir }}/{{ user.uid }}.{{ fid }}.ldif"
7+
ldapadd -H ldap://{{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} -f "{{ CONFIG.general.script_dir }}/{{ user.uid }}.{{ fid }}.ldif"
88

99
if [ -e "{{ CONFIG.general.script_dir }}/group_{{ user.group }}_{{ user.uid }}.{{ fid }}.ldif" ]
1010
then
11-
ldapmodify -h {{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} -f "{{ CONFIG.general.script_dir }}/group_{{ user.group }}_{{ user.uid }}.{{ fid }}.ldif"
11+
ldapmodify -H ldap://{{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} -f "{{ CONFIG.general.script_dir }}/group_{{ user.group }}_{{ user.uid }}.{{ fid }}.ldif"
1212
fi
1313

1414
{% include "user/add_readme.sh" %}

templates/default/user/delete_group.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ echo "Start delete_group.sh in $0 ..."
44

55
set -e
66

7-
ldapdelete -h {{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} -f "{{ CONFIG.general.script_dir }}/{{ group.name }}.{{ fid }}.ldif"
7+
ldapdelete -H ldap://{{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} -f "{{ CONFIG.general.script_dir }}/{{ group.name }}.{{ fid }}.ldif"
88

99
echo "End delete_group.sh in $0 ..."

templates/default/user/delete_user.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ echo "Start delete_user.sh in $0 ..."
55
# Allowed to fail as it may already have been deleted
66
#set -e
77

8-
ldapmodify -h {{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} -f "{{ CONFIG.general.script_dir }}/{{ user.uid }}.{{ fid }}.ldif"
8+
ldapmodify -H ldap://{{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} -f "{{ CONFIG.general.script_dir }}/{{ user.uid }}.{{ fid }}.ldif"
99

10-
ldapdelete -h {{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} "uid={{ user.uid }},ou=people,{{ CONFIG.ldap.dn }}"
10+
ldapdelete -H ldap://{{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} "uid={{ user.uid }},ou=people,{{ CONFIG.ldap.dn }}"
1111

1212
if [ -d "{{ user.home }}" ]
1313
then

0 commit comments

Comments
 (0)