mirror of
https://github.com/proxysu/ProxySU.git
synced 2025-02-16 22:53:13 +03:00
fix acme.sh update cert issue
This commit is contained in:
parent
97ae49c60c
commit
b20be2ac75
@ -1,8 +1,12 @@
|
|||||||
using System;
|
using Microsoft.Win32;
|
||||||
|
using MvvmCross.Commands;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
namespace ProxySuper.Core.Models.Hosts
|
namespace ProxySuper.Core.Models.Hosts
|
||||||
{
|
{
|
||||||
@ -30,5 +34,25 @@ namespace ProxySuper.Core.Models.Hosts
|
|||||||
public LocalProxy Proxy { get; set; }
|
public LocalProxy Proxy { get; set; }
|
||||||
|
|
||||||
public LoginSecretType SecretType { get; set; }
|
public LoginSecretType SecretType { get; set; }
|
||||||
|
|
||||||
|
public IMvxCommand UploadPrivateKeyCommand => new MvxCommand(UploadPrivateKey);
|
||||||
|
|
||||||
|
private void UploadPrivateKey()
|
||||||
|
{
|
||||||
|
var fileDialog = new OpenFileDialog();
|
||||||
|
fileDialog.FileOk += OnFileOk;
|
||||||
|
fileDialog.ShowDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnFileOk(object sender, CancelEventArgs e)
|
||||||
|
{
|
||||||
|
var file = sender as OpenFileDialog;
|
||||||
|
PrivateKeyPath = file.FileName;
|
||||||
|
|
||||||
|
Task.Delay(300).ContinueWith((t) =>
|
||||||
|
{
|
||||||
|
MessageBox.Show("上传成功", "提示");
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using MvvmCross;
|
using Microsoft.Win32;
|
||||||
|
using MvvmCross;
|
||||||
using MvvmCross.Commands;
|
using MvvmCross.Commands;
|
||||||
using MvvmCross.Navigation;
|
using MvvmCross.Navigation;
|
||||||
using MvvmCross.ViewModels;
|
using MvvmCross.ViewModels;
|
||||||
@ -10,6 +11,7 @@ using ProxySuper.Core.Services;
|
|||||||
using ProxySuper.Core.ViewModels;
|
using ProxySuper.Core.ViewModels;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@ -79,7 +81,6 @@ namespace ProxySuper.Core.Models
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public string GetShareLink()
|
public string GetShareLink()
|
||||||
{
|
{
|
||||||
if (Type == ProjectType.Xray)
|
if (Type == ProjectType.Xray)
|
||||||
@ -105,5 +106,6 @@ namespace ProxySuper.Core.Models
|
|||||||
|
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -646,12 +646,12 @@ namespace ProxySuper.Core.Services
|
|||||||
// 申请证书
|
// 申请证书
|
||||||
if (OnlyIpv6)
|
if (OnlyIpv6)
|
||||||
{
|
{
|
||||||
var cmd = $"/root/.acme.sh/acme.sh --force --debug --issue --standalone -d {Parameters.Domain} --listen-v6";
|
var cmd = $"/root/.acme.sh/acme.sh --force --debug --issue --standalone -d {Parameters.Domain} --listen-v6 --pre-hook \"service caddy stop\" --post-hook \"service caddy start\"";
|
||||||
result = RunCmd(cmd);
|
result = RunCmd(cmd);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var cmd = $"/root/.acme.sh/acme.sh --force --debug --issue --standalone -d {Parameters.Domain}";
|
var cmd = $"/root/.acme.sh/acme.sh --force --debug --issue --standalone -d {Parameters.Domain} --pre-hook \"service caddy stop\" --post-hook \"service caddy start\"";
|
||||||
result = RunCmd(cmd);
|
result = RunCmd(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using MvvmCross.Commands;
|
using Microsoft.Win32;
|
||||||
|
using MvvmCross.Commands;
|
||||||
using MvvmCross.Navigation;
|
using MvvmCross.Navigation;
|
||||||
using MvvmCross.ViewModels;
|
using MvvmCross.ViewModels;
|
||||||
using ProxySuper.Core.Models;
|
using ProxySuper.Core.Models;
|
||||||
@ -7,6 +8,7 @@ using ProxySuper.Core.Models.Projects;
|
|||||||
using ProxySuper.Core.Services;
|
using ProxySuper.Core.Services;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
<RowDefinition Height="36" />
|
<RowDefinition Height="36" />
|
||||||
<RowDefinition Height="36" />
|
<RowDefinition Height="36" />
|
||||||
<RowDefinition Height="36" />
|
<RowDefinition Height="36" />
|
||||||
|
<RowDefinition Height="36" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
@ -55,20 +56,26 @@
|
|||||||
Text="{Binding Host.Address}"
|
Text="{Binding Host.Address}"
|
||||||
VerticalContentAlignment="Center" />
|
VerticalContentAlignment="Center" />
|
||||||
|
|
||||||
<Label Content="{DynamicResource HostUserName}" Grid.Row="2" Grid.Column="0" />
|
<Label Content="{DynamicResource HostPort}" Grid.Row="2" Grid.Column="0" />
|
||||||
<TextBox Grid.Row="2" Grid.Column="1"
|
<TextBox Grid.Row="2" Grid.Column="1"
|
||||||
|
Width="170"
|
||||||
|
Text="{Binding Host.Port}"
|
||||||
|
VerticalContentAlignment="Center" />
|
||||||
|
|
||||||
|
<Label Content="{DynamicResource HostUserName}" Grid.Row="3" Grid.Column="0" />
|
||||||
|
<TextBox Grid.Row="3" Grid.Column="1"
|
||||||
Width="170"
|
Width="170"
|
||||||
Text="{Binding Host.UserName}"
|
Text="{Binding Host.UserName}"
|
||||||
VerticalContentAlignment="Center" />
|
VerticalContentAlignment="Center" />
|
||||||
|
|
||||||
<Label Content="{DynamicResource HostPassword}" Grid.Row="3" Grid.Column="0" />
|
<Label Content="{DynamicResource HostPassword}" Grid.Row="4" Grid.Column="0" />
|
||||||
<TextBox Grid.Row="3" Grid.Column="1"
|
<TextBox Grid.Row="4" Grid.Column="1"
|
||||||
Width="170"
|
Width="170"
|
||||||
Text="{Binding Host.Password}"
|
Text="{Binding Host.Password}"
|
||||||
VerticalContentAlignment="Center" />
|
VerticalContentAlignment="Center" />
|
||||||
|
|
||||||
<Label Content="{DynamicResource HostSecretType}" Grid.Row="4" Grid.Column="0" />
|
<Label Content="{DynamicResource HostSecretType}" Grid.Row="5" Grid.Column="0" />
|
||||||
<StackPanel Orientation="Horizontal" Grid.Row="4" Grid.Column="1" VerticalAlignment="Center">
|
<StackPanel Orientation="Horizontal" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center">
|
||||||
<RadioButton GroupName="LoginSecretType"
|
<RadioButton GroupName="LoginSecretType"
|
||||||
Content="{DynamicResource HostSertTypePassword}"
|
Content="{DynamicResource HostSertTypePassword}"
|
||||||
IsChecked="{
|
IsChecked="{
|
||||||
@ -86,11 +93,12 @@
|
|||||||
}" />
|
}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<Label Content="{DynamicResource HostUploadSecretKey}" Grid.Row="5" Grid.Column="0" />
|
<Label Content="{DynamicResource HostUploadSecretKey}" Grid.Row="6" Grid.Column="0" />
|
||||||
<Button Height="24"
|
<Button Height="24"
|
||||||
Width="100"
|
Width="100"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Grid.Row="5" Grid.Column="1"
|
Grid.Row="6" Grid.Column="1"
|
||||||
|
Command="{Binding Host.UploadPrivateKeyCommand}"
|
||||||
IsEnabled="{
|
IsEnabled="{
|
||||||
Binding Host.SecretType,
|
Binding Host.SecretType,
|
||||||
Converter={StaticResource SecretTypeConverter},
|
Converter={StaticResource SecretTypeConverter},
|
||||||
|
@ -40,6 +40,8 @@
|
|||||||
Name="DataGrid"
|
Name="DataGrid"
|
||||||
ItemsSource="{Binding Records}"
|
ItemsSource="{Binding Records}"
|
||||||
VerticalContentAlignment="Bottom"
|
VerticalContentAlignment="Bottom"
|
||||||
|
VerticalScrollBarVisibility="Auto"
|
||||||
|
MaxHeight="450"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
SelectionUnit="Cell"
|
SelectionUnit="Cell"
|
||||||
BorderBrush="#eee"
|
BorderBrush="#eee"
|
||||||
@ -70,7 +72,7 @@
|
|||||||
</DataGridTextColumn>
|
</DataGridTextColumn>
|
||||||
|
|
||||||
<DataGridTextColumn Binding="{Binding Type}"
|
<DataGridTextColumn Binding="{Binding Type}"
|
||||||
Width="200">
|
Width="120">
|
||||||
<DataGridTextColumn.Header>
|
<DataGridTextColumn.Header>
|
||||||
<TextBlock Text="{DynamicResource MainDataGridColumnType}" />
|
<TextBlock Text="{DynamicResource MainDataGridColumnType}" />
|
||||||
</DataGridTextColumn.Header>
|
</DataGridTextColumn.Header>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user