paritybit.ca

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit a04438086c586a539d5594172150a125bfc78bf5
parent 94e1b61c71d61485b2f445e93cc20e61167f2e76
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Mon,  6 Jul 2020 00:18:24 -0400

Publish new blog post

Diffstat:
Mpages/blog.md | 1+
Apages/blog/switching-to-cgit.md | 101+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mpages/home.md | 4++--
Mpages/links.md | 4++++
Mpublic/feeds/sitewide-feed.xml | 26++++++++++++++++++++++++++
Mpublic/sitemap.xml | 1+
6 files changed, 135 insertions(+), 2 deletions(-)

diff --git a/pages/blog.md b/pages/blog.md @@ -23,6 +23,7 @@ blog](https://duckduckgo.com/?q=site%3Awww.paritybit.ca%2Fblog&t=hk&ia=web) ### 2020 <ul> + <li>2020-07-05 <a href="blog/switching-to-cgit">Switching to cgit</a></li> <li>2020-07-04 <a href="blog/generating-my-geek-code">Generating My Geek Code</a></li> <li>2020-07-03 <a href="blog/adding-search-to-my-blog">Adding Search to my Blog</a></li> <li>2020-07-02 <a href="blog/a-month-and-a-half-of-self-hosted-email">A Month-and-a-Half of Self-Hosted Email</a></li> diff --git a/pages/blog/switching-to-cgit.md b/pages/blog/switching-to-cgit.md @@ -0,0 +1,101 @@ +## Switching to cgit + +[//]: # "I got tired of gitea's slowness and I didn't use its features anyways so I took the time this past weekend to swtich over to cgit. I also made a few modifications along the way." + +[//]: # "main.min.css" + +[//]: # + +<div class="byline"> +<b>Written By:</b> Jake Bauer | + <b>Posted:</b> 2020-07-05 | + <b>Last Updated:</b> 2020-07-05 +</div> + +I've been using Gitea for almost six months as my self-hosted git server. In +that time it has served its purpose and done well, but it's fallen into the same +traps as other platforms like GitHub and GitLab. That is to say, Gitea feels +very slow to use and I don't have any need for the plethora of features it +offers. + +### What I Didn't Like About Gitea + +Regarding this first point. A typical page on Gitea takes seconds to load and +usually weighs between 2 and 3 megabytes. I didn't do any rigorous testing of +large diffs or anything like that, I just loaded up the front page and my +profile page. Compared to cgit, which takes milliseconds to load and has page +sizes comparable to my website (10-20 kilobytes), Gitea feels agonizingly slow +to use just like GitHub and GitLab. + +Regarding the features, Gitea comes with things like built-in repo wikis, CI/CD, +social features similar to GitHub, a system for multiple user accounts, and +more. I used none of these features; I basically just used Gitea to host my +repositories and I dislike the pull request development model anyways. + +### Setting up cgit + +When I did my [comparison of self-hosted git +services](https://www.paritybit.ca/blog/choosing-a-self-hosted-git-service), +cgit caught my attention as being light but not as light as something like +Gitweb such that it still has some useful views and features. cgit isn't a +software forge, only allowing viewing repositories and downloading files, but it +has all I need out of a self-hosted git solution. + +Setting up cgit was fairly straightforward. I just followed the [Arch wiki +tutorial on setting up cgit](https://wiki.archlinux.org/index.php/Cgit) to set +up nginx with fastcgi, python-pygments for syntax highlighting source code, and +I read the cgitrc(5) manpage to flesh out the rest of my `/etc/cgitrc` config +file. + +Switching over was really easy too. I just copied the repositories that already +existed on the server to a new location (I chose `/srv/git` and then switched my +reverse proxy to point to the new git server's port instead of Gitea's port. +Following that, I just decommissioned Gitea by stopping the server and deleting +any trace of it off of my system. + +### Improving cgit + +One thing that I wanted to try doing to cgit was adding a dark theme that would +be activated by a CSS `@media` query. Unfortunately, I found the cgit CSS file +to be a huge mess of mixing colour names and hex codes with no use of CSS +variables so it would be an absolute pain to change things. No disrespect to the +developer though, I have a feeling that it's because the file has been growing +over time as features have been added and it doesn't get a lot of development +time. + +What I did to improve it was to go through the whole file, collect all the +colours that were being used, and consolidate and turn the colours into CSS +variables that could be re-used throughout the file. If you were following some +of my toots on Mastodon, I posted about how some 7 slightly different shades of +grey were being used which I pared down to 4. I also turned the font-size and +logo-width into CSS variables so they would be easier to change from the top of +the file. I have yet to design a good dark theme (this will take some time to +ensure it's completely accessible), but I feel like the CSS will be a lot easier +to work with now. + +I did also make some other improvements throughout the CSS. For example, I set +my base font-size to `100%` instead of the ridiculously tiny `10pt`, I added +underlining to all links in tables (because previously you had to hover over +them with your mouse to distinguish a link from just plain text), and I improved +some colours to ensure that there were no contrast issues. I also used the +`borland` theme in python-pygments because it had no contrast issues against the +white background unlike `default`. + +### Conclusion + +I'm still working on cleaning and organizing my project repositories, but I feel +the interface of cgit is a lot smoother and easier to work with than Gitea. All +of the development will be done through the command line and through email +patches which I prefer and I don't have to feel bad about hosting really +bloated, JavaScript-heavy webpages. + +I'm not quite sure if I'll be able to get a dark theme working, but I have made +all of my customizations and settings available in its own repository for others +to look at. Here is the [sourcehut +repository](https://git.sr.ht/~jbauer/cgit-config) and here is [the repository +on my git server](https://git.paritybit.ca/cgit-config/). + +_This is my sixty-first post for the +[#100DaysToOffload](https://social.paritybit.ca/tags/100DaysToOffload) +challenge. You can learn more about this challenge over at +[https://100daystooffload.com](https://100daystooffload.com)._ diff --git a/pages/home.md b/pages/home.md @@ -20,6 +20,8 @@ extent)! Access through `gopher://paritybit.ca` or `gemini://paritybit.ca`. src="/img/feed-icon.png" width="15" height="15" alt="Click for RSS Feed"/> </a> </div> +2020-07-05 <a class="feed-item" href="blog/switching-to-cgit">Switching to cgit</a> + 2020-07-04 <a class="feed-item" href="blog/generating-my-geek-code">Generating My Geek Code</a> 2020-07-03 <a class="feed-item" href="blog/adding-search-to-my-blog">Adding Search to my Blog</a> @@ -37,8 +39,6 @@ extent)! Access through `gopher://paritybit.ca` or `gemini://paritybit.ca`. 2020-06-23 <a class="feed-item" href="blog/switching-to-debian-sid">Switching to Debian Sid</a> 2020-06-22 <a class="feed-item" href="blog/my-lwn-theme">My LWN Theme</a> - -2020-06-21 <a class="feed-item" href="blog/reflecting-on-50-days-of-blogging">Reflecting on 50 Days of Blogging</a> ### What is a Parity Bit? It is a bit (in the 1's and 0's sense) used in checking for errors in digital diff --git a/pages/links.md b/pages/links.md @@ -124,6 +124,10 @@ Kevlin Henney talks about programming anti-patterns and cargo cult programming. +* [Jonathan Blow - Preventing the Collapse of Civilization](https://www.youtube.com/watch?v=pW-SOdj4Kkk) - + Discussing the very real risk of knowledge loss in the software industry + with historical context and a look at the direction the industry is heading. + ### Programming * [Computers Can Be Understood](https://blog.nelhage.com/post/computers-can-be-understood/) diff --git a/public/feeds/sitewide-feed.xml b/public/feeds/sitewide-feed.xml @@ -7,6 +7,32 @@ <description>The feed that covers all notable additions, updates, announcements, and other changes for the entire paritybit.ca website.</description> <item> + <title>Switching to cgit</title> + <link>https://www.paritybit.ca/blog/switching-to-cgit</link> + <guid>https://www.paritybit.ca/blog/switching-to-cgit</guid> + <pubDate>Sun, 05 Jul 2020 23:57:50 -0400</pubDate> + <description><![CDATA[<h2 id="switching-to-cgit">Switching to cgit</h2> +<div class="byline"> +<p><b>Written By:</b> Jake Bauer | <b>Posted:</b> 2020-07-05 | <b>Last Updated:</b> 2020-07-05</p> +</div> +<p>I’ve been using Gitea for almost six months as my self-hosted git server. In that time it has served its purpose and done well, but it’s fallen into the same traps as other platforms like GitHub and GitLab. That is to say, Gitea feels very slow to use and I don’t have any need for the plethora of features it offers.</p> +<h3 id="what-i-didnt-like-about-gitea">What I Didn’t Like About Gitea</h3> +<p>Regarding this first point. A typical page on Gitea takes seconds to load and usually weighs between 2 and 3 megabytes. I didn’t do any rigorous testing of large diffs or anything like that, I just loaded up the front page and my profile page. Compared to cgit, which takes milliseconds to load and has page sizes comparable to my website (10-20 kilobytes), Gitea feels agonizingly slow to use just like GitHub and GitLab.</p> +<p>Regarding the features, Gitea comes with things like built-in repo wikis, CI/CD, social features similar to GitHub, a system for multiple user accounts, and more. I used none of these features; I basically just used Gitea to host my repositories and I dislike the pull request development model anyways.</p> +<h3 id="setting-up-cgit">Setting up cgit</h3> +<p>When I did my <a href="https://www.paritybit.ca/blog/choosing-a-self-hosted-git-service">comparison of self-hosted git services</a>, cgit caught my attention as being light but not as light as something like Gitweb such that it still has some useful views and features. cgit isn’t a software forge, only allowing viewing repositories and downloading files, but it has all I need out of a self-hosted git solution.</p> +<p>Setting up cgit was fairly straightforward. I just followed the <a href="https://wiki.archlinux.org/index.php/Cgit">Arch wiki tutorial on setting up cgit</a> to set up nginx with fastcgi, python-pygments for syntax highlighting source code, and I read the cgitrc(5) manpage to flesh out the rest of my <code>/etc/cgitrc</code> config file.</p> +<p>Switching over was really easy too. I just copied the repositories that already existed on the server to a new location (I chose <code>/srv/git</code> and then switched my reverse proxy to point to the new git server’s port instead of Gitea’s port. Following that, I just decommissioned Gitea by stopping the server and deleting any trace of it off of my system.</p> +<h3 id="improving-cgit">Improving cgit</h3> +<p>One thing that I wanted to try doing to cgit was adding a dark theme that would be activated by a CSS <code>@media</code> query. Unfortunately, I found the cgit CSS file to be a huge mess of mixing colour names and hex codes with no use of CSS variables so it would be an absolute pain to change things. No disrespect to the developer though, I have a feeling that it’s because the file has been growing over time as features have been added and it doesn’t get a lot of development time.</p> +<p>What I did to improve it was to go through the whole file, collect all the colours that were being used, and consolidate and turn the colours into CSS variables that could be re-used throughout the file. If you were following some of my toots on Mastodon, I posted about how some 7 slightly different shades of grey were being used which I pared down to 4. I also turned the font-size and logo-width into CSS variables so they would be easier to change from the top of the file. I have yet to design a good dark theme (this will take some time to ensure it’s completely accessible), but I feel like the CSS will be a lot easier to work with now.</p> +<p>I did also make some other improvements throughout the CSS. For example, I set my base font-size to <code>100%</code> instead of the ridiculously tiny <code>10pt</code>, I added underlining to all links in tables (because previously you had to hover over them with your mouse to distinguish a link from just plain text), and I improved some colours to ensure that there were no contrast issues. I also used the <code>borland</code> theme in python-pygments because it had no contrast issues against the white background unlike <code>default</code>.</p> +<h3 id="conclusion">Conclusion</h3> +<p>I’m still working on cleaning and organizing my project repositories, but I feel the interface of cgit is a lot smoother and easier to work with than Gitea. All of the development will be done through the command line and through email patches which I prefer and I don’t have to feel bad about hosting really bloated, JavaScript-heavy webpages.</p> +<p>I’m not quite sure if I’ll be able to get a dark theme working, but I have made all of my customizations and settings available in its own repository for others to look at. Here is the <a href="https://git.sr.ht/~jbauer/cgit-config">sourcehut repository</a> and here is <a href="https://git.paritybit.ca/cgit-config/">the repository on my git server</a>.</p> +<p><em>This is my sixty-first post for the <a href="https://social.paritybit.ca/tags/100DaysToOffload">#100DaysToOffload</a> challenge. You can learn more about this challenge over at <a href="https://100daystooffload.com">https://100daystooffload.com</a>.</em></p>]]></description> + </item> +<item> <title>Generating My Geek Code</title> <link>https://www.paritybit.ca/blog/generating-my-geek-code</link> <guid>https://www.paritybit.ca/blog/generating-my-geek-code</guid> diff --git a/public/sitemap.xml b/public/sitemap.xml @@ -3,6 +3,7 @@ <url><loc>https://www.paritybit.ca</loc></url> <url><loc>https://www.paritybit.ca/home</loc></url> <url><loc>https://www.paritybit.ca/blog</loc></url> + <url><loc>https://www.paritybit.ca/blog/switching-to-cgit</loc></url> <url><loc>https://www.paritybit.ca/blog/generating-my-geek-code</loc></url> <url><loc>https://www.paritybit.ca/blog/adding-search-to-my-blog</loc></url> <url><loc>https://www.paritybit.ca/blog/a-month-and-a-half-of-self-hosted-email</loc></url>