diff --git a/conf/overleaf-history-v1.service b/conf/overleaf-history-v1.service index 917dc41..bf6e15d 100644 --- a/conf/overleaf-history-v1.service +++ b/conf/overleaf-history-v1.service @@ -17,4 +17,4 @@ Restart=on-failure RestartSec=5s [Install] -WantedBy=multi-user.target +WantedBy=multi-user.target \ No newline at end of file diff --git a/conf/settings.js b/conf/settings.js index 5b6a497..886a8fa 100644 --- a/conf/settings.js +++ b/conf/settings.js @@ -53,7 +53,7 @@ const settings = { brandPrefix: '', port: __PORT__, - + allowAnonymousReadAndWriteSharing: process.env.SHARELATEX_ALLOW_ANONYMOUS_READ_AND_WRITE_SHARING === 'true', diff --git a/scripts/install b/scripts/install index da642ca..33a92d2 100755 --- a/scripts/install +++ b/scripts/install @@ -53,15 +53,15 @@ ynh_mongo_setup_db --db_user=$db_user --db_name=$db_name #================================================= ynh_script_progression --message="Configuring MongoDB..." --weight=10 -#ynh_replace_string --match_string="# engine:" --replace_string=" engine: wiredTiger" --target_file="/etc/mongod.conf" -#ynh_replace_string --match_string="#replication:" --replace_string="replication:\n replSetName: rs0" --target_file="/etc/mongod.conf" +ynh_replace_string --match_string="# engine:" --replace_string=" engine: wiredTiger" --target_file="/etc/mongod.conf" +ynh_replace_string --match_string="#replication:" --replace_string="replication:\n replSetName: rs0" --target_file="/etc/mongod.conf" -#ynh_exec_warn_less systemctl enable mongod --quiet -#ynh_systemd_action --service_name=mongod --action=restart --log_path=/var/log/mongodb/mongod.log --line_match="Waiting for connections" +ynh_exec_warn_less systemctl enable mongod --quiet +ynh_systemd_action --service_name=mongod --action=restart --log_path=/var/log/mongodb/mongod.log --line_match="Waiting for connections" -#if ynh_exec_warn_less ynh_mongo_exec --command="printjson(rs.status())" | grep -q "no replset config has been received"; then - #ynh_exec_warn_less ynh_mongo_exec --command="printjson(rs.initiate())" --eval -#fi +if ynh_exec_warn_less ynh_mongo_exec --command="printjson(rs.status())" | grep -q "no replset config has been received"; then + ynh_exec_warn_less ynh_mongo_exec --command="printjson(rs.initiate())" --eval +fi #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -74,7 +74,6 @@ ynh_setup_source --dest_dir="$install_dir/build" mkdir -p $install_dir/tmp mkdir -p $install_dir/tmp/{projectHistories,dumpFolder,uploads} - chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -117,6 +116,8 @@ chown $app:$app "$install_dir/settings.js" ynh_script_progression --message="Preparing app..." mkdir -p "$install_dir/live" +cp "$install_dir/build/server-ce/genScript.js" "$install_dir/live/genScript.js" +cp "$install_dir/build/server-ce/services.js" "$install_dir/live/services.js" cp "$install_dir/build/package.json" "$install_dir/live/package.json" cp "$install_dir/build/package-lock.json" "$install_dir/live/package-lock.json" cp -r "$install_dir/build/libraries/" "$install_dir/live/libraries/"