diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..0d46ca32 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +mysql \ No newline at end of file diff --git a/README.md b/README.md index 900d3735..e712a50f 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,26 @@ type: competition publish: true ``` -# Setup of a Simulation Server Infrastructure +## Run webots.cloud Locally + +```bash +docker run --rm -p "8088:80" -v ${PWD}/php:/php -v ${PWD}/httpdocs:/app -v ${PWD}/mysql:/var/lib/mysql mattrayner/lamp:latest-1804 +``` + +The webots.cloud website is now available at: +http://localhost:8088/ + +and you can access PhpMyAdmin at: +http://localhost:8088/phpmyadmin/ + +> **Note**: The username is `admin` and the password is randomly generated, shown in the console output (e.g. `You can now connect to this MySQL Server with y6yHUcJaK1fw`) + +You will also need to import the database and create a new config file: +- Use [this link](http://localhost:8088/phpmyadmin/index.php?route=/server/databases&server=1) to create a new database called `webots-cloud`. +- Use [this link](http://localhost:8088/phpmyadmin/index.php?route=/database/import&db=webots-cloud) to import the database from the file [`database/webots-cloud.sql`](database/webots-cloud.sql). +- Create a new config out of the [`php/database.php.template`](httpdocs/php/database.php.template) template. + + +## Setup of a Simulation Server Infrastructure Follow the instructions [here](https://cyberbotics.com/doc/guide/web-server). diff --git a/httpdocs/js/webots-cloud.js b/httpdocs/js/webots-cloud.js index 9371afb1..c42f9094 100644 --- a/httpdocs/js/webots-cloud.js +++ b/httpdocs/js/webots-cloud.js @@ -355,7 +355,7 @@ document.addEventListener('DOMContentLoaded', function() { } const admin = project.email ? project.email.endsWith('@cyberbotics.com') : false; const typeName = (data.duration === 0) ? 'scene' : 'animation'; - const url = data.url.startsWith('https://webots.cloud') ? document.location.origin + data.url.substring(20) : data.url; + const url = data.url.startsWith('https://webots.cloud') ? document.location.origin + data.url.substring(20) : data.url.substring(18); const thumbnailUrl = url.slice(0, url.lastIndexOf('/')) + '/storage' + url.slice(url.lastIndexOf('/')) + '/thumbnail.jpg'; const defaultThumbnailUrl = document.location.origin + '/images/thumbnail_not_available.jpg'; const versionUrl = `https://github.com/cyberbotics/webots/releases/tag/${data.version}`;