<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kerem Gümüş on Medium]]></title>
        <description><![CDATA[Stories by Kerem Gümüş on Medium]]></description>
        <link>https://medium.com/@ibrahimkerem.gumus?source=rss-95fa422d8001------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*pQFtcvgnUugYaOcJY5f0wA.jpeg</url>
            <title>Stories by Kerem Gümüş on Medium</title>
            <link>https://medium.com/@ibrahimkerem.gumus?source=rss-95fa422d8001------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 00:22:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ibrahimkerem.gumus/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Developer’s Guide to Processing Elasticsearch Logs with .NET: From Query to HTML Table]]></title>
            <link>https://medium.com/arvatotech/a-developers-guide-to-processing-elasticsearch-logs-with-net-from-query-to-html-table-a06785ca5082?source=rss-95fa422d8001------2</link>
            <guid isPermaLink="false">https://medium.com/p/a06785ca5082</guid>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[logging]]></category>
            <category><![CDATA[kibana]]></category>
            <dc:creator><![CDATA[Kerem Gümüş]]></dc:creator>
            <pubDate>Fri, 17 Jan 2025 06:50:09 GMT</pubDate>
            <atom:updated>2025-01-17T18:27:32.270Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Developer’s Guide to Processing Elasticsearch Logs with .NET: From Query to HTML Table</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0BNT5iZszdUv_FPFHzzlXg.png" /></figure><h3><strong>Introduction</strong></h3><p>Elasticsearch is an advanced, distributed engine for search and analytics that enables horizontal scalability, reliability, and real-time operations. Normally, Elasticsearch, which is based on Apache Lucene, enables full-text search, analysis of logs and event data, and real-time data monitoring. In this regard, Elasticsearch indexing and searching of huge volumes of data in high speeds are enabled, and in turn, it has made Elasticsearch a highly used system when it comes to applications with complex and high-speed searches. Elasticsearch thereby acts as a log store that is used for searching and analysis from various sources in log management; hence, it is very important to developers, DevOps, and security teams.</p><p>In the below post, I am going to describe how to get logs from Elasticsearch according to your desired queries and how to include only the fields of your concern, giving you a practical approach in log management and analysis using .NET.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4jA60rokeY344nIS9mXEYA.png" /><figcaption>example email template</figcaption></figure><p>Example config for this template:</p><pre>{<br> &quot;indexTag&quot;: &quot;{indexTag}&quot;,<br> &quot;savedQueryId&quot;: &quot;{savedQueryId}&quot;,<br> &quot;title&quot;: &quot;Successful Requests&quot;,<br> &quot;description&quot;: &quot;successful requests in the last 1 hour&quot;,<br> &quot;to&quot;: [<br>  &quot;kerem.gumus@arvato.com&quot;<br> ],<br> &quot;tableHeaders&quot;: [<br>  {<br>   &quot;label&quot;: &quot;requestPath&quot;<br>  },<br>  {<br>   &quot;label&quot;: &quot;userName&quot;<br>  },<br>  {<br>   &quot;label&quot;: &quot;LogLevel&quot;<br>  },<br>  {<br>   &quot;label&quot;: &quot;IsValid&quot;,<br>   &quot;visibility&quot;: false<br>  }<br> ],<br> &quot;TableValues&quot;: [<br>  &quot;path&quot;,<br>  &quot;userid&quot;,<br>  &quot;logleveltext&quot;,<br>  &quot;responsedata.Data[*].IsValid&quot;<br> ],<br> &quot;exprExists&quot;: {<br>  &quot;IsValid&quot;: [<br>   &quot;True&quot;<br>  ]<br> },<br> &quot;func&quot;: &quot;Count&quot;,<br> &quot;sort&quot;: &quot;Count DESC&quot;<br>}</pre><p>You can schedule jobs to query your Elasticsearch indices periodically and send formatted HTML emails containing error summaries, log analysis and reporting like the one shown above. This email template shows successful API requests by path, making it easy for teams to:</p><ul><li>Monitor application <strong>success</strong>/<strong>errors </strong>in real-time</li><li>Track error frequencies across different components</li><li>Identify problematic areas quickly</li><li>Receive <strong>hourly</strong>/<strong>daily</strong>/<strong>weekly</strong> success/error summaries</li><li>Click through to <strong>Kibana</strong> for detailed analysis</li></ul><p>For example, you could schedule this to run daily and automatically notify your development team about error patterns, helping maintain proactive system monitoring rather than reactive problem solving.</p><h4><strong>Github Repository</strong></h4><p><a href="https://github.com/sequester0/ElasticsearchMedium">GitHub - sequester0/ElasticsearchMedium: .NET API for retrieving and transforming Elasticsearch logs into customizable HTML reports using saved queries or Lucene queries.</a></p><h3>What We Will Cover</h3><ul><li>Setting up the request model</li><li>Understanding field mappings</li><li>Using saved queries vs Lucene queries</li><li>Data transformation and filtering</li><li>Example usage scenarios</li></ul><h3>Technical Setup</h3><p>Our solution uses a clean architecture approach with three main projects:</p><ul><li><strong>API Layer</strong>: Handles HTTP requess and responses</li><li><strong>Core Layer</strong>: Contains business models and interfaces</li><li><strong>Infrastructure Layer</strong>: Implements Elasticsearch communication</li></ul><h3>Basic Configuration</h3><pre>{<br>  &quot;ElasticsearchSettings&quot;: {<br>    &quot;Nodes&quot;: [&quot;http://localhost:9200&quot;],<br>    &quot;Username&quot;: &quot;elastic&quot;,<br>    &quot;Password&quot;: &quot;your-password&quot;,<br>    &quot;ElasticUiEndpoint&quot;: &quot;http://localhost:5601/api/&quot;<br>  }<br>}</pre><h3>The Request Model in Detail</h3><pre>{<br>    &quot;indexTag&quot;: &quot;weatherforecast&quot;,<br>    &quot;savedQueryId&quot;: &quot;38ae4b83-d30a-4229-b610-32ffcff793e9&quot;,<br>    &quot;title&quot;: &quot;Weather Data Analysis&quot;,<br>    &quot;description&quot;: &quot;Temperature analysis by city&quot;,<br>    &quot;tableHeaders&quot;: [<br>        {<br>            &quot;label&quot;: &quot;Summary&quot;,<br>            &quot;visibility&quot;: true // default true<br>        },<br>        {<br>            &quot;label&quot;: &quot;Temperature&quot;,<br>            &quot;visibility&quot;: true // default true<br>        }<br>    ],<br>    &quot;tableValues&quot;: [<br>        &quot;data.response[*].summary&quot;,<br>        &quot;data.response[*].temperatureC&quot;<br>    ],<br>    &quot;ExprExists&quot;: {<br>        &quot;temperatureC&quot;: [&quot;13&quot;]<br>    },<br>    &quot;func&quot;: &quot;Group&quot;<br>}</pre><h3>Advanced Field Path Notation</h3><p>Our API supports sophisticated field path notation:</p><h4>1- Simple Fields</h4><pre>&quot;tableValues&quot;: [&quot;message&quot;, &quot;logLevel&quot;]</pre><h4>2- Nested Objects</h4><pre>&quot;tableValues&quot;: [&quot;data.request.method&quot;, &quot;data.response.statusCode&quot;]</pre><h4>3- Array Operations</h4><pre>// First element<br>&quot;tableValues&quot;: [&quot;data.items[0].name&quot;]<br><br>// All elements<br>&quot;tableValues&quot;: [&quot;data.items[*].name&quot;]<br><br>// Specific nested property<br>&quot;tableValues&quot;: [&quot;data.response[*].errors.message&quot;]</pre><h3>Key Components</h3><h4><strong>1- Index Management</strong></h4><ul><li><strong>indexTag</strong>: Specifies the Elasticsearch index pattern (e.g. “<strong>weatherforecast-*</strong>”). Assuming your index name is day-based (<strong>weatherforecast-2024–12–20</strong>). So if it’s not you have to adjust the request:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W8xwhD1VD2t87uJqjK9zsw.png" /></figure><ul><li>Useful for targeting specific log types or time perios</li></ul><h4><strong>2- Query Options</strong></h4><ul><li><strong>savedQueryId</strong>: Reference a saved query from Kibana</li><li><strong>luceneQueryLanguage</strong>: Alternative to use direct Lucene queries</li><li><strong>You must provide either one of these options</strong></li></ul><h4><strong>3- Output Formatting</strong></h4><ul><li><strong>tableHeaders</strong>: Define the columns and their properties</li><li><strong>tableValues</strong>: Specify the field paths to extract data</li><li>Maps Elasticsearch fields to table columns</li></ul><h4><strong>4- Data Processing</strong></h4><ul><li><strong>ExprExists</strong>/<strong>ExprNotExists</strong>: Filter rows based on field values</li><li><strong>Func</strong>: Apply data transformations (“<strong>Group</strong>”, “<strong>Count</strong>”, “<strong>Distinct</strong>”)</li></ul><h3>Real-World Examples</h3><h4><strong>1- Error Log Analysis</strong></h4><pre>{<br>    &quot;indexTag&quot;: &quot;application-logs&quot;,<br>    &quot;luceneQueryLanguage&quot;: &quot;level:ERROR&quot;,<br>    &quot;tableHeaders&quot;: [<br>        { <br>          &quot;label&quot;: &quot;Timestamp&quot; <br>        },<br>        { <br>          &quot;label&quot;: &quot;Error&quot; <br>        }<br>    ],<br>    &quot;tableValues&quot;: [<br>        &quot;timestamp&quot;,<br>        &quot;error.message&quot;<br>    ],<br>    &quot;func&quot;: &quot;Count&quot;<br>}</pre><h4>2- User Activity Tracking</h4><pre>{<br>    &quot;indexTag&quot;: &quot;user-activity&quot;,<br>    &quot;savedQueryId&quot;: &quot;user-activity-sq&quot;,<br>    &quot;tableHeaders&quot;: [<br>        { &quot;label&quot;: &quot;User&quot; },<br>        { &quot;label&quot;: &quot;Action&quot; }<br>    ],<br>    &quot;tableValues&quot;: [<br>        &quot;data.user.id&quot;,<br>        &quot;data.action&quot;,<br>        &quot;count&quot;<br>    ],<br>    &quot;func&quot;: &quot;Count&quot;,<br>    &quot;sort&quot;: &quot;Count DESC&quot;<br>}</pre><h4>3- API Performance Monitoring</h4><pre>{<br>    &quot;indexTag&quot;: &quot;api&quot;,<br>    &quot;luceneQueryLanguage&quot;: &quot;responseTime:&gt;1000 AND method:GET&quot;,<br>    // or slow requests in the last 1 hour<br>    //&quot;luceneQueryLanguage&quot;: &quot;createTime:[now-1h TO now] AND responseTime:&gt;1000&quot;<br>    &quot;tableHeaders&quot;: [<br>        { &quot;label&quot;: &quot;Endpoint&quot; },<br>        { &quot;label&quot;: &quot;ResponseTime&quot; }<br>    ],<br>    &quot;tableValues&quot;: [<br>        &quot;data.path.value&quot;,<br>        &quot;data.responseTime&quot;<br>    ],<br>    &quot;func&quot;: &quot;Count&quot;,<br>    &quot;sort&quot;: &quot;ResponseTime DESC&quot;<br>}</pre><h3>Processing Functions in Detail</h3><h4>Group Function</h4><p>Groups identical rows together:</p><pre>&quot;func&quot;: &quot;Group&quot;,<br>&quot;tableValues&quot;: [&quot;data.category&quot;, &quot;data.status&quot;]<br><br>// Result: Each unique combination of category and status appears once.</pre><h4>Count Function</h4><p>Counts occurrences of unique combinations:</p><ul><li>Even if you don’t give a specific “<strong>Count</strong>” header in the <strong>tableHeaders</strong> section, when you send <strong>Count </strong>in the <strong>Func </strong>parameter, it creates the “Count” column on the DataTable.</li></ul><pre>&quot;func&quot;: &quot;Count&quot;,<br>&quot;tableValues&quot;: [&quot;data.errorCode&quot;, &quot;data.errorMessage&quot;]<br><br>// Result: Shows how many times each error occurred.</pre><h4>Distinct Function</h4><p>Removes duplicate entries while preserving row order:</p><pre>&quot;func&quot;: &quot;Distinct&quot;,<br>&quot;tableValues&quot;: [&quot;data.userId&quot;, &quot;data.action&quot;]<br><br>// Result: Shows unique user actions without duplicates.</pre><h4>Using MinQty for Threshold-Based Reporting</h4><p>The “<strong>minQty</strong>” parameter allows you to filter results based on occurrence count. This is particularly useful when you want to focus on issues that occur more frequently than a certain threshold.</p><pre>{<br>    &quot;indexTag&quot;: &quot;application-logs&quot;,<br>    &quot;luceneQueryLanguage&quot;: &quot;level:ERROR&quot;,<br>    &quot;tableHeaders&quot;: [<br>        { &quot;label&quot;: &quot;Error Type&quot; },<br>        { &quot;label&quot;: &quot;Error Message&quot; },<br>        { &quot;label&quot;: &quot;Count&quot; }<br>    ],<br>    &quot;tableValues&quot;: [<br>        &quot;data.errorType&quot;,<br>        &quot;data.errorMessage&quot;,<br>        &quot;count&quot;<br>    ],<br>    &quot;func&quot;: &quot;Count&quot;,<br>    &quot;minQty&quot;: 5,<br>    &quot;sort&quot;: &quot;Count DESC&quot;<br>}</pre><h4>Sorting Results with Sort and SortField</h4><ol><li><strong>sort</strong>: For sorting the final DataTable results</li><li><strong>sortField</strong>: For sorting the Elasticsearch query results</li></ol><h4>Using SortField for Query Sorting</h4><p>The <strong>sortField </strong>parameter determines how Elasticsearch should sort the records when retrieving them.</p><pre>{<br>    &quot;indexTag&quot;: &quot;application-logs&quot;,<br>    &quot;luceneQueryLanguage&quot;: &quot;level:ERROR&quot;,<br>    &quot;tableHeaders&quot;: [<br>        { &quot;label&quot;: &quot;Timestamp&quot; },<br>        { &quot;label&quot;: &quot;Error&quot; }<br>    ],<br>    &quot;tableValues&quot;: [<br>        &quot;timestamp&quot;,<br>        &quot;error.message&quot;<br>    ],<br>    &quot;sortField&quot;: &quot;@timestamp:desc&quot;,<br>    &quot;querySize&quot;: 1000<br>}</pre><ul><li><strong>@timestamp:desc</strong>: Sort by timestamp, newest first</li><li><strong>@timestamp:asc</strong>: Sort by timestamp, oldest first</li><li><strong>data.responseTime:desc</strong>: Sort by response time, highest first</li><li><strong>@timestamp:desc,data.severity:asc</strong>: Multiple fields</li></ul><h4>Sort vs SortField</h4><ul><li><strong>sortField</strong>: Applies at query time, affects how Elasticsearch retrieves data.</li><li><strong>sort</strong>: Applies after data processing, affects final table presentation</li></ul><pre>{<br>    &quot;indexTag&quot;: &quot;application-logs&quot;,<br>    &quot;luceneQueryLanguage&quot;: &quot;level:ERROR&quot;,<br>    &quot;tableHeaders&quot;: [<br>        { &quot;label&quot;: &quot;Error Type&quot; },<br>        { &quot;label&quot;: &quot;Count&quot; }<br>    ],<br>    &quot;tableValues&quot;: [<br>        &quot;error.type&quot;,<br>        &quot;count&quot;<br>    ],<br>    &quot;func&quot;: &quot;Count&quot;,<br>    &quot;sortField&quot;: &quot;@timestamp:desc&quot;,  // Sort raw data by time<br>    &quot;sort&quot;: &quot;Count DESC&quot;             // Sort final results by count<br>}</pre><h3>Creating and Using Saved Queries in Kibana</h3><p>Before using a saved query in our API, scheduled jobs etc., we need to create it in Kibana. Here’s how:</p><h4>Creating a Saved Query</h4><ul><li>Log in to your Kibana dashboard</li><li>Navigate to <strong>Discover</strong></li><li>Select your <strong>data view</strong> (e.g., “<strong>weatherforecast</strong>”)</li><li>Change your query language to “<strong>Lucene</strong>” (optional but more consistant)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*ctJ4rlY8Z7n32me6K01RDQ.png" /><figcaption>query language</figcaption></figure><ul><li>Write your query and click the <strong>Save</strong> button</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*UyGRkVwUbP7I7faaDfngRg.png" /></figure><ul><li>Fill the necessary fields and click the Save button.</li><li>a. In order to easily access your saved query later, you can create and give a tag with a name that suits you, such as SavedQuery.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*fK4_qqpJ-QW9rgBaM8N4Sw.png" /></figure><ul><li>You can access the queries you have saved from the ‘<strong>Open</strong>’ button on the top right.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*cyuQ_Qr8KbAtBsGXznUZng.png" /></figure><ul><li>It will open the page of the query you saved. You will see the ID of the query you just created and saved in the URL.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*dd8UOhTuUyJVB2_x2veXyg.png" /><figcaption>Saved Query ID</figcaption></figure><h3>Conclusion</h3><p>This API provides a flexible way to extract and transform Elasticsearch log data into structured tables. You can easily adapt the implementation to suit your specific needs, whether you’re building a monitoring dashboard or setting up automated reporting. While I have demonstrated it as a REST API, you could also integrate it with <strong>scheduled jobs</strong> to create an automated <strong>error detection</strong> and <strong>notification system</strong>, <strong>sending email</strong> alerts when critical issues are detected in your logs.</p><p>The code is available on <a href="https://github.com/sequester0/ElasticsearchMedium"><strong>GitHub Repository</strong></a>, and I encourage you to explore and adapt it for your use case. If you discover bugs or have ideas for improvements, don’t hesitate to open an issue or submit a pull request. Every contribution helps make log analysis more accessible and efficient for the developer community.</p><p>I hope this guide helps you get started with processing Elasticsearch logs.</p><h3>References</h3><ul><li><a href="https://www.elastic.co/guide/en/kibana/current/docker.html">Install Kibana with Docker</a></li><li><a href="https://www.elastic.co/guide/en/kibana/current/lucene-query.html">Lucene query syntax</a></li><li><a href="https://www.elastic.co/docs/api/doc/elasticsearch">Elasticsearch API documentation</a></li><li><a href="https://www.elastic.co/docs/api/doc/kibana">Kibana API</a></li></ul><p><a href="https://www.linkedin.com/in/ibrahimkeremgumus/">LinkedIn | Kerem Gümüş</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a06785ca5082" width="1" height="1" alt=""><hr><p><a href="https://medium.com/arvatotech/a-developers-guide-to-processing-elasticsearch-logs-with-net-from-query-to-html-table-a06785ca5082">A Developer’s Guide to Processing Elasticsearch Logs with .NET: From Query to HTML Table</a> was originally published in <a href="https://medium.com/arvatotech">Arvato Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Setup Your Own Git Server on Ubuntu with Gitea & Docker]]></title>
            <link>https://medium.com/arvatotech/how-to-setup-your-own-git-server-on-ubuntu-with-gitea-docker-7a61baf32077?source=rss-95fa422d8001------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a61baf32077</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Kerem Gümüş]]></dc:creator>
            <pubDate>Sun, 01 Sep 2024 14:01:05 GMT</pubDate>
            <atom:updated>2024-09-03T11:06:25.219Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o9ldyp-ibHQhr4scgLlhUA.png" /></figure><h3>Introduction</h3><p>Version control is key for managing and sharing code. Gitea is a free and open-source Git service written in Go. It’s a lightweight and easy-to-use alternative to other Git platforms. It includes a simple interface, issue tracking, and works well with popular Git features.</p><p>In this guide, I’ll show you how to set up a Git server on Ubuntu using Gitea and Docker. By the end, you’ll have your own Git server ready for personal or team use.</p><h3>Setting Up Your Git Server with Gitea and Docker on Ubuntu</h3><ul><li>First you need to update your packages:</li></ul><pre>sudo apt update -y</pre><ul><li>The following command will create a system user named “git” with a specific home directory and no password, making it ideal for hosting your Git server without unnecessary access to other parts of your system.</li><li>After running the command below, we save the UID and GID values as we will use them in our <strong>docker-compose.yml</strong> file:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*jWr6pnfdAMhoD4RtKiy1Vw.png" /><figcaption>UID and GID values</figcaption></figure><pre>sudo adduser --system --shell /bin/bash --gecos &#39;Git Version Control&#39; --group --disabled-password --home /home/git git</pre><ul><li>Next, you’ll need to create a directory where Gitea will be installed and store its files. This directory will serve as the home for your Gitea instance, allowing you to manage its data and configuration easily. The following commands will create the directory and navigate into it:</li></ul><pre>mkdir ~/gitea<br>cd ~/gitea</pre><ul><li>Now that you’re in the Gitea directory, the next step is to create and edit a <strong>docker-compose.yml</strong> file. This file will define the Docker containers needed to run your Git server. To create and open this file in a text editor, use the following command:</li></ul><pre>nano docker-compose.yml</pre><ul><li>In the <strong>docker-compose.yml</strong> file, you&#39;ll define the configuration for your Gitea service, including the Docker image, network settings, environment variables and volume mappings. The following configuration will set up Gitea with the necessary environment settings, network, and volume mappings, as well as expose the relevant ports for accessing the Gitea web interface and SSH.</li><li>After adding this configuration, save and close the file to proceed with running the Docker containers:</li></ul><pre>version: &quot;3&quot;<br><br>networks:<br>  gitea:<br>    external: false<br><br>services:<br>  server:<br>    image: gitea/gitea:latest<br>    container_name: gitea<br>    environment:<br>      - USER_UID=&lt;YOUR UID&gt;<br>      - USER_GID=&lt;YOUR GID&gt;<br>    restart: always<br>    networks:<br>      - gitea<br>    volumes:<br>      - ./gitea:/data<br>      - /home/git/.ssh/:/data/git/.ssh<br>      - /etc/timezone:/etc/timezone:ro<br>      - /etc/localtime:/etc/localtime:ro<br>    ports:<br>      - &quot;3000:3000&quot;<br>      - &quot;2222:22&quot;</pre><ul><li>To install Docker Compose:</li></ul><pre>sudo apt install docker-compose</pre><ul><li>To start your Gitea service defined in the <strong>docker-compose.yml</strong> file:</li></ul><pre>docker-compose up -d</pre><ul><li>After that you can access your Gitea server like below:</li></ul><pre>http://&lt;your-ip&gt;:3000/</pre><h3>Optional: Installing Nginx</h3><p>To further enhance your Gitea setup, installing Nginx as a reverse proxy can provide additional benefits such as improved security, better performance, and advanced configuration options.</p><ul><li>To begin setting up Nginx, first ensure that you are in your home directory.</li></ul><pre>cd<br>sudo apt install nginx</pre><ul><li>To ensure that Nginx can accept incoming connections, you need to configure your firewall to allow HTTP and HTTPS traffic. By allowing “Nginx Full” in the UFW (Uncomplicated Firewall) settings, you grant permission for both ports 80 (HTTP) and 443 (HTTPS) to be accessed.</li></ul><pre>sudo ufw allow &quot;Nginx Full&quot;</pre><ul><li>To configure Nginx to work with Gitea, you need to create and edit a new configuration file for Gitea.</li></ul><pre>sudo nano /etc/nginx/sites-available/gitea</pre><ul><li>In the Nginx configuration file, you’ll set up a server block to manage requests and proxy them to your Gitea instance.</li><li>In this section, you need to pay attention to the <strong>client_max_body_size</strong> parameter. If the size of the file you will upload is bigger than the value written here, you will encounter a “<strong>413 Request Entity Too Large</strong>” error while uploading the file.</li></ul><pre>server {<br> # Listen for requests on your domain/IP address.<br> server_name &lt;YOUR_SERVER_IP_ADDRESS&gt;;<br> <br> root /var/www/html;<br> <br> location / {<br>  # Make sure client_max_body_size is large enough, otherwise there would be &quot;413 Request Entity Too Large&quot; error when uploading large files.<br>  client_max_body_size 512M;<br>  <br>  # Proxy all requests to Gitea running on port 3000<br>  proxy_pass http://localhost:3000;<br>  <br>  # Pass on information about the requests to the proxied service using headers<br>  proxy_set_header HOST $host;<br>  proxy_set_header X-Forwarded-Proto $scheme;<br>  proxy_set_header X-Real-IP $remote_addr;<br>  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br> }<br>}</pre><ul><li>To activate the Nginx configuration for Gitea, you need to create a symbolic link from the “<strong>sites-available</strong>” directory to the “<strong>sites-enabled</strong>” directory.</li></ul><pre>sudo ln -s /etc/nginx/sites-available/gitea /etc/nginx/sites-enabled/gitea</pre><ul><li>After setting up your Nginx configuration, it’s crucial to test the configuration for syntax errors and ensure that it is valid before applying it. This helps prevent issues that might arise from incorrect configurations.</li></ul><pre>sudo nginx -t</pre><p>If you see output like below, then there is no problem with your configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*yxA7bQdPJrRq9KLR17nDIQ.png" /></figure><ul><li>Once you’ve verified that your Nginx configuration is correct, you need to restart Nginx to apply the new settings. Restarting Nginx will reload the configuration and start serving traffic according to the updated rules.</li></ul><pre>sudo systemctl restart nginx</pre><ul><li>Now you can access your Gitea like below:</li></ul><pre>http://&lt;your-ip&gt;/</pre><h3>Accessing Gitea for Initial Configuration</h3><p>You are now ready to finalize your Gitea setup. The next step is to access the Gitea web interface(server ip address) through your browser.</p><p>When you access the interface, you will see an initial configuration page as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TjBMo2PsxGNN31a0xRk6BA.png" /><figcaption>Gitea Initial Configuration Page</figcaption></figure><ul><li>Here you can change the site title and browse the different settings. I continue with the “<strong>Install Gitea</strong>” button without making any settings.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*je433OSZj8p11h4iRjsuzQ.png" /></figure><ul><li>When the installation is complete, you will see the Login/Register page. The user who registers after the first installation is the user with <strong>Admin </strong>authorization.</li></ul><p>You have now completed the setup of your own system for version control.</p><h3>Optional: Additional Configuration for Registration</h3><p>If you want to close access to the registration section and only the user with admin authorization to create a user and only these users can access the system, you can follow the path below.</p><ul><li>You have to adjust Gitea <strong>app.ini</strong> file. In below command you can access <strong>app.ini</strong> file:</li></ul><pre>nano ~/gitea/gitea/gitea/conf/app.ini</pre><ul><li>After accessing this file, you must set the <strong>DISABLE_REGISTRATION</strong> parameter to <strong>true</strong>.</li></ul><pre>[service]<br>DISABLE_REGISTRATION = true</pre><ul><li>Then we restart our docker container to apply our change.</li></ul><pre>docker restart gitea</pre><ul><li>When we try to access the registration page, we will see a warning.</li></ul><h3>Conclusion</h3><p>In this guide, we walked through the process of setting up your own Git server using Gitea and Docker also Nginx on an Ubuntu system. By following these steps, you now have a fully operational Gitea instance tailored to your needs. Should you encounter any issues or need further customization, Gitea’s documentation and community resources are valuable tools to help you get the most out of your setup.</p><h3>References</h3><ul><li><a href="https://docs.gitea.com/">What is Gitea? | Gitea Documentation</a></li><li><a href="https://docs.gitea.com/installation/install-with-docker">Installation with Docker | Gitea Documentation</a></li><li><a href="https://docs.gitea.com/administration/reverse-proxies">Reverse Proxies | Gitea Documentation</a></li></ul><p><a href="https://www.linkedin.com/in/ibrahimkeremgumus/">LinkedIn | Kerem Gümüş</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a61baf32077" width="1" height="1" alt=""><hr><p><a href="https://medium.com/arvatotech/how-to-setup-your-own-git-server-on-ubuntu-with-gitea-docker-7a61baf32077">How to Setup Your Own Git Server on Ubuntu with Gitea &amp; Docker</a> was originally published in <a href="https://medium.com/arvatotech">Arvato Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Demystifying gRPC: A Beginner’s Guide to High-Performance API Communication]]></title>
            <link>https://medium.com/arvatotech/demystifying-grpc-a-beginners-guide-to-high-performance-api-communication-842c470e83ed?source=rss-95fa422d8001------2</link>
            <guid isPermaLink="false">https://medium.com/p/842c470e83ed</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[grpc]]></category>
            <category><![CDATA[net-core]]></category>
            <dc:creator><![CDATA[Kerem Gümüş]]></dc:creator>
            <pubDate>Thu, 16 Nov 2023 10:29:47 GMT</pubDate>
            <atom:updated>2024-03-04T09:19:45.060Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h4pGp9t0q_JzyfeHPZoFvA.jpeg" /></figure><h3>Introduction</h3><p>Efficient API communication is a critical aspect of modern software development for several reasons like performance, scalability, bandwidth and resource usage.</p><ul><li><strong>Performance</strong>: In today’s distributed and microservice-based architectures, software systems often rely on multiple services communicating over the network. <strong>Inefficient</strong> communication can lead to increased <strong>latency</strong>, slower <strong>response times</strong> and decreased all overall <strong>system performance</strong>.</li><li><strong>Scalability</strong>: As software systems grow, the number of API calls and the volume of data exchanged can increase significantly. Efficient API communication is crucial for maintaining system performance and scalability a the load on the grows.</li><li><strong>Bandwidth and Resource Usage</strong>: Inefficient communication can lead to unnecessary use of network bandwidth and server resources. This can result in higher infrastructure costs and suboptimal resource utilization.</li></ul><h3>Why Choose gRPC ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iuoVblHcWKRm02pwjCo1HQ.png" /><figcaption>workflow</figcaption></figure><p><strong>gRPC</strong> is a high-performance and efficient remote procedure call (RPC) framework developed by Google. Allows us to use another service or a method on remote server as if it were the method on of our own service. Offers easy, secure and fast communication in the client-server relationship.</p><ul><li><strong>Protocol Buffers (</strong>ProtoBuf<strong>)</strong>: gRPC uses Protocol Buffers as its interface definition language for defining service contracts and message structures. ProtoBuf is a compact and highly efficient <strong>binary serialization </strong>format that reduces both message size and parsing overhead.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rFN2eIFzkUqM3Xb-2n5pSA.png" /></figure><ul><li><strong>HTTP/2</strong>: It uses HTTP/2 as its transport protocol, which is desgined for <strong>low latency</strong> and efficient multiplexing. This enables multiple requests and responses to be multiplexed over a single connection, reducing overhead and improving performance.</li><li><strong>Bidirectional Streaming</strong>: gRPC supports bidirectional streaming, allowing both the client and server to send a stream of messages to each other over a single connection. This i a particularly useful for real-time communication and interactive applications.</li><li><strong>Code Generation</strong>: gRPC generates client and server code in various programming languages based on the service definition, which ensures type safety and reduces the likelihood of API-related errors.</li></ul><h3>Example gRPC Usage</h3><p>Suppose we have two services called Discount and Basket. Our discount service can be considered as a service we have created to manage discounts for products. Our basket service is a service where we can add, remove or update products before purchasing.</p><p>When adding a product to our basket, we need to check whether there is a discount defined for this product. For this, we have to communicate with our Discount service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F-6TjkDbdVjUWnjpnDruDg.png" /><figcaption>basket and discount service relation</figcaption></figure><p>As seen above, gRPC contains microservices in the adding products to the basket step of a project. The gRPC IDLs to be used in the communication methods and models Discount service are defined on “discount.proto”. We have to define the methods and models we will use in the gRPC integration on the proto file. We need to define this “discount.proto” file on both client and server side. The proto file defines the structure of the messages and gRPC services used in communication. Both services need to agree on this contract to communicate effectively. They generate code based on this shared contract to serialize/deserialize messages and handle gRPC calls.</p><p>Since gRPC is programming language independent, we can use different languages for the services, but in this example we will only see our Discount service developed with .NET.</p><h3>gRPC Implementation with .NET</h3><ul><li>First of all, we create a new gRPC project on Visual Studio.</li><li>After the project is created, you can see the file structure. Let’s open the “<strong>Protos</strong>” folder in this section. You can examine the “<strong>greet.proto</strong>” file if you want, then delete this file.</li><li>Now let’s create our “<strong>discount.proto</strong>” file and specify our model and methods.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*v8EyB5psO3ivz-66YfHJeg.png" /><figcaption>project folder structure</figcaption></figure><ul><li>We specified the methods, message types and their field.</li></ul><pre>syntax = &quot;proto3&quot;;<br><br>option csharp_namespace = &quot;MyGrpcService.Protos&quot;;<br><br>service DiscountProtoService {<br> // Methods<br> rpc GetDiscount (GetDiscountRequest) returns (DiscountModel);<br> rpc CreateDiscount (CreateDiscountRequest) returns (DiscountModel);<br> rpc UpdateDiscount (UpdateDiscountRequest) returns (UpdateDiscountResponse);<br> rpc DeleteDiscount (DeleteDiscountRequest) returns (DeleteDiscountResponse);<br>}<br><br>message GetDiscountRequest {<br> string productName = 1; <br>}<br><br>message DiscountModel {<br> int32 id = 1;<br> string productName = 2;<br> string description = 3;<br> int32 amount = 4;<br>}<br><br>message CreateDiscountRequest {<br> DiscountModel discount = 1;<br>}<br><br>message UpdateDiscountRequest {<br> DiscountModel discount = 1;<br>}<br><br>message DeleteDiscountRequest {<br> string productName = 1;<br>}<br><br>message DeleteDiscountResponse {<br> bool success = 1;<br>}<br><br>message UpdateDiscountResponse {<br> bool success = 1;<br>}</pre><ul><li>In order for our <strong>gRPC</strong> code to be generated automatically, we edit the properties of our “<strong>discount.proto</strong>” file as follows.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/337/1*cbCQ_zG6rpoa-aYLTzaIVw.png" /></figure><ul><li>Now when we build the project, this code will be generated automatically on the back side. After the build, if you want to examine it, we can see the generated file as follows by clicking the “<strong>Show all files</strong>” button.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/1*tQKW9G1mVN5i47Q3lSUQNw.png" /></figure><ul><li>Here is an example service that implements this concept.</li></ul><pre>using Grpc.Core;<br>using MyGrpcService.Protos;<br>using MyGrpcService.Repositories;<br><br>namespace MyGrpcService.Services;<br><br>public class DiscountService(IDiscountRepository _repository, ILogger&lt;DiscountService&gt; _logger) : DiscountProtoService.DiscountProtoServiceBase<br>{<br>    public override async Task&lt;DiscountModel&gt; GetDiscount(GetDiscountRequest request, ServerCallContext context)<br>    {<br>        var discount = await _repository.GetDiscountAsync(request.ProductName);<br><br>        if (discount == null)<br>        {<br>            throw new RpcException(new Status(StatusCode.NotFound, $&quot;Discount with ProductName={request.ProductName} is not found.&quot;));<br>        }<br><br>        _logger.LogInformation($&quot;Discount is retrieved for ProductName: {discount.ProductName}, Amount: {discount.Amount}&quot;);<br><br>        return discount;<br>    }<br><br>    public override async Task&lt;DiscountModel&gt; CreateDiscount(CreateDiscountRequest request, ServerCallContext context)<br>    {<br>        var discount = await _repository.GetDiscountAsync(request.Discount.ProductName);<br><br>        if (discount != null)<br>        {<br>            throw new RpcException(new Status(StatusCode.AlreadyExists, $&quot;Discount with ProductName={request.Discount.ProductName} already exists.&quot;));<br>        }<br><br>        await _repository.CreateDiscountAsync(request.Discount);<br>        _logger.LogInformation($&quot;Discount is successfully created. ProductName : {request.Discount.ProductName}&quot;);<br><br>        return request.Discount;<br>    }<br><br>    public override async Task&lt;UpdateDiscountResponse&gt; UpdateDiscount(UpdateDiscountRequest request, ServerCallContext context)<br>    {<br>        var discount = await _repository.GetDiscountAsync(request.Discount.ProductName);<br><br>        if (discount == null)<br>        {<br>            throw new RpcException(new Status(StatusCode.NotFound, $&quot;Discount with ProductName={request.Discount.ProductName} is not found.&quot;));<br>        }<br><br>        var updated = await _repository.UpdateDiscountAsync(request.Discount);<br>        _logger.LogInformation($&quot;Discount is successfully updated. ProductName : {request.Discount.ProductName}&quot;);<br><br>        return new UpdateDiscountResponse { Success = updated };<br>    }<br><br>    public override async Task&lt;DeleteDiscountResponse&gt; DeleteDiscount(DeleteDiscountRequest request, ServerCallContext context)<br>    {<br>        var discount = await _repository.GetDiscountAsync(request.ProductName);<br><br>        if (discount == null)<br>        {<br>            throw new RpcException(new Status(StatusCode.NotFound, $&quot;Discount with ProductName={request.ProductName} is not found.&quot;));<br>        }<br><br>        var deleted = await _repository.DeleteDiscountAsync(request.ProductName);<br>        _logger.LogInformation($&quot;Discount is successfully deleted. ProductName: {request.ProductName}&quot;);<br><br>        return new DeleteDiscountResponse { Success = deleted };<br>    }<br>}</pre><p>In order not to extend the article further, I will show examples via postman. Through Postman, you can select the proto file you have developed and the methods will be drawn automatically you have defined directly to postman.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b0OshmGOH_eoOEXljfS7cg.png" /><figcaption>postman example</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BFuPwK57hnyA4UWmpKVn1w.png" /><figcaption>console</figcaption></figure><h3>Conclusion</h3><p>In this guide, we’ve delved into the world of gRPC and uncovering a robust solution for high-performance API communication.</p><h4>Key Takeaways</h4><p><strong>Efficiency and Performance</strong>: gRPC, powered by HTTP/2, redefines efficiency in API communication, boasting multiplexing, header compression and asynchronous streaming for lightning-fast interactions.</p><p><strong>Protocol Buffers for Service Definition</strong>: Protocol Buffers offer a language-agnostic way to define services and messages, ensuring strong typing, consistency and ease of use across platform.</p><p><strong>Automatic Code Generation</strong>: The ability of gRPC to generate client and server code simplifies development, reducing boilerplate code<strong> </strong>and accelerating the implementation process.</p><p>In wrapping up, gRPC emerges as a game-changer in the realm of API communication, seamlessly integrating with .NET 8 to offer unparalleled speed, scalability and versatility. Its ability to define services through Protocol Buffers, automate code generation and harness the efficiency of HTTP/2 highlights its significance in modern software development.</p><p>I hope you enjoyed reading this article. I wish everyone a pleasant day :)</p><h3>References</h3><ul><li><a href="https://learn.microsoft.com/en-us/aspnet/core/tutorials/grpc/grpc-start?view=aspnetcore-8.0&amp;tabs=visual-studio">Create a .NET Core gRPC client and server in ASP.NET Core</a></li><li><a href="https://grpc.io/">gRPC</a></li></ul><p><a href="https://www.linkedin.com/in/ibrahimkeremgumus/">LinkedIn | Kerem Gümüş</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=842c470e83ed" width="1" height="1" alt=""><hr><p><a href="https://medium.com/arvatotech/demystifying-grpc-a-beginners-guide-to-high-performance-api-communication-842c470e83ed">Demystifying gRPC: A Beginner’s Guide to High-Performance API Communication</a> was originally published in <a href="https://medium.com/arvatotech">Arvato Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>