mirror of
https://github.com/etesync/server
synced 2024-11-26 02:38:15 +00:00
Rename django_etesync to django_etebase.
This commit is contained in:
parent
23b2bb3c0a
commit
d1017aac76
@ -51,4 +51,4 @@ class AppSettings:
|
|||||||
return self._setting("CHALLENGE_VALID_SECONDS", 60)
|
return self._setting("CHALLENGE_VALID_SECONDS", 60)
|
||||||
|
|
||||||
|
|
||||||
app_settings = AppSettings('ETESYNC_')
|
app_settings = AppSettings('ETEBASE_')
|
5
django_etebase/apps.py
Normal file
5
django_etebase/apps.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class DjangoEtebaseConfig(AppConfig):
|
||||||
|
name = 'django_etebase'
|
@ -4,7 +4,7 @@ from django.conf import settings
|
|||||||
import django.core.validators
|
import django.core.validators
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
import django_etesync.models
|
import django_etebase.models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
@ -35,7 +35,7 @@ class Migration(migrations.Migration):
|
|||||||
('uid', models.CharField(db_index=True, max_length=44, null=True, validators=[django.core.validators.RegexValidator(message='Not a valid UID', regex='[a-zA-Z0-9]')])),
|
('uid', models.CharField(db_index=True, max_length=44, null=True, validators=[django.core.validators.RegexValidator(message='Not a valid UID', regex='[a-zA-Z0-9]')])),
|
||||||
('version', models.PositiveSmallIntegerField()),
|
('version', models.PositiveSmallIntegerField()),
|
||||||
('encryptionKey', models.BinaryField(editable=True, null=True)),
|
('encryptionKey', models.BinaryField(editable=True, null=True)),
|
||||||
('collection', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='django_etesync.Collection')),
|
('collection', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='django_etebase.Collection')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'unique_together': {('uid', 'collection')},
|
'unique_together': {('uid', 'collection')},
|
||||||
@ -46,8 +46,8 @@ class Migration(migrations.Migration):
|
|||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('uid', models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Expected a 256bit base64url.', regex='^[a-zA-Z0-9\\-_]{43}$')])),
|
('uid', models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Expected a 256bit base64url.', regex='^[a-zA-Z0-9\\-_]{43}$')])),
|
||||||
('chunkFile', models.FileField(max_length=150, unique=True, upload_to=django_etesync.models.chunk_directory_path)),
|
('chunkFile', models.FileField(max_length=150, unique=True, upload_to=django_etebase.models.chunk_directory_path)),
|
||||||
('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='chunks', to='django_etesync.CollectionItem')),
|
('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='chunks', to='django_etebase.CollectionItem')),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
@ -58,7 +58,7 @@ class Migration(migrations.Migration):
|
|||||||
('meta', models.BinaryField(editable=True)),
|
('meta', models.BinaryField(editable=True)),
|
||||||
('current', models.BooleanField(db_index=True, default=True, null=True)),
|
('current', models.BooleanField(db_index=True, default=True, null=True)),
|
||||||
('deleted', models.BooleanField(default=False)),
|
('deleted', models.BooleanField(default=False)),
|
||||||
('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='revisions', to='django_etesync.CollectionItem')),
|
('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='revisions', to='django_etebase.CollectionItem')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'unique_together': {('item', 'current')},
|
'unique_together': {('item', 'current')},
|
||||||
@ -68,8 +68,8 @@ class Migration(migrations.Migration):
|
|||||||
name='RevisionChunkRelation',
|
name='RevisionChunkRelation',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('chunk', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='revisions_relation', to='django_etesync.CollectionItemChunk')),
|
('chunk', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='revisions_relation', to='django_etebase.CollectionItemChunk')),
|
||||||
('revision', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='chunks_relation', to='django_etesync.CollectionItemRevision')),
|
('revision', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='chunks_relation', to='django_etebase.CollectionItemRevision')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'ordering': ('id',),
|
'ordering': ('id',),
|
||||||
@ -81,7 +81,7 @@ class Migration(migrations.Migration):
|
|||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('encryptionKey', models.BinaryField(editable=True)),
|
('encryptionKey', models.BinaryField(editable=True)),
|
||||||
('accessLevel', models.CharField(choices=[('adm', 'Admin'), ('rw', 'Read Write'), ('ro', 'Read Only')], default='ro', max_length=3)),
|
('accessLevel', models.CharField(choices=[('adm', 'Admin'), ('rw', 'Read Write'), ('ro', 'Read Only')], default='ro', max_length=3)),
|
||||||
('collection', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='members', to='django_etesync.Collection')),
|
('collection', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='members', to='django_etebase.Collection')),
|
||||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
@ -9,7 +9,7 @@ class Migration(migrations.Migration):
|
|||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('myauth', '0001_initial'),
|
('myauth', '0001_initial'),
|
||||||
('django_etesync', '0001_initial'),
|
('django_etebase', '0001_initial'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
@ -10,7 +10,7 @@ class Migration(migrations.Migration):
|
|||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
('django_etesync', '0002_userinfo'),
|
('django_etebase', '0002_userinfo'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -21,7 +21,7 @@ class Migration(migrations.Migration):
|
|||||||
('uid', models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Expected a 256bit base64url.', regex='^[a-zA-Z0-9\\-_]{43}$')])),
|
('uid', models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Expected a 256bit base64url.', regex='^[a-zA-Z0-9\\-_]{43}$')])),
|
||||||
('signedEncryptionKey', models.BinaryField()),
|
('signedEncryptionKey', models.BinaryField()),
|
||||||
('accessLevel', models.CharField(choices=[('adm', 'Admin'), ('rw', 'Read Write'), ('ro', 'Read Only')], default='ro', max_length=3)),
|
('accessLevel', models.CharField(choices=[('adm', 'Admin'), ('rw', 'Read Write'), ('ro', 'Read Only')], default='ro', max_length=3)),
|
||||||
('fromMember', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='django_etesync.CollectionMember')),
|
('fromMember', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='django_etebase.CollectionMember')),
|
||||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='incoming_invitations', to=settings.AUTH_USER_MODEL)),
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='incoming_invitations', to=settings.AUTH_USER_MODEL)),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
@ -6,7 +6,7 @@ from django.db import migrations, models
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('django_etesync', '0003_collectioninvitation'),
|
('django_etebase', '0003_collectioninvitation'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
@ -6,7 +6,7 @@ from django.db import migrations
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('django_etesync', '0004_collectioninvitation_version'),
|
('django_etebase', '0004_collectioninvitation_version'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
@ -6,7 +6,7 @@ from django.db import migrations, models
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('django_etesync', '0005_auto_20200526_1021'),
|
('django_etebase', '0005_auto_20200526_1021'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
@ -7,7 +7,7 @@ from django.db import migrations, models
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('django_etesync', '0006_auto_20200526_1040'),
|
('django_etebase', '0006_auto_20200526_1040'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
@ -3,13 +3,13 @@
|
|||||||
import django.core.validators
|
import django.core.validators
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
import django_etesync.models
|
import django_etebase.models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('django_etesync', '0007_auto_20200526_1336'),
|
('django_etebase', '0007_auto_20200526_1336'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -17,12 +17,12 @@ class Migration(migrations.Migration):
|
|||||||
name='Stoken',
|
name='Stoken',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('uid', models.CharField(db_index=True, default=django_etesync.models.generate_stoken_uid, max_length=43, unique=True, validators=[django.core.validators.RegexValidator(message='Expected a base64url.', regex='^[a-zA-Z0-9\\-_]{42,43}$')])),
|
('uid', models.CharField(db_index=True, default=django_etebase.models.generate_stoken_uid, max_length=43, unique=True, validators=[django.core.validators.RegexValidator(message='Expected a base64url.', regex='^[a-zA-Z0-9\\-_]{42,43}$')])),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='collectionitemrevision',
|
model_name='collectionitemrevision',
|
||||||
name='stoken',
|
name='stoken',
|
||||||
field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.PROTECT, to='django_etesync.Stoken'),
|
field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.PROTECT, to='django_etebase.Stoken'),
|
||||||
),
|
),
|
||||||
]
|
]
|
@ -4,8 +4,8 @@ from django.db import migrations
|
|||||||
|
|
||||||
|
|
||||||
def create_stokens(apps, schema_editor):
|
def create_stokens(apps, schema_editor):
|
||||||
Stoken = apps.get_model('django_etesync', 'Stoken')
|
Stoken = apps.get_model('django_etebase', 'Stoken')
|
||||||
CollectionItemRevision = apps.get_model('django_etesync', 'CollectionItemRevision')
|
CollectionItemRevision = apps.get_model('django_etebase', 'CollectionItemRevision')
|
||||||
|
|
||||||
for rev in CollectionItemRevision.objects.all():
|
for rev in CollectionItemRevision.objects.all():
|
||||||
rev.stoken = Stoken.objects.create()
|
rev.stoken = Stoken.objects.create()
|
||||||
@ -15,7 +15,7 @@ def create_stokens(apps, schema_editor):
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('django_etesync', '0008_auto_20200526_1535'),
|
('django_etebase', '0008_auto_20200526_1535'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
@ -7,13 +7,13 @@ import django.db.models.deletion
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('django_etesync', '0009_auto_20200526_1535'),
|
('django_etebase', '0009_auto_20200526_1535'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='collectionitemrevision',
|
model_name='collectionitemrevision',
|
||||||
name='stoken',
|
name='stoken',
|
||||||
field=models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to='django_etesync.Stoken'),
|
field=models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to='django_etebase.Stoken'),
|
||||||
),
|
),
|
||||||
]
|
]
|
@ -7,13 +7,13 @@ import django.db.models.deletion
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('django_etesync', '0010_auto_20200526_1539'),
|
('django_etebase', '0010_auto_20200526_1539'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='collectionmember',
|
model_name='collectionmember',
|
||||||
name='stoken',
|
name='stoken',
|
||||||
field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.PROTECT, to='django_etesync.Stoken'),
|
field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.PROTECT, to='django_etebase.Stoken'),
|
||||||
),
|
),
|
||||||
]
|
]
|
@ -4,8 +4,8 @@ from django.db import migrations
|
|||||||
|
|
||||||
|
|
||||||
def create_stokens(apps, schema_editor):
|
def create_stokens(apps, schema_editor):
|
||||||
Stoken = apps.get_model('django_etesync', 'Stoken')
|
Stoken = apps.get_model('django_etebase', 'Stoken')
|
||||||
CollectionMember = apps.get_model('django_etesync', 'CollectionMember')
|
CollectionMember = apps.get_model('django_etebase', 'CollectionMember')
|
||||||
|
|
||||||
for member in CollectionMember.objects.all():
|
for member in CollectionMember.objects.all():
|
||||||
member.stoken = Stoken.objects.create()
|
member.stoken = Stoken.objects.create()
|
||||||
@ -15,7 +15,7 @@ def create_stokens(apps, schema_editor):
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('django_etesync', '0011_collectionmember_stoken'),
|
('django_etebase', '0011_collectionmember_stoken'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
@ -9,7 +9,7 @@ class Migration(migrations.Migration):
|
|||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
('django_etesync', '0012_auto_20200527_0743'),
|
('django_etebase', '0012_auto_20200527_0743'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -17,8 +17,8 @@ class Migration(migrations.Migration):
|
|||||||
name='CollectionMemberRemoved',
|
name='CollectionMemberRemoved',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('collection', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='removed_members', to='django_etesync.Collection')),
|
('collection', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='removed_members', to='django_etebase.Collection')),
|
||||||
('stoken', models.OneToOneField(null=True, on_delete=django.db.models.deletion.PROTECT, to='django_etesync.Stoken')),
|
('stoken', models.OneToOneField(null=True, on_delete=django.db.models.deletion.PROTECT, to='django_etebase.Stoken')),
|
||||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
@ -6,7 +6,7 @@ from django.db import migrations
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('django_etesync', '0013_collectionmemberremoved'),
|
('django_etebase', '0013_collectionmemberremoved'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
@ -6,7 +6,7 @@ from django.db import migrations, models
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('django_etesync', '0014_auto_20200602_1558'),
|
('django_etebase', '0014_auto_20200602_1558'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
@ -13,7 +13,7 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from rest_framework import permissions
|
from rest_framework import permissions
|
||||||
from django_etesync.models import Collection, AccessLevels
|
from django_etebase.models import Collection, AccessLevels
|
||||||
|
|
||||||
|
|
||||||
def is_collection_admin(collection, user):
|
def is_collection_admin(collection, user):
|
@ -2,4 +2,4 @@ from django.apps import AppConfig
|
|||||||
|
|
||||||
|
|
||||||
class TokenAuthConfig(AppConfig):
|
class TokenAuthConfig(AppConfig):
|
||||||
name = 'django_etesync.token_auth'
|
name = 'django_etebase.token_auth'
|
@ -3,7 +3,7 @@
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
from django_etesync.token_auth import models as token_auth_models
|
from django_etebase.token_auth import models as token_auth_models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
@ -534,7 +534,7 @@ class AuthenticationViewSet(viewsets.ViewSet):
|
|||||||
|
|
||||||
def get_encryption_key(self, salt):
|
def get_encryption_key(self, salt):
|
||||||
key = nacl.hash.blake2b(settings.SECRET_KEY.encode(), encoder=nacl.encoding.RawEncoder)
|
key = nacl.hash.blake2b(settings.SECRET_KEY.encode(), encoder=nacl.encoding.RawEncoder)
|
||||||
return nacl.hash.blake2b(b'', key=key, salt=salt[:nacl.hash.BLAKE2B_SALTBYTES], person=b'etesync-auth',
|
return nacl.hash.blake2b(b'', key=key, salt=salt[:nacl.hash.BLAKE2B_SALTBYTES], person=b'etebase-auth',
|
||||||
encoder=nacl.encoding.RawEncoder)
|
encoder=nacl.encoding.RawEncoder)
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
@ -1,5 +0,0 @@
|
|||||||
from django.apps import AppConfig
|
|
||||||
|
|
||||||
|
|
||||||
class DjangoEtesyncConfig(AppConfig):
|
|
||||||
name = 'django_etesync'
|
|
Loading…
Reference in New Issue
Block a user