From 42f43d427ac08548148a20f79537f283e938162d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20D=E2=80=99Aquino?= Date: Wed, 20 Nov 2024 16:40:13 -0800 Subject: [PATCH] Notedeck instructions support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel D’Aquino --- notedeck-install-instructions.md | 15 +++++++++++++++ src/router_config.js | 26 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 notedeck-install-instructions.md diff --git a/notedeck-install-instructions.md b/notedeck-install-instructions.md new file mode 100644 index 0000000..7983edf --- /dev/null +++ b/notedeck-install-instructions.md @@ -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](support@damus.io). + +## 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](#) diff --git a/src/router_config.js b/src/router_config.js index 22c531c..a72ce93 100644 --- a/src/router_config.js +++ b/src/router_config.js @@ -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 @@ -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