Commit d8abd949 authored by erdnaxe's avatar erdnaxe 🎇

Add Cryptpad and homepage

parent 7d6759e1
......@@ -18,4 +18,5 @@ Des fichiers `example.env` doivent être copiés en `.env` puis configurés.
* 8084 -> EtherPad (pad)
* 8085 -> Django CAS server (cas)
* 8086 -> ShareLatex
* 8087 -> Homepage
* 8088 -> Cryptpad
This diff is collapsed.
/*
* You can override the configurable values from this file.
* The recommended method is to make a copy of this file (/customize.dist/application_config.js)
in a 'customize' directory (/customize/application_config.js).
* If you want to check all the configurable values, you can open the internal configuration file
but you should not change it directly (/common/application_config_internal.js)
*/
define(['/common/application_config_internal.js'], function (AppConfig) {
AppConfig.availablePadTypes = ['drive', 'teams', 'pad', 'sheet', 'code', 'slide', 'poll', /*'kanban', 'whiteboard',*/
/*'oodoc', 'ooslide',*/ 'file', /*'todo',*/ 'contacts'];
AppConfig.disableFeedback = true;
AppConfig.surveyURL = "";
AppConfig.disableCrowdfundingMessages = true;
AppConfig.enableTemplates = false;
AppConfig.disableProfile = true;
AppConfig.disableSharedFolders = true;
AppConfig.defaultStorageLimit = 500 * 1024 * 1024;
return AppConfig;
});
define([
'/common/hyperscript.js',
'/common/common-language.js',
'/customize/messages.js',
'jquery',
], function (h, Language, Msg, $) {
var Pages = {};
Pages.setHTML = function (e, html) {
e.innerHTML = html;
return e;
};
var languageSelector = function () {
var options = [];
var languages = Msg._languages;
var selected = Msg._languageUsed;
var keys = Object.keys(languages).sort();
keys.forEach(function (l) {
var attr = { value: l };
if (selected === l) { attr.selected = 'selected'; }
options.push(h('option', attr, languages[l]));
});
var select = h('select', {}, options);
$(select).change(function () {
Language.setLanguage($(select).val() || '', null, function () {
window.location.reload();
});
});
return select;
};
var footerCol = function (title, L, literal) {
return h('div.col-6.col-sm-3', [
h('ul.list-unstyled', [
h('li.footer-title', {
'data-localization': title,
}, title? Msg[title]: literal )
].concat(L.map(function (l) {
return h('li', [ l ]);
}))
)
]);
};
var footLink = function (ref, loc, text) {
var attrs = {
href: ref,
};
if (!/^\//.test(ref)) {
attrs.target = '_blank';
attrs.rel = 'noopener noreferrer';
}
if (loc) {
attrs['data-localization'] = loc;
text = Msg[loc];
}
return h('a', attrs, text);
};
Pages.infopageFooter = function () {
return h('footer', [
h('div.container', [
h('div.row', [
footerCol(null, [
languageSelector()
], ''),
footerCol(null, [
footLink('/faq.html', 'faq_link'),
]),
footerCol(null, [
footLink('/contact.html', 'contact'),
]),
footerCol(null, [
footLink('/terms.html', 'footer_tos'),
]),
])
]),
h('div.cp-version-footer', "CryptPad installé par ServENS")
]);
};
Pages.infopageTopbar = function () {
var rightLinks;
var username = window.localStorage.getItem('User_name');
if (username === null) {
rightLinks = [
h('a.nav-item.nav-link.cp-login-btn', { href: '/login/'}, Msg.login_login),
h('a.nav-item.nav-link.cp-register-btn', { href: '/register/'}, Msg.login_register)
];
} else {
rightLinks = h('a.nav-item.nav-link.cp-user-btn', { href: '/drive/' }, [
h('i.fa.fa-user-circle'),
" ",
username
]);
}
var button = h('button.navbar-toggler', {
'type':'button',
}, h('i.fa.fa-bars '));
$(button).click(function () {
if ($('#menuCollapse').is(':visible')) {
return void $('#menuCollapse').slideUp();
}
$('#menuCollapse').slideDown();
});
return h('nav.navbar.navbar-expand-lg',
h('a.navbar-brand', { href: '/index.html'}),
button,
h('div.collapse.navbar-collapse.justify-content-end#menuCollapse', [
].concat(rightLinks))
);
};
return Pages;
});
define([
'jquery',
'/api/config',
'/common/hyperscript.js',
'/common/common-feedback.js',
'/common/common-interface.js',
'/common/textFit.min.js',
'/customize/messages.js',
'/customize/application_config.js',
'/common/outer/local-store.js',
'/customize/pages.js'
], function ($, Config, h, Feedback, UI, TextFit, Msg, AppConfig, LocalStore, Pages) {
var urlArgs = Config.requireConf.urlArgs;
var isAvailableType = function (x) {
if (!Array.isArray(AppConfig.availablePadTypes)) { return true; }
return AppConfig.availablePadTypes.indexOf(x) !== -1;
};
var checkRegisteredType = function (x) {
// Return true if we're registered or if the app is not registeredOnly
if (LocalStore.isLoggedIn()) { return true; }
if (!Array.isArray(AppConfig.registeredOnlyTypes)) { return true; }
return AppConfig.registeredOnlyTypes.indexOf(x) === -1;
};
return function () {
var icons = [
[ 'pad', Msg.type.pad],
[ 'code', Msg.type.code],
[ 'slide', Msg.type.slide],
[ 'sheet', Msg.type.sheet],
[ 'poll', Msg.type.poll],
[ 'kanban', Msg.type.kanban],
[ 'whiteboard', Msg.type.whiteboard],
[ 'drive', Msg.type.drive]
].filter(function (x) {
return isAvailableType(x[0]);
})
.map(function (x) {
var s = 'div.bs-callout.cp-callout-' + x[0];
var isEnabled = checkRegisteredType(x[0]);
//if (i > 2) { s += '.cp-more.cp-hidden'; }
var icon = AppConfig.applicationsIcon[x[0]];
var font = icon.indexOf('cptools') === 0 ? 'cptools' : 'fa';
var href = '/'+ x[0] +'/';
var attr = isEnabled ? { href: href } : {
onclick: function () {
sessionStorage.redirectTo = href;
window.location.href = '/login/';
}
};
if (!isEnabled) {
s += '.cp-app-disabled';
attr.title = Msg.mustLogin;
}
return h('a', [
attr,
h(s, [
h('i.' + font + '.' + icon),
h('div.pad-button-text', {
style: 'width:120px;height:30px;'
}, [ x[1] ])
])
]);
});
icons.forEach(function (a) {
setTimeout(function () {
TextFit($(a).find('.pad-button-text')[0], {minFontSize: 13, maxFontSize: 18});
});
});
UI.addTooltips();
var _link = h('a', {
href: "https://opencollective.com/cryptpad/",
target: '_blank',
rel: 'noopener',
});
var crowdFunding = h('button', [
Msg.crowdfunding_button
]);
$(crowdFunding).click(function () {
_link.click();
Feedback.send('HOME_SUPPORT_CRYPTPAD');
});
var blocks = h('div.container',[
h('div.row.justify-content-sm-center',[
h('div.col-12.col-sm-4.cp-index-block.cp-index-block-host', h('div', [
Pages.setHTML(h('span'), Msg.home_host),
h('div.cp-img-container', [
h('img.agpl', {
src: "/customize/images/AGPL.png",
title: Msg.home_host_agpl
}),
h('a.img', {
href: 'https://blog.cryptpad.fr/2018/11/13/CryptPad-receives-NGI-Startup-Award/',
target: '_blank'
}, h('img.ngi', {
src: "/customize/images/ngi.png",
title: Msg.home_ngi
}))
])
])),
h('div.col-12.col-sm-4.cp-index-block.cp-index-block-product', h('div', [
Msg.home_product
])),
AppConfig.disableCrowdfundingMessages ? undefined : h('div.col-12.col-sm-4.cp-index-block.cp-index-block-help', h('div', [
Msg.crowdfunding_home1,
h('br'),
Msg.crowdfunding_home2,
h('br'),
crowdFunding,
_link
])),
])
]);
return [
h('div#cp-main', [
Pages.infopageTopbar(),
h('div.container.cp-container', [
h('div.row', [
h('div.cp-title.col-12.col-sm-6', [
h('img', { src: '/customize/cryptpad-new-logo-colors-logoonly.png?' + urlArgs }),
h('h1', 'CryptPad'),
h('p', Msg.main_catch_phrase)
]),
h('div.col-12.col-sm-6.cp-app-grid', [
icons,
//more
])
]),
blocks,
/*h('div.row', [
h('div.cp-crowdfunding', [
crowdFunding
])
])*/
]),
]),
Pages.infopageFooter(),
];
};
});
version: '3'
services:
cryptpad:
image: cryptpad/cryptpad:version-3.3.0
environment:
- USE_SSL=false
- LOG_TO_STDOUT=true
ports:
- "8088:3000"
restart: always
volumes:
- ./customize:/cryptpad/customize:rw
- ./config:/cryptpad/cfg:rw
- ./data_cryptpad/files:/cryptpad/datastore:rw
- ./data_cryptpad/pins:/cryptpad/pins:rw
- ./data_cryptpad/blob:/cryptpad/blob:rw
- ./data_cryptpad/blobstage:/cryptpad/blobstage:rw
- ./data_cryptpad/tasks:/cryptpad/tasks:rw
- ./data_cryptpad/block:/cryptpad/block:rw
- ./data_cryptpad/data:/cryptpad/data:rw
version: "3.7"
services:
webpage:
image: nginx:alpine
volumes:
- ./data_nginx:/usr/share/nginx/html:ro
ports:
- 8087:80
restart: always
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment