Comments (4)
Maybe this conversation could be relevant here, so linking the issue: #33
from integration_whiteboard.
I managed to get the Nextcloud Spaceboard Integration working manually on arm64
.
For the brave:
This assumes you've already downloaded the app through Nextcloud.
Also:
current user: not root
(got to use sudo
)
web-user = www-data
- install node.js 16 + npm
0.1 (optional: make it work with PHP 8.0) - fixes to compile Node.js sqlite3 native bindings for
arm64
# adjust path to your nextcloud apps directory
# this will be our working directory for the next commands
cd /var/www/nextcloud/apps/integration_whiteboard/data/spacedeck
1.1 once in that directory, edit package.json
with your favorite terminal editor and paste:
expand package.json file
{
"name": "spacedeck-open",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "node spacedeck.js",
"pkg": "pkg -t node10-linux -c package.json -o spacedeck.pkg.bin spacedeck.js",
"nexe": "nexe -t linux-x64-10.19.0 spacedeck.js -o spacedeck.nexe.bin"
},
"engines": {
"node": ">=10.0.0"
},
"pkg": {
"assets": [
"views/**/*",
"public/**/*",
"locales/*"
]
},
"dependencies": {
"archiver": "1.3.0",
"async": "2.3.0",
"bcryptjs": "2.4.3",
"body-parser": "^1.19.0",
"cheerio": "0.22.0",
"config": "1.25.1",
"cookie-parser": "~1.4.3",
"ejs": "3.1.5",
"execSync": "latest",
"express": "^4.16.4",
"file-type": "^7.6.0",
"glob": "7.1.1",
"gm": "^1.23.1",
"helmet": "^3.5.0",
"i18n-2": "0.6.3",
"log-timestamp": "latest",
"mock-aws-s3": "^2.6.0",
"moment": "^2.19.3",
"morgan": "^1.9.1",
"node-phantom-simple": "2.2.4",
"node-server-screenshot": "^0.2.1",
"nodemailer": "^4.6.7",
"puppeteer": "3.0.0",
"read-chunk": "^2.1.0",
"request": "^2.88.0",
"sanitize-html": "^1.11.1",
"sequelize": "^4.37.6",
"serve-favicon": "~2.4.2",
"serve-static": "^1.13.1",
"slug": "^1.1.0",
"sqlite3": "^4.0.0",
"umzug": "^2.1.0",
"underscore": "1.8.3",
"uuid": "^3.2.1",
"validator": "7.0.0",
"ws": "3.3.1"
},
"devDependencies": {
"gulp": "^4.0.2",
"gulp-concat": "^2.6.1",
"gulp-sass": "^4.0.2"
},
"main": "app.js",
"description": "",
"directories": {},
"repository": {
"type": "git",
"url": "https://github.com/spacedeck/spacedeck-open.git"
},
"keywords": [],
"author": "Lukas F. Hartmann, Martin Güther",
"license": "AGPLv3"
}
1.2
patch ./helpers/phantom.js
with this patch (extracted from spacedeck/spacedeck-open@26329b0) :
expand patch file
diff --git a/helpers/phantom.js b/helpers/phantom.js
index 197b9a2..5e5e06a 100644
--- a/helpers/phantom.js
+++ b/helpers/phantom.js
@@ -2,7 +2,7 @@
const db = require('../models/db');
const config = require('config');
-const phantom = require('node-phantom-simple');
+const puppeteer = require('puppeteer');
const os = require('os');
module.exports = {
@@ -25,46 +25,44 @@ module.exports = {
var on_exit = function(exit_code) {
if (exit_code>0) {
- console.error("phantom abnormal exit for url "+space_url);
+ console.error(exit_code);
+ console.error("puppeteer abnormal exit for url "+space_url);
if (!on_success_called && on_error) {
on_error();
}
}
};
- phantom.create({ path: require('phantomjs-prebuilt').path }, function (err, browser) {
- if (err) {
- console.error(err);
- } else {
- return browser.createPage(function (err, page) {
- console.log("page created, opening ",space_url);
-
- if (type=="pdf") {
- var psz = {
- width: space.width+"px",
- height: space.height+"px"
- };
- page.set('paperSize', psz);
+ (async () => {
+ let browser;
+ let page;
+ try {
+ browser = await puppeteer.launch(
+ {
+ headless: true,
+ args: ['--disable-dev-shm-usage', '--no-sandbox']
}
+ );
+ page = await browser.newPage();
- page.set('settings.resourceTimeout',timeout);
- page.set('settings.javascriptEnabled',false);
+ page.setDefaultTimeout(timeout);
+ await page.setJavaScriptEnabled(false);
- return page.open(space_url, function (err,status) {
- page.render(export_path, function() {
- on_success_called = true;
- if (on_success) {
- on_success(export_path);
- }
- page.close();
- browser.exit();
- });
- });
- });
- }
+ console.log("page created, opening ",space_url);
+ await page.goto(space_url, {waitUntil: 'networkidle0'});
- }, {
- onExit: on_exit
- });
+ if (type=="pdf") {
+ await page.pdf({path: export_path, width: space.width+'px', height: space.height+'px' });
+ }else{
+ await page.screenshot({path: export_path});
+ }
+
+ await browser.close();
+ on_success(export_path);
+ } catch (error) {
+ on_error();
+ }
+
+ })();
}
};
save this as phantomjs.patch
, then:
sudo patch ./helpers/phantom.js phantomjs.patch
sudo rm -r node_modules/sqlite3
sudo npm install --build-from-source=sqlite3 --production
- use vercel's
pkg
, notnexe
to put it all into one single binary
sudo npm install --global pkg
sudo pkg -c package.json -t linux-node16-arm64 spacedeck.js
sudo chown -R www-data:www-data .
sudo mv spacedeck.nexe.bin spacedeck.nexe.bin.x86_64
sudo mv spacedeck-open spacedeck.nexe.bin
# (re-) enable whiteboard_integration app in nextcloud
# this copies the current folder to `$NC_DATA_DIR/appdata_random-string/spacedeck/`
- be happy and use Spacedeck whiteboards
from integration_whiteboard.
I try the version without the npm and node update. As far as I see, your patch has an error at line 14.
my patch looks like this:
from integration_whiteboard.
Thanks for the effort. I tried the workaround but I get the following error:
patching file ./helpers/phantom.js Hunk #2 FAILED at 25. 1 out of 2 hunks FAILED -- saving rejects to file ./helpers/phantom.js.rej
phantom.js.rej is
--- phantom.js
+++ phantom.js
@@ -25,46 +25,44 @@ module.exports = {var on_exit = function(exit_code) { if (exit_code>0) {
console.error("phantom abnormal exit for url "+space_url);
console.error(exit_code);
};console.error("puppeteer abnormal exit for url "+space_url); if (!on_success_called && on_error) { on_error(); } }
- phantom.create({ path: require('phantomjs-prebuilt').path }, function (err, browser) {
if (err) {
console.error(err);
} else {
return browser.createPage(function (err, page) {
console.log("page created, opening ",space_url);
if (type=="pdf") {
var psz = {
width: space.width+"px",
height: space.height+"px"
};
page.set('paperSize', psz);
- (async () => {
let browser;
let page;
try {
browser = await puppeteer.launch(
{
headless: true,
args: ['--disable-dev-shm-usage', '--no-sandbox'] }
);
page = await browser.newPage();
page.set('settings.resourceTimeout',timeout);
page.set('settings.javascriptEnabled',false);
page.setDefaultTimeout(timeout);
await page.setJavaScriptEnabled(false);
from integration_whiteboard.
Related Issues (20)
- Upload media no libtheora found
- PUT failed - Can't create new whiteboard file in some directories?
- Support pen with pressure sensitivity
- 403 when trying to edit whiteboard HOT 1
- Ship arm64 binaries HOT 5
- Whiteboard on Nextcloud 21 Error - Impossible to load Spacedeck whiteboard "cURL error 7: Failed connect to localhost:9666; Connection refused (see https:\/\/curl.haxx.se\/libcurl\/c\/libcurl-errors.html) for http:\/\/localhost:9666\/api\/spaces" HOT 4
- [ERROR] Spacedeck is unreachable, it might not be running. cURL error 7: Failed to connect to localhost port 9666: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://localhost:9666/api/spaces HOT 15
- Problems with anonymous sharing HOT 1
- cronjob stops working after update to nextcloud 21.0.3 HOT 1
- Transifex project URL?
- whiteboard templates do not open in whiteboard app
- Clear Bucket
- Strange connection issues and media upload error
- Make integration_whiteboard compatible with Nextcloud v23 HOT 12
- Workaround Error 403 Access forbidden on Raspberry 4 NC22.2.3 Suggestion to enable parallel Installations. HOT 6
- Public shares cannot be opened while logged in with an NC account
- Is this integration dead? HOT 5
- Fix lang resource not appearing on Transifex please HOT 3
- [integration_whiteboard] Error: [ERROR] Spacedeck is unreachable, it might not be running. cURL error 7: Failed to connect to localhost port 9666: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://localhost:9666/api/spaces
- Switch to an actively maintained whiteboard solution HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from integration_whiteboard.