-
run
$ cd /opt. -
run
$ sudo git clone https://github.com/persona-dev/persona-server.
-
download and install PostgreSQL.
-
ex)
$ sudo pacman -S postgresqletc.
-
-
create user.
-
ex) persona
-
-
create database.
-
ex) persona
-
-
install sql-migrate
-
create
dbconfig.ymllikesample_dbconfig.yml -
migrate database
-
if you use PostgreSQL, run
sql-migrate up -env="production" -config=dbconfig.yml. -
if you use SQLite3, run
sql-migrate up -env="development" -config=dbconfig.yml.
-
|
Note
|
if you rewrite dbconfig.yml, you should refer to this link: https://github.com/rubenv/sql-migrate#as-a-standalone-tool |
Persona uses RSA key for JWT Authorization.
-
generate RSA key.
-
run
openssl genrsa 2048 -out private-key.pem. -
run
openssl rsa -in private_key.pem -pubout -out public_key.pem.
-
if you create persona-server.service file, you can use journalctl and systemctl.
-
run
sudo groupadd persona -
if you use useradd, run
sudo useradd -r -b /opt/Persona-Server -M -s /usr/bin/nologin -g persona persona -
if you use adduser, run
sudo adduser -r -b /opt/Persona-Server -M -s /usr/bin/nologin --disable-password -G persona persona-
parameter is examples. maybe you should change parameters.
-
-
create
persona-server.servicefile like [persona-server.service].
link:persona-server.service[role=include]|
Note
|
if you use SQLite3 as database, you should rewrite persona-server.service line 7, like [persona-server-sqlite3.service]. |
|
Note
|
Persona defalt use port localhost:3000. if you use different port, you should set environment value PORT, like [persona-server-port.service]. If you want to change database parameters, change environment variable DATABASE_URL in the same way
|
ExecStart=/opt/Persona-Server/persona-serverEnvironment=DATABASE_URL=postgres://persona:@localhost/persona?sslmode=disable PORT=4000you should use mozilla SSL Configuration Generator etc……
And, add to file end like [persona.nginx].
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:3000;
client_max_body_size 16m;
}Please make settings equivalent to [persona.nginx].
if you create persona-server.service, you can use systemctl.
-
run
systemctl start persona. -
run
systemctl enable persona.