Skip to content

Commit dc480c4

Browse files
authored
Update README.md
1 parent 9363d2d commit dc480c4

File tree

1 file changed

+79
-139
lines changed

1 file changed

+79
-139
lines changed

Diff for: README.md

+79-139
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@ Use this guide to start MC-IAM-MANAGER using the docker. The Quick Start guide s
2626
- Ubuntu (22.04 is tested) with external access (https-443, http-80, ssh-ANY)
2727
- docker and docker-compose
2828
- Domain (for Keycloak and Public buffalo) and Email for register SSL with certbot
29-
- Stop or Disable Services using 80 or 443 ports such as nginx
3029

3130
### Step one : Clone this repo
3231

3332
```bash
34-
git clone https://github.com/m-cmp/mc-iam-manager <YourFolderName>
33+
git clone <https://github.com/m-cmp/mc-iam-manager> <YourFolderName>
3534
```
3635

3736
### Step two : Go to Scripts Folder
@@ -40,168 +39,109 @@ git clone https://github.com/m-cmp/mc-iam-manager <YourFolderName>
4039
cd <YourFolderName>/scripts
4140
```
4241

43-
### Step three : Excute generate_nginx_conf.sh
42+
### Step three : Excute keycloakimportsetting.sh
4443

4544
```bash
46-
./generate_nginx_conf.sh
45+
./keycloakimportsetting.sh
4746

48-
# >.env (DOMAIN): yourdomain.com
49-
# >.env (EMAIL): [email protected]
47+
## MC-IAM-MANAGER Init Setup ##
48+
- Please enter the changes. If not, use the environment variable.
49+
- You can set Values in ./.mciammanager_init_env
5050

