Compare commits
11 Commits
v1.0
...
e95d9bb552
| Author | SHA1 | Date | |
|---|---|---|---|
| e95d9bb552 | |||
| 754cc29a83 | |||
| bd9ccd33ef | |||
| c0a1b0bbd5 | |||
| cd52871632 | |||
| a2058ce2d6 | |||
| bad5123b02 | |||
| 15fe1b0e9b | |||
| 2951b48680 | |||
| c494e9697c | |||
| 13f18f99ea |
30
.gitea/workflows/build.yml
Normal file
30
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push: {}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: .
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu
|
||||
container:
|
||||
image: node:20
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install tools
|
||||
run: apt update && apt install -y build-essential
|
||||
|
||||
- name: Compile project
|
||||
run: make
|
||||
|
||||
- name: Save build output
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ncsambawatcher
|
||||
path: ./ncsambawatcher
|
||||
49
.gitea/workflows/release.yml
Normal file
49
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,49 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v.*
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: .
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu
|
||||
needs: build
|
||||
container:
|
||||
image: node:20
|
||||
steps:
|
||||
steps:
|
||||
- name: Install build tools
|
||||
run: apt update && apt install -y zip
|
||||
|
||||
- name: Download compiled binary
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ncsambawatcher
|
||||
|
||||
- name: Copy files
|
||||
run: |
|
||||
mkdir build
|
||||
cp ncsambawatcher build/ncsambawatcher
|
||||
cp configs/ncsambawatcher.config.default build/ncsambawatcher.config
|
||||
cp init.sh config/init.sh
|
||||
|
||||
- name: Create release zip
|
||||
run: |
|
||||
cd build
|
||||
zip ../ncsambawatcher.zip ./*
|
||||
|
||||
- name: Publish release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref_name }}
|
||||
release_name: Release ${{ github.ref_name }}
|
||||
files: |
|
||||
ncsambawatcher.zip
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -90,3 +90,5 @@ settings.json
|
||||
watch.c
|
||||
ncwatchfile
|
||||
ncsambawatcher
|
||||
|
||||
obj/
|
||||
33
Makefile
33
Makefile
@@ -1,2 +1,31 @@
|
||||
all:
|
||||
g++ -lrt -std=c++17 src/main.cpp src/usermanager.cpp -o ncsambawatcher
|
||||
# Compiler and flags
|
||||
CXX := g++
|
||||
CXXFLAGS := -std=c++17 -Wall -Wextra -O2
|
||||
|
||||
# Directories
|
||||
SRC_DIR := src
|
||||
OBJ_DIR := obj
|
||||
BUILD_DIR := .
|
||||
TARGET := $(BUILD_DIR)/ncsambawatcher
|
||||
|
||||
# Create list of source and object files
|
||||
SRCS := $(wildcard $(SRC_DIR)/*.cpp)
|
||||
OBJS := $(SRCS:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o)
|
||||
|
||||
# Default target
|
||||
all: $(TARGET)
|
||||
|
||||
# Link object files into final binary
|
||||
$(TARGET): $(OBJS)
|
||||
$(CXX) $(CXXFLAGS) -o $@ $^
|
||||
|
||||
# Compile .cpp to .o into obj/
|
||||
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
|
||||
@mkdir -p $(OBJ_DIR)
|
||||
$(CXX) $(CXXFLAGS) -c $< -o $@
|
||||
|
||||
# Clean build artifacts
|
||||
clean:
|
||||
rm -f $(OBJ_DIR)/*.o $(TARGET)
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
1
configs/ncsambawatcher.config.default
Normal file
1
configs/ncsambawatcher.config.default
Normal file
@@ -0,0 +1 @@
|
||||
NEXTCLOUD_CONTAINER_NAME=nextcloud
|
||||
@@ -1,5 +1,4 @@
|
||||
[global]
|
||||
|
||||
vfs objects = full_audit
|
||||
full_audit:prefix = %u|%I|%m|%S
|
||||
full_audit:success = mkdirat unlinkat renameat write
|
||||
@@ -7,12 +6,43 @@
|
||||
full_audit:facility = local5
|
||||
full_audit:priority = NOTICE
|
||||
|
||||
# Put this line only for the groupfolder's share
|
||||
[Some gorupfolder share]
|
||||
# Example usershare
|
||||
[<username>] #CHANGEME
|
||||
path = /path/to/nextcloud/data/<username>/files/ #CHANGEME
|
||||
valid users = <username> #CHANGEME
|
||||
force user = www-data
|
||||
force group = www-data
|
||||
create mask = 0755
|
||||
force create mode = 0755
|
||||
directory mask = 0755
|
||||
force directory mode = 0755
|
||||
guest ok = no
|
||||
public = no
|
||||
writable = yes
|
||||
browsable = yes
|
||||
hide dot files = no
|
||||
inherit owner = yes
|
||||
hide unreadable = no
|
||||
|
||||
full_audit:prefix = %u|%I|%m|__groupfolders/<group-folders-id>
|
||||
# Example groupfolder share
|
||||
[Sharename]
|
||||
path = /path/to/nextcloud/data/__groupfolders/<groupfolder-id> #CHANGEME
|
||||
valid users = usernames #CHANGEME
|
||||
force user = www-data
|
||||
force group = www-data
|
||||
create mask = 0755
|
||||
force create mode = 0755
|
||||
directory mask = 0755
|
||||
force directory mode = 0755
|
||||
guest ok = no
|
||||
public = no
|
||||
writable = yes
|
||||
browsable = yes
|
||||
hide dot files = no
|
||||
inherit owner = yes
|
||||
hide unreadable = no
|
||||
full_audit:prefix = %u|%I|%m|__groupfolders/<groupfolder-id> #CHANGEME
|
||||
|
||||
# To disable logs for a specific share
|
||||
[A share]
|
||||
|
||||
vfs objects =
|
||||
# To disable logs for a specific share, add this line to that share
|
||||
[Sharename]
|
||||
vfs objects =
|
||||
Reference in New Issue
Block a user