Skip to content

Commit

Permalink
Release/3.2.0 (#32)
Browse files Browse the repository at this point in the history
* ci: use the main branch for official releases

* refactor: new container names and assets

* fix(docker-compose): wrong image tag runtipi/worker

* chore(docker-compose): add healthchecks for runtipi container

* chore: update deps

* fix(debug): check for file tipi-compose.yml instead of tipi-config.yml

* fix(debug): use new naming convention for debugging running containers

* feat: allow custom path for all runtipi folders

* chore: remove obsolete "version" from docker-compose

* ci: echo distinc id inside matrix
  • Loading branch information
nicotsx authored Apr 27, 2024
1 parent bce5419 commit 13b19b0
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 52 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,8 @@ on:
required: false

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: echo distinct ID ${{ github.event.inputs.distinct_id }}
run: echo ${{ github.event.inputs.distinct_id }}

create-tag:
runs-on: ubuntu-latest
needs: [test]
outputs:
tagname: ${{ inputs.version }}
steps:
Expand Down Expand Up @@ -57,6 +50,9 @@ jobs:

runs-on: ${{ matrix.platform.os }}
steps:
- name: echo distinct ID ${{ github.event.inputs.distinct_id }}
run: echo ${{ github.event.inputs.distinct_id }}

- name: Checkout
uses: actions/checkout@v4
with:
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ on:
required: false

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: echo distinct ID ${{ github.event.inputs.distinct_id }}
run: echo ${{ github.event.inputs.distinct_id }}

build:
name: Release - ${{ matrix.platform.release_for }}
strategy:
Expand All @@ -36,6 +30,9 @@ jobs:

runs-on: ${{ matrix.platform.os }}
steps:
- name: echo distinct ID ${{ github.event.inputs.distinct_id }}
run: echo ${{ github.event.inputs.distinct_id }}

- name: Checkout
uses: actions/checkout@v4
with:
Expand Down
35 changes: 8 additions & 27 deletions src/assets/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.9"

services:
runtipi-reverse-proxy:
container_name: runtipi-reverse-proxy
Expand Down Expand Up @@ -76,14 +74,14 @@ services:
- .env
volumes:
# Data
- ./media:/data/media
- ./state:/data/state
- ./repos:/data/repos
- ./apps:/data/apps
- ./logs:/data/logs
- ./traefik:/data/traefik
- ./user-config:/data/user-config
- ${STORAGE_PATH:-.}/app-data:/app-data
- ${RUNTIPI_MEDIA_PATH:-.}/media:/data/media
- ${RUNTIPI_STATE_PATH:-.}/state:/data/state
- ${RUNTIPI_REPOS_PATH:-.}/repos:/data/repos
- ${RUNTIPI_APPS_PATH:-.}/apps:/data/apps
- ${RUNTIPI_LOGS_PATH:-.}/logs:/data/logs
- ${RUNTIPI_TRAEFIK_PATH:-.}/traefik:/data/traefik
- ${RUNTIPI_USER_CONFIG_PATH:-.}/user-config:/data/user-config
- ${RUNTIPI_APP_DATA_PATH:-.}/app-data:/app-data
# Static
- ./.env:/data/.env
- /var/run/docker.sock:/var/run/docker.sock:ro
Expand Down Expand Up @@ -135,23 +133,6 @@ services:
traefik.http.routers.worker-api.rule: PathPrefix("/worker-api")
traefik.http.routers.worker-api.service: worker-api
traefik.http.routers.worker-api.entrypoints: web
# Websecure
traefik.http.routers.worker-insecure.rule: Host(`${DOMAIN}`) && PathPrefix(`/worker`)
traefik.http.routers.worker-insecure.service: worker
traefik.http.routers.worker-insecure.entrypoints: web
traefik.http.routers.worker-insecure.middlewares: redirect-to-https
traefik.http.routers.worker-secure.rule: Host(`${DOMAIN}`) && PathPrefix(`/worker`)
traefik.http.routers.worker-secure.service: worker
traefik.http.routers.worker-secure.entrypoints: websecure
traefik.http.routers.worker-secure.tls.certresolver: myresolver
traefik.http.routers.worker-api-insecure.rule: Host(`${DOMAIN}`) && PathPrefix(`/worker-api`)
traefik.http.routers.worker-api-insecure.service: worker-api
traefik.http.routers.worker-api-insecure.entrypoints: web
traefik.http.routers.worker-api-insecure.middlewares: redirect-to-https
traefik.http.routers.worker-api-secure.rule: Host(`${DOMAIN}`) && PathPrefix(`/worker-api`)
traefik.http.routers.worker-api-secure.service: worker-api
traefik.http.routers.worker-api-secure.entrypoints: websecure
traefik.http.routers.worker-api-secure.tls.certresolver: myresolver
# Local domain
traefik.http.routers.worker-local-insecure.rule: Host(`${LOCAL_DOMAIN}`) && PathPrefix("/worker")
traefik.http.routers.worker-local-insecure.entrypoints: web
Expand Down
11 changes: 7 additions & 4 deletions src/commands/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use colored::Colorize;
use prettytable::{format, row, Table};
use serde_json::{to_string_pretty, Value};

use crate::utils::{system::get_architecture, env::EnvMap};
use crate::utils::{env::EnvMap, system::get_architecture};

pub fn run(env_map: EnvMap) {
println!("⚠️ Make sure you have started tipi before running this command\n");
Expand All @@ -24,7 +24,7 @@ pub fn run(env_map: EnvMap) {
table.add_row(row!["Architecture", arch]);

// Does the file user_config/tipi-config.yml exist?
let config_file = std::path::Path::new("user-config/tipi-config.yml");
let config_file = std::path::Path::new("user-config/tipi-compose.yml");

// Print the table
table.printstd();
Expand Down Expand Up @@ -87,7 +87,10 @@ pub fn run(env_map: EnvMap) {
"ROOT_FOLDER_HOST",
env_map.get("ROOT_FOLDER_HOST").unwrap_or(&"Not set".red().to_string())
]);
table.add_row(row!["STORAGE_PATH", env_map.get("STORAGE_PATH").unwrap_or(&"Not set".red().to_string())]);
table.add_row(row![
"RUNTIPI_APP_DATA_PATH",
env_map.get("RUNTIPI_APP_DATA_PATH").unwrap_or(&"Not set".red().to_string())
]);
table.add_row(row!["NGINX_PORT", env_map.get("NGINX_PORT").unwrap_or(&"Not set".red().to_string())]);
table.add_row(row![
"NGINX_PORT_SSL",
Expand Down Expand Up @@ -117,7 +120,7 @@ pub fn run(env_map: EnvMap) {
.arg("ps")
.arg("-a")
.arg("--filter")
.arg("name=tipi-")
.arg("name=runtipi-")
.arg("--format")
.arg("{{.Names}} {{.Status}}")
.output()
Expand Down
18 changes: 10 additions & 8 deletions src/utils/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,18 @@ pub fn generate_env_file(custom_env_file_path: Option<PathBuf>) -> Result<(), Er
.unwrap_or(&derive_entropy("redis_password", &seed))
.to_string();

if parsed_json.storage_path.is_some() {
// Test if the storage path is valid
let storage_path = PathBuf::from(&parsed_json.storage_path.as_ref().unwrap());
let app_data_path = parsed_json.app_data_path.or(parsed_json.storage_path.clone());

if !storage_path.exists() {
if app_data_path.is_some() {
// Test if the path is valid
let temp_app_data_path = PathBuf::from(&app_data_path.as_ref().unwrap());

if !temp_app_data_path.exists() {
return Err(Error::new(
std::io::ErrorKind::NotFound,
format!(
"Storage path '{}' does not exist on your system. Make sure it is an absolute path or remove it from settings.json.",
storage_path.display()
"Path '{}' does not exist on your system. Make sure it is an absolute path or remove it from settings.json.",
temp_app_data_path.display()
),
));
}
Expand All @@ -134,8 +136,8 @@ pub fn generate_env_file(custom_env_file_path: Option<PathBuf>) -> Result<(), Er
.as_string(),
);
new_env_map.insert(
"STORAGE_PATH".to_string(),
parsed_json.storage_path.unwrap_or(root_folder.display().to_string()),
"RUNTIPI_APP_DATA_PATH".to_string(),
app_data_path.unwrap_or(root_folder.display().to_string()),
);
new_env_map.insert("POSTGRES_PASSWORD".to_string(), postgres_password);
new_env_map.insert(
Expand Down
4 changes: 4 additions & 0 deletions src/utils/schemas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ pub struct SettingsSchema {
#[serde(rename = "sslPort")]
pub nginx_ssl_port: Option<StringOrInt>,

// Deprecated
#[serde(rename = "storagePath")]
pub storage_path: Option<String>,

#[serde(rename = "appDataPath")]
pub app_data_path: Option<String>,

#[serde(rename = "postgresPort")]
pub postgres_port: Option<StringOrInt>,

Expand Down

0 comments on commit 13b19b0

Please sign in to comment.