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
freon
pleroma
Commits
5e4fe0e8
Commit
5e4fe0e8
authored
5 years ago
by
rinpatch
Browse files
Options
Downloads
Patches
Plain Diff
instance.gen task: fix crash when using custom static directory
Closes #1082
parent
d240ce41
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/mix/tasks/pleroma/instance.ex
+4
-0
4 additions, 0 deletions
lib/mix/tasks/pleroma/instance.ex
test/tasks/instance_test.exs
+4
-1
4 additions, 1 deletion
test/tasks/instance_test.exs
with
8 additions
and
1 deletion
lib/mix/tasks/pleroma/instance.ex
+
4
−
0
View file @
5e4fe0e8
...
...
@@ -6,6 +6,8 @@ defmodule Mix.Tasks.Pleroma.Instance do
use
Mix
.
Task
import
Mix
.
Pleroma
alias
Pleroma
.
Config
@shortdoc
"Manages Pleroma instance"
@moduledoc
File
.
read!
(
"docs/administration/CLI_tasks/instance.md"
)
...
...
@@ -153,6 +155,8 @@ def run(["gen" | rest]) do
Pleroma
.
Config
.
get
([
:instance
,
:static_dir
])
)
Config
.
put
([
:instance
,
:static_dir
],
static_dir
)
secret
=
:crypto
.
strong_rand_bytes
(
64
)
|>
Base
.
encode64
()
|>
binary_part
(
0
,
64
)
jwt_secret
=
:crypto
.
strong_rand_bytes
(
64
)
|>
Base
.
encode64
()
|>
binary_part
(
0
,
64
)
signing_salt
=
:crypto
.
strong_rand_bytes
(
8
)
|>
Base
.
encode64
()
|>
binary_part
(
0
,
8
)
...
...
This diff is collapsed.
Click to expand it.
test/tasks/instance_test.exs
+
4
−
1
View file @
5e4fe0e8
...
...
@@ -3,9 +3,10 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule
Pleroma
.
InstanceTest
do
use
ExUnit
.
Case
,
async:
true
use
ExUnit
.
Case
setup
do
static_dir
=
Pleroma
.
Config
.
get
([
:instance
,
:static_dir
])
File
.
mkdir_p!
(
tmp_path
())
on_exit
(
fn
->
...
...
@@ -15,6 +16,8 @@ defmodule Pleroma.InstanceTest do
if
File
.
exists?
(
static_dir
)
do
File
.
rm_rf
(
Path
.
join
(
static_dir
,
"robots.txt"
))
end
Pleroma
.
Config
.
put
([
:instance
,
:static_dir
],
static_dir
)
end
)
:ok
...
...
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