docs: implement Antigravity global rules
This commit is contained in:
22
.agent/rules/GEMINI.md
Normal file
22
.agent/rules/GEMINI.md
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
trigger: always_on
|
||||
---
|
||||
|
||||
# GEMINI.md - Antigravity Kit (Auto-Generated)
|
||||
|
||||
|
||||
## TIER 0: UNIVERSAL RULES (Always Active)
|
||||
|
||||
### 🌍 Global User Rules (MANDATORY)
|
||||
|
||||
1. **Idioma**: Conversar e desenvolver sempre em **Português do Brasil**.
|
||||
2. **Automação Terminais**: Executar comandos de terminal, leitura de arquivos e edições de forma automática. Comandos de desenvolvimento (build, install, lint, git, etc.) são sempre 'SafeToAutoRun'.
|
||||
3. **Memória & Monitoramento**: Após cada evolução ou atualização no app, é OBRIGATÓRIO:
|
||||
- Atualizar a memória do app em '/root/Antigravity_Memory/knowledge/{AppName}.md'.
|
||||
- Atualizar o status e credenciais no 'app.py' do Cronos Dashboard.
|
||||
- Realizar 'git commit', 'git push' e executar o 'update.sh' do Cronos para deploy automático.
|
||||
|
||||
### 🌐 Language Handling
|
||||
|
||||
|
||||
---
|
||||
50
fix_rls_disable.sql
Normal file
50
fix_rls_disable.sql
Normal file
@@ -0,0 +1,50 @@
|
||||
-- ============================================================================
|
||||
-- REMOVER TODAS AS POLÍTICAS RLS DO SCHEMA 'rdo'
|
||||
-- Execute este script no SQL Editor do Supabase
|
||||
-- ============================================================================
|
||||
|
||||
-- Desabilitar RLS em todas as tabelas
|
||||
ALTER TABLE rdo.usuarios DISABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE rdo.organizacoes DISABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE rdo.obras DISABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE rdo.rdos DISABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE rdo.rdo_atividades DISABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE rdo.rdo_mao_obra DISABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE rdo.rdo_equipamentos DISABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE rdo.rdo_ocorrencias DISABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE rdo.rdo_anexos DISABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE rdo.rdo_inspecoes_solda DISABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE rdo.rdo_verificacoes_torque DISABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE rdo.tarefas DISABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE rdo.inventario_equipamentos DISABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE rdo.task_logs DISABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE rdo.tipos_atividade DISABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE rdo.condicoes_climaticas DISABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE rdo.tipos_ocorrencia DISABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE rdo.funcoes_cargos DISABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE rdo.equipamentos DISABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE rdo.materiais DISABLE ROW LEVEL SECURITY;
|
||||
|
||||
-- Dropar políticas existentes
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_usuarios" ON rdo.usuarios;
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_orgs" ON rdo.organizacoes;
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_obras" ON rdo.obras;
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_rdos" ON rdo.rdos;
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_ativ" ON rdo.rdo_atividades;
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_mao" ON rdo.rdo_mao_obra;
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_equip" ON rdo.rdo_equipamentos;
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_ocor" ON rdo.rdo_ocorrencias;
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_anex" ON rdo.rdo_anexos;
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_insp" ON rdo.rdo_inspecoes_solda;
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_torq" ON rdo.rdo_verificacoes_torque;
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_tarefas" ON rdo.tarefas;
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_inv_equip" ON rdo.inventario_equipamentos;
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_task_logs" ON rdo.task_logs;
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_tipos_ativ" ON rdo.tipos_atividade;
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_cond_clim" ON rdo.condicoes_climaticas;
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_tipos_ocor" ON rdo.tipos_ocorrencia;
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_func" ON rdo.funcoes_cargos;
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_equip" ON rdo.equipamentos;
|
||||
DROP POLICY IF EXISTS "auth_all_rdo_materiais" ON rdo.materiais;
|
||||
|
||||
SELECT 'RLS desabilitado em todas as tabelas do schema rdo!' AS resultado;
|
||||
@@ -11,13 +11,11 @@ if (!supabaseUrl || !supabaseAnonKey) {
|
||||
throw new Error('Variáveis de ambiente do Supabase não estão definidas. Verifique VITE_SUPABASE_URL e VITE_SUPABASE_ANON_KEY no arquivo .env')
|
||||
}
|
||||
|
||||
// Cliente Supabase configurado para leitura (usa service_role para bypassing RLS)
|
||||
// Cliente principal: usa service_role para operations de banco (bypass RLS), sem auth
|
||||
export const supabase: SupabaseClient<Database> = createClient<Database>(supabaseUrl, serviceRoleKey || supabaseAnonKey, {
|
||||
auth: {
|
||||
autoRefreshToken: true,
|
||||
persistSession: true,
|
||||
detectSessionInUrl: true,
|
||||
flowType: 'implicit'
|
||||
persistSession: false,
|
||||
autoRefreshToken: false
|
||||
},
|
||||
db: {
|
||||
schema: 'rdo'
|
||||
|
||||
Reference in New Issue
Block a user