-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add demo mode & fix: Some appearance bug & docs: Change README
- Loading branch information
1 parent
4df7cde
commit ee7a43d
Showing
18 changed files
with
211 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
# Default password: 123456 | ||
# Remember to change this password after setting up the app | ||
PASSWORD=14e1b600b1fd579f47433b88e8d85291 | ||
PASSWORD=14e1b600b1fd579f47433b88e8d85291 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
import fs from "fs"; | ||
import path from "path"; | ||
|
||
import { isDemo } from "./global"; | ||
|
||
const envPath = path.join(process.cwd(), ".pwd"); | ||
const defaultPwd = "14e1b600b1fd579f47433b88e8d85291"; // 123456 | ||
|
||
export function getPasswordFromEnv(): string { | ||
if(isDemo) return defaultPwd; | ||
|
||
const env = fs.readFileSync(envPath, "utf-8"); | ||
|
||
return env.replace("PASSWORD=", ""); | ||
} | ||
|
||
export function setPasswordToEnv(password: string) { | ||
if(isDemo) return; | ||
|
||
fs.writeFileSync(envPath, `PASSWORD=${password}`, "utf-8"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"path": "hello.txt", | ||
"size": 53, | ||
"content": "Welcome to Ferrum Explorer. This is a DEMO text file." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[ | ||
{ | ||
"name": "hello.txt", | ||
"type": "file", | ||
"size": 53, | ||
"access": true | ||
}, | ||
{ | ||
"name": "test.txt", | ||
"type": "file", | ||
"size": 1024, | ||
"access": true | ||
}, | ||
{ | ||
"name": "demo-folder", | ||
"type": "folder", | ||
"size": 0, | ||
"access": true | ||
} | ||
] |
Oops, something went wrong.