Follow

Category: General

Automatic Deployment Using GitHub Actions

Posted on January 28, 2022 by in General, Software Development

Software development is a continuous process, with regular code updates from time to time. Whether from adding new features, fixing bugs or just performing general chores like updating project dependencies now and then. One effective approach to easily push and preview these local development changes to a staging or production environment is to create a continuous integration and deployment workflow. In the next few steps, I will teach you how to automatically deploy your project from GitHub to cloud server using GitHub Actions.

Prerequisites:

GitHub Account

In order to use GitHub actions you should have a GitHub account.

Cloud Server

You will also need a cloud server on which we will deploy the React app. For this tutorial we are going to a React app to keep the process of deployment simple.

Let’s go through some fundamentals

What is CICD?


CI and CD stand for continuous integration and continuous delivery/continuous deployment. In very simple terms, CI is a modern software development practice in which incremental code changes are made frequently and reliably. Automated build-and-test steps triggered by CI ensure that code changes being merged into the repository are reliable. The code is then delivered quickly and seamlessly as a part of the CD process. In the software world, the CI/CD pipeline refers to the automation that enables incremental code changes from developers’ desktops to be delivered quickly and reliably to production.

Why CICD?

CI/CD allows organizations to ship software quickly and efficiently. CI/CD facilitates an effective process for getting products to market faster than ever before, continuously delivering code into production, and ensuring an ongoing flow of new features and bug fixes via the most efficient delivery method.

GitHub Actions

GitHub Actions helps you automate tasks within your software development life cycle. GitHub Actions are event-driven, meaning that you can run a series of commands after a specified event has occurred. For  example, every time someone creates a pull request for a repository, you can automatically run a command that executes a software testing script.
What can you do with GitHub Actions? The possibilities are limitless, you could do anything from:

  • Handling CI and CD (Build, test, and deploy applications)
  • Performance monitoring
  • Twilio voice call or SMS alerts

and much more!

Let’s Start

Our target here is to see how automatic deployment of a react project from GitHub to cloud server can be done using GitHub Actions.

Create Project Repo

For this project I used react-app-deployment-GitHub-action as the repo name.

Create React Project

Step 1

Clone the empty repository.

Step 2

Create the basic react app using create-react-app command.

Please checkout more about how to create a new react app here.

Step 3

Run the base app verify that there are no issues.

Step 4

Commit and push the code to GitHub.

Add GitHub Action workflow

Now that we have the react app in the repository, we can go ahead and create the GitHub Action workflow for deployment.

Step 1

Go to Actions tab.

Step 2

Select Node.js workflow.

Step 3

Create the workflow file.

Firstly rename the file as react-app-deployment.yml (you can use any filename).
Edit the new file and paste the following content.

Commit the file to the repo with a commit message.

Let’s break the above yml file and understand what we are trying to do.

This is the name of the workflow.

Here we are telling when this workflow should trigger. In my example I want this workflow to trigger whenever someone pushes code to the master branch.

A job is a set of steps that execute on the same runner. By default, a workflow with multiple jobs will run those jobs in parallel. You can also configure a workflow to run jobs sequentially. For example, a workflow can have two sequential jobs: build and test code, where the test job is dependent on the status of the build job. If the build job fails, the test job will not run.

For our purpose we just want to do deployment so we just have 1 job.

Configures the job to run on a self hosted server. Since we want to deploy the project on our cloud server.

For now we just want to use node version 16 for our react portal. But if you want to use GitHub actions for testing and you have a piece of code written in node and want to test it across different node versions then you can mention that in the node-version array.

For our purpose we just want to deploy on a server so we will go ahead with Node v16.

Groups together all the steps that run in the job. Each item nested under this section is a separate action or shell command.

The uses keyword tells the job to retrieve v2 of the community action named actions/checkout@v2 . This is an action that checks out your repository and downloads it to the runner, allowing you to run actions against your code (such as testing tools). You must use the checkout action any time your workflow will run against the repository’s code or you are using an action defined in the repository.

This step uses the actions/setup-node@v2 action to install the specified version of the node software package on the runner, which gives you access to the npm command.

Finally we would like to install the node dependencies and build the production files. Optionally you can even run the test cases.

Note that as soon as you commit the file the workflow will start. Since the workflow file is being pushed to the master branch.

This workflow will fail since we did not yet tell GitHub which server to use to run the workflow on.

Setup GitHub Runner

We have the workflow in place but we still did not specify which self hosted server to use. For this you need to add a GitHub Runner to the repo.

Step 1

Go to Settings tab.

Step 2

Go to Actions tab, and click on New self-hosted runner.

Step 3

