Skip to content

Commit

Permalink
WIP OK TO TEST ; DO NOT MERGE
Browse files Browse the repository at this point in the history
  • Loading branch information
jygaulier committed Oct 11, 2023
1 parent 0640580 commit 1d036dd
Show file tree
Hide file tree
Showing 23 changed files with 947 additions and 186 deletions.
11 changes: 9 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
# - "deleteRecord"
# - "editRecord"
# - "exportMail"
# - "downloadAsync"
# - "exposeUpload"
# - "exportFtp"
# - "mainQueue"
Expand Down Expand Up @@ -105,7 +106,7 @@
# Example with all profiles:
# - COMPOSE_FILE=docker-compose.yml:docker-compose.datastores.yml:docker-compose.tools.yml
# - COMPOSE_PROFILES=app,setup,gateway-classic,db,elasticsearch,redis,redis-session,rabbitmq,pma,mailhog,assetsInjest,createRecord,deleteRecord,editRecord,
# exportMail,exposeUpload,exportFtp,mainQueue,populateIndex,pullAssets,recordsActions,subdefCreation,
# exportMail,downloadAsync,exposeUpload,exportFtp,mainQueue,populateIndex,pullAssets,recordsActions,subdefCreation,
# validationReminder,webhook,writeMetadatas,shareBasket,scheduler,elk,db-backup,phraseanet-saml-sp
#

Expand Down Expand Up @@ -197,7 +198,10 @@ GATEWAY_FASTCGI_HTTPS=off
# Content Security Policy (CSP)
# security that helps to detect and mitigate certain types of attacks, including Cross-Site Scripting
## @run
GATEWAY_CSP="default-src 'self' 127.0.0.1 https://apiws.carrick-skills.com:8443 https://apiws.carrick-flow.com:8443 https://fonts.gstatic.com *.tiles.mapbox.com https://api.mapbox.com https://events.mapbox.com *.axept.io *.matomo.cloud *.newrelic.com *.nr-data.net https://www.googletagmanager.com *.google-analytics.com *.phrasea.io https://apiws.carrick-flow.com:8443 https://apiws.carrick-skills.com:8443 https://maxcdn.bootstrapcdn.com data: ; script-src 'unsafe-inline' 'unsafe-eval' 'self' https://www.gstatic.com *.alchemyasp.com *.axept.io *.matomo.cloud *.newrelic.com https://www.googletagmanager.com https://apiws.carrick-flow.com:8443 https://apiws.carrick-skills.com:8443 https://maxcdn.bootstrapcdn.com data: blob: ; style-src 'self' 'unsafe-inline' https://fonts.gstatic.com https://fonts.googleapis.com https://www.google.com https://www.gstatic.com https://apiws.carrick-flow.com:8443 https://apiws.carrick-skills.com:8443 https://maxcdn.bootstrapcdn.com ; img-src 'self' data: blob: *.tiles.mapbox.com https://axeptio.imgix.net *.cloudfront.net *.phrasea.io *.amazonaws.com https://apiws.carrick-flow.com:8443 https://apiws.carrick-skills.com:8443 https://maxcdn.bootstrapcdn.com https://www.gnu.org/graphics/ ; object-src 'self'; frame-ancestors 'self'"
## GATEWAY_CSP="default-src 'self' 127.0.0.1 https://apiws.carrick-skills.com:8443 https://apiws.carrick-flow.com:8443 https://fonts.gstatic.com *.tiles.mapbox.com https://api.mapbox.com https://events.mapbox.com *.axept.io *.matomo.cloud *.newrelic.com *.nr-data.net https://www.googletagmanager.com *.google-analytics.com *.phrasea.io https://apiws.carrick-flow.com:8443 https://apiws.carrick-skills.com:8443 https://maxcdn.bootstrapcdn.com data: ; script-src 'unsafe-inline' 'unsafe-eval' 'self' https://www.gstatic.com *.alchemyasp.com *.axept.io *.matomo.cloud *.newrelic.com https://www.googletagmanager.com https://apiws.carrick-flow.com:8443 https://apiws.carrick-skills.com:8443 https://maxcdn.bootstrapcdn.com data: blob: ; style-src 'self' 'unsafe-inline' https://fonts.gstatic.com https://fonts.googleapis.com https://www.google.com https://www.gstatic.com https://apiws.carrick-flow.com:8443 https://apiws.carrick-skills.com:8443 https://maxcdn.bootstrapcdn.com ; img-src 'self' data: blob: *.tiles.mapbox.com https://axeptio.imgix.net *.cloudfront.net *.phrasea.io *.amazonaws.com https://apiws.carrick-flow.com:8443 https://apiws.carrick-skills.com:8443 https://maxcdn.bootstrapcdn.com https://www.gnu.org/graphics/ https://sockjs-eu.pusher.com:443 wss://ws-eu.pusher.com ; object-src 'self'; frame-ancestors 'self'"


