diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 50402283..d92154a0 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -15,9 +15,9 @@ RUN echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-sel && sudo apt-get clean COPY --chown=gitpod:gitpod .gp/conf/xdebug/xdebug.ini /tmp -RUN wget http://xdebug.org/files/xdebug-3.0.2.tgz \ - && tar -xvzf xdebug-3.0.2.tgz \ - && cd xdebug-3.0.2 \ +RUN wget http://xdebug.org/files/xdebug-3.0.4.tgz \ + && tar -xvzf xdebug-3.0.4.tgz \ + && cd xdebug-3.0.4 \ && phpize \ && ./configure --enable-xdebug \ && make \ @@ -32,8 +32,9 @@ RUN sudo bash -c ". /tmp/update-composer.sh" && rm /tmp/update-composer.sh # gitpod trick to bypass the docker caching mechanism for all lines below this one # just increment the value each time you want to bypass the cache system -ENV INVALIDATE_CACHE=182 +ENV INVALIDATE_CACHE=183 +COPY --chown=gitpod:gitpod .gp/conf/apache/apache2.conf /etc/apache2/apache2.conf COPY --chown=gitpod:gitpod .gp/conf/nginx/nginx.conf /etc/nginx/nginx.conf COPY --chown=gitpod:gitpod .gp/bash/.bash_aliases /home/gitpod COPY --chown=gitpod:gitpod .gp/bash/utils.sh /tmp diff --git a/.gitpod.yml b/.gitpod.yml index 95215461..6b3fb346 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -38,4 +38,4 @@ tasks: vscode: extensions: - - felixfbecker.php-debug@1.14.5:xEr6zDqY853IE2HQtLtXPA== + - felixfbecker.php-debug@1.14.12:e02f0fde2ddd444c182ba531e8b09afd diff --git a/.gp/bash/helpers.sh b/.gp/bash/helpers.sh index 35967e7a..0e295391 100644 --- a/.gp/bash/helpers.sh +++ b/.gp/bash/helpers.sh @@ -23,7 +23,7 @@ # gls_version() { local hard version title file - hard="1.1.0" + hard="1.2.0" title="Gitpod Laravel Starter Framework" file="$GITPOD_REPO_ROOT"/.gp/CHANGELOG.md if [[ -f $file ]]; then diff --git a/.gp/bash/init-gitpod.sh b/.gp/bash/init-gitpod.sh index b3035eec..d4e0c827 100644 --- a/.gp/bash/init-gitpod.sh +++ b/.gp/bash/init-gitpod.sh @@ -43,6 +43,18 @@ fi # BEGIN: Bootstrapping if [ ! -d "$GITPOD_REPO_ROOT/vendor" ]; then + + # Handle laravel README.md + if [[ $(bash .gp/bash/utils.sh parse_ini_value starter.ini laravel include_readme) == 1 ]]; then + if [[ ! -f "$GITPOD_REPO_ROOT/README_LARAVEL.md" ]]; then + mv /home/gitpod/laravel-starter/README.md "$GITPOD_REPO_ROOT/README_LARAVEL.md" + else + rm /home/gitpod/laravel-starter/README.md + fi + else + rm /home/gitpod/laravel-starter/README.md + fi + # BEGIN: rsync any new Laravel project files from the docker image to the repository msg="rsync $(php ~/laravel-starter/artisan --version) from ~/laravel-starter to $GITPOD_REPO_ROOT" log_silent "$msg" && start_spinner "$msg" @@ -60,10 +72,9 @@ if [ ! -d "$GITPOD_REPO_ROOT/vendor" ]; then # END: rsync any new Laravel project files from the docker image to the repository # Move, rename or merge any project files that need it - [[ -f "LICENSE" && -d ".gp" ]] && mv -f LICENSE .gp/LICENSE - [[ -f "README.md" && -d ".gp" ]] && mv -f README.md .gp/README.md - [[ -f "CHANGELOG.md" && -d ".gp" ]] && mv -f CHANGELOG.md .gp/CHANGELOG.md - mv /home/gitpod/laravel-starter/README.md "$GITPOD_REPO_ROOT/README_LARAVEL.md" + [[ -f "LICENSE" && -d ".gp" && ! -f .gp/LICENSE ]] && mv -f LICENSE .gp/LICENSE + [[ -f "README.md" && -d ".gp" && ! -f .gp/README.md ]] && mv -f README.md .gp/README.md + [[ -f "CHANGELOG.md" && -d ".gp" && ! -f .gp/CHANGELOG.md ]] && mv -f CHANGELOG.md .gp/CHANGELOG.md # Remove potentially cached phpmyadmin installation if phpmyadmin should not be installed if [ "$(bash .gp/bash/utils.sh parse_ini_value starter.ini phpmyadmin install)" == 0 ]; then diff --git a/.gp/bash/open-preview.sh b/.gp/bash/open-preview.sh index ddf54ea9..7368af3c 100644 --- a/.gp/bash/open-preview.sh +++ b/.gp/bash/open-preview.sh @@ -15,14 +15,8 @@ exit 1 . .gp/bash/spinner.sh -__path= -if [[ -n $1 ]]; then - if [[ ! $1 =~ \/$ ]]; then - __path=/$1/ - else - __path=/$1 - fi -fi +__path=/$1 + __port=$(bash .gp/bash/helpers.sh get_default_server_port) if [[ $(bash .gp/bash/helpers.sh is_inited) == 0 ]]; then . .gp/bash/spinner.sh && diff --git a/.gp/conf/apache/apache2.conf b/.gp/conf/apache/apache2.conf new file mode 100644 index 00000000..723344f5 --- /dev/null +++ b/.gp/conf/apache/apache2.conf @@ -0,0 +1,42 @@ +# Apache httpd v2.4 minimal configuration +# see https://wiki.apache.org/httpd/Minimal_Config for documentation + +ServerRoot ${GITPOD_REPO_ROOT} + +PidFile ${APACHE_PID_FILE} +User ${APACHE_RUN_USER} +Group ${APACHE_RUN_GROUP} + +# Modules as installed/activated via apt-get +IncludeOptional /etc/apache2/mods-enabled/*.load +IncludeOptional /etc/apache2/mods-enabled/*.conf + +# BEGIN: Configure hostname and port for server + +# Bugfix https://github.com/apolopena/gitpod-laravel-starter/issues/134 +ServerName https://localhost + +Listen *:8001 +# END: Configure hostname and port for server + +# Configure Logging +LogFormat "%h %l %u %t \"%r\" %>s %b" common +CustomLog ${APACHE_LOG_DIR}/access.log common +ErrorLog ${APACHE_LOG_DIR}/error.log + +# Never change this block + + AllowOverride None + Require all denied + + +# Direcrory and files to be served +DirectoryIndex index.html index.htm index.php +DocumentRoot "${GITPOD_REPO_ROOT}/${APACHE_DOCROOT_IN_REPO}" + + AllowOverride all + Require all granted + + +# Include conf installed via apt-get +IncludeOptional /etc/apache2/conf-enabled/*.conf \ No newline at end of file diff --git a/.gp/conf/nginx/nginx.conf b/.gp/conf/nginx/nginx.conf index aa2080e9..234f186d 100644 --- a/.gp/conf/nginx/nginx.conf +++ b/.gp/conf/nginx/nginx.conf @@ -46,8 +46,10 @@ http { index index.html index.htm index.php; # Bugfix: https://github.com/apolopena/gitpod-laravel-starter/issues/96 # Rewrite urls that dont have a trailing slash to have a trailing slash thus bypassing redirection. + # Bugfix: https://github.com/apolopena/gitpod-laravel-starter/issues/131 + # force rewrite to use https in order to bypass mixed content errors when in an iframe if (-d $request_filename) { - rewrite [^/]$ $scheme://$http_host$uri/ permanent; + rewrite [^/]$ https://$http_host$uri/ permanent; } try_files $uri $uri/ /index.php$is_args$args; } diff --git a/starter.ini b/starter.ini index b74ba534..be4db393 100644 --- a/starter.ini +++ b/starter.ini @@ -77,6 +77,13 @@ future_release= version=8.* # allow_mixed_web # Valid values are 0 (off) or 1 (on). Only turn this off if you know what you are doing. +# Default value is 1 # Allows for mixed content on the same domain by converting all http requests to https in routes/web.php # Also forces all web routed urls to use the value set for APP_URL in .env -allow_mixed_web=1 \ No newline at end of file +allow_mixed_web=1 +# include_readme +# Valid values are 0 (omit LARAVEL_README.md) or 1 (include LARAVEL_README.md). +# Default value is 0 +# Allows for the ability to include or omit the LARAVEL_README.md file from your project root +# This directive is ignored if LARAVEL_READEME.md is already in the project root and is in version control +include_readme=0 \ No newline at end of file