Select the runner type. We are going to use a Linux server.

Step 4

You will see a bunch of commands which will guide you through the installation process.

Run the above download steps on your server.

Step 5

Please run all the commands in the same order in which they are shown to download.

Step 6

When you configure your runner please fill in the details which are asked.

You can give a name to your runner and also give a name for the work folder.

Step 7

Finally run the run script.

This will start your runner and it will start listening for the workflow events.

Step 8

Confirm that the runner is running.
Go to Settings > Actions > Runners

You will find that your runner is available and ready to take on any job.

Trigger workflow

Let’s go back to our project file and make a small change to see how this workflow runs now.

Step 1

Make a dummy update to base react app.

For now I added a h1  tag

Step 2

Commit and push the code. Go to the Actions tab and you will find your workflow running

Step 3

You can click on the latest workflow and check the details of the build job.
You will find all the steps and it will also show you the time it took for each step.

Step 4

Login to your server and you will find the build files inside actions-runner folder.

Here all the build files are there which can be served via apache or nginx.

Nginx Setup

I would like to keep this setup very simple.

Step 1

Install nginx

Step 2

Update the default nginx file

Step 3

Update the root path to your build file.

Here I am telling nginx to load the files from my react project.

Step 4

Restart nginx  service

Step 5

Open your server IP address and you will your react app.

Keep GitHub Runner running

You will find that after you close your server terminal where ./run.sh was running, your GitHub runner stopped.

What you can do instead is run the following command.

  1. Stop the self-hosted runner application if it is currently running.
  2. Install the service with the following command:
  3. Start the service with the following command:

You can find more details about this here.

Conclusion

Overall, I very much enjoy the experience of using GitHub Actions. I think it’ll be the future standard of CI/CD platforms. Every time I use GitHub Actions I’m delighted by how fast I can create workflows to automate a manual task and find new patterns to use GitHub Actions.

References

Posted By: Vishnu Kyatannawar, Osmosee

Nextcloud: Why Should You?

Posted on January 7, 2022 by in General, NextCloud


Nextcloud is open source file sync and share software for everyone from individuals operating the free Nextcloud Server in the privacy of their own home, to large enterprises and service providers supported by the Nextcloud Enterprise Subscription. Nextcloud provides a safe, secure, and compliant file synchronization and sharing solution on servers that you control.

You can share one or more files and folders on your computer, and synchronize them with your Nextcloud server. Place files in your local shared directories, and those files are immediately synchronized to the server and to other devices using the Nextcloud Desktop Sync Client, Android app, or iOS app.

Why should you?

There are multiple reasons to adopt nextcloud. Let’s dive into this and look at some of the features nextcloud has to offer that suits your business needs.

On Premises

Nextcloud is, hands down, the best on-premise cloud server platform on the market. Not only is it easy to deploy, it’s also reliable and expandable.

Unlike cloud storage, on-premises storage relies on infrastructure at your Company’s brick and mortar office to manage your data. You’ll own all of the equipment and you will be responsible for the lifecycle management. As you might guess, there are several pros and cons of on-premises solutions for data storage.

Though cloud-storage has been all the rage lately, some companies still believe that on-premises solutions are best suited for their business needs. For example, many enjoy the greater security that on-premises solutions and storage give their data. On-premises storage is a great option for your business because it can:

  • Operate without internet
  • Lower monthly internet costs
  • Provide greater security
  • Offer control over server hardware

Control & Compliant by design

Protect, control and monitor data and communication across your company. Guarantee compliance with business and legal requirements. Keep your data on servers you own, at all times. Nothing leaks, not even metadata.

Nextcloud products are designed with compliance in mind, providing extensive data policy enforcement, encryption, user management and auditing capabilities example: HIPAA, GDPR and more.

Your teams are using email attachments, public chat apps and consumer file sharing tools to communicate and collaborate. Then nextcloud is the best option to keep that under control

  • Host your own collaboration platform.
  • Protect your IT investment by re-using existing infrastructure.
  • Ensure compliance, security and flexibility.
  • Know where your data is, who has access and how it is used.
  • Facilitate secure collaboration and communication.

Security and Authentication


There is a lot to talk about security in nextcloud.

Nextcloud is designed to protect user data through multiple layers of protection. It aligns with industry standards such as Clause 14 of ISO/IEC27001-2013 and related standards, guidance and security principles. Their solution is built around combined assurance layers consisting of rich security features, applied best practices governed by policy and the design itself validated by industry standard testing processes.

Control is key to security. With Nextcloud, your IT department takes back control over its data, managed under its policies and procedures. Nextcloud integrates in the tooling you use in your data center like logging and intrusion detection and works with existing authentication mechanisms like SAML, Kerberos and LDAP.