GATEWAY_CSP="default-src 'self' 127.0.0.1 https://sockjs-eu.pusher.com:443 wss://ws-eu.pusher.com https://apiws.carrick-skills.com:8443 https://apiws.carrick-flow.com:8443 https://fonts.gstatic.com *.tiles.mapbox.com https://api.mapbox.com https://events.mapbox.com *.axept.io *.matomo.cloud *.newrelic.com *.nr-data.net https://www.googletagmanager.com *.google-analytics.com *.phrasea.io https://apiws.carrick-flow.com:8443 https://apiws.carrick-skills.com:8443 data: ;script-src 'unsafe-inline' 'unsafe-eval' 'self' https://www.gstatic.com *.alchemyasp.com *.axept.io *.matomo.cloud *.newrelic.com https://www.googletagmanager.com https://apiws.carrick-flow.com:8443 https://apiws.carrick-skills.com:8443 ;style-src 'self' 'unsafe-inline' https://fonts.gstatic.com https://fonts.googleapis.com https://www.google.com https://www.gstatic.com https://apiws.carrick-flow.com:8443 https://apiws.carrick-skills.com:8443;img-src 'self' data: blob: *.tiles.mapbox.com https://axeptio.imgix.net *.cloudfront.net *.phrasea.io *.amazonaws.com https://apiws.carrick-flow.com:8443 https://apiws.carrick-skills.com:8443 ; object-src 'self';frame-ancestors 'self'"

# --- RabbitMQ settings ------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -686,6 +690,9 @@ PHRASEANET_WORKER_editRecord=2
# @run
PHRASEANET_WORKER_exportMail=2

# @run
PHRASEANET_WORKER_downloadAsync=2

# @run
PHRASEANET_WORKER_exposeUpload=2

