Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
C

cloudron_hacky

@cloudron_hacky
About
Posts
6
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Disable Registration
    C cloudron_hacky

    After an initial user registration I want to disable new users.

    I changed the value for enableregistration to false via the file manager in /app/data/config.yml.

    Once I restart the app the file is overwritten and the value is set to true again.

    How can I prevent new users from registering?
    Thanks.

    Vikunja

  • Pass Cloudron ENV variables to pre-built Docker image
    C cloudron_hacky

    I tried to package my first Cloudron app but I am failing.

    The application Tandoor Recipes is an already pre-built Docker image. It depends on a Postgres DB and from it's overall architecture I think it is a perfect candidate for Cloudron.

    I think all that needs to be done is to pass the Postgres ENV variables Cloudron provides into the container. The Tandoor documentation states to simply start the image, one should pass theses parameters to docker run:

    docker run -d \
        -v ./staticfiles:/opt/recipes/staticfiles \
        -v ./mediafiles:/opt/recipes/mediafiles \
        -p 80:8080 \
        -e SECRET_KEY=YOUR_SECRET_KEY \
        -e DB_ENGINE=django.db.backends.postgresql \
        -e POSTGRES_HOST=db_recipes \
        -e POSTGRES_PORT=5432 \
        -e POSTGRES_USER=djangodb \
        -e POSTGRES_PASSWORD=YOUR_POSTGRES_SECRET_KEY \
        -e POSTGRES_DB=djangodb \
        --name recipes_1 \
        vabene1111/recipes
    

    So my idea was to simply skip the Dockerfile building part of the image and directly install the app with my CloudronManifest.JSON, maybe like this

    {
      "title": "Tandoor Recipes",
      "version": "0.1.0",
      "healthCheckPath": "/",
      "httpPort": 8080,
      "addons": {
        "postgresql": {},
        "localstorage": {}
      },
      "manifestVersion": 2,
      "website": "https://docs.tandoor.dev/",
    }
    

    If I install this with cloudron install --image vabene1111/recipes --no-wait it installs but the logs show an error that the DB file is not found (excerpt below).

    I tried to also build from this image and use the Dockerfile to run a start.sh (idea from this post. But I have difficulties understanding how this build-time script is run every time I start the app. But maybe this is my lack of Docker knowledge.

    So my question is, is it not possible to use external non-Cloudron-style build images and pass variables into those images without building it myself?
    Any help is highly appreciated.
    Thanks.

    Regards
    Christopher

    Dec 21 17:56:13 box:taskworker Task took 0.76 seconds
    Dec 21 17:56:13 box:tasks setCompleted - 3356: {"result":null,"error":null}
    Dec 21 17:56:13 box:tasks update 3356: {"percent":100,"result":null,"error":null}
    Dec 21 18:10:22 File "/opt/recipes/venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect
    Dec 21 18:10:22 self.connection = self.get_new_connection(conn_params)
    Dec 21 18:10:22 File "/opt/recipes/venv/lib/python3.9/site-packages/django/utils/asyncio.py", line 33, in inner
    Dec 21 18:10:22 return func(*args, **kwargs)
    Dec 21 18:10:22 File "/opt/recipes/venv/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 209, in get_new_connection
    Dec 21 18:10:22 conn = Database.connect(**conn_params)
    Dec 21 18:10:22 django.db.utils.OperationalError: unable to open database file
    Dec 21 18:10:22 Done
    Dec 21 18:10:22 chmod: /opt/recipes/mediafiles: No such file or directory
    Dec 21 18:10:23 [2021-12-21 17:10:23 +0000] [1] [INFO] Starting gunicorn 20.1.0
    Dec 21 18:10:23 [2021-12-21 17:10:23 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
    Dec 21 18:10:23 [2021-12-21 17:10:23 +0000] [1] [INFO] Using worker: sync
    Dec 21 18:10:23 [2021-12-21 17:10:23 +0000] [12] [INFO] Booting worker with pid: 12
    Dec 21 18:10:23 [2021-12-21 18:10:23 +0100] [12] [ERROR] Exception in worker process
    Dec 21 18:10:23 Traceback (most recent call last):
    Dec 21 18:10:23 File "/opt/recipes/venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
    Dec 21 18:10:23 self.connect()
    Dec 21 18:10:23 File "/opt/recipes/venv/lib/python3.9/site-packages/django/utils/asyncio.py", line 33, in inner
    Dec 21 18:10:23 return func(*args, **kwargs)
    Dec 21 18:10:23 File "/opt/recipes/venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect
    Dec 21 18:10:23 self.connection = self.get_new_connection(conn_params)
    Dec 21 18:10:23 File "/opt/recipes/venv/lib/python3.9/site-packages/django/utils/asyncio.py", line 33, in inner
    Dec 21 18:10:23 return func(*args, **kwargs)
    Dec 21 18:10:23 File "/opt/recipes/venv/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 209, in get_new_connection
    Dec 21 18:10:23 conn = Database.connect(**conn_params)
    Dec 21 18:10:23 sqlite3.OperationalError: unable to open database file
    Dec 21 18:10:23 
    
    App Packaging & Development

  • Pass Cloudron ENV variables to pre-built Docker image
    C cloudron_hacky

    @klawitterb Very cool indeed, thanks for the link. Works like a charm.

    I myself got passed the SQL ENV variables and had Tandoor up and running but I was then running into the problem of the static file generation at boot time start.sh. I did not manage to get it out of start.sh and into the Dockerfile, like you did here:

    RUN venv/bin/python3 manage.py collectstatic_js_reverse
    RUN venv/bin/python3 manage.py collectstatic --noinput
    

    Anyway, dunno if it makes sens to continue this thread on discussing building Tandoor Recipes but I have one question. In your setup you still use nginx in the image. I think you followed the manual installation description where everything including Postgres and Nginx is put on the same host.
    But we do have an reverse proxy in Cloudron already. So I .dockerignoredd your nginx.conffiles and had port 8080 (gunicorn) instead of 8000 (nginx) directly exposed.

    Do you see a special reason for having another nginx in the image?

    App Packaging & Development

  • Meemo alternative/replacement
    C cloudron_hacky

    Hi,
    I love the simplicity of Meemo and I am using it extensively, but the shortcomings, primarily MD rendering (checkboxes, strike-through), do limit its usage for me.
    Looking for an alternative I stumbled un Memos: https://www.usememos.com/
    It seems to be very similar in its approach, and it looks as if it does not suffer from the same limitations.
    Could it be an alternative or even a replacement?

    Meemo
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search