Skip to content

Commit

Permalink
Notedeck instructions support
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel D’Aquino <[email protected]>
  • Loading branch information
danieldaquino committed Nov 30, 2024
1 parent 9a32bea commit 42f43d4
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
15 changes: 15 additions & 0 deletions notedeck-install-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Installing Notedeck

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.

If you encounter any issues, please [contact us]([email protected]).

## Binaries

Please find the download link for your operating system below.

- macOS (Apple Silicon): [notedeck_macos_silicon.dmg](#)
- macOS (Intel): [notedeck_macos_intel.dmg](#)
- Linux Debian package: [notedeck_linux_debian.deb](#)
- Linux x86 generic: [notedeck_linux_generic.zip](#)
- Linux ARM generic: [notedeck_linux_generic.zip](#)
26 changes: 26 additions & 0 deletions src/router_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const { nip19 } = require('nostr-tools')
const { PURPLE_ONE_MONTH } = require('./invoicing')
const error = require("debug")("api:error")
const { update_iap_history_with_apple_if_needed_and_return_updated_user } = require('./iap_refresh_management')
const fs = require('fs');
const path = require('path');

function config_router(app) {
const router = app.router
Expand Down Expand Up @@ -442,6 +444,30 @@ function config_router(app) {
json_response(res, get_account_info_payload(user_id, account, true))
return
});

router.get('/notedeck-install-instructions', app.web_auth_manager.require_web_auth.bind(app.web_auth_manager), async (req, res) => {
const pubkey = req.authorized_pubkey
const { account, user_id } = get_account_and_user_id(app, pubkey)
if (!account) {
simple_response(res, 404)
return
}
const account_info = get_account_info_payload(user_id, account, true)
if(account_info.active == true) {
const installInstructionsPath = path.resolve('notedeck-install-instructions.md');
try {
const installInstructions = fs.readFileSync(installInstructionsPath, { encoding: 'utf8' });
json_response(res, { value: installInstructions });
return
} catch (err) {
console.log(err);
error("Failed to read file: %s", err.toString());
error_response(res, 'Failed to load installation instructions');
return
}
}
return
});

// MARK: Admin routes

Expand Down

0 comments on commit 42f43d4

Please sign in to comment.