Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open Beta #2

Closed
AustinCasteel opened this issue Apr 26, 2015 · 30 comments
Closed

Open Beta #2

AustinCasteel opened this issue Apr 26, 2015 · 30 comments

Comments

@AustinCasteel
Copy link

I have kept an eye on this project for some time now because I am very interested in it. Today I saw that the beta was released so I jumped at the chance to test it out for myself and see if it is what I have been needing for some time now.

It took me some time to understand composer and laravel and I still don't think I understand it enough but it works so I continued... I realized that the beta was identical to the laravel install so I guessed that it was setup the same as the laravel install so I did the same thing and used artisan to launch the server.

Then I was happily greeted to a maintenance mode page. So I am guessing I did everything correctly... I just don't know how to continue from here. I have read through the install guide page a few times but don't know what to do now.

I have also tried to read the docs site but it is not up, as well as the support site. Then the last option was the troubleshooting chapter which took me a second to figure out where it was because the link on the guide page is not directing to the correct location.

I realize this is a cms and it may be right in front of me and its just going right over my head.

So I guess the issues that I mentioned would be the redirect error and then myself not understanding how to continue. 😄

Thank you for your time and a product that I have been waiting for.

@chriskonnertz
Copy link
Member

Hello,

thank you for your feedback.

The .zip file is (almost) ready for deployment. You do not need to worry about Composer or Laravel at this point. The idea is to prevent those who want to install the CMS from too much trouble(s) with the framework. If you start development with this CMS you have to deal with the framework but not any earlier. (At least, that's the plan...)

When you see the maintenance mode page the framework is running on your server. So that means your server does fullfil the requirements of the framework. The next step is to install the CMS. It needs to setup a database, create your user account and so on. To run the installer call <base-url>/install, e. g. http://localhost/contentify/public/install. The installer will guide you trough the installation and complain about every step that has not been done so far (CHMOD 777 for some directories, setting up a database). 😉

Probably we need to streamline this process a lot more. Probably the whole setup / installation thingy is confusing atm. Therefore your feedback is precious. It helps to improve the process. 😄

@AustinCasteel
Copy link
Author

Just as a suggestion, instead of having people go into the config files to fill out the sql info, you could have it within the install process as text fields. which then leads to some other things I am encountering.

So I am on step 4 and the database is contentify as default and I set it up and filled out the config file. Every time I hit next I get some errors, and then go back and hit next again and its another group of errors. But now it is stuck on the same error.

"A group already exists with name [Visitors], names must be unique for groups."

So I don't know where to go from here..

@chriskonnertz
Copy link
Member

You are right, a text field that allows users to set the MySQL configuration eases the installation. Unfortunately Laravel does not support writing to config files. There are solutions (for example https://github.com/daftspunk/laravel-config-writer ) but honestly I do not want to bloat the CMS* only for the installation - a process you usually perform once and only once. However, I understand there is a need to simplify the step of changing the MySQL configuration.

*= Third-party packages are dangerous. If you wonder why the CMS runs with Laravel 4.2 instead of 5: That is because not all packages have been upgraded to L5 yet (especially Cartalyst\Sentry has not https://medium.com/cartalyst-development/laravel-5-support-4c11e01c3337 )

@chriskonnertz
Copy link
Member

"A group already exists with name [Visitors], names must be unique for groups."

This is an exception thrown by Cartlayst\Sentry (the user management package that enables authentication, permissions etc.). It says it tries to create a user group with the name "Visitors" but that group already exists. So I assume the user_groups table has been created. The strange thing is, if you repeat the database setup the installer tries to delete all tables that might have been created before to avoid such conflicts.

You have MySQL, right? When you started the database setup for the first time, how long did it run until it stopped? Was it for about half a minute? Maybe it exceeded the PHP script execution time limit ( https://github.com/Contentify/Contentify/blob/master/daux/docs/Development/Troubleshooting.md#installation-execution-time-exceeded )?

@creativewild
Copy link

Hi Chris,

I been following this since i first come across with it last year, was really refreshing seeing that you had setup a repo for it, I did fork as you probably have seen.

I installed it without any problems, just uncomment some code does the trick. I am no php expert, more of a rails guy. but if laravel does not write proper config files, maybe doing an standalone installer that uses the CLI to run the migrations and the write then config file into the config folder?

As i said i am no php expert, but i am learning as i go... and I would be interested in contributing to this amazing project.

edit: LoL actually i was the only one forking it :P

@chriskonnertz
Copy link
Member

Hello,

yes I have seen that there was a fork. 😃

but if laravel does not write proper config files, maybe doing an standalone installer that uses the CLI to run the migrations and the write then config file into the config folder?

It is possible. But atm the installer makes use of many of Laravel's features so it is not easy to decouple it. I really want to avoid that. Adding support for writing config files seems to be much easier.

LoL actually i was the only one forking it

I decided to move the private repository from BitBucket to a public repository on GitHub without making much noise. I do not want it to get too much attention until I am sure no one will be disappointed about the state of the CMS. Therefore I called it the first beta to emphasize that there is still a lot of work to do.

@creativewild
Copy link

Hi,

but this is by far one of the most complete beta cms for gaming out there... when i first installed it i though " fine this is a beta, it probably has articles etc..." I was amazed by how much features it already had... I have even looking for the Callista cms?? I believe you wrote it?? but there was no downloads around. most of the current gaming cms are quite out of date both in code and customization... so this one is quite refreshing :D

I may have found something, i was checking a few laravel wannabe cms's I keep around while I am learning php.

One of them has an interesting approach to this.

checks installation

Route::when('*', 'installation');
if (File::exists(base_path() . "/installed.txt")) {
//other routes
} else {
    Route::get('/', 'InstallationController@getIndex');
}

//INSTALATION
Route::get('install', 'InstallationController@getIndex');
Route::post('install', 'InstallationController@postIndex');
Route::get('install1', 'InstallationController@getIndex1');
Route::post('install1', 'InstallationController@postIndex1');
Route::get('mig', function() {
    if (!File::exists(base_path() . '/installed.txt')) {
        if (File::exists(base_path() . '/main.php')) {
            try {
                Artisan::call('migrate', array('--force' => true));
                Artisan::call('db:seed', array('--force' => true));
                Artisan::call('key:generate', array('--force' => true));
                return Redirect::to('install1');
            } catch (Exception $e) {
                return Redirect::to('install1');
            }
        }
    }
});

from there goes to this InstallationController

class InstallationController extends BaseController {

    private $messages;

    public function __construct() {
        View::addLocation(public_path() . "/panel");
        View::addNamespace("panel", public_path() . "/panel");

        $this->messages = [
            'required' => 'The :attribute is required',
            'email' => 'The :attribute must be a valid email address.',
            'min' => 'The :attribute must be at least :min characters.'
        ];
    }

    public function getIndex() {
        if (File::exists(base_path() . "/installed.txt")) {
            return Redirect::to('/');
        }
        if (File::exists(base_path() . "/main.php")) {
            return Redirect::to('install1');
        }
        return View::make('panel::install');
    }

    public function getIndex1() {
        if (File::exists(base_path() . "/installed.txt")) {
            return Redirect::to('/');
        }
        if (!File::exists(base_path() . "/main.php")) {
            return Redirect::to('install');
        }
        return View::make('panel::install1');
    }

    public function postIndex() {
        $data = [
            'database host' => Input::get('host'),
            'database name' => Input::get('name'),
            'database password' => Input::get('pass'),
            'database username' => Input::get('user'),
            'smtp host' => Input::get('smtp_host'),
            'smtp password' => Input::get('smtp_password'),
            'smtp username' => Input::get('smtp_username')
        ];
        $rules = [
            'database host' => 'required',
            'database name' => 'required',
            'database password' => 'required',
            'database username' => 'required',
            'smtp host' => 'required',
            'smtp password' => 'required',
            'smtp username' => 'required'
        ];
        $validator = Validator::make($data, $rules, $this->messages);
        if ($validator->fails()) {
            return Redirect::to('install')->with('errors', $validator->messages());
        } else {
            try {
                mysqli_connect(Input::get('host'), Input::get('user'), Input::get('pass'), Input::get('name'));
                if (mysqli_connect_errno()) {
                    $true = false;
                } else {
                    $true = true;
                }
            } catch (Exception $e) {
                $true = false;
            }
            if ($true) {
                File::put(base_path() . "/main.php", '<?php $host = "' . Input::get('host') . '";$user="' . Input::get('user') . '";$pass="' . Input::get('pass') . '";$db="' . Input::get('name') . '";$smtp_host="' . Input::get('smtp_host') . '";$smtp_username="' . Input::get('smtp_username') . '";$smtp_password="' . Input::get('smtp_password') . '"; ?>');
                return Redirect::to('mig');
            } else {
                File::delete(base_path() . "/main.php");
                return Redirect::to('install')->with('error', 'Can not connect to database ' . Input::get('name') . '. Check the details and try again.');
            }
        }
    }

    public function postIndex1() {
        $data = [
            'site title' => Input::get('site_title'),
            'admin username' => Input::get('username'),
            'admin password' => Input::get('password'),
            'admin email' => Input::get('email')
        ];
        $rules = [
            'site title' => 'required',
            'admin username' => 'required',
            'admin password' => 'required|min:8',
            'admin email' => 'required|email'
        ];
        $validator = Validator::make($data, $rules, $this->messages);
        if ($validator->fails()) {
            return Redirect::to('install1')->with('errors', $validator->messages())->withInput();
        } else {
            $code = str_random(20);
            $salt = md5(e(Input::get('password')) . "cms");
            $password = hash('whirlpool', $salt . "+" . e(Input::get('password')) . "+" . $salt);
            User::create([
                'isAdmin' => 1,
                'username' => e(Input::get('username')),
                'password' => $password,
                'email' => e(Input::get('email')),
                'first_name' => 'Super',
                'last_name' => 'Administrator',
                'activated' => 1,
                'group' => 1
            ]);
            $settings = Settings::first();
            $settings->title = e(Input::get('site_title'));
            $settings->email = e(Input::get('email'));
            $settings->save();
            File::put(base_path() . "/installed.txt", "");
            $user = User::where('username', e(Input::get('username')))->first();
            Session::put('logged', $user);
            return Redirect::to('admin-panel/settings');
        }
    }

}

it writes the main.php into the basepath() in there theres a config.php that includes the main.php

config.php

<?php
if(file_exists(base_path()."/main.php")){
include_once("main.php");
// DO NOT EDIT
define("DB_HOST", $host);
define("DB_USER", $user);
define("DB_PASS", $pass);
define("DB_NAME", $db);
}else{
// EDIT THIS
define("DB_HOST", "localhost");
define("DB_USER", "");
define("DB_PASS", "");
define("DB_NAME", "");
}

and the config.php gets included into the app/config/database.php

<?php

require base_path() . "/config.php";

return array(
    /*
      |--------------------------------------------------------------------------
      | PDO Fetch Style
      |--------------------------------------------------------------------------
      |*/

...

 'mysql' => array(
            'driver' => 'mysql',
            'host' => DB_HOST,
            'database' => DB_NAME,
            'username' => DB_USER,
            'password' => DB_PASS,
            'charset' => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix' => '',
        ),

...

NOTE: This is probably not a good way of doing it, but since i knew about this one i am sharing it, who knows it may help

@chriskonnertz
Copy link
Member

I have even looking for the Callista cms?? I believe you wrote it??

Yes. Somehow Contentify is Callista 4.

but there was no downloads around.

True. It has never been open source.

most of the current gaming cms are quite out of date both in code and customization

Exactly. I have done some research and I do believe there is none modern gaming CMS that is open source and more than just a very early alpha.

So the CMS you reviewed redirects you to its installation controller when you arrive at the website, right? Pretty convenient. Maybe Contentify should adopt that behaviour.

This is probably not a good way of doing it

Well it's not very laravelish and I've always been trying to stick to the Laravel way of PHP.

On the other hand there is no Laravel solution to it at all so I've not much of a choice right?

I'll have a think about it. Thanks for your suggestions.

@AustinCasteel
Copy link
Author

I do have mysql and have multiple databases that run almost all the time so I know it works, however I did turn them all off but the contentify one so that my computer can just focus on it. I realize that it can take some time and that depends on server, internet, and whether you are running it off a host or a personal computer through localhost.

I am running mine as localhost until I have it setup correctly and then move it to my hosting environment. As far as time it took... yea, roughly a half a minute so it could be that. I will test it with the changed php.ini config and see... then if not, could I get the dump file?

@AustinCasteel
Copy link
Author

So I set the time to 0 and then ran the install.... it took 34 seconds and then the error was thrown and it was the visitor thing again. I am going to delete the database and start new and see if that changes anything.

@AustinCasteel
Copy link
Author

So it took 37 seconds and then threw an error that is just about too long to copy here... then I went back and clicked next again, it took 40 seconds and then threw the visitor error.... now I am confused...

@chriskonnertz
Copy link
Member

Me too.

For now a dump seems to be the best solution:
https://gist.github.com/chriskonnertz/ff584773aa3f017537bf
(User account details: username: example, email: example@example.com, password: example)

Can you do me a favor and upload the error log? It's in app\storage\logs\laravel.log and contains all the error messages.

@AustinCasteel
Copy link
Author

Here is the link to the log, thought it would be easier then me posting in here 👍

http://pastebin.com/yCV1a41Z

@AustinCasteel
Copy link
Author

Just because I was curious, plus didn't know where to go, and wanted to test things. After I pushed the dump and it finished, I restarted everything just to make sure, and ran the install again to see if an error comes out or if it moves to the next step.....

lets just say it didn't and pumped out yet another error, on the up side, at least its a different one.

"SQLSTATE[HY000]: General error: 1364 Field 'slug' doesn't have a default value (SQL: insert into users (email, username, password, updated_at, created_at) values (daemon@contentify.org, Daemon, y$eMDzBRoH/TNN5Hm.ImUx4eT3hz9Qz4Givuy8SgbXNciqUv7tEdedO, 2015-04-29 00:51:58, 2015-04-29 00:51:58))"

@chriskonnertz
Copy link
Member

"SQLSTATE[HY000]: General error: 1364 Field 'slug' doesn't have a default value (SQL: insert into users (email, username, password, updated_at, created_at) values (daemon@contentify.org, Daemon, y$eMDzBRoH/TNN5Hm.ImUx4eT3hz9Qz4Givuy8SgbXNciqUv7tEdedO, 2015-04-29 00:51:58, 2015-04-29 00:51:58))"

I made a change to the installer that should fix this bug. (The change is not included in the beta download.)

After I pushed the dump and it finished, I restarted everything just to make sure, and ran the install again

You don't need to do that. I guess it destroyed the tables that you had imported before. Delete all tables and then import the dump again.

@AustinCasteel
Copy link
Author

Just doing it for testing purposes, so that may need to be added somewhere in writing to say don't run it if it has already been ran.

So now my question is once I run the dump how do I get to the site to sign in with example?

@chriskonnertz
Copy link
Member

Oh sorry,you still have that maintenance page, right? Delete this file:
app/storage/meta/.install
Then press F5 and you will see the login area.

@AustinCasteel
Copy link
Author

Ok, thank you, I will test it out tonight and see what I think... But according to Creativewild it's more then what he expected so I have my hopes up....

Then on a side note, can I make the wiki for contentify here on the github page so that people have it to look at for information instead of trying to figure their way around the documentation that's setup currently?

@AustinCasteel
Copy link
Author

I realize you most likely know the create new functions on most things dont work and I assume its because you are working on them. But man, this is exactly what Creativewild said, very well done.

But I do have one thing I want to make a note of just in case it may have been over looked. The matches icon on the side bar and the backend admin panel are crosshairs, where as on the matches page the icon is the steam logo.

Just a little thing that I wanted to make sure it wasn't something that was unknown or over looked. 😄

@chriskonnertz
Copy link
Member

Then on a side note, can I make the wiki for contentify here on the github page

Sure, yeah.

I realize you most likely know the create new functions on most things dont work

They should work. Maybe I should hurry with a public test server where I can try to debug bugs right at the place where they appear.

But I do have one thing I want to make a note of just in case it may have been over looked. The matches icon on the side bar and the backend admin panel are crosshairs, where as on the matches page the icon is the steam logo.

Thanks. This might be something that I have fixed already in the development branch. I will take a look at it.

@chriskonnertz
Copy link
Member

So I keep my promise to setup a demo server:

URL: http://46.101.143.161/
Email: demo@contentify.org
Password: demodemo

There is no service yet that resets the database(database resets at xx:00 and xx:30 hourly) and files so feel free to break everythingupload tons of files to keep me busy cleaning up. 😉

@chriskonnertz
Copy link
Member

But I do have one thing I want to make a note of just in case it may have been over looked. The matches icon on the side bar and the backend admin panel are crosshairs, where as on the matches page the icon is the steam logo.

Fixed: 01a77e9

@creativewild
Copy link

here's a question :). do you mind if i contribute to this project? I re wrote the routes file to check if the installation is done before sending the user to the main page.

I can do some documentation contribution as well...

@chriskonnertz
Copy link
Member

Any help is appreciated. 😄

@AustinCasteel
Copy link
Author

I am very glad to see this going somewhere. I am going to help out the best I can, but php and sql is not my forté by any stretch of the imagination... So I will leave that to you two. But I will work on the wiki and if you want any graphics, I can help you out there as well. 😄

@chriskonnertz
Copy link
Member

I will work on the wiki

Awesome, thanks.

@chriskonnertz
Copy link
Member

I close this issue for now. I've created a new issue dealing with the MySQL tex tfield enhancement: #4

@chriskonnertz
Copy link
Member

@Longshotpro2

Guess it's a good idea to use GitHub wiki. For now I've removed the old solution (Daux) from the Contentify repo.

The old docs are now accessible from the wiki:
https://github.com/Contentify/Contentify/wiki

@AustinCasteel
Copy link
Author

@chriskonnertz

Ok, I'm sorry I haven't gotten around to doing it yet... between final exams, graduation, and moving I haven't had the time for the wiki. Hopefully coming up I will be able to sit down see what has been done so far and then keep it updated as new things come out.

@chriskonnertz
Copy link
Member

That would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants