From 622c5e8203f282fbc25dabf3f803b661501d35f9 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sat, 24 Jan 2026 11:31:34 +0300 Subject: [PATCH] fix is public --- deploy.vsh | 49 +++++++++++++++++++++++------------------------ src/repo.v | 2 +- src/repo_routes.v | 6 ++++-- 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/deploy.vsh b/deploy.vsh index c2bc093..f1bfbd4 100755 --- a/deploy.vsh +++ b/deploy.vsh @@ -3,35 +3,34 @@ import os import term -const server = 'gitly' +const server = 'gitly' const remote_path = '/var/www/gitly' fn main() { - println('Step 1: Syncing files...') - // -a: archive mode (preserves permissions, recursive, etc.) - // -v: verbose - // -z: compress - exec_safe('rsync -avz src translations ${server}:${remote_path}/') - - println('\nStep 2: Remote compilation and restart...') - remote_cmds := [ - 'cd $remote_path', - '/root/v2/v -d new_veb -d use_openssl .', - 'sudo systemctl restart gitly' - ].join(' && ') - - println('ssh $server "$remote_cmds"') - exec_safe('ssh $server "$remote_cmds"') - - println(term.green('\nDeployment successful!')) + println('Step 1: Syncing files...') + // -a: archive mode (preserves permissions, recursive, etc.) + // -v: verbose + // -z: compress + exec_safe('rsync -avz src translations ${server}:${remote_path}/') + + println('\nStep 2: Remote compilation and restart...') + remote_cmds := [ + 'cd ${remote_path}', + '/root/v2/v -keepc -d trace_pg_error -d new_veb -d use_openssl .', + 'sudo systemctl restart gitly', + ].join(' && ') + + println('ssh ${server} "${remote_cmds}"') + exec_safe('ssh ${server} "${remote_cmds}"') + + println(term.green('\nDeployment successful!')) } fn exec_safe(cmd string) { - // os.system streams output directly to stdout/stderr, - // which is better for seeing rsync progress and compiler errors. - if os.system(cmd) != 0 { - eprintln(term.red('\n Error executing command.')) - exit(1) - } + // os.system streams output directly to stdout/stderr, + // which is better for seeing rsync progress and compiler errors. + if os.system(cmd) != 0 { + eprintln(term.red('\n Error executing command.')) + exit(1) + } } - diff --git a/src/repo.v b/src/repo.v index ab1cddb..a097bd8 100644 --- a/src/repo.v +++ b/src/repo.v @@ -72,7 +72,7 @@ fn (mut app App) save_repo(repo Repo) ! { views_count := repo.views_count webhook_secret := repo.webhook_secret tags_count := repo.tags_count - is_public := if repo.is_public { 1 } else { 0 } + is_public := repo.is_public // if repo.is_public { 1 } else { 0 } // SQLITE hack open_issues_count := repo.nr_open_issues open_prs_count := repo.nr_open_prs branches_count := repo.nr_branches diff --git a/src/repo_routes.v b/src/repo_routes.v index 1623d20..b919ea2 100644 --- a/src/repo_routes.v +++ b/src/repo_routes.v @@ -299,8 +299,9 @@ pub fn (mut app App) handle_new_repo(mut ctx Context, name string, clone_url str pub fn (mut app App) clone_repo(mut new_repo Repo) { new_repo.clone() app.debug('cloning done') - app.update_repo_from_fs(mut new_repo) or {} - app.set_repo_status(new_repo.id, .done) or {} + app.update_repo_from_fs(mut new_repo) or { eprintln('cannot update repo from fs ${err}') } + eprintln('setting repo status to done after cloning xxx') + app.set_repo_status(new_repo.id, .done) or { eprintln('cannot set repo status ${err}') } // git.clone(valid_clone_url, repo_path) } @@ -311,6 +312,7 @@ pub fn (mut app App) kekw(mut ctx Context) veb.Result { @['/:username/:repo_name/tree/:branch_name/:path...'] pub fn (mut app App) tree(mut ctx Context, username string, repo_name string, branch_name string, path string) veb.Result { mut repo := app.find_repo_by_name_and_username(repo_name, username) or { + eprintln('tree() repo ${repo_name} not found') return ctx.not_found() } eprintln('!!! REPO STATUS = ${repo.status}') -- 2.39.5