Nextcloud supports your existing storage solution, keeping data under control of trusted IT administrators and managed with established policies. Nextcloud works with industry standard SQL databases like PostgreSQL, MySQL and MariaDB for user and metadata storage.

Nextcloud offers built in monitoring tools and integrates with existing MDM, DLP, event logging and backup tools, enabling existing tool chains to be used to monitor, backup and restore systems.

Nextcloud leverages existing data storage and database technologies so current security policies and governance processes can continue to be used to manage, control and secure operations with Nextcloud. Your IT department is fully in control.

Nextcloud includes a variety of second factors like TOTP, U2F and SMS gateways. 2-factor authentication can be enforced and user sessions and devices can be managed.

Nextcloud is also among the first in the industry to provide support for the WebAuthn standard, enabling password-less authentication and support for Windows Hello, various FIDO2 keys and other standards-compliant authentication devices.

You can find more security details here: https://nextcloud.com/secure/

Apps

The real power of Nextcloud Is Its Apps. If Nextcloud were only a personal alternative to file-hosting services like Dropbox, it wouldn’t be such a big deal. Its real power, however, is in the many extensions, or “apps”, that provide many additional functions.

The open source community gives you a variety of apps to choose from which suits your needs. Either you can go with the apps which are out there or you can build your own apps as per your business need.

You can find a lot of nextcloud apps here: https://apps.nextcloud.com/

Some of the popular apps are:

And many more… You can find a more detailed description of these apps in their respective pages on Nextcloud apps.
These apps make Nextcloud different from other file hosting services.

Mobile and desktop clients

Nextcloud gives you access to your data and communication wherever you are. Their easy to use desktop and mobile clients are available for all major platforms for free!

Users can access and share their data on Nextcloud through sync clients for Windows, Linux and Mac as well as Android and IOS, providing a smooth experience no matter where data is located.

The Nextcloud desktop client keeps photos and documents always up to date, enabling you to work like you always did.

Any file you add, modify or delete in the synced folders on your desktop or laptop will show up, change or disappear on the server and all other connected devices. Sync one or more folders locally with folders on the server and pick what folders you don’t need.

The mobile clients feature integrated real-time document editing. Nextcloud Text is used for note taking with Markdown files, Microsoft Office compatible document editing on-the-go is available through Collabora Online or ONLYOFFICE when these are installed on the server.

The clients also allow users to comment on documents, add a note to a shared file, view and act on server notification like a request to accept a file share or approve a login, see activity for any file and much more. Productivity is guaranteed, wherever you are!

No matter what device or how many devices you use, you will always find consistent data.

Collaboration

Nextcloud is being used by many corporations and since it is an open source project it has a lot of contributors. More than 1000 apps are published to be compatible with latest version of nextcloud. Nextcloud 22 brings a wide range of improvements for the modern digital office with new workflows, important new collaboration features in Talk, Groupware, and Files for effective self-management for teams.

The biggest improvements Nextcloud 22 introduces are:

  • User-defined groups with Circles that makes it easier to manage teams where you can share files or assign tasks to circles, or create chat rooms for a circle.
  • Integrated chat and task management where you can simply share a deck card into a chat room or turn a chat message into a task.
  • Easy approval workflow, where an administrator can define a new approval flow in the settings and users can, on a document, request approval.
  • Getting your document signatures easy with integrated PDF signing with DocuSign, EIDEasy, and LibreSign.
  • Integrated knowledge management Nextcloud puts knowledge available to everyone at a moments’ notice, providing easy search, sharing, and portable access.
  • Groupware improvements bringing a trash bin feature in Calendar and more. Nextcloud Mail features improved threading, email tagging, and support for Sieve filtering.
  • Big improvements in Nextcloud Talk with voice messages, location and contact sharing, message deletion and much more.

There are many more new features and changes like notifications in the app navigation, integrated compression in the Files interface, and significant performance improvements to universal search.

Conclusion

