From 43506e19f17fbf3d946e49ec48b99e3ae374ca9e Mon Sep 17 00:00:00 2001 From: lollipopkit Date: Sat, 14 Oct 2023 19:13:45 +0800 Subject: [PATCH] new: `linux` build --- .gitignore | 6 +++- README.md | 23 +++++++++----- README_zh.md | 25 ++++++++++----- ios/Runner.xcodeproj/project.pbxproj | 36 +++++++++++----------- lib/data/res/build_data.dart | 6 ++-- make.dart | 46 ++++++++++++++++++++++++++-- 6 files changed, 102 insertions(+), 40 deletions(-) diff --git a/.gitignore b/.gitignore index 301bb599..c0ac473d 100644 --- a/.gitignore +++ b/.gitignore @@ -51,4 +51,8 @@ test.dart # Keep generated l10n files /.dart_tool/* -!/.dart_tool/flutter_gen \ No newline at end of file +!/.dart_tool/flutter_gen + +# Linux release +ServerBox.AppDir +ServerBox-x86_64.AppImage diff --git a/README.md b/README.md index 4fbabf69..a38f6a60 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ English | [简体中文](README_zh.md) +

@@ -6,18 +7,26 @@ English | [简体中文](README_zh.md)

- - - - - -

-

Due to Chinese government policy and the BEIAN issue. ServerBox is now free. Please download it from other regions.

+ +

+ Download: + iOS + / + Android + / + macOS + / + Linux + / + Windows (In progress) +

+ +

Due to Chinese government policy and the BEIAN issue. iOS app is now free. Please download it from other regions of AppStore.

A Flutter project which provide charts to display Linux server status and tools to manage server. diff --git a/README_zh.md b/README_zh.md index 5cfad872..531a6f2a 100644 --- a/README_zh.md +++ b/README_zh.md @@ -1,4 +1,5 @@ 简体中文 | [English](README.md) +

@@ -6,23 +7,31 @@

- - - - - -

-

由于中国政策原因,且无法完成备案。现已转为免费,请移步其他区下载。

+ +

+ 下载: + iOS + / + Android + / + macOS + / + Linux + / + Windows (暂未发布) +

+ +

由于中国政策原因,且无法完成备案。iOS 端现已转为免费,请移步 AppStore 其他区下载。

使用 Flutter 开发的 Linux 服务器工具箱,提供服务器状态图表和管理工具。
-特别感谢 dartssh2 & xterm.dart. +特别感谢 dartssh2 & xterm.dart

diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 0a6fa9f6..c46585c2 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -586,7 +586,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 589; + CURRENT_PROJECT_VERSION = 590; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -596,7 +596,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.589; + MARKETING_VERSION = 1.0.590; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -720,7 +720,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 589; + CURRENT_PROJECT_VERSION = 590; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -730,7 +730,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.589; + MARKETING_VERSION = 1.0.590; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -748,7 +748,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 589; + CURRENT_PROJECT_VERSION = 590; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -758,7 +758,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.589; + MARKETING_VERSION = 1.0.590; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -779,7 +779,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 589; + CURRENT_PROJECT_VERSION = 590; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -792,7 +792,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.589; + MARKETING_VERSION = 1.0.590; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; @@ -818,7 +818,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 589; + CURRENT_PROJECT_VERSION = 590; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -831,7 +831,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.589; + MARKETING_VERSION = 1.0.590; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -854,7 +854,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 589; + CURRENT_PROJECT_VERSION = 590; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -867,7 +867,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.589; + MARKETING_VERSION = 1.0.590; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -890,7 +890,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 589; + CURRENT_PROJECT_VERSION = 590; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -902,7 +902,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.589; + MARKETING_VERSION = 1.0.590; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; @@ -931,7 +931,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 589; + CURRENT_PROJECT_VERSION = 590; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -943,7 +943,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.589; + MARKETING_VERSION = 1.0.590; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; PRODUCT_NAME = ServerBox; @@ -969,7 +969,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 589; + CURRENT_PROJECT_VERSION = 590; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -981,7 +981,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.589; + MARKETING_VERSION = 1.0.590; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; PRODUCT_NAME = ServerBox; diff --git a/lib/data/res/build_data.dart b/lib/data/res/build_data.dart index 7f9339e2..5c54c96e 100644 --- a/lib/data/res/build_data.dart +++ b/lib/data/res/build_data.dart @@ -2,9 +2,9 @@ class BuildData { static const String name = "ServerBox"; - static const int build = 589; + static const int build = 590; static const String engine = "3.13.6"; - static const String buildAt = "2023-10-14 12:09:35"; - static const int modifications = 6; + static const String buildAt = "2023-10-14 13:29:43"; + static const int modifications = 1; static const int script = 21; } diff --git a/make.dart b/make.dart index fd1a511c..b43755c5 100755 --- a/make.dart +++ b/make.dart @@ -155,7 +155,47 @@ Future flutterBuildAndroid() async { Future flutterBuildLinux() async { await flutterBuild('linux'); + // mkdir ServerBox.AppDir + await Process.run('mkdir', ['ServerBox.AppDir']); + // cp -r build/linux/x64/release/bundle/* ServerBox.AppDir + await Process.run('cp', [ + '-r', + './build/linux/x64/release/bundle/*', + 'ServerBox.AppDir', + ]); + // cp -r assets/app_icon.png ServerBox.AppDir + await Process.run('cp', [ + '-r', + './assets/app_icon.png', + 'ServerBox.AppDir', + ]); + // Create AppRun + const appRun = ''' +#!/bin/sh +cd "\$(dirname "\$0")" +exec ./ServerBox +'''; + await File('ServerBox.AppDir/AppRun').writeAsString(appRun); + // chmod +x AppRun + await Process.run('chmod', ['+x', 'ServerBox.AppDir/AppRun']); + // Create .desktop + const desktop = ''' +[Desktop Entry] +Name=ServerBox +Exec=ServerBox +Icon=app_icon +Type=Application +Categories=Network; +'''; + await File('ServerBox.AppDir/ServerBox.desktop').writeAsString(desktop); + // Run appimagetool + await Process.run('appimagetool', ['ServerBox.AppDir']); + await scpLinux2CDN(); + + // Clean build files + await Process.run('rm', ['-r', 'ServerBox.AppDir']); + await Process.run('rm', ['ServerBox-x86_64.AppImage']); } Future flutterBuildWin() async { @@ -181,8 +221,8 @@ Future scpLinux2CDN() async { final result = await Process.run( 'scp', [ - './build/linux/x64/release/bundle/server_box.tar.gz', - 'hk:/var/www/res/serverbox/$build.tar.gz', + 'ServerBox-x86_64.AppImage', + 'hk:/var/www/res/serverbox/$build.AppImage', ], runInShell: true, ); @@ -190,7 +230,7 @@ Future scpLinux2CDN() async { print(result.stderr); exit(1); } - print('Upload Linux $build.tar.gz finished.'); + print('Upload $build.AppImage finished.'); } Future scpWindows2CDN() async {