Add instructions

main
Gerard Braad 2023-06-24 03:49:45 +00:00
parent 5984f62f2e
commit 7078542414
2 changed files with 49 additions and 4 deletions

View File

@ -12,6 +12,7 @@ A Cockpit application to manage Tailscale
Development Development
----------- -----------
This repo story includes deployment scripts for the Cocpit Tailscale development environment. This repo story includes deployment scripts for the Cocpit Tailscale development environment.
The easiest to get started is by using the following cloud development environments: The easiest to get started is by using the following cloud development environments:
@ -24,35 +25,78 @@ or you can either use a local `devsys`/`almsys`, like published here:
* https://github.com/gbraad-devenv/almalinux * https://github.com/gbraad-devenv/almalinux
### Preparation ### Preparation
Install the following packages to develop and build: Install the following packages to develop and build:
``` ```
$ sudo dnf install -y make npm $ sudo dnf install -y make npm
``` ```
and to make the RPM you need: and to make the RPM you need:
``` ```
$ sudo rpm-build gettext libappstream-glib $ sudo dnf install -y rpm-build gettext libappstream-glib
``` ```
#### Cockpit user
If you want to run cockpit, you need a user with a password:
```
$ sudo dnf install -y passwd
$ sudo passwd gbraad
```
After which you can use this user to log in to Cockpit.
### Build ### Build
To perform a development build: To perform a development build:
``` ```
$ npx webpack --mode development $ npm run dev
```` ````
To perform a production build: To perform a production build:
``` ```
$ make $ npm run build
``` ```
After the build, copy contents to `/usr/share/cockpit/tailscale`, `/usr/share/local/cockpit/tailscale` or `~/.local/share/cockpit/tailscale` For the RPM package:
```
$ npm run rpm
```
### Cockpit
After the build, copy contents to `/usr/share/cockpit/tailscale`, `/usr/share/local/cockpit/tailscale` or `~/.local/share/cockpit/tailscale`.
#### Link development
For convenience, you can also create a symlink to `~/.local/share/cockpit/tailscale` to `$PWD/dist`. However, you will need to logout/login because Cockpit caches the page and assets. For convenience, you can also create a symlink to `~/.local/share/cockpit/tailscale` to `$PWD/dist`. However, you will need to logout/login because Cockpit caches the page and assets.
To create a link:
```
$ npm run link
```
And to remove:
```
$ npm run unlink
```
#### Run Cockpit
You can run Cockpit in a container or remote development environment with the following command:
```
$ npm run cockpit
```
You will need to use an account with a password to log in.
### Tailscale systemd image ### Tailscale systemd image

View File

@ -8,6 +8,7 @@
"license": "LGPL-2.1", "license": "LGPL-2.1",
"scripts": { "scripts": {
"build": "webpack --mode production", "build": "webpack --mode production",
"dev": "webpack --mode development",
"rpm": "make rpm", "rpm": "make rpm",
"watch": "", "watch": "",
"link": "mkdir -p ~/.local/share/cockpit && ln -s $PWD/dist ~/.localshare/share/cockpit/tailscale", "link": "mkdir -p ~/.local/share/cockpit && ln -s $PWD/dist ~/.localshare/share/cockpit/tailscale",