Skip to content

Commit

Permalink
Merge pull request #112 from 45Drives/build
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
brkelly20 authored Oct 28, 2024
2 parents e91bc5d + 7482e28 commit 86be242
Show file tree
Hide file tree
Showing 159 changed files with 17,662 additions and 194 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ on:
- 'v*.*.*'
jobs:
main:
runs-on: self-hosted
runs-on: deployinatorv1
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 1
- name: Package Binaries
run: build-packages ${{github.repository}} ${{github.workspace}} --env NPM_AUTH_TOKEN ${{secrets.NPM_AUTH_PAT}}
run: build-packages ${{github.repository}} ${{github.workspace}} --env NPM_AUTH_TOKEN ${{secrets.NPM_AUTH_PAT}} --env YARN_IGNORE_NODE 1
- name: Set Variables
if: startsWith(github.ref, 'refs/tags/')
run: |
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
TODO
node_modules/
.yarn/
.yarnrc.yml
*_generic.tar.gz
*_generic.zip
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "houston-common"]
path = houston-common
url = [email protected]:45Drives/houston-common.git
13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"tailwindCSS.classAttributes": [
"class",
"className",
"ngClass",
"enter-active-class",
"enter-from-class",
"enter-to-class",
"leave-active-class",
"leave-from-class",
"leave-to-class"
]
}
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
## Cockpit File Sharing 3.3.7-1
## Cockpit File Sharing 4.2.5-1

* Samba - fix saving global advanced settings with '=' in their value
* NFS - better whitespace handling while parsing exports file
* iSCSI Release
47 changes: 32 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
# If not, see <https://www.gnu.org/licenses/>.

# PLUGIN_SRCS is space-delimited list of subdirectories containg a plugin project.
# You can leave it empty for automatic detection based on directories containing a package.json file.
PLUGIN_SRCS=
PLUGIN_SRCS=file-sharing

# For installing to a remote machine for testing with `make install-remote`
REMOTE_TEST_HOST=192.168.207.27
REMOTE_TEST_HOST=192.168.45.23
REMOTE_TEST_USER=root

# Restarts cockpit after install
Expand Down Expand Up @@ -53,35 +52,44 @@ BUILD_FLAGS=-- --minify false
endif

ifndef PLUGIN_SRCS
PLUGIN_SRCS:=$(patsubst %/package.json,%,$(wildcard */package.json))
# PLUGIN_SRCS:=$(filter-out %-old houston-common, $(patsubst %/package.json,%,$(wildcard */package.json)))
$(error PLUGIN_SRCS not set - please edit Makefile)
endif

OUTPUTS:=$(addsuffix /dist/index.html, $(PLUGIN_SRCS))

NPM_PREFIX:=$(shell command -v yarn > /dev/null 2>&1 && echo 'yarn --cwd' || echo 'npm --prefix')
NPM_UPDATE:=$(shell command -v yarn > /dev/null 2>&1 && echo 'yarn upgrade --cwd' || echo 'npm update --prefix')

VERSION_FILES:=$(addsuffix /src/version.js, $(PLUGIN_SRCS))
OS_PACKAGE_RELEASE?=built_from_source

default: $(VERSION_FILES) $(OUTPUTS)
default: $(OUTPUTS)

all: default

.PHONY: default all install clean help install-local install-remote install
.PHONY: default all install clean help install-local install-remote install houston-common bootstrap-yarn

bootstrap-yarn: .yarnrc.yml

.yarnrc.yml:
./bootstrap.sh

houston-common/Makefile:
git submodule update --init

$(VERSION_FILES): ./manifest.json
echo 'export const pluginVersion = "$(shell jq -r '.version' ./manifest.json)-$(shell jq -r '.buildVersion' ./manifest.json)$(OS_PACKAGE_RELEASE)";' > $@
houston-common: houston-common/Makefile bootstrap-yarn
$(MAKE) -C houston-common

houston-common-%:
$(MAKE) -C houston-common $*

# build outputs
.SECONDEXPANSION:
$(OUTPUTS): %/dist/index.html: $$(shell find '$$*' -type d \( -name node_modules -o -path '$$*/dist' -o -path '*node_modules*' \) -prune -o -type f -not \( -name .gitignore \) -print)
$(OUTPUTS): %/dist/index.html: bootstrap-yarn houston-common $$(shell find '$$*' -type d \( -name node_modules -o -path '$$*/dist' -o -path '*node_modules*' \) -prune -o -type f -not \( -name .gitignore \) -print)
@echo -e $(call cyantext,Building $*)
$(NPM_PREFIX) $* install
yarn --cwd $* install
ifeq ($(AUTO_UPGRADE_DEPS),1)
$(NPM_UPDATE) $*
yarn upgrade --cwd $*
endif
$(NPM_PREFIX) $* run build $(BUILD_FLAGS)
yarn --cwd $* run build $(BUILD_FLAGS)
@echo -e $(call greentext,Done building $*)
@echo

Expand Down Expand Up @@ -141,6 +149,10 @@ package-generic: default
clean: FORCE
rm $(dir $(OUTPUTS)) -rf

clean-all: clean FORCE
rm .yarnrc.yml .yarn/ -rf
find . -name node_modules -type d -exec rm -rf {} \; -prune

help:
@echo 'make usage'
@echo
Expand All @@ -158,4 +170,9 @@ help:
@echo 'build cleanup:'
@echo ' make clean'

test-%:
yarn --cwd $* run test

test: houston-common-test $(addprefix test-, $(PLUGIN_SRCS))

FORCE:
42 changes: 22 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ sudo apt install cockpit-file-sharing
### Direct from .deb
Installing this way may work for other versions of Ubuntu and Debian, but it is unsupported. You won't get automatic updates this way.
```bash
curl -LO https://github.com/45Drives/cockpit-file-sharing/releases/download/v3.3.7/cockpit-file-sharing_3.3.7-1focal_all.deb
sudo apt install ./cockpit-file-sharing_3.3.7-1focal_all.deb
curl -LO https://github.com/45Drives/cockpit-file-sharing/releases/download/v4.1.0/cockpit-file-sharing_4.1.0-1focal_all.deb
sudo apt install ./cockpit-file-sharing_4.1.0-1focal_all.deb
```
## Rocky 8
### From 45Drives Repo (Recommended, Rocky 8 only)
Expand All @@ -51,38 +51,39 @@ sudo dnf install cockpit-file-sharing
Installing this way may work for other versions of Rocky/Centos/RHEL/Fedora/etc, but it is unsupported. You won't get automatic updates this way.
```bash
# dnf or yum
sudo dnf install https://github.com/45Drives/cockpit-file-sharing/releases/download/v3.3.7/cockpit-file-sharing-3.3.7-1.el8.noarch.rpm
sudo dnf install https://github.com/45Drives/cockpit-file-sharing/releases/download/v4.1.0/cockpit-file-sharing-4.1.0-1.el8.noarch.rpm
```
## Generic Installation
1. Install Dependencies
```bash
# debian-like
cockpit
attr
cockpit-bridge
coreutils
attr
findutils
hostname
iproute2
libc-bin
systemd
nfs-kernel-server
samba
samba-common-bin
systemd
winbind
gawk
# RHEL-like
cockpit
attr
cockpit-bridge
coreutils
attr
findutils
hostname
iproute
glibc-common
systemd
nfs-utils
samba-common-tools
samba-winbind-clients
system
gawk
```
2. Download pre-built archive and install
```bash
curl -LO https://github.com/45Drives/cockpit-file-sharing/releases/download/v3.3.7/cockpit-file-sharing_3.3.7_generic.zip
unzip cockpit-file-sharing_3.3.7_generic.zip
cd cockpit-file-sharing_3.3.7_generic
curl -LO https://github.com/45Drives/cockpit-file-sharing/releases/download/v4.1.0/cockpit-file-sharing_4.1.0_generic.zip
unzip cockpit-file-sharing_4.1.0_generic.zip
cd cockpit-file-sharing_4.1.0_generic
# no need to run `make` first, the plugin is pre-built
sudo make install
```
Expand All @@ -95,12 +96,13 @@ Simply click the `+` in the top right of the shares list, fill out the required
* Share Name - Unique name for the share
* Share Description - Optional description for the share
* Path - The path to share out from the server
* Valid Users/Groups
* Allow-lists for users and groups
* By default, any user or group is allowed
* ~~Valid Users/Groups~~ removed in v4 - valid users property still available through advanced settings.
* ~~Allow-lists for users and groups~~
* ~~By default, any user or group is allowed~~
* Guest Ok - Allow accessing share with no password, privileges mapped to `guest account` (default=`nobody`)
* Read Only - Disallow creation/modification of files/directories
* Browsable - Controls whether this share is seen in the list of available shares in a net view and in the browse list
* Inherit Permissions - New directories inherit the mode of the parent directory, including bits such as setgid. New files inherit their read/write bits from the parent directory.
* Windows ACLs - Administer share permissions from Windows, sets the following advanced settings
```ini
map acl inherit = yes
Expand Down
16 changes: 16 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# bootstrap.sh

set -e
set -o pipefail
set -x

command -v sponge >/dev/null || { echo "Missing 'sponge'. Please install moreutils." >&2 ; exit 1 ; }

jq 'del(.packageManager)' ./package.json | sponge ./package.json

rm .yarnrc.yml .yarn -rf

yarn set version stable

yarn config set nodeLinker node-modules
Loading

0 comments on commit 86be242

Please sign in to comment.