terminal-quest 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/bin/terminal-quest.js +2 -0
- package/dist/App.d.ts +2 -0
- package/dist/App.js +33 -0
- package/dist/components/HintBar.d.ts +9 -0
- package/dist/components/HintBar.js +11 -0
- package/dist/components/MenuItem.d.ts +9 -0
- package/dist/components/MenuItem.js +9 -0
- package/dist/components/ObjectivePanel.d.ts +8 -0
- package/dist/components/ObjectivePanel.js +10 -0
- package/dist/components/ProgressBar.d.ts +8 -0
- package/dist/components/ProgressBar.js +10 -0
- package/dist/components/TerminalOutput.d.ts +11 -0
- package/dist/components/TerminalOutput.js +25 -0
- package/dist/components/TerminalPrompt.d.ts +10 -0
- package/dist/components/TerminalPrompt.js +46 -0
- package/dist/data/commands-meta.d.ts +17 -0
- package/dist/data/commands-meta.js +256 -0
- package/dist/data/stories/00-beginner-pc.d.ts +3 -0
- package/dist/data/stories/00-beginner-pc.js +841 -0
- package/dist/data/stories/01-first-server.d.ts +3 -0
- package/dist/data/stories/01-first-server.js +364 -0
- package/dist/data/stories/02-messy-project.d.ts +3 -0
- package/dist/data/stories/02-messy-project.js +433 -0
- package/dist/data/stories/03-log-detective.d.ts +3 -0
- package/dist/data/stories/03-log-detective.js +291 -0
- package/dist/data/stories/04-deploy-day.d.ts +3 -0
- package/dist/data/stories/04-deploy-day.js +337 -0
- package/dist/data/stories/05-git-incident.d.ts +3 -0
- package/dist/data/stories/05-git-incident.js +534 -0
- package/dist/data/stories/06-pipe-master.d.ts +3 -0
- package/dist/data/stories/06-pipe-master.js +377 -0
- package/dist/data/stories/07-dangerous-commands.d.ts +3 -0
- package/dist/data/stories/07-dangerous-commands.js +411 -0
- package/dist/data/stories/index.d.ts +4 -0
- package/dist/data/stories/index.js +14 -0
- package/dist/data/stories/k1-treasure-hunt.d.ts +3 -0
- package/dist/data/stories/k1-treasure-hunt.js +815 -0
- package/dist/data/types.d.ts +97 -0
- package/dist/data/types.js +2 -0
- package/dist/engine/Achievements.d.ts +5 -0
- package/dist/engine/Achievements.js +93 -0
- package/dist/engine/CommandHandler.d.ts +17 -0
- package/dist/engine/CommandHandler.js +177 -0
- package/dist/engine/HintEngine.d.ts +10 -0
- package/dist/engine/HintEngine.js +26 -0
- package/dist/engine/MissionEngine.d.ts +17 -0
- package/dist/engine/MissionEngine.js +84 -0
- package/dist/engine/TabCompletion.d.ts +14 -0
- package/dist/engine/TabCompletion.js +93 -0
- package/dist/engine/VirtualFS.d.ts +33 -0
- package/dist/engine/VirtualFS.js +276 -0
- package/dist/engine/commands/cat.d.ts +4 -0
- package/dist/engine/commands/cat.js +18 -0
- package/dist/engine/commands/cd.d.ts +4 -0
- package/dist/engine/commands/cd.js +12 -0
- package/dist/engine/commands/chmod.d.ts +4 -0
- package/dist/engine/commands/chmod.js +98 -0
- package/dist/engine/commands/clear.d.ts +4 -0
- package/dist/engine/commands/clear.js +4 -0
- package/dist/engine/commands/cp.d.ts +4 -0
- package/dist/engine/commands/cp.js +26 -0
- package/dist/engine/commands/cut.d.ts +4 -0
- package/dist/engine/commands/cut.js +76 -0
- package/dist/engine/commands/echo.d.ts +4 -0
- package/dist/engine/commands/echo.js +4 -0
- package/dist/engine/commands/find.d.ts +4 -0
- package/dist/engine/commands/find.js +60 -0
- package/dist/engine/commands/git.d.ts +4 -0
- package/dist/engine/commands/git.js +510 -0
- package/dist/engine/commands/grep.d.ts +4 -0
- package/dist/engine/commands/grep.js +127 -0
- package/dist/engine/commands/head.d.ts +4 -0
- package/dist/engine/commands/head.js +59 -0
- package/dist/engine/commands/help.d.ts +4 -0
- package/dist/engine/commands/help.js +32 -0
- package/dist/engine/commands/hint.d.ts +4 -0
- package/dist/engine/commands/hint.js +4 -0
- package/dist/engine/commands/index.d.ts +8 -0
- package/dist/engine/commands/index.js +51 -0
- package/dist/engine/commands/ls.d.ts +4 -0
- package/dist/engine/commands/ls.js +50 -0
- package/dist/engine/commands/man.d.ts +4 -0
- package/dist/engine/commands/man.js +51 -0
- package/dist/engine/commands/mkdir.d.ts +4 -0
- package/dist/engine/commands/mkdir.js +31 -0
- package/dist/engine/commands/mv.d.ts +4 -0
- package/dist/engine/commands/mv.js +15 -0
- package/dist/engine/commands/pwd.d.ts +4 -0
- package/dist/engine/commands/pwd.js +4 -0
- package/dist/engine/commands/rm.d.ts +4 -0
- package/dist/engine/commands/rm.js +49 -0
- package/dist/engine/commands/sort.d.ts +4 -0
- package/dist/engine/commands/sort.js +100 -0
- package/dist/engine/commands/tail.d.ts +4 -0
- package/dist/engine/commands/tail.js +59 -0
- package/dist/engine/commands/touch.d.ts +4 -0
- package/dist/engine/commands/touch.js +18 -0
- package/dist/engine/commands/uniq.d.ts +4 -0
- package/dist/engine/commands/uniq.js +61 -0
- package/dist/engine/commands/wc.d.ts +4 -0
- package/dist/engine/commands/wc.js +67 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -0
- package/dist/screens/MissionBriefScreen.d.ts +9 -0
- package/dist/screens/MissionBriefScreen.js +27 -0
- package/dist/screens/MissionCompleteScreen.d.ts +9 -0
- package/dist/screens/MissionCompleteScreen.js +30 -0
- package/dist/screens/ProgressScreen.d.ts +8 -0
- package/dist/screens/ProgressScreen.js +24 -0
- package/dist/screens/SettingsScreen.d.ts +8 -0
- package/dist/screens/SettingsScreen.js +45 -0
- package/dist/screens/StorySelectScreen.d.ts +8 -0
- package/dist/screens/StorySelectScreen.js +81 -0
- package/dist/screens/TerminalScreen.d.ts +12 -0
- package/dist/screens/TerminalScreen.js +150 -0
- package/dist/screens/TitleScreen.d.ts +7 -0
- package/dist/screens/TitleScreen.js +27 -0
- package/dist/state/GameState.d.ts +8 -0
- package/dist/state/GameState.js +12 -0
- package/dist/state/ProgressStore.d.ts +9 -0
- package/dist/state/ProgressStore.js +45 -0
- package/dist/state/useGameState.d.ts +11 -0
- package/dist/state/useGameState.js +92 -0
- package/dist/utils/ascii-art.d.ts +4 -0
- package/dist/utils/ascii-art.js +22 -0
- package/dist/utils/colors.d.ts +17 -0
- package/dist/utils/colors.js +17 -0
- package/dist/utils/text.d.ts +4 -0
- package/dist/utils/text.js +28 -0
- package/package.json +58 -0
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
const mission1FS = {
|
|
2
|
+
type: 'directory',
|
|
3
|
+
children: {
|
|
4
|
+
home: {
|
|
5
|
+
type: 'directory',
|
|
6
|
+
children: {
|
|
7
|
+
admin: {
|
|
8
|
+
type: 'directory',
|
|
9
|
+
children: {
|
|
10
|
+
'welcome.txt': {
|
|
11
|
+
type: 'file',
|
|
12
|
+
content: 'ようこそ、新しい管理者さん!\nこのサーバーの管理をよろしくお願いします。\n',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
var: {
|
|
19
|
+
type: 'directory',
|
|
20
|
+
children: {
|
|
21
|
+
log: {
|
|
22
|
+
type: 'directory',
|
|
23
|
+
children: {},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
etc: {
|
|
28
|
+
type: 'directory',
|
|
29
|
+
children: {},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
const mission2FS = {
|
|
34
|
+
type: 'directory',
|
|
35
|
+
children: {
|
|
36
|
+
etc: {
|
|
37
|
+
type: 'directory',
|
|
38
|
+
children: {
|
|
39
|
+
nginx: {
|
|
40
|
+
type: 'directory',
|
|
41
|
+
children: {
|
|
42
|
+
'nginx.conf': {
|
|
43
|
+
type: 'file',
|
|
44
|
+
content: [
|
|
45
|
+
'worker_processes auto;',
|
|
46
|
+
'error_log /var/log/nginx/error.log;',
|
|
47
|
+
'',
|
|
48
|
+
'events {',
|
|
49
|
+
' worker_connections 1024;',
|
|
50
|
+
'}',
|
|
51
|
+
'',
|
|
52
|
+
'http {',
|
|
53
|
+
' server {',
|
|
54
|
+
' listen 80;',
|
|
55
|
+
' server_name localhost;',
|
|
56
|
+
' location / {',
|
|
57
|
+
' proxy_pass http://localhost:3000;',
|
|
58
|
+
' }',
|
|
59
|
+
' }',
|
|
60
|
+
'}',
|
|
61
|
+
].join('\n'),
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
app: {
|
|
66
|
+
type: 'directory',
|
|
67
|
+
children: {
|
|
68
|
+
'config.json': {
|
|
69
|
+
type: 'file',
|
|
70
|
+
content: '{"port": 3000, "debug": false, "logLevel": "info"}',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
home: {
|
|
77
|
+
type: 'directory',
|
|
78
|
+
children: {
|
|
79
|
+
admin: {
|
|
80
|
+
type: 'directory',
|
|
81
|
+
children: {},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
const logLines = [
|
|
88
|
+
'2024-01-15 08:00:01 [INFO] Server started on port 3000',
|
|
89
|
+
'2024-01-15 08:00:02 [INFO] Database connection established',
|
|
90
|
+
'2024-01-15 08:05:13 [INFO] User login: admin',
|
|
91
|
+
'2024-01-15 08:10:45 [ERROR] Failed to connect to cache server: Connection refused',
|
|
92
|
+
'2024-01-15 08:11:00 [INFO] Retrying cache connection...',
|
|
93
|
+
'2024-01-15 08:11:05 [ERROR] Cache server retry failed: timeout after 5000ms',
|
|
94
|
+
'2024-01-15 08:15:22 [INFO] Request processed: GET /api/users',
|
|
95
|
+
'2024-01-15 08:20:33 [INFO] Request processed: POST /api/data',
|
|
96
|
+
'2024-01-15 08:25:10 [ERROR] Disk space warning: /var/log is 85% full',
|
|
97
|
+
'2024-01-15 08:30:01 [INFO] Scheduled backup started',
|
|
98
|
+
'2024-01-15 08:30:45 [INFO] Backup completed successfully',
|
|
99
|
+
'2024-01-15 08:35:12 [INFO] Request processed: GET /api/status',
|
|
100
|
+
'2024-01-15 08:40:00 [ERROR] Authentication failed for user: unknown_user',
|
|
101
|
+
'2024-01-15 08:45:33 [INFO] Request processed: GET /api/health',
|
|
102
|
+
'2024-01-15 08:50:01 [INFO] Memory usage: 62%',
|
|
103
|
+
'2024-01-15 08:55:22 [INFO] Request processed: PUT /api/config',
|
|
104
|
+
'2024-01-15 09:00:00 [INFO] Hourly log rotation completed',
|
|
105
|
+
'2024-01-15 09:05:15 [ERROR] Unable to send notification email: SMTP connection failed',
|
|
106
|
+
'2024-01-15 09:10:30 [INFO] Request processed: DELETE /api/cache',
|
|
107
|
+
'2024-01-15 09:15:00 [INFO] System health check: all services nominal',
|
|
108
|
+
].join('\n');
|
|
109
|
+
const mission3FS = {
|
|
110
|
+
type: 'directory',
|
|
111
|
+
children: {
|
|
112
|
+
var: {
|
|
113
|
+
type: 'directory',
|
|
114
|
+
children: {
|
|
115
|
+
log: {
|
|
116
|
+
type: 'directory',
|
|
117
|
+
children: {
|
|
118
|
+
'app.log': {
|
|
119
|
+
type: 'file',
|
|
120
|
+
content: logLines,
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
home: {
|
|
127
|
+
type: 'directory',
|
|
128
|
+
children: {
|
|
129
|
+
admin: {
|
|
130
|
+
type: 'directory',
|
|
131
|
+
children: {},
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
const mission4FS = {
|
|
138
|
+
type: 'directory',
|
|
139
|
+
children: {
|
|
140
|
+
etc: {
|
|
141
|
+
type: 'directory',
|
|
142
|
+
children: {
|
|
143
|
+
app: {
|
|
144
|
+
type: 'directory',
|
|
145
|
+
children: {
|
|
146
|
+
'config.json': {
|
|
147
|
+
type: 'file',
|
|
148
|
+
content: '{"port": 3000, "debug": false, "logLevel": "info"}',
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
home: {
|
|
155
|
+
type: 'directory',
|
|
156
|
+
children: {
|
|
157
|
+
admin: {
|
|
158
|
+
type: 'directory',
|
|
159
|
+
children: {
|
|
160
|
+
backups: {
|
|
161
|
+
type: 'directory',
|
|
162
|
+
children: {},
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
const mission5FS = {
|
|
171
|
+
type: 'directory',
|
|
172
|
+
children: {
|
|
173
|
+
etc: {
|
|
174
|
+
type: 'directory',
|
|
175
|
+
children: {
|
|
176
|
+
app: {
|
|
177
|
+
type: 'directory',
|
|
178
|
+
children: {
|
|
179
|
+
'config.json': {
|
|
180
|
+
type: 'file',
|
|
181
|
+
content: '{"port": 3000, "debug": false}',
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
};
|
|
189
|
+
export const story01 = {
|
|
190
|
+
id: 'story-01',
|
|
191
|
+
title: '初めてのサーバー管理',
|
|
192
|
+
description: 'あなたは新人サーバー管理者。先輩が急に休みを取り、本番サーバーの管理を1人で任されることに。基本的なコマンドを使ってサーバーを管理しよう。',
|
|
193
|
+
emoji: '🖥️',
|
|
194
|
+
missions: [
|
|
195
|
+
{
|
|
196
|
+
id: 'mission-01-01',
|
|
197
|
+
title: '現在地を確認しよう',
|
|
198
|
+
description: '基本中の基本、現在のディレクトリを確認し、ファイルの一覧を表示してみよう。',
|
|
199
|
+
narrative: '先輩からの引き継ぎメモには「まずは現在いるディレクトリを確認」と書いてある。ターミナルを開いたら、まず自分がどこにいるのか把握しよう。',
|
|
200
|
+
initialCwd: '/home/admin',
|
|
201
|
+
newCommands: ['pwd', 'ls'],
|
|
202
|
+
initialFS: mission1FS,
|
|
203
|
+
objectives: [
|
|
204
|
+
{
|
|
205
|
+
id: 'obj-01-01-01',
|
|
206
|
+
description: '現在のディレクトリを確認する(pwd コマンド)',
|
|
207
|
+
checks: [{ type: 'command_executed', command: 'pwd' }],
|
|
208
|
+
hints: [
|
|
209
|
+
{ level: 1, text: '現在のディレクトリを表示するコマンドがあります。' },
|
|
210
|
+
{ level: 2, text: '"Print Working Directory" の略で、3文字のコマンドです。' },
|
|
211
|
+
{ level: 3, text: '「pwd」と入力してEnterを押してください。' },
|
|
212
|
+
],
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
id: 'obj-01-01-02',
|
|
216
|
+
description: 'ファイルの一覧を表示する(ls コマンド)',
|
|
217
|
+
checks: [{ type: 'command_executed', command: 'ls' }],
|
|
218
|
+
hints: [
|
|
219
|
+
{ level: 1, text: 'ディレクトリの中身を一覧表示するコマンドを使いましょう。' },
|
|
220
|
+
{ level: 2, text: '"List" の略で、2文字のコマンドです。' },
|
|
221
|
+
{ level: 3, text: '「ls」と入力してEnterを押してください。' },
|
|
222
|
+
],
|
|
223
|
+
},
|
|
224
|
+
],
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
id: 'mission-01-02',
|
|
228
|
+
title: '設定ファイルを探せ',
|
|
229
|
+
description: 'サーバーの設定ファイルを見つけて内容を確認しよう。',
|
|
230
|
+
narrative: 'サーバーの設定ファイルを確認する必要がある。設定ファイルは /etc に保管されている。ディレクトリを移動して、設定内容を確認しよう。',
|
|
231
|
+
initialCwd: '/home/admin',
|
|
232
|
+
newCommands: ['cd', 'cat'],
|
|
233
|
+
initialFS: mission2FS,
|
|
234
|
+
objectives: [
|
|
235
|
+
{
|
|
236
|
+
id: 'obj-01-02-01',
|
|
237
|
+
description: '/etc ディレクトリに移動する',
|
|
238
|
+
checks: [{ type: 'cwd_equals', path: '/etc' }],
|
|
239
|
+
hints: [
|
|
240
|
+
{ level: 1, text: 'ディレクトリを移動するコマンドを使いましょう。' },
|
|
241
|
+
{ level: 2, text: '"Change Directory" の略のコマンドに、移動先のパスを指定します。' },
|
|
242
|
+
{ level: 3, text: '「cd /etc」と入力してEnterを押してください。' },
|
|
243
|
+
],
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
id: 'obj-01-02-02',
|
|
247
|
+
description: 'ファイルの一覧を確認する',
|
|
248
|
+
checks: [{ type: 'command_executed', command: 'ls' }],
|
|
249
|
+
hints: [
|
|
250
|
+
{ level: 1, text: '前のミッションで使った一覧表示コマンドを思い出しましょう。' },
|
|
251
|
+
{ level: 2, text: '2文字のコマンドで、ディレクトリの中身を表示できます。' },
|
|
252
|
+
{ level: 3, text: '「ls」と入力してEnterを押してください。' },
|
|
253
|
+
],
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
id: 'obj-01-02-03',
|
|
257
|
+
description: 'config.json の内容を表示する',
|
|
258
|
+
checks: [{ type: 'output_contains', pattern: 'port' }],
|
|
259
|
+
hints: [
|
|
260
|
+
{ level: 1, text: 'ファイルの内容を表示するコマンドがあります。' },
|
|
261
|
+
{ level: 2, text: '猫の鳴き声に似た3文字のコマンドです。パスを指定しましょう。' },
|
|
262
|
+
{ level: 3, text: '「cat app/config.json」と入力してください。' },
|
|
263
|
+
],
|
|
264
|
+
},
|
|
265
|
+
],
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
id: 'mission-01-03',
|
|
269
|
+
title: 'ログからエラーを探せ',
|
|
270
|
+
description: 'ログファイルからエラーメッセージを見つけ出そう。',
|
|
271
|
+
narrative: 'ユーザーから「エラーが出てる」と報告が。ログファイルを調べて、何が起きているか確認しよう。',
|
|
272
|
+
initialCwd: '/home/admin',
|
|
273
|
+
newCommands: ['grep'],
|
|
274
|
+
initialFS: mission3FS,
|
|
275
|
+
objectives: [
|
|
276
|
+
{
|
|
277
|
+
id: 'obj-01-03-01',
|
|
278
|
+
description: 'ログファイルの内容を表示する',
|
|
279
|
+
checks: [
|
|
280
|
+
{ type: 'command_executed', command: 'cat' },
|
|
281
|
+
{ type: 'output_contains', pattern: 'ERROR' },
|
|
282
|
+
],
|
|
283
|
+
hints: [
|
|
284
|
+
{ level: 1, text: 'ファイルの内容を表示するコマンドでログファイルを見ましょう。' },
|
|
285
|
+
{ level: 2, text: 'ログファイルは /var/log/app.log にあります。' },
|
|
286
|
+
{ level: 3, text: '「cat /var/log/app.log」と入力してください。' },
|
|
287
|
+
],
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
id: 'obj-01-03-02',
|
|
291
|
+
description: 'ERROR を含む行だけを抽出する',
|
|
292
|
+
checks: [
|
|
293
|
+
{ type: 'command_executed', command: 'grep' },
|
|
294
|
+
{ type: 'output_contains', pattern: 'ERROR' },
|
|
295
|
+
],
|
|
296
|
+
hints: [
|
|
297
|
+
{ level: 1, text: '特定の文字列を含む行だけを抽出するコマンドがあります。' },
|
|
298
|
+
{ level: 2, text: 'grep コマンドに検索パターンとファイル名を指定します。' },
|
|
299
|
+
{ level: 3, text: '「grep ERROR /var/log/app.log」と入力してください。' },
|
|
300
|
+
],
|
|
301
|
+
},
|
|
302
|
+
],
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
id: 'mission-01-04',
|
|
306
|
+
title: '設定ファイルのバックアップ',
|
|
307
|
+
description: '設定を変更する前に、安全のためバックアップを取ろう。',
|
|
308
|
+
narrative: '設定を変更する前に、バックアップを取る習慣をつけよう。何かあったときに元に戻せるように、コピーを作成する。',
|
|
309
|
+
initialCwd: '/etc/app',
|
|
310
|
+
newCommands: ['cp'],
|
|
311
|
+
initialFS: mission4FS,
|
|
312
|
+
objectives: [
|
|
313
|
+
{
|
|
314
|
+
id: 'obj-01-04-01',
|
|
315
|
+
description: 'config.json のバックアップを作成する',
|
|
316
|
+
checks: [
|
|
317
|
+
{
|
|
318
|
+
type: 'file_exists',
|
|
319
|
+
path: '/etc/app/config.json.bak',
|
|
320
|
+
},
|
|
321
|
+
],
|
|
322
|
+
hints: [
|
|
323
|
+
{ level: 1, text: 'ファイルをコピーするコマンドを使いましょう。' },
|
|
324
|
+
{ level: 2, text: 'cp コマンドで「元ファイル」「コピー先」を指定します。.bak 拡張子をつけるのが慣例です。' },
|
|
325
|
+
{ level: 3, text: '「cp config.json config.json.bak」と入力してください。' },
|
|
326
|
+
],
|
|
327
|
+
},
|
|
328
|
+
],
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
id: 'mission-01-05',
|
|
332
|
+
title: '設定を修正せよ',
|
|
333
|
+
description: 'デバッグモードを有効にして、問題を調査しやすくしよう。',
|
|
334
|
+
narrative: 'デバッグモードが無効になっている。config.json の debug を true に変更しよう。echo とリダイレクトを使ってファイルを書き換える。',
|
|
335
|
+
initialCwd: '/etc/app',
|
|
336
|
+
newCommands: ['echo'],
|
|
337
|
+
initialFS: mission5FS,
|
|
338
|
+
objectives: [
|
|
339
|
+
{
|
|
340
|
+
id: 'obj-01-05-01',
|
|
341
|
+
description: 'config.json の debug を true に変更する',
|
|
342
|
+
checks: [
|
|
343
|
+
{
|
|
344
|
+
type: 'file_contains',
|
|
345
|
+
path: '/etc/app/config.json',
|
|
346
|
+
pattern: 'true',
|
|
347
|
+
},
|
|
348
|
+
],
|
|
349
|
+
hints: [
|
|
350
|
+
{ level: 1, text: 'echo コマンドとリダイレクト(>)を使ってファイルに書き込めます。' },
|
|
351
|
+
{ level: 2, text: 'echo "内容" > ファイル名 の形式で、ファイルの内容を上書きできます。' },
|
|
352
|
+
{
|
|
353
|
+
level: 3,
|
|
354
|
+
text: '「echo \'{"port": 3000, "debug": true}\' > config.json」と入力してください。',
|
|
355
|
+
},
|
|
356
|
+
],
|
|
357
|
+
},
|
|
358
|
+
],
|
|
359
|
+
},
|
|
360
|
+
],
|
|
361
|
+
unlockRequires: [],
|
|
362
|
+
course: 'engineer',
|
|
363
|
+
};
|
|
364
|
+
//# sourceMappingURL=01-first-server.js.map
|