1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2024-11-22 05:06:08 +03:00

fix acme.sh update cert issue

This commit is contained in:
next-autumn 2021-05-26 16:22:18 +08:00
parent 97ae49c60c
commit b20be2ac75
6 changed files with 52 additions and 14 deletions

View File

@ -1,8 +1,12 @@
using System;
using Microsoft.Win32;
using MvvmCross.Commands;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace ProxySuper.Core.Models.Hosts
{
@ -30,5 +34,25 @@ namespace ProxySuper.Core.Models.Hosts
public LocalProxy Proxy { 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("上传成功", "提示");
});
}
}
}

View File

@ -1,4 +1,5 @@
using MvvmCross;
using Microsoft.Win32;
using MvvmCross;
using MvvmCross.Commands;
using MvvmCross.Navigation;
using MvvmCross.ViewModels;
@ -10,6 +11,7 @@ using ProxySuper.Core.Services;
using ProxySuper.Core.ViewModels;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
@ -79,7 +81,6 @@ namespace ProxySuper.Core.Models
}
}
public string GetShareLink()
{
if (Type == ProjectType.Xray)
@ -105,5 +106,6 @@ namespace ProxySuper.Core.Models
return string.Empty;
}
}
}

View File

@ -646,12 +646,12 @@ namespace ProxySuper.Core.Services
// 申请证书
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);
}
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);
}

View File

@ -1,4 +1,5 @@
using MvvmCross.Commands;
using Microsoft.Win32;
using MvvmCross.Commands;
using MvvmCross.Navigation;
using MvvmCross.ViewModels;
using ProxySuper.Core.Models;
@ -7,6 +8,7 @@ using ProxySuper.Core.Models.Projects;
using ProxySuper.Core.Services;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

View File

@ -34,6 +34,7 @@
<RowDefinition Height="36" />
<RowDefinition Height="36" />
<RowDefinition Height="36" />
<RowDefinition Height="36" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
@ -55,20 +56,26 @@
Text="{Binding Host.Address}"
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"
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"
Text="{Binding Host.UserName}"
VerticalContentAlignment="Center" />
<Label Content="{DynamicResource HostPassword}" Grid.Row="3" Grid.Column="0" />
<TextBox Grid.Row="3" Grid.Column="1"
<Label Content="{DynamicResource HostPassword}" Grid.Row="4" Grid.Column="0" />
<TextBox Grid.Row="4" Grid.Column="1"
Width="170"
Text="{Binding Host.Password}"
VerticalContentAlignment="Center" />
<Label Content="{DynamicResource HostSecretType}" Grid.Row="4" Grid.Column="0" />
<StackPanel Orientation="Horizontal" Grid.Row="4" Grid.Column="1" VerticalAlignment="Center">
<Label Content="{DynamicResource HostSecretType}" Grid.Row="5" Grid.Column="0" />
<StackPanel Orientation="Horizontal" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center">
<RadioButton GroupName="LoginSecretType"
Content="{DynamicResource HostSertTypePassword}"
IsChecked="{
@ -86,11 +93,12 @@
}" />
</StackPanel>
<Label Content="{DynamicResource HostUploadSecretKey}" Grid.Row="5" Grid.Column="0" />
<Label Content="{DynamicResource HostUploadSecretKey}" Grid.Row="6" Grid.Column="0" />
<Button Height="24"
Width="100"
HorizontalAlignment="Left"
Grid.Row="5" Grid.Column="1"
Grid.Row="6" Grid.Column="1"
Command="{Binding Host.UploadPrivateKeyCommand}"
IsEnabled="{
Binding Host.SecretType,
Converter={StaticResource SecretTypeConverter},

View File

@ -40,6 +40,8 @@
Name="DataGrid"
ItemsSource="{Binding Records}"
VerticalContentAlignment="Bottom"
VerticalScrollBarVisibility="Auto"
MaxHeight="450"
IsReadOnly="True"
SelectionUnit="Cell"
BorderBrush="#eee"
@ -70,7 +72,7 @@
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding Type}"
Width="200">
Width="120">
<DataGridTextColumn.Header>
<TextBlock Text="{DynamicResource MainDataGridColumnType}" />
</DataGridTextColumn.Header>