Nextcloud is a great alternative to proprietary services such as Google Drive and Dropbox. It also provides a set of apps which you can install to extend its functionality in various ways. Below is a summary of the features offered by nextcloud:

  • Nextcloud is open source – there are no limitations and you can inspect, integrate, extend and modify Nextcloud however you want.
  • Powerful, integrated logging, two-factor authentication and NIST compliant password policy control functionalities.
  • Sharing and Provisioning REST APIs. Facilitates the integration of remote 3rd party apps.
  • Nextcloud offers an easy to use user interface which comes with search functionality, favorites, tags and even more ways to quickly reach the files you need. Full Text search is available using Apache Solr.
  • Authentication through LDAP / Active Directory, Kerberos and Shibboleth / SAML 2.0 and more.
  • Fine-grained control from mobile, desktop or the Web over data access and sharing capabilities. Pick from the list of users and groups, stored either locally or on another, authorized, server.
  • Quick access to core functions for app development with the powerful Nextcloud App API and webhooks following the publication / subscription model.
  • Text file editing and thumbnail previews of PDF, images, text files, office files and more.
  • Pre-loaded files and folders for new users. Populate a new user’s Files area with, for example, a tutorial file, which appears when they first log in.
  • Advanced quota management with configurable accounting of external storage.
  • Built in, easy to use theming to set color, login background and logo from Administrator screen.

How Osmosys Can Help?

Osmosys has been developing Nextcloud apps since Jan 2019. We have worked with some of the organizations from Germany and helped them in developing large scale solutions around Nextcloud to meet their business requirements.

For example: Nextcloud is capable of keeping the data in sync across different clients which are connected to one Nextcloud instance. We have come up with a solution for one of our clients to be able to sync their data across multiple Nextcloud instances. This requirement is very specific to their business requirement.

We can develop custom nextcloud apps which are very specific to your business needs. Osmosys will also help with deployment and maintaining the Nextcloud instance. We also provide support for enhancements and maintain app compatibility with future Nextcloud releases.

Contact us for more queries.

References

 

Posted By: Vishnu Kyatannawar, Osmosee

Top 6 Software Development Trends Predictions in 2019

Posted on January 19, 2019 by in General

The previous year has observed a substantial growth throughout the mobile app development trade, but 2019 is anticipated to be further innovative. It’s a well-known fact that we live in a world that is fast moving towards technological developments every moment. 2019, the last teen year for the rest of the century needs to have some importance when it comes to standing out in the technological development era.

Technology keeps growing as per the requirement of the user. Though it gets outdated, it is always useful in the future to know how the bugs should be resolved. Technology growth enables both change and progress in the user techniques and development of technology.

This year is anticipated to bring us the following fresh batch of software development trends.

     1. Programming Languages Come Back!

Experts have noted the process of primary functional programming language bouncing back as far as 2019 is concerned. But the trend forthwith continues to change the field of software development, and in 2019 it will seemingly grow even more established.

When it comes to programming languages, emphasis will place on tasks such as parallel computing support, qualitative error checking during the compilation process, and providing a compressed and expressive syntax.

Programming Languages

The programming language first developed by Konrad Zuse which is a high-level programming language known as Plankalkül, from 1942 to 1945 with a compiler programmed by Corrado Böhm in 1951.

The advanced programming language Cloud Computing was already existing as a technology, but it took a while to come into use as the bugs kept coming and the issues had to be resolved.

  1. Artificial Intelligence driven development

All through 2018, there was a clear trend of a rise in the platforms, applications, and tools based on Artificial Intelligence. These technologies have not only impacted the Internet and the software industry but also other sectors such as manufacturing, automobile, healthcare, legal, and agriculture.

AI-driven development is a blending of the best tools, technologies, and practices to build AI-equipped development tools and the incorporation AI into applications and software. The rapidly developing technology of AI grants significant development opportunities that a lot of companies have already been ready to grab.

Artificial Intelligence

Modern infrastructure and applications are producing recorded data which is captured for searching, indexing, and analytics. These massive data sets are obtained from the operating systems, server software, hardware, and application software. They can be correlated and aggregated to get insights and models. IT operations modify from being reactive to predictive while machine learning models are applied to these data sets.

  1. Blockchain Technology

Blockchain Technology

The blockchain technology is making a strong case for the future with various use cases. A few of its other uses are the distribution of resources, smart contracts, identity management, healthcare data, and supply chain management. The blockchain technology also facilitates the authentication of numerous large-scale transactions in seconds; one can anticipate businesses to cut their costs by employing it to the whole supply chain while streamlining the processes. There is an anticipation of the constant growth of this technology to happen in 2019.

The blockchain is a remarkable invention. Blockchain development will be not only about cryptocurrencies or crypto exchanges in 2019, but it will change the aspect of the healthcare and finance industries. Gartner analysts have published in their recent Trend Insight Report that “the blockchain revolution promises to touch every industry.”

  1. Cybersecurity

Cybersecurity

Hacking is the most common cyber threat all through the world with a new technique every day but is given insignificant importance. As the technology doesn’t seem to be emerging though it has been around for a while evolving as other techniques.

The evil hackers will never give up on hacking the data and get access illegally. They even continue to get through the most robust security measures. According to an expert, one of the three advancements to modify security are hardware authentication, cloud technology, and deep learning. Cybersecurity will be existent till we have hackers. Another that adds to the list is the data loss prevention and behavioral analytics.

  1. Augmented Reality and Virtual Reality

