yannstatic/static/2020/08/06/Serveur-srvxo-Debian10-Yunohost(xoyize.xyz).html

3847 lines
285 KiB
HTML
Raw Normal View History

2024-10-31 20:18:37 +01:00
<!DOCTYPE html><html lang="fr">
<head><meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"><title>Serveur srvxo Debian10 Yunohost xoyize.xyz - YannStatic</title>
<meta name="description" content="">
<link rel="canonical" href="https://static.rnmkcy.eu/2020/08/06/Serveur-srvxo-Debian10-Yunohost(xoyize.xyz).html"><link rel="alternate" type="application/rss+xml" title="YannStatic" href="/feed.xml">
<!-- - include head/favicon.html - -->
<link rel="shortcut icon" type="image/png" href="/assets/favicon/favicon.png"><link rel="stylesheet" href="/assets/css/main.css"><link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" ><!-- start custom head snippets --><link rel="stylesheet" href="/assets/css/expand.css">
<!-- end custom head snippets --><script>(function() {
window.isArray = function(val) {
return Object.prototype.toString.call(val) === '[object Array]';
};
window.isString = function(val) {
return typeof val === 'string';
};
window.hasEvent = function(event) {
return 'on'.concat(event) in window.document;
};
window.isOverallScroller = function(node) {
return node === document.documentElement || node === document.body || node === window;
};
window.isFormElement = function(node) {
var tagName = node.tagName;
return tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA';
};
window.pageLoad = (function () {
var loaded = false, cbs = [];
window.addEventListener('load', function () {
var i;
loaded = true;
if (cbs.length > 0) {
for (i = 0; i < cbs.length; i++) {
cbs[i]();
}
}
});
return {
then: function(cb) {
cb && (loaded ? cb() : (cbs.push(cb)));
}
};
})();
})();
(function() {
window.throttle = function(func, wait) {
var args, result, thisArg, timeoutId, lastCalled = 0;
function trailingCall() {
lastCalled = new Date;
timeoutId = null;
result = func.apply(thisArg, args);
}
return function() {
var now = new Date,
remaining = wait - (now - lastCalled);
args = arguments;
thisArg = this;
if (remaining <= 0) {
clearTimeout(timeoutId);
timeoutId = null;
lastCalled = now;
result = func.apply(thisArg, args);
} else if (!timeoutId) {
timeoutId = setTimeout(trailingCall, remaining);
}
return result;
};
};
})();
(function() {
var Set = (function() {
var add = function(item) {
var i, data = this._data;
for (i = 0; i < data.length; i++) {
if (data[i] === item) {
return;
}
}
this.size ++;
data.push(item);
return data;
};
var Set = function(data) {
this.size = 0;
this._data = [];
var i;
if (data.length > 0) {
for (i = 0; i < data.length; i++) {
add.call(this, data[i]);
}
}
};
Set.prototype.add = add;
Set.prototype.get = function(index) { return this._data[index]; };
Set.prototype.has = function(item) {
var i, data = this._data;
for (i = 0; i < data.length; i++) {
if (this.get(i) === item) {
return true;
}
}
return false;
};
Set.prototype.is = function(map) {
if (map._data.length !== this._data.length) { return false; }
var i, j, flag, tData = this._data, mData = map._data;
for (i = 0; i < tData.length; i++) {
for (flag = false, j = 0; j < mData.length; j++) {
if (tData[i] === mData[j]) {
flag = true;
break;
}
}
if (!flag) { return false; }
}
return true;
};
Set.prototype.values = function() {
return this._data;
};
return Set;
})();
window.Lazyload = (function(doc) {
var queue = {js: [], css: []}, sources = {js: {}, css: {}}, context = this;
var createNode = function(name, attrs) {
var node = doc.createElement(name), attr;
for (attr in attrs) {
if (attrs.hasOwnProperty(attr)) {
node.setAttribute(attr, attrs[attr]);
}
}
return node;
};
var end = function(type, url) {
var s, q, qi, cbs, i, j, cur, val, flag;
if (type === 'js' || type ==='css') {
s = sources[type], q = queue[type];
s[url] = true;
for (i = 0; i < q.length; i++) {
cur = q[i];
if (cur.urls.has(url)) {
qi = cur, val = qi.urls.values();
qi && (cbs = qi.callbacks);
for (flag = true, j = 0; j < val.length; j++) {
cur = val[j];
if (!s[cur]) {
flag = false;
}
}
if (flag && cbs && cbs.length > 0) {
for (j = 0; j < cbs.length; j++) {
cbs[j].call(context);
}
qi.load = true;
}
}
}
}
};
var load = function(type, urls, callback) {
var s, q, qi, node, i, cur,
_urls = typeof urls === 'string' ? new Set([urls]) : new Set(urls), val, url;
if (type === 'js' || type ==='css') {
s = sources[type], q = queue[type];
for (i = 0; i < q.length; i++) {
cur = q[i];
if (_urls.is(cur.urls)) {
qi = cur;
break;
}
}
val = _urls.values();
if (qi) {
callback && (qi.load || qi.callbacks.push(callback));
callback && (qi.load && callback());
} else {
q.push({
urls: _urls,
callbacks: callback ? [callback] : [],
load: false
});
for (i = 0; i < val.length; i++) {
node = null, url = val[i];
if (s[url] === undefined) {
(type === 'js' ) && (node = createNode('script', { src: url }));
(type === 'css') && (node = createNode('link', { rel: 'stylesheet', href: url }));
if (node) {
node.onload = (function(type, url) {
return function() {
end(type, url);
};
})(type, url);
(doc.head || doc.body).appendChild(node);
s[url] = false;
}
}
}
}
}
};
return {
js: function(url, callback) {
load('js', url, callback);
},
css: function(url, callback) {
load('css', url, callback);
}
};
})(this.document);
})();
</script><script>
(function() {
var TEXT_VARIABLES = {
version: '2.2.6',
sources: {
font_awesome: 'https://use.fontawesome.com/releases/v5.0.13/css/all.css',
jquery: '/assets/js/jquery.min.js',
leancloud_js_sdk: '//cdn.jsdelivr.net/npm/leancloud-storage@3.13.2/dist/av-min.js',
chart: 'https://cdn.bootcss.com/Chart.js/2.7.2/Chart.bundle.min.js',
gitalk: {
js: 'https://cdn.bootcss.com/gitalk/1.2.2/gitalk.min.js',
css: 'https://cdn.bootcss.com/gitalk/1.2.2/gitalk.min.css'
},
valine: 'https://unpkg.com/valine/dist/Valine.min.js'
},
site: {
toc: {
selectors: 'h1,h2,h3'
}
},
paths: {
search_js: '/assets/search.js'
}
};
window.TEXT_VARIABLES = TEXT_VARIABLES;
})();
</script>
</head>
<body>
<div class="root" data-is-touch="false">
<div class="layout--page js-page-root"><!----><div class="page__main js-page-main page__viewport hide-footer has-aside has-aside cell cell--auto">
<div class="page__main-inner"><div class="page__header d-print-none"><header class="header"><div class="main">
<div class="header__title">
<div class="header__brand"><svg id="svg" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="478.9473684210526" viewBox="0, 0, 400,478.9473684210526"><g id="svgg"><path id="path0" d="M308.400 56.805 C 306.970 56.966,303.280 57.385,300.200 57.738 C 290.906 58.803,278.299 59.676,269.200 59.887 L 260.600 60.085 259.400 61.171 C 258.010 62.428,256.198 63.600,255.645 63.600 C 255.070 63.600,252.887 65.897,252.598 66.806 C 252.460 67.243,252.206 67.600,252.034 67.600 C 251.397 67.600,247.206 71.509,247.202 72.107 C 247.201 72.275,246.390 73.190,245.400 74.138 C 243.961 75.517,243.598 76.137,243.592 77.231 C 243.579 79.293,241.785 83.966,240.470 85.364 C 239.176 86.740,238.522 88.365,237.991 91.521 C 237.631 93.665,236.114 97.200,235.554 97.200 C 234.938 97.200,232.737 102.354,232.450 104.472 C 232.158 106.625,230.879 109.226,229.535 110.400 C 228.933 110.926,228.171 113.162,226.434 119.500 C 226.178 120.435,225.795 121.200,225.584 121.200 C 225.373 121.200,225.200 121.476,225.200 121.813 C 225.200 122.149,224.885 122.541,224.500 122.683 C 223.606 123.013,223.214 123.593,223.204 124.600 C 223.183 126.555,220.763 132.911,219.410 134.562 C 218.443 135.742,217.876 136.956,217.599 138.440 C 217.041 141.424,215.177 146.434,214.532 146.681 C 214.240 146.794,214.000 147.055,214.000 147.261 C 214.000 147.467,213.550 148.086,213.000 148.636 C 212.450 149.186,212.000 149.893,212.000 150.208 C 212.000 151.386,208.441 154.450,207.597 153.998 C 206.319 153.315,204.913 150.379,204.633 147.811 C 204.365 145.357,202.848 142.147,201.759 141.729 C 200.967 141.425,199.200 137.451,199.200 135.974 C 199.200 134.629,198.435 133.224,196.660 131.311 C 195.363 129.913,194.572 128.123,193.870 125.000 C 193.623 123.900,193.236 122.793,193.010 122.540 C 190.863 120.133,190.147 118.880,188.978 115.481 C 188.100 112.928,187.151 111.003,186.254 109.955 C 185.358 108.908,184.518 107.204,183.847 105.073 C 183.280 103.273,182.497 101.329,182.108 100.753 C 181.719 100.177,180.904 98.997,180.298 98.131 C 179.693 97.265,178.939 95.576,178.624 94.378 C 178.041 92.159,177.125 90.326,175.023 87.168 C 174.375 86.196,173.619 84.539,173.342 83.486 C 172.800 81.429,171.529 79.567,170.131 78.785 C 169.654 78.517,168.697 77.511,168.006 76.549 C 167.316 75.587,166.594 74.800,166.402 74.800 C 166.210 74.800,164.869 73.633,163.421 72.206 C 160.103 68.936,161.107 69.109,146.550 69.301 C 133.437 69.474,128.581 70.162,126.618 72.124 C 126.248 72.495,125.462 72.904,124.872 73.033 C 124.282 73.163,123.088 73.536,122.219 73.863 C 121.349 74.191,119.028 74.638,117.061 74.858 C 113.514 75.254,109.970 76.350,108.782 77.419 C 107.652 78.436,100.146 80.400,97.388 80.400 C 95.775 80.400,93.167 81.360,91.200 82.679 C 90.430 83.195,89.113 83.804,88.274 84.031 C 85.875 84.681,78.799 90.910,74.400 96.243 L 73.400 97.456 73.455 106.028 C 73.526 117.055,74.527 121.238,77.820 124.263 C 78.919 125.273,80.400 127.902,80.400 128.842 C 80.400 129.202,81.075 130.256,81.900 131.186 C 83.563 133.059,85.497 136.346,86.039 138.216 C 86.233 138.886,87.203 140.207,88.196 141.153 C 89.188 142.098,90.000 143.104,90.000 143.388 C 90.000 144.337,92.129 148.594,92.869 149.123 C 93.271 149.410,93.600 149.831,93.600 150.059 C 93.600 150.286,93.932 150.771,94.337 151.136 C 94.743 151.501,95.598 153.004,96.237 154.475 C 96.877 155.947,97.760 157.351,98.200 157.596 C 98.640 157.841,99.900 159.943,101.000 162.267 C 102.207 164.817,103.327 166.644,103.825 166.876 C 104.278 167.087,105.065 168.101,105.573 169.130 C 107.658 173.348,108.097 174.093,110.006 176.647 C 111.103 178.114,112.000 179.725,112.000 180.227 C 112.000 181.048,113.425 183.163,114.678 184.200 C 115.295 184.711,117.396 188.733,117.720 190.022 C 117.855 190.562,118.603 191.633,119.381 192.402 C 120.160 193.171,121.496 195.258,122.351 197.039 C 123.206 198.820,124.167 200.378,124.487 200.501 C 124.807 200.624,125.953 202.496,127.034 204.662 C 128.114 206.828,129.676 209.299,130.505 210.153 C 131.333 211.007,132.124 212.177,132.262 212.753 C 132.618 214.239,134.291 217.048,136.288 219.5
" href="/">YannStatic</a></div><!--<button class="button button--secondary button--circle search-button js-search-toggle"><i class="fas fa-search"></i></button>--><!-- <li><button class="button button--secondary button--circle search-button js-search-toggle"><i class="fas fa-search"></i></button></li> -->
<!-- Champ de recherche -->
<div id="searchbox" class="search search--dark" style="visibility: visible">
<div class="main">
<div class="search__header"></div>
<div class="search-bar">
<div class="search-box js-search-box">
<div class="search-box__icon-search"><i class="fas fa-search"></i></div>
<input id="search-input" type="text" />
<!-- <div class="search-box__icon-clear js-icon-clear">
<a><i class="fas fa-times"></i></a>
</div> -->
</div>
</div>
</div>
</div>
<!-- Script pointing to search-script.js -->
<script>/*!
* Simple-Jekyll-Search
* Copyright 2015-2020, Christian Fei
* Licensed under the MIT License.
*/
(function(){
'use strict'
var _$Templater_7 = {
compile: compile,
setOptions: setOptions
}
const options = {}
options.pattern = /\{(.*?)\}/g
options.template = ''
options.middleware = function () {}
function setOptions (_options) {
options.pattern = _options.pattern || options.pattern
options.template = _options.template || options.template
if (typeof _options.middleware === 'function') {
options.middleware = _options.middleware
}
}
function compile (data) {
return options.template.replace(options.pattern, function (match, prop) {
const value = options.middleware(prop, data[prop], options.template)
if (typeof value !== 'undefined') {
return value
}
return data[prop] || match
})
}
'use strict';
function fuzzysearch (needle, haystack) {
var tlen = haystack.length;
var qlen = needle.length;
if (qlen > tlen) {
return false;
}
if (qlen === tlen) {
return needle === haystack;
}
outer: for (var i = 0, j = 0; i < qlen; i++) {
var nch = needle.charCodeAt(i);
while (j < tlen) {
if (haystack.charCodeAt(j++) === nch) {
continue outer;
}
}
return false;
}
return true;
}
var _$fuzzysearch_1 = fuzzysearch;
'use strict'
/* removed: const _$fuzzysearch_1 = require('fuzzysearch') */;
var _$FuzzySearchStrategy_5 = new FuzzySearchStrategy()
function FuzzySearchStrategy () {
this.matches = function (string, crit) {
return _$fuzzysearch_1(crit.toLowerCase(), string.toLowerCase())
}
}
'use strict'
var _$LiteralSearchStrategy_6 = new LiteralSearchStrategy()
function LiteralSearchStrategy () {
this.matches = function (str, crit) {
if (!str) return false
str = str.trim().toLowerCase()
crit = crit.trim().toLowerCase()
return crit.split(' ').filter(function (word) {
return str.indexOf(word) >= 0
}).length === crit.split(' ').length
}
}
'use strict'
var _$Repository_4 = {
put: put,
clear: clear,
search: search,
setOptions: __setOptions_4
}
/* removed: const _$FuzzySearchStrategy_5 = require('./SearchStrategies/FuzzySearchStrategy') */;
/* removed: const _$LiteralSearchStrategy_6 = require('./SearchStrategies/LiteralSearchStrategy') */;
function NoSort () {
return 0
}
const data = []
let opt = {}
opt.fuzzy = false
opt.limit = 10
opt.searchStrategy = opt.fuzzy ? _$FuzzySearchStrategy_5 : _$LiteralSearchStrategy_6
opt.sort = NoSort
opt.exclude = []
function put (data) {
if (isObject(data)) {
return addObject(data)
}
if (isArray(data)) {
return addArray(data)
}
return undefined
}
function clear () {
data.length = 0
return data
}
function isObject (obj) {
return Boolean(obj) && Object.prototype.toString.call(obj) === '[object Object]'
}
function isArray (obj) {
return Boolean(obj) && Object.prototype.toString.call(obj) === '[object Array]'
}
function addObject (_data) {
data.push(_data)
return data
}
function addArray (_data) {
const added = []
clear()
for (let i = 0, len = _data.length; i < len; i++) {
if (isObject(_data[i])) {
added.push(addObject(_data[i]))
}
}
return added
}
function search (crit) {
if (!crit) {
return []
}
return findMatches(data, crit, opt.searchStrategy, opt).sort(opt.sort)
}
function __setOptions_4 (_opt) {
opt = _opt || {}
opt.fuzzy = _opt.fuzzy || false
opt.limit = _opt.limit || 10
opt.searchStrategy = _opt.fuzzy ? _$FuzzySearchStrategy_5 : _$LiteralSearchStrategy_6
opt.sort = _opt.sort || NoSort
opt.exclude = _opt.exclude || []
}
function findMatches (data, crit, strategy, opt) {
const matches = []
for (let i = 0; i < data.length && matches.length < opt.limit; i++) {
const match = findMatchesInObject(data[i], crit, strategy, opt)
if (match) {
matches.push(match)
}
}
return matches
}
function findMatchesInObject (obj, crit, strategy, opt) {
for (const key in obj) {
if (!isExcluded(obj[key], opt.exclude) && strategy.matches(obj[key], crit)) {
return obj
}
}
}
function isExcluded (term, excludedTerms) {
for (let i = 0, len = excludedTerms.length; i < len; i++) {
const excludedTerm = excludedTerms[i]
if (new RegExp(excludedTerm).test(term)) {
return true
}
}
return false
}
/* globals ActiveXObject:false */
'use strict'
var _$JSONLoader_2 = {
load: load
}
function load (location, callback) {
const xhr = getXHR()
xhr.open('GET', location, true)
xhr.onreadystatechange = createStateChangeListener(xhr, callback)
xhr.send()
}
function createStateChangeListener (xhr, callback) {
return function () {
if (xhr.readyState === 4 && xhr.status === 200) {
try {
callback(null, JSON.parse(xhr.responseText))
} catch (err) {
callback(err, null)
}
}
}
}
function getXHR () {
return window.XMLHttpRequest ? new window.XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP')
}
'use strict'
var _$OptionsValidator_3 = function OptionsValidator (params) {
if (!validateParams(params)) {
throw new Error('-- OptionsValidator: required options missing')
}
if (!(this instanceof OptionsValidator)) {
return new OptionsValidator(params)
}
const requiredOptions = params.required
this.getRequiredOptions = function () {
return requiredOptions
}
this.validate = function (parameters) {
const errors = []
requiredOptions.forEach(function (requiredOptionName) {
if (typeof parameters[requiredOptionName] === 'undefined') {
errors.push(requiredOptionName)
}
})
return errors
}
function validateParams (params) {
if (!params) {
return false
}
return typeof params.required !== 'undefined' && params.required instanceof Array
}
}
'use strict'
var _$utils_9 = {
merge: merge,
isJSON: isJSON
}
function merge (defaultParams, mergeParams) {
const mergedOptions = {}
for (const option in defaultParams) {
mergedOptions[option] = defaultParams[option]
if (typeof mergeParams[option] !== 'undefined') {
mergedOptions[option] = mergeParams[option]
}
}
return mergedOptions
}
function isJSON (json) {
try {
if (json instanceof Object && JSON.parse(JSON.stringify(json))) {
return true
}
return false
} catch (err) {
return false
}
}
var _$src_8 = {};
(function (window) {
'use strict'
let options = {
searchInput: null,
resultsContainer: null,
json: [],
success: Function.prototype,
searchResultTemplate: '<li><a href="{url}" title="{desc}">{title}</a></li>',
templateMiddleware: Function.prototype,
sortMiddleware: function () {
return 0
},
noResultsText: 'No results found',
limit: 10,
fuzzy: false,
debounceTime: null,
exclude: []
}
let debounceTimerHandle
const debounce = function (func, delayMillis) {
if (delayMillis) {
clearTimeout(debounceTimerHandle)
debounceTimerHandle = setTimeout(func, delayMillis)
} else {
func.call()
}
}
const requiredOptions = ['searchInput', 'resultsContainer', 'json']
/* removed: const _$Templater_7 = require('./Templater') */;
/* removed: const _$Repository_4 = require('./Repository') */;
/* removed: const _$JSONLoader_2 = require('./JSONLoader') */;
const optionsValidator = _$OptionsValidator_3({
required: requiredOptions
})
/* removed: const _$utils_9 = require('./utils') */;
window.SimpleJekyllSearch = function (_options) {
const errors = optionsValidator.validate(_options)
if (errors.length > 0) {
throwError('You must specify the following required options: ' + requiredOptions)
}
options = _$utils_9.merge(options, _options)
_$Templater_7.setOptions({
template: options.searchResultTemplate,
middleware: options.templateMiddleware
})
_$Repository_4.setOptions({
fuzzy: options.fuzzy,
limit: options.limit,
sort: options.sortMiddleware,
exclude: options.exclude
})
if (_$utils_9.isJSON(options.json)) {
initWithJSON(options.json)
} else {
initWithURL(options.json)
}
const rv = {
search: search
}
typeof options.success === 'function' && options.success.call(rv)
return rv
}
function initWithJSON (json) {
_$Repository_4.put(json)
registerInput()
}
function initWithURL (url) {
_$JSONLoader_2.load(url, function (err, json) {
if (err) {
throwError('failed to get JSON (' + url + ')')
}
initWithJSON(json)
})
}
function emptyResultsContainer () {
options.resultsContainer.innerHTML = ''
}
function appendToResultsContainer (text) {
options.resultsContainer.innerHTML += text
}
function registerInput () {
options.searchInput.addEventListener('input', function (e) {
if (isWhitelistedKey(e.which)) {
emptyResultsContainer()
debounce(function () { search(e.target.value) }, options.debounceTime)
}
})
}
function search (query) {
if (isValidQuery(query)) {
emptyResultsContainer()
render(_$Repository_4.search(query), query)
}
}
function render (results, query) {
const len = results.length
if (len === 0) {
return appendToResultsContainer(options.noResultsText)
}
for (let i = 0; i < len; i++) {
results[i].query = query
appendToResultsContainer(_$Templater_7.compile(results[i]))
}
}
function isValidQuery (query) {
return query && query.length > 0
}
function isWhitelistedKey (key) {
return [13, 16, 20, 37, 38, 39, 40, 91].indexOf(key) === -1
}
function throwError (message) {
throw new Error('SimpleJekyllSearch --- ' + message)
}
})(window)
}());
</script>
<!-- Configuration -->
<script>
SimpleJekyllSearch({
searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('results-container'),
json: '/search.json',
//searchResultTemplate: '<li><a href="https://static.rnmkcy.eu{url}">{date}&nbsp;{title}</a></li>'
searchResultTemplate: '<li><a href="{url}">{date}&nbsp;{title}</a></li>'
})
</script>
<!-- Fin déclaration champ de recherche --></div><nav class="navigation">
<ul><li class="navigation__item"><a href="/archive.html">Etiquettes</a></li><li class="navigation__item"><a href="/htmldoc.html">Documents</a></li><li class="navigation__item"><a href="/liens_ttrss.html">Liens</a></li><li class="navigation__item"><a href="/aide-jekyll-text-theme.html">Aide</a></li></ul>
</nav></div>
</header>
</div><div class="page__content"><div class ="main"><div class="grid grid--reverse">
<div class="col-main cell cell--auto"><!-- start custom main top snippet --><div id="results-container" class="search-result js-search-result"></div><!-- end custom main top snippet -->
<article itemscope itemtype="http://schema.org/Article"><div class="article__header"><header><h1 style="color:Tomato;">Serveur srvxo Debian10 Yunohost xoyize.xyz</h1></header></div><meta itemprop="headline" content="Serveur srvxo Debian10 Yunohost xoyize.xyz"><div class="article__info clearfix"><ul class="left-col menu"><li>
<a class="button button--secondary button--pill button--sm"
href="/archive.html?tag=yunohost">yunohost</a>
</li></ul><ul class="right-col menu"><li>
<i class="far fa-calendar-alt"></i>&nbsp;<span title="Création" style="color:#FF00FF">&nbsp;6&nbsp;août&nbsp;&nbsp;2020</span></li></ul></div><meta itemprop="datePublished" content="2020-08-06T00:00:00+02:00">
<meta itemprop="keywords" content="yunohost"><div class="js-article-content">
<div class="layout--article"><!-- start custom article top snippet -->
<style>
#myBtn {
display: none;
position: fixed;
bottom: 10px;
right: 10px;
z-index: 99;
font-size: 12px;
font-weight: bold;
border: none;
outline: none;
background-color: white;
color: black;
cursor: pointer;
padding: 5px;
border-radius: 4px;
}
#myBtn:hover {
background-color: #555;
}
</style>
<button onclick="topFunction()" id="myBtn" title="Haut de page">&#8679;</button>
<script>
//Get the button
var mybutton = document.getElementById("myBtn");
// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
mybutton.style.display = "block";
} else {
mybutton.style.display = "none";
}
}
// When the user clicks on the button, scroll to the top of the document
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
</script>
<!-- end custom article top snippet -->
<div class="article__content" itemprop="articleBody"><details>
<summary><b>Afficher/cacher Sommaire</b></summary>
<!-- affichage sommaire -->
<div class="toc-aside js-toc-root"></div>
</details><p><img src="/images/yunohost.png" alt="" title="ASRock QC5000M" width="60" /></p>
<h1 id="asrock-qc5000m-quad-core-apu">ASRock QC5000M Quad-Core APU</h1>
<p><a href="https://static.rnmkcy.eu/files/QC5000M.pdf">ASRock QC5000M (pdf)</a></p>
<p><img src="/images/asrock-qc500m.png" alt="ASRock QC5000M" title="ASRock QC5000M" width="60" /></p>
<ul>
<li>Platform
<ul>
<li>Micro ATX Form Factor</li>
<li>Solid Capacitor design</li>
<li>High Density Glass Fabric PCB</li>
</ul>
</li>
<li>CPU
<ul>
<li>AMD FT3 Kabini A4-5050/5000 Quad-Core APU</li>
</ul>
</li>
<li>Memory
<ul>
<li>2 x DDR3 DIMM Slots</li>
<li>Supports DDR3 1600/1333/1066 non-ECC, un-buffered memory</li>
<li>Max. capacity of system memory: 32GB (see CAUTION1)</li>
</ul>
</li>
<li>Expansion Slot
<ul>
<li>1 x PCI Express 2.0 x16 Slot (PCIE2: x4 mode)</li>
<li>2 x PCI Express 2.0 x1 Slot</li>
</ul>
</li>
<li>Graphics
<ul>
<li>Integrated AMD RadeonTM HD 8330 Graphics</li>
<li>DirectX 11.1, Pixel Shader 5.0</li>
<li>Max. shared memory 2GB</li>
<li>Dual graphics output: support D-Sub and HDMI ports by independent display controllers (see CAUTION2)</li>
<li>Supports HDMI with max. resolution up to 4K × 2K (4096x2160) @ 24Hz or 4K × 2K (3840x2160) @ 30Hz</li>
<li>Supports D-Sub with max. resolution up to 2048x1536 @ 60Hz</li>
<li>Supports Auto Lip Sync, Deep Color (12bpc), xvYCC and HBR (High Bit Rate Audio) with HDMI Port (Compliant HDMI monitor is required)</li>
<li>Supports HDCP with HDMI Port</li>
<li>Supports Full HD 1080p Blu-ray (BD) playback with HDMI Port</li>
</ul>
</li>
<li>Audio
<ul>
<li>7.1 CH HD Audio (Realtek ALC887 Audio Codec) * To configure 7.1 CH HD Audio, it is required to use an HD front panel audio module and enable the multi-channel audio feature through the audio driver.</li>
<li>Supports Surge Protection (ASRock Full Spike Protection)</li>
<li>ELNA Audio Caps</li>
</ul>
</li>
<li>LAN
<ul>
<li>PCIE x1 Gigabit LAN 10/100/1000 Mb/s</li>
<li>Rea ltek RTL 8111GR</li>
<li>S u p p o r t s Wa k e - O n -WA N</li>
<li>Suppor t s Wa ke- On-L A N</li>
<li>Supports Lightning/ESD Protection (ASRock Full Spike Protection)</li>
<li>Supports LAN Cable Detection</li>
<li>Supports Energy Efficient Ethernet 802.3az</li>
<li>Supports PXE</li>
</ul>
</li>
<li>Rear Panel I/O
<ul>
<li>1 x PS/2 Mouse/Keyboard Port</li>
<li>1 x Serial Port: COM1</li>
<li>1 x D-Sub Port</li>
<li>1 x HDMI Port</li>
<li>4 x USB 2.0 Ports (Supports ESD Protection (ASRock Full Spike Protection))</li>
<li>2 x USB 3.0 Ports (Supports ESD Protection (ASRock Full Spike Protection))</li>
<li>1 x RJ-45 LAN Port with LED (ACT/LINK LED and SPEED LED)</li>
<li>HD Audio Jacks: Line in / Front Speaker / Microphone</li>
</ul>
</li>
<li>Storage
<ul>
<li>2 x SATA3 6.0 Gb/s Connectors, support NCQ, AHCI and Hot Plug</li>
</ul>
</li>
<li>Connector
<ul>
<li>1 x TPM Header</li>
<li>1 x CPU Fan Connector (3-pin)</li>
<li>2 x Chassis Fan Connectors (1 x 4-pin, 1 x 3-pin)</li>
<li>1 x 24 pin ATX Power Connector</li>
<li>1 x Front Panel Audio Connector</li>
<li>2 x USB 2.0 Headers (Support 4 USB 2.0 ports) (Supports ESD Protection (ASRock Full Spike Protection))</li>
</ul>
</li>
<li>BIOS Feature
<ul>
<li>32Mb AMI UEFI Legal BIOS with multilingual GUI support</li>
<li>Supports “Plug and Play”</li>
<li>ACPI 1.1 compliance wake up events</li>
<li>SMBIOS 2.3.1 support</li>
<li>DRAM Voltage multi-adjustment</li>
</ul>
</li>
<li>HardwareMonitor
<ul>
<li>CPU/Chassis temperature sensing</li>
<li>CPU/Chassis Fan Tachometer</li>
<li>CPU/Chassis Quiet Fan</li>
<li>CPU/Chassis Fan multi-speed control</li>
<li>Voltage monitoring: +12V, +5V, +3.3V, Vcore</li>
</ul>
</li>
<li>OS
<ul>
<li>Microsoft® Windows® 10 64-bit / 8.1 32-bit / 8.1 64-bit / 8 32-bit / 8 64-bit / 7 32-bit / 7 64-bit / XP 32-bit / XP 64-bit*</li>
<li>USB 3.0 is not supported by Windows® XP* For the updated Windows® 10 driver, please visit ASRocks website for details: http://www.asrock.com</li>
</ul>
</li>
<li>Certifica-tions
<ul>
<li>FCC, CE, WHQL</li>
<li>ErP/EuP ready (ErP/EuP ready power supply is required)</li>
</ul>
</li>
</ul>
<h2 id="pre-installation">PRE-INSTALLATION</h2>
<p>Structure actuelle</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.3
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
------------------------------------------------------------------------
fdisk /dev/sda
Bienvenue dans fdisk (util-linux 2.33.1).
Les modifications resteront en mémoire jusqu'à écriture.
Soyez prudent avant d'utiliser la commande d'écriture.
Commande (m pour l'aide) : p
Disque /dev/sda : 111,8 GiB, 120034123776 octets, 234441648 secteurs
Modèle de disque : SSD2SC120G3SA754
Unités : secteur de 1 × 512 = 512 octets
Taille de secteur (logique / physique) : 512 octets / 512 octets
taille d'E/S (minimale / optimale) : 512 octets / 512 octets
Type d'étiquette de disque : gpt
Identifiant de disque : E404411D-4E3E-4957-A853-D095508F4024
Périphérique Début Fin Secteurs Taille Type
/dev/sda1 2048 6143 4096 2M Amorçage BIOS
/dev/sda2 6144 1054719 1048576 512M Système de fichiers Linux
/dev/sda3 1054720 9443327 8388608 4G Partition d'échange Linux
/dev/sda4 9443328 234441614 224998287 107,3G LVM Linux
------------------------------------------------------------------------
pvs
PV VG Fmt Attr PSize PFree
/dev/sda4 ssd-vg lvm2 a-- &lt;107,29g 0
/dev/sdb1 hdd-2g lvm2 a-- &lt;1,82t 0
vgs
VG #PV #LV #SN Attr VSize VFree
hdd-2g 1 1 0 wz--n- &lt;1,82t 0
ssd-vg 1 2 0 wz--n- &lt;107,29g 0
lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lvhdd hdd-2g -wi-ao---- &lt;1,82t
roota ssd-vg -wi-a----- &lt;57,29g
rootb ssd-vg -wi-ao---- 50,00g
</code></pre></div></div>
<h3 id="installation-debian-10">Installation debian 10</h3>
<ul>
<li>Installation effectuée à partir dune clé USB bootable Debian</li>
<li>Choix “partitionnement manuel”
<ul>
<li>/dev/sda2 → /boot</li>
<li>/dev/sda3 → swap</li>
<li>/dev/ssd-vg/roota → / (Racine LVM)</li>
</ul>
</li>
</ul>
<p><img src="/images/debian-buster-logo.png" alt="Debian 10" width="100" /></p>
<ul>
<li>Système : <strong>Debian Buster</strong></li>
<li>machine : <strong>srvxo</strong></li>
<li>domaine :</li>
<li>root : <strong>ytreu49</strong></li>
<li>Utilisateur : <strong>xoyi</strong></li>
<li>Mot de passe : <strong>xoyi49</strong></li>
<li>Adresse IP : <strong>192.168.0.45</strong></li>
<li>Accès
<ul>
<li>SSH : <strong>ssh bust@192.168.0.45</strong></li>
<li>
<s>SSH + clé : **ssh -i ~/.ssh/vbox-vmbust-ed25519 bust@192.168.0.49** (facultatif)</s>
</li>
<li>
<s>Transfert de fichier : **scp -P 55022 -i ~/.ssh/vbox-vmbust-ed25519 fichiera fichierb bust@192.168.0.49:/home/bust** (facultatif)</s>
</li>
</ul>
</li>
</ul>
<p>Partitionnement<br />
Disque SCSI1(0,0,0)(sda) 120.0 GB</p>
<table>
<thead>
<tr>
<th>Partition</th>
<th>Taille</th>
<th>_</th>
<th>Type</th>
<th>Commentaire</th>
<th>_</th>
</tr>
</thead>
<tbody>
<tr>
<td>n°1</td>
<td>2.1 MB</td>
<td>K</td>
<td>biosgrub Bios</td>
<td>boot pa</td>
<td> </td>
</tr>
<tr>
<td>n°2</td>
<td>536.9 MB</td>
<td> </td>
<td>ext2</td>
<td>Linux filesys</td>
<td>/boot</td>
</tr>
<tr>
<td>n°3</td>
<td>4.3 GB</td>
<td>F</td>
<td>swap</td>
<td>Linux swap</td>
<td>swap</td>
</tr>
<tr>
<td>n°4</td>
<td>63.7 GB</td>
<td>K</td>
<td>lvm</td>
<td>Linux lvm</td>
<td> </td>
</tr>
</tbody>
</table>
<p>Groupe de volumes LVM <strong>ssd-vg</strong></p>
<table>
<thead>
<tr>
<th>Partition</th>
<th>Taille</th>
<th>_</th>
<th>Type</th>
<th>Commentaire</th>
<th>_</th>
</tr>
</thead>
<tbody>
<tr>
<td>n°1</td>
<td>63.7 GB</td>
<td>F</td>
<td>ext4</td>
<td>roota</td>
<td>/</td>
</tr>
</tbody>
</table>
<p>Sélection des logiciels</p>
<ul>
<li>serveur SSH</li>
<li>utilitaires usuels du système</li>
<li>Grub sur /dev/sda</li>
<li>Horloge heure universelle</li>
</ul>
<p>Oter la clé après installation</p>
<h3 id="connexion-ssh">Connexion SSH</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh xoyi@192.168.0.45
</code></pre></div></div>
<p>Passer en root</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>su
</code></pre></div></div>
<p>Installer sudo</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>apt install sudo
</code></pre></div></div>
<p>Visudo pour les accès root via utilisateur bust</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>echo "xoyi ALL=(ALL) NOPASSWD: ALL" &gt;&gt; /etc/sudoers
</code></pre></div></div>
<h3 id="freebox-dmz-next-hop-et-reverse-dns">Freebox DMZ, Next Hop et Reverse DNS</h3>
<p>Activer la dmz sur la “freebox” pour rediriger tout le traffic entrant sur ladresse ip 192.168.0.45</p>
<p><img src="/images/dmz-free.png" alt="" width="400" /></p>
<p>Next Hop<br />
<img src="/images/nexthop-xoyize.png" alt="" /></p>
<p>Reverse DNS : xoyize.xyz</p>
<h3 id="adressage-ipv6">Adressage ipv6</h3>
<p><img src="/images/ipv6.png" alt="ipv6" width="70" /></p>
<p>Adresse IP : 192.168.0.45<br />
Mac Adress : 70:85:c2:53:cb:80</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ip addr
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp3s0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 70:85:c2:53:cb:80 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.45/24 brd 192.168.0.255 scope global dynamic enp3s0
valid_lft 41814sec preferred_lft 41814sec
inet6 2a01:e34:eebf:df0:7285:c2ff:fe53:cb80/64 scope global dynamic mngtmpaddr
valid_lft 86318sec preferred_lft 86318sec
inet6 fe80::7285:c2ff:fe53:cb80/64 scope link
valid_lft forever preferred_lft forever
</code></pre></div></div>
<p>La carte nest joignable de linternet que par son adresse IPV6<br />
NextHop Freebox permet dattribuer une adresse IPV6</p>
<p>Prefixe : <strong>2a01:e34:eebf:df5:://64</strong><br />
Next Hop: <strong>fe80::7285:c2ff:fe53:cb80</strong><br />
Passerelle IPV6 Box : <strong>fe80::224:d4ff:fea6:aa20</strong></p>
<p>Modifier interface réseau debian</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano /etc/network/interfaces
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp3s0
iface enp3s0 inet static
address 192.168.0.45
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.254
# This is an autoconfigured IPv6 interface
#iface enp3s0 inet6 auto
iface enp3s0 inet6 static
address 2a01:e34:eebf:df3::1
netmask 64
gateway fe80::224:d4ff:fea6:aa20
</code></pre></div></div>
<p>Redémarrer la machine</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl reboot
</code></pre></div></div>
<p>Après reboot, connexion SSH<br />
Vérifier adresses IP V4 et V6</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ip addr
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp3s0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 70:85:c2:53:cb:80 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.45/24 brd 192.168.0.255 scope global enp3s0
valid_lft forever preferred_lft forever
inet6 2a01:e34:eebf:df3::1/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::7285:c2ff:fe53:cb80/64 scope link
valid_lft forever preferred_lft forever
</code></pre></div></div>
<p>Vérifier avec un autre poste sur le même réseau local</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ping -6 -c5 2a01:e34:eebf:df3::1
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>PING 2a01:e34:eebf:df3::1(2a01:e34:eebf:df3::1) 56 data bytes
64 bytes from 2a01:e34:eebf:df3::1: icmp_seq=1 ttl=53 time=45.6 ms
64 bytes from 2a01:e34:eebf:df3::1: icmp_seq=2 ttl=53 time=44.7 ms
64 bytes from 2a01:e34:eebf:df3::1: icmp_seq=3 ttl=53 time=45.9 ms
64 bytes from 2a01:e34:eebf:df3::1: icmp_seq=4 ttl=53 time=45.6 ms
64 bytes from 2a01:e34:eebf:df3::1: icmp_seq=5 ttl=53 time=45.4 ms
</code></pre></div></div>
<h3 id="historique-de-la-ligne-de-commande">Historique de la ligne de commande</h3>
<p>Ajoutez la recherche dhistorique de la ligne de commande au terminal.
Tapez un début de commande précédent, puis utilisez shift + up (flèche haut) pour rechercher lhistorique filtré avec le début de la commande.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Global, tout utilisateur
echo '"\e[1;2A": history-search-backward' | sudo tee -a /etc/inputrc
echo '"\e[1;2B": history-search-forward' | sudo tee -a /etc/inputrc
exit
</code></pre></div></div>
<h2 id="yunohost">Yunohost</h2>
<p>Installation</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wget https://install.yunohost.org/buster -O install_script
chmod +x install_script
sudo -s
./install_script -d testing # phase de test
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[ OK ] YunoHost installation completed !
===============================================================================
You should now proceed with Yunohost post-installation. This is where you will
be asked for :
- the main domain of your server ;
- the administration password.
You can perform this step :
- from the command line, by running 'yunohost tools postinstall' as root
- or from your web browser, by accessing :
- https://192.168.0.45/ (local IP, if self-hosting at home)
- https://78.235.240.223/ (global IP, if you're on a VPS)
If this is your first time with YunoHost, it is strongly recommended to take
time to read the administator documentation and in particular the sections
'Finalizing your setup' and 'Getting to know YunoHost'. It is available at
the following URL : https://yunohost.org/admindoc
===============================================================================
</code></pre></div></div>
<h3 id="post-installation">Post-installation</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yunohost tools postinstall
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Attention : La configuration de ssh a été modifiée manuellement. Vous devez explicitement indiquer la mention --force à "ssh" pour appliquer les changements.
Succès ! YunoHost est maintenant configuré
Attention : La post-installation terminée! Pour finaliser votre configuration, il est recommandé de :
- ajouter un premier utilisateur depuis la section "Utilisateurs" de linterface web (ou "yunohost user create &lt;nom dutilisateur&gt;" en ligne de commande) ;
- diagnostiquer les potentiels problèmes dans la section "Diagnostic" de l'interface web (ou "yunohost diagnosis run" en ligne de commande) ;
- lire les parties "Finalisation de votre configuration" et "Découverte de YunoHost" dans le guide de ladministrateur: https://yunohost.org/admindoc.
</code></pre></div></div>
<blockquote>
<p>Le mot de passe root remplacé par celui de ladmin yunohost</p>
</blockquote>
<h3 id="créer-un-utilisateur-yunohost">Créer un utilisateur (yunohost)</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yunohost user create yak
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Prénom : yak
Nom : xoyi
Adresse de courriel : yak@xoyize.xyz
Vous êtes maintenant sur le point de définir un nouveau mot de passe utilisateur. Le mot de passe doit comporter au moins 8 caractères, bien qu'il soit recommandé d'utiliser un mot de passe plus long (c'est-à-dire une phrase secrète) et / ou une variation de caractères (majuscule, minuscule, chiffres et caractères spéciaux).
Mot de passe :
Confirmez : mot de passe :
Succès ! Lutilisateur créé
fullname: yak xoyi
mail: yak@xoyize.xyz
username: yak
</code></pre></div></div>
<h3 id="configuration-dns">Configuration DNS</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yunohost domain dns-conf xoyize.xyz
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Info : Cette page montre la configuration *recommandée*. Elle ne configure *pas* le DNS pour vous. Il est de votre responsabilité que de configurer votre zone DNS chez votre fournisseur/registrar DNS avec cette recommandation.
; Basic ipv4/ipv6 records
@ 3600 IN A 78.235.240.223
@ 3600 IN AAAA 2a01:e34:eebf:df3::1
; XMPP
_xmpp-client._tcp 3600 IN SRV 0 5 5222 xoyize.xyz.
_xmpp-server._tcp 3600 IN SRV 0 5 5269 xoyize.xyz.
muc 3600 IN CNAME @
pubsub 3600 IN CNAME @
vjud 3600 IN CNAME @
xmpp-upload 3600 IN CNAME @
; Mail
@ 3600 IN MX 10 xoyize.xyz.
@ 3600 IN TXT "v=spf1 a mx -all"
mail._domainkey 3600 IN TXT "v=DKIM1; h=sha256; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDz4siOQ6M1yPrUWfObGFG7WAvSAEXoxqzZU1JwmjTLJtvz3tRFhdAIYSFvUCnDI2ir3/CSLcYdMx3huNp816g8P3TuQYiukhAsPm6Ib6C1L+poCaYW8KqwM0bW3tiKFVcP5Db0j9V4BecKeayrWT3GJ2lIwwvysJz0nRU6a0ADYwIDAQAB"
_dmarc 3600 IN TXT "v=DMARC1; p=none"
; Extra
* 3600 IN A 78.235.240.223
* 3600 IN AAAA 2a01:e34:eebf:df3::1
@ 3600 IN CAA 128 issue "letsencrypt.org"
</code></pre></div></div>
<h3 id="dns-ovh">DNS OVH</h3>
<p><img src="/images/dns-logo.png" alt="dns" width="50" /> <img src="/images/OVH-320px-Logo.png" alt="OVH" width="50" /></p>
<p>Modification domaine <strong>xoyize.xyz</strong> pour un accès IPV4/IPV6.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$TTL 3600
@ IN SOA dns106.ovh.net. tech.ovh.net. (2020070403 86400 3600 3600000 300)
IN NS dns106.ovh.net.
IN NS ns106.ovh.net.
IN MX 10 xoyize.xyz.
IN A 78.235.240.223
IN AAAA 2a01:e34:eebf:df3::1
IN CAA 128 issue "letsencrypt.org"
600 IN TXT "v=spf1 a mx -all"
* IN CNAME xoyize.xyz.
_dmarc IN TXT "v=DMARC1; p=none"
mail._domainkey IN TXT ( "v=DKIM1;h=sha256;k=rsa;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDz4siOQ6M1yPrUWfObGFG7WAvSAEXoxqzZU1JwmjTLJtvz3tRFhdAIYSFvUCnDI2ir3/CSLcYdMx3huNp816g8P3TuQYiukhAsPm6Ib6C1L+poCaYW8KqwM0bW3tiKFVcP5Db0j9V4BecKeayrWT3GJ2lIwwvysJz0nRU6a0ADYwIDAQAB;" )
</code></pre></div></div>
<h3 id="certificats-ssl">Certificats SSL</h3>
<p>Installer un certificat Lets Encrypt en ligne de commande</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yunohost domain cert-install # en cas de problème --no-checks
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Info : Now attempting install of certificate for domain xoyize.xyz!
Succès ! La configuration a été mise à jour pour 'dnsmasq'
Info : Parsing account key...
Info : Parsing CSR...
Info : Found domains: xmpp-upload.xoyize.xyz, xoyize.xyz
Info : Getting directory...
Info : Directory found!
Info : Registering account...
Info : Registered!
Info : Creating new order...
Info : Order created!
Info : Verifying xmpp-upload.xoyize.xyz...
Info : xmpp-upload.xoyize.xyz verified!
Info : Verifying xoyize.xyz...
Info : xoyize.xyz verified!
Info : Signing certificate...
Info : Certificate signed!
Succès ! La configuration a été mise à jour pour 'nginx'
Succès ! Le certificat Lets Encrypt est maintenant installé pour le domaine « xoyize.xyz »
</code></pre></div></div>
<h3 id="openssh-clé-et-script">OpenSSH, clé et script</h3>
<p><img src="/images/ssh_logo1.png" alt="OpenSSH" width="100" /></p>
<p><strong>connexion avec clé</strong><br />
<u>sur l'ordinateur de bureau</u>
Générer une paire de clé curve25519-sha256 (ECDH avec Curve25519 et SHA2) nommé <strong>xoyize-ed25519</strong> pour une liaison SSH avec le serveur KVM.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh-keygen -t ed25519 -o -a 100 -f ~/.ssh/xoyize-ed25519
</code></pre></div></div>
<p>Envoyer la clé publique sur le serveur KVM</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>scp ~/.ssh/xoyize-ed25519.pub xoyi@192.168.0.45:/home/xoyi/
</code></pre></div></div>
<p><u>sur le serveur KVM</u>
On se connecte</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh xoyi@192.168.0.45
</code></pre></div></div>
<p>Copier le contenu de la clé publique dans /home/$USER/.ssh/authorized_keys</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cd ~
</code></pre></div></div>
<p>Sur le KVM ,créer un dossier .ssh</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkdir</span> .ssh
<span class="nb">cat</span> <span class="nv">$HOME</span>/xoyize-ed25519.pub <span class="o">&gt;&gt;</span> <span class="nv">$HOME</span>/.ssh/authorized_keys
</code></pre></div></div>
<p>et donner les droits</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>chmod 600 $HOME/.ssh/authorized_keys
</code></pre></div></div>
<p>effacer le fichier de la clé</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>rm $HOME/xoyize-ed25519.pub
</code></pre></div></div>
<p>Modifier la configuration serveur SSH <strong>/etc/ssh/sshd_config</strong></p>
<p>Port = 55035 # changement numéro port , facultatif<br />
PermitRootLogin no # Connexion par root NON autorisée <br />
PasswordAuthentication no # Utilise la clé comme authentification</p>
<p>Exécuter les commande ci-dessous</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo sed -i 's/#Port 22/Port 55035/g' /etc/ssh/sshd_config
sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin no/g' /etc/ssh/sshd_config
sudo sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
</code></pre></div></div>
<p>Relancer openSSH</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl restart sshd
</code></pre></div></div>
<p>Modifier le parefeu, ouvrir le port 55035 et fermer le port 22</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo yunohost firewall allow TCP 55035
sudo yunohost firewall disallow TCP 22
</code></pre></div></div>
<p>Accès depuis le poste distant avec la clé privée</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh -p 55035 -i ~/.ssh/xoyize-ed25519 xoyi@192.168.0.45
</code></pre></div></div>
<h3 id="outils-motd-ssh_rc_bash--journalctl">Outils, motd, ssh_rc_bash , journalctl</h3>
<p><img src="/images/bash-logo.png" alt="" width="100" /></p>
<p>Installer utilitaires</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo apt install tmux figlet tree -y
</code></pre></div></div>
<p>Motd</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo rm /etc/motd &amp;&amp; sudo nano /etc/motd
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> ___ _ _ __ ____ __ ___
(_-&lt;| '_|\ V /\ \ // _ \
/__/|_| \_/ /_\_\\___/
__ __ ___ _ _ (_) ___ ___ __ __ _ _ ___
\ \ // _ \| || || ||_ // -_) _ \ \ /| || ||_ /
/_\_\\___/ \_, ||_|/__|\___|(_)/_\_\ \_, |/__|
|__/ |__/
</code></pre></div></div>
<p>Script ssh_rc_bash</p>
<blockquote>
<p>ATTENTION!!! Les scripts sur connexion peuvent poser des problèmes pour des appels externes autres que ssh</p>
</blockquote>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wget https://yann.cinay.eu/files/ssh_rc_bash
chmod +x ssh_rc_bash # rendre le bash exécutable
./ssh_rc_bash # exécution
</code></pre></div></div>
<p><img src="/images/xoyize-srvxo.png" alt="" /></p>
<p><strong>journalctl</strong> : Ajout utilisateur courant au groupe systemd-journal et adm</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo gpasswd -a $USER systemd-journal
sudo gpasswd -a $USER adm
</code></pre></div></div>
<p>Lignes non tronquées ,ajouter au fichier ~/.bashrc</p>
<p>echo “export SYSTEMD_LESS=FRXMK journalctl” » /home/$USER/.bashrc</p>
<p>Prise en compte après déconnexion/reconnexion</p>
<h3 id="structure-srvxo">Structure srvxo</h3>
<p>Création du point de montage /srv</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo mkdir -p /srv/{data,nfs}
</code></pre></div></div>
<p>Modification <strong>/etc/fstab</strong> pour ajouter le volume “data”</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/dev/mapper/hdd--2g-lvhdd /srv ext4 defaults 0 2
</code></pre></div></div>
<p>montage manuel</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo mount -a
</code></pre></div></div>
<p>Structure<br />
<code class="language-plaintext highlighter-rouge">df -h</code></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Filesystem Size Used Avail Use% Mounted on
udev 3.7G 0 3.7G 0% /dev
tmpfs 741M 8.7M 733M 2% /run
/dev/mapper/ssd--vg-roota 57G 2.1G 52G 4% /
tmpfs 3.7G 72K 3.7G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.7G 0 3.7G 0% /sys/fs/cgroup
/dev/sda2 504M 86M 393M 18% /boot
tmpfs 741M 0 741M 0% /run/user/1000
/dev/mapper/hdd--2g-lvhdd 1.8T 415G 1.3T 24% /srv
</code></pre></div></div>
<h3 id="optimisation-etcfstab">Optimisation /etc/fstab</h3>
<p>Pour tenir compte du disque SSD /dev/sda (<a href="https://www.p3ter.fr/optimiser-son-ssd-sous-linux.html">Optimiser son SSD sous Linux</a>)</p>
<ul>
<li>Loption <strong>noatime</strong>, permet de ne pas écrire sur le disque la date du dernier accès en lecture lorsquil ny a pas décriture. Éditez le fichier /etc/fstab avec les droits root, et ajoutez noatime sur les lignes correspondantes aux partitions ext4 de votre SSD.</li>
<li>Plutôt que décrire sur le SSD les fichiers temporaires, on peut les placer dans la mémoire vive. Attention il faut prévoir au moins 1go de RAM qui sera dédié à /tmp.</li>
</ul>
<p>Le fichier <strong>/etc/fstab</strong> après modification</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># SSD /dev/sda , LVM /dev/mapper/ssd--vg-roota
UUID=dae7c313-6787-4fad-ba68-2d9845951706 / ext4 noatime,errors=remount-ro 0 1
# /boot was on /dev/sda2 during installation
UUID=6ff909c4-5117-4b17-a571-54bde94fd6b5 /boot ext2 defaults 0 2
# swap was on /dev/sda3 during installation
UUID=2bf31f52-1ce1-4f67-bf7b-683263d7cbf6 none swap sw 0 0
# HDD /dev/sdb
/dev/mapper/hdd--2g-lvhdd /srv ext4 defaults 0 2
# Fichiers temporaires en ram
tmpfs /tmp tmpfs defaults,size=1g
</code></pre></div></div>
<h2 id="nfs-serveur">NFS serveur</h2>
<p><img src="/images/nfs-ufw.png" alt="" width="200" /><br />
<em>NFS (pour Network File System, système de fichiers en réseau) est un protocole qui permet à un ordinateur daccéder à des fichiers via un réseau.</em></p>
<h3 id="installation-nfs">Installation NFS</h3>
<p>on passe en mode su</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo -s
</code></pre></div></div>
<p>Installation</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>apt install nfs-kernel-server
</code></pre></div></div>
<p>Vérification serveur</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>rpcinfo -p | grep nfs
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> 100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100003 3 udp 2049 nfs
</code></pre></div></div>
<p>Vérifier que le système supporte effectivement NFS</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cat /proc/filesystems | grep nfs
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nodev nfsd
</code></pre></div></div>
<p>Si la commande précédente ne renvoie rien, il se peut que le module NFS ne soit pas chargé, auquel cas, il faut le charger <code class="language-plaintext highlighter-rouge">modprobe nfs</code><br />
Enfin, vérifions que portmap attend les instructions sur le port 111</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>rpcinfo -p | grep portmap
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> 100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
</code></pre></div></div>
<h3 id="configuration-du-partage">Configuration du partage</h3>
<p>Passage en su</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo -s
</code></pre></div></div>
<p>indiquer au serveur les répertoires qui seront partagés, les machines qui y auront accès et les conditions de ce partage.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano /etc/exports
</code></pre></div></div>
<p>Ajouter en fin de fichier <strong>/etc/exports</strong></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/srv 192.168.0.0/24(rw,sync,no_subtree_check,no_root_squash)
</code></pre></div></div>
<p>Exporter</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>exportfs -ar
</code></pre></div></div>
<h3 id="sécurisation-nfs">Sécurisation NFS</h3>
<p><img src="/images/nfs-new-logo.png" alt="" width="40" /></p>
<p>Passage en su</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo -s
</code></pre></div></div>
<p>Le protocole RPC na pas la réputation dêtre bien sécurisé, mais la version 4 de NFS entend corriger ce problème, elle est donc à privilégier. Il est déconseillé deffectuer un partage NFS via internet, ou bien dans ce cas, opter pour un tunnel crypté.</p>
<ul>
<li>Sassurer que les partages sont réservés à certaines IP dans /etc/exports</li>
<li>Sappuyer sur rpcbind (/etc/hosts.deny et /etc/hosts.allow) pour sécuriser laccès au serveur NFS</li>
<li>Configurer convenablement iptables</li>
</ul>
<p><strong>hosts.deny , hosts.allow</strong><br />
Tout le monde est interdit, puis le LAN est autorisé:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>echo "rpcbind mountd nfsd statd lockd rquotad : ALL" &gt;&gt; /etc/hosts.deny
echo "rpcbind mountd nfsd statd lockd rquotad: 192.168.0." &gt;&gt; /etc/hosts.allow
</code></pre></div></div>
<p><strong>iptables (NFS)</strong><br />
Par défaut, les différents services NFS (lockd, statd, mountd, etc.) demandent des assignations de ports aléatoires à partir du portmapper (portmap/rpcbind), ce qui signifie que la plupart des administrateurs doivent ouvrir une gamme de ports dans leur base de règles de pare-feu pour que NFS fonctionne.</p>
<p>Il va donc falloir fixer les ports de ces services afin de créer les règles iptables.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>echo 'STATDOPTS="--port 32765 --outgoing-port 32766"' &gt;&gt; /etc/default/nfs-common
echo 'RPCMOUNTDOPTS="-p 32767"' &gt;&gt; /etc/default/nfs-kernel-server
echo 'RPCRQUOTADOPTS="-p 32769"' &gt;&gt; /etc/default/quota
</code></pre></div></div>
<p>Relance sysctl</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sysctl --system
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>* Applying /etc/sysctl.d/99-sysctl.conf ...
* Applying /etc/sysctl.d/protect-links.conf ...
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
* Applying /etc/sysctl.conf ...
</code></pre></div></div>
<p>Relancer le service</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl restart nfs-kernel-server
</code></pre></div></div>
<h3 id="nfs---iptables">NFS - iptables</h3>
<p>Ajout des règles firewall en utilisant le “hook” yunohost <code class="language-plaintext highlighter-rouge">post_iptable_rules</code></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo -s
mkdir -p /etc/yunohost/hooks.d/post_iptable_rules
touch /etc/yunohost/hooks.d/post_iptable_rules/95-nfs-iptables
chmod +x /etc/yunohost/hooks.d/post_iptable_rules/95-nfs-iptables
</code></pre></div></div>
<p>Bash pour ajout des régles iptables</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano /etc/yunohost/hooks.d/post_iptable_rules/95-nfs-iptables
</code></pre></div></div>
<p>Voici les règles à fixer dans le parefeu</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>#!/bin/bash
iptables -A INPUT -s 192.168.0.0/24 -p tcp -m multiport --ports 111,2049,32764:32769 -j ACCEPT -m comment --comment "NFS Server"
iptables -A INPUT -s 192.168.0.0/24 -p udp -m multiport --ports 111,2049,32764:32769 -j ACCEPT -m comment --comment "NFS Server"
exit 0
</code></pre></div></div>
<p>Vérifier la création du hook</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yunohost hook list post_iptable_rules
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>hooks: nfs-iptables
</code></pre></div></div>
<p>Exécution manuelle du hook et vérification</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/etc/yunohost/hooks.d/post_iptable_rules/95-nfs-iptables
iptables -L
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>...
ACCEPT tcp -- 192.168.0.0/24 anywhere multiport ports sunrpc,nfs,32764:32769 /* NFS Server */
ACCEPT udp -- 192.168.0.0/24 anywhere multiport ports sunrpc,nfs,32764:32769 /* NFS Server */
...
</code></pre></div></div>
<h3 id="configurer-le-partage-nfs-avec-setgid">Configurer le partage NFS avec SetGID</h3>
<p>Maintenant que le serveur NFS est configuré avec le point de montage NFS de base /srv/nfs, nous devons configurer SetGID dans ce répertoire, comme indiqué ci-dessous.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo chmod 2770 /srv/nfs
</code></pre></div></div>
<p>Cela a également défini les autorisations 770 sur le répertoire, de sorte que lutilisateur racine et le groupe défini disposent dautorisations complètes. Le 2 permet setgid.</p>
<p>Ensuite, nous créons un groupe appelé partage et modifions le répertoire /srv/nfs afin que le propriétaire du groupe soit ce groupe partage.<br />
Nous spécifions également manuellement le GID qui sera utilisé pour le groupe en tant que 9999; il doit sagir dun <u>numéro libre sur votre client et votre serveur</u>.</p>
<p>Exécuter <code class="language-plaintext highlighter-rouge">groupadd</code> sur le client et sur le serveur, et ajouter un utilisateur à ce groupe.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo groupadd -g 9999 partage # sur client et serveur
sudo usermod -a -G partage $USER # sur client et serveur
sudo chgrp partage /srv/nfs # serveur uniquement
</code></pre></div></div>
<blockquote>
<p>NE PAS OUBLIER DE SE DECONNECTER/CONNECTER</p>
</blockquote>
<p>Nous pouvons confirmer que setgid est en place, comme indiqué ci-dessous, où le bit dexécution pour les autorisations de groupe est une minuscule. Cela passera à une majuscule S si le groupe ne dispose pas de lautorisation dexécution et que seul setgid est en place.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ls -la /srv/nfs/
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>...
drwxrws--- 4 xoyi partage 4096 Jun 30 11:02 .
...
</code></pre></div></div>
<p>Désormais, tous les fichiers ou répertoires créés dans /srv/nfs se verront automatiquement attribuer le propriétaire du groupe partage, ce qui permettra essentiellement la collaboration de groupe, car tout utilisateur appartenant au groupe partage pourra désormais accéder aux fichiers créés par dautres utilisateurs du groupe. même groupe dans le répertoire /srv/nfs.</p>
<h2 id="sauvegardes-et-synchronisation">Sauvegardes et synchronisation</h2>
<h3 id="borgbackup">BorgBackup</h3>
<p><img src="/images/borg-logo.png" alt="" /></p>
<h4 id="machine-qui-stocke-les-sauvegardes--xoyizexyz---192168045">Machine qui stocke les sauvegardes → xoyize.xyz - 192.168.0.45</h4>
<p><strong><u>Installation BorgBackup et ajout clé publique sur le serveur de sauvegarde xoyize.xyz</u></strong><br />
On se connecte sur la machine et on passe en mode su</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo -s
</code></pre></div></div>
<p>Installer borgbackup</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>apt install borgbackup
</code></pre></div></div>
<p>Créer un utilisateur borg dédié aux sauvegardes par BorgBackup :</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>useradd borg --home-dir /srv/data/borg-backups/ # --create-home si répertoire inexistant
</code></pre></div></div>
<p>Vérifier le propriétaire des dossiers “borg”</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ls -la /srv/data/borg-backups/
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>...
drwxr-xr-x 10 borg borg 4096 Jun 24 08:01 .
drwxr-xr-x 12 root root 4096 Jun 24 12:01 ..
-rw-r--r-- 1 borg borg 220 May 15 2017 .bash_logout
-rw-r--r-- 1 borg borg 3526 May 15 2017 .bashrc
drwx------ 3 borg borg 4096 Jan 28 2019 .cache
drwx------ 3 borg borg 4096 Jul 4 02:42 cinay.eu
drwx------ 3 borg borg 4096 Jul 4 03:33 cinay.xyz
drwx------ 3 borg borg 4096 Jan 28 2019 .config
drwx------ 3 borg borg 4096 Jul 3 06:59 Dell_Latitude_e6230
drwx------ 3 borg borg 4096 Aug 27 2019 .gnupg
-rw-r--r-- 1 borg borg 675 May 15 2017 .profile
drwxr-xr-x 2 borg borg 4096 Jul 24 2019 .ssh
drwx------ 3 root root 4096 Jul 4 08:18 yannick-pc
</code></pre></div></div>
<p>sinon modifier</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>chown borg.borg -R /srv/data/borg-backups/
</code></pre></div></div>
<p>Cet utilisateur na pas de mot de passe, nous nous y connecterons uniquement avec une clef SSH ,ajout de la clé publique</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mkdir -p /srv/data/borg-backups/.ssh
cat &gt;&gt; /srv/data/borg-backups/.ssh/authorized_keys
</code></pre></div></div>
<p>Copier/coller le contenu fichier de clef publique (/root/.ssh/yanspm_ed25519.pub de la machine à sauvegarder ) dans ce terminal, et presser [Ctrl]+[D] pour valider.</p>
<p>Autoriser utilisateur <strong>borg</strong> à exécuter <em>/usr/bin/borg</em> uniquement</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>echo "borg ALL=NOPASSWD: /usr/bin/borg" &gt;&gt; /etc/sudoers
</code></pre></div></div>
<h4 id="machines-autorisés-à-effectuer-leur-backup">Machines autorisés à effectuer leur backup</h4>
<p>Le dossier de base pour les sauvegardes sur le serveur xoyize.xyz : <strong>/srv/data/borg-backups/</strong> <br />
Pour info les machines autorisés à effectuer leur backup sur cette machine :<br />
yannick-pc e6230</p>
<h3 id="rsync">Rsync</h3>
<p><img src="/images/rsync.png" alt="" /></p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Source</th>
<th>Destination</th>
<th>Commentaire</th>
</tr>
</thead>
<tbody>
<tr>
<td>rsync</td>
<td><code class="language-plaintext highlighter-rouge">usernl@xoyaz.xyz:/srv/data/borg-backups/*</code></td>
<td><code class="language-plaintext highlighter-rouge">/srv/data/borg-backups/</code> (xoyize.xyz)</td>
<td>(rsync over ssh)</td>
</tr>
<tr>
<td>rsync</td>
<td><code class="language-plaintext highlighter-rouge">/srv/data/music/* </code>(xoyize.xyz)</td>
<td><code class="language-plaintext highlighter-rouge">usernl@xoyaz.xyz:/home/usernl/backup/musique/</code></td>
<td>(rsync over ssh)</td>
</tr>
<tr>
<td>rsync</td>
<td><code class="language-plaintext highlighter-rouge">/srv/data/CalibreTechnique/*</code> (xoyize.xyz)</td>
<td><code class="language-plaintext highlighter-rouge">usernl@xoyaz.xyz:/home/usernl/backup/CalibreTechnique/</code></td>
<td>(rsync over ssh)</td>
</tr>
</tbody>
</table>
<h4 id="synchronisation-dossier-de-sauvegarde-borg-xoyazxyz--xoyizexyz">Synchronisation dossier de sauvegarde borg xoyaz.xyzxoyize.xyz</h4>
<p><em>Pour les serveurs yanspm.com yanfi.net et cinay.xyz ,les sauvegardes sont effectuées en utilisant le logiciel borg ,vers le serveur de backup xoyaz.xyz et on utilise rsync pour les transférer localement</em></p>
<p><strong>connexion avec clé</strong><br />
<u>sur le serveur appelant srvxo (xoyize.xyz - 192.168.0.45)</u>
Générer une paire de clé curve25519-sha256 (ECDH avec Curve25519 et SHA2) nommé <strong>xoyaz_ed25519</strong> pour une liaison SSH avec le serveur KVM.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh-keygen -t ed25519 -o -a 100 -f ~/.ssh/xoyaz_ed25519
</code></pre></div></div>
<p>Ajouter la clé publique au fichier <strong>~/.ssh/authorized_keys</strong> du serveur de backup xoyaz.xyz</p>
<p>Test connexion</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh -p 55036 -i /home/xoyi/.ssh/xoyaz_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null usernl@xoyaz.xyz
</code></pre></div></div>
<p>Créer la commande rsync avec son fichier dexclusion</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano .ssh/exclude-list.txt
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>.bash_logout
.bashrc
.profile
.ssh
</code></pre></div></div>
<p>Lancer la commande rsync dans une fenêtre terminal tmux en mode su</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>tmux
sudo -s
rsync -avz --progress --stats --human-readable --exclude-from '/home/xoyi/.ssh/exclude-list.txt' --rsync-path="sudo rsync" -e "ssh -p 55036 -i /home/xoyi/.ssh/xoyaz_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" usernl@xoyaz.xyz:/srv/data/borg-backups/* /srv/data/borg-backups/
</code></pre></div></div>
<p>Paramétrer pour une exécution chaque jour à 2h30</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo crontab -e
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Synchro Backup entre serveur distant xoyaz.xyz (contient les backup des serveurs VPS) et le serveur local xoyize.xyz
30 02 * * * rsync -avz --progress --stats --delete --human-readable --exclude-from '/home/xoyi/.ssh/exclude-list.txt' --rsync-path="sudo rsync" -e "ssh -p 55036 -i /home/xoyi/.ssh/xoyaz_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" usernl@xoyaz.xyz:/srv/data/borg-backups/* /srv/data/borg-backups/ ; if [ $? -eq 0 ]; then echo "Rsync usernl@xoyaz.xyz:/srv/data/borg-backups/* /srv/data/borg-backups/ : Synchronisation OK" | systemd-cat -t rsync-cron -p info ; else echo "Rsync usernl@xoyaz.xyz:/srv/data/borg-backups/* /srv/data/borg-backups/ : Synchronisation ERREUR" | systemd-cat -t rsync-cron -p emerg ; fi
</code></pre></div></div>
<p><strong>Explications sur la commande</strong><br />
On redirige le résultat de la commande ($?) vers le journal avec <strong>systemd-cat</strong> <br />
<code class="language-plaintext highlighter-rouge">if [ $? -eq 0 ]; then echo "Rsync usernl@xoyaz.xyz:/srv/data/borg-backups/* /srv/data/borg-backups/ : Synchronisation OK" | systemd-cat -t rsync-cron -p info ; else echo "Rsync usernl@xoyaz.xyz:/srv/data/borg-backups/* /srv/data/borg-backups/ : Synchronisation ERREUR" | systemd-cat -t rsync-cron -p emerg ; fi</code></p>
<p>la ligne de commande décortiquée:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>if [ $? -eq 0 ]
then
echo "Rsync usernl@xoyaz.xyz:/srv/data/borg-backups/* /srv/data/borg-backups/ : Synchronisation OK" | systemd-cat -t rsync-cron -p info
else
echo "Rsync usernl@xoyaz.xyz:/srv/data/borg-backups/* /srv/data/borg-backups/ :Erreur Synchronisation" | systemd-cat -t rsync-cron -p emerg
fi
</code></pre></div></div>
<p>On peut lire le journal avec lidentifiant <em>rsync-cron</em></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>journalctl -t rsync-cron
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>-- Logs begin at Thu 2019-08-29 11:07:55 CEST, end at Tue 2019-09-17 17:50:32 CEST. --
sept. 17 17:50:32 srvxo rsync-cron[11728]: Rsync usernl@xoyaz.xyz:/srv/data/borg-backups/* /srv/data/borg-backups/ : Synchronisation OK
</code></pre></div></div>
<h4 id="synchronisation-dossiers-music-calibre-xoyizexyz--xoyazxyz">Synchronisation dossiers music Calibre xoyize.xyzxoyaz.xyz</h4>
<p>Ajouter au lanceur de tâches programmées</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo crontab -e
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Synchro music avec Backup
00 02 * * * rsync -avz --progress --stats --human-readable --delete --exclude-from '/home/xoyi/.ssh/exclude-list.txt' --rsync-path="sudo rsync" -e "ssh -p 55036 -i /home/xoyi/.ssh/xoyaz_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" /srv/data/music/* usernl@xoyaz.xyz:/home/usernl/backup/musique/ ; if [ $? -eq 0 ]; then echo "Rsync /srv/data/music/* usernl@xoyaz.xyz:/home/usernl/backup/musique/ : Synchronisation OK" | systemd-cat -t rsync-cron -p info ; else echo "Rsync /srv/data/music/* usernl@xoyaz.xyz:/home/usernl/backup/musique/ : Synchronisation ERREUR" | systemd-cat -t rsync-cron -p emerg ; fi
# Synchro CalibreTechnique avec Backup
10 02 * * * rsync -avz --progress --stats --human-readable --delete --exclude-from '/home/xoyi/.ssh/exclude-list.txt' --rsync-path="sudo rsync" -e "ssh -p 55036 -i /home/xoyi/.ssh/xoyaz_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" /srv/data/CalibreTechnique/* usernl@xoyaz.xyz:/home/usernl/backup/CalibreTechnique/ ; if [ $? -eq 0 ]; then echo "Rsync /srv/data/CalibreTechnique/* usernl@xoyaz.xyz:/home/usernl/backup/CalibreTechnique/ : Synchronisation OK" | systemd-cat -t rsync-cron -p info ; else echo "Rsync /srv/data/CalibreTechnique/* usernl@xoyaz.xyz:/home/usernl/backup/CalibreTechnique/ : Synchronisation ERREUR" | systemd-cat -t rsync-cron -p emerg ; fi
# Synchro BiblioCalibre avec Backup
15 02 * * * rsync -avz --progress --stats --human-readable --delete --exclude-from '/home/xoyi/.ssh/exclude-list.txt' --rsync-path="sudo rsync" -e "ssh -p 55036 -i /home/xoyi/.ssh/xoyaz_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" /srv/data/BiblioCalibre/* usernl@xoyaz.xyz:/home/usernl/backup/BiblioCalibre/ ; if [ $? -eq 0 ]; then echo "Rsync /srv/data/BiblioCalibre/* usernl@xoyaz.xyz:/home/usernl/backup/BiblioCalibre/ : Synchronisation OK" | systemd-cat -t rsync-cron -p info ; else echo "Rsync /srv/data/BiblioCalibre/* usernl@xoyaz.xyz:/home/usernl/backup/BiblioCalibre/ : Synchronisation ERREUR" | systemd-cat -t rsync-cron -p emerg ; fi
# Synchro osm-new avec Backup
20 02 * * * rsync -avz --progress --stats --human-readable --delete --exclude-from '/home/xoyi/.ssh/exclude-list.txt' --rsync-path="sudo rsync" -e "ssh -p 55036 -i /home/xoyi/.ssh/xoyaz_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" /srv/data/devel/ouestline/osm-new/* usernl@xoyaz.xyz:/home/usernl/backup/osm-new/ ; if [ $? -eq 0 ]; then echo "Rsync /srv/data/devel/ouestline/osm-new/* usernl@xoyaz.xyz:/home/usernl/backup/osm-new/ : Synchronisation OK" | systemd-cat -t rsync-cron -p info ; else echo "Rsync /srv/data/devel/ouestline/osm-new/* usernl@xoyaz.xyz:/home/usernl/backup/osm-new/ : Synchronisation ERREUR" | systemd-cat -t rsync-cron -p emerg ; fi
</code></pre></div></div>
<h3 id="synchronisation-temps-réel-pc1-lsyncd---srvxo-192168045">Synchronisation temps réel PC1 (lsyncd) → srvxo (192.168.0.45)</h3>
<p>On va utiliser <strong>lsync</strong> sur <strong>PC1</strong> pour synchroniser les dossiers locaux de PC1 avec ceux du serveur xoyize.xyz (192.168.0.45)</p>
<table>
<thead>
<tr>
<th>Type</th>
<th>PC1</th>
<th>srvxo xoyize.xyz (192.168.0.45)</th>
</tr>
</thead>
<tbody>
<tr>
<td>lsync</td>
<td>~/media/CalibreTechnique</td>
<td>xoyi@192.168.0.45:/srv/data/CalibreTechnique</td>
</tr>
<tr>
<td>lsync</td>
<td>~/media/BiblioCalibre</td>
<td>xoyi@192.168.0.45:/srv/data/BiblioCalibre</td>
</tr>
<tr>
<td>lsync</td>
<td>~/media/dplus</td>
<td>xoyi@192.168.0.45:/srv/data/dplus</td>
</tr>
<tr>
<td>lsync</td>
<td>~/media/devel</td>
<td>xoyi@192.168.0.45:/srv/data/devel</td>
</tr>
</tbody>
</table>
<h2 id="diagnostiques">Diagnostiques</h2>
<h3 id="6-juillet-2020">6 juillet 2020</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yunohost diagnosis run
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Success! Everything looks good for Base system!
Success! Everything looks good for Internet connectivity!
Success! Everything looks good for DNS records!
Success! Everything looks good for Ports exposure!
Success! Everything looks good for Web!
Error: Found 1 significant issue(s) related to Email!
Success! Everything looks good for Services status check!
Success! Everything looks good for System resources!
Warning: Found 1 item(s) that could be improved for System configurations.
Warning: To see the issues found, you can go to the Diagnosis section of the webadmin, or run 'yunohost diagnosis show --issues' from the command-line.
</code></pre></div></div>
<p>Détail</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yunohost diagnosis show --issues
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>reports:
0:
description: Email
id: mail
items:
details:
- You should first try to configure the reverse DNS with xoyize.xyz in your internet router interface or your hosting provider interface. (Some hosting provider may require you to send them a support ticket for this).
- Some providers won't let you configure your reverse DNS (or their feature might be broken...). If your reverse DNS is correctly configured for IPv4, you can try disabling the use of IPv6 when sending emails by running 'yunohost settings set smtp.allow_ipv6 -v off'. Note: this last solution means that you won't be able to send or receive emails from the few IPv6-only servers out there.
status: ERROR
summary: No reverse DNS is defined in IPv6. Some emails may fail to get delivered or may get flagged as spam.
1:
description: System configurations
id: regenconf
items:
details: This is probably OK if you know what you're doing! YunoHost will stop updating this file automatically... But beware that YunoHost upgrades could contain important recommended changes. If you want to, you can inspect the differences with 'yunohost tools regen-conf ssh --dry-run --with-diff' and force the reset to the recommended configuration with 'yunohost tools regen-conf ssh --force'
status: WARNING
summary: Configuration file /etc/ssh/sshd_config appears to have been manually modified.
</code></pre></div></div>
<p>Corrections</p>
<p>Impossible de définir un reverse DNS IPV6 chez free.fr , on désactive</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yunohost settings set smtp.allow_ipv6 -v off
</code></pre></div></div>
<p>On ne modifie pas SSH</p>
<h2 id="applications">Applications</h2>
<h3 id="dévelopment---develxoyizexyz">Dévelopment - devel.xoyize.xyz</h3>
<p>Créer le domaine devel.xoyize.xyz et les certificats</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo -s
yunohost domain add devel.xoyize.xyz
yunohost domain cert-install devel.xoyize.xyz --no-checks
</code></pre></div></div>
<p>Installer application Multi web app</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://gitea.cinay.eu/yann/multi_webapp_buster_ynh
yunohost app install multi_webapp_buster_ynh/
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>DANGER! This app is not part of Yunohost<span class="s1">'s app catalog. Installing third-party apps may compromise the integrity and security of your system. You should probably NOT install it unless you know what you are doing. NO SUPPORT will be provided if this app doesn'</span>t work or breaks your system… If you are willing to take that risk anyway, <span class="nb">type</span> <span class="s1">'Yes, I understand'</span>: Yes, I understand
Available domains:
- xoyize.xyz
- devel.xoyize.xyz
Choose a domain <span class="k">for </span>your Webapp <span class="o">(</span>default: cinay.eu<span class="o">)</span>: devel.xoyize.xyz
Choose a path <span class="k">for </span>your Webapp <span class="o">(</span>default: /site<span class="o">)</span>: /
Available <span class="nb">users</span>:
- yak
Choose the YunoHost user: yak
Create a database? <span class="o">[</span><span class="nb">yes</span> | no] <span class="o">(</span>default: no<span class="o">)</span>:
Is it a public website ? <span class="o">[</span><span class="nb">yes</span> | no] <span class="o">(</span>default: no<span class="o">)</span>:
Info: Installing the app <span class="s1">'multi_webapp'</span>
Info: <span class="o">[</span>+...................] <span class="o">&gt;</span> Retrieve arguments from the manifest
Info: <span class="o">[</span><span class="c">#+..................] &gt; Check if the app can be installed</span>
Info: <span class="o">[</span><span class="c">##+++...............] &gt; Store settings from manifest</span>
Info: <span class="o">[</span><span class="c">#####+..............] &gt; Setup SSOwat</span>
Info: <span class="o">[</span><span class="c">######+.............] &gt; Create final path</span>
Info: The directory /var/www/webapp_yann already exist, <span class="k">do </span>not recreate it.
Info: <span class="o">[</span><span class="c">#######+++..........] &gt; Create a dedicated user</span>
Info: <span class="o">[</span><span class="c">##########+.........] &gt; Configure php-fpm</span>
Info: <span class="o">[</span><span class="c">###########+........] &gt; Configure nginx</span>
Info: <span class="o">[</span><span class="c">############+++++...] &gt; Reload nginx</span>
Info: <span class="o">[</span><span class="c">####################] &gt; Installation completed</span>
Success! Installation completed
</code></pre></div></div>
<p>Accès dossier “développement” <strong>/srv/data/devel/ouestline</strong> partagé avec PC1 <br />
Fichier de configuration nginx <strong>/etc/nginx/conf.d/devel.xoyize.xyz.d/webapp_devel.xoyize.xyz_.conf</strong></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>#sub_path_only rewrite ^/$ / permanent;
location / {
alias /srv/data/devel/ouestline/ ;
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
fancyindex on; # Enable fancy indexes.
fancyindex_exact_size off; # Output human-readable file sizes.
index index.html index.php ;
try_files $uri $uri/ index.php;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.3-fpm-webapp_devel.xoyize.xyz_.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
}
</code></pre></div></div>
<p>Vérifier et relancer nginx</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nginx -t
systemctl reload nginx
</code></pre></div></div>
<p>Applications installées</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yunohost app list
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>apps:
description: Empty App without FTP access
id: multi_webapp
name: Multi custom webapp
version: 1.0~ynh5
</code></pre></div></div>
<p>Changer le label</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yunohost app change-label multi_webapp Développement
</code></pre></div></div>
<h3 id="nextcloud---ncxoyizexyz">Nextcloud - nc.xoyize.xyz</h3>
<p>Créer le domaine nc.xoyize.xyz et les certificats</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo -s
yunohost domain add nc.xoyize.xyz
yunohost domain cert-install nc.xoyize.xyz --no-checks
</code></pre></div></div>
<p>Installer application Nextcloud</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yunohost app install https://github.com/YunoHost-Apps/nextcloud_ynh
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Available domains:
- xoyize.xyz
- nc.xoyize.xyz
- devel.xoyize.xyz
Choose a domain for Nextcloud (default: xoyize.xyz): nc.xoyize.xyz
Choose a path for Nextcloud (default: /nextcloud): /
Available users:
- yak
Choose the Nextcloud administrator (must be an existing YunoHost user): yak
Access the users home folder from Nextcloud? [yes | no] (default: no): yes
Info: Installing the app 'nextcloud'…
Info: [....................] &gt; Validating installation parameters...
Info: [....................] &gt; Storing installation settings...
Info: [+...................] &gt; Installing dependencies...
Warning:
Warning: Creating config file /etc/papersize with new version
Warning:
Warning: Creating config file /etc/samba/smb.conf with new version
Warning: Created symlink /etc/systemd/system/multi-user.target.wants/atd.service -&gt; /lib/systemd/system/atd.service.
Warning: Load smb config files from /etc/samba/smb.conf
Warning: Loaded services file OK.
Warning: Server role: ROLE_STANDALONE
Warning:
Info: [#+..................] &gt; Creating a MySQL database...
Info: [##..................] &gt; Setting up source files...
Info: [##..................] &gt; Configuring nginx web server...
Info: [##+.................] &gt; Configuring system user...
Info: [###++++++++.........] &gt; Configuring php-fpm...
Warning:
Warning: Creating config file /etc/php/7.3/mods-available/bz2.ini with new version
Warning:
Warning: Creating config file /etc/php/7.3/mods-available/gmp.ini with new version
Warning:
Warning: Creating config file /etc/php/7.3/mods-available/zip.ini with new version
Warning:
Warning: Creating config file /etc/php/7.3/mods-available/imap.ini with new version
Info: [###########++++.....] &gt; Installing nextcloud...
Info: [###############++...] &gt; Configuring nextcloud...
Warning: warning: commands will be executed using /bin/sh
Warning: job 1 at Mon Jul 6 11:44:00 2020
Warning: 2020-07-06 11:34:43 URL:https://codeload.github.com/YunoHost-Apps/yunohost.multimedia/tar.gz/v1.2 [15921] -&gt; "v1.2.tar.gz" [1]
Info: [#################+..] &gt; Adding multimedia directories...
Info: [##################..] &gt; Configuring log rotation...
Info: [##################+.] &gt; Configuring fail2ban...
Info: The service fail2ban has correctly executed the action reload-or-restart.
Info: [###################.] &gt; Configuring SSOwat...
Warning: /!\ Packagers! This app is still using the skipped/protected/unprotected_uris/regex settings which are now obsolete and deprecated... Instead, you should use the new helpers 'ynh_permission_{create,urls,update,delete}' and the 'visitors' group to initialize the public/private access. Check out the documentation at the bottom of yunohost.org/groups_and_permissions to learn how to use the new permission mechanism.
Warning: /!\ Packagers! This app is still using the skipped/protected/unprotected_uris/regex settings which are now obsolete and deprecated... Instead, you should use the new helpers 'ynh_permission_{create,urls,update,delete}' and the 'visitors' group to initialize the public/private access. Check out the documentation at the bottom of yunohost.org/groups_and_permissions to learn how to use the new permission mechanism.
Info: [###################.] &gt; Reloading nginx web server...
Success! Installation completed
</code></pre></div></div>
<h3 id="transmission---xoyizexyztorrent">Transmission - xoyize.xyz/torrent</h3>
<p>Fichiers torrents</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yunohost app install transmission
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Available domains:
- xoyize.xyz
- nc.xoyize.xyz
- devel.xoyize.xyz
Choose a domain for Transmission (default: xoyize.xyz):
Choose a path for Transmission (default: /torrent):
Info: Installing the app 'transmission'…
Info: [....................] &gt; Validating installation parameters...
Info: [+...................] &gt; Storing installation settings...
Info: [#+++++++............] &gt; Configuring firewall...
Info: [########+++++++.....] &gt; Installing transmission...
Warning: Created symlink /etc/systemd/system/multi-user.target.wants/transmission-daemon.service -&gt; /lib/systemd/system/transmission-daemon.service.
Info: [###############+....] &gt; Configuring nginx web server...
Info: [################....] &gt; Configuring transmission...
Warning: 2020-07-21 09:11:57 URL:https://codeload.github.com/YunoHost-Apps/yunohost.multimedia/tar.gz/v1.2 [15921] -&gt; "v1.2.tar.gz" [1]
Info: [################++..] &gt; Adding multimedia directories...
Info: [##################+.] &gt; Starting transmission...
Info: [###################.] &gt; Reloading nginx web server...
Info: [####################] &gt; Installation of transmission completed
Success! Installation completed
</code></pre></div></div>
<h3 id="firefox-sync-server">Firefox Sync Server</h3>
<p><em>Firefox propos une connexion pour partager favoris, mots de passe et autres entre les différentes instances de navigateurs (PC, tablette et téléphone).Le serveur de synchronisation est hébergeable</em></p>
<ul>
<li><a href="https://wiki.archlinux.org/index.php/Firefox_Sync_Server">Firefox Sync Server (archlinux)</a></li>
<li><a href="https://www.pofilo.fr/post/20190324-syncserver/">Firefox Sync Server (Tuto FR)</a></li>
</ul>
<blockquote>
<p><strong>ATTENTION : Lapplication ets basée sur python2.7</strong></p>
</blockquote>
<p>Installation sur yunohost</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yunohost app install ffsync
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Available domains:
- xoyize.xyz
- nc.xoyize.xyz
- devel.xoyize.xyz
- static.xoyize.xyz
Choose a domain for Firefox-Sync Server (default: xoyize.xyz):
Choose a path for Firefox-Sync Server (default: /ffsync):
Info: Installing the app 'ffsync'…
Info: [....................] &gt; Validating installation parameters...
Info: [++++++..............] &gt; Installing dependencies...
Info: [######..............] &gt; Creating a MySQL database...
Info: [######++++++++......] &gt; Installing sources files...
Warning: /usr/bin/which: 10: printf: printf: I/O error
Warning: DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Warning: DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Warning: DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Info: [##############+.....] &gt; Configuring nginx
Info: [###############+....] &gt; Configuring system user...
Info: [################....] &gt; Configuring application...
Warning: Created symlink /etc/systemd/system/multi-user.target.wants/uwsgi-app@ffsync.service → /etc/systemd/system/uwsgi-app@.service.
Info: [################+...] &gt; Protecting directory
Info: [#################+..] &gt; Configuring permissions
Warning: /!\ Packagers! This app is still using the skipped/protected/unprotected_uris/regex settings which are now obsolete and deprecated... Instead, you should use the new helpers 'ynh_permission_{create,urls,update,delete}' and the 'visitors' group to initialize the public/private access. Check out the documentation at the bottom of yunohost.org/groups_and_permissions to learn how to use the new permission mechanism.
Info: [##################+.] &gt; Reloading nginx web server...
Success! Installation completed
</code></pre></div></div>
<p><strong>Serveur de synchronisation firefox auto-hébergé</strong><br />
Ouvrir le lien https://xoyize.xyz/ffsync<br />
<img src="/images/ffsync-xoyize.xyz.png" alt="ffsync" width="400px" /></p>
<p><strong>Créer un compte Firefox</strong> : ffsync@xoyize.xyz<br />
<img src="/images/ffsync-xoyize.xyz-1.png" alt="ffsync" width="200px" /> <img src="/images/ffsync-xoyize.xyz-2.png" alt="ffsync" width="200px" /> <img src="/images/ffsync-xoyize.xyz-3.png" alt="ffsync" width="200px" /></p>
<p><strong>Comment synchroniser Firefox avec le serveur xoyize.xyz au lieu de celui de Mozilla ?</strong><br />
Vous pouvez utiliser en toute sécurité le serveur de comptes Firefox hébergé par Mozilla en combinaison avec un serveur de stockage de synchronisation auto-hébergé.<br />
Les protocoles dauthentification et de cryptage sont conçus de manière à ce que le serveur de compte ne connaisse pas le mot de passe en clair de lutilisateur et ne puisse donc pas accéder à ses données de synchronisation stockées.<br />
Pour configurer <strong>Firefox</strong> afin quil communique avec votre nouveau serveur de synchronisation, allez dans “<code class="language-plaintext highlighter-rouge">about:config</code>”, cherchez “<code class="language-plaintext highlighter-rouge">identity.sync.tokenserver.uri</code>” et modifiez sa valeur pour quelle corresponde à lURL de votre serveur avec le chemin daccès “token/1.0/sync/1.5” :</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>identity.sync.tokenserver.uri : https://xoyize.xyz/ffsync/token/1.0/sync/1.5
</code></pre></div></div>
<h3 id="jekyll-générateur-de-site-statique">Jekyll Générateur de Site statique</h3>
<p><img src="/images/jekyll-300x133.png" alt="jekyll" width="150px" /><br />
<em>Générer un site statique via jekyll</em></p>
<p><strong>Rbenv (gestionnaire version ruby)</strong> est un outil léger de gestion des versions de Ruby qui vous permet de changer facilement de version de Ruby.</p>
<p>Par défaut, Rbenv ne gère pas linstallation des versions de Ruby. ruby-build est un outil qui vous aide à installer nimporte quelle version de Ruby dont vous pourriez avoir besoin. Il est disponible en tant que programme autonome et en tant que plugin pour rbenv.</p>
<p>Installez les dépendances nécessaires à loutil ruby-build pour construire Ruby à partir des sources :</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo apt update
sudo apt install git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev
</code></pre></div></div>
<p>Ensuite, lancez la commande curl suivante pour installer les scripts rbenv et ruby-build :</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl -sL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash -
</code></pre></div></div>
<p>Si linstallation est réussie, le script imprimera quelque chose comme ceci :</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Running doctor script to verify installation...
Checking for `rbenv' in PATH: not found
You seem to have rbenv installed in `/home/dbsuser/.rbenv/bin', but that
directory is not present in PATH. Please add it to PATH by configuring
your `~/.bashrc', `~/.zshrc', or `~/.config/fish/config.fish'.
</code></pre></div></div>
<p>Avant de commencer à utiliser rbenv, nous devons ajouter $HOME/.rbenv/bin à notre PATH.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>echo 'export PATH="$HOME/.rbenv/bin:$PATH"' &gt;&gt; ~/.bashrc
echo 'eval "$(rbenv init -)"' &gt;&gt; ~/.bashrc
source ~/.bashrc
</code></pre></div></div>
<p>Les dernières versions stables</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>rbenv install -l
</code></pre></div></div>
<p>Maintenant que rbenv est installé sur notre système, nous pouvons facilement installer la dernière version stable de Ruby et la définir comme version par défaut avec :</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>rbenv install 2.7.1 # patientez de 3 à 8 minutes
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Downloading ruby-2.7.1.tar.bz2...
-&gt; https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.1.tar.bz2
Installing ruby-2.7.1...
Installed ruby-2.7.1 to /home/xoyi/.rbenv/versions/2.7.1
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>rbenv global 2.7.1
</code></pre></div></div>
<p>Vérifiez que Ruby a été correctement installé en imprimant le numéro de version :</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ruby -v
</code></pre></div></div>
<p><code class="language-plaintext highlighter-rouge">ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]</code></p>
<h3 id="yannxoyizexyz">yann.xoyize.xyz</h3>
<p><strong>Yunohost - domaine et certificat static.xoyize.xyz</strong></p>
<p>En mode su<br />
Ajout domaine</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yunohost domain add yann.xoyize.xyz
yunohost domain cert-install yann.xoyize.xyz --no-checks
</code></pre></div></div>
<p><strong>Yunohost - application Multi webapp</strong></p>
<p>Installation de lapplication “Multi webapp for YunoHost” sur le domaine <strong>static.xoyize.xyz</strong></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yunohost app install https://github.com/YunoHost-Apps/multi_webapp_ynh
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Choose a domain for your Webapp (default: xoyize.xyz): yann.xoyize.xyz
Choose a path for your Webapp (default: /site): /
Available users:
- yak
Choose the YunoHost user: yak
Create a database? [yes | no] (default: no):
Is it a public website ? [yes | no] (default: no): yes
[...]
Success! Installation complete
</code></pre></div></div>
<p>ID application “Multi custom webapp” : <code class="language-plaintext highlighter-rouge">multi_webapp__3</code><br />
Le dossier par défaut de “Multi webapp for YunoHost” <strong>/var/www/webapp_yak/yann.xoyize.xyz_/</strong></p>
<p>Pour créer un lien sur un autre dossier</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo rm -r /var/www/webapp_yak/yann.xoyize.xyz_/ # on supprime le dossier par défaut
sudo ln -s /srv/data/jekyll-theme-chirpy/_site /var/www/webapp_yak/yann.xoyize.xyz_ # créer le lien
</code></pre></div></div>
<p>Changer létiquette</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yunohost app change-label multi_webapp__3 "Site TEST yann.xoyize.xyz"
</code></pre></div></div>
<p>Le site test sur le lien <a href="https://yann.xoyize.xyz">https://yann.xoyize.xyz</a></p>
<blockquote>
<p>En cas de changement de domaine, il faut modifier les liens statiques des fichiers markdown dans le dossier <strong>~/media/dplus/statique/_posts</strong> <br />
Remplacer https://static.cinay.xyz par https://static.xoyize.xyz <br />
<code class="language-plaintext highlighter-rouge">find . -name "*.md" -type f -exec sed -i "s#https://static.cinay.xyz#https://static.xoyize.xyz#g" {} \;</code></p>
</blockquote>
<p>Site test</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo rm /var/www/webapp_yak/yann.xoyize.xyz_
sudo mkdir /var/www/webapp_yak/yann.xoyize.xyz_
sudo -s
echo "&lt;html&gt;Site TEST&lt;/html&gt;" &gt; /var/www/webapp_yak/yann.xoyize.xyz_/index.html
</code></pre></div></div>
<p>Site cartes</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo rm -r /var/www/webapp_yak/yann.xoyize.xyz_
sudo ln -s /srv/data/devel/ouestline/osm-new /var/www/webapp_yak/yann.xoyize.xyz_
</code></pre></div></div>
<p>Site statique</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo rm -r /var/www/webapp_yak/yann.xoyize.xyz_
sudo ln -s /srv/data/jekyll/jekyll-TeXt-theme/_site /var/www/webapp_yak/yann.xoyize.xyz_
</code></pre></div></div>
<p>Lien <a href="https://yann.xoyize.xyz">https://yann.xoyize.xyz</a></p>
<h3 id="recherche-searxxoyizexyz">Recherche (searx.xoyize.xyz)</h3>
<p><img src="/images/Searx_logo.png" alt="" width="70" /> <br />
<em>Un méta-moteur de recherche respectueux de la vie privée et bidouillable</em></p>
<p>En mode su</p>
<p>Ajout domaine searx.cinay.xyz et certificat lets encrypt (mode su)</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yunohost domain add searx.xoyize.xyz
yunohost domain cert-install searx.xoyize.xyz --no-checks
</code></pre></div></div>
<p>Installation par administration web<br />
domaine : searx.xoyize.xyz<br />
chemin : /<br />
Public</p>
<p>Modifier les paramètres</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano /opt/yunohost/searx/searx/settings.yml
</code></pre></div></div>
<div class="language-yml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">general</span><span class="pi">:</span>
<span class="na">instance_name </span><span class="pi">:</span> <span class="s2">"</span><span class="s">YannSearx"</span> <span class="c1"># displayed name</span>
<span class="na">search</span><span class="pi">:</span>
<span class="na">language </span><span class="pi">:</span> <span class="s2">"</span><span class="s">fr-FR"</span>
<span class="na">server</span><span class="pi">:</span>
<span class="na">image_proxy </span><span class="pi">:</span> <span class="s">True</span> <span class="c1"># Proxying image results through searx</span>
<span class="na">ui</span><span class="pi">:</span>
<span class="na">default_theme </span><span class="pi">:</span> <span class="s">oscar</span> <span class="c1"># ui theme</span>
<span class="na">theme_args </span><span class="pi">:</span>
<span class="na">oscar_style </span><span class="pi">:</span> <span class="s">logicodev-dark</span>
<span class="pi">-</span> <span class="na">name </span><span class="pi">:</span> <span class="s">ddg definitions</span>
<span class="na">engine </span><span class="pi">:</span> <span class="s">duckduckgo_definitions</span>
<span class="na">shortcut </span><span class="pi">:</span> <span class="s">ddd</span>
<span class="na">weight </span><span class="pi">:</span> <span class="m">2</span>
<span class="pi">-</span> <span class="na">name </span><span class="pi">:</span> <span class="s">duckduckgo</span>
<span class="na">engine </span><span class="pi">:</span> <span class="s">duckduckgo</span>
<span class="na">shortcut </span><span class="pi">:</span> <span class="s">ddg</span>
<span class="pi">-</span> <span class="na">name </span><span class="pi">:</span> <span class="s">duckduckgo images</span>
<span class="na">engine </span><span class="pi">:</span> <span class="s">duckduckgo_images</span>
<span class="na">shortcut </span><span class="pi">:</span> <span class="s">ddi</span>
<span class="na">timeout</span><span class="pi">:</span> <span class="m">3.0</span>
<span class="pi">-</span> <span class="na">name </span><span class="pi">:</span> <span class="s">fdroid</span>
<span class="na">engine </span><span class="pi">:</span> <span class="s">fdroid</span>
<span class="na">shortcut </span><span class="pi">:</span> <span class="s">fd</span>
<span class="na">default_doi_resolver </span><span class="pi">:</span> <span class="s1">'</span><span class="s">oadoi.org'</span>
</code></pre></div></div>
<p><strong>Ouvrir le lien sur un nouvel onglet</strong><br />
Il suffit de faire une modification dans le code <strong>/opt/yunohost/searx/searx/preferences.py</strong><br />
Remplacer <code class="language-plaintext highlighter-rouge">MapSetting(False</code> par <code class="language-plaintext highlighter-rouge">MapSetting(True</code></p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code> <span class="sh">'</span><span class="s">results_on_new_tab</span><span class="sh">'</span><span class="p">:</span> <span class="nc">MapSetting</span><span class="p">(</span><span class="bp">True</span><span class="p">,</span> <span class="nb">map</span><span class="o">=</span><span class="p">{</span><span class="sh">'</span><span class="s">0</span><span class="sh">'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="sh">'</span><span class="s">1</span><span class="sh">'</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="sh">'</span><span class="s">False</span><span class="sh">'</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
<span class="sh">'</span><span class="s">True</span><span class="sh">'</span><span class="p">:</span> <span class="bp">True</span><span class="p">}),</span>
</code></pre></div></div>
<p>Redémarrer le service uwsgi</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl restart uwsgi
</code></pre></div></div>
<h2 id="jekyll-text-theme">jekyll-TeXt-theme</h2>
<p><a href="https://tianqi.name/jekyll-TeXt-theme/docs/en/quick-start">Documentation TeXt theme</a></p>
<h3 id="srvdatajekylljekyll-text-theme">/srv/data/jekyll/jekyll-TeXt-theme</h3>
<p>Créer un dossier jekyll</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo mkdir -p /srv/data/jekyll
sudo chown $USER.$USER /srv/data/jekyll
cd /srv/data/jekyll
</code></pre></div></div>
<p>Cloner le dépôt</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/kitian616/jekyll-TeXt-theme.git
cd jekyll-TeXt-theme
</code></pre></div></div>
<p>Vérifier <em>Gemfile</em></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>source "https://rubygems.org"
# gem "github-pages", group: :jekyll_plugins
gemspec
</code></pre></div></div>
<p>Bundle lit le fichier <strong>Gemfile</strong></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bundle install # Patientez ...
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Bundle complete! 3 Gemfile dependencies, 43 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
</code></pre></div></div>
<p>Info sur jekyll et créer un lien</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bundle info jekyll
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> * jekyll (4.1.1)
Summary: A simple, blog aware, static site generator.
Homepage: https://jekyllrb.com
Path: /home/xoyi/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/jekyll-4.1.1
</code></pre></div></div>
<h3 id="_configyml">_config.yml</h3>
<p>configuration <strong>_config.yml</strong></p>
<div class="language-yml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">## =&gt; Site Settings</span>
<span class="c1">##############################</span>
<span class="na">text_skin</span><span class="pi">:</span> <span class="s">dark</span> <span class="c1"># "default" (default), "dark", "forest", "ocean", "chocolate", "orange"</span>
<span class="na">highlight_theme</span><span class="pi">:</span> <span class="s">tomorrow-night-eighties</span> <span class="c1"># "default" (default), "tomorrow", "tomorrow-night", "tomorrow-night-eighties", "tomorrow-night-blue", "tomorrow-night-bright"</span>
<span class="na">url </span><span class="pi">:</span> <span class="s">https://yann.cinay.eu</span> <span class="c1"># the base hostname &amp; protocol for your site e.g. https://www.someone.com</span>
<span class="na">baseurl </span><span class="pi">:</span> <span class="c1"># does not include hostname</span>
<span class="na">title </span><span class="pi">:</span> <span class="s">Site Yann</span>
<span class="na">description</span><span class="pi">:</span> <span class="pi">&gt;</span> <span class="c1"># this means to ignore newlines until "Language &amp; timezone"</span>
<span class="s">Expérimentations et tests</span>
<span class="c1">## =&gt; Language and Timezone</span>
<span class="c1">##############################</span>
<span class="na">lang</span><span class="pi">:</span> <span class="s">fr</span> <span class="c1"># the language of your site, default as "en"</span>
<span class="na">timezone</span><span class="pi">:</span> <span class="s">Europe/Paris</span> <span class="c1"># see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for the available values</span>
<span class="c1">## =&gt; Author and Social</span>
<span class="c1">##############################</span>
<span class="na">author</span><span class="pi">:</span>
<span class="na">type </span><span class="pi">:</span> <span class="c1"># "person" (default), "organization"</span>
<span class="na">name </span><span class="pi">:</span> <span class="s">Yann M</span>
<span class="c1">## Ajouter 2 fichiers à exclure</span>
<span class="na">exclude</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">yannstatic.sh</span>
<span class="pi">-</span> <span class="s">synchro_site.sh</span>
</code></pre></div></div>
<p>Création des liens sur les dossiers <strong>files</strong> , <strong>images</strong> et <strong>_posts</strong></p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo ln</span> <span class="nt">-s</span> /srv/data/dplus/statique/images /srv/data/jekyll/jekyll-TeXt-theme/images
<span class="nb">sudo ln</span> <span class="nt">-s</span> /srv/data/dplus/statique/files /srv/data/jekyll/jekyll-TeXt-theme/files
<span class="nb">sudo ln</span> <span class="nt">-s</span> /srv/data/dplus/statique/_posts /srv/data/jekyll/jekyll-TeXt-theme/_posts
</code></pre></div></div>
<p>Création site</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>jekyll build
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Configuration file: /srv/data/jekyll/jekyll-TeXt-theme/_config.yml
Source: /srv/data/jekyll/jekyll-TeXt-theme
Destination: /srv/data/jekyll/jekyll-TeXt-theme/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
done in 2.339 seconds.
Auto-regeneration: disabled. Use --watch to enable.
</code></pre></div></div>
<p>Le site lisible sur yann.xoyize.xyz</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo rm</span> <span class="nt">-r</span> /var/www/webapp_yak/yann.xoyize.xyz_ <span class="c"># on supprime le dossier ou lien par défaut</span>
<span class="nb">sudo ln</span> <span class="nt">-s</span> /srv/data/jekyll/jekyll-TeXt-theme/_site /var/www/webapp_yak/yann.xoyize.xyz_ <span class="c"># créer le lien</span>
</code></pre></div></div>
<h3 id="entête-posts-et-date">Entête “posts” et date</h3>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># layout: post -&gt; layout: article</span>
find <span class="nb">.</span> <span class="nt">-name</span> <span class="s2">"*.md"</span> <span class="nt">-type</span> f <span class="nt">-exec</span> <span class="nb">sed</span> <span class="nt">-i</span> <span class="s1">'s/layout\: post/layout\: article/g'</span> <span class="o">{}</span> <span class="se">\;</span>
<span class="c"># layout : post -&gt; layout: article</span>
find <span class="nb">.</span> <span class="nt">-name</span> <span class="s2">"*.md"</span> <span class="nt">-type</span> f <span class="nt">-exec</span> <span class="nb">sed</span> <span class="nt">-i</span> <span class="s1">'s/layout \: post/layout\: article/g'</span> <span class="o">{}</span> <span class="se">\;</span>
<span class="c"># supprimer les lignes qui commence par date, private et categories:</span>
<span class="nb">sed</span> <span class="nt">-i</span> <span class="s1">'/^date\:/d'</span> <span class="k">*</span>.md
<span class="nb">sed</span> <span class="nt">-i</span> <span class="s1">'/^private\:/d'</span> <span class="k">*</span>.md
</code></pre></div></div>
<p>Affichage des dates <strong>_includes/article-list.html</strong><br />
lignes 101 à 106 AVANT</p>
<p><code class="language-plaintext highlighter-rouge">html&lt;li class="item" itemscope itemtype="http://schema.org/BlogPosting" data-tags=""&gt;
&lt;div class="item__content"&gt;</code></p>
<p>lignes APRES</p>
<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code> <span class="nt">&lt;li</span> <span class="na">class=</span><span class="s">"item"</span> <span class="na">itemscope</span> <span class="na">itemtype=</span><span class="s">"http://schema.org/BlogPosting"</span> <span class="na">data-tags=</span><span class="s">""</span><span class="nt">&gt;</span>
<span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">"item__content"</span><span class="nt">&gt;</span>```
Affichage des dates **_includes/article-info.html**
lignes 64 à 67 AVANT
```html
<span class="nt">&lt;li&gt;&lt;i</span> <span class="na">class=</span><span class="s">"far fa-calendar-alt"</span><span class="nt">&gt;&lt;/i&gt;</span> <span class="nt">&lt;span&gt;&lt;/span&gt;</span>
<span class="nt">&lt;/li&gt;</span>
</code></pre></div></div>
<p>lignes APRES</p>
<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code> <span class="nt">&lt;li&gt;</span>
<span class="nt">&lt;i</span> <span class="na">class=</span><span class="s">"far fa-calendar-alt"</span><span class="nt">&gt;&lt;/i&gt;</span> <span class="nt">&lt;span&gt;</span><span class="ni">&amp;nbsp;&amp;nbsp;</span><span class="nt">&lt;/span&gt;</span>
<span class="nt">&lt;/li&gt;</span>
</code></pre></div></div>
<h3 id="les-icônes">Les icônes</h3>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>find . -type d \( -name _site \) -prune -o -name "favicon*" -type f
</code></pre></div></div>
<p>Les nouveaux icônes</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cp</span> /srv/data/dplus//images/yannick/yannick-white16x16.ico ./assets/favicon.ico
<span class="nb">cp</span> /srv/data/dplus//images/yannick/yannick-white32x32.png ./assets/favicon-32x32.png
<span class="nb">cp</span> /srv/data/dplus//images/yannick/yannick-white16x16.png ./assets/favicon-16x16.png
<span class="nb">cp</span> /srv/data/dplus//images/yannick/yannick-white16x16.ico ./favicon.ico
</code></pre></div></div>
<blockquote>
<p>INFO :<br />
conversion ico <code class="language-plaintext highlighter-rouge">convert logo.png -define icon:auto-resize=64,48,32,16 logo.ico</code><br />
dimension <code class="language-plaintext highlighter-rouge">convert -resize 32x32 logo.png logo32x32.png</code></p>
</blockquote>
<p>Les svg</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>find . -type d \( -name _site \) -prune -o -name "*.svg" -type f./assets/images/logo/logo.svg
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>./assets/safari-pinned-tab.svg
./_includes/svg/logo.svg
</code></pre></div></div>
<p>Remplacer logo.svg</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cp</span> /srv/data/dplus//images/yannick/yannick-white.svg ./_includes/svg/logo.svg
</code></pre></div></div>
<p>Modifier le fichier <strong>about.md</strong></p>
<p>Modifier le fichier <strong>./_includes/footer.html</strong> ligne 32<br />
Remplacer “Powered by” par “Propulsé par”<br />
Modifier les fichiers markdown avec la vidéo youtube</p>
<h3 id="service-yannstatic">Service yannstatic</h3>
<p>Pour lancer le serveur <strong>yannstatic</strong> au démarrage, utilisation dun <u>service systemd</u><br />
<strong>ATTENTION!</strong> , remplacer <em>User=utilisateur</em> par votre nom dutilisateur <code class="language-plaintext highlighter-rouge">echo $USER</code><br />
Relever le chemin complet de bundle : <code class="language-plaintext highlighter-rouge">which bundle</code><strong>/home/xoyi/.rbenv/shims/bundle</strong></p>
<p>Création dun service “yannstatic” sous systemd</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo nano /etc/systemd/system/yannstatic.service
</code></pre></div></div>
<p>Contenu du fichier</p>
<div class="language-ini highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nn">[Unit]</span>
<span class="py">Description</span><span class="p">=</span><span class="s">service yannstatic</span>
<span class="py">After</span><span class="p">=</span><span class="s">network.target</span>
<span class="nn">[Service]</span>
<span class="py">Type</span><span class="p">=</span><span class="s">simple</span>
<span class="py">User</span><span class="p">=</span><span class="s">xoyi</span>
<span class="py">WorkingDirectory</span><span class="p">=</span><span class="s">/srv/data/jekyll/jekyll-TeXt-theme</span>
<span class="py">ExecStart</span><span class="p">=</span><span class="s">/usr/bin/sh /srv/data/jekyll/jekyll-TeXt-theme/yannstatic.sh</span>
<span class="py">Restart</span><span class="p">=</span><span class="s">on-abort</span>
<span class="nn">[Install]</span>
<span class="py">WantedBy</span><span class="p">=</span><span class="s">multi-user.target</span>
</code></pre></div></div>
<p>Le fichier bash <strong>/srv/data/jekyll/jekyll-TeXt-theme/yannstatic.sh</strong></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano /srv/data/jekyll/jekyll-TeXt-theme/yannstatic.sh
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd</span> /srv/data/jekyll/jekyll-TeXt-theme
/home/xoyi/.rbenv/shims/jekyll build <span class="nt">--watch</span> <span class="nt">--incremental</span>
</code></pre></div></div>
<p>Le rendre exécutable</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>chmod +x /srv/data/jekyll/jekyll-TeXt-theme/yannstatic.sh
</code></pre></div></div>
<p>Lancer le service <strong>yannstatic</strong> :</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl daemon-reload
sudo systemctl start yannstatic
</code></pre></div></div>
<p>Vérifier</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl status yannstatic
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>● yannstatic.service - service yannstatic
Loaded: loaded <span class="o">(</span>/etc/systemd/system/yannstatic.service<span class="p">;</span> enabled<span class="p">;</span> vendor preset: enabled<span class="o">)</span>
Active: active <span class="o">(</span>running<span class="o">)</span> since Mon 2020-08-03 22:49:24 CEST<span class="p">;</span> 46s ago
Main PID: 18124 <span class="o">(</span>sh<span class="o">)</span>
Tasks: 4 <span class="o">(</span>limit: 4915<span class="o">)</span>
Memory: 101.9M
CGroup: /system.slice/yannstatic.service
├─18124 /usr/bin/sh /srv/data/jekyll/jekyll-TeXt-theme/yannstatic.sh
└─18125 ruby /home/xoyi/.rbenv/versions/2.7.1/bin/jekyll build <span class="nt">--watch</span> <span class="nt">--incremental</span>
août 03 22:49:24 xoyize.xyz systemd[1]: Started service yannstatic.
août 03 22:49:27 xoyize.xyz sh[18124]: fatal: ni ceci ni aucun de ses répertoires parents n<span class="s1">'est un dépôt git : .git
août 03 22:49:28 xoyize.xyz sh[18124]: Configuration file: /srv/data/jekyll/jekyll-TeXt-theme/_config.yml
août 03 22:49:28 xoyize.xyz sh[18124]: Source: /srv/data/jekyll/jekyll-TeXt-theme
août 03 22:49:28 xoyize.xyz sh[18124]: Destination: /srv/data/jekyll/jekyll-TeXt-theme/_site
août 03 22:49:28 xoyize.xyz sh[18124]: Incremental build: enabled
août 03 22:49:28 xoyize.xyz sh[18124]: Generating...
août 03 22:49:31 xoyize.xyz sh[18124]: Jekyll Feed: Generating feed for posts
août 03 22:49:50 xoyize.xyz sh[18124]: done in 22.06 seconds.
août 03 22:49:51 xoyize.xyz sh[18124]: Auto-regeneration: enabled for '</span>/srv/data/jekyll/jekyll-TeXt-theme<span class="s1">'
</span></code></pre></div></div>
<p>Activation</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl enable yannstatic
</code></pre></div></div>
<h3 id="synchro-dossier-_site">Synchro dossier _site</h3>
<p>Le générateur de site jekyll construit un dossier _site<br />
Il faut synchroniser le dossier _site avec le serveur distant cinay.eu</p>
<p>Le dossier distant est accessible via ssh et la clé kvm-vps506197 sur le port 55034 , faire une première connexion manuelle</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh -i ~/.ssh/kvm-vps506197 -p 55034 debian@cinay.eu
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>The authenticity of host <span class="s1">'[cinay.eu]:55034 ([2001:41d0:401:3200::6e7]:55034)'</span> can<span class="s1">'t be established.
ECDSA key fingerprint is SHA256:azzqw6i92z3LQXEpIPFe5RAE2tERAr53TGvxNdzAKZ8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '</span><span class="o">[</span>cinay.eu]:55034,[2001:41d0:401:3200::6e7]:55034<span class="s1">' (ECDSA) to the list of known hosts.
Linux cinay.eu 5.6.0-2-cloud-amd64 #1 SMP Debian 5.6.14-2 (2020-06-09) x86_64
___ __ __ _ ___ ____
__ __ _ __ ___| __| / \ / / / |/ _ \|__ |
\ V /| '</span>_ <span class="se">\(</span>_-&lt;|__ <span class="se">\|</span> <span class="o">()</span> |/ _ <span class="se">\|</span> |<span class="se">\_</span>, / / /
<span class="se">\_</span>/ | .__//__/|___/ <span class="se">\_</span>_/ <span class="se">\_</span>__/|_| /_/ /_/
|_|
__ <span class="o">(</span>_<span class="o">)</span> _ _ __ _ _ _ ___ _ _
/ _|| <span class="o">||</span> <span class="s1">' \ / _` || || | _ / -_)| || |
\__||_||_||_|\__,_| \_, |(_)\___| \_,_|
|__/
Last login: Mon Aug 3 20:03:37 2020 from 193.32.126.222
debian@cinay:~$ exit
logout
Connection to cinay.eu closed.
</span></code></pre></div></div>
<p>Le script de synchronisation <code class="language-plaintext highlighter-rouge">synchro_site.sh</code></p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/bash</span>
rsync <span class="nt">-avz</span> <span class="nt">--progress</span> <span class="nt">--stats</span> <span class="nt">--human-readable</span> <span class="nt">--delete</span> <span class="nt">--rsync-path</span><span class="o">=</span><span class="s2">"sudo rsync"</span> <span class="nt">-e</span> <span class="s2">"ssh -p 55034 -i /home/xoyi/.ssh/kvm-vps506197 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"</span> /srv/data/jekyll/jekyll-TeXt-theme/_site/<span class="k">*</span> debian@cinay.eu:/var/www/webapp_yann/yann.cinay.eu_/ <span class="p">;</span> <span class="k">if</span> <span class="o">[</span> <span class="nv">$?</span> <span class="nt">-eq</span> 0 <span class="o">]</span><span class="p">;</span> <span class="k">then </span><span class="nb">echo</span> <span class="s2">"Synchronisation dossier _site/ xoyize.xyz -&gt; cinay.eu OK "</span> | systemd-cat <span class="nt">-t</span> rsync_site <span class="nt">-p</span> info <span class="p">;</span> <span class="k">else </span><span class="nb">echo</span> <span class="s2">"Synchronisation dossier _site/ xoyize.xyz -&gt; cinay.eu ERREUR"</span> | systemd-cat <span class="nt">-t</span> rsync_site <span class="nt">-p</span> emerg <span class="p">;</span> <span class="k">fi</span>
<span class="c"># Envoi d'un message (facultatif)</span>
<span class="c"># dt=$(date '+%H:%M:%S'); echo '' | mail -a "Content-Type: text/plain; charset=UTF-8" -s "Fin Synchronisation $dt" yak@xoyize.xyz</span>
</code></pre></div></div>
<h4 id="synchro-toutes-les-minutes">Synchro toutes les minutes</h4>
<p>On utilise une unité timer systemd pour lancer la <u>synchronisation toutes les minutes</u></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo nano /etc/systemd/system/synchro_site.service
</code></pre></div></div>
<div class="language-ini highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nn">[Unit]</span>
<span class="py">Description</span><span class="p">=</span><span class="s">"Rsync local distant"</span>
<span class="py">After</span><span class="p">=</span><span class="s">network.target</span>
<span class="nn">[Service]</span>
<span class="py">ExecStart</span><span class="p">=</span><span class="s">/srv/data/jekyll/jekyll-TeXt-theme/synchro_site.sh</span>
</code></pre></div></div>
<p>Unité timer avec le même nom qui définit la période dexécution du service<br />
OnCalendar=*:0/1 → Service exécuté toute les minutes (60 s)</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo nano /etc/systemd/system/synchro_site.timer
</code></pre></div></div>
<div class="language-ini highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nn">[Unit]</span>
<span class="py">Description</span><span class="p">=</span><span class="s">synchro dossier _site</span>
<span class="nn">[Timer]</span>
<span class="py">OnCalendar</span><span class="p">=</span><span class="s">*:0/1</span>
<span class="py">Unit</span><span class="p">=</span><span class="s">synchro_site.service</span>
<span class="nn">[Install]</span>
<span class="py">WantedBy</span><span class="p">=</span><span class="s">multi-user.target</span>
</code></pre></div></div>
<p>Démarrage du timer</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl start synchro_site.timer
</code></pre></div></div>
<p>Voir le fichier journal</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>journalctl -u synchro_site.service
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>août 05 17:56:00 xoyize.xyz synchro_site.sh[16734]: total size is 306.90M speedup is 3,018.74
août 05 17:56:00 xoyize.xyz systemd[1]: synchro_site.service: Succeeded.
[...]
août 05 17:58:02 xoyize.xyz synchro_site.sh[16764]: total size is 306.90M speedup is 3,018.74
août 05 17:58:02 xoyize.xyz systemd[1]: synchro_site.service: Succeeded.
</code></pre></div></div>
<p>Le timer sexécute toute les minutes , on peut lactiver</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl enable synchro_site.timer
</code></pre></div></div>
<p>Lactivité des timers</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl list-timers
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>NEXT LEFT LAST PASSED UNIT
Sun 2020-08-09 08:28:00 CEST 50s left Sun 2020-08-09 08:27:00 CEST 9s ago synchro_site.timer
</code></pre></div></div>
<p>Visualiser le journal rsync</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>journalctl -f -t rsync_site
</code></pre></div></div>
<h3 id="sauvegarde-dns-ovh">Sauvegarde DNS OVH</h3>
<p>Clé dkim xoyize.xyz carte amd</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mail._domainkey IN TXT ( "v=DKIM1;h=sha256;k=rsa;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDz4siOQ6M1yPrUWfObGFG7WAvSAEXoxqzZU1JwmjTLJtvz3tRFhdAIYSFvUCnDI2ir3/CSLcYdMx3huNp816g8P3TuQYiukhAsPm6Ib6C1L+poCaYW8KqwM0bW3tiKFVcP5Db0j9V4BecKeayrWT3GJ2lIwwvysJz0nRU6a0ADYwIDAQAB;" )
</code></pre></div></div>
</div>
<div class="d-print-none"><footer class="article__footer"><meta itemprop="dateModified" content="2020-08-06T00:00:00+02:00"><!-- start custom article footer snippet -->
<!-- end custom article footer snippet -->
<!--
<div align="right"><a type="application/rss+xml" href="/feed.xml" title="S'abonner"><i class="fa fa-rss fa-2x"></i></a>
&emsp;</div>
-->
</footer>
<div class="article__section-navigator clearfix"><div class="previous"><span>PRÉCÉDENT</span><a href="/2020/08/04/iwd-daemon-wifi.html">Wifi iwd remplace wpa_supplicant</a></div><div class="next"><span>SUIVANT</span><a href="/2020/08/08/TERMUX-Terminal-android.html">Termux - Linux sur Android</a></div></div></div>
</div>
<script>(function() {
var SOURCES = window.TEXT_VARIABLES.sources;
window.Lazyload.js(SOURCES.jquery, function() {
$(function() {
var $this ,$scroll;
var $articleContent = $('.js-article-content');
var hasSidebar = $('.js-page-root').hasClass('layout--page--sidebar');
var scroll = hasSidebar ? '.js-page-main' : 'html, body';
$scroll = $(scroll);
$articleContent.find('.highlight').each(function() {
$this = $(this);
$this.attr('data-lang', $this.find('code').attr('data-lang'));
});
$articleContent.find('h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]').each(function() {
$this = $(this);
$this.append($('<a class="anchor d-print-none" aria-hidden="true"></a>').html('<i class="fas fa-anchor"></i>'));
});
$articleContent.on('click', '.anchor', function() {
$scroll.scrollToAnchor('#' + $(this).parent().attr('id'), 400);
});
});
});
})();
</script>
</div><section class="page__comments d-print-none"></section></article><!-- start custom main bottom snippet -->
<!-- end custom main bottom snippet -->
</div>
</div></div></div></div>
</div><script>(function() {
var SOURCES = window.TEXT_VARIABLES.sources;
window.Lazyload.js(SOURCES.jquery, function() {
var $body = $('body'), $window = $(window);
var $pageRoot = $('.js-page-root'), $pageMain = $('.js-page-main');
var activeCount = 0;
function modal(options) {
var $root = this, visible, onChange, hideWhenWindowScroll = false;
var scrollTop;
function setOptions(options) {
var _options = options || {};
visible = _options.initialVisible === undefined ? false : show;
onChange = _options.onChange;
hideWhenWindowScroll = _options.hideWhenWindowScroll;
}
function init() {
setState(visible);
}
function setState(isShow) {
if (isShow === visible) {
return;
}
visible = isShow;
if (visible) {
activeCount++;
scrollTop = $(window).scrollTop() || $pageMain.scrollTop();
$root.addClass('modal--show');
$pageMain.scrollTop(scrollTop);
activeCount === 1 && ($pageRoot.addClass('show-modal'), $body.addClass('of-hidden'));
hideWhenWindowScroll && window.hasEvent('touchstart') && $window.on('scroll', hide);
$window.on('keyup', handleKeyup);
} else {
activeCount > 0 && activeCount--;
$root.removeClass('modal--show');
$window.scrollTop(scrollTop);
activeCount === 0 && ($pageRoot.removeClass('show-modal'), $body.removeClass('of-hidden'));
hideWhenWindowScroll && window.hasEvent('touchstart') && $window.off('scroll', hide);
$window.off('keyup', handleKeyup);
}
onChange && onChange(visible);
}
function show() {
setState(true);
}
function hide() {
setState(false);
}
function handleKeyup(e) {
// Char Code: 27 ESC
if (e.which === 27) {
hide();
}
}
setOptions(options);
init();
return {
show: show,
hide: hide,
$el: $root
};
}
$.fn.modal = modal;
});
})();
</script><div class="modal modal--overflow page__search-modal d-print-none js-page-search-modal"><script>
(function () {
var SOURCES = window.TEXT_VARIABLES.sources;
window.Lazyload.js(SOURCES.jquery, function() {
// search panel
var search = (window.search || (window.search = {}));
var useDefaultSearchBox = window.useDefaultSearchBox === undefined ?
true : window.useDefaultSearchBox ;
var $searchModal = $('.js-page-search-modal');
var $searchToggle = $('.js-search-toggle');
var searchModal = $searchModal.modal({ onChange: handleModalChange, hideWhenWindowScroll: true });
var modalVisible = false;
search.searchModal = searchModal;
var $searchBox = null;
var $searchInput = null;
var $searchClear = null;
function getModalVisible() {
return modalVisible;
}
search.getModalVisible = getModalVisible;
function handleModalChange(visible) {
modalVisible = visible;
if (visible) {
search.onShow && search.onShow();
useDefaultSearchBox && $searchInput[0] && $searchInput[0].focus();
} else {
search.onShow && search.onHide();
useDefaultSearchBox && $searchInput[0] && $searchInput[0].blur();
setTimeout(function() {
useDefaultSearchBox && ($searchInput.val(''), $searchBox.removeClass('not-empty'));
search.clear && search.clear();
window.pageAsideAffix && window.pageAsideAffix.refresh();
}, 400);
}
}
$searchToggle.on('click', function() {
modalVisible ? searchModal.hide() : searchModal.show();
});
// Char Code: 83 S, 191 /
$(window).on('keyup', function(e) {
if (!modalVisible && !window.isFormElement(e.target || e.srcElement) && (e.which === 83 || e.which === 191)) {
modalVisible || searchModal.show();
}
});
if (useDefaultSearchBox) {
$searchBox = $('.js-search-box');
$searchInput = $searchBox.children('input');
$searchClear = $searchBox.children('.js-icon-clear');
search.getSearchInput = function() {
return $searchInput.get(0);
};
search.getVal = function() {
return $searchInput.val();
};
search.setVal = function(val) {
$searchInput.val(val);
};
$searchInput.on('focus', function() {
$(this).addClass('focus');
});
$searchInput.on('blur', function() {
$(this).removeClass('focus');
});
$searchInput.on('input', window.throttle(function() {
var val = $(this).val();
if (val === '' || typeof val !== 'string') {
search.clear && search.clear();
} else {
$searchBox.addClass('not-empty');
search.onInputNotEmpty && search.onInputNotEmpty(val);
}
}, 400));
$searchClear.on('click', function() {
$searchInput.val(''); $searchBox.removeClass('not-empty');
search.clear && search.clear();
});
}
});
})();
</script><div class="search search--dark">
<div class="main">
<div class="search__header">Recherche</div>
<div class="search-bar">
<div class="search-box js-search-box">
<div class="search-box__icon-search"><i class="fas fa-search"></i></div>
<input id="search-input" type="text" />
<div class="search-box__icon-clear js-icon-clear">
<a><i class="fas fa-times"></i></a>
</div>
</div>
<button class="button button--theme-dark button--pill search__cancel js-search-toggle">
Annuler</button>
</div>
<div id="results-container" class="search-result js-search-result"></div>
</div>
</div>
<!-- Script pointing to search-script.js -->
<script>/*!
* Simple-Jekyll-Search
* Copyright 2015-2020, Christian Fei
* Licensed under the MIT License.
*/
(function(){
'use strict'
var _$Templater_7 = {
compile: compile,
setOptions: setOptions
}
const options = {}
options.pattern = /\{(.*?)\}/g
options.template = ''
options.middleware = function () {}
function setOptions (_options) {
options.pattern = _options.pattern || options.pattern
options.template = _options.template || options.template
if (typeof _options.middleware === 'function') {
options.middleware = _options.middleware
}
}
function compile (data) {
return options.template.replace(options.pattern, function (match, prop) {
const value = options.middleware(prop, data[prop], options.template)
if (typeof value !== 'undefined') {
return value
}
return data[prop] || match
})
}
'use strict';
function fuzzysearch (needle, haystack) {
var tlen = haystack.length;
var qlen = needle.length;
if (qlen > tlen) {
return false;
}
if (qlen === tlen) {
return needle === haystack;
}
outer: for (var i = 0, j = 0; i < qlen; i++) {
var nch = needle.charCodeAt(i);
while (j < tlen) {
if (haystack.charCodeAt(j++) === nch) {
continue outer;
}
}
return false;
}
return true;
}
var _$fuzzysearch_1 = fuzzysearch;
'use strict'
/* removed: const _$fuzzysearch_1 = require('fuzzysearch') */;
var _$FuzzySearchStrategy_5 = new FuzzySearchStrategy()
function FuzzySearchStrategy () {
this.matches = function (string, crit) {
return _$fuzzysearch_1(crit.toLowerCase(), string.toLowerCase())
}
}
'use strict'
var _$LiteralSearchStrategy_6 = new LiteralSearchStrategy()
function LiteralSearchStrategy () {
this.matches = function (str, crit) {
if (!str) return false
str = str.trim().toLowerCase()
crit = crit.trim().toLowerCase()
return crit.split(' ').filter(function (word) {
return str.indexOf(word) >= 0
}).length === crit.split(' ').length
}
}
'use strict'
var _$Repository_4 = {
put: put,
clear: clear,
search: search,
setOptions: __setOptions_4
}
/* removed: const _$FuzzySearchStrategy_5 = require('./SearchStrategies/FuzzySearchStrategy') */;
/* removed: const _$LiteralSearchStrategy_6 = require('./SearchStrategies/LiteralSearchStrategy') */;
function NoSort () {
return 0
}
const data = []
let opt = {}
opt.fuzzy = false
opt.limit = 10
opt.searchStrategy = opt.fuzzy ? _$FuzzySearchStrategy_5 : _$LiteralSearchStrategy_6
opt.sort = NoSort
opt.exclude = []
function put (data) {
if (isObject(data)) {
return addObject(data)
}
if (isArray(data)) {
return addArray(data)
}
return undefined
}
function clear () {
data.length = 0
return data
}
function isObject (obj) {
return Boolean(obj) && Object.prototype.toString.call(obj) === '[object Object]'
}
function isArray (obj) {
return Boolean(obj) && Object.prototype.toString.call(obj) === '[object Array]'
}
function addObject (_data) {
data.push(_data)
return data
}
function addArray (_data) {
const added = []
clear()
for (let i = 0, len = _data.length; i < len; i++) {
if (isObject(_data[i])) {
added.push(addObject(_data[i]))
}
}
return added
}
function search (crit) {
if (!crit) {
return []
}
return findMatches(data, crit, opt.searchStrategy, opt).sort(opt.sort)
}
function __setOptions_4 (_opt) {
opt = _opt || {}
opt.fuzzy = _opt.fuzzy || false
opt.limit = _opt.limit || 10
opt.searchStrategy = _opt.fuzzy ? _$FuzzySearchStrategy_5 : _$LiteralSearchStrategy_6
opt.sort = _opt.sort || NoSort
opt.exclude = _opt.exclude || []
}
function findMatches (data, crit, strategy, opt) {
const matches = []
for (let i = 0; i < data.length && matches.length < opt.limit; i++) {
const match = findMatchesInObject(data[i], crit, strategy, opt)
if (match) {
matches.push(match)
}
}
return matches
}
function findMatchesInObject (obj, crit, strategy, opt) {
for (const key in obj) {
if (!isExcluded(obj[key], opt.exclude) && strategy.matches(obj[key], crit)) {
return obj
}
}
}
function isExcluded (term, excludedTerms) {
for (let i = 0, len = excludedTerms.length; i < len; i++) {
const excludedTerm = excludedTerms[i]
if (new RegExp(excludedTerm).test(term)) {
return true
}
}
return false
}
/* globals ActiveXObject:false */
'use strict'
var _$JSONLoader_2 = {
load: load
}
function load (location, callback) {
const xhr = getXHR()
xhr.open('GET', location, true)
xhr.onreadystatechange = createStateChangeListener(xhr, callback)
xhr.send()
}
function createStateChangeListener (xhr, callback) {
return function () {
if (xhr.readyState === 4 && xhr.status === 200) {
try {
callback(null, JSON.parse(xhr.responseText))
} catch (err) {
callback(err, null)
}
}
}
}
function getXHR () {
return window.XMLHttpRequest ? new window.XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP')
}
'use strict'
var _$OptionsValidator_3 = function OptionsValidator (params) {
if (!validateParams(params)) {
throw new Error('-- OptionsValidator: required options missing')
}
if (!(this instanceof OptionsValidator)) {
return new OptionsValidator(params)
}
const requiredOptions = params.required
this.getRequiredOptions = function () {
return requiredOptions
}
this.validate = function (parameters) {
const errors = []
requiredOptions.forEach(function (requiredOptionName) {
if (typeof parameters[requiredOptionName] === 'undefined') {
errors.push(requiredOptionName)
}
})
return errors
}
function validateParams (params) {
if (!params) {
return false
}
return typeof params.required !== 'undefined' && params.required instanceof Array
}
}
'use strict'
var _$utils_9 = {
merge: merge,
isJSON: isJSON
}
function merge (defaultParams, mergeParams) {
const mergedOptions = {}
for (const option in defaultParams) {
mergedOptions[option] = defaultParams[option]
if (typeof mergeParams[option] !== 'undefined') {
mergedOptions[option] = mergeParams[option]
}
}
return mergedOptions
}
function isJSON (json) {
try {
if (json instanceof Object && JSON.parse(JSON.stringify(json))) {
return true
}
return false
} catch (err) {
return false
}
}
var _$src_8 = {};
(function (window) {
'use strict'
let options = {
searchInput: null,
resultsContainer: null,
json: [],
success: Function.prototype,
searchResultTemplate: '<li><a href="{url}" title="{desc}">{title}</a></li>',
templateMiddleware: Function.prototype,
sortMiddleware: function () {
return 0
},
noResultsText: 'No results found',
limit: 10,
fuzzy: false,
debounceTime: null,
exclude: []
}
let debounceTimerHandle
const debounce = function (func, delayMillis) {
if (delayMillis) {
clearTimeout(debounceTimerHandle)
debounceTimerHandle = setTimeout(func, delayMillis)
} else {
func.call()
}
}
const requiredOptions = ['searchInput', 'resultsContainer', 'json']
/* removed: const _$Templater_7 = require('./Templater') */;
/* removed: const _$Repository_4 = require('./Repository') */;
/* removed: const _$JSONLoader_2 = require('./JSONLoader') */;
const optionsValidator = _$OptionsValidator_3({
required: requiredOptions
})
/* removed: const _$utils_9 = require('./utils') */;
window.SimpleJekyllSearch = function (_options) {
const errors = optionsValidator.validate(_options)
if (errors.length > 0) {
throwError('You must specify the following required options: ' + requiredOptions)
}
options = _$utils_9.merge(options, _options)
_$Templater_7.setOptions({
template: options.searchResultTemplate,
middleware: options.templateMiddleware
})
_$Repository_4.setOptions({
fuzzy: options.fuzzy,
limit: options.limit,
sort: options.sortMiddleware,
exclude: options.exclude
})
if (_$utils_9.isJSON(options.json)) {
initWithJSON(options.json)
} else {
initWithURL(options.json)
}
const rv = {
search: search
}
typeof options.success === 'function' && options.success.call(rv)
return rv
}
function initWithJSON (json) {
_$Repository_4.put(json)
registerInput()
}
function initWithURL (url) {
_$JSONLoader_2.load(url, function (err, json) {
if (err) {
throwError('failed to get JSON (' + url + ')')
}
initWithJSON(json)
})
}
function emptyResultsContainer () {
options.resultsContainer.innerHTML = ''
}
function appendToResultsContainer (text) {
options.resultsContainer.innerHTML += text
}
function registerInput () {
options.searchInput.addEventListener('input', function (e) {
if (isWhitelistedKey(e.which)) {
emptyResultsContainer()
debounce(function () { search(e.target.value) }, options.debounceTime)
}
})
}
function search (query) {
if (isValidQuery(query)) {
emptyResultsContainer()
render(_$Repository_4.search(query), query)
}
}
function render (results, query) {
const len = results.length
if (len === 0) {
return appendToResultsContainer(options.noResultsText)
}
for (let i = 0; i < len; i++) {
results[i].query = query
appendToResultsContainer(_$Templater_7.compile(results[i]))
}
}
function isValidQuery (query) {
return query && query.length > 0
}
function isWhitelistedKey (key) {
return [13, 16, 20, 37, 38, 39, 40, 91].indexOf(key) === -1
}
function throwError (message) {
throw new Error('SimpleJekyllSearch --- ' + message)
}
})(window)
}());
</script>
<!-- Configuration -->
<script>
SimpleJekyllSearch({
searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('results-container'),
noResultsText: '<p>Aucun résultat!</p>',
json: '/search.json',
searchResultTemplate: '<li><a href="{url}">{date}&nbsp;{title}</a>&nbsp;(Création {create})</li>'
})
</script>
</div></div>
<script>(function() {
var SOURCES = window.TEXT_VARIABLES.sources;
window.Lazyload.js(SOURCES.jquery, function() {
function scrollToAnchor(anchor, duration, callback) {
var $root = this;
$root.animate({ scrollTop: $(anchor).position().top }, duration, function() {
window.history.replaceState(null, '', window.location.href.split('#')[0] + anchor);
callback && callback();
});
}
$.fn.scrollToAnchor = scrollToAnchor;
});
})();
(function() {
var SOURCES = window.TEXT_VARIABLES.sources;
window.Lazyload.js(SOURCES.jquery, function() {
function affix(options) {
var $root = this, $window = $(window), $scrollTarget, $scroll,
offsetBottom = 0, scrollTarget = window, scroll = window.document, disabled = false, isOverallScroller = true,
rootTop, rootLeft, rootHeight, scrollBottom, rootBottomTop,
hasInit = false, curState;
function setOptions(options) {
var _options = options || {};
_options.offsetBottom && (offsetBottom = _options.offsetBottom);
_options.scrollTarget && (scrollTarget = _options.scrollTarget);
_options.scroll && (scroll = _options.scroll);
_options.disabled !== undefined && (disabled = _options.disabled);
$scrollTarget = $(scrollTarget);
isOverallScroller = window.isOverallScroller($scrollTarget[0]);
$scroll = $(scroll);
}
function preCalc() {
top();
rootHeight = $root.outerHeight();
rootTop = $root.offset().top + (isOverallScroller ? 0 : $scrollTarget.scrollTop());
rootLeft = $root.offset().left;
}
function calc(needPreCalc) {
needPreCalc && preCalc();
scrollBottom = $scroll.outerHeight() - offsetBottom - rootHeight;
rootBottomTop = scrollBottom - rootTop;
}
function top() {
if (curState !== 'top') {
$root.removeClass('fixed').css({
left: 0,
top: 0
});
curState = 'top';
}
}
function fixed() {
if (curState !== 'fixed') {
$root.addClass('fixed').css({
left: rootLeft + 'px',
top: 0
});
curState = 'fixed';
}
}
function bottom() {
if (curState !== 'bottom') {
$root.removeClass('fixed').css({
left: 0,
top: rootBottomTop + 'px'
});
curState = 'bottom';
}
}
function setState() {
var scrollTop = $scrollTarget.scrollTop();
if (scrollTop >= rootTop && scrollTop <= scrollBottom) {
fixed();
} else if (scrollTop < rootTop) {
top();
} else {
bottom();
}
}
function init() {
if(!hasInit) {
var interval, timeout;
calc(true); setState();
// run calc every 100 millisecond
interval = setInterval(function() {
calc();
}, 100);
timeout = setTimeout(function() {
clearInterval(interval);
}, 45000);
window.pageLoad.then(function() {
setTimeout(function() {
clearInterval(interval);
clearTimeout(timeout);
}, 3000);
});
$scrollTarget.on('scroll', function() {
disabled || setState();
});
$window.on('resize', function() {
disabled || (calc(true), setState());
});
hasInit = true;
}
}
setOptions(options);
if (!disabled) {
init();
}
$window.on('resize', window.throttle(function() {
init();
}, 200));
return {
setOptions: setOptions,
refresh: function() {
calc(true, { animation: false }); setState();
}
};
}
$.fn.affix = affix;
});
})();
(function() {
var SOURCES = window.TEXT_VARIABLES.sources;
window.Lazyload.js(SOURCES.jquery, function() {
function toc(options) {
var $root = this, $window = $(window), $scrollTarget, $scroller, $tocUl = $('<ul class="toc toc--ellipsis"></ul>'), $tocLi, $headings, $activeLast, $activeCur,
selectors = 'h1,h2,h3', container = 'body', scrollTarget = window, scroller = 'html, body', disabled = false,
headingsPos, scrolling = false, hasRendered = false, hasInit = false;
function setOptions(options) {
var _options = options || {};
_options.selectors && (selectors = _options.selectors);
_options.container && (container = _options.container);
_options.scrollTarget && (scrollTarget = _options.scrollTarget);
_options.scroller && (scroller = _options.scroller);
_options.disabled !== undefined && (disabled = _options.disabled);
$headings = $(container).find(selectors).filter('[id]');
$scrollTarget = $(scrollTarget);
$scroller = $(scroller);
}
function calc() {
headingsPos = [];
$headings.each(function() {
headingsPos.push(Math.floor($(this).position().top));
});
}
function setState(element, disabled) {
var scrollTop = $scrollTarget.scrollTop(), i;
if (disabled || !headingsPos || headingsPos.length < 1) { return; }
if (element) {
$activeCur = element;
} else {
for (i = 0; i < headingsPos.length; i++) {
if (scrollTop >= headingsPos[i]) {
$activeCur = $tocLi.eq(i);
} else {
$activeCur || ($activeCur = $tocLi.eq(i));
break;
}
}
}
$activeLast && $activeLast.removeClass('active');
($activeLast = $activeCur).addClass('active');
}
function render() {
if(!hasRendered) {
$root.append($tocUl);
$headings.each(function() {
var $this = $(this);
$tocUl.append($('<li></li>').addClass('toc-' + $this.prop('tagName').toLowerCase())
.append($('<a></a>').text($this.text()).attr('href', '#' + $this.prop('id'))));
});
$tocLi = $tocUl.children('li');
$tocUl.on('click', 'a', function(e) {
e.preventDefault();
var $this = $(this);
scrolling = true;
setState($this.parent());
$scroller.scrollToAnchor($this.attr('href'), 400, function() {
scrolling = false;
});
});
}
hasRendered = true;
}
function init() {
var interval, timeout;
if(!hasInit) {
render(); calc(); setState(null, scrolling);
// run calc every 100 millisecond
interval = setInterval(function() {
calc();
}, 100);
timeout = setTimeout(function() {
clearInterval(interval);
}, 45000);
window.pageLoad.then(function() {
setTimeout(function() {
clearInterval(interval);
clearTimeout(timeout);
}, 3000);
});
$scrollTarget.on('scroll', function() {
disabled || setState(null, scrolling);
});
$window.on('resize', window.throttle(function() {
if (!disabled) {
render(); calc(); setState(null, scrolling);
}
}, 100));
}
hasInit = true;
}
setOptions(options);
if (!disabled) {
init();
}
$window.on('resize', window.throttle(function() {
init();
}, 200));
return {
setOptions: setOptions
};
}
$.fn.toc = toc;
});
})();
/*(function () {
})();*/
</script><script>
/* toc must before affix, since affix need to konw toc' height. */(function() {
var SOURCES = window.TEXT_VARIABLES.sources;
var TOC_SELECTOR = window.TEXT_VARIABLES.site.toc.selectors;
window.Lazyload.js(SOURCES.jquery, function() {
var $window = $(window);
var $articleContent = $('.js-article-content');
var $tocRoot = $('.js-toc-root'), $col2 = $('.js-col-aside');
var toc;
var tocDisabled = false;
var hasSidebar = $('.js-page-root').hasClass('layout--page--sidebar');
var hasToc = $articleContent.find(TOC_SELECTOR).length > 0;
function disabled() {
return $col2.css('display') === 'none' || !hasToc;
}
tocDisabled = disabled();
toc = $tocRoot.toc({
selectors: TOC_SELECTOR,
container: $articleContent,
scrollTarget: hasSidebar ? '.js-page-main' : null,
scroller: hasSidebar ? '.js-page-main' : null,
disabled: tocDisabled
});
$window.on('resize', window.throttle(function() {
tocDisabled = disabled();
toc && toc.setOptions({
disabled: tocDisabled
});
}, 100));
});
})();
(function() {
var SOURCES = window.TEXT_VARIABLES.sources;
window.Lazyload.js(SOURCES.jquery, function() {
var $window = $(window), $pageFooter = $('.js-page-footer');
var $pageAside = $('.js-page-aside');
var affix;
var tocDisabled = false;
var hasSidebar = $('.js-page-root').hasClass('layout--page--sidebar');
affix = $pageAside.affix({
offsetBottom: $pageFooter.outerHeight(),
scrollTarget: hasSidebar ? '.js-page-main' : null,
scroller: hasSidebar ? '.js-page-main' : null,
scroll: hasSidebar ? $('.js-page-main').children() : null,
disabled: tocDisabled
});
$window.on('resize', window.throttle(function() {
affix && affix.setOptions({
disabled: tocDisabled
});
}, 100));
window.pageAsideAffix = affix;
});
})();
</script><!---->
</div>
<script>(function () {
var $root = document.getElementsByClassName('root')[0];
if (window.hasEvent('touchstart')) {
$root.dataset.isTouch = true;
document.addEventListener('touchstart', function(){}, false);
}
})();
</script>
</body>
</html>