Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pleroma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alex Gleason
pleroma
Commits
c20530e7
Commit
c20530e7
authored
7 years ago
by
Roger Braun
Browse files
Options
Downloads
Patches
Plain Diff
Add configuration option for registrations.
parent
50409326
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
config/config.exs
+2
-1
2 additions, 1 deletion
config/config.exs
lib/pleroma/web/router.ex
+6
-1
6 additions, 1 deletion
lib/pleroma/web/router.ex
lib/pleroma/web/twitter_api/controllers/util_controller.ex
+3
-1
3 additions, 1 deletion
lib/pleroma/web/twitter_api/controllers/util_controller.ex
with
11 additions
and
3 deletions
config/config.exs
+
2
−
1
View file @
c20530e7
...
...
@@ -44,7 +44,8 @@
version:
version
,
name:
"Pleroma"
,
email:
"example@example.com"
,
limit:
5000
limit:
5000
,
registrations_open:
true
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
...
...
This diff is collapsed.
Click to expand it.
lib/pleroma/web/router.ex
+
6
−
1
View file @
c20530e7
...
...
@@ -98,6 +98,9 @@ def user_fetcher(username) do
get
"/statusnet/version"
,
TwitterAPI
.
UtilController
,
:version
end
@instance
Application
.
get_env
(
:pleroma
,
:instance
)
@registrations_open
Keyword
.
get
(
@instance
,
:registrations_open
)
scope
"/api"
,
Pleroma
.
Web
do
pipe_through
:api
...
...
@@ -110,7 +113,9 @@ def user_fetcher(username) do
get
"/statuses/show/:id"
,
TwitterAPI
.
Controller
,
:fetch_status
get
"/statusnet/conversation/:id"
,
TwitterAPI
.
Controller
,
:fetch_conversation
post
"/account/register"
,
TwitterAPI
.
Controller
,
:register
if
@registrations_open
do
post
"/account/register"
,
TwitterAPI
.
Controller
,
:register
end
get
"/externalprofile/show"
,
TwitterAPI
.
Controller
,
:external_profile
end
...
...
This diff is collapsed.
Click to expand it.
lib/pleroma/web/twitter_api/controllers/util_controller.ex
+
3
−
1
View file @
c20530e7
...
...
@@ -16,6 +16,7 @@ def config(conn, _params) do
<name>#{Keyword.get(@instance, :name)}</name>
<site>#{Web.base_url}</site>
<textlimit>#{Keyword.get(@instance, :limit)}</textlimit>
<closed>#{!Keyword.get(@instance, :registrations_open)}</closed>
</site>
</config>
"""
...
...
@@ -27,7 +28,8 @@ def config(conn, _params) do
site:
%{
name:
Keyword
.
get
(
@instance
,
:name
),
server:
Web
.
base_url
,
textlimit:
Keyword
.
get
(
@instance
,
:limit
)
textlimit:
Keyword
.
get
(
@instance
,
:limit
),
closed:
if
(
Keyword
.
get
(
@instance
,
:registrations_open
),
do
:
"0"
,
else
:
"1"
)
}
})
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment