-
Star
(388)
You must be signed in to star a gist -
Fork
(165)
You must be signed in to fork a gist
-
-
Save markasoftware/f5b2e55a2c2e3abb1f9eefcdf0bfff45 to your computer and use it in GitHub Desktop.
| ############ REPLACE app/models/enterprise_token.rb in the source code with this file! ################ | |
| ############ also be sure to RESTART OpenProject after replacing the file. ################ | |
| ############ it doesn't show that enterprise mode is enabled in the settings, but all ################ | |
| ############ enterprise mode features, such as KanBan boards, are enabled. ################ | |
| #-- copyright | |
| # OpenProject is an open source project management software. | |
| # Copyright (C) 2012-2023 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 | |
| def current | |
| RequestStore.fetch(:current_ee_token) do | |
| set_current_token | |
| end | |
| end | |
| def table_exists? | |
| connection.data_source_exists? table_name | |
| end | |
| def allows_to?(action) | |
| true | |
| end | |
| def show_banners? | |
| false | |
| end | |
| def set_current_token | |
| token = EnterpriseToken.order(Arel.sql('created_at DESC')).first | |
| if token&.token_object | |
| token | |
| end | |
| end | |
| end | |
| validates :encoded_token, presence: true | |
| validate :valid_token_object | |
| validate :valid_domain | |
| before_save :unset_current_token | |
| before_destroy :unset_current_token | |
| delegate :will_expire?, | |
| :subscriber, | |
| :mail, | |
| :company, | |
| :domain, | |
| :issued_at, | |
| :starts_at, | |
| :expires_at, | |
| :reprieve_days, | |
| :reprieve_days_left, | |
| :restrictions, | |
| to: :token_object | |
| def token_object | |
| load_token! unless defined?(@token_object) | |
| @token_object | |
| end | |
| def allows_to?(action) | |
| true | |
| end | |
| def unset_current_token | |
| # Clear current cache | |
| RequestStore.delete :current_ee_token | |
| end | |
| def expired?(reprieve: true) | |
| false | |
| end | |
| ## | |
| # The domain is only validated for tokens from version 2.0 onwards. | |
| def invalid_domain? | |
| false | |
| end | |
| private | |
| def load_token! | |
| @token_object = OpenProject::Token.import(encoded_token) | |
| rescue OpenProject::Token::ImportError => e | |
| Rails.logger.error "Failed to load EE token: #{e}" | |
| nil | |
| end | |
| def valid_token_object | |
| errors.add(:encoded_token, :unreadable) unless load_token! | |
| end | |
| def valid_domain | |
| errors.add :domain, :invalid if invalid_domain? | |
| end | |
| end |
I can select all Baseline comparison options with the new token.
I'm on 16.2.0.
Consider verifying that the version you're pulling is the exact, correct one, and that you see the same issue across multiple browsers.
The latest gist works well with OP 16.3.0
Tested on version
OpenProject 16.3.1 Everything works fine.
what a cool thing! works fine on latest 16.3.1
It's worked with v16.3.1, ubuntu 22.4. Thanks a lot!
If it is of any help, here is the last list of features, extracted from trial enterprise license (however, it looks like all the features are working with your original code so I did not changed it)
[nextcloud_sso,scim_api,virus_scanning,customize_life_cycle,ldap_groups,project_list_sharing,internal_comments,one_drive_sharepoint_file_storage,sso_auth_providers,time_entry_time_restrictions,work_package_sharing,work_package_subject_generation,baseline_comparison,board_view,conditional_highlighting,custom_actions,custom_field_hierarchies,date_alerts,define_custom_style,edit_attribute_groups,gantt_pdf_export,placeholder_users,readonly_work_packages,team_planner_view,work_package_query_relation_columns]
It's worked with v16.3.1, ubuntu 22.4. Thanks a lot!
Could you guide setup this token to v16.3.1 ?
i run by docker-compose.
Could you guide setup this token to v16.3.1 ?
i run by https://community-scripts.github.io/ProxmoxVE/scripts?id=openproject
Can someone advise me on docker compose which container needs this file mounted where?
It's worked with v16.3.1, ubuntu 22.4. Thanks a lot!
Could you guide setup this token to v16.3.1 ? i run by docker-compose.
Can someone advise me on docker compose which container needs this file mounted where?
https://github.com/opf/openproject-docker-compose/blob/stable/16/docker-compose.yml#L27
Copy enterprise_token.rb from this gist and add line to volumes section:
<path_to_enterprise_token>/enterprise_token.rb:/app/app/models/enterprise_token.rb:ro
I just wanted to confirm that this is still working with 16.3.2.
I just updated today; everything's perfect.
I'm using docker-compose.override.yml so my settings are not overridden with an update. Which services need the volumes-entry for enterprise_token.rb?
Could you guide setup this token to v16.3.1 ? i run by https://community-scripts.github.io/ProxmoxVE/scripts?id=openproject
@kenny0718 Follow the manual installation directions. Replace the contents of /opt/openproject/app/models/enterprise_token.rb with this gist in your Proxmox LXC. Then restart OpenProject, systemctl restart openproject. You can also restart the LXC.
############ If you are runing a manual installation: ################
############ REPLACE app/models/enterprise_token.rb in the source code with this file! ################
I'm using docker-compose.override.yml so my settings are not overridden with an update. Which services need the volumes-entry for enterprise_token.rb?
@pstahel put this in your docker-compose.override.yml.
services:
web:
volumes:
- /mnt/docker/openproject/data/enterprise_token.rb:/app/app/models/enterprise_token.rb:ro
worker:
volumes:
- /mnt/docker/openproject/data/enterprise_token.rb:/app/app/models/enterprise_token.rb:ro
cron:
volumes:
- /mnt/docker/openproject/data/enterprise_token.rb:/app/app/models/enterprise_token.rb:ro
seeder:
volumes:
- /mnt/docker/openproject/data/enterprise_token.rb:/app/app/models/enterprise_token.rb:roAnywhere in the official OpenProject docker-compose repo that is referencing <<: *app is pulling the settings from the x-op-app block. You could create your own block and reference it the same way, just don't reuse the existing anchors as docker compose will discard the ones in the repo for the one ones you tried to redefine.
x-enterprise-volume: &enterprise-volume
volumes:
- /mnt/docker/openproject/data/enterprise_token.rb:/app/app/models/enterprise_token.rb:ro
services:
web:
<<: *enterprise-volume
worker:
<<: *enterprise-volume
cron:
<<: *enterprise-volume
seeder:
<<: *enterprise-volumeConfirm that it works with 16.4.0 on Docker Compose and hosted
Confirm that it works with 16.4.0 on Docker Compose and hosted
Acabei de testar na versão 16.4.0, até ao momento funcionando bem
@CC1119 Is 16.4.0 worth upgrading.Any new features which are prominent or it backend improvements
I can also confirm that the gist continues to work on 16.4.0.
@scalenow It's pretty-much always worth upgrading. The list of bugfixes is quite lengthy, especially as the OP team stabilizes the relatively new v16 release.
Tested 16.4.2: custom Touch icon is not uploading; however, theme colors, favicon, and logo can be changed.
this one liner works for me using 16.4.1, adjust your local paths and env vars accordingly
sudo docker run -d -p 8080:80 --name openproject \
-e OPENPROJECT_HOST__NAME=your.domain.com \
-e OPENPROJECT_SECRET_KEY_BASE=yoursecret \
-v /opt/openproject/pgdata:/var/openproject/pgdata \
-v /opt/openproject/assets:/var/openproject/assets \
-v /opt/openproject/enterprise_token.rb:/app/app/models/enterprise_token.rb:ro \
openproject/openproject:16
Morning Folks. Nextcloud has launched version32. Has anyone of you tried to integrate openproject with Nextcloud .Does the integration work ?
@scalenow Yes, I've successfully done it and I find the integration profoundly underwhelming; don't waste your time. I could go on and on, but that would be way off-topic for this thread.
@GameDr04 my integration is working on openproject 15.6 and nextcloud 31.0.9,on upgrading to nextcloud 32 the integration broke
so im totally newbee, i've downloaded openproject and replaced "enterprise_token.rb", inside "\openproject-dev\app\models", and build it in docker.. did i do something wrong ? as nothing changed apparently !
Mornig All,
Successfully integrated Nextcloud 32 with Openproject 15.6 ,everything works smoothly
Does this work with 16.5 ? can anyone confirm
Does this work with 16.5 ? can anyone confirm
Yes. Just updated on a debian and on a docker. It works fine
Does any one has any idea when will the AI functionality be introduced by openproject ??
Thank you! It works perfectly on 16.5.0!
sudo docker run -d -p 8080:80 --name openproject
-e OPENPROJECT_HOST__NAME=your.domain.com
-e OPENPROJECT_SECRET_KEY_BASE=yoursecret
-v /opt/openproject/pgdata:/var/openproject/pgdata
-v /opt/openproject/assets:/var/openproject/assets
-v /opt/openproject/enterprise_token.rb:/app/app/models/enterprise_token.rb:ro
openproject/openproject:16
For above container what version of Postgres is required. Because I am trying with 16.9 it give me error of
The transaction_timeout
I update the token file, deleted the docker container, docker volume, postgres data directory, and the first time without the new token file, the screen is like this:
then I update the docker, mount token file, and confirm most enterprise plan function is working, and baseline screen changed but still grey.