mirror of
https://github.com/YunoHost-Apps/thelounge_ynh.git
synced 2024-09-03 20:35:54 +02:00
[fix] Resolve path properly
This commit is contained in:
parent
e4101b0a6c
commit
30b8623cf0
4 changed files with 9 additions and 4 deletions
|
@ -31,6 +31,9 @@ user=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | s
|
|||
sed -i "s@USERTOCHANGE@$user@g" ../conf/user.json
|
||||
sed -i "s@PATHTOCHANGE@$path/@g" ../conf/config.js
|
||||
|
||||
# HACK: Change the socket.io path in the sources
|
||||
sed -i "s@PATHTOCHANGE@$path@g" ../sources/client/js/shout.js
|
||||
|
||||
# Copy files to the right place
|
||||
sudo mkdir -p $final_path/.shout/users
|
||||
sudo cp ../conf/config.js $final_path/.shout/
|
||||
|
|
|
@ -11,6 +11,9 @@ final_path=/var/www/shout
|
|||
# Remove trailing "/" from the path
|
||||
path=${path%/}
|
||||
|
||||
# HACK: Change the socket.io path in the sources
|
||||
sed -i "s@PATHTOCHANGE@$path@g" ../sources/client/js/shout.js
|
||||
|
||||
# Copy files to the right place
|
||||
sudo mkdir -p $final_path/.shout/users
|
||||
sed -i "s@PATHTOCHANGE@$path/@g" ../conf/config.js
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
$(function() {
|
||||
var socket = io();
|
||||
var socket = io({path: 'PATHTOCHANGE/socket.io'});
|
||||
var commands = [
|
||||
"/close",
|
||||
"/connect",
|
||||
|
|
|
@ -16,8 +16,8 @@ module.exports = function(options) {
|
|||
config = _.extend(config, options);
|
||||
|
||||
var app = express()
|
||||
.use(config.rootpath, index)
|
||||
.use(config.rootpath, express.static("client"));
|
||||
.use(index)
|
||||
.use(express.static("client"));
|
||||
|
||||
app.enable("trust proxy");
|
||||
|
||||
|
@ -46,7 +46,6 @@ module.exports = function(options) {
|
|||
sockets = io(server, {
|
||||
transports: transports
|
||||
});
|
||||
sockets.path(config.rootpath + 'socket.io');
|
||||
|
||||
sockets.on("connect", function(socket) {
|
||||
var authHeader = socket.client.request.headers.authorization;
|
||||
|
|
Loading…
Reference in a new issue