From d477e234d03bb55234c2ca40d6ff61e88754ad94 Mon Sep 17 00:00:00 2001 From: KunoiSayami Date: Sun, 16 Jan 2022 22:25:55 +0800 Subject: feat: Add immutable option make sure sqlite file readonly * chore: Bump version Signed-off-by: KunoiSayami --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 784837b..74d5a21 100644 --- a/src/main.rs +++ b/src/main.rs @@ -135,6 +135,7 @@ async fn cmd_authenticate_cookie(matches: &ArgMatches<'_>, cfg: Config) -> Resul if !repo.is_empty() && !conn.exists(&redis_key).await? { let sql_conn = SqliteConnectOptions::from_str(cfg.get_database_location())? .read_only(true) + .immutable(true) .disable_statement_logging() .connect() .await; @@ -378,6 +379,7 @@ async fn cmd_upgrade_database(cfg: Config) -> Result<()> { let mut origin_conn = SqliteConnectOptions::from_str(v2_path.as_path().to_str().unwrap())? .read_only(true) + .immutable(true) .connect() .await?; @@ -529,6 +531,7 @@ async fn cmd_list_repos_acl(arg_matches: &ArgMatches<'_>, cfg: Config) -> Result let mut conn = SqliteConnectOptions::from_str(cfg.get_database_location())? .read_only(true) + .immutable(true) .connect() .await?; -- cgit v1.3.1