Expand Down
107 changes: 82 additions & 25 deletions Phraseanet-production-client/dist/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -7441,6 +7441,7 @@ var exportRecord = function exportRecord(services) {
var url = configService.get('baseUrl');
var $container = null;
var initialize = function initialize() {

$container = (0, _jquery2.default)('body');
$container.on('click', '.record-export-action', function (event) {
event.preventDefault();
Expand Down Expand Up @@ -7579,6 +7580,86 @@ var exportRecord = function exportRecord(services) {
$dialog.close();
});

// $('#download_async .download_button_async').bind('click', function () {
// if (!check_subdefs($('#download_async'), dataConfig)) {
// return false;
// }
//
// if (!check_TOU($('#download_async'), dataConfig)) {
// return false;
// }
//
// var total = 0;
// var count = 0;
//
// $('input[name="obj[]"]', $('#download_async')).each(function () {
// var total_el = $(
// '#download_async input[name=download_' + $(this).val() + ']'
// );
// var count_el = $(
// '#download_async input[name=count_' + $(this).val() + ']'
// );
// if ($(this).prop('checked')) {
// total += parseInt($(total_el).val(), 10);
// count += parseInt($(count_el).val(), 10);
// }
// });
//
// if (count > 1 && total / 1024 / 1024 > dataConfig.maxDownload) {
// if (
// confirm(
// `${dataConfig.msg.fileTooLarge} \n ${dataConfig.msg
// .fileTooLargeAlt}`
// )
// ) {
// $(
// 'input[name="obj[]"]:checked',
// $('#download_async')
// ).each(function (i, n) {
// $(
// 'input[name="obj[]"][value="' + $(n).val() + '"]',
// $('#sendmail')
// ).prop('checked', true);
// });
//
// $(document).find('input[name="taglistdestmail"]').tagsinput('add', dataConfig.user.email);
//
// var tabs = $('.tabs', $dialog.getDomElement());
// tabs.tabs('option', 'active', 1);
// }
//
// return false;
// }
// $('#download_async form').submit();


// // Enable pusher logging - don't include this in production
// Pusher.logToConsole = true;
// const pusher = new Pusher('07b97d8d50b1f2b3d515', {
// cluster: 'eu'
// });
// const channel = pusher.subscribe("my-channel");
// pusher.connection.bind("state_change", function (states) {
// // states = {previous: 'oldState', current: 'newState'}
// console.log("========== connection changed : ========== ", states);
// });
// channel.bind("my-event", (data) => {
// // Method to be dispatched on trigger.
// console.log("========== received from pusher : ========== ", data);
// channel.unbind("my-event");
// console.log("========== channel unbinded ========== ");
// channel.disconnect();
// console.log("========== channel disconnected ========== ");
// pusher.unsubscribe("my-channel");
// console.log("========== pusher unsubscribed ========== ");
// pusher.disconnect()
// console.log("========== pusher disconnected ========== ");
// });


// $dialog.close();
// });

(0, _jquery2.default)('#order .order_button').bind('click', function () {
var title = '';
if (!check_TOU((0, _jquery2.default)('#order'), dataConfig)) {
Expand Down Expand Up @@ -7705,31 +7786,7 @@ var exportRecord = function exportRecord(services) {

(0, _jquery2.default)('#sendmail form').submit();
humane.infoLarge((0, _jquery2.default)('#export-send-mail-notif').val());
// $dialog.close();


// Enable pusher logging - don't include this in production
_pusherJs2.default.logToConsole = true;
var pusher = new _pusherJs2.default('07b97d8d50b1f2b3d515', {
cluster: 'eu'
});
var channel = pusher.subscribe("my-channel");
pusher.connection.bind("state_change", function (states) {
// states = {previous: 'oldState', current: 'newState'}
console.log("========== connection changed : ========== ", states);
});
channel.bind("my-event", function (data) {
// Method to be dispatched on trigger.
console.log("========== received from pusher : ========== ", data);
channel.unbind("my-event");
console.log("========== channel unbinded ========== ");
channel.disconnect();
console.log("========== channel disconnected ========== ");
pusher.unsubscribe("my-channel");
console.log("========== pusher unsubscribed ========== ");
pusher.disconnect();
console.log("========== pusher disconnected ========== ");
});
$dialog.close();
});

(0, _jquery2.default)('.datepicker', $dialog.getDomElement()).datepicker({
Expand Down
107 changes: 82 additions & 25 deletions Phraseanet-production-client/dist/production.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -7441,6 +7441,7 @@ var exportRecord = function exportRecord(services) {
var url = configService.get('baseUrl');
var $container = null;
var initialize = function initialize() {

$container = (0, _jquery2.default)('body');
$container.on('click', '.record-export-action', function (event) {
event.preventDefault();
Expand Down Expand Up @@ -7579,6 +7580,86 @@ var exportRecord = function exportRecord(services) {
$dialog.close();
});

// $('#download_async .download_button_async').bind('click', function () {
// if (!check_subdefs($('#download_async'), dataConfig)) {
// return false;
// }
//
// if (!check_TOU($('#download_async'), dataConfig)) {
// return false;
// }
//
// var total = 0;
// var count = 0;
//
// $('input[name="obj[]"]', $('#download_async')).each(function () {
// var total_el = $(
// '#download_async input[name=download_' + $(this).val() + ']'
// );
// var count_el = $(
// '#download_async input[name=count_' + $(this).val() + ']'
// );
// if ($(this).prop('checked')) {
// total += parseInt($(total_el).val(), 10);
// count += parseInt($(count_el).val(), 10);
// }
// });
//
// if (count > 1 && total / 1024 / 1024 > dataConfig.maxDownload) {
// if (
// confirm(
// `${dataConfig.msg.fileTooLarge} \n ${dataConfig.msg
// .fileTooLargeAlt}`
// )
// ) {
// $(
// 'input[name="obj[]"]:checked',
// $('#download_async')
// ).each(function (i, n) {
// $(
// 'input[name="obj[]"][value="' + $(n).val() + '"]',
// $('#sendmail')
// ).prop('checked', true);
// });
//
// $(document).find('input[name="taglistdestmail"]').tagsinput('add', dataConfig.user.email);
//
// var tabs = $('.tabs', $dialog.getDomElement());
// tabs.tabs('option', 'active', 1);
// }
//
// return false;
// }
// $('#download_async form').submit();


// // Enable pusher logging - don't include this in production
// Pusher.logToConsole = true;
// const pusher = new Pusher('07b97d8d50b1f2b3d515', {
// cluster: 'eu'
// });
// const channel = pusher.subscribe("my-channel");
// pusher.connection.bind("state_change", function (states) {
// // states = {previous: 'oldState', current: 'newState'}
// console.log("========== connection changed : ========== ", states);
// });
// channel.bind("my-event", (data) => {
// // Method to be dispatched on trigger.
// console.log("========== received from pusher : ========== ", data);
// channel.unbind("my-event");
// console.log("========== channel unbinded ========== ");
// channel.disconnect();
// console.log("========== channel disconnected ========== ");
// pusher.unsubscribe("my-channel");
// console.log("========== pusher unsubscribed ========== ");
// pusher.disconnect()
// console.log("========== pusher disconnected ========== ");
// });


// $dialog.close();
// });

(0, _jquery2.default)('#order .order_button').bind('click', function () {
var title = '';
if (!check_TOU((0, _jquery2.default)('#order'), dataConfig)) {
Expand Down Expand Up @@ -7705,31 +7786,7 @@ var exportRecord = function exportRecord(services) {

(0, _jquery2.default)('#sendmail form').submit();
humane.infoLarge((0, _jquery2.default)('#export-send-mail-notif').val());
// $dialog.close();


// Enable pusher logging - don't include this in production
_pusherJs2.default.logToConsole = true;
var pusher = new _pusherJs2.default('07b97d8d50b1f2b3d515', {
cluster: 'eu'
});
var channel = pusher.subscribe("my-channel");
pusher.connection.bind("state_change", function (states) {
// states = {previous: 'oldState', current: 'newState'}
console.log("========== connection changed : ========== ", states);
});
channel.bind("my-event", function (data) {
// Method to be dispatched on trigger.
console.log("========== received from pusher : ========== ", data);
channel.unbind("my-event");
console.log("========== channel unbinded ========== ");
channel.disconnect();
console.log("========== channel disconnected ========== ");
pusher.unsubscribe("my-channel");
console.log("========== pusher unsubscribed ========== ");
pusher.disconnect();
console.log("========== pusher disconnected ========== ");
});
$dialog.close();
});

(0, _jquery2.default)('.datepicker', $dialog.getDomElement()).datepicker({
Expand Down
51 changes: 23 additions & 28 deletions Phraseanet-production-client/src/components/record/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,28 @@ const exportRecord = services => {

return false;
}
// // Enable pusher logging - don't include this in production
// Pusher.logToConsole = true;
// const pusher = new Pusher('07b97d8d50b1f2b3d515', {
// cluster: 'eu'
// });
// const channel = pusher.subscribe("my-channel");
// pusher.connection.bind("state_change", function (states) {
// // states = {previous: 'oldState', current: 'newState'}
// console.log("========== connection changed : ========== ", states);
// });
// channel.bind("my-event", (data) => {
// // Method to be dispatched on trigger.
// console.log("========== received from pusher : ========== ", data);
// channel.unbind("my-event");
// console.log("========== channel unbinded ========== ");
// channel.disconnect();
// console.log("========== channel disconnected ========== ");
// pusher.unsubscribe("my-channel");
// console.log("========== pusher unsubscribed ========== ");
// pusher.disconnect()
// console.log("========== pusher disconnected ========== ");
// });
$('#download form').submit();
$dialog.close();
});
Expand Down Expand Up @@ -318,34 +340,7 @@ const exportRecord = services => {

$('#sendmail form').submit();
humane.infoLarge($('#export-send-mail-notif').val());
// $dialog.close();



// Enable pusher logging - don't include this in production
Pusher.logToConsole = true;
const pusher = new Pusher('07b97d8d50b1f2b3d515', {
cluster: 'eu'
});
const channel = pusher.subscribe("my-channel");
pusher.connection.bind("state_change", function (states) {
// states = {previous: 'oldState', current: 'newState'}
console.log("========== connection changed : ========== ", states);
});
channel.bind("my-event", (data) => {
// Method to be dispatched on trigger.
console.log("========== received from pusher : ========== ", data);
channel.unbind("my-event");
console.log("========== channel unbinded ========== ");
channel.disconnect();
console.log("========== channel disconnected ========== ");
pusher.unsubscribe("my-channel");
console.log("========== pusher unsubscribed ========== ");
pusher.disconnect()
console.log("========== pusher disconnected ========== ");
});


$dialog.close();
});

$('.datepicker', $dialog.getDomElement()).datepicker({
Expand Down
5 changes: 5 additions & 0 deletions config/configuration.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ registration-fields:
-
name: geonameid
required: true
pusher:
enabled: false
auth_key: 'pusher-auth_key'
secret: 'pusher-secret'
app_id: 'pusher-app_id'
xsendfile:
enabled: false
type: nginx
Expand Down
11 changes: 9 additions & 2 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,15 @@ services:

w-exportMail:
volumes:
- ../:/var/alchemy
- .:/var/alchemy/Phraseanet
- ../:/var/alchemy
- .:/var/alchemy/Phraseanet
networks:
- internal

w-downloadAsync:
volumes:
- ../:/var/alchemy
- .:/var/alchemy/Phraseanet
networks:
- internal

Expand Down
Loading

0 comments on commit 1d036dd

Please sign in to comment.