Skip to content

Commit 92a888f

Browse files
committed
Notedeck instructions support
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
1 parent 9a32bea commit 92a888f

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

notedeck-install-instructions.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Installing Notedeck
2+
3+
Thank you for your interest in the Notedeck Alpha release! We are excited to have you try out our software. Below are the instructions for installing Notedeck on your system.
4+
5+
If you encounter any issues, please [contact us](support@damus.io).
6+
7+
## Binaries
8+
9+
Please find the download link for your operating system below.
10+
11+
- macOS (Apple Silicon): [notedeck_macos_silicon.dmg](#)
12+
- macOS (Intel): [notedeck_macos_intel.dmg](#)
13+
- Linux Debian package: [notedeck_linux_debian.deb](#)
14+
- Linux x86 generic: [notedeck_linux_generic.zip](#)
15+
- Linux ARM generic: [notedeck_linux_generic.zip](#)

src/router_config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const { nip19 } = require('nostr-tools')
99
const { PURPLE_ONE_MONTH } = require('./invoicing')
1010
const error = require("debug")("api:error")
1111
const { update_iap_history_with_apple_if_needed_and_return_updated_user } = require('./iap_refresh_management')
12+
const fs = require('fs');
13+
const path = require('path');
1214

1315
function config_router(app) {
1416
const router = app.router
@@ -442,6 +444,30 @@ function config_router(app) {
442444
json_response(res, get_account_info_payload(user_id, account, true))
443445
return
444446
});
447+
448+
router.get('/notedeck-install-instructions', app.web_auth_manager.require_web_auth.bind(app.web_auth_manager), async (req, res) => {
449+
const pubkey = req.authorized_pubkey
450+
const { account, user_id } = get_account_and_user_id(app, pubkey)
451+
if (!account) {
452+
simple_response(res, 404)
453+
return
454+
}
455+
const account_info = get_account_info_payload(user_id, account, true)
456+
if(account_info.active == true) {
457+
const installInstructionsPath = path.resolve('notedeck-install-instructions.md');
458+
try {
459+
const installInstructions = fs.readFileSync(installInstructionsPath, { encoding: 'utf8' });
460+
json_response(res, { value: installInstructions });
461+
return
462+
} catch (err) {
463+
console.log(err);
464+
error("Failed to read file: %s", err.toString());
465+
error_response(res, 'Failed to load installation instructions');
466+
return
467+
}
468+
}
469+
return
470+
});
445471

446472
// MARK: Admin routes
447473

0 commit comments

Comments
 (0)