Changeset cb01666 in Klonkt
- Timestamp:
- 06/23/2026 02:54:36 PM (3 months ago)
- Branches:
- main
- Children:
- 9b851e7
- Parents:
- 8f2f97c
- Files:
-
- 1 added
- 8 edited
-
.env.example (modified) (1 diff)
-
src/config/features.js (added)
-
src/middleware/render.js (modified) (2 diffs)
-
src/middleware/site.js (modified) (2 diffs)
-
src/routes/posts.js (modified) (3 diffs)
-
src/server.js (modified) (4 diffs)
-
src/views/pages/admin-site-edit.ejs (modified) (1 diff)
-
src/views/pages/admin.ejs (modified) (2 diffs)
-
src/views/partials/profile-header.ejs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
.env.example
r8f2f97c rcb01666 35 35 SMTP_PASS= 36 36 SMTP_FROM= 37 38 # ── Lite-modus (optioneel) ───────────────────────────────────────── 39 # Zet op "off" om de hele audio-feature uit te schakelen (geen eigen muziek- 40 # hosting/speler, geen ffmpeg nodig). Klonkt draait dan als lichte blog/foto/ 41 # EPK-site, ook op een omgeving zonder ffmpeg. Hub en Cirkels blijven werken. 42 # Externe embeds (YouTube/SoundCloud/Spotify) blijven ook werken. 43 KLONKT_AUDIO=on -
src/middleware/render.js
r8f2f97c rcb01666 20 20 import { isPremium as isPremiumInstance, premiumEnabled, premiumUnlocked } from '../services/PatreonService.js'; 21 21 import { unreadCount as notifUnreadCount } from '../services/NotificationService.js'; 22 import { audioEnabled as audioFeatureEnabled } from '../config/features.js'; 22 23 import { PLATFORMS as PLATFORMS_CATALOG } from '../services/PlatformIcons.js'; 23 24 import { t as i18nT, resolveLang, SUPPORTED as LANGS, LANG_NAMES } from '../services/i18n.js'; … … 111 112 siteOwnerAvatar, 112 113 site: _site, 114 audioEnabled: audioFeatureEnabled(), 113 115 audioTracks: data.audioTracks || res.locals.audioTracks || [], 114 116 siteUrlBase: res.locals.siteUrlBase || '', -
src/middleware/site.js
r8f2f97c rcb01666 12 12 import { getTenancy } from '../services/SettingsService.js'; 13 13 import { audioUrl } from '../services/AudioStreamService.js'; 14 import { audioEnabled } from '../config/features.js'; 14 15 15 16 /** … … 70 71 */ 71 72 export function loadAudioTracks(req, res, next) { 73 if (!audioEnabled()) { res.locals.audioTracks = []; return next(); } // lite-modus 72 74 const site = res.locals.site; 73 75 if (!site || site.enable_audio_player === 0) { -
src/routes/posts.js
r8f2f97c rcb01666 16 16 import AudioEmbedService from '../services/AudioEmbedService.js'; 17 17 import PlaylistService from '../services/PlaylistService.js'; 18 import { audioEnabled } from '../config/features.js'; 18 19 import { audioUrl } from '../services/AudioStreamService.js'; 19 20 import { toWebp } from '../services/ImageWebpService.js'; … … 538 539 // stored HTML → autoembed → [[track]]/[[album]]/[[playlist]] → response 539 540 let html = post.content || ''; 541 if (audioEnabled()) { 540 542 if (site.enable_audio_player !== 0) { 541 543 html = AudioEmbedService.autoembed(html); … … 622 624 } 623 625 } 626 } else { 627 // LITE-modus (KLONKT_AUDIO=off): geen eigen audio (geen ffmpeg/stream-route). 628 // Externe embeds (YouTube/SoundCloud/Spotify) blijven wel; de eigen-audio- 629 // shortcodes ([[track]]/[[album]]/[[playlist]]) verwijderen we netjes. 630 html = AudioEmbedService.autoembed(html); 631 html = AudioEmbedService.embedMediaShortcodes(html); 632 html = AudioEmbedService.embedExternalLinkShortcodes(html); 633 html = html.replace(/\[\[(track|album|playlist):[^\]]+\]\]/gi, ''); 634 } 624 635 post.content_html = html; 625 636 -
src/server.js
r8f2f97c rcb01666 22 22 import { isViewer } from './middleware/auth.js'; 23 23 import { renderPage } from './middleware/render.js'; 24 import { audioEnabled } from './config/features.js'; 24 25 import authRoutes from './routes/auth.js'; 25 26 import accountRoutes from './routes/account.js'; … … 251 252 app.use('/account', accountRoutes); 252 253 app.use('/notifications', notificationsRoutes); 253 app.use('/admin/audio', adminAudioRoutes); 254 app.use('/admin/playlists', adminPlaylistsRoutes); 254 if (audioEnabled()) { 255 app.use('/admin/audio', adminAudioRoutes); 256 app.use('/admin/playlists', adminPlaylistsRoutes); 257 } 255 258 app.use('/admin/sites', adminSitesRoutes); 256 259 app.use('/admin/users', adminUsersRoutes); … … 266 269 app.use('/admin/epk', adminEpkRoutes); 267 270 app.use('/admin', adminRoutes); 268 app.use('/audio', audioRoutes);271 if (audioEnabled()) app.use('/audio', audioRoutes); 269 272 app.use('/search', searchRoutes); 270 273 app.use('/comments', commentsRoutes); … … 280 283 app.use('/', epkRoutes); // /pers perskit (premium; niet-premium: next() -> 404) 281 284 app.use('/', newsletterRoutes); // /nieuwsbrief in/uitschrijven (premium; niet-premium: next()) 282 app.use('/', downloadRoutes); // /downloads + /download/:id download-voor-email (premium)285 if (audioEnabled()) app.use('/', downloadRoutes); // /downloads + /download/:id (audio; lite: uit) 283 286 app.use('/', linkbioRoutes); // /links link-in-bio + klikstats (premium) 284 app.use('/', embedRoutes); // /embed inbedbare audiospeler (premium)287 if (audioEnabled()) app.use('/', embedRoutes); // /embed inbedbare audiospeler (audio; lite: uit) 285 288 app.use('/', showsRoutes); // /shows agenda + notify-me (premium) 286 289 app.use('/', changelogRoutes); // /changelog publieke release-/wijzigingen-pagina -
src/views/pages/admin-site-edit.ejs
r8f2f97c rcb01666 159 159 </select> 160 160 </label> 161 <% if (typeof audioEnabled === 'undefined' || audioEnabled) { %> 161 162 <label class="cb"> 162 163 <input type="checkbox" name="enable_audio_player" value="1" <%= site.enable_audio_player ? 'checked' : '' %>> 163 164 <span><%= t('asite.enable_audio') %></span> 164 165 </label> 166 <% } %> 165 167 </fieldset> 166 168 -
src/views/pages/admin.ejs
r8f2f97c rcb01666 11 11 <a href="/admin/sites" class="btn"><%= t('admin.b_sites') %></a> 12 12 <a href="/admin/users" class="btn"><%= t('admin.b_users') %></a> 13 <% if (typeof audioEnabled === 'undefined' || audioEnabled) { %> 13 14 <a href="/admin/audio" class="btn"><%= t('admin.b_audio') %></a> 14 15 <a href="/admin/playlists" class="btn"><%= t('admin.b_playlists') %></a> 16 <% } %> 15 17 <a href="/admin/comments" class="btn"><%= t('admin.b_comments') %></a> 16 18 <% if (primarySite) { %><a href="/admin/seo" class="btn"><%= t('admin.b_seo') %></a><% } %> … … 18 20 <% } else { %> 19 21 <a href="/posts/new" class="btn"><%= t('admin.b_newpost') %></a> 22 <% if (typeof audioEnabled === 'undefined' || audioEnabled) { %> 20 23 <a href="/admin/audio" class="btn"><%= t('admin.b_audio') %></a> 24 <% } %> 21 25 <a href="/admin/comments" class="btn"><%= t('admin.b_comments') %></a> 22 26 <% if (primarySite) { %> -
src/views/partials/profile-header.ejs
r8f2f97c rcb01666 41 41 <% } else if (typeof siteOwnerAvatar !== 'undefined' && siteOwnerAvatar) { %> 42 42 <img src="<%= siteOwnerAvatar %>" alt=""> 43 <% } else if (site.enable_audio_player ) { %>43 <% } else if (site.enable_audio_player && (typeof audioEnabled === 'undefined' || audioEnabled)) { %> 44 44 <span class="profile-photo-fallback profile-photo-fallback--music" aria-hidden="true"> 45 45 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)