All Projects → brunocfalcao → Larapush

brunocfalcao / Larapush

Licence: mit
artisan push - Deploy your codebase into your web server with one Laravel artisan command and no SSH needed!

Projects that are alternatives of or similar to Larapush

Laravel Janitor
🔑 Easily add login proxy to your Laravel API
Stars: ✭ 54 (-64%)
Mutual labels:  laravel, passport
Poetryclub Backend
基于 laravel + vue.js 的诗词小筑网站后台页面与后端代码
Stars: ✭ 87 (-42%)
Mutual labels:  laravel, passport
Laravel Caprover Template
Template to deploy a Laravel app in docker for CapRover
Stars: ✭ 56 (-62.67%)
Mutual labels:  laravel, deployment
Socialite
Socialite is an OAuth2 Authentication tool. It is inspired by laravel/socialite, you can easily use it without Laravel.
Stars: ✭ 1,026 (+584%)
Mutual labels:  laravel, oauth
Passport Social Grant
Stars: ✭ 114 (-24%)
Mutual labels:  laravel, passport
Qq
[READ ONLY] Subtree split of the SocialiteProviders/QQ Provider (see SocialiteProviders/Providers)
Stars: ✭ 50 (-66.67%)
Mutual labels:  laravel, oauth
Weixin
[READ ONLY] Subtree split of the SocialiteProviders/Weixin Provider (see SocialiteProviders/Providers)
Stars: ✭ 84 (-44%)
Mutual labels:  laravel, oauth
Laravel template with vue
laravel5.5和vue.js结合的前后端分离项目模板,后端使用了laravel的LTS版本(5.5),前端使用了流行的vue-element-template项目。作为程序的起点,可以直接以此为基础来进行业务扩展。模板内容包括基础的用户管理和权限管理、日志管理、集成第三方登录,整合laravel-echo-server 实现了websocket 做到了消息的实时推送,并在此基础上,实现了聊天室和客服功能。权限管理包括后端Token认证和前端vue.js的动态权限,解决了前后端完整分离的情况下,vue.js的认证与权限相关的痛点,已在本人的多个项目中集成使用。
Stars: ✭ 763 (+408.67%)
Mutual labels:  laravel, passport
Mern Boilerplate
Fullstack boilerplate with React, Redux, Express, Mongoose, Passport Local, JWT, Facebook and Google OAuth out of the box.
Stars: ✭ 112 (-25.33%)
Mutual labels:  oauth, passport
Laravel Tenancy Passport Demo
Laravel demo with Passport and Tenancy
Stars: ✭ 107 (-28.67%)
Mutual labels:  laravel, passport
Workmanger
laravel+vue.js 前后端分离实战项目(项目中wx端等已经存在,因为涉及业务较多,不再更新到github 需要参考可以私聊我)
Stars: ✭ 41 (-72.67%)
Mutual labels:  laravel, oauth
Laravel Authz
An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.
Stars: ✭ 136 (-9.33%)
Mutual labels:  laravel, passport
Deployer
Deployer is a free and open source deployment tool.
Stars: ✭ 854 (+469.33%)
Mutual labels:  laravel, deployment
Laravel Oauth
Social OAuth authentication for Laravel 5 & 6. Drivers: Facebook, Twitter, Google, LinkedIn, Github, Bitbucket.
Stars: ✭ 52 (-65.33%)
Mutual labels:  laravel, oauth
Angular5.2 Laravel5.6
Angular 5.2 and Laravel 5.6 Authentication and CRUD
Stars: ✭ 17 (-88.67%)
Mutual labels:  laravel, passport
Reactnativelaravellogin
Sample App for login using laravel 5.5 React Native and Redux
Stars: ✭ 75 (-50%)
Mutual labels:  laravel, passport
Passport
Simple, unobtrusive authentication for Node.js.
Stars: ✭ 19,608 (+12972%)
Mutual labels:  oauth, passport
Laravel Imap
Laravel IMAP is an easy way to integrate both the native php-imap module and an extended custom imap protocol into your Laravel app.
Stars: ✭ 416 (+177.33%)
Mutual labels:  laravel, oauth
Laravel Deployer
🚀 Zero-downtime deployment out-of-the-box
Stars: ✭ 1,536 (+924%)
Mutual labels:  laravel, deployment
Laravel Passport Android
Laravel + Passport for an Android App
Stars: ✭ 116 (-22.67%)
Mutual labels:  laravel, passport

Larapush logo


Latest Stable Version Total Downloads License

Deploy your codebase to your web server using a new Laravel Artisan command

php artisan push

Features

  • Client <-> Server communications using HTTP. No need to have SSH access!
  • Choose what codebase you want to upload (files, folders).
  • Run pre-scripts and post-scripts that you define (artisan commands, invokable classes, or custom methods).
  • You can choose to upload only modified files, or all files inside your codebase.
  • Blacklist files so they can never be uploaded to your web server (e.g. .env).
  • Keeps all of your uploaded codebase versions backup on your storage path.
  • Get prompted in case you are uploading to production environments.
  • Works on both UNIX and Windows web servers.

