mirror of
https://github.com/freedit-org/freedit.git
synced 2026-01-09 12:38:04 -05:00
static vs data folder
This commit is contained in:
9
.gitignore
vendored
9
.gitignore
vendored
@@ -1,11 +1,4 @@
|
||||
/target
|
||||
/freedit.db*
|
||||
/certs
|
||||
/static/imgs
|
||||
.rustc_info.json
|
||||
.rustdoc_fingerprint.json
|
||||
config.toml
|
||||
/snapshots
|
||||
/tantivy
|
||||
/static/podcasts
|
||||
.DS_Store
|
||||
/data
|
||||
@@ -17,6 +17,7 @@ pub struct Config {
|
||||
pub(crate) upload_path: String,
|
||||
pub(crate) tantivy_path: String,
|
||||
pub(crate) podcast_path: String,
|
||||
pub snapshots_path: String,
|
||||
pub(crate) proxy: String,
|
||||
}
|
||||
|
||||
@@ -42,6 +43,7 @@ impl Config {
|
||||
check_path(&config.upload_path);
|
||||
check_path(&config.tantivy_path);
|
||||
check_path(&config.podcast_path);
|
||||
check_path(&config.snapshots_path);
|
||||
|
||||
config
|
||||
}
|
||||
@@ -50,14 +52,15 @@ impl Config {
|
||||
impl Default for Config {
|
||||
fn default() -> Self {
|
||||
Config {
|
||||
db: "freedit.db".into(),
|
||||
db: "data/freedit.db".into(),
|
||||
addr: "127.0.0.1:3001".into(),
|
||||
rebuild_index: None,
|
||||
avatars_path: "static/imgs/avatars".into(),
|
||||
inn_icons_path: "static/imgs/inn_icons".into(),
|
||||
upload_path: "static/imgs/upload".into(),
|
||||
podcast_path: "static/podcasts".into(),
|
||||
tantivy_path: "tantivy".into(),
|
||||
avatars_path: "data/imgs/avatars".into(),
|
||||
inn_icons_path: "data/imgs/inn_icons".into(),
|
||||
upload_path: "data/imgs/upload".into(),
|
||||
podcast_path: "data/podcasts".into(),
|
||||
tantivy_path: "data/tantivy".into(),
|
||||
snapshots_path: "data/snapshots".into(),
|
||||
proxy: "".into(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ fn create_snapshot(db: &sled::Db) {
|
||||
info!(%checksum);
|
||||
|
||||
let ts = Timestamp::now().strftime("%Y-%m-%d-%H-%M-%S");
|
||||
let mut snapshot_path = PathBuf::from("snapshots");
|
||||
let mut snapshot_path = PathBuf::from(&CONFIG.snapshots_path);
|
||||
if !snapshot_path.exists() {
|
||||
fs::create_dir_all(&snapshot_path).unwrap();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user