-
Star
(318)
You must be signed in to star a gist -
Fork
(141)
You must be signed in to fork a gist
-
-
Save markasoftware/f5b2e55a2c2e3abb1f9eefcdf0bfff45 to your computer and use it in GitHub Desktop.
############ If you are using DOCKER all-in-one image, create Dockerfile like: ################ | |
############ FROM openproject/openproject:16 ################ | |
############ COPY ./enterprise_token.rb app/models/enterprise_token.rb ################ | |
############ If you are runing a manual installation: ################ | |
############ REPLACE app/models/enterprise_token.rb in the source code with this file! ################ | |
############ also be sure to RESTART OpenProject after replacing the file. ################ | |
############ If using some other set up (eg docker-compose), read the comments on ################ | |
############ https://gist.github.com/markasoftware/f5b2e55a2c2e3abb1f9eefcdf0bfff45 ################ | |
# OpenProject is an open source project management software. | |
# Copyright (C) the OpenProject GmbH | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License version 3. | |
# | |
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: | |
# Copyright (C) 2006-2013 Jean-Philippe Lang | |
# Copyright (C) 2010-2013 the ChiliProject Team | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License | |
# as published by the Free Software Foundation; either version 2 | |
# of the License, or (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
# GNU General Public License for more details. | |
# | |
# You should have received a copy of the GNU General Public License | |
# along with this program; if not, write to the Free Software | |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
# | |
# See COPYRIGHT and LICENSE files for more details. | |
#++ | |
class EnterpriseToken < ApplicationRecord | |
class << self | |
# On the backend, features are checked only using `allows_to?`, which we can hardcode to return `true`. | |
# On the frontend, however, it instead checks if particular strings are included in the `available_features` | |
# Unfortunately there is no canonical variable with all the features, so we have to hardcode. | |
# Use `rg --pcre2 -INo "(?<=allows_to\?[^:*]:|allowsTo\(')[a-z_]*" | sort -u` to generate this list: | |
TRUE_FEATURES = %i[ | |
allowed_action | |
baseline_comparison | |
board_view | |
conditional_highlighting | |
custom_actions | |
custom_field_hierarchies | |
customize_life_cycle | |
date_alerts | |
define_custom_style | |
edit_attribute_groups | |
forbidden_action | |
gantt_pdf_export | |
internal_comments | |
ldap_groups | |
nextcloud_sso | |
one_drive_sharepoint_file_storage | |
placeholder_users | |
readonly_work_packages | |
scim_api | |
sso_auth_providers | |
team_planner_view | |
time_entry_time_restrictions | |
virus_scanning | |
work_package_query_relation_columns | |
work_package_sharing | |
work_package_subject_generation | |
].freeze | |
# Not all the methods here are ever actually called outside the enterprise_token.rb file itself | |
# in upstream openproject, but I'll include all of them that can be reasonably implemented here, | |
# just in case openproject changes in the future to start using the extra methods. | |
def current | |
self.new | |
end | |
def all_tokens | |
[self.new] | |
end | |
def active_tokens | |
[self.new] | |
end | |
def active_non_trial_tokens | |
[self.new] | |
end | |
def active_trial_tokens | |
[] | |
end | |
def active_trial_token | |
nil | |
end | |
def allows_to?(feature) | |
true | |
end | |
def active? | |
true | |
end | |
def trial_only? | |
false | |
end | |
def available_features | |
TRUE_FEATURES | |
end | |
def non_trialling_features | |
TRUE_FEATURES | |
end | |
def trialling_features | |
[] | |
end | |
def trialling?(feature) | |
false | |
end | |
def hide_banners? | |
true | |
end | |
def show_banners? | |
false | |
end | |
def user_limit | |
nil | |
end | |
def non_trial_user_limit | |
nil | |
end | |
def trial_user_limit | |
nil | |
end | |
def banner_type_for(feature:) | |
nil | |
end | |
def get_user_limit_of(tokens) | |
nil | |
end | |
end | |
FAR_FUTURE_DATE = Date.new(9999, 1, 1) | |
def token_object | |
Class.new do | |
def id | |
"lmao" | |
end | |
def has_feature?(feature) | |
true | |
end | |
def will_expire? | |
false | |
end | |
def mail | |
"[email protected]" | |
end | |
def subscriber | |
"markasoftware-free-enterprise-mode" | |
end | |
def company | |
"markasoftware" | |
end | |
def domain | |
"markasoftware.com" | |
end | |
def issued_at | |
Time.zone.today - 1 | |
end | |
def starts_at | |
Time.zone.today - 1 | |
end | |
def expires_at | |
Time.zone.today + 1 | |
end | |
def reprieve_days | |
nil | |
end | |
def reprieve_days_left | |
69 | |
end | |
def restrictions | |
nil | |
end | |
def available_features | |
EnterpriseToken.TRUE_FEATURES | |
end | |
def plan | |
"markasoftware_free_enterprise_mode" | |
end | |
def features | |
EnterpriseToken.TRUE_FEATURES | |
end | |
def version | |
69 | |
end | |
def started? | |
true | |
end | |
def trial? | |
false | |
end | |
def active? | |
true | |
end | |
end.new | |
end | |
def id | |
"lmao" | |
end | |
def encoded_token | |
"oaml" | |
end | |
def will_expire? | |
false | |
end | |
def mail | |
"[email protected]" | |
end | |
def subscriber | |
"markasoftware-free-enterprise-mode" | |
end | |
def company | |
"markasoftware" | |
end | |
def domain | |
"markasoftware.com" | |
end | |
def issued_at | |
Time.zone.today - 1 | |
end | |
def starts_at | |
Time.zone.today - 1 | |
end | |
def expires_at | |
Time.zone.today + 1 | |
end | |
def reprieve_days | |
nil | |
end | |
def reprieve_days_left | |
69 | |
end | |
def restrictions | |
nil | |
end | |
def available_features | |
EnterpriseToken.TRUE_FEATURES | |
end | |
def plan | |
"markasoftware_free_enterprise_mode" | |
end | |
def features | |
EnterpriseToken.TRUE_FEATURES | |
end | |
def version | |
69 | |
end | |
def started? | |
true | |
end | |
def trial? | |
false | |
end | |
def active? | |
true | |
end | |
def allows_to?(action) | |
true | |
end | |
def expiring_soon? | |
false | |
end | |
def in_grace_period? | |
false | |
end | |
def expired?(reprieve: true) | |
false | |
end | |
def statuses | |
[] | |
end | |
def invalid_domain? | |
false | |
end | |
def unlimited_users? | |
true | |
end | |
def max_active_users | |
nil | |
end | |
def sort_key | |
[FAR_FUTURE_DATE, FAR_FUTURE_DATE] | |
end | |
def days_left | |
69 | |
end | |
end |
Did someone manage to upgrade the Postgresql Database from 13 to 17 as recommended when upgrading to 16.0? I tried their Guide but it aborts with
Current and new postgres version are identical. Aborting.
@supaeasy @CC1119 The link sends you to the old version stable/15. The person from this post (https://community.openproject.org/topics/19208) mentioned: "This message comes from the "postgres-db-upgrade" script." If it is this resource "https://github.com/opf/openproject/blob/dev/docker/prod/postgres-db-upgrade" than it shouldn't work because there it is still set to NEW_PGVERSION="13".
Same shouldn't work for the docker-compose because there and the Docker Hub images 16.0.0 and 16.0.0-slim are still ENV PGVERSION=13 and ENV NEXT_PGVERSION=15.
Change the values manually and try it again.
Thank you for pointing this out! I created a pull request.
@supaeasy Good. Me too because there are more places to fix the versions for Postgres and OpenProject:
opf/openproject#19011
opf/openproject-docker-compose#112
Works great on OpenProject 16.0 via "Compose-based installation". Thanks!
Hi guys,
how to do this for an openproject that's not installed with docker ? meaning installed directly on centos machine
Hi guys,
how to do this for an openproject that's not installed with docker ? meaning installed directly on centos machine
just replace the file directly
thnx, my stuped self didn't read the file :p, i just did it thnx
Openprojects GitHub Management as well as their support is a disaster. Didnt manage to update my database yet and nobody reacts to anything if you don't REALLY annoy people directly as I did about https://gist.github.com/markasoftware/f5b2e55a2c2e3abb1f9eefcdf0bfff45?permalink_comment_id=5591479#gistcomment-5591479
i agree, for exemple i'm stuck with the upgrade to new version, each time i try it following their docs i get the same error with ruby on rails about data base migration error
Hi guys,
how to do this for an openproject that's not installed with docker ? meaning installed directly on centos machinejust replace the file directly
yes just cut copy and paste
Openprojects GitHub Management as well as their support is a disaster. Didnt manage to update my database yet and nobody reacts to anything if you don't REALLY annoy people directly as I did about https://gist.github.com/markasoftware/f5b2e55a2c2e3abb1f9eefcdf0bfff45?permalink_comment_id=5591479#gistcomment-5591479
Support is complimentary ,they will reply at will
i agree, for exemple i'm stuck with the upgrade to new version, each time i try it following their docs i get the same error with ruby on rails about data base migration error
Yes I gave up on that as well. But I just did a backup via in-App function (Backup Token), got a new docker stack running with Postgres 17 and Openproject 16 and restored the database. Not the smoothest experience because it didnt quite work as documented (surprise!) but managable (thank you, ChatGPT). Everything has been restored including all settings, custom types- everything. I am very happy with this solution and the whole upgrade path as documented seems completely unecessary to me now.
They made some changes for the All-In-One solution (opf/openproject#19011 (comment), opf/openproject#19210).
And I tried to get the other changes merged for the docker-compose one last time (opf/openproject#19011 (comment)).
If interests anyone, upgrade from 15 to 16 was seamless while using Helm Chart and this gist file works as expected
If interests anyone, upgrade from 15 to 16 was seamless while using Helm Chart and this gist file works as expected
But you don't get the features of the tier Enterpise Professional? Only Enterprise Basic?
If interests anyone, upgrade from 15 to 16 was seamless while using Helm Chart and this gist file works as expected
But you don't get the features of the tier Enterpise Professional? Only Enterprise Basic?
Yes those features are working too, my config:
For helm installations
- Add configmap with this file content in it:
apiVersion: v1 kind: ConfigMap metadata: name: enterprise-token-config namespace: openproject data: enterprise_token.rb: | <file content here>
- Add helm values:
extraVolumes: - name: enterprise-token-volume configMap: name: enterprise-token-config extraVolumeMounts: - name: enterprise-token-volume mountPath: /app/app/models/enterprise_token.rb subPath: enterprise_token.rb readOnly: true
@JokerGermany my understanding was the above code will give full functional rights ,Is that not your understanding
@scalenow
https://www.openproject.org/docs/release-notes/16-0-0/#important-updates
The Enterprise plans (Basic, Professional, Premium, and Corporate) have been updated. Each plan now includes a specific set of Enterprise add-ons. Support levels and pricing remain unchanged with version 16.0.
Current Enterprise customers retain their existing plans with access to all Enterprise add-ons available at that time. No features are removed. > From this version onward, new Enterprise add-ons may be included only in higher-tier plans. For example, the new Internal comments feature is part of the Professional plan.
@JokerGermany as far as I know, this gist enables all features. Please install and test for yourself.
@JokerGermany @markasoftware I confirm that all enterprise add-ons functions are available. Checked in the latest version 16.1.0.
@positiveque thanks
@positiveque Is working on docker?
@positiveque Is working on docker?
Yes, sure. I use it in docker-compose.yml like this:
volumes:
- "/docker/openproject/enterprise/enterprise_token.rb:/app/app/models/enterprise_token.rb"
@positiveque with version openproject-dev?
@positiveque with version openproject-dev?
I use image for production "openproject/openproject:16-slim" and don't know about openproject-dev.
Its not working on the 16.1.1
Its not working on the 16.1.1
I just checked and it works on the 16.1.1. Can you give more details?
Anyone tried on OpenProject 16.1.1?
Every enterprise features is working but baseline comparison in work packages? any idea?
Like the options are available but not working...
Hey @positiveque , thanks for your support. It was my mistake, I had upgraded OpenProject from version 15 to 16 and tried using the token, but it didn’t work. I was also running PostgreSQL 13 at the time. I’ve now done a fresh setup, and everything is working fine.
I just learned I am not alone: https://community.openproject.org/topics/19208