Skip to content

Commit

Permalink
add patch v3.6.2-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
ericwang401 committed Feb 11, 2023
1 parent 161a587 commit ae56916
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 158 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ This file is a running track of new features and fixes to each version of the pa

This project follows [Semantic Versioning](http://semver.org) guidelines.

## v3.6.2-beta

### Fixed

- IP Addresses being clipped if too long in the UI (x2)
- Hostname validation regex in frontend
- Viewport glitch when a server name or hostname is too long
- Validation rule not catching special characters from other languages for OS password validation

### Note

If you are developing automation software for Convoy, please implement these regular expressions in your code. Otherwise, your code will error when you send invalid requests.
- server `account_password` validation
- `/^[A-z0-9!@£$%^&*()\'~*_+\-]+$/` to detect special characters from other language
- `/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})/u` minimum password requirements
- server `hostname` validation
- `/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/`

## v3.6.1-beta

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function handle(Request $request, Closure $next)
try {
$server->validateCurrentState();
} catch (ServerStateConflictException $exception) {
if ($request->routeIs('api:client:servers.show')) {
if ($request->routeIs('client.servers.show')) {
return $next($request);
}

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/Admin/Servers/StoreServerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function rules()
'limits.bandwidth' => $rules['bandwidth_limit'],
'limits.address_ids' => 'sometimes|nullable|array',
'limits.address_ids.*' => 'integer|exists:ip_addresses,id',
'account_password' => ['sometimes', 'nullable', 'string', 'min:8', 'max:191', 'regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})/u'],
'account_password' => ['sometimes', 'nullable', 'string', 'min:8', 'max:191', 'regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})/u', 'regex:/^[A-z0-9!@£$%^&*()\'~*_+\-]+$/'],
'should_create_server' => 'present|boolean',
'template_uuid' => 'required_if:create_server,1|string|exists:templates,uuid',
'start_on_completion' => 'present|boolean',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function rules()
return [
'type' => [new Enum(AuthenticationType::class), 'required'],
'ssh_keys' => ['nullable', 'string', 'exclude_unless:type,sshkeys'],
'password' => ['string', 'min:8', 'max:191', 'regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})/u', 'exclude_unless:type,cipassword'],
'password' => ['string', 'min:8', 'max:191', 'regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})/u', 'regex:/^[A-z0-9!@£$%^&*()\'~*_+\-]+$/', 'exclude_unless:type,cipassword'],
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const CreateServerModal = ({ nodeId, userId, open, onClose }: Props) => {
.string()
.max(191, 'Do not exceed 191 characters')
.matches(
/((https?):\/\/)?(www.)?[a-z0-9]+(\.[a-z]{2,}){1,3}(#?\/?[a-zA-Z0-9#]+)*\/?(\?[a-zA-Z0-9-_]+=[a-zA-Z0-9-%]+&?)?$/,
/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/,
'Enter a valid hostname'
)
.required(),
Expand All @@ -72,6 +72,7 @@ const CreateServerModal = ({ nodeId, userId, open, onClose }: Props) => {
/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})/,
'Must Contain 8 Characters, One Uppercase, One Lowercase, One Number and One Special Case Character'
)
.matches(/^[A-z0-9!@£$%^&*()\'~*_+\-]+$/, 'Must not contain special characters from other languages')
.optional(),
shouldCreateServer: yup.boolean(),
templateUuid: yup.string().when('createServer', {
Expand Down Expand Up @@ -170,11 +171,7 @@ const CreateServerModal = ({ nodeId, userId, open, onClose }: Props) => {
placeholder={'Leave blank for no limit'}
/>
</div>
<TextInputFormik
name={'accountPassword'}
label={'Account Password'}
type={'password'}
/>
<TextInputFormik name={'accountPassword'} label={'Account Password'} type={'password'} />
<CheckboxFormik
name={'shouldCreateServer'}
label={'Create Server'}
Expand Down
6 changes: 3 additions & 3 deletions resources/scripts/components/dashboard/ServerCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ const ServerCard = ({ server }: Props) => {
return (
<Link
to={`/servers/${server.id}`}
className='bg-background p-6 shadow-light hover:shadow-lg border border-accent-200 sm:dark:hover:border-foreground dark:active:border-foreground dark:shadow-none dark:hover:shadow-none transition-shadow rounded-lg'
className='overflow-hidden bg-background p-6 shadow-light hover:shadow-lg border border-accent-200 sm:dark:hover:border-foreground dark:active:border-foreground dark:shadow-none dark:hover:shadow-none transition-shadow rounded-lg'
>
<div className='flex items-center space-x-3'>
<Avatar color='dark' size='md' radius='xl'>
{getInitials(server.name, ' ', 2)}
</Avatar>
<div>
<div className='overflow-hidden'>
<div className='flex items-center space-x-3'>
<p className='font-medium text-foreground text-ellipsis overflow-hidden whitespace-nowrap'>
<p className='font-medium text-foreground truncate'>
{server.name}
</p>{' '}
{server.status === 'suspended' && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const NavigationBar = () => {
<LoadingOverlay visible={isLoggingOut} zIndex={4000} />
<ContentContainer ref={topBar} className='pt-3 pb-1.5 relative'>
<div className='flex justify-between'>
<div className='flex space-x-5 items-center'>
<div className='flex shrink overflow-hidden space-x-5 items-center'>
<Link to={isAdminArea ? '/admin' : '/'} className='flex items-center space-x-3'>
<img src={Logo} className='w-7 h-7 dark:invert' alt='Convoy logo' />
<h1 className='font-semibold text-lg text-foreground'>Convoy</h1>
Expand All @@ -104,7 +104,7 @@ const NavigationBar = () => {
<div className='py-1.5 h-full'>
<div className='rotate-[25deg] w-[2px] h-full bg-[#eaeaea] dark:bg-[#333] rounded-full' />
</div>
<p className='font-medium text-sm text-foreground text-ellipsis overflow-hidden whitespace-nowrap'>
<p className='shrink font-medium text-sm text-foreground truncate text-ellipsis overflow-hidden whitespace-nowrap'>
{breadcrumb}
</p>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ const ServerAdminBlock = () => {
const serverId = ServerContext.useStoreState(state => state.server.data!.id)

return (
<Card className='flex flex-col col-span-10 md:col-span-5 relative'>
<h5 className='h5'>Configure This Server</h5>
<p className='description-small mt-1'>
You are an administrator! You can click below to visit this server's build configuration and swiftly
make edits.
</p>
<div className='flex mt-auto justify-end'>
<Card className='flex flex-col justify-between col-span-10 md:col-span-5 relative'>
<div>
<h5 className='h5'>Configure This Server</h5>
<p className='description-small mt-1'>
You are an administrator! You can click below to visit this server's build configuration and swiftly
make edits.
</p>
</div>
<div className='flex mt-6 justify-end'>
<Link to={`/admin/servers/${serverId}`}>
<Button className='inline-flex items-center' as={'span'}>
Configure Server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const ServerNetworkBlock = () => {
)

return (
<Card className='flex flex-col col-span-10 md:col-span-5 relative'>
<Card className='flex flex-col col-span-10 relative'>
<h5 className='h5'>Network</h5>
<div className='flex flex-col space-y-3 mt-3'>
<dl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const ServerOverviewContainer = () => {
<ServerPowerBlock />
<div className='grid grid-cols-10 gap-6'>
<ServerDetailsBlock />
<ServerTerminalBlock />
<ServerNetworkBlock />
<ServerTerminalBlock />
{rootAdmin && <ServerAdminBlock />}
</div>
</ServerContentBlock>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ const GeneralContainer = () => {
name: yup.string().required('A name is required').max(40),
hostname: yup
.string()
.required()
.max(191)
.matches(
/((https?):\/\/)?(www.)?[a-z0-9]+(\.[a-z]{2,}){1,3}(#?\/?[a-zA-Z0-9#]+)*\/?(\?[a-zA-Z0-9-_]+=[a-zA-Z0-9-%]+&?)?$/,
/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/,
'Enter a valid hostname'
),
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ const SecurityContainer = () => {
.matches(
/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})/,
'Must Contain 8 Characters, One Uppercase, One Lowercase, One Number and One Special Case Character'
),
sshKeys: yup.string(),
)
.matches(/^[A-z0-9!@£$%^&*()\'~*_+\-]+$/, 'Must not contain special characters from other languages'),
sshKeys: yup.string(),
}),
onSubmit: ({ password, sshKeys }, { setSubmitting }) => {
clearFlashes('server:settings:auth')
Expand Down
2 changes: 1 addition & 1 deletion routes/api-client.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
AuthenticateServerAccess::class,
],
], function () {
Route::get('/', [Client\Servers\ServerController::class, 'index'])->name('api:client:servers.show');
Route::get('/', [Client\Servers\ServerController::class, 'index'])->name('servers.show');
Route::get('/details', [Client\Servers\ServerController::class, 'details']);

Route::get('/status', [Client\Servers\ServerController::class, 'getStatus']);
Expand Down
131 changes: 0 additions & 131 deletions routes/client.php

This file was deleted.

0 comments on commit ae56916

Please sign in to comment.