Augmented Reality and Virtual Reality

To enhance the use with environment  Augment Reality(AR) and to immerse the user in an environment Virtual Reality(VR) is used. Primarily, VR was used for gaming and also for training with VirtualShip.

VirtualShip is used to train Navy, Army, and Coast Guard Ship captains in the USA as it is simulation software. The famous game that went viral during the year 2017-2018 is and the perfect example of Pokemon Go.

The Virtual and Augmented Realities have tremendous potential in education, marketing, training, entertainment, and for injuries in the rehabilitation center. In the top reputed hospitals, these are used for trained doctors to do surgery and for deeper experience at the museum-goers too.

  1. Edge Computing

 Edge Computing

The major player Amazon Web Services(AWS) has become mainstream with Microsoft Azure and Google Cloud dominating the market. With more and more migration of business to a cloud solution, there is a growth in cloud computing. Edge Computing has taken over Cloud Computing, so no longer cloud computing is emerging.

The bugs of cloud computing have been realized as the quantity of data that are being dealt with started to increase. Edge computing was developed to overcome the flaws in cloud computing with better features and process with a way to bypass the latency caused and getting data to the data center for the procedure.

Conclusion

 As organizations go through the digital transformation, they also expect a potential to increase their exposure to risk. It seems like the two most important resolutions for the year 2019, is enhancing security and eradicating susceptibilities of development. The technology industry is now leading towards achieving more holistic and user-centric services that help satisfy customer expectations. The investment in technology holds the solution to advancement. However, it is a difficult proposition to predict trends in technology. Considering the relentless global competition and the accelerated speed of technological innovations, Osmosys plans and utilizes developing technologies to keep your business protected and at the vanguard of the industry.

Regret for inadvertent activity

Posted on July 17, 2018 by in General

Dear Subscriber,

A test post has been created inadvertently in the process of testing our new website. We regret for any inconvenience.

Sincerely,

Team Osmosys

GitLab – Recovering from a corrupted database record

Posted on May 17, 2018 by in General

Introduction

One of the most terrifying thing for a Database administrator to come across is a corrupted database.

Corrupted Database

A database corruption can be defined as a problem associated with the improper storage of the 0’s and 1’s that you need to store on the disk in order to access your data.

Despite the usefulness of the relational databases, they are prone to corruption, which results in the inaccessibility of some or all the data in the database.

More than 95% of corruption happens due to hardware failure. Among the remaining 5% we have,

Prevent iOS from zooming in on input fields

Posted on January 5, 2017 by in General, iOS, Mobile Technologies

Developing a responsive website that works well across various browsers and devices is tough. The difficulty is compounded by the fact that browser vendors keep adding distinct behaviors to improve user experience. We recently faced an issue with the auto zoom-in feature in Safari on iOS. 

Auto-clearing browser cache after deployments

Posted on July 13, 2016 by in General

Majority of web developers have had to, one time or the other, ask their users or the test engineer to clear their cache before validating a change. Browsers’ cache static resources like JavaScript and CSS, and load them from their cache to improve page load speed. Hence your latest modifications won’t apply until the end user clears their browser’s cache. We’ve been using a technique that allows us to refresh the browser cache automatically without asking our users to do so.

Gridster

Posted on June 24, 2015 by in General

Traditional web applications or portals have navigation in the form of menus (with dropdown options), toolbars or accordion etc. While each have their own pros and cons, none of them provide an UI similar to desktop.

Imagine showcasing the navigation options in one massive gird based gallery? Impress the visitors with a unique UI where the content is laid out creatively. Enter Gridster and all this becomes a reality where the UI is tile based (similar to Windows 8) and users can play with each widget/tile. Users can reposition the tiles/widgets to suit their preference using Gridster’s drag-and-drop feature.

Cross Site Scripting

Posted on February 28, 2013 by in General

Cross Site Scripting (or XSS) is a type of security vulnerability typically found in Web Applications. XSS allows hackers to inject client side scripts written in a language like JavaScript, VBScript into Web Pages that is then viewed by other users. According to Symantec’s records (2007) XSS accounted for nearly 84% of all security vulnerabilities.

Getting Files Out of GAC

Posted on November 15, 2010 by in General

DLLs once deployed in GAC (normally located at c:\windows\assembly) can’t be viewed or used as a normal DLL file. They can’t be directly referenced from VS project. Developers usually keep a copy of the original DLL file and refer to it in the project at development (design) time, which uses the assembly from GAC during run-time of the project.