Compare commits

...

10 Commits

Author SHA1 Message Date
Philipp Lang 891e4deac1 Add ResyncAction for Maildispatcher when updating memberships
continuous-integration/drone/push Build is passing Details
2023-07-30 11:09:03 +02:00
Philipp Lang 65aeb4aeaf Add websocket
continuous-integration/drone/push Build is passing Details
2023-07-25 17:23:48 +02:00
Philipp Lang 1141ad1cbf Fix deploy key
continuous-integration/drone/tag Build is passing Details
2023-07-25 15:35:20 +02:00
Philipp Lang 1eb1aa61e9 fix install
continuous-integration/drone/tag Build was killed Details
2023-07-25 13:28:36 +02:00
Philipp Lang 91270ea289 fix: install openssh
continuous-integration/drone/tag Build is failing Details
2023-07-25 12:59:32 +02:00
Philipp Lang 242bf146c0 Add gitea release 2023-07-25 12:30:28 +02:00
Philipp Lang 3dcab9d719 Fix Deployments
continuous-integration/drone/tag Build is failing Details
2023-07-25 12:27:34 +02:00
Philipp Lang 4d97c6ff8a Add deployments 2023-07-25 12:21:41 +02:00
Philipp Lang 9d3abb4b23 Add carddav and caldav redirect 2023-07-25 12:20:58 +02:00
Philipp Lang 0c5a3cd27d Fix: Set TrustProxies
continuous-integration/drone/tag Build is passing Details
2023-07-25 12:03:31 +02:00
18 changed files with 1328 additions and 106 deletions

View File

@ -16,3 +16,5 @@ MAIL_FROM_NAME=me
DB_PASSWORD=secret_db_password
MYSQL_PASSWORD=secret_db_password
PUSHER_APP_HOST=socketi

View File

