Исправление ошибки компиляции

This commit is contained in:
2024-06-23 20:24:15 +07:00
parent 13a1252266
commit 9cf7b1b0f2
6 changed files with 16 additions and 27 deletions
+6 -5
View File
@@ -36,18 +36,19 @@ jobs:
with:
lfs: true
token: ${{secrets.RELEASE_TOKEN}}
- name: Check repository
run: |
touch src-tauri/.env
echo 'ENC_KEY=${{secrets.HASH_KEY}}' > src-tauri/.env
touch src-tauri/src/config.rs
echo 'pub(crate) static ENC_KEY: &str = "${{secrets.HASH_KEY}}";' > src-tauri/src/config.rs
- name: Get files (Linux)
if: matrix.platform == 'ubuntu-latest'
run: |
ls -l src-tauri
cat src-tauri/.env
ls -l src-tauri/src
- name: Get files (Windows)
if: matrix.platform == 'windows-latest'
run: dir src-tauri
run: dir src-tauri/src
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
-7
View File
@@ -681,12 +681,6 @@ dependencies = [
"syn 2.0.66",
]
[[package]]
name = "dotenv"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
[[package]]
name = "dtoa"
version = "1.0.9"
@@ -3206,7 +3200,6 @@ dependencies = [
name = "to-do-app"
version = "0.0.0"
dependencies = [
"dotenv",
"magic-crypt",
"rust-fuzzy-search",
"serde",
+2 -2
View File
@@ -16,7 +16,6 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1"
magic-crypt = "3.1.13"
rust-fuzzy-search = "0.1.1"
dotenv = "0.15.0"
[features]
# This feature is used for production builds or when a dev server is not specified, DO NOT REMOVE!!
@@ -24,5 +23,6 @@ custom-protocol = ["tauri/custom-protocol"]
[profile.release]
lto = true # Enables link to optimizations
opt-level = "s" # Optimize for binary size
opt-level = "z" # Optimize for binary size
strip = true # Remove debug symbols
+1 -2
View File
@@ -1,11 +1,10 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use dotenv::dotenv;
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
#[path="tasks_functions.rs"] mod tasks;
mod config;
fn main() {
dotenv().ok();
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![
tasks::check_or_create_tasks_file,
+6 -4
View File
@@ -6,9 +6,11 @@ use std::fs::File;
use serde_json::{Value, json};
use rust_fuzzy_search::fuzzy_search_best_n;
pub fn encrypt_n_save_file(path: PathBuf, content: String){
let mc = new_magic_crypt!(std::env::var("ENC_KEY").unwrap(), 256);
use crate::config;
pub fn encrypt_n_save_file(path: PathBuf, content: String){
let key = config::ENC_KEY;
let mc = new_magic_crypt!(key, 256);
let mut encrypted: String = String::new();
for line in content.lines() {
@@ -22,8 +24,8 @@ pub fn encrypt_n_save_file(path: PathBuf, content: String){
}
pub fn decrypt_file(path: PathBuf) -> String {
let mc = new_magic_crypt!(std::env::var("ENC_KEY").unwrap(), 256);
let key = config::ENC_KEY;
let mc = new_magic_crypt!(key, 256);
let mut decrypted: String = String::new();
let lines = read_to_string(path);
+1 -7
View File
@@ -7,7 +7,7 @@
},
"package": {
"productName": "to-do-app",
"version": "1.0.0"
"version": "1.5.0"
},
"tauri": {
"allowlist": {
@@ -26,9 +26,6 @@
"unmaximize": true,
"unminimize": true,
"startDragging": true
},
"fs": {
"scope": ["$RESOURCE/*"]
}
},
"windows": [
@@ -52,9 +49,6 @@
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
],
"resources": [
".env"
]
}
}