Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ItzNotABug committed Mar 6, 2024
2 parents c236eb0 + a05948d commit 386ee47
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ Pre-requisites: `Node 18^` & `pm2` installed.
- Name the integration (e.g., Newsletters) and click **Add**.
- **Copy** the **Admin API Key** displayed.
3. **Configure Ghosler**:
- Fire up the Ghosler front-end by going to `https://your-domain.com`. Default `PORT` is `2369`.
- Fire up the Ghosler front-end by going to `https://your-domain.com`.
- Default `PORT` is `2369`
- Default login credentials are - Username: `ghosler`, Password - `admin`
- Click on **Settings** button.
- Click on **Ghost Settings** & add your **Ghost Site Url** & **Admin API Key**.
- Add mail configurations in **Emails** section.
Expand Down Expand Up @@ -161,4 +163,4 @@ If you want to customize the newsletter template even more, follow the steps -
2. <s>Add feedback support in newsletter template</s>.
3. <s>Build a `CLI` to install, update & other options to manage Ghosler instance</s>.

#### And don't forget to `⭐` the project!
#### And don't forget to `⭐` the project!
15 changes: 10 additions & 5 deletions utils/data/configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,11 @@ export default class ProjectConfigs {
configs.ghosler.auth.pass = Miscellaneous.hash(newPass);

const success = await this.#write(configs);
if (success) return {level: 'success', message: 'Password updated!'};
else return {level: 'error', message: 'Error updating password, check error logs for more info.'};
if (success) {
// update password in cache.
this.#cachedSettings = configs;
return {level: 'success', message: 'Password updated!'};
} else return {level: 'error', message: 'Error updating password, check error logs for more info.'};
}

const url = formData['ghosler.url'];
Expand Down Expand Up @@ -216,10 +219,12 @@ export default class ProjectConfigs {
};
})];

this.#cachedSettings = configs;
const success = await this.#write(configs);
if (success) return {level: 'success', message: 'Settings updated!'};
else return {level: 'error', message: 'Error updating settings, check error logs for more info.'};
if (success) {
// update the config. cache.
this.#cachedSettings = configs;
return {level: 'success', message: 'Settings updated!'};
} else return {level: 'error', message: 'Error updating settings, check error logs for more info.'};
}

/**
Expand Down

0 comments on commit 386ee47

Please sign in to comment.