{"id":580,"date":"2023-08-27T15:15:38","date_gmt":"2023-08-27T15:15:38","guid":{"rendered":"https:\/\/blogs.gentoo.org\/gsoc\/?p=580"},"modified":"2023-08-27T16:21:51","modified_gmt":"2023-08-27T16:21:51","slug":"gentoo_update-user-guide","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/gsoc\/2023\/08\/27\/gentoo_update-user-guide\/","title":{"rendered":"gentoo_update User Guide"},"content":{"rendered":"<h2 id=\"introduction\">Introduction<\/h2>\n<p>This article will go through the basic usage of\u00a0<code>gentoo_update<\/code>\u00a0CLI tool and the mobile app.<\/p>\n<p>But before that, here is a demo of this project:<\/p>\n<p><iframe loading=\"lazy\" title=\"Gentoo Linux updater demo. GSoC2023\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/go6SJZBgpgg?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe><\/p>\n<h2 id=\"gentoo_update-cli-app\">gentoo_update CLI App<\/h2>\n<h3 id=\"installation\">Installation<\/h3>\n<p><code>gentoo_update<\/code>\u00a0is available in GURU overlay and in PyPI. Generally, installing the program from GURU overlay is the preferred method, but PyPI will always have the most recent version.<\/p>\n<p>Enable GURU and install with emerge:<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-bash hljs\" data-lang=\"bash\">eselect repository <span class=\"hljs-built_in\">enable<\/span> guru\r\nemerge --ask app-admin\/gentoo_update\r\n<\/code><\/pre>\n<\/div>\n<p>Alternatively, install from PyPI with pip:<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-bash hljs\" data-lang=\"bash\">python -m venv .venv_gentoo_update\r\nsource .venv_gentoo_update\/bin\/activate\r\npython -m pip install gentoo_update<\/code><\/pre>\n<h3 id=\"update\">Update<\/h3>\n<p><code>gentoo_update<\/code>\u00a0provides 2 update modes &#8211; full and security. Full mode updates @world, and security mode uses glsa-check to find security patches, and installs them if something is found.<\/p>\n<p>By default, when run without flags security mode is selected:<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-bash hljs\" data-lang=\"bash\">gentoo-update\r\n<\/code><\/pre>\n<\/div>\n<p>To update @world, run:<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-bash hljs\" data-lang=\"bash\">gentoo-update --update-mode full\r\n<\/code><\/pre>\n<\/div>\n<p>Full list of available parameters and flags can be accessed with the\u00a0<code>--help<\/code>\u00a0flag. Further examples are detailed in the repository\u2019s\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\">readme file<\/a>.<\/p>\n<p>Once the update concludes, a log file gets generated at\u00a0<code>\/var\/log\/portage\/gentoo_update\/log_&lt;date&gt;<\/code>\u00a0(or whatever $PORTAGE_LOGDIR is set to). This log becomes the basis for the update report when the\u00a0<code>--report<\/code>\u00a0flag is used, transforming the log details into a structured update report.<\/p>\n<h3 id=\"send-report\">Send Report<\/h3>\n<p>The update report can be sent through three distinct methods: IRC bot, email, or mobile app.<\/p>\n<p><strong>IRC Bot Method<\/strong><br \/>\nBegin by registering a user on an IRC server and setting a nickname as outlined in the\u00a0<a href=\"https:\/\/libera.chat\/guides\/registration\">documentation<\/a>. After establishing a chat channel for notifications, define the necessary environmental variables and execute the following commands:<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-bash hljs\" data-lang=\"bash\"><span class=\"hljs-built_in\">export<\/span> IRC_CHANNEL=<span class=\"hljs-string\">\"#&lt;irc_channel_name&gt;\"<\/span>\r\n<span class=\"hljs-built_in\">export<\/span> IRC_BOT_NICKNAME=<span class=\"hljs-string\">\"&lt;bot_name&gt;\"<\/span>\r\n<span class=\"hljs-built_in\">export<\/span> IRC_BOT_PASSWORD=<span class=\"hljs-string\">\"&lt;bot_password&gt;\"<\/span>\r\ngentoo-update --send-report irc\r\n<\/code><\/pre>\n<\/div>\n<p><strong>Email via Sendgrid<\/strong><br \/>\nTo utilize Sendgrid, register for an account and generate an\u00a0<a href=\"https:\/\/docs.sendgrid.com\/ui\/account-and-settings\/api-keys\">API key<\/a>). After installing the Sendgrid Python library from GURU, save the API key in the environmental variables and use the commands below:<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-bash hljs\" data-lang=\"bash\">emerge --ask dev-python\/sendgrid\r\n<span class=\"hljs-built_in\">export<\/span> SENDGRID_TO=<span class=\"hljs-string\">'recipient@email.com'<\/span>\r\n<span class=\"hljs-built_in\">export<\/span> SENDGRID_FROM=<span class=\"hljs-string\">'sender@email.com'<\/span>\r\n<span class=\"hljs-built_in\">export<\/span> SENDGRID_API_KEY=<span class=\"hljs-string\">'SG.****************'<\/span>\r\ngentoo-update --send-report email\r\n<\/code><\/pre>\n<\/div>\n<p>Notifications can also be sent via the mobile app. Details on this method will be elaborated in the following section.<\/p>\n<p>&nbsp;<\/p>\n<h2 id=\"gentoo_update-mobile-app\">gentoo_update Mobile App<\/h2>\n<h3 id=\"installation-1\">Installation<\/h3>\n<p>Mobile app can either be installed from Github or Google Play Store.<\/p>\n<p><strong>Play Store<\/strong><\/p>\n<p>App can be found by searching &#8216;gentoo_update&#8217; in the Play Store, or by using <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=net.labbrat.gentoo_update\">this link<\/a>.<\/p>\n<p><strong>Manual Installation<\/strong><br \/>\nFor manual installation on an Android device, download the APK file from<br \/>\n<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update_flutter\/releases\/tag\/1.0.1\">Releases<\/a>\u00a0tab on Github. Ensure you\u2019ve enabled installation from\u00a0<a href=\"https:\/\/www.applivery.com\/docs\/mobile-app-distribution\/android-unknown-sources\/\">Unknown Sources<\/a>\u00a0before proceeding.<\/p>\n<h3 id=\"usage\">Usage<\/h3>\n<p>The mobile app consists of three screens: Login, Reports, and Profile.<\/p>\n<p>Upon first use, users will see the Login screen. To proceed, select the Anonymous Login button. This action generates an account with a unique user ID and token, essential for the CLI to send reports.<\/p>\n<p>The Reports screen displays all reports sent using a specific token. Each entry shows the update status and report ID. For an in-depth view of any report, simply tap on it.<\/p>\n<p>On the Profile screen, users can find their 8-character token, which needs to be saved as the GU_TOKEN variable on the Gentoo instance. This screen also shows the AES key status, crucial for decrypting the client-side token as it\u2019s encrypted in the database. To log out, tap the Sign Out button.<br \/>\n<strong>Note:<\/strong>\u00a0Since only Anonymous Login is available, once logged out, returning to the same account isn\u2019t possible.<\/p>\n<p><img loading=\"lazy\" class=\"wp-image-586 aligncenter\" src=\"http:\/\/blogs.gentoo.org\/gsoc\/files\/2023\/08\/2_screens-300x282.jpg\" alt=\"\" width=\"489\" height=\"460\" srcset=\"https:\/\/blogs.gentoo.org\/gsoc\/files\/2023\/08\/2_screens-300x282.jpg 300w, https:\/\/blogs.gentoo.org\/gsoc\/files\/2023\/08\/2_screens-1024x961.jpg 1024w, https:\/\/blogs.gentoo.org\/gsoc\/files\/2023\/08\/2_screens-768x721.jpg 768w, https:\/\/blogs.gentoo.org\/gsoc\/files\/2023\/08\/2_screens.jpg 1504w\" sizes=\"(max-width: 489px) 100vw, 489px\" \/><\/p>\n<h2 id=\"contacts\">Contacts<\/h2>\n<p>Preferred method for getting help or requesting a new feature for both CLI and mobile apps is by creating an issue in Github:<\/p>\n<ul>\n<li>gentoo_update CLI\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/issues\">issues page<\/a><\/li>\n<li>Mobile app\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update_flutter\/issues\">issues page<\/a><\/li>\n<\/ul>\n<p>Or just contact me directly via\u00a0<a href=\"mailto:labbrat_social@pm.me\">labbrat_social@pm.me<\/a> and IRC. I am in most of the #gentoo IRC groups and my nick is #LabBrat.<\/p>\n<h2 id=\"links\">Links<\/h2>\n<ul>\n<li>[<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\">Link<\/a>] &#8211; gentoo_update CLI repository<\/li>\n<\/ul>\n<ul>\n<li>[<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update_flutter\">Link<\/a>] &#8211; Mobile App repository<\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Introduction This article will go through the basic usage of\u00a0gentoo_update\u00a0CLI tool and the mobile app. But before that, here is a demo of this project: gentoo_update CLI App Installation gentoo_update\u00a0is available in GURU overlay and in PyPI. Generally, installing the &hellip; <a href=\"https:\/\/blogs.gentoo.org\/gsoc\/2023\/08\/27\/gentoo_update-user-guide\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":182,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,18],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/580"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/users\/182"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/comments?post=580"}],"version-history":[{"count":4,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/580\/revisions"}],"predecessor-version":[{"id":590,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/580\/revisions\/590"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/media?parent=580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/categories?post=580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/tags?post=580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}