Requirements

Database is only needed in your web server (Laravel Passport will be installed)
PHP 7.2+
Laravel 5.8+

Installation

❗️ In order to generate your OAuth client and token, you need to first install Larapush on your web server!

Log in into your web server and run the following commands:

composer require brunocfalcao/larapush
php artisan larapush:install-remote

At the end, it will generate your command line that you will need to use to install it on your local computer. As example:

❗️ Now copy+paste the one generated on your web server so you can use it later on your local installation.

On your local development computer, run the following commands:

composer require brunocfalcao/larapush

Now paste the line from your previous web server installation to your local computer prompt. Here is an example:

php artisan larapush:install-local --client=4 --secret=5DrehY2gjPWTPL4rxzQwseHiQHWq8FXaH0Y --token=WXD2W6ZVK5

The installer will prompt to insert your web server URL. Just add it in the FQDN format (e.g.: https://www.johnsmith.com).

The installation completes you should see:

All good! Now you can push your codebase to your web server!

Don't forget to update your larapush.php configuration file for the correct codebase files and directories
that you want to upload.

Usage

Henceforth all you have to do is to run the command:

php artisan push

It will upload your codebase that you define on your larapush.php configuration file (larapush.codebase) and the scripts that you also specified (larapush.scripts).

Configuration

A new larapush.php configuration file is created. Let's explore it.

larapush.type

No need to change this, it is automatically configured by the installers using .env keys that will be registered.

larapush.environment

If your web server environment name matches one of the ones specified here, then Larapush will ask you to confirm the upload each time you push your code. This will avoid you to upload your codebase to environments that you might not want to (like a production).

larapush.remote

No need to change these keys by default, unless you want to change the main root URL path, or force a web server URL.

larapush.scripts (pre_scripts and post_scripts)

You can specify actions to run before and after the code is deployed on your web server. For each, you can:

  • Run an Artisan command. E.g.: ['cache:clear', ScriptType::ARTISAN]
  • Execute an invokable method. E.g.: [MyClass::class, ScriptType::CLASSMETHOD]
  • Execute a specific object method: E.g.: ['[email protected]', ScriptType::CLASSMETHOD]
  • Execute a system shell commands: E.g.:"['composer dumpautoload', ScriptType::SHELLCMD]

You can add as much as you want. All outputs are stored inside your transaction folder (later to be explained).

larapush.codebase

Important part, where you can specify your codebase folders and files. Just add them as array values, E.g.:

    'codebase' => [
        'App', 'database', 'resources/views/file.blade.php', 'webpack.js'
    ],

larapush.storage

This is the path where all of your codebase push transactions are stored. See it like a versioning way of storing all of your codebase along time.

larapush.oauth

These are security tokens generated by Laravel Passport. Don't change them, they are recorded on your .env file.

larapush.token

This is an extra security layer, of a token that needs to be the same in both web server and your local dev computer. Registered via your installation process.

Codebase transaction repository

Each time you upload your codebase, Larapush stores that codebase plus your configured "pre" and "post" scripts both in your local computer and in your web server. This is called a transaction. By default these transaction folders are on your storage_path("app/larapush"). You can change this path on your larapush.php configuration file.

As example, you are pushing your codebase and you see this line on your artisan command info:

[...]

Creating local environment codebase repository (20190413-211644-GFKXN)...

[...]

That code between parenthesis is the transaction code. If you navigate to your storage-path/app/larapush you will see all the transaction folders listed there. Each of those correspond to a push you have made to your web server.

Here is an example of the folders location:
Codebase transaction folders

In your web server it works exactly the same way. Additionally on each of the folder you might see also 2 files:

output_pre_scripts.log
output_post_scripts.log

Those are the console exports of the scripts that ran on each of your codebase push. So, in case you are running scripts you will see your console output there. Nice, heim? :)

Security above all

Larapush was developed taking security very seriously. At the end, anyone that knows your endpoint would be able to upload a malicious codebase to your web server. That's why Larapush uses OAuth client grant access tokens for each of the HTTP transactions that are handshaken between your web server and your local computer. At the end of the HTTP transaction, the client access token is marked as used, so it cannot be used again.

When you install Larapush on your web server, it installs Laravel Passport and generates a specific client token that will be unique between your web server and your local computer. Henceforth any transaction between your local computer and your web server needs to first request a new client grant token and then use that token on the respective HTTP call. Additionally there is also a token that is passed on each request that needs to be the same between your local computer and the web server. If not, the transaction aborts in error.

All of this is done automatically each time you push your codebase. Nice and smooth!

Security

If you find any security related issue please send me a direct email.

License

The MIT License (MIT). Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].