Skip to content

Commit

Permalink
integration/refactors
Browse files Browse the repository at this point in the history
wip: Refactoring the service

-> Made new skeleton
-> Added service manager
-> Manager Refactored
-> Cleanup
-> Add gid struct
-> remove synchronizer
-> Added backup into manager
-> Fix the configure signal not send
-> Fixes around backup and sync

wip: Moved over the config into the service manager

js effect for subscribing to config

js effect for subscribing to config

fix errors

chore: Fix some things in the manager for clippy

add interfaces from manifest automatically

make OsApi manager-based

wip: Starting down the bind for the effects

todo: complete a ip todo

chore: Fix the result type on something

todo: Address returning

chore: JS with callbacks

chore: Add in the chown and permissions

chore: Add in the binds and unbinds in

feat: Add in the ability to get configs

makefile changes

add start/stop/restart to effects

config hooks

fix: add a default always to the get status

chore: Only do updates when the thing is installed.

use nistp256 to satisfy firefox

use ed25519 if available

chore: Make the thing buildable for testing

chore: Add in the debugging

fix ip signing

chore: Remove the bluj tracing

fix SQL error

chore: Fix the build

update prettytable to fix segfault

Chore: Make these fn's instead of allways ran.

chore: Fix the testing

fix: The stopping/ restarting service

fix: Fix the restarting.

remove current-dependents, derive instead

remove pointers from current-dependencies

remove pointers and system pointers from FE

v0.3.4

remove health checks from manifest

remove "restarting" bool on "starting" status

remove restarting attr

update makefile

fix

add efi support

fix efi

add redirect if connecting to https over http

clean up

lan port forwarding

add `make update` and `make update-overlay`

fix migration

more protections

fix: Fix a lint

chore: remove the limit on the long-running

fix: Starting sometimes.

fix: Make it so the stop of the main works

fix: Bind local and tor with package.

wip: envs

closes #2152, closes #2155, closes #2157

fix TS error

import config types from sdk

update package.json
  • Loading branch information
dr-bonez committed Mar 14, 2023
1 parent d5b057a commit 243881f
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 174 deletions.
1 change: 1 addition & 0 deletions backend/src/manager/js_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use sqlx::Acquire;
use crate::{
config::hook::ConfigHook,
manager::{start_stop::StartStop, Manager},
net::keys::Key,
};

use super::try_get_running_ip;
Expand Down
1 change: 1 addition & 0 deletions backend/src/net/ssl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use crate::account::AccountInfo;
use crate::hostname::Hostname;
use crate::net::dhcp::ips;
use crate::net::keys::{Key, KeyInfo};
use crate::s9pk::manifest::PackageId;
use crate::{Error, ErrorKind, ResultExt};

