Skip to content

Commit 517f467

Browse files
committed
refactor: remove unused environment variable retrieval and hardcode Supabase configuration
1 parent f527585 commit 517f467

File tree

5 files changed

+5
-61
lines changed

5 files changed

+5
-61
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ jobs:
5656
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
5757
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
5858
TAURI_UPDATER_SUFFIX: "-${{ matrix.arch }}"
59-
VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }}
60-
VITE_SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_ANON_KEY }}
6159
with:
6260
tagName: v__VERSION__ # the action automatically replaces __VERSION__ with the app version.
6361
releaseName: 'v__VERSION__'

.gitignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,4 @@ dist-ssr
2525

2626
.claude
2727

28-
.env
29-
.env.local
30-
.env.development.local
31-
.env.test.local
32-
.env.production.local
33-
3428
claude.md

src-tauri/src/lib.rs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,6 @@ pub fn run() {
928928
load_session_tags,
929929
save_session_tags,
930930
add_session_tag,
931-
get_env_var,
932931
write_excel_file,
933932
start_oauth_server
934933
])
@@ -1191,41 +1190,6 @@ async fn add_session_tag(session_tag: SessionTag, app: AppHandle) -> Result<(),
11911190
save_session_tags(session_tags, app).await
11921191
}
11931192

1194-
#[tauri::command]
1195-
async fn get_env_var(key: String) -> Result<String, String> {
1196-
// First try to get from environment variables
1197-
if let Ok(value) = std::env::var(&key) {
1198-
return Ok(value);
1199-
}
1200-
1201-
// Try multiple possible locations for .env file
1202-
let possible_paths = vec![
1203-
std::env::current_dir().ok().map(|p| p.join(".env")),
1204-
std::env::current_dir().ok().and_then(|p| p.parent().map(|parent| parent.join(".env"))),
1205-
Some(std::path::PathBuf::from("/Users/stefanonovelli/Sites/Personal/presto/.env")),
1206-
];
1207-
1208-
for path_opt in possible_paths {
1209-
if let Some(env_path) = path_opt {
1210-
println!("Checking .env path: {:?}", env_path);
1211-
if env_path.exists() {
1212-
println!("Found .env file at: {:?}", env_path);
1213-
if let Ok(content) = std::fs::read_to_string(&env_path) {
1214-
for line in content.lines() {
1215-
let line = line.trim();
1216-
if line.starts_with(&format!("{}=", key)) {
1217-
if let Some(value) = line.split('=').nth(1) {
1218-
return Ok(value.to_string());
1219-
}
1220-
}
1221-
}
1222-
}
1223-
}
1224-
}
1225-
}
1226-
1227-
Err(format!("Environment variable '{}' not found in any location", key))
1228-
}
12291193

12301194
#[tauri::command]
12311195
async fn update_tray_menu(

src/utils/supabase.js

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,10 @@ async function initSupabase() {
2121
await waitForSupabase();
2222

2323
const { createClient } = window.supabase;
24-
const { invoke } = window.__TAURI__.core;
2524

26-
// Get environment variables from Tauri backend
27-
let supabaseUrl, supabaseAnonKey;
28-
29-
try {
30-
supabaseUrl = await invoke('get_env_var', { key: 'SUPABASE_URL' });
31-
supabaseAnonKey = await invoke('get_env_var', { key: 'SUPABASE_ANON_KEY' });
32-
} catch (error) {
33-
console.error('Failed to load environment variables:', error);
34-
throw new Error('Failed to load Supabase configuration from environment');
35-
}
36-
37-
if (!supabaseUrl || !supabaseAnonKey) {
38-
throw new Error('Missing Supabase environment variables');
39-
}
25+
// Hardcoded Supabase configuration
26+
const supabaseUrl = 'https://lopgwwppinkqvttozqfx.supabase.co';
27+
const supabaseAnonKey = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImxvcGd3d3BwaW5rcXZ0dG96cWZ4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTA2NzgxMDIsImV4cCI6MjA2NjI1NDEwMn0.DqPcwsBJdPeV5iWsMkZLMn6-xZ_A9l-Xh7R-wi7kc2k';
4028

4129
// Create Supabase client
4230
supabase = createClient(supabaseUrl, supabaseAnonKey, {
@@ -90,7 +78,7 @@ async function initSupabase() {
9078
console.log(`Starting Tauri OAuth flow for ${provider}...`);
9179

9280
// Get Supabase configuration
93-
const supabaseUrl = await invoke('get_env_var', { key: 'SUPABASE_URL' });
81+
const supabaseUrl = 'https://lopgwwppinkqvttozqfx.supabase.co';
9482

9583
// Start OAuth flow using tauri-plugin-oauth
9684
console.log('Invoking OAuth start...');

src/utils/theme-loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ThemeLoader {
3939
// that gets updated by the build process or manually maintained
4040

4141
// This could be enhanced to use a build-time script that generates this list
42-
const knownThemes = [
42+
const knownThemes = [
4343
'espresso.css',
4444
'pipboy.css',
4545
'pommodore64.css'

0 commit comments

Comments
 (0)