Merge pull request #1232 from ajnart/fix-env-not-working
Fix env not working
This commit is contained in:
@@ -5,8 +5,12 @@ function Post(req: NextApiRequest, res: NextApiResponse) {
|
||||
const { tried, type = 'password' } = req.body;
|
||||
// If the type of password is "edit", we run this branch to check the edit password
|
||||
if (type === 'edit') {
|
||||
if (tried === process.env.EDIT_MODE_PASSWORD) {
|
||||
process.env.DISABLE_EDIT_MODE = process.env.DISABLE_EDIT_MODE === 'true' ? 'false' : 'true';
|
||||
if ((tried === process.env.EDIT_MODE_PASSWORD) !== undefined) {
|
||||
if (process.env.DISABLE_EDIT_MODE?.toLowerCase() === 'true') {
|
||||
process.env.DISABLE_EDIT_MODE = 'false';
|
||||
} else {
|
||||
process.env.DISABLE_EDIT_MODE = 'true';
|
||||
}
|
||||
return res.status(200).json({
|
||||
success: true,
|
||||
});
|
||||
|
||||
@@ -9,12 +9,7 @@ export default class DockerSingleton extends Docker {
|
||||
|
||||
public static getInstance(): DockerSingleton {
|
||||
if (!DockerSingleton.dockerInstance) {
|
||||
DockerSingleton.dockerInstance = new Docker({
|
||||
// If env variable DOCKER_HOST is not set, it will use the default socket
|
||||
...(process.env.DOCKER_HOST && { host: process.env.DOCKER_HOST }),
|
||||
// Same thing for docker port
|
||||
...(process.env.DOCKER_PORT && { port: process.env.DOCKER_PORT }),
|
||||
});
|
||||
DockerSingleton.dockerInstance = new Docker();
|
||||
}
|
||||
return DockerSingleton.dockerInstance;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user