Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
interfect
funkwhale
Commits
2b9a5ffe
Verified
Commit
2b9a5ffe
authored
Mar 31, 2018
by
Eliot Berriot
Browse files
ActivityPub Actor model
parent
22370d1b
Changes
3
Hide whitespace changes
Inline
Side-by-side
api/funkwhale_api/federation/migrations/0001_initial.py
0 → 100644
View file @
2b9a5ffe
# Generated by Django 2.0.3 on 2018-03-31 13:43
from
django.db
import
migrations
,
models
import
django.utils.timezone
class
Migration
(
migrations
.
Migration
):
initial
=
True
dependencies
=
[
]
operations
=
[
migrations
.
CreateModel
(
name
=
'Actor'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'url'
,
models
.
URLField
(
db_index
=
True
,
max_length
=
500
,
unique
=
True
)),
(
'outbox_url'
,
models
.
URLField
(
max_length
=
500
)),
(
'inbox_url'
,
models
.
URLField
(
max_length
=
500
)),
(
'following_url'
,
models
.
URLField
(
blank
=
True
,
max_length
=
500
,
null
=
True
)),
(
'followers_url'
,
models
.
URLField
(
blank
=
True
,
max_length
=
500
,
null
=
True
)),
(
'shared_inbox_url'
,
models
.
URLField
(
blank
=
True
,
max_length
=
500
,
null
=
True
)),
(
'type'
,
models
.
CharField
(
choices
=
[(
'Person'
,
'Person'
),
(
'Application'
,
'Application'
),
(
'Group'
,
'Group'
),
(
'Organization'
,
'Organization'
),
(
'Service'
,
'Service'
)],
default
=
'Person'
,
max_length
=
25
)),
(
'name'
,
models
.
CharField
(
blank
=
True
,
max_length
=
200
,
null
=
True
)),
(
'domain'
,
models
.
CharField
(
max_length
=
1000
)),
(
'summary'
,
models
.
CharField
(
blank
=
True
,
max_length
=
500
,
null
=
True
)),
(
'preferred_username'
,
models
.
CharField
(
blank
=
True
,
max_length
=
200
,
null
=
True
)),
(
'public_key'
,
models
.
CharField
(
blank
=
True
,
max_length
=
5000
,
null
=
True
)),
(
'private_key'
,
models
.
CharField
(
blank
=
True
,
max_length
=
5000
,
null
=
True
)),
(
'creation_date'
,
models
.
DateTimeField
(
default
=
django
.
utils
.
timezone
.
now
)),
(
'last_fetch_date'
,
models
.
DateTimeField
(
default
=
django
.
utils
.
timezone
.
now
)),
(
'manually_approves_followers'
,
models
.
NullBooleanField
(
default
=
None
)),
],
),
]
api/funkwhale_api/federation/migrations/__init__.py
0 → 100644
View file @
2b9a5ffe
api/funkwhale_api/federation/models.py
0 → 100644
View file @
2b9a5ffe
from
django.conf
import
settings
from
django.db
import
models
from
django.utils
import
timezone
TYPE_CHOICES
=
[
(
'Person'
,
'Person'
),
(
'Application'
,
'Application'
),
(
'Group'
,
'Group'
),
(
'Organization'
,
'Organization'
),
(
'Service'
,
'Service'
),
]
class
Actor
(
models
.
Model
):
url
=
models
.
URLField
(
unique
=
True
,
max_length
=
500
,
db_index
=
True
)
outbox_url
=
models
.
URLField
(
max_length
=
500
)
inbox_url
=
models
.
URLField
(
max_length
=
500
)
following_url
=
models
.
URLField
(
max_length
=
500
,
null
=
True
,
blank
=
True
)
followers_url
=
models
.
URLField
(
max_length
=
500
,
null
=
True
,
blank
=
True
)
shared_inbox_url
=
models
.
URLField
(
max_length
=
500
,
null
=
True
,
blank
=
True
)
type
=
models
.
CharField
(
choices
=
TYPE_CHOICES
,
default
=
'Person'
,
max_length
=
25
)
name
=
models
.
CharField
(
max_length
=
200
,
null
=
True
,
blank
=
True
)
domain
=
models
.
CharField
(
max_length
=
1000
)
summary
=
models
.
CharField
(
max_length
=
500
,
null
=
True
,
blank
=
True
)
preferred_username
=
models
.
CharField
(
max_length
=
200
,
null
=
True
,
blank
=
True
)
public_key
=
models
.
CharField
(
max_length
=
5000
,
null
=
True
,
blank
=
True
)
private_key
=
models
.
CharField
(
max_length
=
5000
,
null
=
True
,
blank
=
True
)
creation_date
=
models
.
DateTimeField
(
default
=
timezone
.
now
)
last_fetch_date
=
models
.
DateTimeField
(
default
=
timezone
.
now
)
manually_approves_followers
=
models
.
NullBooleanField
(
default
=
None
)
@
property
def
webfinger_subject
(
self
):
return
'{}@{}'
.
format
(
self
.
preferred_username
,
settings
.
FEDERATION_HOSTNAME
,
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment