Comments (7)
The best way that I've found to do this is to define your own "setup" command within your composer configuration, then encourage people to run that command after cloning your project instead of composer install. For example, a command named setup
might do the following:
- Install all the composer dependencies
- Copy the configuration file
- Set up the Homestead environment
- Generate the application key
- ??? Anything else you need
And you can create such a command in your composer.json like so:
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"setup": [
"composer install",
"php -r \"copy('.env.example', '.env');\"",
"php vendor/bin/homestead make --ip=192.168.10.32",
"sed -i '' 's/homestead.app/pterodactyl.local/g' Homestead.yaml",
"php artisan key:generate"
]
}
Then someone might do the following:
$ git clone https://github.com/Pterodactyl/Panel.git
$ composer setup
After that command has ran they'll be ready to go, no other set up required, which is ideal
That's the best way I've uncovered so far, I'll update this issue if I ever find something better. Unfortunately it's not possible to do this automatically on composer install
because there's no "on first composer install" event, but there's no danger to someone running composer install
and then composer setup
after so... this method is almost perfect.
Also, minor note, using .app
is bad -- unsure why Laravel encourages this. The .app
gtld is owned by Google and may eventually be put into use, rendering development links broken. .local
is reserved (via wikipedia) so it shouldn't be a risk to use .local during development.
from panel.
Thanks for the note about .app
, I was unaware of that. I like the idea of using a setup
command as well. It might be possible to use post-create-project-cmd
, although I haven't looked into it closely.
from panel.
unfortunately the post-create-project-cmd
event is only fired when you first create a project via composer (composer create-project --prefer-dist laravel/laravel
), so it's not a viable option. There is no event -- as far as I can find -- that is fired after the first composer install
.
from panel.
Yeah, it seems like having a custom setup
command is the way to go. I could potentially include a separate bash script that the install calls each time that checks if it has ready been run, but that is excessive. Plus, if it is its own command they can always redeploy if for some reason it is needed.
from panel.
Discovered that the command included for changing the hostname in the Homestead configuration won't work cross platform. Essentially sed
does not have a cross platform way to rename in place without a backup file (Stackoverflow discussion of the problem here). The cross platform solution is to enable the backup file and then remove it after, so the command looks like:
sed -i.bak 's/homestead.app/pterodactyl.local/g' Homestead.yaml && rm Homestead.yaml.bak
from panel.
Still need to provide documentation for editing their hosts file as well, I could echo it in probably, but that would require sudo privileges.
from panel.
I probably should have a setup-dev
and setup
command, but I'll come back to that when we figure out how we will be shipping the final panel.
from panel.
Related Issues (20)
- other server path to backup
- Querying endpoint including eggs sometimes throws json exception HOT 3
- Hide "Launch SFTP" button on Firefox and Firefox-based browsers. HOT 5
- PostgreSQL not present in releases HOT 1
- Bot Panel HOT 1
- More wings HOT 1
- Stuck on server installation HOT 3
- Nix setup is broken HOT 3
- Reorganize servers HOT 2
- Feature Request - Terminal Output Trigger for Scheduled Tasks
- panel returns a connecting error even though it has obtained node information HOT 2
- Node resolving but Panel showing red heart HOT 7
- Build configuration blank page HOT 1
- More Translations HOT 1
- Admin pages not returning correct URL when using reverse proxy HOT 1
- Wings want start after allocated Disk Space change HOT 1
- Wings do not connect properly. SFTP Error HOT 1
- invalid character '<' looking for beginning of value HOT 1
- Restart every hour HOT 2
- Mounts are not added to the game HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from panel.