@ -31,6 +31,12 @@ http {
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location = /.well-known/carddav {
return 301 $scheme://$host/dav;
}
location = /.well-known/caldav {
return 301 $scheme://$host/dav;
}
location ~ /\.ht {
deny all;
}

View File

@ -93,6 +93,30 @@ steps:
when:
event: tag
- name: deploy
image: php:8.1.6
environment:
SSH_KEY:
from_secret: deploy_private_key
commands:
- apt-get update > /dev/null
- apt-get install -y openssh-client
- mkdir $HOME/.ssh
- echo "UserKnownHostsFile=/dev/null" >> $HOME/.ssh/config
- echo "StrictHostKeyChecking=no" >> $HOME/.ssh/config
- echo "$SSH_KEY" > $HOME/.ssh/id_rsa
- chmod 600 $HOME/.ssh/id_rsa
- ./vendor/bin/envoy run deploy
when:
event: tag
- name: github push
image: alpine/git
commands:
when:
branch: master
event: push
- name: composer_no_dev
image: composer:2.2.7
commands:
@ -117,93 +141,6 @@ steps:
when:
event: tag
- name: deploy silva
image: drillster/drone-rsync
settings:
hosts: ['zoomyboy.de']
user: stammsilva
source: ./
target: ~/nami
exclude: ['.git']
key:
from_secret: deploy_private_key
script:
- cd ~/nami
- /usr/bin/php8.1 artisan migrate --force
when:
branch: master
event: push
- name: deploy lennep
image: drillster/drone-rsync
settings:
hosts: ['zoomyboy.de']
user: dpsg-lennep
source: ./
target: ~/nami
exclude: ['.git']
key:
from_secret: deploy_private_key
script:
- cd ~/nami
- /usr/bin/php8.1 artisan migrate --force
when:
branch: master
event: push
- name: deploy dpsgkoeln
image: drillster/drone-rsync
settings:
hosts: ['dpsg-koeln.de']
user: dpsg-koeln
source: ./
target: ~/adrema
exclude: ['.git']
key:
from_secret: deploy_private_key
script:
- cd ~/adrema
- /usr/bin/php8.1 artisan migrate --force
- sudo systemctl restart adrema-horizon
when:
branch: master
event: push
- name: deploy dpsgbergischland
image: drillster/drone-rsync
settings:
hosts: ['zoomyboy.de']
user: dpsgbergischland
source: ./
target: ~/adrema
exclude: ['.git']
key:
from_secret: deploy_private_key
script:
- cd ~/adrema
- /usr/bin/php8.1 artisan migrate --force
- sudo systemctl restart adremabl-horizon
when:
branch: master
event: push
- name: github push
image: alpine/git
environment:
SSH_KEY:
from_secret: github_private_key
commands:
- mkdir $HOME/.ssh
- git config core.sshCommand "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
- echo "$SSH_KEY"
- echo "$SSH_KEY" > $HOME/.ssh/id_rsa
- chmod 600 $HOME/.ssh/id_rsa
- git remote add gh git@github.com:zoomyboy/adrema.git
- git push -f gh HEAD:master
when:
branch: master
event: push
services:
- name: db
image: mariadb/server:10.3

8
Envoy.blade.php Normal file
View File

@ -0,0 +1,8 @@
@servers(['docker' => ['stammsilva@zoomyboy.de']])
@task('deploy', ['on' => 'docker'])
cd $ADREMA_PATH
docker compose down
docker compose pull
docker compose up -d
@endtask

View File

@ -12,7 +12,7 @@ class TrustProxies extends Middleware
*
* @var array<int, string>|string|null
*/
protected $proxies;
protected $proxies = '*';
/**
* The headers that should be used to detect proxies.

View File

@ -2,6 +2,7 @@
namespace App\Membership\Actions;
use App\Maildispatcher\Actions\ResyncAction;
use App\Member\Member;
use App\Member\Membership;
use App\Setting\NamiSettings;
@ -16,7 +17,7 @@ class MembershipDestroyAction
public function handle(Member $member, Membership $membership, NamiSettings $settings): void
{
$api = $settings->login();
if ($membership->hasNami) {
$settings->login()->deleteMembership(
$member->nami_id,
@ -39,6 +40,8 @@ class MembershipDestroyAction
$settings,
);
ResyncAction::dispatch();
return redirect()->back();
}
}

View File

@ -4,6 +4,7 @@ namespace App\Membership\Actions;
use App\Activity;
use App\Group;
use App\Maildispatcher\Actions\ResyncAction;
use App\Member\Member;
use App\Member\Membership;
use App\Setting\NamiSettings;
@ -95,6 +96,8 @@ class MembershipStoreAction
$settings,
);
ResyncAction::dispatch();
return redirect()->back();
}
}

View File

@ -3,6 +3,7 @@
namespace App\Membership\Actions;
use App\Activity;
use App\Maildispatcher\Actions\ResyncAction;
use App\Member\Member;
use App\Member\Membership;
use App\Subactivity;
@ -64,6 +65,8 @@ class MembershipUpdateAction
$request->promised_at ? Carbon::parse($request->promised_at) : null,
);
ResyncAction::dispatch();
return redirect()->back();
}
}

View File

@ -42,18 +42,20 @@
"monicahq/laravel-sabre": "^1.6",
"nunomaduro/collision": "^6.1",
"phake/phake": "^4.2",
"pusher/pusher-php-server": "^7.2",
"spatie/laravel-data": "^3.0",
"spatie/laravel-ignition": "^1.0",
"spatie/laravel-medialibrary": "^10.0",
"spatie/laravel-settings": "^2.2",
"worksome/request-factories": "^2.5",
"zoomyboy/laravel-nami": "dev-master",
"zoomyboy/osm": "^1.0",
"zoomyboy/phone": "^1.0",
"zoomyboy/tex": "dev-main as 1.0",
"zoomyboy/osm": "^1.0"
"zoomyboy/tex": "dev-main as 1.0"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"laravel/envoy": "^2.8",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/larastan": "^2.0",

1182
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,7 @@ return [
|
*/
'default' => env('BROADCAST_DRIVER', 'log'),
'default' => env('BROADCAST_DRIVER', 'pusher'),
/*
|--------------------------------------------------------------------------
@ -30,12 +30,16 @@ return [
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'key' => 'adremakey',
'app_id' => 'adremaid',
'secret' => 'adremasecret',
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'cluster' => 'adrema',
'encrypted' => true,
'host' => env('PUSHER_APP_HOST', '127.0.0.1'),
'useTLS' => true,
'port' => 6001,
'scheme' => 'http',
],
],

View File

@ -13,6 +13,7 @@ services:
image: zoomyboy/adrema-app:latest
depends_on:
- db
command: /bin/entrypoint app
env_file:
- .app.env
environment:
@ -32,7 +33,27 @@ services:
depends_on:
- db
- php
command: /bin/horizon-entrypoint
command: /bin/entrypoint horizon
env_file:
- .app.env
environment:
DB_HOST: db
DB_DATABASE: db
DB_USERNAME: db
QUEUE_CONNECTION: redis
XELATEX_BIN: /usr/bin/xelatex
PDFLATEX_BIN: /usr/bin/pdflatex
REDIS_HOST: redis
volumes:
- ./data/storage:/app/storage/app
- ./cookies:/app/packages/laravel-nami/.cookies
schedule:
image: zoomyboy/adrema-app:latest
depends_on:
- db
- php
command: /bin/entrypoint schedule
env_file:
- .app.env
environment:

View File

@ -87,6 +87,15 @@ services:
volumes:
- ./data/db:/var/lib/mysql
socketi:
image: quay.io/soketi/soketi:89604f268623cf799573178a7ba56b7491416bde-16-debian
ports:
- '6001:6001'
environment:
SOKETI_DEFAULT_APP_ID: adremaid
SOKETI_DEFAULT_APP_KEY: adremakey
SOKETI_DEFAULT_APP_SECRET: adremasecret
redis:
image: redis:alpine3.18
container_name: redis

41
package-lock.json generated
View File

@ -10,12 +10,14 @@
"@vitejs/plugin-vue": "^4.2.3",
"change-case": "^4.1.2",
"floating-vue": "^2.0.0-beta.24",
"laravel-echo": "^1.15.2",
"laravel-vite-plugin": "^0.7.8",
"lodash": "^4.17.21",
"merge": "^2.1.1",
"pinia": "^2.1.4",
"postcss-import": "^14.1.0",
"prettier": "^2.8.8",
"pusher-js": "^8.3.0",
"svg-sprite": "^2.0.2",
"vite": "^4.3.9",
"vue": "^3.3.4",
@ -2444,6 +2446,14 @@
"resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz",
"integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A=="
},
"node_modules/laravel-echo": {
"version": "1.15.2",
"resolved": "https://registry.npmjs.org/laravel-echo/-/laravel-echo-1.15.2.tgz",
"integrity": "sha512-FpbYv4hnAE/ck1ow2aLlx3wBuDRMNWBcSCpFmh9EkUxxBYZoaRt8rB4pKPnfAESvcaguohEesQ1naNM81zCWPQ==",
"engines": {
"node": ">=10"
}
},
"node_modules/laravel-vite-plugin": {
"version": "0.7.8",
"resolved": "https://registry.npmjs.org/laravel-vite-plugin/-/laravel-vite-plugin-0.7.8.tgz",
@ -3165,6 +3175,14 @@
"node": ">=6"
}
},
"node_modules/pusher-js": {
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/pusher-js/-/pusher-js-8.3.0.tgz",
"integrity": "sha512-6GohP06WlVeomAQQe9qWh1IDzd3+InluWt+ZUOcecVK1SEQkg6a8uYVsvxSJm7cbccfmHhE0jDkmhKIhue8vmA==",
"dependencies": {
"tweetnacl": "^1.0.3"
}
},
"node_modules/qs": {
"version": "6.11.2",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz",
@ -3745,6 +3763,11 @@
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz",
"integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w=="
},
"node_modules/tweetnacl": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
"integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="
},
"node_modules/type-check": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
@ -5766,6 +5789,11 @@
"resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz",
"integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A=="
},
"laravel-echo": {
"version": "1.15.2",
"resolved": "https://registry.npmjs.org/laravel-echo/-/laravel-echo-1.15.2.tgz",
"integrity": "sha512-FpbYv4hnAE/ck1ow2aLlx3wBuDRMNWBcSCpFmh9EkUxxBYZoaRt8rB4pKPnfAESvcaguohEesQ1naNM81zCWPQ=="
},
"laravel-vite-plugin": {
"version": "0.7.8",
"resolved": "https://registry.npmjs.org/laravel-vite-plugin/-/laravel-vite-plugin-0.7.8.tgz",
@ -6262,6 +6290,14 @@
"integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==",
"dev": true
},
"pusher-js": {
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/pusher-js/-/pusher-js-8.3.0.tgz",
"integrity": "sha512-6GohP06WlVeomAQQe9qWh1IDzd3+InluWt+ZUOcecVK1SEQkg6a8uYVsvxSJm7cbccfmHhE0jDkmhKIhue8vmA==",
"requires": {
"tweetnacl": "^1.0.3"
}
},
"qs": {
"version": "6.11.2",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz",
@ -6678,6 +6714,11 @@
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz",
"integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w=="
},
"tweetnacl": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
"integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="
},
"type-check": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",

View File

@ -26,12 +26,14 @@
"@vitejs/plugin-vue": "^4.2.3",
"change-case": "^4.1.2",
"floating-vue": "^2.0.0-beta.24",
"laravel-echo": "^1.15.2",
"laravel-vite-plugin": "^0.7.8",
"lodash": "^4.17.21",
"merge": "^2.1.1",
"pinia": "^2.1.4",
"postcss-import": "^14.1.0",
"prettier": "^2.8.8",
"pusher-js": "^8.3.0",
"svg-sprite": "^2.0.2",
"vite": "^4.3.9",
"vue": "^3.3.4",

View File

@ -26,6 +26,7 @@
<server name="APP_ENV" value="testing"/>
<server name="BCRYPT_ROUNDS" value="4"/>
<server name="CACHE_DRIVER" value="array"/>
<server name="BROADCAST_DRIVER" value="log"/>
<server name="MAIL_MAILER" value="array"/>
<server name="QUEUE_CONNECTION" value="sync"/>
<server name="SESSION_DRIVER" value="array"/>

2
resources/js/app.js vendored
View File

@ -4,6 +4,7 @@ import axios from 'axios';
import VueAxios from 'vue-axios';
import {Plugin as FloatingVue, options as FloatingVueOptions} from './lib/floatingVue.js';
import {createPinia, PiniaVuePlugin} from 'pinia';
import Echo from './lib/echo.js';
import requireModules from './lib/requireModules.js';
import AppLayout from './layouts/AppLayout.vue';
@ -21,6 +22,7 @@ const pinia = createPinia();
var views = import.meta.glob('./views/**/*.vue');
axios.interceptors.response.use(...toastInterceptor);
window.Echo = Echo;
createInertiaApp({
title: (title) => `${title} | Adrema`,

14
resources/js/lib/echo.js vendored Normal file
View File

@ -0,0 +1,14 @@
import Pusher from 'pusher-js';
import Echo from 'laravel-echo';
window.Pusher = Pusher;
export default new Echo({
broadcaster: 'pusher',
key: 'adremakey',
wsHost: window.location.hostname,
wsPort: 6001,
forceTLS: false,
disableStats: true,
cluster: 'adrema',
enabledTransports: ['ws', 'wss'],
});