Compare commits

...

5 Commits

16 changed files with 195 additions and 7 deletions

2
debian/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*~
\#*\#

10
debian/README.Debian vendored Normal file
View File

@ -0,0 +1,10 @@
workadventure for Debian
-----------------------
To install:
- Install workadventure-back workadventure-front workadventure-pusher
- Go to "/var/lib/workadvenure/{back,pusher}" and run "yarn install --production"
- Serve "/usr/src/workadventure/front" as web page
- Provide configuration for the UI in "/usr/src/workadventure/front/config.js"
-- unknown <felix@localhost> Sat, 17 Apr 2021 14:06:51 +0200

12
debian/changelog vendored Normal file
View File

@ -0,0 +1,12 @@
workadventure (1.2.4-2) unstable; urgency=medium
* Fix chat dialog spacing
* Improve systemd unit for backend
-- unknown <felix@localhost> Wed, 21 Apr 2021 21:55:41 +0200
workadventure (1.2.4-1) unstable; urgency=medium
* Initial release
-- unknown <felix@localhost> Sat, 17 Apr 2021 14:06:51 +0200

32
debian/control vendored Normal file
View File

@ -0,0 +1,32 @@
Source: workadventure
Section: unknown
Priority: optional
Maintainer: unknown <felix@localhost>
Build-Depends: debhelper-compat (= 12), yarnpkg
Standards-Version: 4.5.1
Homepage: <insert the upstream URL, if relevant>
Rules-Requires-Root: no
Package: workadventure-back
Architecture: all
Depends: ${misc:Depends}, yarnpkg
Description: <insert up to 60 chars description>
<insert long description, indented with spaces>
Package: workadventure-pusher
Architecture: all
Depends: ${misc:Depends}, yarnpkg
Description: <insert up to 60 chars description>
<insert long description, indented with spaces>
Package: workadventure-front
Architecture: all
Depends: ${misc:Depends}
Description: <insert up to 60 chars description>
<insert long description, indented with spaces>
Package: workadventure-front-map
Architecture: all
Depends: ${misc:Depends}, workadventure-front
Description: <insert up to 60 chars description>
<insert long description, indented with spaces>

32
debian/copyright vendored Normal file
View File