static CERTIFICATE_VERSION: i32 = 2; // X509 version 3 is actually encoded as '2' in the cert because fuck you.
Expand Down
36 changes: 29 additions & 7 deletions backend/src/procedure/js_scripts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,27 +253,49 @@ mod tests {
&self,
id: PackageId,
path: &str,
callback: Callback,
) -> Result<serde_json::Value, Report> {
println!("Adding callback");
self.config_callbacks.send_modify(|x| x.push(callback));
Ok(Value::Null)
callback: Option<Callback>,
) -> Result<Vec<serde_json::Value>, Report> {
if let Some(callback) = callback {
println!("Adding callback");
self.config_callbacks.send_modify(|x| x.push(callback));
}
Ok(vec![Value::Null])
}
#[allow(unused_variables)]
async fn bind_local(
&self,
internal_port: u16,
address_schema: AddressSchemaLocal,
) -> Result<Address, Report> {
todo!()
unimplemented!()
}
#[allow(unused_variables)]
async fn bind_onion(
&self,
internal_port: u16,
address_schema: AddressSchemaOnion,
) -> Result<Address, Report> {
todo!()
unimplemented!()
}
#[allow(unused_variables)]
async fn unbind_local(&self, id: InterfaceId, external: u16) -> Result<(), Report> {
unimplemented!()
}
#[allow(unused_variables)]
async fn unbind_onion(&self, id: InterfaceId, external: u16) -> Result<(), Report> {
unimplemented!()
}
fn set_started(&self) -> Result<(), Report> {
unimplemented!()
}
async fn restart(&self) -> Result<(), Report> {
unimplemented!()
}
async fn start(&self) -> Result<(), Report> {
unimplemented!()
}
async fn stop(&self) -> Result<(), Report> {
unimplemented!()
}
}
#[tokio::test]
Expand Down
29 changes: 10 additions & 19 deletions backend/src/version/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,7 @@ impl Version {
#[cfg(test)]
fn as_sem_ver(&self) -> emver::Version {
match self {
Version::V0_3_0(Wrapper(x)) => x.semver(),
Version::V0_3_0_1(Wrapper(x)) => x.semver(),
Version::V0_3_0_2(Wrapper(x)) => x.semver(),
Version::V0_3_0_3(Wrapper(x)) => x.semver(),
Version::V0_3_1(Wrapper(x)) => x.semver(),
Version::V0_3_1_1(Wrapper(x)) => x.semver(),
Version::V0_3_1_2(Wrapper(x)) => x.semver(),
Version::V0_3_2(Wrapper(x)) => x.semver(),
Version::V0_3_2_1(Wrapper(x)) => x.semver(),
Version::LT0_3_3(LTWrapper(_, x)) => x.clone(),
Version::V0_3_3(Wrapper(x)) => x.semver(),
Version::V0_3_4(Wrapper(x)) => x.semver(),
Version::Other(x) => x.clone(),
Expand Down Expand Up @@ -195,7 +187,7 @@ where
let v = crate::util::Version::deserialize(deserializer)?;
let version = T::new();
if *v == version.semver() {
Ok(Wrapper(version))
Ok(Self(version))
} else {
Err(serde::de::Error::custom("Mismatched Version"))
}
Expand Down Expand Up @@ -255,15 +247,14 @@ mod tests {

fn versions() -> impl Strategy<Value = Version> {
prop_oneof![
Just(Version::V0_3_0(Wrapper(v0_3_0::Version::new()))),
Just(Version::V0_3_0_1(Wrapper(v0_3_0_1::Version::new()))),
Just(Version::V0_3_0_2(Wrapper(v0_3_0_2::Version::new()))),
Just(Version::V0_3_0_3(Wrapper(v0_3_0_3::Version::new()))),
Just(Version::V0_3_1(Wrapper(v0_3_1::Version::new()))),
Just(Version::V0_3_1_1(Wrapper(v0_3_1_1::Version::new()))),
Just(Version::V0_3_1_2(Wrapper(v0_3_1_2::Version::new()))),
Just(Version::V0_3_2(Wrapper(v0_3_2::Version::new()))),
Just(Version::V0_3_2_1(Wrapper(v0_3_2_1::Version::new()))),
em_version().prop_map(|v| if v < v0_3_3::Version::new().semver() {
Version::LT0_3_3(LTWrapper(v0_3_3::Version::new(), v))
} else {
Version::LT0_3_3(LTWrapper(
v0_3_3::Version::new(),
emver::Version::new(0, 3, 0, 0),
))
}),
Just(Version::V0_3_3(Wrapper(v0_3_3::Version::new()))),
Just(Version::V0_3_4(Wrapper(v0_3_4::Version::new()))),
em_version().prop_map(Version::Other),
Expand Down
12 changes: 0 additions & 12 deletions build/raspberry-pi/033-upgrade.service

This file was deleted.

88 changes: 0 additions & 88 deletions build/raspberry-pi/033-upgrade.sh

This file was deleted.

45 changes: 0 additions & 45 deletions build/raspberry-pi/make-upgrade-image.sh

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/patchdb-ui-seed.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": null,
"ack-welcome": "0.3.4",
"ack-welcome": "0.4.0",
"marketplace": {
"selected-url": "https://registry.start9.com/",
"known-hosts": {
Expand Down
1 change: 1 addition & 0 deletions libs/helpers/src/os_api.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::sync::Arc;

use color_eyre::eyre::eyre;
use color_eyre::Report;
use models::InterfaceId;
use models::PackageId;
Expand Down
1 change: 0 additions & 1 deletion libs/js_engine/src/artifacts/loadModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ const effects = {
runCommand,
runDaemon,
runRsync,
chmod,
signalGroup,
sleep,
start,
Expand Down
1 change: 0 additions & 1 deletion libs/js_engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ impl JsExecutionEnvironment {
fns::chmod::decl(),
fns::bind_local::decl(),
fns::bind_onion::decl(),
fns::chown::decl(),
fns::fetch::decl(),
fns::read_file::decl(),
fns::metadata::decl(),
Expand Down

0 comments on commit 243881f

Please sign in to comment.