-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
368 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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,26 @@ | ||
/.git | ||
/.github | ||
/.idea | ||
/.vscode | ||
/docker/* | ||
!/docker/deploy | ||
/node_modules | ||
/public/build | ||
/public/hot | ||
/public/storage | ||
/storage/*.key | ||
/storage/logs | ||
/storage/app/private | ||
/storage/app/public/fonts | ||
/data | ||
/vendor | ||
_ide_helper.php | ||
.editorconfig | ||
.phpstorm.meta.php | ||
.phpunit.result.cache | ||
auth.json | ||
docker-compose.yml | ||
Homestead.json | ||
Homestead.yaml | ||
npm-debug.log | ||
yarn-error.log |
This file contains 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
File renamed without changes.
This file contains 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,56 @@ | ||
name: Build and push Docker image to GHCR | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
on: | ||
workflow_dispatch: | ||
release: | ||
branches: ['main'] | ||
types: ['published'] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
PLATFORMS: linux/amd64, linux/arm64, linux/arm/v7 | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Docker buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
id: build-and-push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
platforms: ${{ env.PLATFORMS }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains 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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
/public/hot | ||
/public/storage | ||
/storage/*.key | ||
/data | ||
/vendor | ||
.env | ||
.env.backup | ||
|
This file contains 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,45 @@ | ||
FROM serversideup/php:8.2-fpm-nginx | ||
|
||
ARG NODE_VERSION=18 | ||
|
||
# Add /config to allowed directory tree | ||
ENV PHP_OPEN_BASEDIR=$WEBUSER_HOME:/config/:/dev/stdout:/tmp | ||
|
||
# Enable mixed ssl mode so port 80 or 443 can be used | ||
ENV SSL_MODE="mixed" | ||
|
||
# Install additional packages and cron file | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
curl \ | ||
cron \ | ||
htop \ | ||
# Install cron file | ||
&& echo "MAILTO=\"\"\n* * * * * webuser /usr/bin/php /var/www/html/artisan schedule:run" > /etc/cron.d/laravel \ | ||
# Install node & npm | ||
&& curl -sLS https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - \ | ||
&& apt-get install -y nodejs \ | ||
&& npm install -g npm \ | ||
# Clean up package lists | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* | ||
|
||
# Copy package configs | ||
COPY --chmod=755 docker/deploy/etc/s6-overlay/ /etc/s6-overlay/ | ||
|
||
WORKDIR /var/www/html | ||
|
||
# Copy app | ||
COPY --chown=webuser:webgroup . /var/www/html/ | ||
|
||
# Install composer dependencies | ||
RUN composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev --no-cache \ | ||
&& mkdir -p storage/logs \ | ||
&& php artisan optimize:clear \ | ||
&& chown -R webuser:webgroup /var/www/html | ||
|
||
# Install npm dependencies | ||
RUN npm ci \ | ||
&& npm run build | ||
|
||
VOLUME /config |
This file contains 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 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,48 @@ | ||
<?php | ||
|
||
namespace Database\Seeders; | ||
|
||
use App\Models\User; | ||
use Illuminate\Database\Seeder; | ||
use Illuminate\Support\Carbon; | ||
use Illuminate\Support\Facades\DB; | ||
use Illuminate\Support\Facades\Hash; | ||
use Spatie\Permission\Models\Role; | ||
|
||
class FirstAdminUserSeeder extends Seeder | ||
{ | ||
/** | ||
* Run the database seeds. | ||
* | ||
* @return void | ||
*/ | ||
public function run() | ||
{ | ||
// exit if there are users in the system | ||
if (User::count() !== 0) { | ||
return; | ||
} | ||
|
||
$user = User::create([ | ||
'name' => 'admin', | ||
'email' => '[email protected]', | ||
'email_verified_at' => Carbon::now(), | ||
'password' => Hash::make('password'), | ||
]); | ||
|
||
$roles = Role::all(); | ||
|
||
// give the user full permissions | ||
foreach ($roles as $role) { | ||
if (DB::table('model_has_roles')->where('role_id', $role->id)->where('model_id', $user->id)->count() == 0) { | ||
DB::table('model_has_roles')->insert([ | ||
'role_id' => $role->id, | ||
'model_type' => \App\Models\User::class, | ||
'model_id' => $user->id, | ||
]); | ||
} | ||
} | ||
|
||
app()[\Spatie\Permission\PermissionRegistrar::class]->forgetCachedPermissions(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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,22 @@ | ||
version: '3' | ||
services: | ||
wol-client: | ||
build: | ||
context: ./ | ||
dockerfile: Dockerfile | ||
container_name: wol-client | ||
ports: | ||
- '8080:80' | ||
- '8443:443' | ||
- '6001:6001' # Websocket server | ||
environment: | ||
- PUID=1000 | ||
- PGID=1000 | ||
- APP_URL=http://localhost:8080 | ||
- TZ=Europe/Berlin | ||
volumes: | ||
- '/etc/localtime:/etc/localtime:ro' | ||
- './data/config:/config' # Directory for sqlite database & .env | ||
- './data/ssl/web:/etc/ssl/web' # Directory for ssl certificates | ||
image: wol-client | ||
restart: unless-stopped |
Empty file.
This file contains 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,2 @@ | ||
#!/command/with-contenv bash | ||
s6-setuidgid root /usr/sbin/cron -f -l 8 |
This file contains 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 @@ | ||
longrun |
Empty file.
This file contains 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,2 @@ | ||
#!/command/with-contenv bash | ||
s6-setuidgid webuser php $WEBUSER_HOME/artisan queue:work --tries=3 --no-ansi -q |
This file contains 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 @@ | ||
longrun |
2 changes: 2 additions & 0 deletions
2
docker/deploy/etc/s6-overlay/s6-rc.d/laravel-automations/dependencies
This file contains 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,2 @@ | ||
runas-user | ||
configure-ssl |
Empty file.
This file contains 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,2 @@ | ||
#!/command/with-contenv bash | ||
s6-setuidgid webuser php $WEBUSER_HOME/artisan queue:work --queue notifications --tries=3 --no-ansi -q |
This file contains 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 @@ | ||
longrun |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains 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,2 @@ | ||
#!/command/with-contenv bash | ||
s6-setuidgid webuser php $WEBUSER_HOME/artisan websockets:serve --no-ansi -q |
This file contains 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 @@ | ||
longrun |
Oops, something went wrong.