<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: João</title>
    <description>The latest articles on DEV Community by João (@joaopms).</description>
    <link>https://dev.to/joaopms</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F8777%2Fbb8c7722-1e35-48ff-8f24-715aac5c3088.jpg</url>
      <title>DEV Community: João</title>
      <link>https://dev.to/joaopms</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/joaopms"/>
    <language>en</language>
    <item>
      <title>Plans for my web server</title>
      <dc:creator>João</dc:creator>
      <pubDate>Wed, 27 Feb 2019 00:36:21 +0000</pubDate>
      <link>https://dev.to/joaopms/plans-for-my-web-server-3fbm</link>
      <guid>https://dev.to/joaopms/plans-for-my-web-server-3fbm</guid>
      <description>&lt;p&gt;I currently own a small VPS server hosted at OVH. It serves as a home to a few experiments with Linux, some files that I needed to share and a clown fiesta of security issues and running web services that I setup months ago and eventually forgot.&lt;/p&gt;

&lt;p&gt;Although I'm still learning how to work with Linux and how to secure a server, I've learned from my mistakes and developed a new and improved plan.&lt;/p&gt;

&lt;h2&gt;
  
  
  The old plan
&lt;/h2&gt;

&lt;p&gt;Two years ago, I was amazed by sysadmins and how they managed to setup their servers. Inspired by them and hoping I could enforce some security, I wrote down some key points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Only ports 80 (HTTP), 443 (HTTPS) and 22 (SSH) are open&lt;/li&gt;
&lt;li&gt;Every service has a specific Linux account&lt;/li&gt;
&lt;li&gt;Every service listens on localhost&lt;/li&gt;
&lt;li&gt;nginx exposes those services via reverse proxies&lt;/li&gt;
&lt;li&gt;nginx routes traffic to services using sub domains&lt;/li&gt;
&lt;li&gt;Let's Encrypt certificates for every sub domain&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything looked great and I was excited, but as time went by, this plan quickly stabbed me in the back.&lt;/p&gt;

&lt;h2&gt;
  
  
  Old plan flaws
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Permissions became a pain in the butt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A few things didn't work because the working directory of a service wasn't created with the right account and &lt;code&gt;sudo&lt;/code&gt; needed to be used every time I wanted to publish a temporary file; needless to say, there are some files and directories with permissions set to 777.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Services' working directory weren't centralized&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Shared files lived on &lt;code&gt;/var/www/static&lt;/code&gt;, a Node.js app ran on &lt;code&gt;~/dev/nodejs/app&lt;/code&gt;, ...&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;nginx's config file had lots of repeated blocks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Since every service/sub domain had two blocks - HTTPS reverse proxy and HTTP to redirect to HTTPS - a lot of blocks were identical due to the logic being the same for all the services.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Certificates for every sub domain&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At the time, Let's Encrypt didn't support wildcard certificates; thereby, the certificate had to be updated every time I wanted to deploy a new service. It wasn't that bad, just something that can now be avoided.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Unused/broken services&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Services stopped being used, things broke, memory leaks happened and I didn't even notice. This &lt;em&gt;definitely&lt;/em&gt; needs to be improved.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The master plan
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use Docker to isolate, control and centralize services; this also allows me to test new shiny &lt;del&gt;JS frameworks&lt;/del&gt; services without polluting the whole system with unwanted packages&lt;/li&gt;
&lt;li&gt;Figure how to generate a nginx config file from a simplified config file&lt;/li&gt;
&lt;li&gt;Upgrade to Let's Encrypt's wildcard certificates&lt;/li&gt;
&lt;li&gt;Move infrequently accessed files to some external cold storage solution&lt;/li&gt;
&lt;li&gt;Create a nice personal page with details about me&lt;/li&gt;
&lt;li&gt;Host a MySQL/MariaDB database with semi-automated account creation and deletion&lt;/li&gt;
&lt;li&gt;Develop a web app to manage shared files&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;What do you think about this new plan? Would you do something in a different way? Suggestions are appreciated!&lt;/p&gt;

</description>
      <category>devops</category>
    </item>
    <item>
      <title>How do you deal with naming when you're bilingual?</title>
      <dc:creator>João</dc:creator>
      <pubDate>Mon, 20 Nov 2017 23:26:29 +0000</pubDate>
      <link>https://dev.to/joaopms/how-do-you-deal-with-naming-when-youre-bilingual-2fo</link>
      <guid>https://dev.to/joaopms/how-do-you-deal-with-naming-when-youre-bilingual-2fo</guid>
      <description>&lt;p&gt;For those who are bilingual, how do you name your variables and functions? What about comments? Do you only use your mother tongue? Do you mix the languages?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For example:&lt;/strong&gt; You're Portuguese and use English for all of your projects, but now you have a project that needs to be in Portuguese (only the frontend); what's your plan?&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
  </channel>
</rss>
