<?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 Randhi on Medium]]></title>
        <description><![CDATA[Stories by Randhi on Medium]]></description>
        <link>https://medium.com/@randhi.pp?source=rss-92cc951e12d6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*tONYiIng_S-O3-EwHbNlWA.png</url>
            <title>Stories by Randhi on Medium</title>
            <link>https://medium.com/@randhi.pp?source=rss-92cc951e12d6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 10:04:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@randhi.pp/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[Backup Laravel app to Alibaba OSS]]></title>
            <link>https://medium.com/@randhi.pp/backup-laravel-app-to-alibaba-oss-5e2bf9b5ffc6?source=rss-92cc951e12d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e2bf9b5ffc6</guid>
            <category><![CDATA[alibabacloud]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[backup]]></category>
            <dc:creator><![CDATA[Randhi]]></dc:creator>
            <pubDate>Mon, 20 Nov 2023 14:42:36 GMT</pubDate>
            <atom:updated>2023-11-20T14:42:36.095Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3wuCpHQ5i1GxRUdUmzy8Ug.png" /><figcaption>backup monitor using php artisan backup:list</figcaption></figure><p>Laravel doesn’t have an auto backup feature integrated, but Spatie had cover this with their <a href="https://spatie.be/docs/laravel-backup/v8/introduction">laravel-backup</a> module. Thanks Spatie!</p><p>Read their documentation above if you are new to this. They had a great and easy to understand documentation.</p><p>Using laravel-backup, allow us to backup all laravel folder and zip it. Configure to auto run daily, monthly, or customized time.</p><p>This module can also dump database for you.</p><p>Add laravel-backup module and publish config :</p><pre>composer require spatie/laravel-backup<br>php artisan vendor:publish --provider=&quot;Spatie\Backup\BackupServiceProvider&quot;</pre><p>For the backup location, you can use local disk or S3.</p><p>If you want to use Alibaba OSS ( AWS S3 like but it is from Alibabacloud ), you need to add new module which is <a href="https://github.com/alphasnow/aliyun-oss-laravel">https://github.com/alphasnow/aliyun-oss-laravel</a></p><p>Add oss laravel module :</p><pre>composer require alphasnow/aliyun-oss-laravel</pre><p>Basically it will add OSS into Laravel as an available storage disk.</p><p>Update `.env` with your OSS credential</p><pre>OSS_ACCESS_KEY_ID=&lt;Your aliyun accessKeyId, Required&gt;<br>OSS_ACCESS_KEY_SECRET=&lt;Your aliyun accessKeySecret, Required&gt;<br>OSS_BUCKET=&lt;Your oss bucket name, Required&gt;<br>OSS_ENDPOINT=&lt;Your oss endpoint domain, Required&gt;</pre><p>NB: for security, you can create OSS bucket with ACL for new specific RAM user only. Also you can use internal https endpoint if your server also in Alibaba.</p><p>Update config on `config/filesystems.php`</p><pre>&quot;default&quot; =&gt; env(&quot;FILESYSTEM_DRIVER&quot;, &quot;oss&quot;),<br>// ...<br>&quot;disks&quot;=&gt;[<br>    // ...<br>    &quot;oss&quot; =&gt; [<br>        &quot;driver&quot;            =&gt; &quot;oss&quot;,<br>        &quot;access_key_id&quot;     =&gt; env(&quot;OSS_ACCESS_KEY_ID&quot;),           // Required, YourAccessKeyId<br>        &quot;access_key_secret&quot; =&gt; env(&quot;OSS_ACCESS_KEY_SECRET&quot;),       // Required, YourAccessKeySecret<br>        &quot;bucket&quot;            =&gt; env(&quot;OSS_BUCKET&quot;),                  // Required, For example: my-bucket<br>        &quot;endpoint&quot;          =&gt; env(&quot;OSS_ENDPOINT&quot;),                // Required, For example: oss-cn-shanghai.aliyuncs.com<br>        &quot;internal&quot;          =&gt; env(&quot;OSS_INTERNAL&quot;, null),          // Optional, For example: oss-cn-shanghai-internal.aliyuncs.com<br>        &quot;domain&quot;            =&gt; env(&quot;OSS_DOMAIN&quot;, null),            // Optional, For example: oss.my-domain.com<br>        &quot;is_cname&quot;          =&gt; env(&quot;OSS_CNAME&quot;, false),            // Optional, if the Endpoint is a custom domain name, this must be true, see: https://github.com/aliyun/aliyun-oss-php-sdk/blob/572d0f8e099e8630ae7139ed3fdedb926c7a760f/src/OSS/OssClient.php#L113C1-L122C78<br>        &quot;prefix&quot;            =&gt; env(&quot;OSS_PREFIX&quot;, &quot;&quot;),              // Optional, The prefix of the store path<br>        &quot;use_ssl&quot;           =&gt; env(&quot;OSS_SSL&quot;, false),              // Optional, Whether to use HTTPS<br>        &quot;reverse_proxy&quot;     =&gt; env(&quot;OSS_REVERSE_PROXY&quot;, false),    // Optional, Whether to use the Reverse proxy, such as nginx<br>        &quot;throw&quot;             =&gt; env(&quot;OSS_THROW&quot;, false),            // Optional, Whether to throw an exception that causes an error<br>        &quot;options&quot;           =&gt; [],                                 // Optional, Add global configuration parameters, For example: [\OSS\OssClient::OSS_CHECK_MD5 =&gt; false]<br>        &quot;macros&quot;            =&gt; []                                  // Optional, Add custom Macro, For example: [\App\Macros\ListBuckets::class, \App\Macros\CreateBucket::class]<br>    ],<br>    // ...<br>]</pre><p>then update your `config/backup.php`</p><pre>&#39;destination&#39; =&gt; [<br><br>            /*<br>             * The filename prefix used for the backup zip file.<br>             */<br>            &#39;filename_prefix&#39; =&gt; &#39;&#39;,<br><br>            /*<br>             * The disk names on which the backups will be stored.<br>             */<br>            &#39;disks&#39; =&gt; [<br>                &#39;local&#39;,<br>                &#39;oss&#39;,<br>            ],<br>...<br><br>...<br>&#39;monitor_backups&#39; =&gt; [<br>        [<br>            &#39;name&#39; =&gt; env(&#39;APP_NAME&#39;, &#39;laravel-backup&#39;),<br>            &#39;disks&#39; =&gt; [&#39;local&#39;,&#39;oss&#39;],<br>            &#39;health_checks&#39; =&gt; [<br>                \Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumAgeInDays::class =&gt; 1,<br>                \Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumStorageInMegabytes::class =&gt; 5000,<br>            ],<br>        ],</pre><p>to enable db dump, update config/database.php</p><pre>&#39;mysql&#39; =&gt; [<br>      ...<br>      &#39;dump&#39; =&gt; [<br>           &#39;useSingleTransaction&#39; =&gt; true,<br>       ],<br> ],</pre><p>After all that step, now it will allow backups to two destination every php artisan backup:run command is started.</p><p>On the Alibaba Bucket we can see laravel-backup was success</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KzibiWO-3RlSTcrSpFM1Iw.png" /><figcaption>backup success on Alibaba OSS</figcaption></figure><p>To configure auto backup on laravel please add cronjob in your server</p><pre>EDITOR=nano crontab -e</pre><p>this will open crontab editor, add this :</p><pre>* * * * * cd /data/www/yourweb.com/laravel &amp;&amp; php artisan schedule:run &gt;&gt; /dev/null 2&gt;&amp;1</pre><p>ctrl + x for saving in nano, for details about this check <a href="https://laravel.com/docs/10.x/scheduling#running-the-scheduler">https://laravel.com/docs/10.x/scheduling#running-the-scheduler</a></p><p>After that add your scheduler in app/Console/Kernel.php</p><pre>...<br><br>protected function schedule(Schedule $schedule)<br>{<br>  ...<br>  $schedule-&gt;command(&#39;backup:clean&#39;)-&gt;daily()-&gt;at(&#39;01:00&#39;)-&gt;timezone(&#39;Asia/Jakarta&#39;);<br>  $schedule-&gt;command(&#39;backup:run&#39;)-&gt;daily()-&gt;at(&#39;05:00&#39;)-&gt;timezone(&#39;Asia/Jakarta&#39;);<br>  ...<br>}<br>...</pre><p>more about this check <a href="https://laravel.com/docs/10.x/scheduling#scheduling-artisan-commands">https://laravel.com/docs/10.x/scheduling#scheduling-artisan-commands</a></p><p>That’s it!</p><p>Hope it helps you to automate backups and/or db-dump in Laravel.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e2bf9b5ffc6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Control BARDI Smart Home Devices using Python]]></title>
            <link>https://medium.com/@randhi.pp/control-bardi-smart-home-devices-using-python-3344868d2909?source=rss-92cc951e12d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/3344868d2909</guid>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[led]]></category>
            <category><![CDATA[smart-home]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Randhi]]></dc:creator>
            <pubDate>Sat, 02 Jul 2022 16:56:22 GMT</pubDate>
            <atom:updated>2022-07-02T16:56:22.230Z</atom:updated>
            <content:encoded><![CDATA[<p>Some other day i was thinking how to control my BARDI devices programmatically, but it seems impossible, no documentation on their website mentioning API or SDK.</p><p>After some googling, i found out that BARDI is a rebranding devices that using TUYA IOT.</p><p>You can use this module tinytuya — <a href="https://pypi.org/project/tinytuya/">https://pypi.org/project/tinytuya/</a></p><p>They have complete guide there, but the resume is :</p><ol><li>Install using : python -m pip install tinytuya</li><li><em>If you already connected to BARDI APP, you Need to use Smart Life App</em> or <em>Tuya Smart App. Install it on your phone.</em></li><li>Reset your smart device and connect it to Smart Life App or Tuya Smart App.</li><li>Run : python -m tinytuya scan and note the device id</li><li>Follow Setup Wizard — Getting Local Keys</li><li>Create account on <a href="https://iot.tuya.com/">https://iot.tuya.com</a></li><li>Create new cloud project, and add All data center, trust me! You will need this all if your devices not listed in some of it.</li><li>Get <em>API Key: Access ID/Client ID</em> and <em>API Secret: Access Secret/Client Secret</em></li><li>Link Smart Life App or Tuya Smart App to Tuya Developer Account</li><li>run : python -m tinytuya wizard</li><li>Input the key:secret from number 8 and your deviceId from number 10</li><li>Wizard will continue using tuya dev credentials, scan local devices and get local keys for you.</li><li>There you have it, the local key will be printed in the terminal and saved to a json file</li></ol><p>After you are done getting all this required data, now you can start programming.</p><p>My device is BARDI RGBWW LED Strip.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W7iZabWe-J5F4LC4gsE6Ww.png" /></figure><p>Create some script like this :</p><pre># index.py</pre><pre>import tinytuya<br>import time</pre><pre># OutletDevice(deviceId, ipAddress, localKey)</pre><pre>d = tinytuya.OutletDevice(&#39;04085xxxxxxxxxxxxxc6b&#39;, &#39;10.0.0.3&#39;, &#39;2a55xxxxxxed0a9&#39;)<br>d.set_version(3.3)</pre><pre># Get Status<br>data = d.status() <br>print(&#39;set_status() result %r&#39; % data)</pre><pre># Turn Off<br>d.set_value(20, False)<br>time.sleep(1)</pre><pre># Turn On<br>d.set_value(20, True)<br>time.sleep(1)</pre><pre># Yellow<br>d.set_value(24, &#39;003203e801f7&#39;)<br>time.sleep(1)</pre><pre># Green<br>d.set_value(24, &#39;00aa03e803e8&#39;)<br>time.sleep(1)</pre><pre># Red<br>d.set_value(24, &#39;e2ffb8005447&#39;)<br>time.sleep(1)</pre><pre># Turn Off<br>d.set_value(20, False)</pre><p>Then run it :</p><pre>$ python3 index.py</pre><p>Voila!! now you have awaken the force!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*jtyLfMp2JzJQtm-3dsZhww.gif" /><figcaption>Controlling BARDI using python</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3344868d2909" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ini Customer Service beneran atau Bot ya?]]></title>
            <link>https://medium.com/@randhi.pp/ini-customer-service-beneran-atau-bot-ya-6564704a2144?source=rss-92cc951e12d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/6564704a2144</guid>
            <dc:creator><![CDATA[Randhi]]></dc:creator>
            <pubDate>Fri, 27 May 2022 02:48:29 GMT</pubDate>
            <atom:updated>2022-05-27T02:48:29.651Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JsLATodnhpx9u48BPQw2KQ.jpeg" /><figcaption>chatbot icon vector created by pch.vector — <a href="http://freepik.com/">freepik.com</a></figcaption></figure><p>Pernah nggak berfikir seperti itu waktu chat dengan CS? Kok jawabannya ngasal? Jawabannya kok kadang g nyambung?</p><p>Ya, itu adalah bot yang masih belajar. CS tersebut kemungkinan besar menggunakan teknologi Google Dialogflow. Dengan menggunakan Dialogflow, Anda dapat memberikan cara baru dan menarik bagi pengguna untuk berinteraksi dengan produk Anda.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fO9X3LPclOikSV6s.png" /><figcaption>whatsapp chatbot as customer service</figcaption></figure><p>Mengapa menggunakan Dialogflow? Karena kadang-kadang pertanyaan yang dilontarkan ke CS rata-rata punya maksud dan tujuan yang sama (FAQ, Frequently Asked Question).</p><p>Misalkan, menanyakan harga untuk berlangganan atau menanyakan fungsi tertentu. Jadi dengan teknologi ini, tidak perlu hire CS yang harus on 24 jam. Kita bisa pakai Dialogflow misalkan untuk jam malam sampai dengan pagi saja.</p><p>Bagaimana, kira-kira Anda mau coba implementasi CS-bot?</p><p><a href="https://www.linkedin.com/feed/hashtag/?keywords=csbot&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6935777153783332864">#csbot</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=customerservice&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6935777153783332864">#customerservice</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=dialogflow&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6935777153783332864">#dialogflow</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=wabot&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6935777153783332864">#wabot</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=whatsappbot&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6935777153783332864">#whatsappbot</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=whatsapp&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6935777153783332864">#whatsapp</a></p><p>Contoh implementasi Whatsapp CS-bot dengan menggunakan Wafvel dan Dialogflow : <a href="https://gitlab.com/randhi.pp/wafvel-x-dialogflow-es-demo">https://gitlab.com/randhi.pp/wafvel-x-dialogflow-es-demo</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6564704a2144" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Membuat Laravel Autodeploy ke VPS/ECS dengan Gitlab CI/CD]]></title>
            <link>https://medium.com/@randhi.pp/membuat-laravel-autodeploy-ke-vps-ecs-dengan-gitlab-ci-cd-775afce887a9?source=rss-92cc951e12d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/775afce887a9</guid>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[gitlab-ci]]></category>
            <category><![CDATA[vps]]></category>
            <dc:creator><![CDATA[Randhi]]></dc:creator>
            <pubDate>Sat, 16 May 2020 09:54:41 GMT</pubDate>
            <atom:updated>2020-05-16T09:54:41.367Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v2Lh6rtAtZaAbQMr" /><figcaption>Photo by <a href="https://unsplash.com/@lucabravo?utm_source=medium&amp;utm_medium=referral">Luca Bravo</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Sebelum melanjutkan, tutorial ini hanya berlaku untuk:</p><ol><li>Repository menggunakan Gitlab</li><li>VPS atau ECS dengan akses SSH</li><li>VPS menggunakan Ubuntu, dengan LAMP yang sudah running.</li><li>/var/www/&lt;projects&gt; adalah clone dari repo Gitlab</li></ol><p>Auto Deploy Workflow :</p><ol><li>File project di PC local anda, misal branch development, pada dasarnya akan selalu sama dengan di VPS.</li><li>Saat anda coding di local environmet, setelah selesai anda bisa push ke repo Gitlab, misal branch development, maka gitlab akan otomatis melakukan koneksi otomatis ke SSH Server VPS anda dan melakukan git fetch dan git pull dengan branch yang sama.</li><li>Gitlab juga akan melakukan beberapa script yang bisa kita tambahkan seperti, php artisan optimize, dan php artisan migrate.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*qqg_zxGPYOkjaoz_yaY3Cw.png" /></figure><h3>Persiapan di VPS atau ECS</h3><p>Pastikan server sudah terinstall LAMP ( apache, mysql, php ) untuk spesifikasi Laravel Framework sbb:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/279/1*kvg5yBC_9KOBIDzfxsc0SQ.png" /><figcaption>Kebutuhan minimal untuk Laravel</figcaption></figure><ol><li>Install LAMP di Ubuntu : <a href="https://medium.com/hammercode/cara-install-apache-mysql-php-phpmyadmin-di-linux-e6ba341ec14a">disini</a></li><li>Install composer : <a href="https://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;uact=8&amp;ved=2ahUKEwjckYL77rfpAhVt6XMBHd7iDpYQtwIwAHoECAQQAQ&amp;url=https%3A%2F%2Fmusaamin.web.id%2Fcara-install-composer-di-ubuntu%2F&amp;usg=AOvVaw1SxvNvMGj12S75-scA3HdJ">disini</a></li><li>Install git : <em>apt install git</em></li></ol><pre>sudo apt install git</pre><h4>Clone Repository dari gitlab</h4><p><em>( skip, lanjutkan kalau anda akan buat repository baru dengan laravel installer atau sudah ada existing project )</em></p><p><a href="https://gist.github.com/bd60ab1030e6da5deaa20cbe241b1313">https://gist.github.com/bd60ab1030e6da5deaa20cbe241b1313</a></p><ul><li>Sesuaikan .env dengan setting server anda seperti mysql db name, user, dan password yang digunakan di server vps.</li><li>Disini saya menggunakan repo yang sudah saya buat sebelumnya yang berisi file-file default dari laravel 7, anda bisa gunakan repo anda sendiri disini.</li></ul><p>Note: untuk start new project : <a href="https://laravel.com/docs/7.x">disini</a></p><h4>Setting Apache VirtualHost</h4><p>buat site-available baru di /etc/apache2/sites-available</p><pre>nano /etc/apache2/sites-available/laravel.jombang.digital</pre><p><a href="https://gist.github.com/050e06092f06a07b35f2d806dc3335fe">https://gist.github.com/050e06092f06a07b35f2d806dc3335fe</a></p><pre>sudo a2ensite laravel.jombang.digital<br>sudo a2enmod rewrite<br>sudo service apache2 restart</pre><p>Voila!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*544FQWh_Cib1iay2O-B39w.png" /></figure><p>test instalasi laravel anda di vps dengan mengunjungi domain anda ( disini saya menggunakan laravel.jombang.digital ) atau ip server anda.</p><h4>Setting SSH Akses — dari gitlab ke vps</h4><p>Anda perlu melakukan configurasi agar gitlab bisa login ke server vps anda tanpa password, dan ini dapat dilakukan dengan SSH.</p><p>Buat SSH Key dari VPS anda :</p><pre>$ ssh-keygen<br>Generating public/private rsa key pair.</pre><pre>Enter file in which to save the key (/home/randhi/.ssh/id_rsa): &lt;enter&gt;</pre><pre>Enter passphrase (empty for no passphrase): &lt;enter -- leave empty&gt;</pre><pre>Your identification has been saved in /home/randhi/.ssh/id_rsa.</pre><pre>Your public key has been saved in /home/randhi/.ssh/id_rsa.pub.</pre><pre>The key fingerprint is:<br>a9:49:2e:2a:5e:33:3e:a9:de:4e:77:11:58:b6:90:26 username@remote_host<br>The key&#39;s randomart image is:<br>+--[ RSA 2048]----+<br>|     ..o         |<br>|   E o= .        |<br>|    o. o         |<br>|        ..       |<br>|      ..S        |<br>|     o o.        |<br>|   =o.+.         |<br>|. =++..          |<br>|o=++.            |<br>+-----------------+</pre><p>Hasil dari ssh keygen tadi ada 2 file di</p><p>~/.ssh/id_rsa.pub &amp; ~/.ssh/id_rsa</p><p>Kemudian copy id_rsa.pub ke authorized keys di vps :</p><pre>cat ~/.ssh/id_rsa.pub &gt; ~/.ssh/authorized_keys</pre><p>dan copy isi dari ~/.ssh/id_rsa ke gitlab ( next section )</p><h3>Persiapan di Gitlab Repository</h3><p>Masuk ke Setting — CI/CD</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*Qkqc1sgzHqWqiCyuZbMO5w.png" /></figure><p>Tambahkan new variable SSH_PRIVATE_KEY dengan value dari ~/.ssh/id_rsa</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*_v2_4PQ4igwzwdiEMIS8JA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*WCqiotF3lK74SwqP_PivAg.png" /></figure><p>Klik add variable untuk menyimpan. Saat ini gitlab sudah bisa koneksi ke vps tanpa password dengan menggunakan SSH key Auth.</p><h4>FINAL STEP — Menambahkan .gitlab-ci.yml</h4><p>Langkah terakhir adalah memberi perintah kepada gitlab runner untuk melakukan deploy otomatis ke VPS dengan cara menambahkan .gitlab-ci.yml ke root folder repository.</p><p><a href="https://gist.github.com/7d896f5e663280fbf6aab700beb8aeee">https://gist.github.com/7d896f5e663280fbf6aab700beb8aeee</a></p><p>Note: anda bisa create manual di local dev dan push ke repository atau menggunakan gitlab web ui.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*dfsAXZyNDpacChiX68rJpA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OQngrt_l_JnGP94-g9lpJA.png" /></figure><h4>Check Deploy Status</h4><p>Setelah menambahkan .gitlab-ci.yml maka akan ada icon baru yaitu jobs status, yang kalau diklik akan menampilkan detail deploy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*8zhmw1Ggva5NnyzrHwPRfQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*-mAn2OZj8A4z9neVTHC6-A.png" /></figure><p>Disini deploy job yang dilakukan gagal, untuk mengetahui detailnya anda bisa klik deploy staging dengan tanda X.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MJzn5gexjJKOoEEaGuzT0g.png" /></figure><p>Disini ada error permission denied, dikarenakan ssh belum saya setup dengan benar di VPS saya. sedangkan kalau berhasil akan muncul seperti ini</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yD8mL_sRqefKdwQPLap7wQ.png" /></figure><p>Perhatikan disini, gitlab runner akan otomatis melakukan git fetch dan pull latest change from branch dan juga php optimize dan migrasi otomatis sesuai apa yang ada di .gitlab-ci.yml</p><p>Anda bisa melakukan tweak script apa yang anda butuhkan saat anda deploy di vps, php artisan jwt:secret misalnya.</p><p>Kuncinya adalah di gitlab-ci.yml ini juga .env di staging server / VPS anda.</p><p>That’s a wrap!! VPS anda sudah dalam keadaan latest update sesuai branch yang ada set.</p><p>Semoga bisa membantu dan mempermudah proses deploy anda!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=775afce887a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrasi Laravel dengan Telegram]]></title>
            <link>https://medium.com/@randhi.pp/integrasi-laravel-dengan-telegram-385b36d76426?source=rss-92cc951e12d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/385b36d76426</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[telegram]]></category>
            <category><![CDATA[login]]></category>
            <category><![CDATA[indonesia]]></category>
            <dc:creator><![CDATA[Randhi]]></dc:creator>
            <pubDate>Fri, 22 Nov 2019 03:07:24 GMT</pubDate>
            <atom:updated>2019-11-22T03:07:24.631Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>re-post dari web milik saya di jombangdigital.net</blockquote><p>Hari ini saya ingin mencoba menulis blog kembali setelah lama tidak aktif di dunia blog. Belakangan ini sedang belajar Laravel, jadi tidak ada salahnya saya tuliskan disini supaya tidak lupa. Tulisan ini saya buat berseri ya!</p><p>Saya sedang membuat project experiment, sebuah <strong>Sistem Informasi Rental Kendaraan</strong> yang maunya saya bisa terintegrasi dengan Telegram, baik dari Notification ataupun Login.</p><p>Nah yang sudah saya capai saat ini adalah :</p><ol><li>Laravel make:auth + Telegram Widget Login — <a href="https://blog.jombangdigital.net/post/integrasi-laravel-telegram-login">Part 1</a></li><li>Integrasi Telegram Notification — <a href="https://blog.jombangdigital.net/post/404">Part 2</a></li></ol><p>Disini kenapa saya mau integrasikan Laravel Project dengan telegram karena :</p><ul><li>‘Masih’ Free &amp; Open Source</li><li>API boleh digunakan tanpa daftar dan request by email.</li><li>Whatsapp harus request by email, dan apabila tidak disetujui opsi lain menggunakan 3rd-party API yang berbayar.</li></ul><blockquote><em>Our API is open, and we welcome developers to create their own Telegram apps. We also have a Bot API, a platform for developers that allows anyone to easily build specialized tools for Telegram, integrate any services, and even accept payments from users around the world. ~ Telegram FAQ</em></blockquote><h3>Telegram Login Widget</h3><p>Telegram login juga memudahkan proses input data di form register, karena data callback yang diberikan adalah :</p><ul><li>Telegram ID &amp; username</li><li>first &amp; last name</li><li>auth_time</li><li>avatar</li><li>token</li></ul><p>Jadi apabila user baru mencoba Login, maka akan langsung diarahkan ke form register yang sudah terisi namanya.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/0*FS94aecGbsxLZV3H.png" /></figure><p>Validasi lebih aman karena ada hash token, AuthTime, dan Secret Code yang digenerate dari Bot Token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XcW1LZ1q4D6ZUBTu" /></figure><blockquote><em>Bonus : Telegram ID juga bisa langsung tersimpan di database, nantinya berfungsi untuk send notification</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/0*EDaKNe_DZSr60IlW.png" /></figure><p>Contoh diatas adalah notifikasi yang dikirimkan otomatis oleh bot telegram kepada user yang login menggunakan Telegram Widget.</p><p>Bagaimana? tertarik untuk implementasi di website anda? :D</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=385b36d76426" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>