CINXE.COM
How do you change invenio.cfg without rebuilding the whole project? - Invenio RDM - Invenio
<!DOCTYPE html> <html lang="en-GB"> <head> <meta charset="utf-8"> <title>How do you change invenio.cfg without rebuilding the whole project? - Invenio RDM - Invenio</title> <meta name="description" content="Is it possible to change invenio.cfg values, for example allowed hosts, without rebuilding?"> <meta name="generator" content="Discourse 3.4.0.beta3-dev - https://github.com/discourse/discourse version 4d1e66418cdb08028ab3d616ba90b8d003783cae"> <link rel="icon" type="image/png" href="https://invenio-talk.web.cern.ch/uploads/default/optimized/1X/_129430568242d1b7f853bb13ebea28b3f6af4e7_2_32x32.png"> <link rel="apple-touch-icon" type="image/png" href="https://invenio-talk.web.cern.ch/uploads/default/optimized/1X/_129430568242d1b7f853bb13ebea28b3f6af4e7_2_180x180.png"> <meta name="theme-color" media="all" content="#0377cd"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=yes, viewport-fit=cover"> <link rel="canonical" href="https://invenio-talk.web.cern.ch/t/how-do-you-change-invenio-cfg-without-rebuilding-the-whole-project/218" /> <link rel="search" type="application/opensearchdescription+xml" href="https://invenio-talk.web.cern.ch/opensearch.xml" title="Invenio Search"> <link href="/stylesheets/color_definitions_invenio-colors_3_3_9ed6b39db0bb5e21484139466c4146bec81f031e.css?__ws=invenio-talk.web.cern.ch" media="all" rel="stylesheet" class="light-scheme"/> <link href="/stylesheets/desktop_ad226f30fe9dfc4f9cc1c38a76cb7ef0dce672c3.css?__ws=invenio-talk.web.cern.ch" media="all" rel="stylesheet" data-target="desktop" /> <link href="/stylesheets/checklist_ad226f30fe9dfc4f9cc1c38a76cb7ef0dce672c3.css?__ws=invenio-talk.web.cern.ch" media="all" rel="stylesheet" data-target="checklist" /> <link href="/stylesheets/discourse-details_ad226f30fe9dfc4f9cc1c38a76cb7ef0dce672c3.css?__ws=invenio-talk.web.cern.ch" media="all" rel="stylesheet" data-target="discourse-details" /> <link href="/stylesheets/discourse-lazy-videos_ad226f30fe9dfc4f9cc1c38a76cb7ef0dce672c3.css?__ws=invenio-talk.web.cern.ch" media="all" rel="stylesheet" data-target="discourse-lazy-videos" /> <link href="/stylesheets/discourse-local-dates_ad226f30fe9dfc4f9cc1c38a76cb7ef0dce672c3.css?__ws=invenio-talk.web.cern.ch" media="all" rel="stylesheet" data-target="discourse-local-dates" /> <link href="/stylesheets/discourse-narrative-bot_ad226f30fe9dfc4f9cc1c38a76cb7ef0dce672c3.css?__ws=invenio-talk.web.cern.ch" media="all" rel="stylesheet" data-target="discourse-narrative-bot" /> <link href="/stylesheets/discourse-presence_ad226f30fe9dfc4f9cc1c38a76cb7ef0dce672c3.css?__ws=invenio-talk.web.cern.ch" media="all" rel="stylesheet" data-target="discourse-presence" /> <link href="/stylesheets/discourse-solved_ad226f30fe9dfc4f9cc1c38a76cb7ef0dce672c3.css?__ws=invenio-talk.web.cern.ch" media="all" rel="stylesheet" data-target="discourse-solved" /> <link href="/stylesheets/discourse-templates_ad226f30fe9dfc4f9cc1c38a76cb7ef0dce672c3.css?__ws=invenio-talk.web.cern.ch" media="all" rel="stylesheet" data-target="discourse-templates" /> <link href="/stylesheets/discourse-voting_ad226f30fe9dfc4f9cc1c38a76cb7ef0dce672c3.css?__ws=invenio-talk.web.cern.ch" media="all" rel="stylesheet" data-target="discourse-voting" /> <link href="/stylesheets/footnote_ad226f30fe9dfc4f9cc1c38a76cb7ef0dce672c3.css?__ws=invenio-talk.web.cern.ch" media="all" rel="stylesheet" data-target="footnote" /> <link href="/stylesheets/poll_ad226f30fe9dfc4f9cc1c38a76cb7ef0dce672c3.css?__ws=invenio-talk.web.cern.ch" media="all" rel="stylesheet" data-target="poll" /> <link href="/stylesheets/spoiler-alert_ad226f30fe9dfc4f9cc1c38a76cb7ef0dce672c3.css?__ws=invenio-talk.web.cern.ch" media="all" rel="stylesheet" data-target="spoiler-alert" /> <link href="/stylesheets/discourse-voting_desktop_ad226f30fe9dfc4f9cc1c38a76cb7ef0dce672c3.css?__ws=invenio-talk.web.cern.ch" media="all" rel="stylesheet" data-target="discourse-voting_desktop" /> <link href="/stylesheets/poll_desktop_ad226f30fe9dfc4f9cc1c38a76cb7ef0dce672c3.css?__ws=invenio-talk.web.cern.ch" media="all" rel="stylesheet" data-target="poll_desktop" /> <link href="/stylesheets/desktop_theme_3_f0fe5ba92aa24eafd7421e95c28504a28ad98ca2.css?__ws=invenio-talk.web.cern.ch" media="all" rel="stylesheet" data-target="desktop_theme" data-theme-id="3" data-theme-name="shades of blue"/> <link rel="alternate nofollow" type="application/rss+xml" title="RSS feed of 'How do you change invenio.cfg without rebuilding the whole project?'" href="https://invenio-talk.web.cern.ch/t/how-do-you-change-invenio-cfg-without-rebuilding-the-whole-project/218.rss" /> <meta property="og:site_name" content="Invenio" /> <meta property="og:type" content="website" /> <meta name="twitter:card" content="summary" /> <meta name="twitter:image" content="https://invenio-talk.web.cern.ch/uploads/default/original/1X/365b3da954a64ad5402137fe610018898acec6a9.png" /> <meta property="og:image" content="https://invenio-talk.web.cern.ch/uploads/default/original/1X/365b3da954a64ad5402137fe610018898acec6a9.png" /> <meta property="og:url" content="https://invenio-talk.web.cern.ch/t/how-do-you-change-invenio-cfg-without-rebuilding-the-whole-project/218" /> <meta name="twitter:url" content="https://invenio-talk.web.cern.ch/t/how-do-you-change-invenio-cfg-without-rebuilding-the-whole-project/218" /> <meta property="og:title" content="How do you change invenio.cfg without rebuilding the whole project?" /> <meta name="twitter:title" content="How do you change invenio.cfg without rebuilding the whole project?" /> <meta property="og:description" content="Is it possible to change invenio.cfg values, for example allowed hosts, without rebuilding?" /> <meta name="twitter:description" content="Is it possible to change invenio.cfg values, for example allowed hosts, without rebuilding?" /> <meta property="og:article:section" content="Projects" /> <meta property="og:article:section:color" content="0E76BD" /> <meta property="og:article:section" content="Invenio RDM" /> <meta property="og:article:section:color" content="fb8273" /> <meta property="article:published_time" content="2022-02-11T12:09:20+00:00" /> <meta property="og:ignore_canonical" content="true" /> </head> <body class="crawler browser-update"> <header> <a href="/"> Invenio </a> </header> <div id="main-outlet" class="wrap" role="main"> <div id="topic-title"> <h1> <a href="/t/how-do-you-change-invenio-cfg-without-rebuilding-the-whole-project/218">How do you change invenio.cfg without rebuilding the whole project?</a> </h1> <div class="topic-category" itemscope itemtype="http://schema.org/BreadcrumbList"> <span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> <a href="/c/projects/invenio-rdm/8" class="badge-wrapper bullet" itemprop="item"> <span class='badge-category-bg' style='background-color: #0E76BD'></span> <span class='badge-category clear-badge'> <span class='category-name' itemprop='name'>Projects</span> </span> </a> <meta itemprop="position" content="1" /> </span> <span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> <a href="/c/projects/invenio-rdm/8" class="badge-wrapper bullet" itemprop="item"> <span class='badge-category-bg' style='background-color: #fb8273'></span> <span class='badge-category clear-badge'> <span class='category-name' itemprop='name'>Invenio RDM</span> </span> </a> <meta itemprop="position" content="2" /> </span> </div> </div> <div itemscope itemtype='http://schema.org/DiscussionForumPosting'> <meta itemprop='headline' content='How do you change invenio.cfg without rebuilding the whole project?'> <link itemprop='url' href='https://invenio-talk.web.cern.ch/t/how-do-you-change-invenio-cfg-without-rebuilding-the-whole-project/218'> <meta itemprop='datePublished' content='2022-02-11T12:09:20Z'> <meta itemprop='articleSection' content='Invenio RDM'> <meta itemprop='keywords' content=''> <div itemprop='publisher' itemscope itemtype="http://schema.org/Organization"> <meta itemprop='name' content='Invenio'> <div itemprop='logo' itemscope itemtype="http://schema.org/ImageObject"> <meta itemprop='url' content='https://invenio-talk.web.cern.ch/uploads/default/original/1X/365b3da954a64ad5402137fe610018898acec6a9.png'> </div> </div> <div id='post_1' class='topic-body crawler-post'> <div class='crawler-post-meta'> <span class="creator" itemprop="author" itemscope itemtype="http://schema.org/Person"> <a itemprop="url" href='https://invenio-talk.web.cern.ch/u/aliforever'><span itemprop='name'>aliforever</span></a> </span> <link itemprop="mainEntityOfPage" href="https://invenio-talk.web.cern.ch/t/how-do-you-change-invenio-cfg-without-rebuilding-the-whole-project/218"> <span class="crawler-post-infos"> <time datetime='2022-02-11T12:09:20Z' class='post-time'> 11 February 2022 12:09 </time> <meta itemprop='dateModified' content='2022-02-11T12:09:20Z'> <span itemprop='position'>1</span> </span> </div> <div class='post' itemprop='text'> <p>Is it possible to change invenio.cfg values, for example allowed hosts, without rebuilding?</p> </div> <div itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter"> <meta itemprop="interactionType" content="http://schema.org/LikeAction"/> <meta itemprop="userInteractionCount" content="0" /> <span class='post-likes'></span> </div> </div> <div id='post_2' itemprop='comment' itemscope itemtype='http://schema.org/Comment' class='topic-body crawler-post'> <div class='crawler-post-meta'> <span class="creator" itemprop="author" itemscope itemtype="http://schema.org/Person"> <a itemprop="url" href='https://invenio-talk.web.cern.ch/u/nitarocc'><span itemprop='name'>nitarocc</span></a> </span> <span class="crawler-post-infos"> <time itemprop='datePublished' datetime='2022-02-11T12:36:27Z' class='post-time'> 11 February 2022 12:36 </time> <meta itemprop='dateModified' content='2022-02-11T12:36:27Z'> <span itemprop='position'>2</span> </span> </div> <div class='post' itemprop='text'> <p>Hello,<br> you don’t have to rebuild the whole project:</p> <ol> <li>stop the running web server and celery</li> <li>change the <code>invenio.cfg</code>, see <a href="https://inveniordm.docs.cern.ch/install/configuration/">here</a> for more info</li> <li>restart the server</li> </ol> <p>I hope it helps!</p> </div> <div itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter"> <meta itemprop="interactionType" content="http://schema.org/LikeAction"/> <meta itemprop="userInteractionCount" content="0" /> <span class='post-likes'></span> </div> </div> <div id='post_3' itemprop='comment' itemscope itemtype='http://schema.org/Comment' class='topic-body crawler-post'> <div class='crawler-post-meta'> <span class="creator" itemprop="author" itemscope itemtype="http://schema.org/Person"> <a itemprop="url" href='https://invenio-talk.web.cern.ch/u/aliforever'><span itemprop='name'>aliforever</span></a> </span> <span class="crawler-post-infos"> <time itemprop='datePublished' datetime='2022-02-11T13:13:13Z' class='post-time'> 11 February 2022 13:13 </time> <meta itemprop='dateModified' content='2022-02-11T13:13:13Z'> <span itemprop='position'>3</span> </span> </div> <div class='post' itemprop='text'> <p><a class="mention" href="/u/nitarocc">@nitarocc</a><br> I’m using docker image</p> <pre><code class="lang-auto">invenio-cli containers start --lock --build --setup </code></pre> <p>How do I stop celery? Is that a docker container as well?</p> <p>I use <code>docker exec -it <container_id> /bin/bash</code> to change invenio.cfg inside the docker container, but that doesn’t work</p> </div> <div itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter"> <meta itemprop="interactionType" content="http://schema.org/LikeAction"/> <meta itemprop="userInteractionCount" content="0" /> <span class='post-likes'></span> </div> </div> <div id='post_4' itemprop='comment' itemscope itemtype='http://schema.org/Comment' class='topic-body crawler-post'> <div class='crawler-post-meta'> <span class="creator" itemprop="author" itemscope itemtype="http://schema.org/Person"> <a itemprop="url" href='https://invenio-talk.web.cern.ch/u/nitarocc'><span itemprop='name'>nitarocc</span></a> </span> <span class="crawler-post-infos"> <time itemprop='datePublished' datetime='2022-02-11T15:10:56Z' class='post-time'> 11 February 2022 15:10 </time> <meta itemprop='dateModified' content='2022-02-11T15:10:56Z'> <span itemprop='position'>4</span> </span> </div> <div class='post' itemprop='text'> <p>In development, to stop see <a href="https://inveniordm.docs.cern.ch/reference/cli/#containers-stop">here</a>.</p> <p>When deploying with Docker, you will build the Docker image and Invenio will use your <code>invenio.cfg</code>.<br> When you run the container, then you should inject environment variables to override the default configuration, see <a href="https://inveniordm.docs.cern.ch/install/configuration/#environment-variables">here</a>.</p> </div> <div itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter"> <meta itemprop="interactionType" content="http://schema.org/LikeAction"/> <meta itemprop="userInteractionCount" content="0" /> <span class='post-likes'></span> </div> </div> <div id='post_5' itemprop='comment' itemscope itemtype='http://schema.org/Comment' class='topic-body crawler-post'> <div class='crawler-post-meta'> <span class="creator" itemprop="author" itemscope itemtype="http://schema.org/Person"> <a itemprop="url" href='https://invenio-talk.web.cern.ch/u/aliforever'><span itemprop='name'>aliforever</span></a> </span> <span class="crawler-post-infos"> <time itemprop='datePublished' datetime='2022-02-11T17:28:08Z' class='post-time'> 11 February 2022 17:28 </time> <meta itemprop='dateModified' content='2022-02-11T17:28:08Z'> <span itemprop='position'>5</span> </span> </div> <div class='post' itemprop='text'> <p><code>invenio-cli containers stop</code></p> <p><code>export INVENIO_APP_ALLOWED_HOSTS=['example.com']</code></p> <p><code>invenio-cli containers start</code></p> <p>Didn’t work. Do you know the path to config.py inside docker containers? I can modify the confiuration from there</p> </div> <div itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter"> <meta itemprop="interactionType" content="http://schema.org/LikeAction"/> <meta itemprop="userInteractionCount" content="0" /> <span class='post-likes'></span> </div> </div> <div id='post_6' itemprop='comment' itemscope itemtype='http://schema.org/Comment' class='topic-body crawler-post'> <div class='crawler-post-meta'> <span class="creator" itemprop="author" itemscope itemtype="http://schema.org/Person"> <a itemprop="url" href='https://invenio-talk.web.cern.ch/u/nitarocc'><span itemprop='name'>nitarocc</span></a> </span> <span class="crawler-post-infos"> <time itemprop='datePublished' datetime='2022-02-14T08:09:53Z' class='post-time'> 14 February 2022 08:09 </time> <meta itemprop='dateModified' content='2022-02-14T08:09:53Z'> <span itemprop='position'>6</span> </span> </div> <div class='post' itemprop='text'> <p>Env vars are working correctly in my local env, and we don’t have other users reporting this issue.<br> You can have a look <a href="https://github.com/inveniosoftware/invenio-cli/blob/master/invenio_cli/commands/local.py#L129">here</a> how the current env is copied into the new env created by <code>invenio-cli</code>.</p> <pre><code class="lang-auto">❯ export INVENIO_APP_ALLOWED_HOSTS=['example.com'] ❯ echo $INVENIO_APP_ALLOWED_HOSTS [example.com] ❯ invenio-cli shell Launching subshell in virtual environment... ... ❯ echo $INVENIO_APP_ALLOWED_HOSTS [example.com] ❯ invenio shell --no-term-title -c "app.config['APP_ALLOWED_HOSTS']" Out[1]: '[example.com]' ❯ pipenv run invenio shell --no-term-title -c "app.config['APP_ALLOWED_HOSTS']" Out[1]: '[example.com]' > exit ❯ unset INVENIO_APP_ALLOWED_HOSTS ❯ pipenv run invenio shell --no-term-title -c "app.config['APP_ALLOWED_HOSTS']" Out[1]: ['0.0.0.0', 'localhost', '127.0.0.1'] </code></pre> <p>Just a warning: <code>invenio-cli</code> is not meant to be run in <strong>any deployed env</strong>, only for development.</p> <p>To answer your other question about the path to the <code>invenio.cfg</code>:</p> <ul> <li> <a href="https://github.com/inveniosoftware/cookiecutter-invenio-rdm/blob/master/%7B%7Bcookiecutter.project_shortname%7D%7D/Dockerfile#L23">here</a> the path in the Dockerfile in the InvenioRDM image</li> <li> <a href="https://github.com/inveniosoftware/docker-invenio/blob/master/python3.8/Dockerfile#L60">here</a> the base image with the path</li> </ul> <p>You can join our <a href="https://inveniosoftware.org/support/">chatroom</a> where other users facing similar issues might be able to help.</p> </div> <div itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter"> <meta itemprop="interactionType" content="http://schema.org/LikeAction"/> <meta itemprop="userInteractionCount" content="0" /> <span class='post-likes'></span> </div> </div> </div> </div> <footer class="container wrap"> <nav class='crawler-nav'> <ul> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/' itemprop="url">Home </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/categories' itemprop="url">Categories </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/guidelines' itemprop="url">Guidelines </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/tos' itemprop="url">Terms of Service </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/privacy' itemprop="url">Privacy Policy </a> </span> </li> </ul> </nav> <p class='powered-by-link'>Powered by <a href="https://www.discourse.org">Discourse</a>, best viewed with JavaScript enabled</p> </footer> <div class="buorg"><div>Unfortunately, <a href="https://www.discourse.org/faq/#browser">your browser is unsupported</a>. Please <a href="https://browsehappy.com">switch to a supported browser</a> to view rich content, log in and reply.</div></div> </body> </html>