Compare commits
3 Commits
d58a241abb
...
2951b48680
| Author | SHA1 | Date | |
|---|---|---|---|
| 2951b48680 | |||
| c494e9697c | |||
| 13f18f99ea |
58
.gitea/workflows/ci.yml
Normal file
58
.gitea/workflows/ci.yml
Normal file
@@ -0,0 +1,58 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push: {}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install build tools
|
||||
run: sudo apt update && sudo apt install -y build-essential zip
|
||||
|
||||
- name: Compile project
|
||||
run: make
|
||||
|
||||
- name: Save build output
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ncsambawatcher
|
||||
path: ./ncsambawatcher
|
||||
|
||||
release:
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
runs-on: ubuntu-24.04
|
||||
needs: build
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- 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