Skip to content

Commit 6789be7

Browse files
committed
Add optional environment value 'PORT_ADMIN'
1 parent 1032039 commit 6789be7

10 files changed

Lines changed: 185 additions & 20 deletions

File tree

CHANGELOG.txt renamed to CHANGELOG.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,27 @@
22
# UpdatEngine-server #
33
######################
44

5-
6.1.2:
5+
## 6.1.3 (2025-12-12):
6+
7+
**✨ Improvements**
8+
9+
- Add optional environment value 'PORT_ADMIN' to distinguish the admin IP port from the client port
10+
11+
## 6.1.2:
612
- Fix help text for 'Enable failure tolerance' feature
713

8-
6.1.1:
14+
## 6.1.1:
915
- Fix ignorance of 'download_no_restart' and 'no_break_on_error' when using the extended conditions
1016

11-
6.1.0:
17+
## 6.1.0:
1218
- Fix bug when displaying the password_change_done page
1319
- Fix AuthBackend authentication accepting bad passwords
1420

15-
6.0.1:
21+
## 6.0.1:
1622
- Fix debian installation script for Python 3.12 compatibility
1723
- Fix escape sequence in inventory views
1824

19-
6.0.0:
25+
## 6.0.0:
2026
- Upgrade to Django 4.2.16 LTS
2127
- Increase upload size limit to 5G
2228
- Add 'custom variables' column to deploy/package page
@@ -37,7 +43,7 @@
3743
- Add docker installation script
3844

3945

40-
5.0.0:
46+
## 5.0.0:
4147
- Upgrade to Django 3.2 LTS
4248
- Upgrade adminactions module to 1.15 version
4349
- Add debian upgrade script
@@ -51,40 +57,40 @@
5157
- Apply bulleted list style to 'packages' on the packageprofile page
5258
- Fix version check
5359

54-
4.1.0:
60+
## 4.1.0:
5561
- Update last release version using json
5662
- Add debian installation script and new apache config
5763
- Complete entity ip range help text
5864
- Sort machines names in history filter list
5965
- Add os version in inventory view
6066

61-
4.0.3:
67+
## 4.0.3:
6268
- Fix white page on mass update
6369
- Remove web directory indexes from apache conf
6470

65-
4.0.2:
71+
## 4.0.2:
6672
- Fix wol issue
6773
- Add lines to fix potential pip3 mysqlclient issue
6874
- Fix version check
6975

70-
4.0.1:
76+
## 4.0.1:
7177
- Add script db tables conversion to utf-8 (all languages support)
7278
- Fix bug on remove os name or arch through the web gui
7379
- Add 'username' condition and 'not logged in' tag
7480

75-
4.0.0:
81+
## 4.0.0:
7682
- Port code to Python 3.7
7783
- Migrate to Django 2.2
7884
- Use the latest python packages in line with the upgrade (django-grappelli, mysqlclient...)
7985

80-
3.0.2:
86+
## 3.0.2:
8187
- Optimizes extended conditions with client: Pre-check conditions to avoid asking client for unnecessary extended conditions if already a condition on the software is not satisfied.
8288

83-
3.0.1:
89+
## 3.0.1:
8490
- Fix bug in imports/exports deployments
8591
- Fix inventory dispatch (clients < 3.0 was sending 'undefined' for UserName, Domain and Language)
8692

87-
3.0:
93+
## 3.0:
8894
- Interface:
8995
- The chosen language remains displayed
9096
- Fix some translations in 'Export as CSV' and 'Mass update'

install/debian/custom.dist/.env.default

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ SERVER_NAME=localhost
1515

1616
# Updatengine port
1717
PORT=1979
18+
PORT_ADMIN=1997
1819

1920
# Language for web interface. default to fr (French)
2021
LANGUAGE_CODE=fr

install/debian/install.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
################################################
44
## UpdatEngine-server installation script
5-
## 2024/12/05
5+
## 2025/12/12
66
################################################
77
#
88
# /!\ WARNING /!\
@@ -76,6 +76,7 @@ grep -l $'\r' ./custom/.env && sed -i 's/\r//g' ./custom/.env && echo "Informati
7676

7777
# Export all key/value pairs from the '.env' file to the shell environment
7878
export $(cat ./custom/.env) > /dev/null 2>&1
79+
[ -z $PORT_ADMIN ] && $PORT_ADMIN=$PORT
7980

8081
# Set SECRET_KEY to a random value if not defined
8182
if [ -z ${SECRET_KEY} ] || [ ${SECRET_KEY} = '!mustbechanged!' ]; then
@@ -148,7 +149,11 @@ fi
148149
# Set apache configuration
149150
if [ ! -f /etc/apache2/sites-available/apache-updatengine.conf ] ; then
150151
echo "Set apache configuration"
151-
envsubst < ${INST_DIR}/updatengine-server/requirements/apache-updatengine.conf > /etc/apache2/sites-available/apache-updatengine.conf
152+
if [ "${PORT}" = "${PORT_ADMIN}" ]; then
153+
envsubst < ${INST_DIR}/updatengine-server/requirements/apache-updatengine.conf > /etc/apache2/sites-available/apache-updatengine.conf
154+
else
155+
envsubst < ${INST_DIR}/updatengine-server/requirements/apache-updatengine_distinct-admin-access.conf > /etc/apache2/sites-available/apache-updatengine.conf
156+
fi
152157
a2ensite apache-updatengine
153158
a2enmod wsgi
154159
fi

install/docker/custom.dist/.env.default

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ SERVER_NAME=localhost
1111

1212
# Updatengine nginx port
1313
PORT=1979
14+
PORT_ADMIN=1997
1415

1516
# Configuration type
1617
# Valid values : empty, HTTP_REDIRECT or LETSENCRYPT

install/docker/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ services:
6868
- ./install/docker/custom/ssl/site.key:/etc/ssl/private/site.key
6969
ports:
7070
- $PORT:443
71+
- $PORT_ADMIN:1443
7172
depends_on:
7273
web:
7374
condition: service_healthy

install/docker/entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,4 @@ fi
4747
gunicorn updatengine.wsgi:application --bind 0.0.0.0:8000
4848

4949

50+

install/docker/install.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
################################################
44
## UpdatEngine-server docker installation script
5-
## 2024/12/05
5+
## 2025/12/12
66
################################################
77
#
88
################################################
@@ -56,6 +56,9 @@ grep -l $'\r' ./custom/.env && sed -i 's/\r//g' ./custom/.env && echo "Informati
5656

5757
# Export all key/value pairs from the '.env' file to the shell environment
5858
export $(cat ./custom/.env) > /dev/null 2>&1
59+
[ -z $PORT_ADMIN ] && $PORT_ADMIN=$PORT
60+
61+
# Warning for LETSENCRYPT type
5962
if [ "$CONFIG_TYPE" = "LETSENCRYPT" ]; then
6063
echo "################"
6164
echo "ERROR: LETSENCRYPT option is not yet supported."
@@ -80,7 +83,12 @@ fi
8083
if [ ! -f ./custom/nginx/nginx.conf ]; then
8184
mkdir -p ./custom/nginx
8285
export DOLLAR='$'
83-
envsubst < ./nginx/nginx.conf.in$CONFIG_TYPE > ./custom/nginx/nginx.conf
86+
if [ "${PORT}" = "${PORT_ADMIN}" ]; then
87+
envsubst < ./nginx/nginx.conf.in$CONFIG_TYPE > ./custom/nginx/nginx.conf
88+
else
89+
envsubst < ./nginx/nginx.conf_distinct-admin-access.in$CONFIG_TYPE > ./custom/nginx/nginx.conf
90+
fi
91+
8492
fi
8593

8694
if ([ ! -f ./custom/ssl/site.key ] || [ ! -f ./custom/ssl/site.crt ]) && [ "$CONFIG_TYPE" != "LETSENCRYPT" ]; then
@@ -93,12 +101,15 @@ BASE_DIR='../..'
93101
cp Dockerfile $BASE_DIR/
94102
cp entrypoint.sh $BASE_DIR/
95103
envsubst < docker-compose.yml$CONFIG_TYPE > $BASE_DIR/docker-compose.yml
104+
if [ "${PORT}" = "${PORT_ADMIN}" ]; then
105+
sed -i '/:1443/d' $BASE_DIR/docker-compose.yml
106+
fi
96107
cp ./custom/.env $BASE_DIR/
97108
cat $BASE_DIR/requirements/pip-packages.txt requirements.txt > $BASE_DIR/requirements.txt
98109

99110
cd $BASE_DIR
100111
git pull
101-
docker compose up -d --build
112+
docker compose up -d --build --force-recreate
102113

103114
# Create admin account if none
104115
docker exec -it updatengine-server bash -c "echo 'select count(*) from auth_user;' | python manage.py dbshell | grep -v 'count' | grep 0" > /dev/null 2>&1
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
upstream updatengine {
2+
server web:8000;
3+
}
4+
5+
# Client access
6+
server {
7+
listen 443 ssl;
8+
server_name ${SERVER_NAME};
9+
server_tokens off;
10+
11+
ssl_certificate /etc/ssl/certs/site.crt;
12+
ssl_certificate_key /etc/ssl/private/site.key;
13+
14+
location /post/ {
15+
proxy_pass http://updatengine;
16+
proxy_set_header X-Forwarded-For ${DOLLAR}proxy_add_x_forwarded_for;
17+
proxy_set_header Host ${DOLLAR}host;
18+
proxy_redirect off;
19+
}
20+
21+
location /media/ {
22+
alias /app/updatengine/media/;
23+
}
24+
}
25+
26+
# Admin access
27+
server {
28+
listen 1443 ssl;
29+
server_name ${SERVER_NAME};
30+
server_tokens off;
31+
32+
client_max_body_size 5G;
33+
34+
ssl_certificate /etc/ssl/certs/site.crt;
35+
ssl_certificate_key /etc/ssl/private/site.key;
36+
37+
location / {
38+
proxy_pass http://updatengine;
39+
proxy_set_header X-Forwarded-For ${DOLLAR}proxy_add_x_forwarded_for;
40+
proxy_set_header Host ${DOLLAR}host;
41+
proxy_redirect off;
42+
}
43+
44+
location /static/ {
45+
alias /app/updatengine/static/;
46+
}
47+
48+
location /media/ {
49+
alias /app/updatengine/media/;
50+
}
51+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
WSGIPythonHome ${VENV_DIR}/
2+
WSGIPythonPath ${INST_DIR}/updatengine-server/updatengine
3+
WSGIApplicationGroup %{GLOBAL}
4+
5+
# Client access
6+
Listen ${PORT}
7+
<VirtualHost *:${PORT}>
8+
WSGIDaemonProcess updatengine-cli display-name=updatengine-cli user=www-data processes=2 threads=15
9+
WSGIScriptAlias / ${INST_DIR}/updatengine-server/updatengine/wsgi.py
10+
11+
Alias /static/ ${INST_DIR}/updatengine-server/updatengine/static/
12+
Alias /media/ ${INST_DIR}/updatengine-server/updatengine/media/
13+
14+
Loglevel info
15+
ErrorLog /var/log/apache2/updatengine.err
16+
CustomLog /var/log/apache2/updatengine.log "%{%Y%m%d%H%M}t|%h|http://%v%U|%s"
17+
18+
RewriteEngine On
19+
RewriteCond %{REQUEST_URI} !^/post/.*
20+
RewriteCond %{REQUEST_URI} !^/media/.*
21+
RewriteRule .* - [R=404]
22+
23+
<Directory ${INST_DIR}/updatengine-server/updatengine>
24+
<Files wsgi.py>
25+
Require all granted
26+
</Files>
27+
</Directory>
28+
29+
<Directory ${INST_DIR}/updatengine-server/updatengine/media>
30+
Options -Indexes
31+
Require all granted
32+
</Directory>
33+
34+
<IfModule mod_headers.c>
35+
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate, proxy-revalidate"
36+
</IfModule>
37+
38+
<IfModule mod_ssl.c>
39+
SSLEngine on
40+
SSLCertificateFile ${SSL_DIR}/updatengine.crt
41+
SSLCertificateKeyFile ${SSL_DIR}/updatengine.key
42+
</IfModule>
43+
44+
</VirtualHost>
45+
46+
# Admin access
47+
Listen ${PORT_ADMIN}
48+
<VirtualHost *:${PORT_ADMIN}>
49+
WSGIDaemonProcess updatengine display-name=updatengine user=www-data processes=2 threads=15
50+
WSGIScriptAlias / ${INST_DIR}/updatengine-server/updatengine/wsgi.py
51+
52+
Alias /static/ ${INST_DIR}/updatengine-server/updatengine/static/
53+
Alias /media/ ${INST_DIR}/updatengine-server/updatengine/media/
54+
55+
Loglevel info
56+
ErrorLog /var/log/apache2/updatengine.err
57+
CustomLog /var/log/apache2/updatengine.log "%{%Y%m%d%H%M}t|%h|http://%v%U|%s"
58+
59+
LimitRequestBody 5368709120
60+
61+
<Directory ${INST_DIR}/updatengine-server/updatengine>
62+
<Files wsgi.py>
63+
Require all granted
64+
</Files>
65+
</Directory>
66+
67+
<Directory ${INST_DIR}/updatengine-server/updatengine/static>
68+
Options -Indexes
69+
Require all granted
70+
</Directory>
71+
72+
<Directory ${INST_DIR}/updatengine-server/updatengine/media>
73+
Options -Indexes
74+
Require all granted
75+
</Directory>
76+
77+
<IfModule mod_headers.c>
78+
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate, proxy-revalidate"
79+
</IfModule>
80+
81+
<IfModule mod_ssl.c>
82+
SSLEngine on
83+
SSLCertificateFile ${SSL_DIR}/updatengine.crt
84+
SSLCertificateKeyFile ${SSL_DIR}/updatengine.key
85+
</IfModule>
86+
87+
</VirtualHost>
88+

updatengine/settings.py.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ PROJECT_URL = 'https://${SERVER_NAME}:${PORT}'
3434
ALLOWED_HOSTS = ['${SERVER_NAME}']
3535

3636
# List of trusted origins
37-
CSRF_TRUSTED_ORIGINS = ['https://${SERVER_NAME}:${PORT}']
37+
CSRF_TRUSTED_ORIGINS = ['https://${SERVER_NAME}:${PORT}','https://${SERVER_NAME}:${PORT_ADMIN}']
3838

3939
# Interface language
4040
LANGUAGES = (

0 commit comments

Comments
 (0)