From de6a66b068b9aa19df81590f6a6a48f7899a682b Mon Sep 17 00:00:00 2001 From: Odair M <odairmario45@gmail.com> Date: Thu, 12 Jan 2023 22:31:36 -0300 Subject: [PATCH] feat(Bamemetals): add recover system doc --- .pre-commit-config.yaml | 31 ++ .readthedocs.yaml | 14 + CHANGELOG.md | 15 + LICENSE | 21 + docs/Makefile => Makefile | 0 Pipfile | 15 + Pipfile.lock | 452 +++++++++++++++++++ README.md | 41 ++ README.rst | 9 - cz.yaml | 4 + docs/make.bat | 35 -- docs/source/api.rst | 7 - docs/source/conf.py | 35 -- docs/source/index.rst | 22 - docs/source/usage.rst | 34 -- lumache.py | 23 - pyproject.toml | 8 - requirements.txt | 35 ++ scripts/generate-requeriments.sh | 2 + source/_static/.gitkeep | 0 source/_templates/.gitkeep | 0 source/conf.py | 43 ++ source/index.rst | 23 + source/pages/.gitkeep | 0 source/pages/baremetals.rst | 746 +++++++++++++++++++++++++++++++ 25 files changed, 1442 insertions(+), 173 deletions(-) create mode 100644 .pre-commit-config.yaml create mode 100644 .readthedocs.yaml create mode 100644 CHANGELOG.md create mode 100644 LICENSE rename docs/Makefile => Makefile (100%) create mode 100644 Pipfile create mode 100644 Pipfile.lock create mode 100644 README.md delete mode 100644 README.rst create mode 100644 cz.yaml delete mode 100644 docs/make.bat delete mode 100644 docs/source/api.rst delete mode 100644 docs/source/conf.py delete mode 100644 docs/source/index.rst delete mode 100644 docs/source/usage.rst delete mode 100644 lumache.py delete mode 100644 pyproject.toml create mode 100644 requirements.txt create mode 100755 scripts/generate-requeriments.sh create mode 100644 source/_static/.gitkeep create mode 100644 source/_templates/.gitkeep create mode 100644 source/conf.py create mode 100644 source/index.rst create mode 100644 source/pages/.gitkeep create mode 100644 source/pages/baremetals.rst diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..cf124fd --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,31 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-json + - id: check-merge-conflict + - id: check-added-large-files + - id: check-symlinks + - id: detect-private-key + - repo: https://github.com/commitizen-tools/commitizen + rev: v2.37.0 + hooks: + - id: commitizen + - id: commitizen-branch + stages: [push] + - repo: https://github.com/psf/black + rev: 22.10.0 + hooks: + - id: black +# - repo: local +# hooks: +# - id: pipenv-generetate-requirements +# name: Generate requirements.txt +# description: This hook generate the requirements.txt based on pipfile +# entry: scripts/generate-requeriments.sh +# language: script +# files: ^Pipfile(\.lock)?$ +# stages: [merge-commit, push, prepare-commit-msg] diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..cbf2338 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,14 @@ +version: 2 + +build: + os: ubuntu-20.04 + tools: + python: "3.10" +python: + install: + - requirements: ./requirements.txt +sphinx: + configuration: source/conf.py +formats: + - pdf + - epub diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..9e980fa --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,15 @@ +## 0.2.0 (2022-12-07) + +### Feat + +- **Conf**: update conf + +### Fix + +- fix requeriments + +## 0.1.0 (2022-11-03) + +### Feat + +- **build**: add .gitkeep on empty directories diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..00d1760 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 C3SL + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/docs/Makefile b/Makefile similarity index 100% rename from docs/Makefile rename to Makefile diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..38ce1bd --- /dev/null +++ b/Pipfile @@ -0,0 +1,15 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +sphinx = "*" +sphinx-rtd-theme = "*" +commitizen = "*" +pre-commit = "*" + +[dev-packages] + +[requires] +python_version = "3.10" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..94b8483 --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,452 @@ +{ + "_meta": { + "hash": { + "sha256": "4ed80d9f8668f4924a35f35bed2ce986b08bc848c0caf2a82e99ab903fb70ad6" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.10" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "alabaster": { + "hashes": [ + "sha256:446438bdcca0e05bd45ea2de1668c1d9b032e1a9154c2c259092d77031ddd359", + "sha256:a661d72d58e6ea8a57f7a86e37d86716863ee5e92788398526d58b26a4e4dc02" + ], + "version": "==0.7.12" + }, + "argcomplete": { + "hashes": [ + "sha256:6372ad78c89d662035101418ae253668445b391755cfe94ea52f1b9d22425b20", + "sha256:cffa11ea77999bb0dd27bb25ff6dc142a6796142f68d45b1a26b11f58724561e" + ], + "markers": "python_version >= '3.6'", + "version": "==2.0.0" + }, + "babel": { + "hashes": [ + "sha256:1ad3eca1c885218f6dce2ab67291178944f810a10a9b5f3cb8382a5a232b64fe", + "sha256:5ef4b3226b0180dedded4229651c8b0e1a3a6a2837d45a073272f313e4cf97f6" + ], + "markers": "python_version >= '3.6'", + "version": "==2.11.0" + }, + "certifi": { + "hashes": [ + "sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14", + "sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382" + ], + "markers": "python_version >= '3.6'", + "version": "==2022.9.24" + }, + "cfgv": { + "hashes": [ + "sha256:c6a0883f3917a037485059700b9e75da2464e6c27051014ad85ba6aaa5884426", + "sha256:f5a830efb9ce7a445376bb66ec94c638a9787422f96264c98edc6bdeed8ab736" + ], + "markers": "python_full_version >= '3.6.1'", + "version": "==3.3.1" + }, + "charset-normalizer": { + "hashes": [ + "sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845", + "sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f" + ], + "markers": "python_version >= '3.6'", + "version": "==2.1.1" + }, + "colorama": { + "hashes": [ + "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", + "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6'", + "version": "==0.4.6" + }, + "commitizen": { + "hashes": [ + "sha256:6de59b76278c66585883d9173538b66e7a233e375e1a1a5c2e78592efa769122", + "sha256:c8a0df910e7360bc901be93e6bd230737824e6500800d80b443bb1e19024c6c8" + ], + "index": "pypi", + "version": "==2.37.0" + }, + "decli": { + "hashes": [ + "sha256:d3207bc02d0169bf6ed74ccca09ce62edca0eb25b0ebf8bf4ae3fb8333e15ca0", + "sha256:f2cde55034a75c819c630c7655a844c612f2598c42c21299160465df6ad463ad" + ], + "markers": "python_version >= '3.6'", + "version": "==0.5.2" + }, + "distlib": { + "hashes": [ + "sha256:14bad2d9b04d3a36127ac97f30b12a19268f211063d8f8ee4f47108896e11b46", + "sha256:f35c4b692542ca110de7ef0bea44d73981caeb34ca0b9b6b2e6d7790dda8f80e" + ], + "version": "==0.3.6" + }, + "docutils": { + "hashes": [ + "sha256:686577d2e4c32380bb50cbb22f575ed742d58168cee37e99117a854bcd88f125", + "sha256:cf316c8370a737a022b72b56874f6602acf974a37a9fba42ec2876387549fc61" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==0.17.1" + }, + "filelock": { + "hashes": [ + "sha256:55447caa666f2198c5b6b13a26d2084d26fa5b115c00d065664b2124680c4edc", + "sha256:617eb4e5eedc82fc5f47b6d61e4d11cb837c56cb4544e39081099fa17ad109d4" + ], + "markers": "python_version >= '3.7'", + "version": "==3.8.0" + }, + "identify": { + "hashes": [ + "sha256:48b7925fe122720088aeb7a6c34f17b27e706b72c61070f27fe3789094233440", + "sha256:7a214a10313b9489a0d61467db2856ae8d0b8306fc923e03a9effa53d8aedc58" + ], + "markers": "python_version >= '3.7'", + "version": "==2.5.8" + }, + "idna": { + "hashes": [ + "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4", + "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2" + ], + "markers": "python_version >= '3.5'", + "version": "==3.4" + }, + "imagesize": { + "hashes": [ + "sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b", + "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==1.4.1" + }, + "jinja2": { + "hashes": [ + "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852", + "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61" + ], + "markers": "python_version >= '3.7'", + "version": "==3.1.2" + }, + "markupsafe": { + "hashes": [ + "sha256:0212a68688482dc52b2d45013df70d169f542b7394fc744c02a57374a4207003", + "sha256:089cf3dbf0cd6c100f02945abeb18484bd1ee57a079aefd52cffd17fba910b88", + "sha256:10c1bfff05d95783da83491be968e8fe789263689c02724e0c691933c52994f5", + "sha256:33b74d289bd2f5e527beadcaa3f401e0df0a89927c1559c8566c066fa4248ab7", + "sha256:3799351e2336dc91ea70b034983ee71cf2f9533cdff7c14c90ea126bfd95d65a", + "sha256:3ce11ee3f23f79dbd06fb3d63e2f6af7b12db1d46932fe7bd8afa259a5996603", + "sha256:421be9fbf0ffe9ffd7a378aafebbf6f4602d564d34be190fc19a193232fd12b1", + "sha256:43093fb83d8343aac0b1baa75516da6092f58f41200907ef92448ecab8825135", + "sha256:46d00d6cfecdde84d40e572d63735ef81423ad31184100411e6e3388d405e247", + "sha256:4a33dea2b688b3190ee12bd7cfa29d39c9ed176bda40bfa11099a3ce5d3a7ac6", + "sha256:4b9fe39a2ccc108a4accc2676e77da025ce383c108593d65cc909add5c3bd601", + "sha256:56442863ed2b06d19c37f94d999035e15ee982988920e12a5b4ba29b62ad1f77", + "sha256:671cd1187ed5e62818414afe79ed29da836dde67166a9fac6d435873c44fdd02", + "sha256:694deca8d702d5db21ec83983ce0bb4b26a578e71fbdbd4fdcd387daa90e4d5e", + "sha256:6a074d34ee7a5ce3effbc526b7083ec9731bb3cbf921bbe1d3005d4d2bdb3a63", + "sha256:6d0072fea50feec76a4c418096652f2c3238eaa014b2f94aeb1d56a66b41403f", + "sha256:6fbf47b5d3728c6aea2abb0589b5d30459e369baa772e0f37a0320185e87c980", + "sha256:7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b", + "sha256:86b1f75c4e7c2ac2ccdaec2b9022845dbb81880ca318bb7a0a01fbf7813e3812", + "sha256:8dc1c72a69aa7e082593c4a203dcf94ddb74bb5c8a731e4e1eb68d031e8498ff", + "sha256:8e3dcf21f367459434c18e71b2a9532d96547aef8a871872a5bd69a715c15f96", + "sha256:8e576a51ad59e4bfaac456023a78f6b5e6e7651dcd383bcc3e18d06f9b55d6d1", + "sha256:96e37a3dc86e80bf81758c152fe66dbf60ed5eca3d26305edf01892257049925", + "sha256:97a68e6ada378df82bc9f16b800ab77cbf4b2fada0081794318520138c088e4a", + "sha256:99a2a507ed3ac881b975a2976d59f38c19386d128e7a9a18b7df6fff1fd4c1d6", + "sha256:a49907dd8420c5685cfa064a1335b6754b74541bbb3706c259c02ed65b644b3e", + "sha256:b09bf97215625a311f669476f44b8b318b075847b49316d3e28c08e41a7a573f", + "sha256:b7bd98b796e2b6553da7225aeb61f447f80a1ca64f41d83612e6139ca5213aa4", + "sha256:b87db4360013327109564f0e591bd2a3b318547bcef31b468a92ee504d07ae4f", + "sha256:bcb3ed405ed3222f9904899563d6fc492ff75cce56cba05e32eff40e6acbeaa3", + "sha256:d4306c36ca495956b6d568d276ac11fdd9c30a36f1b6eb928070dc5360b22e1c", + "sha256:d5ee4f386140395a2c818d149221149c54849dfcfcb9f1debfe07a8b8bd63f9a", + "sha256:dda30ba7e87fbbb7eab1ec9f58678558fd9a6b8b853530e176eabd064da81417", + "sha256:e04e26803c9c3851c931eac40c695602c6295b8d432cbe78609649ad9bd2da8a", + "sha256:e1c0b87e09fa55a220f058d1d49d3fb8df88fbfab58558f1198e08c1e1de842a", + "sha256:e72591e9ecd94d7feb70c1cbd7be7b3ebea3f548870aa91e2732960fa4d57a37", + "sha256:e8c843bbcda3a2f1e3c2ab25913c80a3c5376cd00c6e8c4a86a89a28c8dc5452", + "sha256:efc1913fd2ca4f334418481c7e595c00aad186563bbc1ec76067848c7ca0a933", + "sha256:f121a1420d4e173a5d96e47e9a0c0dcff965afdf1626d28de1460815f7c4ee7a", + "sha256:fc7b548b17d238737688817ab67deebb30e8073c95749d55538ed473130ec0c7" + ], + "markers": "python_version >= '3.7'", + "version": "==2.1.1" + }, + "nodeenv": { + "hashes": [ + "sha256:27083a7b96a25f2f5e1d8cb4b6317ee8aeda3bdd121394e5ac54e498028a042e", + "sha256:e0e7f7dfb85fc5394c6fe1e8fa98131a2473e04311a45afb6508f7cf1836fa2b" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6'", + "version": "==1.7.0" + }, + "packaging": { + "hashes": [ + "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb", + "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522" + ], + "markers": "python_version >= '3.6'", + "version": "==21.3" + }, + "platformdirs": { + "hashes": [ + "sha256:027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788", + "sha256:58c8abb07dcb441e6ee4b11d8df0ac856038f944ab98b7be6b27b2a3c7feef19" + ], + "markers": "python_version >= '3.7'", + "version": "==2.5.2" + }, + "pre-commit": { + "hashes": [ + "sha256:51a5ba7c480ae8072ecdb6933df22d2f812dc897d5fe848778116129a681aac7", + "sha256:a978dac7bc9ec0bcee55c18a277d553b0f419d259dadb4b9418ff2d00eb43959" + ], + "index": "pypi", + "version": "==2.20.0" + }, + "prompt-toolkit": { + "hashes": [ + "sha256:9696f386133df0fc8ca5af4895afe5d78f5fcfe5258111c2a79a1c3e41ffa96d", + "sha256:9ada952c9d1787f52ff6d5f3484d0b4df8952787c087edf6a1f7c2cb1ea88148" + ], + "markers": "python_full_version >= '3.6.2'", + "version": "==3.0.31" + }, + "pygments": { + "hashes": [ + "sha256:56a8508ae95f98e2b9bdf93a6be5ae3f7d8af858b43e02c5a2ff083726be40c1", + "sha256:f643f331ab57ba3c9d89212ee4a2dabc6e94f117cf4eefde99a0574720d14c42" + ], + "markers": "python_version >= '3.6'", + "version": "==2.13.0" + }, + "pyparsing": { + "hashes": [ + "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb", + "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc" + ], + "markers": "python_full_version >= '3.6.8'", + "version": "==3.0.9" + }, + "pytz": { + "hashes": [ + "sha256:222439474e9c98fced559f1709d89e6c9cbf8d79c794ff3eb9f8800064291427", + "sha256:e89512406b793ca39f5971bc999cc538ce125c0e51c27941bef4568b460095e2" + ], + "version": "==2022.6" + }, + "pyyaml": { + "hashes": [ + "sha256:01b45c0191e6d66c470b6cf1b9531a771a83c1c4208272ead47a3ae4f2f603bf", + "sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293", + "sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b", + "sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57", + "sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b", + "sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4", + "sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07", + "sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba", + "sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9", + "sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287", + "sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513", + "sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0", + "sha256:432557aa2c09802be39460360ddffd48156e30721f5e8d917f01d31694216782", + "sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0", + "sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92", + "sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f", + "sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2", + "sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc", + "sha256:81957921f441d50af23654aa6c5e5eaf9b06aba7f0a19c18a538dc7ef291c5a1", + "sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c", + "sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86", + "sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4", + "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c", + "sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34", + "sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b", + "sha256:afa17f5bc4d1b10afd4466fd3a44dc0e245382deca5b3c353d8b757f9e3ecb8d", + "sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c", + "sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb", + "sha256:bfaef573a63ba8923503d27530362590ff4f576c626d86a9fed95822a8255fd7", + "sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737", + "sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3", + "sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d", + "sha256:d4b0ba9512519522b118090257be113b9468d804b19d63c71dbcf4a48fa32358", + "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53", + "sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78", + "sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803", + "sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a", + "sha256:dbad0e9d368bb989f4515da330b88a057617d16b6a8245084f1b05400f24609f", + "sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174", + "sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5" + ], + "markers": "python_version >= '3.6'", + "version": "==6.0" + }, + "questionary": { + "hashes": [ + "sha256:600d3aefecce26d48d97eee936fdb66e4bc27f934c3ab6dd1e292c4f43946d90", + "sha256:fecfcc8cca110fda9d561cb83f1e97ecbb93c613ff857f655818839dac74ce90" + ], + "markers": "python_version >= '3.6' and python_version < '4.0'", + "version": "==1.10.0" + }, + "requests": { + "hashes": [ + "sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983", + "sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349" + ], + "markers": "python_version >= '3.7' and python_version < '4.0'", + "version": "==2.28.1" + }, + "setuptools": { + "hashes": [ + "sha256:512e5536220e38146176efb833d4a62aa726b7bbff82cfbc8ba9eaa3996e0b17", + "sha256:f62ea9da9ed6289bfe868cd6845968a2c854d1427f8548d52cae02a42b4f0356" + ], + "markers": "python_version >= '3.7'", + "version": "==65.5.0" + }, + "snowballstemmer": { + "hashes": [ + "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1", + "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a" + ], + "version": "==2.2.0" + }, + "sphinx": { + "hashes": [ + "sha256:060ca5c9f7ba57a08a1219e547b269fadf125ae25b06b9fa7f66768efb652d6d", + "sha256:51026de0a9ff9fc13c05d74913ad66047e104f56a129ff73e174eb5c3ee794b5" + ], + "index": "pypi", + "version": "==5.3.0" + }, + "sphinx-rtd-theme": { + "hashes": [ + "sha256:36da4267c804b98197419df8aa415d245449b8945301fce8c961038e0ba79ec5", + "sha256:6e20f00f62b2c05434a33c5116bc3348a41ca94af03d3d7d1714c63457073bb3" + ], + "index": "pypi", + "version": "==1.1.0" + }, + "sphinxcontrib-applehelp": { + "hashes": [ + "sha256:806111e5e962be97c29ec4c1e7fe277bfd19e9652fb1a4392105b43e01af885a", + "sha256:a072735ec80e7675e3f432fcae8610ecf509c5f1869d17e2eecff44389cdbc58" + ], + "markers": "python_version >= '3.5'", + "version": "==1.0.2" + }, + "sphinxcontrib-devhelp": { + "hashes": [ + "sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e", + "sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4" + ], + "markers": "python_version >= '3.5'", + "version": "==1.0.2" + }, + "sphinxcontrib-htmlhelp": { + "hashes": [ + "sha256:d412243dfb797ae3ec2b59eca0e52dac12e75a241bf0e4eb861e450d06c6ed07", + "sha256:f5f8bb2d0d629f398bf47d0d69c07bc13b65f75a81ad9e2f71a63d4b7a2f6db2" + ], + "markers": "python_version >= '3.6'", + "version": "==2.0.0" + }, + "sphinxcontrib-jsmath": { + "hashes": [ + "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178", + "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8" + ], + "markers": "python_version >= '3.5'", + "version": "==1.0.1" + }, + "sphinxcontrib-qthelp": { + "hashes": [ + "sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72", + "sha256:bd9fc24bcb748a8d51fd4ecaade681350aa63009a347a8c14e637895444dfab6" + ], + "markers": "python_version >= '3.5'", + "version": "==1.0.3" + }, + "sphinxcontrib-serializinghtml": { + "hashes": [ + "sha256:352a9a00ae864471d3a7ead8d7d79f5fc0b57e8b3f95e9867eb9eb28999b92fd", + "sha256:aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952" + ], + "markers": "python_version >= '3.5'", + "version": "==1.1.5" + }, + "termcolor": { + "hashes": [ + "sha256:91dd04fdf661b89d7169cefd35f609b19ca931eb033687eaa647cef1ff177c49", + "sha256:b80df54667ce4f48c03fe35df194f052dc27a541ebbf2544e4d6b47b5d6949c4" + ], + "markers": "python_version >= '3.7'", + "version": "==2.1.0" + }, + "toml": { + "hashes": [ + "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b", + "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f" + ], + "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2'", + "version": "==0.10.2" + }, + "tomlkit": { + "hashes": [ + "sha256:07de26b0d8cfc18f871aec595fda24d95b08fef89d147caa861939f37230bf4b", + "sha256:71b952e5721688937fb02cf9d354dbcf0785066149d2855e44531ebdd2b65d73" + ], + "markers": "python_version >= '3.6'", + "version": "==0.11.6" + }, + "typing-extensions": { + "hashes": [ + "sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa", + "sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e" + ], + "markers": "python_version >= '3.7'", + "version": "==4.4.0" + }, + "urllib3": { + "hashes": [ + "sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e", + "sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4.0'", + "version": "==1.26.12" + }, + "virtualenv": { + "hashes": [ + "sha256:186ca84254abcbde98180fd17092f9628c5fe742273c02724972a1d8a2035108", + "sha256:530b850b523c6449406dfba859d6345e48ef19b8439606c5d74d7d3c9e14d76e" + ], + "markers": "python_version >= '3.6'", + "version": "==20.16.6" + }, + "wcwidth": { + "hashes": [ + "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784", + "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83" + ], + "version": "==0.2.5" + } + }, + "develop": {} +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..4878561 --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# Template Read the docs +Este repositório server de template para documentação do readthedocs do C3SL +[docs](docs.c3sl.ufpr.br). + +[[_TOC_]] + +# Como começar +O primeiro passo é realizar o folk do template e depois clonar o folk. + +Após clonar, edite a documentação localizada em `sources` e quando terminar faça push para o gitlab +e link no [docs](docs.c3sl.ufpr.br). + + +# Organização do repositório +O repositório é dedicado a documentação e esta orgazanizado da seguinte maneira: + * `build/` Diretório onde os arquivos compilados vão. + * `cz.yaml` Arquivo de configuração do commitizen + * `.git` Diretório de configuração do git + * `.gitignore`Arquivo com padrões de nomes que o git deve ignorar ao realizar `git add` ou `git + stage` + * `Makefile` Makefile para fazer o build da documentação, resultado vai para o diretório `build` + * `Pipfile` Arquivo do pipenv para criar ambiente do python para fazer build + * `Pipfile.lock` Arquivo do pipenv para criar ambiente do python para fazer build + * `.pre-commit-config.yaml` Arquivo de configuração do pre-commit + * `README.md` arquivo de readme do repositório. + * `.readthedocs.yaml` Arquivo de configuração do readthedocs + * `requirements.txt` Arquivos com listas de modulos python para fazer build da documentação, deve + ser igual ao `Pipfile` + * `LICENSE` arquivo de licença + * `.gitlab-ci.yml` Arquivo do Gitlab CI + * `scripts/` Diretório com scripts variados. + * `generate-requeriments.sh` Script que gera o arquivo `requirements.txt` a partir do `Pipfile`. + * `source/` Diretório da documentação. + * `conf.py` Arquivo de configuração do sphinx + * `index.rst` Primeira página da documentação + * `pages/` Diretório com as páginas da documentação + * `quickstart-rst.rst` Página com dicas de rst com sphinx + * `quickstart-conf.rst` Página com dicas de configuração do `conf.py` + * `quickstart-rdt.rst` Página de como incluir um repositório em [docs](docs.c3sl.ufpr.br) + * `_static/` Diretório para armazenar arquivos estáticos, como imagens, gifs e etc. + * `_templates/` Diretório para armazenar estilização das páginas, css, html e etc. diff --git a/README.rst b/README.rst deleted file mode 100644 index 07eac7f..0000000 --- a/README.rst +++ /dev/null @@ -1,9 +0,0 @@ -Template for the Read the Docs tutorial -======================================= - -This GitHub template includes fictional Python library -with some basic Sphinx docs. - -Read the tutorial here: - -https://docs.readthedocs.io/en/stable/tutorial/ diff --git a/cz.yaml b/cz.yaml new file mode 100644 index 0000000..67604a0 --- /dev/null +++ b/cz.yaml @@ -0,0 +1,4 @@ +commitizen: + name: cz_conventional_commits + tag_format: $version + version: 0.1.0 diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 6247f7e..0000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=source -set BUILDDIR=build - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/docs/source/api.rst b/docs/source/api.rst deleted file mode 100644 index ec94338..0000000 --- a/docs/source/api.rst +++ /dev/null @@ -1,7 +0,0 @@ -API -=== - -.. autosummary:: - :toctree: generated - - lumache diff --git a/docs/source/conf.py b/docs/source/conf.py deleted file mode 100644 index 6e9e8c0..0000000 --- a/docs/source/conf.py +++ /dev/null @@ -1,35 +0,0 @@ -# Configuration file for the Sphinx documentation builder. - -# -- Project information - -project = 'Lumache' -copyright = '2021, Graziella' -author = 'Graziella' - -release = '0.1' -version = '0.1.0' - -# -- General configuration - -extensions = [ - 'sphinx.ext.duration', - 'sphinx.ext.doctest', - 'sphinx.ext.autodoc', - 'sphinx.ext.autosummary', - 'sphinx.ext.intersphinx', -] - -intersphinx_mapping = { - 'python': ('https://docs.python.org/3/', None), - 'sphinx': ('https://www.sphinx-doc.org/en/master/', None), -} -intersphinx_disabled_domains = ['std'] - -templates_path = ['_templates'] - -# -- Options for HTML output - -html_theme = 'sphinx_rtd_theme' - -# -- Options for EPUB output -epub_show_urls = 'footnote' diff --git a/docs/source/index.rst b/docs/source/index.rst deleted file mode 100644 index 03d09a5..0000000 --- a/docs/source/index.rst +++ /dev/null @@ -1,22 +0,0 @@ -Welcome to Lumache's documentation! -=================================== - -**Lumache** (/lu'make/) is a Python library for cooks and food lovers -that creates recipes mixing random ingredients. -It pulls data from the `Open Food Facts database <https://world.openfoodfacts.org/>`_ -and offers a *simple* and *intuitive* API. - -Check out the :doc:`usage` section for further information, including -how to :ref:`installation` the project. - -.. note:: - - This project is under active development. - -Contents --------- - -.. toctree:: - - usage - api diff --git a/docs/source/usage.rst b/docs/source/usage.rst deleted file mode 100644 index 924afcf..0000000 --- a/docs/source/usage.rst +++ /dev/null @@ -1,34 +0,0 @@ -Usage -===== - -.. _installation: - -Installation ------------- - -To use Lumache, first install it using pip: - -.. code-block:: console - - (.venv) $ pip install lumache - -Creating recipes ----------------- - -To retrieve a list of random ingredients, -you can use the ``lumache.get_random_ingredients()`` function: - -.. autofunction:: lumache.get_random_ingredients - -The ``kind`` parameter should be either ``"meat"``, ``"fish"``, -or ``"veggies"``. Otherwise, :py:func:`lumache.get_random_ingredients` -will raise an exception. - -.. autoexception:: lumache.InvalidKindError - -For example: - ->>> import lumache ->>> lumache.get_random_ingredients() -['shells', 'gorgonzola', 'parsley'] - diff --git a/lumache.py b/lumache.py deleted file mode 100644 index 3ea7ce9..0000000 --- a/lumache.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -Lumache - Python library for cooks and food lovers. -""" - -__version__ = "0.1.0" - - -class InvalidKindError(Exception): - """Raised if the kind is invalid.""" - pass - - -def get_random_ingredients(kind=None): - """ - Return a list of random ingredients as strings. - - :param kind: Optional "kind" of ingredients. - :type kind: list[str] or None - :raise lumache.InvalidKindError: If the kind is invalid. - :return: The ingredients list. - :rtype: list[str] - """ - return ["shells", "gorgonzola", "parsley"] diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 14a2dda..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,8 +0,0 @@ -[build-system] -requires = ["flit_core >=3.2,<4"] -build-backend = "flit_core.buildapi" - -[project] -name = "lumache" -authors = [{name = "Graziella", email = "graziella@lumache"}] -dynamic = ["version", "description"] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1898c6f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,35 @@ +# +# These requirements were autogenerated by pipenv +# To regenerate from the project's Pipfile, run: +# +# pipenv lock --requirements +# + +-i https://pypi.org/simple +alabaster==0.7.12 +babel==2.10.3; python_version >= '3.6' +certifi==2022.6.15; python_version >= '3.6' +charset-normalizer==2.1.1; python_version >= '3.6' +docutils==0.17.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' +idna==3.3; python_version >= '3.5' +imagesize==1.4.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' +importlib-metadata==4.12.0 +jinja2==3.1.2; python_version >= '3.7' +markupsafe==2.1.1; python_version >= '3.7' +packaging==21.3; python_version >= '3.6' +pygments==2.13.0; python_version >= '3.6' +pyparsing==3.0.9; python_full_version >= '3.6.8' +pytz==2022.2.1 +requests==2.28.1; python_version >= '3.7' and python_version < '4' +snowballstemmer==2.2.0 +sphinx-rtd-size==0.2.0 +sphinx-rtd-theme==1.0.0 +sphinx==5.1.1 +sphinxcontrib-applehelp==1.0.2; python_version >= '3.5' +sphinxcontrib-devhelp==1.0.2; python_version >= '3.5' +sphinxcontrib-htmlhelp==2.0.0; python_version >= '3.6' +sphinxcontrib-jsmath==1.0.1; python_version >= '3.5' +sphinxcontrib-qthelp==1.0.3; python_version >= '3.5' +sphinxcontrib-serializinghtml==1.1.5; python_version >= '3.5' +urllib3==1.26.12; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4' +zipp==3.8.1; python_version >= '3.7' diff --git a/scripts/generate-requeriments.sh b/scripts/generate-requeriments.sh new file mode 100755 index 0000000..ad05737 --- /dev/null +++ b/scripts/generate-requeriments.sh @@ -0,0 +1,2 @@ +#!/usr/bin/sh +pipenv lock -r > requirements.txt diff --git a/source/_static/.gitkeep b/source/_static/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/source/_templates/.gitkeep b/source/_templates/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/source/conf.py b/source/conf.py new file mode 100644 index 0000000..1aeaa37 --- /dev/null +++ b/source/conf.py @@ -0,0 +1,43 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = "Rootlabs" +copyright = "2022, Odair M." +author = "Odair M." + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "sphinx.ext.duration", + "sphinx.ext.doctest", + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", +] + +intersphinx_mapping = { + "python": ("https://docs.python.org/3/", None), + "sphinx": ("https://www.sphinx-doc.org/en/master/", None), +} + +intersphinx_disabled_domains = ["std"] + + + +templates_path = ["_templates"] +exclude_patterns = [] + +language = "pt" + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "sphinx_rtd_theme" +html_static_path = ["_static"] +epub_show_urls = "footnote" diff --git a/source/index.rst b/source/index.rst new file mode 100644 index 0000000..1bd290c --- /dev/null +++ b/source/index.rst @@ -0,0 +1,23 @@ +.. Template-RDT documentation master file, created by + sphinx-quickstart on Wed Nov 2 22:52:13 2022. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Rootlabs +======== +Ambiente de testes e experimentação de sysadmin. + +.. toctree:: + :maxdepth: 2 + :caption: Documentação + :glob: + + pages/* + + +Páginas +======= + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/source/pages/.gitkeep b/source/pages/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/source/pages/baremetals.rst b/source/pages/baremetals.rst new file mode 100644 index 0000000..0a2a6c1 --- /dev/null +++ b/source/pages/baremetals.rst @@ -0,0 +1,746 @@ +########## +Introdução +########## + + +Todas bare metals do *rootlab* tem suporte a multi boot e snapshot. + +O layout de discos é: +:: + + 5G 15G 15G 15G 30G 60G + ┌─────────┐ ┌──────┐ ┌──────┐ ┌────────┐ ┌─────────┐ ┌───────────┐ + │ Recover │ │ C3SL │ │ Ceph │ │ CentOS │ │ ReadOly │ │ OverlayFS │ + └────▲────┘ └───▲──┘ └──▲───┘ └────▲───┘ └────▲────┘ └─────▲─────┘ + │ │ │ │ │ │ + ┌──────┴──────────┴───────┴──────────┴──────────┴────────────┴────────┐ + │ rootlabvg │ + │ 230 GB │ + │ Volume group │ + └─────────────────────────────────▲───────────────────────────────────┘ + │ + ┌───────────┴────────────┐ + │ │ + │ Physical volume 240G │ + │ │ + │ Disco␡1 Disco 2 │ + │ │ + └──────▲────────────▲────┘ + │ │ + │ │ + ┌─────────┴────┐ ┌──┴───────────┐ + │ │ │ │ + │ Disco 1 120G │ │ Disco 2 120G │ + │ │ │ │ + └──────────────┘ └──────────────┘ + +######################## +Configuração via Ansible +######################## + +################### +Configuração Manual +################### + + + +*********************** +Configuração dos discos +*********************** + +O primeiro passo consiste em configurar os discos das *bare metals* para seguir +o layout proposto. + +Cada disco da raiz será particionado em 3 partes: + * bios/uefi: partição bios ou uefi para ser bootável + * boot: partição com informação do grub para boot e chain loader de outros + grubs. + * lvm: partição para ser usado pelo LVM. + +A tabela a segui demostra os tamanhos e tipo de cada partição: + ++------+------+---------+-----------------------------+ +| Nome | tipo | tamanho | Descrição | ++======+======+=========+=============================+ +| BIOS | ef02 | 1M | bios mode | ++------+------+---------+-----------------------------+ +| BOOT | fd00 | 2G | boot | ++------+------+---------+-----------------------------+ +| LVM | 8300 | - | lvm, todo restante do disco | ++------+------+---------+-----------------------------+ + +Note que a raiz será formada por dois discos, a partição **BOOT** será a única +com raid1. + +Variaveis de ambientes +---------------------- +Para tornar o processo mais genericos, faremos extenso uso de variáveis de +ambiente. + +.. note:: + As únicas variáveis de ambiente, nesse estágio, que difere de cada servidor é + o id do disco que segue abaixo, todas as outras variáveis de ambientes são + feita com base nas variáveis de discos. + +.. code:: shell + + export DISK1=/dev/disk/by-id/wwn-0x5001b448bb93c957 + export DISK2=/dev/disk/by-id/wwn-0x5001b448bb90a400 + +Variáveis genéricas para quaisquer servidor: + +.. code:: shell + + # variáveis para partição de BIOS, não será utilizada, mas vamos criar + export BIOS_PART1=${DISK1}-part1 + export BIOS_PART2=${DISK1}-part1 + + # variáveis para partição de boot, usado no raid + export BOOT_PART1=${DISK1}-part2 + export BOOT_PART2=${DISK2}-part2 + + # variáveis para partição do lvm + export LVM_PART1=${DISK1}-part3 + export LVM_PART2=${DISK2}-part3 + + + +Criando as partições +==================== + +O primeiro passo para criar as partições é certificar que não exite nada nela, +então verifique com o comando ``lsblk`` se existe algum volume raid sendo +executado, se sim pare. Após se certificar que não existe nada utilizando os +discos, siga os próximos passos: + +.. contents:: Passos + :local: + :depth: 1 + +Passo 1: configure a tabela GPT +------------------------------- +O primeiro passo consiste em destruir qualquer informação que tenha nos discos e +criar uma tabela de partição do zero. O comando abaixo destrói a tabela de +partição *GBT/MBR* + +.. code:: shell + + sgdisk -Z ${DISK1} + sgdisk -Z ${DISK2} + +Passo 2: Crie as partições +-------------------------- +O processo de criar as partições é o mesmo, muda apenas o tamanho, tipo e label +de cada partição. O processo deve ser realizado nos dois discos. + +.. code:: shell + + for disk in ${DISK1} ${DISK2}; do + # id id type id label disco + sgdisk -n 1:0:+1M -t 1:ef02 -c 1:BIOS ${disk} # partição da bios modo legado + sgdisk -n 2:0:+2G -t 2:fd00 -c 2:BOOT ${disk} # partição de boot + sgdisk -n 3:0:0 -t 3:8503 -c 3:LVM ${disk} # partição do lvm + done; + +Criado as partições verique com o comando ``sgdisk -p device``: + +.. code:: shell + + echo "Patições disco 1" + sgdisk -p ${DISK1} + echo "Patições disco 2" + sgdisk -p ${DISK2} + +Configurando boot +================= + +A configuração do boot é feito em duas parte, na primeira se cria o array no +mdadm, formata com *ext2*. A segunda parte é feita após instalar o primeiro +sistema operacional que aí se configura o grub. + +.. contents:: Passos: + :local: + :depth: 1 + +Passo 1: Crie o array no mdadm +------------------------------ +O boot fica em um array raid com geometria de nível 1, *mirror*. + +Execute o comando abaixo para criar o array: + +.. code:: shell + + mdadm --create /dev/md/boot --level=1 --raid-devices=2 ${BOOT_PART1} ${BOOT_PART2} + +Passo 2: Formate o array +------------------------ + +Formate o array com sistema de arquivo que o bootloader aceite. No caso usaremos +o sistema de arquivo *EXT4* e o bootloader *GRUB*. + +.. code:: shell + + mkfs.ext4 /dev/md/boot + + +Configurando LVM: +================= + +A próxima etapa é configurar o LVM, que consiste em adicionar os dispositivos +fisicos, criar o *volume group* e criar as partições virtuais. + +.. contents:: Passos: + :local: + :depth: 1 + +Passo 1: Adicionando dispositivos fisicos +----------------------------------------- + +O primeiro passo consiste em adicionar os dispositivos fisicos ao LVM. Para +adicionar um dispositivo fisico ao LVM use o comando ``pvcreate <device>``. +Execute os comandos abaixo: + +.. code:: shell + + pvcreate ${LVM_PART1} ${LVM_PART2} + +Passo 2: Crie o *volume group*: +------------------------------- + +O segundo passo consiste em criar o *volume group*, camada superior ao *physical +devices*. O nome do *volume group* será **rootlabsvg**. Execute os comandos +abaixo para criar: + +.. code:: shell + + vgcreate rootlabsvg ${LVM_PART1} ${LVM_PART2} + +Passo 3: Crie as partições +-------------------------- + +O terceiro passo consiste em criar as partições básicas. O interessante do LVM +que podemos criar com tamanho menor e aumentar posteriomente, além de poder +adicionar ou remover partições com mais facilidade. O LVM chama as partições de +*logical volume*. + +As partições a serem criada são: + ++-----------+-----------------+----------------------------------------+ +| Nome | Tamanho inicial | Descrição | ++===========+=================+========================================+ +| recover | 5 Gb | debian basico paara recover | ++-----------+-----------------+----------------------------------------+ +| readonly | 10 Gb | Testes variados, debian basico | ++-----------+-----------------+----------------------------------------+ +| overlayfs | 50 Gb | camada de escrita da partição readonly | ++-----------+-----------------+----------------------------------------+ +| snapshot | 30 Gb | snapshots das outras camadas | ++-----------+-----------------+----------------------------------------+ + + +.. code:: shell + + lvcreate --name recover --size 5G rootlabsvg + lvcreate --name readonly --size 10G rootlabsvg + lvcreate --name overlayfs --size 50G rootlabsvg + + lvcreate --type striped --name recover --size 5G rootlabsvg + lvcreate --type striped --name readonly --size 20G rootlabsvg + lvcreate --type striped --name overlayfs --size 50G rootlabsvg + +.. tip:: + Com o comando ``lvdisplay`` é possível ver todos volumes criado e suas informações. + +Passo 4: Configure as partições +------------------------------- + +O último passo coniste em formatar cada partição, exceto a *snapshot* que será criada *on the fly*. +O sistema de arquivo utilizado será o *EXT4*. + +.. code:: shell + + export RECOVER_PART=/dev/rootlabsvg/recover + mkfs.ext4 ${RECOVER_PART} + + export READONLY_PART=/dev/rootlabsvg/readonly + mkfs.ext4 ${READONLY_PART} + + +**************************** +Bootstrap recover e readonly +**************************** + +O sistema operacional minímo que deve estar funcional é o recover e readonly, o restante pode ser feito com o +tempo e necessecidade. + +A ideia é o sistema *recover* tenha o mínimo para gerência e *readonly* pocotes a mais. + +Pacotes +======= + +Os pacotes a ser instalado é dividido em duas partes, base que será todos pacotes instalado no +*recover* e complementos que será instalado somente no readonly *readonly* + +Base +---- + +Os pacotes base são: + +.. hlist:: + :columns: 4 + + * systemd + * systemd-container + * systemd-timesyncd + * systemd-cron + * mdadm + * lvm2 + * grub2 + * linux-image-amd64 + * linux-headers-amd64 + * ssh + * rsync + * vim + * htop + * curl + * wget + * less + * lm-sensors + * iproute2 + * gdisk + * fdisk + * dnsutils + * iputils-ping + * zsh + * locales + * locales-all + * gcc + * make + * unzip + * tar + * man-db + * keyboard-configuration + * console-setup + * git + * python3 + * debootstrap + +Complementos: +------------- + +Os pacotes complementares são: + +.. hlist:: + * cmake + * forensics-all + * build-essential + +Variáveis de ambientes +====================== + +As variáveis de ambiente utilizada nesse momento serão: + +.. code:: shell + + export recover_part=/dev/rootlabsvg/recover + export recover_mountpoint=/recover + + export readonly_part=/dev/rootlabsvg/readonly + export readonly_mountpoint=/readonly + + export base_packages="systemd,systemd-container,systemd-timesyncd,systemd-cron,mdadm,lvm2,grub2,linux-image-amd64,linux-headers-amd64,ssh,rsync,vim,htop,curl,wget,less,lm-sensors,iproute2,gdisk,fdisk,dnsutils,iputils-ping,zsh,locales,locales-all,gcc,make,unzip,tar,man-db,keyboard-configuration,console-setup,git,python3,debootstrap" + export complement_packages="${base_packages} cmake forensics-all build-essential" + +Bootstrap +========= + +O bootstrap vai instalar os pacotes definidos. O comando a ser utilizado é: + +.. code:: shell + + debootstrap --variant=`<variant>` --include=`<packages>` --arch=`<architecture>` `<path-chroot>` `<mirror>` + +Onde: + + * `<variante>`: Variante da instalação, utilizaremos **minbase**. + * `<architecture>`: Arquitetura da instalação utilizaremos **amd64**. + * `<packages>`: Pacotes a ser incluído na instalação, utilizaremos valor de **base_packages** e **complement_packages**. + * `<path-chroot>`: Caminho para o local no qual será realizado o debootstrap, utilizaremos o valor de **recover_mountpoint** e **readonly_mountpoint**. + * `<mirror>`: URL ou caminho para o mirror de onde será baixado os pacotes, utilizaremos **http://debian.c3sl.ufpr.br/debian** + +Recover +------- + +O debootstrap do recover seguirá os seguintes passos: + +.. contents:: Passos + :local: + :depth: 1 + +Monte a partição recover +^^^^^^^^^^^^^^^^^^^^^^^^ + +O primeiro passo consiste em montar a partição recover e fazer alguns links com outras partições. + +Monte a partição *recover*: + +.. code:: shell + + mkdir -p ${recover_mountpoint} + mount ${recover_part} ${recover_mountpoint} + +Faça o link da partição boot com a partição recover + +.. code:: shell + + export boot_alt=${recover_mountpoint}/boot_alt + mkdir -p ${boot_alt} + + mount --bind /boot_alt/ ${boot_alt} + mkdir -p ${boot_alt}/recover + + mkdir -p ${recover_mountpoint}/boot + mount --bind ${boot_alt}/recover ${recover_mountpoint}/boot + +Execute o debootstrap +^^^^^^^^^^^^^^^^^^^^^ + +Execute o debootstrap: + +.. code:: shell + + debootstrap --variant=minbase --include=${base_packages} --arch=amd64 stable ${recover_mountpoint} http://debian.c3sl.ufpr.br/debian + +readonly +-------- + +O processo de bootstrap do readonly é o mesmo do *recover*, a diferença só vai surgir no momento da +configuração do *initramfs*. Os passos são: + +.. contents:: Passos + :local: + :depth: 1 + +Monte a partição readonly +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +O primeiro passo é montar e fazer link da partição: + +.. code:: shell + + mkdir -p ${readonly_mountpoint} + mount ${recover_part} ${recover_mountpoint} + +Faça o link da partição boot com a partição recover + +.. code:: shell + + export boot_alt=${readonly_mountpoint}/boot_alt + mkdir -p ${boot_alt} + + mount --bind ${BOOT_PARTITION} ${boot_alt} + mkdir -p ${boot_alt}/readonly + + mkdir -p ${readonly_mountpoint}/boot + mount --bind ${boot_alt}/readonly ${readonly_mountpoint}/boot + + +Execute o debootstrap +^^^^^^^^^^^^^^^^^^^^^ + +Execute o debootstrap: + +.. code:: shell + + debootstrap --variant=minbase --include=${complement_packages} --arch=x86 ${recover_mountpoint} ${mirror} + +Configure recover system +======================== + +.. code:: shell + + systemd-nspawn --bind /dev/sda --bind /dev/sdb --bind ${BOOT_PART1} \ + --bind ${BOOT_PART2} --bind /dev/md/boot --bind /dev/rootlabsvg/recover -D \ + ${recover_mountpoint} bash + +A configuração consiste em copiar os arquivos de configuração de cada componente importante, +configurar o grub e fazer o enable dos serviços. + +.. contents:: Passos + :local: + :depth: 1 + +Network +------- + +A configuração do network se dá por editar dois arquivos o */etc/systemd/network/20-cable.network* +e o */etc/systemd/resolved.conf*. O primeiro serve para configurar *IPV4* e *IPV6* do servidor, o +segundo serve para resolver nomes. + +20-cable.network +^^^^^^^^^^^^^^^^ + +Edite o arquivo ``${recover_mountpoint}/etc/systemd/network/20-cable.network`` e adicione o seguinte +conteúdo: + +.. code:: ini + + [Match] + Name=e* + + [Network] + DHCP=yes + +resolved.conf +^^^^^^^^^^^^^ + +Edite o arquivo ``${recover_mountpoint}/etc/systemd/resolved.conf`` e adicione o seguinte conteúdo: + +.. code:: ini + + [Resolve] + DNS=200.17.202.3 2801:82:80ff:8001::2 + FallbackDNS=200.236.31.1 2801:82:80ff:8000::2 + +Remora o arquivo ``${recover_mountpoint}/etc/resolv.conf`` e subtitua por um link para +``/run/systemd/resolve/stub-resolv.conf`` + +.. code:: shell + + rm -f ${recover_mountpoint}/etc/resolv.conf + cd ${recover_mountpoint}/etc + ln -s /run/systemd/resolve/stub-resolv.conf resolv.conf + cd - + +SSH +--- + +A configuração do ssh se dá por configurar o servidor e o cliente. + + +Servidor +^^^^^^^^ +Edite o arquivo ``${recover_mountpoint}/etc/ssh/sshd_config`` e adicione a opção de não aceitar +conexão por senha: + +.. code:: shell + + echo "PasswordAuthentication no" >> ${recover_mountpoint}/etc/ssh/sshd_config + +Verifique se o servidor está *enable* no systemd: + +.. code:: shell + + find ${recover_mountpoint}/etc/systemd/system/multi-user.target.wants -iname "ssh*" + +Caso não esteja, ative. + +.. code:: shell + + systemd-nspawn -D ${recover_mountpoint} systemctl enable ssh + +Cliente +^^^^^^^ +A configuração do cliente consiste em adicionar a chave de acesso no usuário root. + +.. code:: shell + + mkdir -p ${recover_mountpoint}/root/.ssh + echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICRHqT7/fqt4sriJjYzXbMfLTOS47/QIoi++aTFD3hOk rootslabs" > ${recover_mountpoint}/root/.ssh/authorized_keys + +Sincronização de relógio +------------------------ +Para sincronizar o relógio será utilizado o *systemd-timesyncd*, e a configuração consiste em +definir o servidor de *NTP*. Edite o arquivo ``${recover_mountpoint}/systemd/timesyncd.conf`` e +coloque o conteúdo: + +.. code:: ini + + [Time] + NTP=ntp.c3sl.ufpr.br + +Locales +------- + +Configure o locales: + +.. code:: shell + + echo "pt_BR.UTF-8 UTF-8" >> ${recover_mountpoint}/etc/locale.gen + systemd-nspawn -D ${recover_mountpoint} locale-gen + +Senha +----- + +Defina a senha de root: + +.. code:: shell + + systemd-nspawn -D ${recover_mountpoint} passwd + +Grub +---- + +A configuração do grub consiste em editar o arquivo ``${recover_mountpoint}/etc/default/grub`` e +defini parametros para que: + * O ``INIT`` aponte para o *systemd*. + * Configuração de porta serial esteja correta + +******************** +Configuração do boot +******************** + +Monte o array: + +.. code:: shell + + mkdir -p /boot_alt + mount /dev/md/boot /boot_alt + +Crie o diretório chamado grub: + +.. code:: shell + + mkdir -p /boot_alt/grub + +Copie o arquivo de fonte para o diretório + +.. code:: shell + + cp /usr/share/grub/unicode.pf2 /boot_alt/grub/ + +Crie o arquivo ``/boot_alt/grub/grub.cfg`` com o conteúdo: + +.. code:: cfg + + # variavel do grubenv + if [ -s $prefix/grubenv ]; then + set have_grubenv=true + load_env + fi + # opção default + if [ "${next_entry}" ] ; then + set default="${next_entry}" + set next_entry= + save_env next_entry + set boot_once=true + else + set default="0" + fi + + if [ x"${feature_menuentry_id}" = xy ]; then + menuentry_id_option="--id" + else + menuentry_id_option="" + fi + + export menuentry_id_option + + if [ "${prev_saved_entry}" ]; then + set saved_entry="${prev_saved_entry}" + save_env saved_entry + set prev_saved_entry= + save_env prev_saved_entry + set boot_once=true + fi + + function savedefault { + if [ -z "${boot_once}" ]; then + saved_entry="${chosen}" + save_env saved_entry + fi + } + function load_video { + if [ x$feature_all_video_module = xy ]; then + insmod all_video + else + insmod efi_gop + insmod efi_uga + insmod ieee1275_fb + insmod vbe + insmod vga + insmod video_bochs + insmod video_cirrus + fi + } + if [ x$feature_default_font_path = xy ] ; then + font=unicode + else + insmod part_msdos + insmod part_msdos + insmod diskfilter + insmod mdraid1x + insmod ext2 + set root='mduuid/580c789518a82e6edb8f4f6ef3e533b5' + if [ x$feature_platform_search_hint = xy ]; then + search --no-floppy --fs-uuid --set=root --hint='mduuid/580c789518a82e6edb8f4f6ef3e533b5' 47d567cb-4401-41b1-93ab-16e8096071ff + else + search --no-floppy --fs-uuid --set=root 47d567cb-4401-41b1-93ab-16e8096071ff + fi + font="/grub/unicode.pf2" + fi + + + if loadfont $font ; then + set gfxmode=auto + load_video + insmod gfxterm + set locale_dir=$prefix/locale + set lang=pt_BR + insmod gettext + fi + terminal_output gfxterm + if [ "${recordfail}" = 1 ] ; then + set timeout=30 + else + if [ x$feature_timeout_style = xy ] ; then + set timeout_style=menu + set timeout=5 + # Fallback normal timeout code in case the timeout_style feature is + # unavailable. + else + set timeout=5 + fi + fi + + + #--class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-be7d7025-4b62-461a-addf-17505b8dc2b4' + menuentry 'Template' $menuentry_id_option 'gnulinux-simple-template-47d567cb-4401-41b1-93ab-16e8096071ff' { + load_video + insmod gzio + if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi + insmod part_gpt + insmod ext2 + insmod part_msdos + insmod part_msdos + insmod diskfilter + insmod mdraid1x + + set root='mduuid/580c789518a82e6edb8f4f6ef3e533b5' # MUDAR + if [ x$feature_platform_search_hint = xy ]; then + search --no-floppy --fs-uuid --set=root --hint='mduuid/580c789518a82e6edb8f4f6ef3e533b5' 47d567cb-4401-41b1-93ab-16e8096071ff + else + search --no-floppy --fs-uuid --set=root 47d567cb-4401-41b1-93ab-16e8096071ff + fi + chain /boot/template/grub/grub.cfg + } + +pegue o *MDUUID* do array boot: + +.. code:: cfg + + mduuid=580c789518a82e6edb8f4f6ef3e533b5 + +Pegue o UUID do boot + +.. code:: cfg + + uuid: 47d567cb-4401-41b1-93ab-16e8096071ff + + +Instale o grub: + +.. code:: shell + + grub-install --boot-directory=/boot_alt/ --target=i386-pc $DISK1 + grub-install --boot-directory=/boot_alt/ --target=i386-pc $DISK2 -- GitLab