Skip to content

Commit

Permalink
Merge new version to main
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaboud committed Jul 6, 2022
2 parents bf1c339 + 9c8b3ef commit 91a4057
Show file tree
Hide file tree
Showing 115 changed files with 8,608 additions and 28,187 deletions.
62 changes: 62 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

## Bug Info

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Console Output**
- Firefox:
- Go to the menu dropdown > Web Developer > Web Developer Tools > Console
- Expand relevent error messages
- Copy and paste console log
- Chrome
- Press Ctrl+Shift+J
- Expand relevent error messages
- Copy and paste console log
- Safari
- [Open console](https://balsamiq.com/support/faqs/browserconsole/#apple-safari)
- Expand relevent error messages
- Copy and paste console log
- Internet Explorer
- Good luck

## Client Side

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

## Server Side
- OS: [e.g. Ubuntu 20.04, Rocky 8]
- Cockpit Version: [e.g. 235]

**Additional context**
Add any other context about the problem here.
7 changes: 5 additions & 2 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@ name: Build Packages
on:
push:
branches:
- main
- build
tags:
- 'v*.*.*'
jobs:
main:
runs-on: self-hosted
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Package Binaries
run: build-packages ${{github.repository}} ${{github.workspace}}
run: build-packages ${{github.repository}} ${{github.workspace}} --env NPM_AUTH_TOKEN ${{secrets.NPM_AUTH_PAT}}
- name: Set Variables
if: startsWith(github.ref, 'refs/tags/')
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## Cockpit File Sharing 2.4.5-1
## Cockpit File Sharing 3.2.0-1

* add support for using samba varibles in path names
* Add button to import configuration from /etc/samba/smb.conf, backup original smb.conf, and replace it to just include registry
152 changes: 152 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# Automatic Houston Plugin Makefile
# Copyright (C) 2022 Josh Boudreau <jboudreau@45drives.com>
#
# Automatic Houston Plugin Makefile is free software: you can redistribute it and/or modify it under the terms
# of the GNU General Public License as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# Automatic Houston Plugin Makefile is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with Automatic Houston Plugin Makefile.
# 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=

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

# Restarts cockpit after install
RESTART_COCKPIT?=0

# When set to 1, JS is not minified
DEBUG?=0

# Run yarn upgrade or npm update for each project before build
AUTO_UPGRADE_DEPS?=0

# USAGE
# installation:
# $ make
# # make install
# testing:
# $ make
# $ make install-local
# or
# $ make install-remote
################################
# Do not edit anything below

define greentext
'\033[1;32m$(1)\033[0m'
endef
define cyantext
'\033[1;96m$(1)\033[0m'
endef

ifeq ($(DEBUG),1)
BUILD_FLAGS=-- --minify false
endif

ifndef PLUGIN_SRCS
PLUGIN_SRCS:=$(patsubst %/package.json,%,$(wildcard */package.json))
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)

all: default

.PHONY: default all install clean help install-local install-remote install

$(VERSION_FILES): ./manifest.json
echo 'export const pluginVersion = "$(shell jq -r '.version' ./manifest.json)-$(shell jq -r '.buildVersion' ./manifest.json)$(OS_PACKAGE_RELEASE)";' > $@

# build outputs
.SECONDEXPANSION:
$(OUTPUTS): %/dist/index.html: $$(shell find $$*/src -type f) $$(shell find $$*/public -type f) $$(shell find $$* -name 'yarn.lock' -o -name 'package.json' -not -path '*node_modules*') $$*/*.html $$*/*.js
@echo -e $(call cyantext,Building $*)
$(NPM_PREFIX) $* install
ifeq ($(AUTO_UPGRADE_DEPS),1)
$(NPM_UPDATE) $*
endif
$(NPM_PREFIX) $* run build $(BUILD_FLAGS)
@echo -e $(call greentext,Done building $*)
@echo

# system install, requires `systemctl restart cockpit.socket`
# runs plugin-install-* for each plugin
.SECONDEXPANSION:
install install-local install-remote: default $$(addprefix plugin-$$@-, $$(PLUGIN_SRCS)) system-files-$$@
ifeq ($(RESTART_COCKPIT), 1)
ifndef DESTDIR
$(SSH) systemctl stop cockpit.socket
$(SSH) systemctl start cockpit.socket
endif
endif

install-remote : SSH=ssh $(REMOTE_TEST_USER)@$(REMOTE_TEST_HOST)

plugin-install-% plugin-install-local-% plugin-install-remote-%:
@echo -e $(call cyantext,Installing $*)
@echo Creating install directory
$(SSH) mkdir -p $(DESTDIR)$(INSTALL_PREFIX)/$*$(INSTALL_SUFFIX)
@echo
@echo Copying files
@test -z "$(SSH)" && \
cp -af $*/dist/* $(DESTDIR)$(INSTALL_PREFIX)/$*$(INSTALL_SUFFIX) || \
rsync -avh $*/dist/* $(REMOTE_TEST_USER)@$(REMOTE_TEST_HOST):$(DESTDIR)$(INSTALL_PREFIX)/$*$(INSTALL_SUFFIX)
@echo -e $(call greentext,Done installing $*)
@echo

plugin-install-% : INSTALL_PREFIX?=/usr/share/cockpit

plugin-install-local-% : INSTALL_PREFIX=$(HOME)/.local/share/cockpit
plugin-install-local-% : INSTALL_SUFFIX=-test

plugin-install-remote-% : INSTALL_PREFIX=$(REMOTE_TEST_HOME)/.local/share/cockpit
plugin-install-remote-% : INSTALL_SUFFIX=-test
plugin-install-remote-% : SSH=ssh $(REMOTE_TEST_USER)@$(REMOTE_TEST_HOST)
plugin-install-remote-% : REMOTE_TEST_HOME=$(shell ssh $(REMOTE_TEST_USER)@$(REMOTE_TEST_HOST) 'echo $$HOME')

system-files-install:
-cp -af system_files/* $(DESTDIR)/

system-files-install-local:
-cp -af system_files/* $(DESTDIR)/

system-files-install-remote:
-rsync -avh system_files/* $(REMOTE_TEST_USER)@$(REMOTE_TEST_HOST):$(DESTDIR)/

clean: FORCE
rm $(dir $(OUTPUTS)) -rf

help:
@echo 'make usage'
@echo
@echo 'building:'
@echo ' make'
@echo
@echo 'installation:'
@echo ' make install [RESTART_COCKPIT=1]'
@echo
@echo 'testing:'
@echo ' make install-local [RESTART_COCKPIT=1]'
@echo 'or'
@echo ' make install-remote [RESTART_COCKPIT=1]'
@echo
@echo 'build cleanup:'
@echo ' make clean'

FORCE:
Loading

0 comments on commit 91a4057

Please sign in to comment.