Collaboration Tremplin des Sciences
-
- This repo
- ?
- Accueil
- Journal public
- Gists
- Sign in
'; } else if (searchSubType !== undefined && searchSubType == 'repo_group') { valueDisplay += '
repo group
'; } } // repository else if (searchType === 'repo') { var repoIcon = getRepoIcon(data['repo_type']); icon += repoIcon; if (data['private']) { icon += ' '; } else if (visualShowPublicIcon) { icon += ' '; } } // repository groups else if (searchType === 'repo_group') { icon += ' '; } // user group else if (searchType === 'user_group') { icon += ' '; } // user else if (searchType === 'user') { icon += ''.format(data['icon_link']); } // pull request else if (searchType === 'pull_request') { icon += ' '; } // commit else if (searchType === 'commit') { var repo_data = data['repo_data']; var repoIcon = getRepoIcon(repo_data['repository_type']); if (repoIcon) { icon += repoIcon; } else { icon += ''; } } // file else if (searchType === 'file') { var repo_data = data['repo_data']; var repoIcon = getRepoIcon(repo_data['repository_type']); if (repoIcon) { icon += repoIcon; } else { icon += ''; } } // generic text else if (searchType === 'text') { icon = ''; } var tmpl = '
{0}{1}
'; return tmpl.format(icon, valueDisplay); }; var handleSelect = function(element, suggestion) { if (suggestion.type === "hint") { // we skip action $('#main_filter').focus(); } else if (suggestion.type === "text") { // we skip action $('#main_filter').focus(); } else { window.location = suggestion['url']; } }; var autocompleteMainFilterResult = function (suggestion, originalQuery, queryLowerCase) { if (queryLowerCase.split(':').length === 2) { queryLowerCase = queryLowerCase.split(':')[1] } if (suggestion.type === "text") { // special case we don't want to "skip" display for return true } return suggestion.value_display.toLowerCase().indexOf(queryLowerCase) !== -1; }; var cleanContext = { repo_view_type: null, repo_id: null, repo_name: "", repo_group_id: null, repo_group_name: null }; var removeGoToFilter = function () { $('.searchTagHidable').hide(); $('#main_filter').autocomplete( 'setOptions', {params:{search_context: cleanContext}}); }; $('#main_filter').autocomplete({ serviceUrl: pyroutes.url('goto_switcher_data'), params: { "search_context": templateContext.search_context }, minChars:2, maxHeight:400, deferRequestBy: 300, //miliseconds tabDisabled: true, autoSelectFirst: false, containerClass: 'autocomplete-qfilter-suggestions', formatResult: autocompleteMainFilterFormatResult, lookupFilter: autocompleteMainFilterResult, onSelect: function (element, suggestion) { handleSelect(element, suggestion); return false; }, onSearchError: function (element, query, jqXHR, textStatus, errorThrown) { if (jqXHR !== 'abort') { var message = formatErrorMessage(jqXHR, textStatus, errorThrown); SwalNoAnimation.fire({ icon: 'error', title: _gettext('Error during search operation'), html: '{0}'.format(message), }).then(function(result) { window.location.reload(); }) } }, onSearchStart: function (params) { $('.searchTag.searchTagIcon').html('') }, onSearchComplete: function (query, suggestions) { $('.searchTag.searchTagIcon').html('') }, }); showMainFilterBox = function () { $('#main_filter_help').toggle(); }; $('#main_filter').on('keydown.autocomplete', function (e) { var BACKSPACE = 8; var el = $(e.currentTarget); if(e.which === BACKSPACE){ var inputVal = el.val(); if (inputVal === ""){ removeGoToFilter() } } }); var dismissNotice = function(noticeId) { var url = pyroutes.url('user_notice_dismiss', {"user_id": templateContext.rhodecode_user.user_id}); var postData = { 'csrf_token': CSRF_TOKEN, 'notice_id': noticeId, }; var success = function(response) { $('#notice-message-' + noticeId).remove(); return false; }; var failure = function(data, textStatus, xhr) { alert("error processing request: " + textStatus); return false; }; ajaxPOST(url, postData, success, failure); } var hideLicenseWarning = function () { var fingerprint = templateContext.session_attrs.license_fingerprint; storeUserSessionAttr('rc_user_session_attr.hide_license_warning', fingerprint); $('#notifications').hide(); } var hideLicenseError = function () { var fingerprint = templateContext.session_attrs.license_fingerprint; storeUserSessionAttr('rc_user_session_attr.hide_license_error', fingerprint); $('#notifications').hide(); }
Align vidal repo on drtyhlpr
Align vidal repo on drtyhlpr
Unknown - - Load All Authors |
Fichier de la dernière révision:
r501:3c3d6ac60789
r728:cb531218d6a8
Show More
Download file
30-security.sh
24 lines | 687 B | application/x-sh | BashLexer
/ bootstrap.d / 30-security.sh
Historique | Source | Brut |Copy content |Copy permalink
Filip Pytloun Refactor: split bootstrap actions and allow custom | r56 | # | ||
# Setup users and security settings | ||||
# | ||||
Jan Wagner spliting more files, fix-uboot, fix-fbturbo, fix-locale | r67 | # Load utility functions | ||
Filip Pytloun Refactor: split bootstrap actions and allow custom | r56 | . ./functions.sh | ||
# Generate crypt(3) password string | ||||
Unknown fixes... | r338 | ENCRYPTED_PASSWORD=$(mkpasswd -m sha-512 "${PASSWORD}") | ||
ENCRYPTED_USER_PASSWORD=$(mkpasswd -m sha-512 "${USER_PASSWORD}") | ||||
Filip Pytloun Refactor: split bootstrap actions and allow custom | r56 | |||
Jan Wagner comment-cleanup, net-cleanup, size-calc-fix, split-more, menuconfig | r71 | # Setup default user | ||
Filip Pytloun Refactor: split bootstrap actions and allow custom | r56 | if [ "$ENABLE_USER" = true ] ; then | ||
Unknown fixes... | r420 | chroot_exec adduser --gecos "$USER_NAME" --add_extra_groups --disabled-password "$USER_NAME" | ||
chroot_exec usermod -a -G sudo -p "${ENCRYPTED_USER_PASSWORD}" "$USER_NAME" | ||||
Filip Pytloun Refactor: split bootstrap actions and allow custom | r56 | fi | ||
Jan Wagner comment-cleanup, net-cleanup, size-calc-fix, split-more, menuconfig | r71 | # Setup root password or not | ||
Jan Wagner Added: KERNEL_SRCDIR, path-checks, code-cleanup | r72 | if [ "$ENABLE_ROOT" = true ] ; then | ||
Filip Pytloun Refactor: split bootstrap actions and allow custom | r56 | chroot_exec usermod -p "${ENCRYPTED_PASSWORD}" root | ||
else | ||||
Jan Wagner code cleanup and even more spliting | r70 | # Set no root password to disable root login | ||
Filip Pytloun Refactor: split bootstrap actions and allow custom | r56 | chroot_exec usermod -p \'!\' root | ||
fi | ||||
'.format(_gettext('Loading ...'))); $.pjax({ url: url, container: '#file_history_container', push: false, timeout: 5000 }).complete(function () { tooltipActivate(); }); }); }; var initTreeJS = function () { var state = getFileState(); getFilesMetadata(); // fuzzy file filter fileBrowserListeners(state.node_list_url, state.url_base); // switch to widget var initialCommitData = { at_ref: atRef, id: null, text: 'cb531218d6a8f096873b1797e5435978be73a63c', type: 'sha', raw_id: 'cb531218d6a8f096873b1797e5435978be73a63c', idx: 728, files_url: null, }; // check if we have ref info. var selectedRef = fileTreeRefs[atRef]; if (selectedRef !== undefined) { $.extend(initialCommitData, selectedRef) } var loadUrl = pyroutes.url('repo_refs_data', {'repo_name': templateContext.repo_name}); var cacheKey = '__ALL_FILE_REFS__'; var cachedDataSource = {}; var loadRefsData = function (query) { $.ajax({ url: loadUrl, data: {}, dataType: 'json', type: 'GET', success: function (data) { cachedDataSource[cacheKey] = data; query.callback({results: data.results}); } }); }; var feedRefsData = function (query, cachedData) { var data = {results: []}; //filter results $.each(cachedData.results, function () { var section = this.text; var children = []; $.each(this.children, function () { if (query.term.length === 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0) { children.push(this) } }); data.results.push({ 'text': section, 'children': children }) }); //push the typed in commit idx if (!isNaN(query.term)) { var files_url = pyroutes.url('repo_files', {'repo_name': templateContext.repo_name, 'commit_id': query.term, 'f_path': state.f_path}); data.results.push({ 'text': _gettext('go to numeric commit'), 'children': [{ at_ref: null, id: null, text: 'r{0}'.format(query.term), type: 'sha', raw_id: query.term, idx: query.term, files_url: files_url, }] }); } query.callback(data); }; var select2RefFileSwitcher = function (targetElement, loadUrl, initialData) { var formatResult = function (result, container, query) { return formatSelect2SelectionRefs(result); }; var formatSelection = function (data, container) { var commit_ref = data; var tmpl = ''; if (commit_ref.type === 'sha') { tmpl = (commit_ref.raw_id || "").substr(0,8); } else if (commit_ref.type === 'branch') { tmpl = tmpl.concat(' '); tmpl = tmpl.concat(escapeHtml(commit_ref.text)); } else if (commit_ref.type === 'tag') { tmpl = tmpl.concat(' '); tmpl = tmpl.concat(escapeHtml(commit_ref.text)); } else if (commit_ref.type === 'book') { tmpl = tmpl.concat(' '); tmpl = tmpl.concat(escapeHtml(commit_ref.text)); } var idx = commit_ref.idx || 0; if (idx !== 0) { tmpl = tmpl.concat('r{0}'.format(idx)); } return tmpl }; $(targetElement).select2({ dropdownAutoWidth: true, width: "resolve", containerCssClass: "drop-menu", dropdownCssClass: "drop-menu-dropdown", query: function(query) { var cachedData = cachedDataSource[cacheKey]; if (cachedData) { feedRefsData(query, cachedData) } else { loadRefsData(query) } }, initSelection: function(element, callback) { callback(initialData); }, formatResult: formatResult, formatSelection: formatSelection }); }; select2RefFileSwitcher('#refs_filter', loadUrl, initialCommitData); // switcher for file tree $('#refs_filter').on('change', function(e) { var data = $('#refs_filter').select2('data'); window.location = data.files_url }); }; $(document).ready(function() { timeagoActivate(); tooltipActivate(); if ($('#trimmed_message_box').height() < 50) { $('#message_expand').hide(); } $('#message_expand').on('click', function(e) { $('#trimmed_message_box').css('max-height', 'none'); $(this).hide(); }); if (fileSourcePage) { initFileJS() } else { initTreeJS() } var search_GET = ""; if (search_GET === "1") { NodeFilter.initFilter(); NodeFilter.focus(); } });