@ -0,0 +1,32 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: workadventure
Upstream-Contact: <preferred name and address to reach the upstream project>
Source: <url://example.com>
Files: *
Copyright: 2021 TheCodingMachine
License: AGPL-3 with Commons Clause
<Put the license of the package here indented by 1 space>
<This follows the format of Description: lines in control file>
.
<Including paragraphs>
Files: debian/*
Copyright: 2021 unknown <felix@localhost>
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".

49
debian/rules vendored Executable file
View File

@ -0,0 +1,49 @@
#!/usr/bin/make -f
%:
dh $@
override_dh_install:
install -Dt debian/workadventure-front/usr/src/workadventure/front front/dist/index.html
install -d debian/workadventure-front/usr/src/workadventure/front/js
cp -r front/dist/static front/dist/resources front/dist/*.js front/dist/style*.css debian/workadventure-front/usr/src/workadventure/front
cp -r front/dist/js/*.js debian/workadventure-front/usr/src/workadventure/front/js
install -d debian/workadventure-front-map/usr/src/workadventure/front/js
cp -r front/dist/*.js.map front/dist/style*.css.map debian/workadventure-front-map/usr/src/workadventure/front
cp -r front/dist/js/*.js.map debian/workadventure-front-map/usr/src/workadventure/front/js
install -d debian/workadventure-back/usr/src/workadventure/back
cp -r back/dist/server.js back/dist/src debian/workadventure-back/usr/src/workadventure/back
cp back/yarn.lock back/package.json debian/workadventure-back/usr/src/workadventure/back
install -d debian/workadventure-back/var/lib/workadventure/back
ln -s /usr/src/workadventure/back/package.json /usr/src/workadventure/back/yarn.lock /usr/src/workadventure/back/src /usr/src/workadventure/back/server.js debian/workadventure-back/var/lib/workadventure/back/
install -d debian/workadventure-pusher/usr/src/workadventure/pusher
cp -r pusher/dist/server.js pusher/dist/src debian/workadventure-pusher/usr/src/workadventure/pusher
cp pusher/yarn.lock pusher/package.json debian/workadventure-pusher/usr/src/workadventure/pusher
install -d debian/workadventure-back/var/lib/workadventure/pusher
ln -s /usr/src/workadventure/pusher/package.json /usr/src/workadventure/pusher/yarn.lock /usr/src/workadventure/pusher/src /usr/src/workadventure/pusher/server.js debian/workadventure-back/var/lib/workadventure/pusher/
front/src/Messages/generated:
ln -s ../../../messages/generated front/src/Messages
back/src/Messages/generated:
ln -s ../../../messages/generated back/src/Messages
pusher/src/Messages/generated:
ln -s ../../../messages/generated pusher/src/Messages
override_dh_auto_build: front/src/Messages/generated back/src/Messages/generated pusher/src/Messages/generated
cd messages && yarnpkg install && yarnpkg run proto
rm -Rf front/dist/js
cd front && ./templater.sh && yarnpkg install && yarnpkg run build
cd back && yarnpkg install && yarnpkg run tsc
cd pusher && yarnpkg install && yarnpkg run tsc
# dh_make generated override targets
# This is example for Cmake (See https://bugs.debian.org/641051 )
#override_dh_auto_configure:
# dh_auto_configure -- \
# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)

13
debian/workadventure-back.service vendored Normal file
View File

@ -0,0 +1,13 @@
[Unit]
Description="Workadventure Backend"
[Service]
User=webspace-user
WorkingDirectory=/var/lib/workadventure/back
Environment=NODE_PATH=node_modules
ExecStart=node --max-old-space-size=4096 server.js
ProtectSystem=Full
ProtectHome=true
[Install]
WantedBy=multi-user.target

2
debian/workadventure-docs.docs vendored Normal file
View File

@ -0,0 +1,2 @@
README.source
README.Debian

15
debian/workadventure-pusher.service vendored Normal file
View File

@ -0,0 +1,15 @@
[Unit]
Description="Workadventure Pusher"
[Service]
User=webspace-user
WorkingDirectory=/var/lib/workadventure/pusher
Environment=NODE_PATH=node_modules
Environment=PUSHER_HTTP_PORT=8081
Environment=API_URL=localhost:50051
ExecStart=node --max-old-space-size=4096 server.js
ProtectSystem=Full
ProtectHome=true
[Install]
WantedBy=multi-user.target

View File

@ -126,6 +126,7 @@
<audio id="report-message"> <audio id="report-message">
<source src="/resources/objects/report-message.mp3" type="audio/mp3"> <source src="/resources/objects/report-message.mp3" type="audio/mp3">
</audio> </audio>
<script type="text/javascript" src="config.js"></script>
</body> </body>
</html> </html>

View File

@ -42,6 +42,9 @@
<section> <section>
<button id="sparkButton">Create map</button> <button id="sparkButton">Create map</button>
</section> </section>
<section>
<button id="sourceButton">Browse Source Code</button>
</section>
<section id="adminConsoleSection" hidden> <section id="adminConsoleSection" hidden>
<button id="adminConsoleButton">Admin console</button> <button id="adminConsoleButton">Admin console</button>
</section> </section>

View File

@ -1045,7 +1045,7 @@ div.modal-report-user{
.discussion .messages{ .discussion .messages{
position: absolute; position: absolute;
height: calc(100% - 360px); height: calc(100% - 360px - 36px);
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
max-width: calc(100% - 40px); max-width: calc(100% - 40px);

View File

@ -165,7 +165,7 @@ export class ConsoleGlobalMessageManager {
// Start loading CSS // Start loading CSS
const cssPromise = ConsoleGlobalMessageManager.loadCss(); const cssPromise = ConsoleGlobalMessageManager.loadCss();
// Import quill // Import quill
const Quill:any = await import("quill"); // eslint-disable-line @typescript-eslint/no-explicit-any const Quill:any = (await import("quill")).default; // eslint-disable-line @typescript-eslint/no-explicit-any
// Wait for CSS to be loaded // Wait for CSS to be loaded
await cssPromise; await cssPromise;

View File

@ -1,14 +1,21 @@
declare global {
interface Window {
waconfig:any;
}
}
const DEBUG_MODE: boolean = process.env.DEBUG_MODE == "true"; const DEBUG_MODE: boolean = process.env.DEBUG_MODE == "true";
const START_ROOM_URL : string = process.env.START_ROOM_URL || '/_/global/maps.workadventure.localhost/Floor0/floor0.json'; const START_ROOM_URL : string = process.env.START_ROOM_URL || window.waconfig.START_ROOM_URL || '/_/global/maps.workadventure.localhost/Floor0/floor0.json';
// For compatibility reasons with older versions, API_URL is the old host name of PUSHER_URL // For compatibility reasons with older versions, API_URL is the old host name of PUSHER_URL
const PUSHER_URL = process.env.PUSHER_URL || (process.env.API_URL ? '//'+process.env.API_URL : "//pusher.workadventure.localhost"); const PUSHER_URL = process.env.PUSHER_URL || window.waconfig.PUSHER_URL || (process.env.API_URL ? '//'+process.env.API_URL : "//pusher.workadventure.localhost");
const UPLOADER_URL = process.env.UPLOADER_URL || '//uploader.workadventure.localhost'; const UPLOADER_URL = process.env.UPLOADER_URL || '//uploader.workadventure.localhost';
const SOURCE_URL = window.waconfig.SOURCE_URL || '//github.com/thecodingmachine/workadventure';
const ADMIN_URL = process.env.ADMIN_URL || "//workadventure.localhost"; const ADMIN_URL = process.env.ADMIN_URL || "//workadventure.localhost";
const STUN_SERVER: string = process.env.STUN_SERVER || "stun:stun.l.google.com:19302"; const STUN_SERVER: string = process.env.STUN_SERVER || window.waconfig.STUN_SERVER || "stun:stun.l.google.com:19302";
const TURN_SERVER: string = process.env.TURN_SERVER || ""; const TURN_SERVER: string = process.env.TURN_SERVER || window.waconfig.TURN_SERVER || "";
const TURN_USER: string = process.env.TURN_USER || ''; const TURN_USER: string = process.env.TURN_USER || '';
const TURN_PASSWORD: string = process.env.TURN_PASSWORD || ''; const TURN_PASSWORD: string = process.env.TURN_PASSWORD || '';
const JITSI_URL : string|undefined = (process.env.JITSI_URL === '') ? undefined : process.env.JITSI_URL; const JITSI_URL : string|undefined = (process.env.JITSI_URL === '' || process.env.JITSI_URL === null) ? window.waconfig.JITSI_URL : process.env.JITSI_URL;
const JITSI_PRIVATE_MODE : boolean = process.env.JITSI_PRIVATE_MODE == "true"; const JITSI_PRIVATE_MODE : boolean = process.env.JITSI_PRIVATE_MODE == "true";
const RESOLUTION = 2; const RESOLUTION = 2;
const ZOOM_LEVEL = 1/*3/4*/; const ZOOM_LEVEL = 1/*3/4*/;
@ -21,6 +28,7 @@ export {
DEBUG_MODE, DEBUG_MODE,
START_ROOM_URL, START_ROOM_URL,
PUSHER_URL, PUSHER_URL,
SOURCE_URL,
UPLOADER_URL, UPLOADER_URL,
ADMIN_URL, ADMIN_URL,
RESOLUTION, RESOLUTION,

View File

@ -9,6 +9,7 @@ import {connectionManager} from "../../Connexion/ConnectionManager";
import {GameConnexionTypes} from "../../Url/UrlManager"; import {GameConnexionTypes} from "../../Url/UrlManager";
import {WarningContainer, warningContainerHtml, warningContainerKey} from "../Components/WarningContainer"; import {WarningContainer, warningContainerHtml, warningContainerKey} from "../Components/WarningContainer";
import {worldFullWarningStream} from "../../Connexion/WorldFullWarningStream"; import {worldFullWarningStream} from "../../Connexion/WorldFullWarningStream";
import {SOURCE_URL} from "../../Enum/EnvironmentVariable";
export const MenuSceneName = 'MenuScene'; export const MenuSceneName = 'MenuScene';
const gameMenuKey = 'gameMenu'; const gameMenuKey = 'gameMenu';
@ -279,6 +280,9 @@ export class MenuScene extends Phaser.Scene {
case 'sparkButton': case 'sparkButton':
this.gotToCreateMapPage(); this.gotToCreateMapPage();
break; break;
case 'sourceButton':
this.goToSourcePage();
break;
case 'changeSkinButton': case 'changeSkinButton':
this.closeSideMenu(); this.closeSideMenu();
gameManager.leaveGame(this, SelectCharacterSceneName, new SelectCharacterScene()); gameManager.leaveGame(this, SelectCharacterSceneName, new SelectCharacterScene());
@ -326,6 +330,10 @@ export class MenuScene extends Phaser.Scene {
this.closeGameQualityMenu(); this.closeGameQualityMenu();
} }
private goToSourcePage() {
window.open(SOURCE_URL, '_blank');
}
private gotToCreateMapPage() { private gotToCreateMapPage() {
//const sparkHost = 'https://'+window.location.host.replace('play.', '')+'/choose-map.html'; //const sparkHost = 'https://'+window.location.host.replace('play.', '')+'/choose-map.html';
//TODO fix me: this button can to send us on WorkAdventure BO. //TODO fix me: this button can to send us on WorkAdventure BO.