A set of scripts for initialization of PlaceOS.
The scripts are methods wrapped by a sam.cr interface. Most use named arguments which are used as described here.
Execute scripts as one-off container jobs.
# Create a set of placeholder documents
docker run -it placeos/init make sam create:placeholder
# Create an Authority
docker run -it placeos/init make sam create:authority domain="localhost:8080"
# Create a User
docker run -it placeos/init make sam create:user \
authority_id="s0mek1nd4UUID" \
email="[email protected]" \
username="burger" \
password="burgerR00lz" \
sys_admin=true \
support=true
The default entrypoint to the container generates a User, Authority, and Application dependent on the environment variables below.
email
:PLACE_EMAIL
, required.username
:PLACE_USERNAME
, required.password
:PLACE_PASSWORD
, required.application_name
:PLACE_APPLICATION
||"backoffice"
domain
:PLACE_DOMAIN
||"localhost:8080"
tls
:PLACE_TLS == "true"
auth_host
:PLACE_AUTH_HOST
||"auth"
development
:ENV == "development"
-
create:placeholders
: Creates a representative set of documents in RethinkDB -
create:authority
: Creates an Authoritydomain
: Defaults toPLACE_DOMAIN
||"localhost:8080"
tls
: Defaults toPLACE_TLS
||false
-
create:application
: Creates an Applicationauthority
: Authority ID. Required.base
: Defaults to"http://localhost:8080"
name
: Defaults to"backoffice"
redirect_uri
: Defaults to"#{base}/#{name}/oauth-resp.html"
scope
: Defaults to"public"
-
create:user
: Creates a Userauthority_id
: Id of Authority. Required.email
: Email of user. Required.username
: Username of user. Required.password
: Password of user. Required.sys_admin
: Defaults tofalse
support
: Defaults tofalse
-
drop
: Drops Elasticsearch and RethinkDB- Runs
drop:elastic
anddrop:db
via environmental configuration
- Runs
-
drop:elastic
: Deletes all elastic indices tableshost
: Defaults toES_HOST
||"localhost"
port
: Defaults toES_PORT
||9200
-
drop:db
: Drops all RethinkDB tableshost
: Defaults toRETHINKDB_HOST
||"localhost"
port
: Defaults toRETHINKDB_PORT
||28015
user
: Defaults toRETHINKDB_USER
||"admin"
password
: Defaults toRETHINKDB_PASS
||""
- Create a function in a relevant file under
src/tasks
- Write the sam binding in
src/sam.cr
- Document it