-
Notifications
You must be signed in to change notification settings - Fork 59
add koel-init to do init tasks and add the flags to the docs, #208
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
AEnterprise
wants to merge
4
commits into
koel:master
Choose a base branch
from
AEnterprise:koel-init
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
55e46a5
add koel-init to do init tasks and add the flags to the docs, init is…
AEnterprise 29b22f3
warn about missing .env file instead of running the init without it
AEnterprise e7866fc
Apply suggestions from code review
AEnterprise 48dd07f
Update koel-init
AEnterprise File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,3 +5,4 @@ | |
| !/apache.conf | ||
| !/php.ini | ||
| !/koel-entrypoint | ||
| !/koel-init | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,13 @@ | ||
| #!/bin/bash | ||
| #!/bin/sh | ||
phanan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| set -e | ||
|
|
||
| # Change to program root directory. | ||
| cd /var/www/html | ||
|
|
||
| # Run the koel-init script to (optionally) optimize configs and (optionally) run initialize/update koel | ||
| su -s '/bin/sh' -c "/usr/local/bin/koel-init" www-data | ||
|
|
||
| # Run the next entrypoint in the chain. | ||
| echo "running docker-php-entrypoint with arguments $@" | ||
| docker-php-entrypoint $@ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #!/bin/bash | ||
|
|
||
| if [[ ! -f /var/www/html/.env ]]; then | ||
| echo "No .env file found in /var/www/html. Make sure to mount a .env file to store the configuration. You can use the koel:init command (see https://github.com/koel/docker#the-koelinit-command) for a guided setup." | ||
| echo "" | ||
| echo "See https://github.com/koel/koel/blob/master/.env.example for an example .env file." | ||
| exit 0 | ||
| fi | ||
|
|
||
| if [[ -z "${SKIP_INIT}" ]]; then | ||
|
|
||
| if [[ -z "${OPTIMIZE_CONFIG}" ]]; then | ||
| echo "Config not optimized. You can optimize the config with `OPTIMIZE_CONFIG`. Note that this will prevent config modifications from being applied until the container is restarted." | ||
| else | ||
| echo "Optimizing config..." | ||
| # clear before caching, in case this is a container reboot and it was already cached from before | ||
| php artisan config:clear | ||
| php artisan config:cache | ||
| fi | ||
|
|
||
| # Invoke the init script so database migrations run and the config is at least partially validated | ||
| echo "Running installer..." | ||
| php artisan koel:init --no-assets --no-interaction | ||
| php artisan koel:doctor | ||
| else | ||
| echo "Initialization skipped. koel might not work properly if it is misconfigured or if the database is out of date. This should not be used outside of debugging or manual initial setups!" | ||
| fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the current text is pretty cryptic (e.g., what are "some manual adjustments" and what does "providing the needed env variables to the container" mean? I am the author of koel and I'm still having a hard time trying to wrap my head around it 🙂). Can ChatGPT help us here?
Also I don't think this paragraph doesn't blend well with the whole section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure how to word it better. the manul thing is more using the php commands to figue out why things don't work when the init fails entirely
this should be pretty rare though unless koel itself is broken completely already