aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: f22fe56064bf12d71c6aad108f5463c20ed0e9ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# FlightCore

A [Northstar](https://northstar.tf/) installer, updater, and mod-manager

## Roadmap

- [ ] General
  - [ ] Icon
  - [ ] CI builds
  - [ ] Self updating
    - [x] ensure version sync with tauri.conf.json, cargo.toml
    - [x] CI release
    - [x] some scripts to create release JSON file
  - [ ] Self detect if outdated
  - [ ] Self update delivery
    - [ ] CI/CD
    - [ ] Flatpak (with CI to push flatpak update)
    - [ ] Chocolatey (maybe?)
    - [ ] Option to disable self-update (for Flatpak and Chocolatey)
  - [ ] Display current version in UI window
  - [x] Crash report uploading (sentry.io)
- [ ] Northstar install/launch support
  - [ ] 1-click to get to running Northstar
  - [x] Detect game install path
    - [x] Steam
    - [ ] Origin
    - [ ] EA
      -[ ] Handle read-only filesystem
  - [x] Check if Northstar install is up-to-date
  - [ ] 1-click updating Northstar
  - [ ] Support for multiple release channels (GitHub + Thunderstore)
  - [ ] Launch Northstar support via gamelauncher (Steam/Origin/EA)
  - [ ] Read-out current version from exe and mods
- [ ] Mod install support
  - [ ] check mod validity
  - [ ] mod update detection
- [ ] Game repair functionality
  - [ ] Button to disable all mods except core Northstar mods
  - [ ] Check filesystem permissions (we wanna look for admin owned files etc)
  - [ ] CloudFlare blocking debugger (in particular make sure to check IPv4)
- [ ] Extra
  - [ ] "dev mode"
    - [ ] PR install support
  - [ ] Support multiple profiles
  - [ ] get list of installed mods and export as TXT
  - [ ] support r2mm links
  - [ ] Open common config files
- [ ] Security
  - [ ] Ensure when loading mod title, description etc from Thunderstore to escape HTML tags

## Development

Make sure you have the necessary dependencies installed: https://tauri.app/v1/guides/getting-started/prerequisites


Install `npm` dependencies with 

```sh
npm install
```

Then for developing

```sh
# terminal 1 (UI localhost for hot-reload)
npm run ui-dev

# terminal 2 (for the Rust/App hot-reload)
npm run tauri dev
```

> **Note**
> On Windows instead of `npm run ui-dev`, you may need to run 
> `./node_modules/.bin/rollup --config --watch`
> and
> `npm run localhost`
> in two separate console windows

### Tips

Note that you can adjust the behaviour of Tauri windows in `tauri.conf.json`, e.g.

```json
"windows": [
  {
    "fullscreen": false,
    "resizable": true,
    "alwaysOnTop": true,
    "x": 1200,
    "y": 0,
    "height": 500,
    "width": 300,
    "title": "FlightCore"
  }
]
```

### Building

Release builds are generally done via CI. To build locally, make sure typescript is compiled (`./node_modules/.bin/rollup --config`), then run `npm run tauri build`.

# Old README (to be removed)


Source code for the [Rust Tauri Introduction Video](https://www.youtube.com/watch?v=kRoGYgAuZQE&list=PL7r-PXl6ZPcCIOFaL7nVHXZvBmHNhrh_Q)

## Setup

```sh
npm install
```

## Run

```sh
# terminal 1 (UI localhost for hot-reload)
npm run ui-dev

# terminal 2 (for the Rust/App hot-reload)
npm run tauri dev
```

## Database Pool as state

Rather to have a simple Mutex for the state, database can be used. 

```
sqlx = { version = "0.6", features = [ "runtime-tokio-rustls", "postgres" ] }
```

```rs
let con_string = format!("postgres://postgres:postgres@localhost/postgres");
let db = PgPoolOptions::new()
	.max_connections(5)
	.connect(&con_string)
	.await
	.expect("Cannot create PgPool");

let arc_db = Arc::new(db);
```

Then

```rs
tauri::Builder::default()
	.manage(arc_db)
```