mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
use blade as conmmands template (#444)
* use blade as conmmands template * fix lint * fix ssl
This commit is contained in:
@ -0,0 +1,6 @@
|
||||
curl --location --request POST 'https://api.dropboxapi.com/2/files/delete_v2' \
|
||||
--header 'Authorization: Bearer {{ $token }}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"path": "{{ $src }}"
|
||||
}'
|
4
resources/views/ssh/storage/dropbox/download.blade.php
Normal file
4
resources/views/ssh/storage/dropbox/download.blade.php
Normal file
@ -0,0 +1,4 @@
|
||||
curl -o {{ $dest }} --location --request POST 'https://content.dropboxapi.com/2/files/download' \
|
||||
--header 'Accept: application/json' \
|
||||
--header 'Dropbox-API-Arg: {"path":"{{ $src }}"}' \
|
||||
--header 'Authorization: Bearer {{ $token }}'
|
6
resources/views/ssh/storage/dropbox/upload.blade.php
Normal file
6
resources/views/ssh/storage/dropbox/upload.blade.php
Normal file
@ -0,0 +1,6 @@
|
||||
curl -sb --location --request POST 'https://content.dropboxapi.com/2/files/upload' \
|
||||
--header 'Accept: application/json' \
|
||||
--header 'Dropbox-API-Arg: {"path":"{{ $dest }}"}' \
|
||||
--header 'Content-Type: text/plain; charset=dropbox-cors-hack' \
|
||||
--header 'Authorization: Bearer {{ $token }}' \
|
||||
--data-binary '@{{ $src }}'
|
1
resources/views/ssh/storage/ftp/delete-file.blade.php
Normal file
1
resources/views/ssh/storage/ftp/delete-file.blade.php
Normal file
@ -0,0 +1 @@
|
||||
curl {{ $passive }} -u "{{ $username }}:{{ $password }}" ftp{{ $ssl }}://{{ $host }}:{{ $port }}/{{ $src }} -Q "DELE /{{ $src }}"
|
1
resources/views/ssh/storage/ftp/download.blade.php
Normal file
1
resources/views/ssh/storage/ftp/download.blade.php
Normal file
@ -0,0 +1 @@
|
||||
curl {{ $passive }} -u "{{ $username }}:{{ $password }}" ftp{{ $ssl }}://{{ $host }}:{{ $port }}/{{ $src }} -o "{{ $dest }}"
|
1
resources/views/ssh/storage/ftp/upload.blade.php
Normal file
1
resources/views/ssh/storage/ftp/upload.blade.php
Normal file
@ -0,0 +1 @@
|
||||
curl {{ $passive }} -T "{{ $src }}" -u "{{ $username }}:{{ $password }}" ftp{{ $ssl }}://{{ $host }}:{{ $port }}/{{ $dest }}
|
1
resources/views/ssh/storage/local/download.blade.php
Normal file
1
resources/views/ssh/storage/local/download.blade.php
Normal file
@ -0,0 +1 @@
|
||||
cp {{ $src }} {{ $dest }}
|
2
resources/views/ssh/storage/local/upload.blade.php
Normal file
2
resources/views/ssh/storage/local/upload.blade.php
Normal file
@ -0,0 +1,2 @@
|
||||
mkdir -p {{ $destDir }}
|
||||
cp {{ $src }} {{ $destFile }}
|
30
resources/views/ssh/storage/s3/delete-file.blade.php
Normal file
30
resources/views/ssh/storage/s3/delete-file.blade.php
Normal file
@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
command_exists() {
|
||||
command -v "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
install_aws_cli() {
|
||||
echo "Installing AWS CLI"
|
||||
ARCH=$(uname -m)
|
||||
curl "https://awscli.amazonaws.com/awscli-exe-linux-$ARCH.zip" -o "aws.zip"
|
||||
unzip -q aws.zip
|
||||
sudo ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update
|
||||
rm -rf aws.zip aws
|
||||
}
|
||||
|
||||
if ! command_exists aws; then
|
||||
install_aws_cli
|
||||
fi
|
||||
|
||||
if ! command_exists aws; then
|
||||
echo "Error: AWS CLI installation failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export AWS_ACCESS_KEY_ID={{ $key }}
|
||||
export AWS_SECRET_ACCESS_KEY={{ $secret }}
|
||||
export AWS_DEFAULT_REGION={{ $region }}
|
||||
export AWS_ENDPOINT_URL={{ $endpoint }}
|
||||
|
||||
aws s3 rm s3://{{ $bucket }}/{{ $src }}
|
32
resources/views/ssh/storage/s3/download.blade.php
Normal file
32
resources/views/ssh/storage/s3/download.blade.php
Normal file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
command_exists() {
|
||||
command -v "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
install_aws_cli() {
|
||||
echo "Installing AWS CLI"
|
||||
ARCH=$(uname -m)
|
||||
curl "https://awscli.amazonaws.com/awscli-exe-linux-$ARCH.zip" -o "aws.zip"
|
||||
unzip -q aws.zip
|
||||
sudo ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update
|
||||
rm -rf aws.zip aws
|
||||
}
|
||||
|
||||
if ! command_exists aws; then
|
||||
install_aws_cli
|
||||
fi
|
||||
|
||||
if ! command_exists aws; then
|
||||
echo "Error: AWS CLI installation failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export AWS_ACCESS_KEY_ID={{ $key }}
|
||||
export AWS_SECRET_ACCESS_KEY={{ $secret }}
|
||||
export AWS_DEFAULT_REGION={{ $region }}
|
||||
export AWS_ENDPOINT_URL={{ $endpoint }}
|
||||
|
||||
if aws s3 cp s3://{{ $bucket }}/{{ $src }} {{ $dest }}; then
|
||||
echo "Download successful"
|
||||
fi
|
32
resources/views/ssh/storage/s3/upload.blade.php
Normal file
32
resources/views/ssh/storage/s3/upload.blade.php
Normal file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
command_exists() {
|
||||
command -v "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
install_aws_cli() {
|
||||
echo "Installing AWS CLI"
|
||||
ARCH=$(uname -m)
|
||||
curl "https://awscli.amazonaws.com/awscli-exe-linux-$ARCH.zip" -o "aws.zip"
|
||||
unzip -q aws.zip
|
||||
sudo ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update
|
||||
rm -rf aws.zip aws
|
||||
}
|
||||
|
||||
if ! command_exists aws; then
|
||||
install_aws_cli
|
||||
fi
|
||||
|
||||
if ! command_exists aws; then
|
||||
echo "Error: AWS CLI installation failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export AWS_ACCESS_KEY_ID={{ $key }}
|
||||
export AWS_SECRET_ACCESS_KEY={{ $secret }}
|
||||
export AWS_DEFAULT_REGION={{ $region }}
|
||||
export AWS_ENDPOINT_URL={{ $endpoint }}
|
||||
|
||||
if aws s3 cp {{ $src }} s3://{{ $bucket }}/{{ $dest }}; then
|
||||
echo "Upload successful"
|
||||
fi
|
Reference in New Issue
Block a user