Giter Site home page Giter Site logo

uvuno / pockethold Goto Github PK

View Code? Open in Web Editor NEW
82.0 8.0 27.0 1.64 MB

Install Flarum without SSH/composer access.

Home Page: https://discuss.flarum.org/d/5731-pockethold-a-web-based-installer

License: MIT License

PHP 78.65% JavaScript 21.35%
flarum php jquery

pockethold's Introduction

Pockethold

Web-based flarum installer/downloader

  • Goal: Provide a non shell alternative for installing Flarum.

Requirements.

  1. cUrl or allow_url_fopen, proc_open)
  2. PHP Memory limit at least 512M
  3. Rougly 3 - 5 minutes of your time.

Usage: Upload installer.php where you want Flarum to be installed. Visit the the default: yoururl.com/installer.php and follow the instructions.

Pockethold will redirect you upon completion.

pockethold's People

Contributors

andreherberth avatar felli avatar kevslashnull avatar lucasleandrobr avatar luceos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pockethold's Issues

Progress tracker for Composer Create-Project

Add tracking for folders created under ./flarum/vendors/ to see how many are created to allow a rough progress bar on the front end. (Extend the $ajax=status?)

I am fairly sure this will be straight forward, and that my main problem will be honing my JS and front-end skills.

Failed at stage 3 with master branch

@andreherberth like the look of Pockethold. Tried your master branch and clicked through stages 1, 2 and 3 but the install failed.

flarumtemp and composer (inside vendor) are both empty.

Server details:

Apache Version 2.4.29
PHP Version  5.6.32
MySQL Version  10.0.31-MariaDB-cll-lve
Architecture  x86_64
Operating System  linux

Presumably /FlarumTest is ok and it doesn't need to install in the root directory?
I currently have a 302 temporary redirect on the root of the domain but not the directory for Flarum.

I tried a second time and stage 1 does create the temp directory with res, src, bin and vendor directories and vendor has the composer and symfony subdirectories etc. Stage 2 seems to quit very early with something like "1 of 91" flashing up on screen before moving onto stage 3.

install.log has:

Mon Nov 13 22:26:44: Status:  prepare
Mon Nov 13 22:26:53: Status:  Composer is Unpacked
Mon Nov 13 22:26:59: Status:  composer
Mon Nov 13 22:30:02: Status:  waiting1
Mon Nov 13 22:30:02: Status:  /home/domain/public_html/test/temp/
Mon Nov 13 22:30:02: Status:  composer.log is currently 1 long
Mon Nov 13 22:30:12: Status:  cleanup1

OK think I have found the problem. composer.log shows:

Installing flarum/flarum (v0.1.0-beta.7)
  - Installing flarum/flarum (v0.1.0-beta.7): Downloading (100%)
    <warning>Failed to download flarum/flarum from dist: The Process class relies on proc_open, which is not available on your PHP installation.</warning>
    <warning>Now trying to download from source</warning>
  - Installing flarum/flarum (v0.1.0-beta.7): 
                                                                                           
  [Symfony\Component\Process\Exception\RuntimeException]                                   
  The Process class relies on proc_open, which is not available on your PHP installation.  
                                                                                           

create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]

Any way around the proc_open if the host will not enable it?

On Fail: Provide options

Let's give Pockethold the ability to zip down all logs/temps that the user can download. (And if they want, give it to me).

Bazaar does not install

v0.1.0-beta.2

With this version, I have tested locally as well as on shared hosting and Bazaar does not install after the button is clicked. It is missing from the extensions page after the final installation phase.

Transition to Class (OOP)

Next Up - Move all functions into methods in a pockethold class.

Good on my way already. Will shorten code down a bit. And I need to begin thinking object like! And, easier for testing as well.

Timeouts

Still get timeouts. All test-beds use 1 to 2 minutes downloading Flarum. However, live test at 000webhost.com(Edge Case Testing) times out randomly. It work 2 times, then fail 5, then works again.

It could be server load, or limited bandwidth, and that increasing php timeout will help.

Also get random 504 timeout return from Ajax call which is not supposed to return anything, however, the call itself initiated what it is supposed to.

Permission error and missing file during installation

After uploading installer.php + pockethold folder to server, I was stuck on step 1, and received a 500 error.

