Skip to content

Instantly share code, notes, and snippets.

@markasoftware
Last active May 21, 2025 21:35
Show Gist options
  • Save markasoftware/f5b2e55a2c2e3abb1f9eefcdf0bfff45 to your computer and use it in GitHub Desktop.
Save markasoftware/f5b2e55a2c2e3abb1f9eefcdf0bfff45 to your computer and use it in GitHub Desktop.
OpenProject Enterprise mode for free
############ 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
def current
self.new
end
def allows_to?(feature)
true
end
def active?
true
end
def hide_banners?
true
end
def show_banners?
false
end
def banner_type_for(feature:)
nil
end
end
def token_object
Class.new do
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
[]
end
def plan
"markasoftware_free_enterprise_mode"
end
def features
[]
end
def version
69
end
end.new
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
[]
end
def plan
"markasoftware_free_enterprise_mode"
end
def features
[]
end
def version
69
end
def allows_to?(action)
true
end
def expired?(reprieve: true)
false
end
def invalid_domain?
false
end
end
@smarthomecoder
Copy link

I also installed as standalone under Ubuntu, pasted the code in the token.rb file and then whole openproject crashed. Can that be a result of not shutting down the right processes before editing the file? Maybe I forgot to turn of something !? Also I installed the community version that you can download.

@perexwi
Copy link

perexwi commented Mar 15, 2025

@smarthomecoder @duy12i1i7 I installed the package version under a fresh install of Ubuntu 20.04 (The same you use) and works just perfect. I noticed that you write "pasted the code in the token.rb" maybe did you replace the wrong file? you need to replace the /opt/openproject/app/models/enterprise_token.rb file, not the token.rb file. Can you confirm what file did you replace?

@lockdlock
Copy link

Working with OpenProject 15.4.1?

@duy12i1i7
Copy link

@smarthomecoder @duy12i1i7 I installed the package version under a fresh install of Ubuntu 20.04 (The same you use) and works just perfect. I noticed that you write "pasted the code in the token.rb" maybe did you replace the wrong file? you need to replace the /opt/openproject/app/models/enterprise_token.rb file, not the token.rb file. Can you confirm what file did you replace?

Oh I see how to use this on newest version, thanks bro

@benmi3
Copy link

benmi3 commented Mar 21, 2025

It is working on OpenProject 15.4.1

@smarthomecoder
Copy link

smarthomecoder commented Mar 24, 2025

thx for the help! did it again, step by step and now it works.

@antoniolago
Copy link

For helm installations

  1. 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>
    
  1. 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
   
 

@gelt00
Copy link

gelt00 commented Mar 27, 2025

I have a question, my enterprise demo version only has 10 users, is there any way to adjust it to 20-25?

@OPiElix
Copy link

OPiElix commented Mar 31, 2025

works for 15.4.2. Thanks !!

@buzzqw
Copy link

buzzqw commented Apr 9, 2025

Hi
on New Custom Action, the Add Action is empty

any hints ?

@scalenow
Copy link

@buzzqw raise a ticket with openproject

@javito1081
Copy link

javito1081 commented Apr 17, 2025

Just for everyone having issues on how to do this the easiest way, i did the following:

Step 1:

Downloaded the file using curl to the openproject folder, i have a folder called openproject and inside its my docker compose file and now the enterprise_token.rb, along with my assets and data folder

curl "https://gist.githubusercontent.com/markasoftware/f5b2e55a2c2e3abb1f9eefcdf0bfff45/raw/148c5067e30eae04f96e3233144b4404f70ade47/enterprise_token.rb" -o openproject/enterprise_token.rb

Step 2:

Once downloaded i added this line - ./enterprise_token.rb:/app/app/models/enterprise_token.rb to my docker compose file in the volumes

services:
    openproject:
        image: openproject/openproject:15
        container_name: openproject
        ports:
            - "8200:80"
        restart: unless-stopped
        environment:
            - OPENPROJECT_SECRET_KEY_BASE=secret
            - OPENPROJECT_HOST__NAME=openproject.something.com
            - OPENPROJECT_HTTPS=true
            - OPENPROJECT_DEFAULT__LANGUAGE=es
            - OPENPROJECT_USER__DEFAULT__TIMEZONE=America/Mexico_City
        volumes:
            - ./pgdata:/var/openproject/pgdata
            - ./assets:/var/openproject/assets
            - ./enterprise_token.rb:/app/app/models/enterprise_token.rb

Step 3:

after that, i saved the file and ran my docker compose like this:

docker-compose -f openproject/openproject.yml up -d

thats it, no restarts or any extra steps,

@ados8
Copy link

ados8 commented Apr 24, 2025

It has been ages since returning to here to update and it's great to see the trend of update confirming still going.
I've updated to 15.4.2 without issue.

@scalenow
Copy link

I have heard a major change with version 16.0 coming in openproject.Hope this file will still be valid for version 16.0

@christophwolff
Copy link

should work fine in 16

@chihilock
Copy link

work v15.5?

@CC1119
Copy link

CC1119 commented May 7, 2025

work v15.5?

Yes, perfectly fine

@CC1119
Copy link

CC1119 commented May 7, 2025

No need to change values for banner_type_for(). Keep it as the original:

def show_banners?(feature: nil)
  false
end

def banner_type_for(feature:)
  if !active?
    :no_token
  elsif !allows_to?(feature)
    :upsell
  end
end

@chihilock
Copy link

Thank you. I was worried about what to do about that part.

No need to change values for banner_type_for(). Keep it as the original:

def show_banners?(feature: nil)
  false
end

def banner_type_for(feature:)
  if !active?
    :no_token
  elsif !allows_to?(feature)
    :upsell
  end
end

@supaeasy
Copy link

with openproject 15.1.1 it is working for me just added this line in docker-compose file:

    volumes:
      - /mnt/data/openproject/enterprise_token.rb:/app/app/models/enterprise_token.rb:ro

Can confirm this is still working very fine with 15.5.1.

To everyone who is confused on where to put this: this needs to go in the same volumes section as the /data volumes. NOT in the /db part.
Also, of course change /mnt/data/openproject/ to the actual location you downloaded enterprise_token.rb to.

@scalenow
Copy link

version 16 released today for openproject ,Has anyone tried to see whether the file is compatible

@perexwi
Copy link

perexwi commented May 21, 2025

Not working with version 16, you probably will get a 500 Internal Server Error

@scalenow
Copy link

Yes that was my suspicion @markasoftware any intelligent insights

@3115fcfc-2c0b-4076-927f-ae6531c76061

@markasoftware
Copy link
Author

markasoftware commented May 21, 2025

I have just updated this to OpenProject 16.

Also: The "enterprise edition" section in the settings will now work!

@markasoftware
Copy link
Author

I have also just verified that this is backward-compatible with opf 15. Thanks for the reports everyone! Would appreciate more testers to ensure my latest change didn't break anything else.

@markasoftware
Copy link
Author

and also thanks @3115fcfc-2c0b-4076-927f-ae6531c76061 you beat me by 25 minutes :)

@scalenow
Copy link

@djtilo-ol
Copy link

@markasoftware I have upgraded my 15.5.1 manual installation and added your modified file - it works as it should. Thank you and @3115fcfc-2c0b-4076-927f-ae6531c76061

@3115fcfc-2c0b-4076-927f-ae6531c76061

also just verified that this is backward-compatible with opf 15. Thanks for the reports everyone! Would appreciate more testers to ensure my latest change didn't break anything else.

@markasoftware Thank you. Works flawlessly for me in 15.5.1 and 16.0.0 with docker-compose and replacing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment