mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-16 08:23:12 +00:00
Merge branch 'upgrade-django-ldapdb' into 'dev'
Upgrade django ldapdb See merge request federez/re2o!433
This commit is contained in:
commit
0f063bd187
9 changed files with 116 additions and 30 deletions
16
CHANGELOG.md
16
CHANGELOG.md
|
@ -187,3 +187,19 @@ OPTIONNAL_APPS = OPTIONNAL_APPS_RE2O + (...,...,)
|
||||||
```
|
```
|
||||||
|
|
||||||
Don't forget to run migrations afterwards.
|
Don't forget to run migrations afterwards.
|
||||||
|
|
||||||
|
## MR 433 : upgrade django-ldapdb to 1.3.0
|
||||||
|
|
||||||
|
Uninstall the existing django-ldapdb installation
|
||||||
|
|
||||||
|
pip3 uninstall django-ldapdb
|
||||||
|
|
||||||
|
Install debian(buster) supported version
|
||||||
|
|
||||||
|
apt install python3-django-ldapdb
|
||||||
|
|
||||||
|
If you use MySQL, please run
|
||||||
|
|
||||||
|
```
|
||||||
|
SET GLOBAL SQL_MODE=ANSI_QUOTES;
|
||||||
|
```
|
||||||
|
|
|
@ -19,3 +19,4 @@ fonts-font-awesome
|
||||||
graphviz
|
graphviz
|
||||||
git
|
git
|
||||||
gettext
|
gettext
|
||||||
|
python3-django-ldapdb
|
||||||
|
|
|
@ -109,7 +109,7 @@ install_database() {
|
||||||
mysql_command="CREATE DATABASE $db_name collate='utf8_general_ci';
|
mysql_command="CREATE DATABASE $db_name collate='utf8_general_ci';
|
||||||
CREATE USER '$username'@'localhost' IDENTIFIED BY '$password';
|
CREATE USER '$username'@'localhost' IDENTIFIED BY '$password';
|
||||||
GRANT ALL PRIVILEGES ON $db_name.* TO '$username'@'localhost';
|
GRANT ALL PRIVILEGES ON $db_name.* TO '$username'@'localhost';
|
||||||
FLUSH PRIVILEGES;"
|
FLUSH PRIVILEGES;SET GLOBAL SQL_MODE=ANSI_QUOTES;"
|
||||||
|
|
||||||
if [ "$local_setup" == 1 ]; then
|
if [ "$local_setup" == 1 ]; then
|
||||||
echo "Setting up local MySQL server ..."
|
echo "Setting up local MySQL server ..."
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
django-bootstrap3
|
django-bootstrap3
|
||||||
django-ldapdb==0.9.0
|
|
||||||
django-macaddress
|
django-macaddress
|
||||||
|
|
|
@ -34,10 +34,17 @@ class Migration(migrations.Migration):
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
migrations.SeparateDatabaseAndState(
|
||||||
|
state_operations=[
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='ldapuser',
|
model_name='ldapuser',
|
||||||
name='sambaSID',
|
name='sambaSID',
|
||||||
field=ldapdb.models.fields.IntegerField(db_column='sambaSID', unique=True, null=True),
|
field=ldapdb.models.fields.IntegerField(db_column='sambaSID', unique=True, null=True),
|
||||||
preserve_default=False,
|
preserve_default=False,
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
database_operations=[
|
||||||
|
migrations.RunSQL('ALTER TABLE "users_ldapuser" ADD COLUMN "sambaSID" integer NULL UNIQUE;'),
|
||||||
|
],
|
||||||
|
)
|
||||||
]
|
]
|
||||||
|
|
|
@ -35,16 +35,13 @@ class Migration(migrations.Migration):
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
migrations.SeparateDatabaseAndState(
|
||||||
|
state_operations=[
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='ldapuser',
|
model_name='ldapuser',
|
||||||
name='display_name',
|
name='display_name',
|
||||||
field=ldapdb.models.fields.CharField(null=True, blank=True, max_length=200, db_column='displayName'),
|
field=ldapdb.models.fields.CharField(null=True, blank=True, max_length=200, db_column='displayName'),
|
||||||
),
|
),
|
||||||
migrations.AddField(
|
|
||||||
model_name='ldapuser',
|
|
||||||
name='macs',
|
|
||||||
field=ldapdb.models.fields.ListField(null=True, blank=True, max_length=200, db_column='radiusCallingStationId'),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='ldapuser',
|
model_name='ldapuser',
|
||||||
name='sambat_nt_password',
|
name='sambat_nt_password',
|
||||||
|
@ -55,6 +52,18 @@ class Migration(migrations.Migration):
|
||||||
name='user_password',
|
name='user_password',
|
||||||
field=ldapdb.models.fields.CharField(null=True, blank=True, max_length=200, db_column='userPassword'),
|
field=ldapdb.models.fields.CharField(null=True, blank=True, max_length=200, db_column='userPassword'),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
database_operations=[
|
||||||
|
migrations.RunSQL('ALTER TABLE users_ldapuser ADD COLUMN "displayName" varchar(200) NULL;'),
|
||||||
|
migrations.RunSQL('ALTER TABLE users_ldapuser ADD COLUMN "sambaNTPassword" varchar(200) NULL;'),
|
||||||
|
migrations.RunSQL('ALTER TABLE users_ldapuser ADD COLUMN "userPassword" varchar(200) NULL;'),
|
||||||
|
]
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='ldapuser',
|
||||||
|
name='macs',
|
||||||
|
field=ldapdb.models.fields.ListField(null=True, blank=True, max_length=200, db_column='radiusCallingStationId'),
|
||||||
|
),
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='listright',
|
model_name='listright',
|
||||||
name='gid',
|
name='gid',
|
||||||
|
|
|
@ -36,11 +36,18 @@ class Migration(migrations.Migration):
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
migrations.SeparateDatabaseAndState(
|
||||||
|
state_operations=[
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='ldapuser',
|
model_name='ldapuser',
|
||||||
name='login_shell',
|
name='login_shell',
|
||||||
field=ldapdb.models.fields.CharField(blank=True, db_column='loginShell', max_length=200, null=True),
|
field=ldapdb.models.fields.CharField(blank=True, db_column='loginShell', max_length=200, null=True),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
database_operations=[
|
||||||
|
migrations.RunSQL('ALTER TABLE users_ldapuser ADD COLUMN "loginShell" varchar(200) NULL;')
|
||||||
|
],
|
||||||
|
),
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='user',
|
model_name='user',
|
||||||
name='rezo_rez_uid',
|
name='rezo_rez_uid',
|
||||||
|
|
|
@ -13,9 +13,16 @@ class Migration(migrations.Migration):
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
migrations.SeparateDatabaseAndState(
|
||||||
|
state_operations=[
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='ldapuser',
|
model_name='ldapuser',
|
||||||
name='shadowexpire',
|
name='shadowexpire',
|
||||||
field=ldapdb.models.fields.CharField(blank=True, db_column='shadowExpire', max_length=200, null=True),
|
field=ldapdb.models.fields.CharField(blank=True, db_column='shadowExpire', max_length=200, null=True),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
database_operations=[
|
||||||
|
migrations.RunSQL('ALTER TABLE users_ldapuser ADD COLUMN "shadowExpire" varchar(200) NULL;'),
|
||||||
|
]
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
40
users/migrations/0082_auto_20190908_1338.py
Normal file
40
users/migrations/0082_auto_20190908_1338.py
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.11.23 on 2019-09-08 11:38
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
import ldapdb.models.fields
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('users', '0081_auto_20190317_0302'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.SeparateDatabaseAndState(
|
||||||
|
state_operations=[
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='ldapserviceuser',
|
||||||
|
name='dn',
|
||||||
|
field=ldapdb.models.fields.CharField(max_length=200, primary_key=True, serialize=False),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='ldapserviceusergroup',
|
||||||
|
name='dn',
|
||||||
|
field=ldapdb.models.fields.CharField(max_length=200, primary_key=True, serialize=False),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='ldapuser',
|
||||||
|
name='dn',
|
||||||
|
field=ldapdb.models.fields.CharField(max_length=200, primary_key=True, serialize=False),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='ldapusergroup',
|
||||||
|
name='dn',
|
||||||
|
field=ldapdb.models.fields.CharField(max_length=200, primary_key=True, serialize=False),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
]
|
Loading…
Reference in a new issue