LinkStackOrg / LinkStack

LinkStack - the ultimate solution for creating a personalized & professional profile page. Showcase all your important links in one place, forget the limitation of one link on social media. Set up your personal site on your own server with just a few clicks.
https://linkstack.org
GNU Affero General Public License v3.0
2.3k stars 235 forks source link

application does not seed and Undefined variable: page #28

Closed ccarney16 closed 2 years ago

ccarney16 commented 2 years ago

Hello! I have been attempting to setup this application for a few days now, and have been running a few issues when attempting to deploy this application. Some background is needed, I run a lot of my applications in containers and for the most part, they work fine with a bit of work. I run a fair amount of laravel applications in containers, so I opted to retrofit the same image to run littlelink custom.

The first problem revolves around the application not generating its key and seeding its database upon first load, and I do not get any button on the missing key page. Knowing my way around artisan, this was not difficult to solve. I do not know if this is due to being put into a container and slightly modified (.env and storage are symlinked to a directory outside of the web folder), but other laravel applications I have tried in the past dont seem to have this issue.

The next problem now stems with Undefined variable: page (View: /var/www/html/resources/views/home.blade.php). Ive tried a few artisan commands but nothing has fixed this problem. I am unsure how to proceed with this issue.

JulianPrieber commented 2 years ago

LittleLink Custom mostly behaves differently than your usual Laravel application. For example, you can't serve it with php artisan serve. Think of this project more like an application like WordPress, one that you simply drop onto a web server.

At the most part I don't really have much experience using docker, tough if you really want to deploy this application with docker you might want to get a generic Apache web server docker image and put everything on there.

The app key can't be generated if PHP can't write to the .env file in the root directory, but as you've said this can be easily circumvented by manually editing the .env file or generating the app key with php artisan key:generate. Otherwise, this should not be a huge problem, assuming you won't need to use the built-in config editor.

The database seeder does not fully work since LittleLink Admin I think, I still need to find out how to fix this. For now, if you wish to use MySQL you have to have this setup in the config first and then run the commands:

php artisan migrate
php artisan db:seed 
php artisan db:seed --class="AdminSeeder"
php artisan db:seed --class="PageSeeder"
php artisan db:seed --class="ButtonSeeder"
JulianPrieber commented 2 years ago

The next problem now stems with Undefined variable: page (View: /var/www/html/resources/views/home.blade.php). Ive tried a few artisan commands but nothing has fixed this problem. [...]

I'm assuming you're using the default built in SQLite database, this error is probably again caused by PHP not being able to write to or read the file database.sqlite found in .../database.

ccarney16 commented 2 years ago

thank you, those commands did work, and php has write access to database.sqlite. I would consider this problem solved for the time being. I am going to continue tinkering with it, and may publish a public image in the near future.