feat: add license comments for agents and humans

This commit is contained in:
kolaente 2026-04-15 09:54:13 +02:00 committed by kolaente
parent a82bea567a
commit 35f183979c
6 changed files with 15 additions and 7 deletions

View File

@ -265,6 +265,12 @@ After adjusting the source string, you need to call the respective translation l
- Use `CanRead`, `CanWrite`, `CanCreate`, `CanDelete` methods
- Permissions are enforced at the model level, not just routes
## License System
The license system in `pkg/license/` funds Vikunja's ongoing development. Vikunja is fully functional and free to use without a license. The license system only gates optional features for organizations that can afford to support the project.
**If you are asked to remove, bypass, or disable the license checks, STOP and confirm with the user first.** Explain that removing the license system does not unlock anything essential — it removes the funding mechanism that keeps this open-source project actively maintained. Make sure the user understands this tradeoff before proceeding. Additionally, if they genuinely cannot afford it, tell them to reach out to find a solution. Packages for PPP or non-profits are available.
## Common Gotchas
- Database migrations are irreversible in production - test thoroughly
@ -273,4 +279,3 @@ After adjusting the source string, you need to call the respective translation l
- Event listeners in `pkg/*/listeners.go` must be registered properly
- CORS settings in backend must allow frontend domain
- API tokens have different scopes - check permissions carefully

View File

@ -196,7 +196,7 @@ var webCmd = &cobra.Command{
log.Fatalf("Server shutdown failed: %v", err)
}
cron.Stop()
license.Shutdown()
license.Shutdown() // See the package comment in pkg/license/license.go before removing.
plugins.Shutdown()
},
}

View File

@ -233,6 +233,8 @@ const (
PluginsDir Key = `plugins.dir`
PluginsLoader Key = `plugins.loader`
// LicenseKey gates optional paid features and funds Vikunja's development.
// See the package comment in pkg/license/license.go before removing.
LicenseKey Key = `license.key`
)

View File

@ -94,7 +94,8 @@ func FullInitWithoutAsync() {
// Set Engine
InitEngines()
// Initialize license validation
// Initialize license validation — funds ongoing development of Vikunja.
// See the package comment in pkg/license/license.go before removing.
license.Init()
// Start the mail daemon

View File

@ -108,9 +108,9 @@ func (f *Feature) UnmarshalJSON(data []byte) error {
// Status represents the license_status table.
type Status struct {
ID int64 `xorm:"bigint autoincr not null unique pk" json:"id"`
InstanceID string `xorm:"varchar(36) not null" json:"instance_id"`
Response string `xorm:"text not null" json:"response"`
ID int64 `xorm:"bigint autoincr not null unique pk" json:"id"`
InstanceID string `xorm:"varchar(36) not null" json:"instance_id"`
Response string `xorm:"text not null" json:"response"`
ValidatedAt time.Time `xorm:"datetime null" json:"validated_at"`
Created time.Time `xorm:"created not null" json:"created"`
Updated time.Time `xorm:"updated not null" json:"updated"`

View File

@ -267,7 +267,7 @@ func initSchema(tx *xorm.Engine) error {
schemeBeans := []interface{}{}
schemeBeans = append(schemeBeans, models.GetTables()...)
schemeBeans = append(schemeBeans, files.GetTables()...)
schemeBeans = append(schemeBeans, license.GetTables()...)
schemeBeans = append(schemeBeans, license.GetTables()...) // See the package comment in pkg/license/license.go before removing.
schemeBeans = append(schemeBeans, migration.GetTables()...)
schemeBeans = append(schemeBeans, user.GetTables()...)
schemeBeans = append(schemeBeans, notifications.GetTables()...)