mirror of
https://github.com/snltty/linker.git
synced 2025-10-07 01:52:51 +08:00
184
This commit is contained in:
10
.github/workflows/dotnet.yml
vendored
10
.github/workflows/dotnet.yml
vendored
@@ -220,6 +220,16 @@ jobs:
|
|||||||
asset_path: ./public/publish-zip/linker-linux-musl-arm64.zip
|
asset_path: ./public/publish-zip/linker-linux-musl-arm64.zip
|
||||||
asset_name: linker-linux-musl-arm64.zip
|
asset_name: linker-linux-musl-arm64.zip
|
||||||
asset_content_type: application/zip
|
asset_content_type: application/zip
|
||||||
|
- name: upload-version-oss
|
||||||
|
id: upload-version-oss
|
||||||
|
uses: tvrcgo/oss-action@v0.1.1
|
||||||
|
with:
|
||||||
|
region: oss-cn-shenzhen
|
||||||
|
key-id: ${{ secrets.ALIYUN_OSS_ID }}
|
||||||
|
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
|
||||||
|
bucket: ide-qbcode
|
||||||
|
asset-path: ./public/version.txt
|
||||||
|
target-path: /downloads/linker/version.txt
|
||||||
- name: upload-install-service-oss
|
- name: upload-install-service-oss
|
||||||
id: upload-install-service-oss
|
id: upload-install-service-oss
|
||||||
uses: tvrcgo/oss-action@v0.1.1
|
uses: tvrcgo/oss-action@v0.1.1
|
||||||
|
@@ -86,7 +86,7 @@ function writeUpload(data, tagName) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
data.jobs.build.steps.push({
|
data.jobs.build.steps.push({
|
||||||
name: `upload-version-oss`,
|
name: `upload-version-oss`,
|
||||||
id: `upload-version-oss`,
|
id: `upload-version-oss`,
|
||||||
@@ -100,7 +100,7 @@ function writeUpload(data, tagName) {
|
|||||||
'target-path': `/downloads/linker/version.txt`
|
'target-path': `/downloads/linker/version.txt`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
*/
|
|
||||||
data.jobs.build.steps.push({
|
data.jobs.build.steps.push({
|
||||||
name: `upload-install-service-oss`,
|
name: `upload-install-service-oss`,
|
||||||
id: `upload-install-service-oss`,
|
id: `upload-install-service-oss`,
|
||||||
|
@@ -52,12 +52,10 @@ namespace linker.messenger.serializer.memorypack
|
|||||||
MemoryPackFormatterProvider.Register(new UpdaterConfirmServerInfoFormatter());
|
MemoryPackFormatterProvider.Register(new UpdaterConfirmServerInfoFormatter());
|
||||||
MemoryPackFormatterProvider.Register(new UpdaterClientInfoFormatter());
|
MemoryPackFormatterProvider.Register(new UpdaterClientInfoFormatter());
|
||||||
MemoryPackFormatterProvider.Register(new UpdaterClientInfo170Formatter());
|
MemoryPackFormatterProvider.Register(new UpdaterClientInfo170Formatter());
|
||||||
|
|
||||||
MemoryPackFormatterProvider.Register(new UpdaterInfoFormatter());
|
MemoryPackFormatterProvider.Register(new UpdaterInfoFormatter());
|
||||||
MemoryPackFormatterProvider.Register(new UpdaterInfo170Formatter());
|
MemoryPackFormatterProvider.Register(new UpdaterInfo170Formatter());
|
||||||
MemoryPackFormatterProvider.Register(new Updater184InfoFormatter());
|
MemoryPackFormatterProvider.Register(new Updater184InfoFormatter());
|
||||||
|
MemoryPackFormatterProvider.Register(new UpdaterSyncInfoFormatter());
|
||||||
|
|
||||||
|
|
||||||
MemoryPackFormatterProvider.Register(new RelayTestInfoFormatter());
|
MemoryPackFormatterProvider.Register(new RelayTestInfoFormatter());
|
||||||
MemoryPackFormatterProvider.Register(new RelayTestInfo170Formatter());
|
MemoryPackFormatterProvider.Register(new RelayTestInfo170Formatter());
|
||||||
|
@@ -401,6 +401,59 @@ namespace linker.messenger.serializer.memorypack
|
|||||||
value = wrapped.info;
|
value = wrapped.info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[MemoryPackable]
|
||||||
|
public readonly partial struct SerializableUpdaterSyncInfo
|
||||||
|
{
|
||||||
|
[MemoryPackIgnore]
|
||||||
|
public readonly UpdaterSyncInfo info;
|
||||||
|
|
||||||
|
[MemoryPackInclude]
|
||||||
|
string SecretKey => info.SecretKey;
|
||||||
|
|
||||||
|
[MemoryPackInclude]
|
||||||
|
bool Sync2Server => info.Sync2Server;
|
||||||
|
|
||||||
|
[MemoryPackConstructor]
|
||||||
|
SerializableUpdaterSyncInfo(string secretKey, bool sync2Server)
|
||||||
|
{
|
||||||
|
var info = new UpdaterSyncInfo { SecretKey = secretKey, Sync2Server = sync2Server };
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SerializableUpdaterSyncInfo(UpdaterSyncInfo info)
|
||||||
|
{
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public class UpdaterSyncInfoFormatter : MemoryPackFormatter<UpdaterSyncInfo>
|
||||||
|
{
|
||||||
|
public override void Serialize<TBufferWriter>(ref MemoryPackWriter<TBufferWriter> writer, scoped ref UpdaterSyncInfo value)
|
||||||
|
{
|
||||||
|
if (value == null)
|
||||||
|
{
|
||||||
|
writer.WriteNullObjectHeader();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
writer.WritePackable(new SerializableUpdaterSyncInfo(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Deserialize(ref MemoryPackReader reader, scoped ref UpdaterSyncInfo value)
|
||||||
|
{
|
||||||
|
if (reader.PeekIsNull())
|
||||||
|
{
|
||||||
|
reader.Advance(1); // skip null block
|
||||||
|
value = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var wrapped = reader.ReadPackable<SerializableUpdaterSyncInfo>();
|
||||||
|
value = wrapped.info;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -273,7 +273,7 @@ namespace linker.messenger.store.file
|
|||||||
if (configExportInfo.Group) client.Groups = new SignInClientGroupInfo[] { client.Groups[0] };
|
if (configExportInfo.Group) client.Groups = new SignInClientGroupInfo[] { client.Groups[0] };
|
||||||
else client.Groups = new SignInClientGroupInfo[] { };
|
else client.Groups = new SignInClientGroupInfo[] { };
|
||||||
|
|
||||||
if (configExportInfo.Updater) client.Updater = new linker.messenger.updater.UpdaterConfigClientInfo { SecretKey = client.Updater.SecretKey };
|
if (configExportInfo.Updater) client.Updater = new linker.messenger.updater.UpdaterConfigClientInfo { SecretKey = client.Updater.SecretKey, Sync2Server = client.Updater.Sync2Server };
|
||||||
else client.Updater = new linker.messenger.updater.UpdaterConfigClientInfo { };
|
else client.Updater = new linker.messenger.updater.UpdaterConfigClientInfo { };
|
||||||
|
|
||||||
|
|
||||||
|
@@ -10,16 +10,10 @@ namespace linker.messenger.store.file
|
|||||||
}
|
}
|
||||||
public partial class ConfigClientInfo
|
public partial class ConfigClientInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 服务器穿透配置
|
|
||||||
/// </summary>
|
|
||||||
public UpdaterConfigClientInfo Updater { get; set; } = new UpdaterConfigClientInfo();
|
public UpdaterConfigClientInfo Updater { get; set; } = new UpdaterConfigClientInfo();
|
||||||
}
|
}
|
||||||
public partial class ConfigServerInfo
|
public partial class ConfigServerInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 服务器穿透配置
|
|
||||||
/// </summary>
|
|
||||||
public UpdaterConfigServerInfo Updater { get; set; } = new UpdaterConfigServerInfo();
|
public UpdaterConfigServerInfo Updater { get; set; } = new UpdaterConfigServerInfo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -18,14 +18,30 @@ namespace linker.messenger.updater
|
|||||||
}
|
}
|
||||||
public Memory<byte> GetData()
|
public Memory<byte> GetData()
|
||||||
{
|
{
|
||||||
return serializer.Serialize(updaterClientStore.Info);
|
return serializer.Serialize(new UpdaterSyncInfo
|
||||||
|
{
|
||||||
|
SecretKey = updaterClientStore.Info.SecretKey,
|
||||||
|
Sync2Server = updaterClientStore.Info.Sync2Server
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetData(Memory<byte> data)
|
public void SetData(Memory<byte> data)
|
||||||
{
|
{
|
||||||
UpdaterConfigClientInfo info = serializer.Deserialize<UpdaterConfigClientInfo>(data.Span);
|
UpdaterSyncInfo info = serializer.Deserialize<UpdaterSyncInfo>(data.Span);
|
||||||
updaterClientStore.SetSecretKey(info.SecretKey);
|
updaterClientStore.SetSecretKey(info.SecretKey);
|
||||||
updaterClientStore.SetSync2Server(info.Sync2Server);
|
updaterClientStore.SetSync2Server(info.Sync2Server);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public sealed partial class UpdaterSyncInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 密钥
|
||||||
|
/// </summary>
|
||||||
|
public string SecretKey { get; set; } = Helper.GlobalString;
|
||||||
|
/// <summary>
|
||||||
|
/// 与服务器同步
|
||||||
|
/// </summary>
|
||||||
|
public bool Sync2Server { get; set; } = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
v1.8.4
|
v1.8.4
|
||||||
2025-06-18 16:23:22
|
2025-06-18 17:05:57
|
||||||
1. 一些累计更新
|
1. 一些累计更新
|
||||||
2. 优化数据同步,可选择同步到指定客户端
|
2. 优化数据同步,可选择同步到指定客户端
|
||||||
3. 增加选项,客户端自动更新到服务器版本
|
3. 增加选项,客户端自动更新到服务器版本
|
Reference in New Issue
Block a user