Basic
The documentation applies to: v0.9.0
Download LET Portal¶
Because LET Portal is a set of services so we can't package into one installation file. You should download a tag v0.9.0-r1.1 code in this Github repo
After downloading a source code and extracting zip package, you MUST do exactly some steps below.
Step 1: Choose Database to install¶
As we mentioned, you should pick one database for installing LET Portal. LET Portal, by default, requires one database on the same database software. The database name should be:
- letportal: main database, store all data which relate to LET Portal
- cms: cms database, it is an optional to run CMS
Table below contains all default connections which include username/password which are using to connect your database in LET Portal CLI.
Database | Connection String | Username/Password | DB Permission |
---|---|---|---|
MongoDB | mongodb://localhost:27017/letportal | ||
SQLServer | Server=.;Database=letportal;User Id=sa;Password=123456; | sa/123456 | sysadmin |
PostgreSQL | Host=localhost;Port=5432;Database=letportal;Username=postgres;Password=123456 | postgres/123456 | Superuser or (CanLogin and Create databases) |
MySQL | server=localhost;uid=root;pwd=123456;database=letportal | root/123456 |
Step 2: Change configuration files¶
By default, if you install the database with default username/password which we noticed above, you don't need to change any configuration. For changing a correct configuration, you should check carefully these configuration files below:
File | Line | Change to | Note |
---|---|---|---|
src\web-apis\LetPortal.Saturn\appsettings.json | 2 | Your connection string | |
src\web-apis\LetPortal.Saturn\appsettings.Docker.json | 2 | Your connection string | |
src\web-apis\LetPortal.Saturn\appsettings.Production.json | 2 | Your connection string | |
src\web-apis\LetPortal.Saturn\Files\WebsiteCMS\v1.0\appsettings.json | 2 | Your connection string | |
src\web-apis\LetPortal.Saturn\Files\WebsiteCMS\v1.0\appsettings.Docker.json | 2 | Your connection string | |
src\web-apis\LetPortal.Saturn\Files\WebsiteCMS\v1.0\appsettings.Production.json | 2 | Your connection string | |
src\LetPortal.Tools\tools.json | 1 | Your connection string | Find your correct database to change. Ex: MongoDB is MongoStoringConnections section |
src\LetPortal.Tools\tools.json | CMSToolOptions | Your connection string | Find your correct database to change. Ex: MongoDB is MongoStoringConnections section |
For quick preference, this is a sample of one change in Saturn's appsetting.json file. The current database is MongoDB
"DatabaseOptions": {
"ConnectionString": "mongodb://localhost:27017",
"DataSource": "letportal",
"ConnectionType": "MongoDB"
}
"DatabaseOptions": {
"ConnectionString": "Server=.;Database=letportal;User Id=sa;Password=123456;",
"DataSource": "letportal",
"ConnectionType": "SQLServer"
}
ConnectionType
field
MongoDB
SQLServer
PostgreSQL
MySQL
tools.json
This file is used to insert a database connection into Portal database for constructing some dynamic list. You just change an appropriate connection following its database. Also, each database connection group has three child connections: Portal, Identity and Service Management. You should change them to your target database. All target database MUST be the same (ex: all are letportal instead of different name)
Step 3: Run installation script¶
On Windows, open your Powershell (press Win + X A), move to your source code folder then execute
``` powerShell tab="Powershell" .\src\web-apis\installation.ps1
``` bash tab="Ubuntu"
sudo ./src/web-apis/installation.sh
Close Powershell window or logout ubuntu for making sure a script is effective
Step 4: Install Database with CLI¶
You need to run LET Portal CLI for installing database. Before running the CLI, you must know your installing database connection (Ex: IP, Port, SSL) from your executing CLI machine to.
We strongly recommend you to write down the {Your database connection} in Notepad.
Docker - Default and recommended scenario¶
If you run LET Portal with Docker on Local, they have two scenarios: the database stays on Host (your PC) and the database stays on Docker Container.
- Host: You must change the database connection as Step 3, the connection looks like host.docker.internal:{Port}. Then the connection should look like localhost:{Port}. Ex: mongodb://localhost:27017.
- Container: Nothing to change as Step 3, the connection should look like localhost:{Docker Port}. Ex: you bind MongoDb to port 27117:27017 , the connection will be mongodb://localhost:27117
With the connection above and MongoDB is default database, on Docker Container
# The database name should be letportal
letportal portal install -c mongodb://localhost:27117/letportal
letportal portal install -c mongodb://localhost:27117/letportal -pn cms
letportal identity install -c mongodb://localhost:27117/letportal
letportal identity install -c mongodb://localhost:27117/letportal -pn cms
# The database name should be cms
letportal blog install -c mongodb://localhost:27117/cms
With SQL Server, on Docker Host
# The database name should be letportal
letportal portal install -c Server=.;Database=letportal;User Id=sa;Password=123456; -db sqlserver
letportal portal install -c Server=.;Database=letportal;User Id=sa;Password=123456; -pn cms -db sqlserver
letportal identity install -c Server=.;Database=letportal;User Id=sa;Password=123456; -db sqlserver
letportal identity install -c Server=.;Database=letportal;User Id=sa;Password=123456; -pn cms -db sqlserver
# The database name should be cms
letportal blog install -c Server=.;Database=cms;User Id=sa;Password=123456; -db=sqlserver