Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Essem
Sharkey
Commits
85134b51
Commit
85134b51
authored
7 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
Fix config init script
parent
21ebd9a3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/init.js
+108
-130
108 additions, 130 deletions
tools/init.js
with
108 additions
and
130 deletions
tools/init.js
+
108
−
130
View file @
85134b51
...
...
@@ -7,140 +7,119 @@ const chalk = require('chalk');
const
configDirPath
=
`
${
__dirname
}
/../.config`
;
const
configPath
=
`
${
configDirPath
}
/default.yml`
;
const
form
=
[
{
type
:
'
input
'
,
name
:
'
maintainer
'
,
message
:
'
Maintainer name(and email address):
'
},
{
type
:
'
input
'
,
name
:
'
url
'
,
message
:
'
PRIMARY URL:
'
},
{
type
:
'
input
'
,
name
:
'
secondary_url
'
,
message
:
'
SECONDARY URL:
'
},
{
type
:
'
input
'
,
name
:
'
port
'
,
message
:
'
Listen port:
'
},
{
type
:
'
confirm
'
,
name
:
'
https
'
,
message
:
'
Use TLS?
'
,
default
:
false
},
{
type
:
'
input
'
,
name
:
'
https_key
'
,
message
:
'
Path of tls key:
'
,
when
:
ctx
=>
ctx
.
https
},
{
type
:
'
input
'
,
name
:
'
https_cert
'
,
message
:
'
Path of tls cert:
'
,
when
:
ctx
=>
ctx
.
https
},
{
type
:
'
input
'
,
name
:
'
https_ca
'
,
message
:
'
Path of tls ca:
'
,
when
:
ctx
=>
ctx
.
https
},
{
type
:
'
input
'
,
name
:
'
mongo_host
'
,
message
:
'
MongoDB
\'
s host:
'
,
default
:
'
localhost
'
},
{
type
:
'
input
'
,
name
:
'
mongo_port
'
,
message
:
'
MongoDB
\'
s port:
'
,
default
:
'
27017
'
},
{
type
:
'
input
'
,
name
:
'
mongo_db
'
,
message
:
'
MongoDB
\'
s db:
'
,
default
:
'
misskey
'
},
{
type
:
'
input
'
,
name
:
'
mongo_user
'
,
message
:
'
MongoDB
\'
s user:
'
},
{
type
:
'
password
'
,
name
:
'
mongo_pass
'
,
message
:
'
MongoDB
\'
s password:
'
},
{
type
:
'
input
'
,
name
:
'
redis_host
'
,
message
:
'
Redis
\'
s host:
'
,
default
:
'
localhost
'
},
{
type
:
'
input
'
,
name
:
'
redis_port
'
,
message
:
'
Redis
\'
s port:
'
,
default
:
'
6379
'
},
{
type
:
'
password
'
,
name
:
'
redis_pass
'
,
message
:
'
Redis
\'
s password:
'
},
{
type
:
'
confirm
'
,
name
:
'
elasticsearch
'
,
message
:
'
Use Elasticsearch?
'
,
default
:
false
},
{
type
:
'
input
'
,
name
:
'
es_host
'
,
message
:
'
Elasticsearch
\'
s host:
'
,
default
:
'
localhost
'
,
when
:
ctx
=>
ctx
.
elasticsearch
},
{
type
:
'
input
'
,
name
:
'
es_port
'
,
message
:
'
Elasticsearch
\'
s port:
'
,
default
:
'
9200
'
,
when
:
ctx
=>
ctx
.
elasticsearch
},
{
type
:
'
password
'
,
name
:
'
es_pass
'
,
message
:
'
Elasticsearch
\'
s password:
'
,
when
:
ctx
=>
ctx
.
elasticsearch
},
{
type
:
'
input
'
,
name
:
'
recaptcha_site
'
,
message
:
'
reCAPTCHA
\'
s site key:
'
},
{
type
:
'
input
'
,
name
:
'
recaptcha_secret
'
,
message
:
'
reCAPTCHA
\'
s secret key:
'
}
];
const
form
=
[{
type
:
'
input
'
,
name
:
'
maintainerName
'
,
message
:
'
Your name:
'
},
{
type
:
'
input
'
,
name
:
'
maintainerUrl
'
,
message
:
'
Your home page URL or your mailto URL:
'
},
{
type
:
'
input
'
,
name
:
'
url
'
,
message
:
'
URL you want to run Misskey:
'
},
{
type
:
'
input
'
,
name
:
'
port
'
,
message
:
'
Listen port (e.g. 443):
'
},
{
type
:
'
confirm
'
,
name
:
'
https
'
,
message
:
'
Use TLS?
'
,
default
:
false
},
{
type
:
'
input
'
,
name
:
'
https_key
'
,
message
:
'
Path of tls key:
'
,
when
:
ctx
=>
ctx
.
https
},
{
type
:
'
input
'
,
name
:
'
https_cert
'
,
message
:
'
Path of tls cert:
'
,
when
:
ctx
=>
ctx
.
https
},
{
type
:
'
input
'
,
name
:
'
https_ca
'
,
message
:
'
Path of tls ca:
'
,
when
:
ctx
=>
ctx
.
https
},
{
type
:
'
input
'
,
name
:
'
mongo_host
'
,
message
:
'
MongoDB
\'
s host:
'
,
default
:
'
localhost
'
},
{
type
:
'
input
'
,
name
:
'
mongo_port
'
,
message
:
'
MongoDB
\'
s port:
'
,
default
:
'
27017
'
},
{
type
:
'
input
'
,
name
:
'
mongo_db
'
,
message
:
'
MongoDB
\'
s db:
'
,
default
:
'
misskey
'
},
{
type
:
'
input
'
,
name
:
'
mongo_user
'
,
message
:
'
MongoDB
\'
s user:
'
},
{
type
:
'
password
'
,
name
:
'
mongo_pass
'
,
message
:
'
MongoDB
\'
s password:
'
},
{
type
:
'
input
'
,
name
:
'
redis_host
'
,
message
:
'
Redis
\'
s host:
'
,
default
:
'
localhost
'
},
{
type
:
'
input
'
,
name
:
'
redis_port
'
,
message
:
'
Redis
\'
s port:
'
,
default
:
'
6379
'
},
{
type
:
'
password
'
,
name
:
'
redis_pass
'
,
message
:
'
Redis
\'
s password:
'
},
{
type
:
'
confirm
'
,
name
:
'
elasticsearch
'
,
message
:
'
Use Elasticsearch?
'
,
default
:
false
},
{
type
:
'
input
'
,
name
:
'
es_host
'
,
message
:
'
Elasticsearch
\'
s host:
'
,
default
:
'
localhost
'
,
when
:
ctx
=>
ctx
.
elasticsearch
},
{
type
:
'
input
'
,
name
:
'
es_port
'
,
message
:
'
Elasticsearch
\'
s port:
'
,
default
:
'
9200
'
,
when
:
ctx
=>
ctx
.
elasticsearch
},
{
type
:
'
password
'
,
name
:
'
es_pass
'
,
message
:
'
Elasticsearch
\'
s password:
'
,
when
:
ctx
=>
ctx
.
elasticsearch
},
{
type
:
'
input
'
,
name
:
'
recaptcha_site
'
,
message
:
'
reCAPTCHA
\'
s site key:
'
},
{
type
:
'
input
'
,
name
:
'
recaptcha_secret
'
,
message
:
'
reCAPTCHA
\'
s secret key:
'
}];
inquirer
.
prompt
(
form
).
then
(
as
=>
{
// Mapping answers
const
conf
=
{
maintainer
:
as
[
'
maintainer
'
],
maintainer
:
{
name
:
as
[
'
maintainerName
'
],
url
:
as
[
'
maintainerUrl
'
]
},
url
:
as
[
'
url
'
],
secondary_url
:
as
[
'
secondary_url
'
],
port
:
parseInt
(
as
[
'
port
'
],
10
),
https
:
{
enable
:
as
[
'
https
'
],
...
...
@@ -175,7 +154,6 @@ inquirer.prompt(form).then(as => {
console
.
log
(
`Thanks. Writing the configuration to
${
chalk
.
bold
(
path
.
resolve
(
configPath
))}
`
);
try
{
fs
.
mkdirSync
(
configDirPath
);
fs
.
writeFileSync
(
configPath
,
yaml
.
dump
(
conf
));
console
.
log
(
chalk
.
green
(
'
Well done.
'
));
}
catch
(
e
)
{
...
...
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