11 Commits

Author SHA1 Message Date
e95d9bb552 Change ubuntu image to node
All checks were successful
Build / build (push) Successful in 11s
2025-06-02 16:34:25 +02:00
754cc29a83 Use Github's checkout instead of apt git
Some checks failed
Build / build (push) Failing after 3s
2025-06-02 16:30:25 +02:00
bd9ccd33ef Cloning project in CI
Some checks failed
Build / build (push) Failing after 27s
2025-06-02 16:27:29 +02:00
c0a1b0bbd5 Separate the ci jobs
Some checks failed
Build / build (push) Failing after 23s
2025-06-02 16:21:20 +02:00
cd52871632 Remove sudo from ci.yml
Some checks failed
CI / build (push) Failing after 1s
CI / release (push) Has been skipped
2025-06-02 13:55:27 +02:00
a2058ce2d6 Update ci.yml
Some checks failed
CI / build (push) Failing after 1s
CI / release (push) Has been skipped
2025-06-02 13:53:54 +02:00
bad5123b02 Update ci
Some checks failed
CI / build (push) Failing after 21s
CI / release (push) Has been skipped
2025-06-02 13:45:37 +02:00
15fe1b0e9b Update ci
Some checks failed
CI / build (push) Has been cancelled
CI / release (push) Has been cancelled
2025-06-02 13:42:25 +02:00
2951b48680 Added CI
Some checks failed
CI / build (push) Has been cancelled
CI / release (push) Has been cancelled
2025-06-02 13:39:06 +02:00
c494e9697c Modify config files 2025-06-02 13:18:02 +02:00
13f18f99ea Better makefile (AI created) 2025-06-02 13:02:52 +02:00
6 changed files with 152 additions and 11 deletions

View 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

View 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
View File

@@ -90,3 +90,5 @@ settings.json
watch.c
ncwatchfile
ncsambawatcher
obj/

View File

@@ -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

View File

@@ -0,0 +1 @@
NEXTCLOUD_CONTAINER_NAME=nextcloud

View File

@@ -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 =