Compare commits

..

6 Commits

8 changed files with 86 additions and 14 deletions

1
.github/FUNDING.yml vendored
View File

@@ -1,2 +1,3 @@
---
github: [error311] github: [error311]
ko_fi: error311 ko_fi: error311

View File

@@ -1,5 +1,5 @@
--- ---
name: Sync Changelog to Docker Repo name: Bump version and sync Changelog to Docker Repo
on: on:
push: push:
@@ -10,35 +10,69 @@ permissions:
contents: write contents: write
jobs: jobs:
sync: bump_and_sync:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout FileRise - uses: actions/checkout@v4
uses: actions/checkout@v4
with: - name: Extract version from commit message
path: file-rise id: ver
run: |
MSG="${{ github.event.head_commit.message }}"
if [[ "$MSG" =~ release\((v[0-9]+\.[0-9]+\.[0-9]+)\) ]]; then
echo "version=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
echo "Found version: ${BASH_REMATCH[1]}"
else
echo "version=" >> $GITHUB_OUTPUT
echo "No release(vX.Y.Z) tag in commit message; skipping bump."
fi
- name: Update public/js/version.js
if: steps.ver.outputs.version != ''
run: |
cat > public/js/version.js <<'EOF'
// generated by CI
window.APP_VERSION = '${{ steps.ver.outputs.version }}';
EOF
- name: Commit version.js (if changed)
if: steps.ver.outputs.version != ''
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add public/js/version.js
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "chore: set APP_VERSION to ${{ steps.ver.outputs.version }}"
git push
fi
- name: Checkout filerise-docker - name: Checkout filerise-docker
if: steps.ver.outputs.version != ''
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
repository: error311/filerise-docker repository: error311/filerise-docker
token: ${{ secrets.PAT_TOKEN }} token: ${{ secrets.PAT_TOKEN }}
path: docker-repo path: docker-repo
- name: Copy CHANGELOG.md - name: Copy CHANGELOG.md and write VERSION
if: steps.ver.outputs.version != ''
run: | run: |
cp file-rise/CHANGELOG.md docker-repo/CHANGELOG.md cp CHANGELOG.md docker-repo/CHANGELOG.md
echo "${{ steps.ver.outputs.version }}" > docker-repo/VERSION
- name: Commit & push - name: Commit & push to docker repo
if: steps.ver.outputs.version != ''
working-directory: docker-repo working-directory: docker-repo
run: | run: |
git config user.name "github-actions[bot]" git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com" git config user.email "github-actions[bot]@users.noreply.github.com"
git add CHANGELOG.md git add CHANGELOG.md VERSION
if git diff --cached --quiet; then if git diff --cached --quiet; then
echo "No changes to commit" echo "No changes to commit"
else else
git commit -m "chore: sync CHANGELOG.md from FileRise" git commit -m "chore: sync CHANGELOG.md and VERSION (${{ steps.ver.outputs.version }}) from FileRise"
git push origin main git push origin main
fi fi

View File

@@ -1,5 +1,33 @@
# Changelog # Changelog
## Changes 10/24/2025 (v1.6.5)
release(v1.6.5): fix PHP warning and upload-flag check in capabilities.php
- Fix undefined variable: use $disableUpload consistently
- Harden flag read: (bool)($perms['disableUpload'] ?? false)
- Prevents warning and ensures Upload capability is computed correctly
---
## Changes 10/24/2025 (v1.6.4)
release(v1.6.4): runtime version injection + CI bump/sync; caching tweaks
- Add public/js/version.js (default "dev") and load it before main.js.
- adminPanel.js: replace hard-coded string with `window.APP_VERSION || "dev"`.
- public/.htaccess: add no-cache for js/version.js
- GitHub Actions: replace sync job with “Bump version and sync Changelog to Docker Repo”.
- Parse commit msg `release(vX.Y.Z)` -> set step output `version`.
- Write `public/js/version.js` with `window.APP_VERSION = '<version>'`.
- Commit/push version.js if changed.
- Mirror CHANGELOG.md to filerise-docker and write a VERSION file with `<version>`.
- Guard all steps with `if: steps.ver.outputs.version != ''` to no-op on non-release commits.
This wires the UI version label to CI, keeps dev builds showing “dev”, and feeds the Docker repo with CHANGELOG + VERSION for builds.
---
## Changes 10/24/2025 (v1.6.3) ## Changes 10/24/2025 (v1.6.3)
release(v1.6.3): drag/drop card persistence, admin UX fixes, and docs (closes #58) release(v1.6.3): drag/drop card persistence, admin UX fixes, and docs (closes #58)

View File

@@ -50,6 +50,12 @@ RewriteEngine On
<FilesMatch "\.(js|css)$"> <FilesMatch "\.(js|css)$">
Header set Cache-Control "public, max-age=3600, must-revalidate" Header set Cache-Control "public, max-age=3600, must-revalidate"
</FilesMatch> </FilesMatch>
# version.js should always revalidate (it changes on releases)
<FilesMatch "^js/version\.js$">
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "0"
</FilesMatch>
</IfModule> </IfModule>
# ----------------------------- # -----------------------------

View File

@@ -153,7 +153,7 @@ if ($folder !== 'root') {
$perms = loadPermsFor($username); $perms = loadPermsFor($username);
$isAdmin = ACL::isAdmin($perms); $isAdmin = ACL::isAdmin($perms);
$readOnly = !empty($perms['readOnly']); $readOnly = !empty($perms['readOnly']);
$disableUp = !empty($perms['disableUpload']); $disableUpload = (bool)($perms['disableUpload'] ?? false);
$inScope = inUserFolderScope($folder, $username, $perms, $isAdmin); $inScope = inUserFolderScope($folder, $username, $perms, $isAdmin);
// --- ACL base abilities --- // --- ACL base abilities ---
@@ -213,7 +213,7 @@ echo json_encode([
'flags' => [ 'flags' => [
//'folderOnly' => !empty($perms['folderOnly']) || !empty($perms['userFolderOnly']) || !empty($perms['UserFolderOnly']), //'folderOnly' => !empty($perms['folderOnly']) || !empty($perms['userFolderOnly']) || !empty($perms['UserFolderOnly']),
'readOnly' => $readOnly, 'readOnly' => $readOnly,
'disableUpload' => $disableUp, 'disableUpload' => $disableUpload,
], ],
'owner' => $owner, 'owner' => $owner,

View File

@@ -563,6 +563,7 @@
</div> </div>
</div> </div>
</div> </div>
<script src="js/version.js"></script>
<script type="module" src="js/main.js"></script> <script type="module" src="js/main.js"></script>
</body> </body>

View File

@@ -4,7 +4,7 @@ import { loadAdminConfigFunc } from './auth.js';
import { showToast, toggleVisibility, attachEnterKeyListener } from './domUtils.js'; import { showToast, toggleVisibility, attachEnterKeyListener } from './domUtils.js';
import { sendRequest } from './networkUtils.js'; import { sendRequest } from './networkUtils.js';
const version = "v1.6.3"; const version = window.APP_VERSION || "dev";
const adminTitle = `${t("admin_panel")} <small style="font-size:12px;color:gray;">${version}</small>`; const adminTitle = `${t("admin_panel")} <small style="font-size:12px;color:gray;">${version}</small>`;

2
public/js/version.js Normal file
View File

@@ -0,0 +1,2 @@
// generated by CI
window.APP_VERSION = 'v1.6.5';