Compare commits

...

12 Commits
1.1.0 ... 1.2.0

Author SHA1 Message Date
bce05d3171 Merge pull request #148 from vitodeploy/versioning
show current version
2024-04-01 20:50:03 +02:00
929dd1dbaa show version a bit trasparent on mobile 2024-04-01 00:06:29 +02:00
2bcd145bea docker 2024-03-31 23:58:45 +02:00
c0f903d4ca show current version 2024-03-31 23:29:22 +02:00
cca4ab7ae3 fix code editor 2024-03-29 18:40:20 +01:00
51e7325d3d fix trusted procies 2024-03-29 18:25:14 +01:00
ce085879c1 Merge pull request #144 from vitodeploy/fix-env-update
empty content on editing file
2024-03-29 12:29:21 +01:00
8a49003e9e fix focus issue 2024-03-29 12:21:33 +01:00
dcc4276f09 fix spacing in the editor 2024-03-29 10:07:14 +01:00
f089779045 empty content on editing file 2024-03-29 00:42:36 +01:00
f1efb9a6c8 make project dropdown full width #132 2024-03-28 18:59:37 +01:00
a7d472fb45 update discord link 2024-03-27 22:33:24 +01:00
26 changed files with 114 additions and 67 deletions

View File

@ -12,5 +12,5 @@ MAIL_PORT=
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_ADDRESS="noreply@${APP_NAME}"
MAIL_FROM_NAME="${APP_NAME}"

View File

@ -12,5 +12,5 @@ MAIL_PORT=
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_ADDRESS="noreply@${APP_NAME}"
MAIL_FROM_NAME="${APP_NAME}"

View File

@ -13,5 +13,5 @@ MAIL_PORT=
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_ADDRESS="noreply@${APP_NAME}"
MAIL_FROM_NAME="${APP_NAME}"

2
.gitignore vendored
View File

@ -7,6 +7,8 @@
/storage/test-key
/storage/test-key.pub
/vendor
/storage/database.sqlite
/storage/database-test.sqlite
.env
.env.backup
.env.production

View File

@ -37,7 +37,7 @@ ## Useful Links
- [Feedbacks](https://vitodeploy.featurebase.app)
- [Roadmap](https://vitodeploy.featurebase.app/roadmap)
- [Video Demo](https://youtu.be/rLRHIyEfON8)
- [Discord](https://discord.gg/dcUWA5DV)
- [Discord](https://discord.gg/uZeeHZZnm5)
- [Contribution](/CONTRIBUTING.md)
- [Security](/SECURITY.md)

View File

@ -1,10 +1,11 @@
<?php
namespace App\Http\Controllers;
namespace App\Http\Controllers\API;
use App\Actions\Site\Deploy;
use App\Exceptions\SourceControlIsNotConnected;
use App\Facades\Notifier;
use App\Http\Controllers\Controller;
use App\Models\GitHook;
use App\Models\ServerLog;
use App\Notifications\SourceControlDisconnected;

View File

@ -0,0 +1,16 @@
<?php
namespace App\Http\Controllers\API;
use App\Http\Controllers\Controller;
class HealthController extends Controller
{
public function __invoke()
{
return response()->json([
'success' => true,
'version' => vito_version(),
]);
}
}

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

@ -7,7 +7,6 @@
use App\Helpers\Toast;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Http\Resources\Json\ResourceCollection;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
@ -37,9 +36,5 @@ public function boot(): void
$this->app->bind('toast', function () {
return new Toast;
});
if (str(config('app.url'))->startsWith('https://')) {
URL::forceScheme('https');
}
}
}

View File

@ -98,12 +98,12 @@ public function reboot(): void
);
}
public function editFile(string $path, string $content): void
public function editFile(string $path, ?string $content = null): void
{
$this->server->ssh()->exec(
$this->getScript('edit-file.sh', [
'path' => $path,
'content' => $content,
'content' => $content ?? '',
]),
);
}

View File

@ -29,3 +29,8 @@ function htmx(): HtmxResponse
{
return new HtmxResponse();
}
function vito_version(): string
{
return exec('git describe --tags');
}

View File

@ -27,9 +27,9 @@ COPY docker/php.ini /etc/php/8.2/cli/conf.d/99-vito.ini
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# app
COPY . /var/www/html
RUN rm -rf /var/www/html/vendor
RUN rm -rf /var/www/html/.env
RUN rm -rf /var/www/html
RUN git clone -b 1.x https://github.com/vitodeploy/vito.git /var/www/html
RUN git checkout $(git tag -l --merged 1.x --sort=-v:refname | head -n 1)
RUN composer install --no-dev --prefer-dist
RUN chown -R www-data:www-data /var/www/html \
&& chmod -R 755 /var/www/html/storage /var/www/html/bootstrap/cache

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"resources/css/app.css": {
"file": "assets/app-eff15392.css",
"file": "assets/app-e3775b0a.css",
"isEntry": true,
"src": "resources/css/app.css"
},
@ -12,7 +12,7 @@
"css": [
"assets/app-a1ae07b3.css"
],
"file": "assets/app-a74f846c.js",
"file": "assets/app-5f99a92f.js",
"isEntry": true,
"src": "resources/js/app.js"
}

File diff suppressed because one or more lines are too long

View File

@ -26,7 +26,9 @@ document.body.addEventListener('htmx:configRequest', (event) => {
if (window.getSelection) { window.getSelection().removeAllRanges(); }
else if (document.selection) { document.selection.empty(); }
});
let activeElement = null;
document.body.addEventListener('htmx:beforeRequest', (event) => {
activeElement = document.activeElement;
let targetElements = event.target.querySelectorAll('[hx-disable]');
for (let i = 0; i < targetElements.length; i++) {
targetElements[i].disabled = true;
@ -38,6 +40,18 @@ document.body.addEventListener('htmx:afterRequest', (event) => {
targetElements[i].disabled = false;
}
});
document.body.addEventListener('htmx:afterSwap', (event) => {
tippy('[data-tooltip]', {
content(reference) {
return reference.getAttribute('data-tooltip');
},
});
if (activeElement) {
activeElement.blur();
activeElement.focus();
activeElement = null;
}
});
import toastr from 'toastr';
window.toastr = toastr;
@ -49,13 +63,6 @@ window.toastr.options = {
import tippy from 'tippy.js';
import 'tippy.js/dist/tippy.css';
document.body.addEventListener('htmx:afterSettle', (event) => {
tippy('[data-tooltip]', {
content(reference) {
return reference.getAttribute('data-tooltip');
},
});
});
tippy('[data-tooltip]', {
content(reference) {
return reference.getAttribute('data-tooltip');

View File

@ -17,7 +17,7 @@
document.documentElement.className === 'dark'
? 'one-dark'
: 'github'
editor = window.ace.edit(this.editorId)
editor = window.ace.edit(this.editorId, {})
let contentElement = document.getElementById(
`text-${this.editorId}`,
)

View File

@ -1,9 +1,12 @@
<nav
class="fixed top-0 z-50 flex h-[64px] w-full items-center border-b border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-800"
>
<div class="w-full px-3 py-3 lg:px-5 lg:pl-3">
<div class="w-full">
<div class="flex items-center justify-between">
<div class="flex items-center justify-start">
<div
class="flex items-center justify-start border-r border-gray-200 px-3 py-3 dark:border-gray-700 md:w-64"
>
<button
data-drawer-target="logo-sidebar"
data-drawer-toggle="logo-sidebar"
@ -15,12 +18,17 @@ class="inline-flex items-center rounded-md p-2 text-sm text-gray-500 hover:bg-gr
<x-heroicon name="o-bars-3-center-left" class="h-6 w-6" />
</button>
<a href="/" class="ms-2 flex md:me-24">
<div class="flex items-center justify-start text-3xl font-extrabold">
<div class="relative flex items-center justify-start text-3xl font-extrabold">
<x-application-logo class="h-9 w-9 rounded-md" />
<span class="ml-1 hidden sm:block">Deploy</span>
<span class="ml-1 hidden md:block">Deploy</span>
<span
class="absolute bottom-0 left-0 right-0 rounded-b-md bg-gray-700/60 text-center text-xs text-white md:relative md:ml-1 md:block md:bg-inherit md:text-inherit"
>
{{ vito_version() }}
</span>
</div>
</a>
<div class="h-[64px] w-1 border-r border-gray-200 px-3 dark:border-gray-700 md:px-0"></div>
</div>
<div class="ml-5 cursor-pointer" x-data="">
<div
class="flex w-full items-center rounded-md border border-gray-200 bg-gray-100 px-4 py-2 text-sm text-gray-900 focus:ring-4 focus:ring-gray-300 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300 dark:focus:ring-gray-600"
@ -31,7 +39,7 @@ class="flex w-full items-center rounded-md border border-gray-200 bg-gray-100 px
</div>
</div>
</div>
<div class="flex items-center">
<div class="flex items-center px-3 py-3">
<div class="mr-3">
@include("layouts.partials.color-scheme")
</div>

View File

@ -1,5 +1,5 @@
<div data-tooltip="Project" class="cursor-pointer">
<x-dropdown align="left">
<x-dropdown width="full">
<x-slot:trigger>
<div>
<div

View File

@ -137,8 +137,8 @@
x-on:click="close"
class="fixed inset-0 bottom-0 left-0 right-0 top-0 z-[1000] items-center bg-gray-500 opacity-75 dark:bg-gray-900"
></div>
<div class="absolute z-[1000] mt-20 lg:scale-110">
<div class="w-[500px]">
<div class="absolute left-1 right-1 z-[1000] mt-20 md:left-auto md:right-auto lg:scale-110">
<div class="w-full px-10 md:w-[500px]">
<x-text-input
id="search-input"
x-ref="input"

View File

@ -1,7 +1,9 @@
<?php
// git hook
use App\Http\Controllers\GitHookController;
use App\Http\Controllers\API\GitHookController;
use App\Http\Controllers\API\HealthController;
use Illuminate\Support\Facades\Route;
Route::any('git-hooks', GitHookController::class)->name('git-hooks');
Route::get('health', HealthController::class)->name('api.health');
Route::any('git-hooks', GitHookController::class)->name('api.git-hooks');

View File

@ -1,5 +1,6 @@
#!/bin/bash
export VITO_VERSION="1.x"
export DEBIAN_FRONTEND=noninteractive
export NEEDRESTART_MODE=a
@ -151,11 +152,13 @@ ln -s /etc/nginx/sites-available/vito /etc/nginx/sites-enabled/
service nginx restart
rm -rf /home/${V_USERNAME}/vito
git config --global core.fileMode false
git clone -b 1.x ${V_REPO} /home/${V_USERNAME}/vito
git clone -b ${VITO_VERSION} ${V_REPO} /home/${V_USERNAME}/vito
find /home/${V_USERNAME}/vito -type d -exec chmod 755 {} \;
find /home/${V_USERNAME}/vito -type f -exec chmod 644 {} \;
cd /home/${V_USERNAME}/vito && git config core.fileMode false
cd /home/${V_USERNAME}/vito && composer install --no-dev
cd /home/${V_USERNAME}/vito
git checkout $(git tag -l --merged ${VITO_VERSION} --sort=-v:refname | head -n 1)
composer install --no-dev
cp .env.prod .env
touch /home/${V_USERNAME}/vito/storage/database.sqlite
php artisan key:generate

View File

@ -4,7 +4,9 @@ cd /home/vito/vito
php artisan down
git pull
git fetch --all
git checkout $(git tag -l --merged 1.x --sort=-v:refname | head -n 1)
composer install --no-dev

View File

@ -212,7 +212,7 @@ public function test_git_hook_deployment(): void
'content' => 'git pull',
]);
$this->post(route('git-hooks'), [
$this->post(route('api.git-hooks'), [
'secret' => 'secret',
])->assertSessionDoesntHaveErrors();
@ -240,7 +240,7 @@ public function test_git_hook_deployment_invalid_secret(): void
'content' => 'git pull',
]);
$this->post(route('git-hooks'), [
$this->post(route('api.git-hooks'), [
'secret' => 'invalid-secret',
])->assertNotFound();