Output from apache error log
[Tue Mar 05 11:32:39.109649 2019] [php7:warn] [pid 19699] [client 192.168.0.3:51517] PHP Warning: file_put_contents(/var/www/html/flarum/pockethold/log/ajax.log): failed to open stream: No such file or directory in /var/www/html/flarum/pockethold/classes/pockethold.class.php on line 41, referer: http://192.168.0.19/flarum/installer.php

This was resolved with manually creating the ajax.log in pockethold/log/ajax.log

OS: Debian 8

EDIT: Changed title to better reflect issue

Move repository

Move repository from "andreherberth/pockethold" to "pockethold/pockethold".

Optional Upgrade Feature

Eventually, it would be awesome if this installer could handle upgrading Flarum to the latest build.

Requirements:

  • The script searches for any currently installed Flarum versions based on ./vendor/composer/installed,json (or any other easier means of identification).
  • Provide an upgrade button upon which upgrades Flarum to the current version.
  • Display any errors to why the current installation cannot be upgraded.

If not, I would recommend an upgrade.php option that handles upgrades.

That is, until, Flagrow introduces that magical "upgrade" option down the line <3 @luceos

Clean up code for first beta.

Need a full cleanup phase for beta. Remove code, ponder on errors, and read up more on theory. A part of me thinks that when this is finally done in a beautiful way, it will be built into flarum.

Stuck on "Getting Status"

Hello there!
Today, I've tried to install Flarum with Pockethold.
I've created a folder called "flarum" and then I've unzipped Pockethold in the folder.
Then I launched the installer.php
But I'm stuck on "Getting Status" and I can't start the installation
What should I do?
Thanks in advance :)

It's stuck here

Installing flarum/flarum (v0.1.0-beta.11)
As there is no 'unzip' command installed zip files are being unpacked using the PHP zip extension.
This may cause invalid reports of corrupted archives. Installing 'unzip' may remediate them.

  • Installing flarum/flarum (v0.1.0-beta.11): Downloading (100%)
    Created project in ./pockethold/download
    Loading composer repositories with package information
    Updating dependencies (including require-dev)

Cannot Install with ionos hosting.

All I seem to be getting is:

Something went wrong: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known

Some help please?

It doesn't complete

The download just sits at 1 of 87 and never moves. Is there something I am doing wrong?

intsaller

