GithubHelp home page GithubHelp logo

atellier2 / oc-webartisan-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vojtasvoboda/oc-webartisan-plugin

0.0 0.0 0.0 91 KB

Web artisan plugin for OctoberCMS

License: MIT License

PHP 85.99% HTML 14.01%

oc-webartisan-plugin's Introduction

Web Artisan plugin for OctoberCMS

Codacy Scrutinizer Coverage License

Plugin allows you to run artisan commands by public URL. You can call this URL by http, curl or wget.

Example: http://www.domain.com/artisan/v1/cache/clear/secret-hash

This could be useful:

  • when you don't have SSH access to your server and wants to run some commands
  • when you don't have access to /etc/crontab and want to run scheduled tasks from outside
  • when you want to run scheduled tasks by online CRON tools like webcron.org etc.
  • when you want to run commands by services like IFTTT, Zapier, etc.
  • for deployment and automated tasks

Tested with the latest stable OctoberCMS build 419 (with Laravel 5.5).

Important

It is highly recommend to use SSL (https://) when invoking commands with Web Artisan. The secret hash can be stolen if SSL is not used.

Configuration

Before call any command you have to set secret hash at Backend > Settings > System > Web Artisan. Run without secret hash is not possible due to security reasons.

For generating secret hash use some random generator.

Usage

General pattern is:

http://www.domain.com/artisan/v1/{group}/{command}/{secret}

Run command cache:clear by URL:

http://www.domain.com/artisan/v1/cache/clear/1234567890abcdef

Run command schedule:run by curl:

curl http://www.domain.com/artisan/v1/schedule/run/1234567890abcdef

Available commands

Whitelist: auth:clear-resets, cache:clear, october:update, queue:flush, queue:forget, queue:restart, queue:retry, queue:work, route:clear, schedule:run, view:clear.

Wants more? Override plugin's config file and add your commands as you wish.

Queued commands

You can queue commands so they are processed in the background by your queue workers. Before using this method, make sure you have configured your queue and are running a queue listener.

For running queue commands just put prefix queued before command

http://www.domain.com/artisan/v1/queued/{group}/{command}/{secret}

for example

http://www.domain.com/artisan/v1/queued/october/update/1234567890abcdef

TODO

  • pass Artisan to CommandRunner through constructor as Illuminate\Console\Application
  • set hash also by config (when you want to fire october:up on stage server)

Contributing

Please send Pull Request to the master branch.

License

Web artisan plugin is open-sourced software licensed under the MIT license same as OctoberCMS platform.

oc-webartisan-plugin's People

Contributors

vojtasvoboda avatar bombozama avatar atellier2 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.