51-
================================================
52-
* DOMAIN = yourdomain.com
53-
54-
================================================
55-
56-
** Nginx configuration file has been created at ./nginx/nginx.conf **
57-
```
58-
59-
This process creates two versions of nginx.conf:
60-
61-
the first (nginx-cert.conf) to receive SSL certificates and the second (nginx.conf) to set up an internal proxy for mc-iam-manager and keycloak, and certbot, as well as an SSL reverse proxy
62-
63-
### Step four : Excute init docker-compose for SSL setup
64-
65-
```bash
66-
docker-compose -f docker-compose.init.yml up
67-
# check the log "Successfully received certificate." and "ertbot exited with code 0"
68-
# ctrl + C to exit docker-compose and shutdown with below command
69-
docker-compose -f docker-compose.init.yml down
70-
```
71-
72-
This process creates a SSL certificate in the `~/.m-cmp/data/certbot` path through the nginx-cert.conf setting. ****If you have checked the console log (Successfully received certificate. ~~ certbot exited with code 0) as below, you have successfully issued an SSL certificate and created it at the designated location.
73-
74-
```bash
75-
$ docker-compose -f docker-compose.init.yml up
76-
....
77-
certbot | Successfully received certificate.
78-
certbot | Certificate is saved at: /etc/letsencrypt/live/yourdomain.com/fullchain.pem
79-
certbot | Key is saved at: /etc/letsencrypt/live/yourdomain.com/privkey.pem
80-
certbot | This certificate expires on 2024-09-11.
81-
certbot | These files will be updated when the certificate renews.
82-
certbot | NEXT STEPS:
83-
certbot | - The certificate will need to be renewed before it expires. Certbot can automatically renew the certificate in the background, but you may need to take steps to enable that functionality. See https://certbot.org/renewal-setup for instructions.
84-
certbot |
85-
certbot | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
86-
certbot | If you like Certbot, please consider supporting our work by:
87-
certbot | * Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
88-
certbot | * Donating to EFF: https://eff.org/donate-le
89-
certbot | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
90-
certbot exited with code 0
51+
COMPANY_NAME :
52+
...
9153
```
9254

93-
And you don't have to consider the renewal. The next docker-compose checks the certificate every 12 hours and automatically updates it to the symbol link if it needs to be renewed. In other words, this is only the first time you need it, and it doesn't need to be applied from the next update.
55+
This step defines the environment variables that you want to use by default or creates `./scripts/container-volume/mc-iam-manager/keycloak/data/import/realm-import.json` based on the variables defined in `./scripts/.env`. Therefore, "Keycloak" completes the initial setup based on the file, creating the first login user in the process.
9456

95-
### Step five : Excute docker-compose
57+
### Step four: Excute docker-compose
9658

9759
```bash
98-
docker-compose up --build -d
60+
cd scripts
61+
sudo docker-compose up --build -d
9962
```
10063

101-
If you check the log as below, it seems that you have successfully built and deployed the mc-iam-manager without any problems.
64+
This step is time consuming. Don't worry if the console fails. "Keycloak" is a natural error that occurs during initial installation when MC-IAM-MANAGER requests Keyclaok readiness and certification to initialize the database and import the required data.
10265

103-
```bash
104-
$ docker-compose up --build -d
105-
106-
Creating network "scripts_mciammanagernet" with the default driver
107-
Building mciammanager
108-
Step 1/19 : FROM gobuffalo/buffalo:v0.18.14 as builder
109-
---> dbcc9d3a40f5
110-
Step 2/19 : ENV GOPROXY http://proxy.golang.org
111-
---> Using cache
112-
---> 05e55ac7f5eb
113-
....
114-
Step 10/19 : RUN buffalo build --static -o /bin/app
115-
---> Running in 3c1d37d71384
116-
....
117-
Successfully built 7d0ed2aa6a89
118-
Successfully tagged scripts_mciammanager:latest
119-
Creating scripts_postgresdb_1 ... done
120-
Creating certbot ... done
121-
Creating scripts_keycloak_1 ... done
122-
Creating scripts_mciammanager_1 ... done
123-
Creating nginx ... done
124-
```
66+
Once the server completes successfully, you can access the readyz endpoint with the message that it has been loaded successfully.
12567

126-
### Step six : Check Alive enpoint
68+
### Step final: Check Readyzenpoint
12769

12870
```bash
129-
$ curl https://<yourdomain.com>:5000/alive
71+
$ curl https://<yourdomain.com>:5000/readyz
13072
# {"ststus":"ok"}
13173
```
13274

13375
If `{"stststus":"ok"}` is received from the endpoint, it means that the service is being deployed normally.
13476

13577
### WELCOME : Now you can use MC-IAM-MANAGER
13678

137-
You can get tokens issued and see the default Role created through some of the built-in accounts below. For more API information, check the following swagger link.
138-
139-
```bash
140-
$ curl --location 'https://yourdomain.com:5000/api/auth/login' \
141-
--header 'Content-Type: application/json' \
142-
--data '{
143-
"id":"mcpsuper",
144-
"password":"mcpuserpassword"
145-
}'
146-
147-
$ curl --location 'https://yourdomain.com:5000/api/auth/login' \
148-
--header 'Content-Type: application/json' \
149-
--data '{
150-
"id":"mcpadmin",
151-
"password":"mcpuserpassword"
152-
}'
153-
154-
$ curl --location 'https://yourdomain.com:5000/api/auth/login' \
155-
--header 'Content-Type: application/json' \
156-
--data '{
157-
"id":"mcpoperator",
158-
"password":"mcpuserpassword"
159-
}'
160-
161-
$ curl --location 'https://yourdomain.com:5000/api/auth/login' \
162-
--header 'Content-Type: application/json' \
163-
--data '{
164-
"id":"mcpviewer",
165-
"password":"mcpuserpassword"
166-
}'
167-
168-
200 OK application/json
169-
{
170-
"access_token": "xxxxx", # Rolelist in token (claims : realmRole[])
171-
"id_token": "xxxxx",
172-
"expires_in": 36000,
173-
"refresh_expires_in": 1800,
174-
"refresh_token": "xxxxx",
175-
"token_type": "Bearer",
176-
"not-before-policy": 0,
177-
"session_state": "xxxxx",
178-
"scope": "openid microprofile-jwt profile email"
179-
}
180-
```
79+
To use MC-IAM-MANAGER, you need to register the resources of the framework to be used as the first registered user.
80+
81+
For example, MC-WEB-CONSOLE must register a menu so that the user can load the web screen normally.
82+
83+
This section describes how to use scripts that made the process simple.
84+
85+
- init.sh
86+
87+
```bash
88+
# ./scripts/init/init.sh
89+
./init.sh
90+
91+
--------------------
92+
0. exit
93+
94+
1. login
95+
96+
2. Init Resource Data from api.yaml
97+
(MCADMINCLI_APIYAML: https://raw.githubusercontent.com/m-cmp/mc-admin-cli/refs/heads/main/conf/api.yaml)
98+
99+
3. Init Menu Data from menu.yaml
100+
(MCWEBCONSOLE_MENUYAML: https://raw.githubusercontent.com/m-cmp/mc-web-console/refs/heads/main/conf/webconsole_menu_resources.yaml)
101+
102+
4. Init Role Data PREDEFINED_ROLE
103+
(PREDEFINED_ROLE: admin,operator,viewer,billadmin,billviewer)
104+
105+
5. Get permission CSV
106+
107+
6. Update permission CSV
108+
(./permission.csv)
109+
110+
99. auto init
111+
112+
--------------------
113+
select Number :
114+
```
115+
116+
Running this script allows you to view the menu above, using the information defined in .env to perform tasks according to the numbers you enter.
117+
118+
However, the first priority is to log in by entering the user's information that you entered. If you run number 1 and run numbers 2 to 6, you will be able to use MC-WEB-CONSOLE.
119+
120+
- initauto.sh
121+
122+
```
123+
# ./scripts/init/initauto.sh
124+
./initauto.sh
125+
```
126+
127+
This script automatically performs all procedures based on the user defined in the environment variables, but it cannot define detailed role-specific menus, and it is automatically imported to the version listed in GitHub.
128+
129+
If you want more detailed settings, we recommend init.sh .
130+
131+
- add_demo_user.sh
132+
133+
```
134+
# ./scripts/init/add_demo_user.sh
135+
./add_demo_user.sh
136+
```
137+
138+
This script registers the demo user defined in ./scripts/init/add_demo_user.json. The process of registering is very simple and you can automatically activate the registered user. Use MC-WEB-CONSOLE for role setup and workspace interworking.
139+
140+
141+
swagger docs
181142
182-
### swagger docs
183143
https://m-cmp.github.io/mc-iam-manager/
184144
185-
```
186-
# https://m-cmp.github.io/mc-iam-manager/
187-
```
188-
189-
### Get CB-Tumblebug namespace Data
190-
191-
You can run the following script to assign the configured existing data to the Default Workplace.
192-
193-
```bash
194-
$ cd <yourfolder>/scripts/init
195-
$ nano ./init.env
196-
# TB_HOST=<tumblegub host>
197-
# TB_username=<TB_username>
198-
# TB_password=<TB_password>
199-
#
200-
# MCIAM_HOST=<https://yourdomain.com:5000>
201-
202-
$ ./init-default-workspace-project.sh
203-
```
204-
205145
---
206146
207147

0 commit comments

Comments
 (0)