When i use pockethold to install 3rd party Flarum on my vps(i don't have ssh permission),i got HTTP 500 ERROR
How can i solve it?
1
2
Thanks!

"Style the Installer" and upgrade to Bootstrap 4?

Hey,

I first wanted to create a Flarum web installer on my own, but then I discovered this pockethold.

This link takes you to a video of my installer. I only coded two or three hours on it and it had some major issues like not beeing able to reload the tab or continue from a second device like pockethold is able to.

I still like the vertical timeline or at least some more visual feedback from what is happening. So I forked the repo and made the following changes.

  • Update to Bootstrap 4.0.0-beta
  • Add font-awesome (4.7.0)
  • Replace h2 and span to button with disabled attribute and a spinning font-awesome gear.
  • Add a progress bar for the Flarum installation
  • Add a <title>

And that looks like this. Code here.

What I want to say with this issue is that Pockethold, even in alpha, could get some love to it's style. Not exactly what I programmed, but not "only" text.

Aaand maybe upgrade to Bootstrap 4 even if it's in beta, it looks really cool to me compared with Boostrap 3.

KevSlashNull. ^-^

Not working at hostinger (Free plan only?)

Everything works, except the composer install. Need to validate where error occurs, as current codebase does not stop. use a try/catch maybe.

If someone have a hostinger paid plan, it would be nice to see if it works or not there.

Addons?

Hey

My web-hosting provider doesn't allow SSH access due to their security. is it possible to install flaurm addons. I've used pockethold to install flarum.

Javascript Error on line 28

$("#progress").html('<pre id=\'consoleoutput\' style=\'white-space: pre-wrap; text-align:left; height: 300px; max-height: 300px; overflow:auto; color:#fff;\'>'data'</pre>');

Am more comfortable using backtick so I change my code which work but I got error 500 on on first run with logged php error

2020-02-08 22:36:09.824665 [NOTICE] ...[STDERR] PHP Parse error: syntax error, unexpected 'return' (T_RETURN) in /home/.../public_html/pockethold/classes/pockethold.class.php on line 242

an indication of inability to create log file

Does this script depends on composer?

Flarum Upgrade/Update Functionality

Pockethold does not support this at the moment.
It is possible to do it, but it requires some manual work.

I am currently experimenting with this, and will most likely write a guide for this when I am comfortable with it myself.

I do plan to have upgrade being part of Pockethold.
But it depends on the new UI being finished before I can start work on it.

Rework for v0.1.0 (Again)

For Pockethold to be a viable option in the future, and it's added workload, I am moving away from my original goal, which was to provide a singlefile way of installing Flarum via Web-browser.

Beta 8 version of Pockethold will come bundles with composer 1.7.1 (Latest working with pockethold).
It will also, if not at first release, have the option to use "cron". These options should in theory increase the chance of Pockethold being able to setup flarum on shared hosts.

Notations on New Approach

I am rewriting pockethold. Mainly, what I want is to make it more robust.

First of, it will use a .lock file and "composer install". This let's composer consentrate on just downloading the specific packages. It should make composer timeout less likely. It will also be easier to re-run if composer times out.

Second, the installer will check requirements before proceeding.

Third, UI will be updated with better information. Instead of progress tracking, I have decided I want to show the composer.log instead, updating it every 6 seconds or so.

Before cleanup (Both on success and failure), the option to download the logs will be present.

My main issue would be the UI. My JS skills is somewhat limited (Not that my PHP skills are that much better, but still).

I will update this ticket during the planing phase.

Current Tasks:

  • Proof of concept (.lock file) (non UI test)

Installation doesn't progress

I'm trying this on InfinityFree host. I just wanted to make sure it works with that host before I actually connect my domain and all.

So, this is the URL: http://forum2500.epizy.com/installer.php

It asked me to download the files of Flarum and then, it just shows 'Current Task Log' with no progress (except, it keeps blinking). Is it working, is it not? Can someone tell?

Edit: I have now found that my PHP memory limit is just 158MB and it can't increase.

Need better Ajax code

Ajax needs an overhaul. It needs to display something to indicate it is working on something, and display errors properly when it is done.

Filesystem not found

Hi,

I uploaded pockethold installer to my web website folder. When i navigate my browser to https://myurl.com/community/installer.php nable to setup. When I open the error_log file that was created in the ftp directory, I encounter the error.

[20-Feb-2019 19:11:22 Europe/Istanbul] PHP Fatal error:  Uncaught Error: Class 'Composer\Util\Filesystem' not found in /home/elissaga/public_html/community/pockethold/3rdparty/composer/src/Composer/Cache.php:45
Stack trace:
#0 /home/elissaga/public_html/community/pockethold/3rdparty/composer/src/Composer/Repository/ComposerRepository.php(101): Composer\Cache->__construct(Object(Composer\IO\ConsoleIO), '/home/elissaga/...', 'a-z0-9.$')
#1 /home/elissaga/public_html/community/pockethold/3rdparty/composer/src/Composer/Repository/RepositoryManager.php(131): Composer\Repository\ComposerRepository->__construct(Array, Object(Composer\IO\ConsoleIO), Object(Composer\Config), NULL, Object(Composer\Util\RemoteFilesystem))
#2 /home/elissaga/public_html/community/pockethold/3rdparty/composer/src/Composer/Repository/RepositoryFactory.php(160): Composer\Repository\RepositoryManager->createRepository('composer', Array, 'packagist.org')
#3 /home/elissaga/public_html/community/pockethold/3rdparty/composer/src/Composer/Repository/RepositoryFactory.php(104): Composer\Repository\Reposi in /home/elissaga/public_html/community/pockethold/3rdparty/composer/src/Composer/Cache.php on line 45

How can i fix this? Thanks.

Issue intalling bazaar

Hello,

I am using BlueHost to test out Flarum and after trying to run Pockethold it gets stuck on step 3 with the following message on the log:

./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev)

It seems to have frozen eventhough I've given it 2048M in the php.ini.

Any suggestions would be appriciated!

Redo Composer Create-Project

I am considering doing composer create-project flarum/flarum --no-install, and then manually require each package manually after the fact. This would allow the script to be used on a load more systems, due to the decreased memory requirements.

Doing this, I could perhaps move away from create-project all together, and download flarum/flarum manually, and just use the require command?

Food for for brain.

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.