Giter Site home page Giter Site logo

weblateorg / docker Goto Github PK

View Code? Open in Web Editor NEW
85.0 85.0 103.0 1.78 MB

Official Docker container for Weblate, a libre software web-based continuous localization system

Home Page: https://docs.weblate.org/en/latest/admin/install/docker.html

License: GNU General Public License v3.0

Shell 50.38% Dockerfile 37.59% Smarty 12.03%
docker docker-container docker-image hacktoberfest internationalization localization weblate

docker's People

Contributors

alfeg avatar blacksails avatar buffcode avatar danmark avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar fabiowidmer avatar glensc avatar jokester avatar lafriks avatar mareksuscak avatar mcfedr avatar mydnicq avatar nijel avatar opichon avatar paulpach avatar pc-jedi avatar pre-commit-ci[bot] avatar ptman avatar renovate[bot] avatar ruslansennov avatar sebastianhaeni avatar semgrep-bot avatar stefk avatar sylvainar avatar tnextday avatar tswast avatar westfood avatar wichert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker's Issues

Not running on armhf

I've got a QNAP NAS here and liked to install your software here.
When trying to run the container at the end, the UI tells about a "wrong exec format" error. So I guess the image contains binaries for i386 or amd64 CPUs.

Any chance to get a armhf build?

Thanks!

Celery not working after version-by-version upgrade from 3.2-1 to 3.2.2-3

Celery stopped working as expected after we have bumped up our docker based Weblate to version 3.2.2-3 (version by version from 3.2-1). We were getting same error regarding celery during updates from: 3.2.1-2 to 3.2.2-1, 3.2.2-1 to 3.2.2-2 and further to 3.2.2-3.

Stack trace given while trying to run callery (via bash; same given container startup):

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/kombu/utils/objects.py", line 42, in __get__
    return obj.__dict__[self.__name__]
KeyError: 'scheduler'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/shelve.py", line 111, in __getitem__
    value = self.cache[key]
KeyError: 'entries'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/celery/beat.py", line 515, in _create_schedule
    self._store[str('entries')]
  File "/usr/lib/python3.5/shelve.py", line 113, in __getitem__
    f = BytesIO(self.dict[key.encode(self.keyencoding)])
KeyError: b'entries'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/billiard/process.py", line 327, in _bootstrap
    self.run()
  File "/usr/local/lib/python3.5/dist-packages/celery/beat.py", line 664, in run
    self.service.start(embedded_process=True)
  File "/usr/local/lib/python3.5/dist-packages/celery/beat.py", line 579, in start
    humanize_seconds(self.scheduler.max_interval))
  File "/usr/local/lib/python3.5/dist-packages/kombu/utils/objects.py", line 44, in __get__
    value = obj.__dict__[self.__name__] = self.__get(obj)
  File "/usr/local/lib/python3.5/dist-packages/celery/beat.py", line 623, in scheduler
    return self.get_scheduler()
  File "/usr/local/lib/python3.5/dist-packages/celery/beat.py", line 618, in get_scheduler
    lazy=lazy,
  File "/usr/local/lib/python3.5/dist-packages/celery/beat.py", line 458, in __init__
    Scheduler.__init__(self, *args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/celery/beat.py", line 225, in __init__
    self.setup_schedule()
  File "/usr/local/lib/python3.5/dist-packages/celery/beat.py", line 486, in setup_schedule
    self._create_schedule()
  File "/usr/local/lib/python3.5/dist-packages/celery/beat.py", line 519, in _create_schedule
    self._store[str('entries')] = {}
  File "/usr/lib/python3.5/shelve.py", line 125, in __setitem__
    self.dict[key.encode(self.keyencoding)] = f.getvalue()
_dbm.error: cannot add item to database
Process Beat:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/kombu/utils/objects.py", line 42, in __get__
    return obj.__dict__[self.__name__]
KeyError: 'scheduler'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.5/shelve.py", line 111, in __getitem__
    value = self.cache[key]
KeyError: 'entries'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/celery/beat.py", line 515, in _create_schedule
    self._store[str('entries')]
File "/usr/lib/python3.5/shelve.py", line 113, in __getitem__
    f = BytesIO(self.dict[key.encode(self.keyencoding)])
KeyError: b'entries'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/billiard/process.py", line 327, in _bootstrap
    self.run()
File "/usr/local/lib/python3.5/dist-packages/celery/beat.py", line 664, in run
    self.service.start(embedded_process=True)
File "/usr/local/lib/python3.5/dist-packages/celery/beat.py", line 579, in start
    humanize_seconds(self.scheduler.max_interval))
File "/usr/local/lib/python3.5/dist-packages/kombu/utils/objects.py", line 44, in __get__
    value = obj.__dict__[self.__name__] = self.__get(obj)
File "/usr/local/lib/python3.5/dist-packages/celery/beat.py", line 623, in scheduler
    return self.get_scheduler()
File "/usr/local/lib/python3.5/dist-packages/celery/beat.py", line 618, in get_scheduler
    lazy=lazy,
File "/usr/local/lib/python3.5/dist-packages/celery/beat.py", line 458, in __init__
    Scheduler.__init__(self, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/celery/beat.py", line 225, in __init__
    self.setup_schedule()
File "/usr/local/lib/python3.5/dist-packages/celery/beat.py", line 486, in setup_schedule
    self._create_schedule()
File "/usr/local/lib/python3.5/dist-packages/celery/beat.py", line 519, in _create_schedule
    self._store[str('entries')] = {}
File "/usr/lib/python3.5/shelve.py", line 125, in __setitem__
    self.dict[key.encode(self.keyencoding)] = f.getvalue()
_dbm.error: cannot add item to database
Exception ignored in:
<bound method Shelf.__del__ of <shelve.DbfilenameShelf object at 0x7f587438db00>>
Traceback (most recent call last):
File "/usr/lib/python3.5/shelve.py", line 162, in __del__
self.close()
File "/usr/lib/python3.5/shelve.py", line 144, in close
self.sync()
File "/usr/lib/python3.5/shelve.py", line 168, in sync
self[key] = entry
File "/usr/lib/python3.5/shelve.py", line 125, in __setitem__
self.dict[key.encode(self.keyencoding)] = f.getvalue()
_dbm.error: cannot add item to database

list versions ouput:

* Weblate 3.2.2
 * Python 3.5.3
 * Django 2.1.2
 * Celery 4.2.1
 * celery-batches 0.2
 * six 1.10.0
 * social-auth-core 1.7.0
 * social-auth-app-django 2.1.0
 * django-appconf 1.0.2
 * translate-toolkit 2.3.1
 * Whoosh 2.7.4
 * defusedxml 0.5.0
 * Git 2.11.0
 * Pillow 4.0.0
 * python-dateutil 2.5.3
 * lxml 3.7.1
 * django-crispy-forms 1.7.2
 * django_compressor 2.2
 * djangorestframework 3.9.0
 * user-agents 1.1.0
 * jellyfish 0.6.1
 * pytz 2018.7
 * pyuca 1.2
 * PyYAML 3.12
 * tesserocr 2.3.1
 * Mercurial 4.0
 * git-svn 2.11.0
 * Database backends: django.db.backends.postgresql
 * Cache backends: default:RedisCache, avatar:FileBasedCache
 * Platform: Linux 4.4.0-134-generic (x86_64)

check --deploy output

SystemCheckError: System check identified some issues:

CRITICALS:
?: (weblate.E018) Failed to download avatar: <urlopen error [Errno 99] Cannot assign requested address>
	HINT: https://docs.weblate.org/en/weblate-3.2.2/admin/optionals.html#avatars

WARNINGS:
?: (security.W004) You have not set a value for the SECURE_HSTS_SECONDS setting. If your entire site is served only over SSL, you may want to consider setting a value and enabling HTTP Strict Transport Security. Be sure to read the documentation first; enabling HSTS carelessly can cause serious, irreversible problems.
?: (security.W008) Your SECURE_SSL_REDIRECT setting is not set to True. Unless your site should be available over both SSL and non-SSL connections, you may want to either set this setting True or configure a load balancer or reverse-proxy server to redirect all connections to HTTPS.
?: (security.W012) SESSION_COOKIE_SECURE is not set to True. Using a secure-only session cookie makes it more difficult for network traffic sniffers to hijack user sessions.

System check identified 4 issues (0 silenced).

Additional context
We have a custom task scheduled using settings-override.py with content:

CELERY_BEAT_SCHEDULE = {
    'commit': {
        'task': 'weblate.trans.tasks.commit_pending',
	'kwargs': {'hours': 0},
        'schedule': 120,
     }
}

failed at docker-compose up

I have followed the instruction of the doc until step 4 shows FATAL: password authentication failed for user "weblate"

The full log is

Starting weblatedocker_cache_1...
Recreating weblatedocker_database_1...
Recreating weblatedocker_weblate_1...
Attaching to weblatedocker_cache_1, weblatedocker_database_1, weblatedocker_weblate_1
cache_1    | Signal handled: Terminated.
database_1 | LOG:  database system was interrupted; last known up at 2015-09-23 11:51:30 UTC
database_1 | LOG:  database system was not properly shut down; automatic recovery in progress
database_1 | LOG:  record with zero length at 0/16C2FC0
database_1 | LOG:  redo is not required
database_1 | LOG:  MultiXact member wraparound protections are now enabled
database_1 | LOG:  database system is ready to accept connections
database_1 | LOG:  autovacuum launcher started
database_1 | LOG:  incomplete startup packet
database_1 | LOG:  incomplete startup packet
weblate_1  | 2015/09/23 11:54:53 TCP: Service DATABASE_PORT_5432 (172.17.0.16:5432) is up
database_1 | LOG:  incomplete startup packet
weblate_1  | 2015/09/23 11:54:53 TCP: Service WEBLATEDOCKER_CACHE_1_PORT_11211 (172.17.0.15:11211) is up
weblate_1  | 2015/09/23 11:54:53 TCP: Service CACHE_PORT_11211 (172.17.0.15:11211) is up
weblate_1  | 2015/09/23 11:54:53 TCP: Service WEBLATEDOCKER_DATABASE_1_PORT_5432 (172.17.0.16:5432) is up
weblate_1  | 2015/09/23 11:54:53 TCP: Service CACHE_1_PORT_11211 (172.17.0.15:11211) is up
weblate_1  | 2015/09/23 11:54:53 TCP: Service DATABASE_1_PORT_5432 (172.17.0.16:5432) is up
weblate_1  | 2015/09/23 11:54:53 All services are up!
database_1 | FATAL:  password authentication failed for user "weblate"
database_1 | DETAIL:  Connection matched pg_hba.conf line 95: "host all all 0.0.0.0/0 md5"
weblate_1  | Unhandled exception in thread started by <function wrapper at 0x7f0ac08827d0>
weblate_1  | Performing system checks...
weblate_1  | 
weblate_1  | System check identified no issues (0 silenced).
weblate_1  | Traceback (most recent call last):
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 225, in wrapper
weblate_1  |     fn(*args, **kwargs)
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 112, in inner_run
weblate_1  |     self.check_migrations()
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 164, in check_migrations
weblate_1  |     executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 19, in __init__
weblate_1  |     self.loader = MigrationLoader(self.connection)
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 47, in __init__
weblate_1  |     self.build_graph()
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 182, in build_graph
weblate_1  |     self.applied_migrations = recorder.applied_migrations()
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 59, in applied_migrations
weblate_1  |     self.ensure_schema()
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 49, in ensure_schema
weblate_1  |     if self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 162, in cursor
weblate_1  |     cursor = self.make_debug_cursor(self._cursor())
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 135, in _cursor
weblate_1  |     self.ensure_connection()
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
weblate_1  |     self.connect()
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/db/utils.py", line 97, in __exit__
weblate_1  |     six.reraise(dj_exc_type, dj_exc_value, traceback)
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
weblate_1  |     self.connect()
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 119, in connect
weblate_1  |     self.connection = self.get_new_connection(conn_params)
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 176, in get_new_connection
weblate_1  |     connection = Database.connect(**conn_params)
weblate_1  |   File "/usr/lib/python2.7/dist-packages/psycopg2/__init__.py", line 164, in connect
weblate_1  |     conn = _connect(dsn, connection_factory=connection_factory, async=async)
weblate_1  | django.db.utils.OperationalError: FATAL:  password authentication failed for user "weblate"
weblate_1  | 

Docker Compose file is still version 1

@species and me just discovered a few caveeats due to the changes from docker compose version 1 to version 2:

Additionally the changes proposed in #2 (comment) appear useful for a high-availability setup.
We are going to publish a fork and mybe issue a PR with the neccessary changes.


Resources:

settings.py / Docker environment variables

Question from a Docker newbie: how do I set the variables in settings.py that aren't available as Docker environment variables? Specifically, I need to disable the SIMPLIFY_LANGUAGES settings, but I'm not sure how to access the settings.py file in a Docker deployment.

Upgrade to 2.14

This is upgrade checklist for 2.14:

  • Examples are now shipped in the package (see WeblateOrg/weblate#1471), adjust Dockerfile
  • Update settings.py to match new one
  • Raise required versions to current ones and to match 2.14 requirements

Postgres is unavailable in QNAP Container Station install

hello, we are trying to install your weblate docker image on a QNAP device, in the specialized application that this provider has available (Container Station). We select your docker image for Weblate and install correctly. The problem is that when the image starts, it tells us the error message "Postgres is unavailable - sleeping" and the Weblate service does not work.
Would you tell us how to correct the problem?

libs removed in Dockerfile

Here is line from dockerfile:

&& apt-get -y purge python-pip python-dev libleptonica-dev libtesseract-dev cython gcc g++ python-setuptools python-wheel python-pip \

https://hub.docker.com/r/weblate/weblate/~/dockerfile/

Why do we need to remove these packages? Actually pip/setuptools are quite useful, e.g. if I'm going to install some custom libs used in weblate scripts

Error at /accounts/register/ - [Errno 111]

Looks to be the same as https://github.com/nijel/weblate/issues/628.

weblate_1  | error: [Errno 111] Connection refused
weblate_1  | ERROR:django.request:Internal Server Error: /accounts/register/
weblate_1  | Traceback (most recent call last):
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
weblate_1  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
weblate_1  |   File "/app/local/lib/python2.7/site-packages/weblate/accounts/views.py", line 422, in register
weblate_1  |     return complete(request, 'email')
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
weblate_1  |     response = view_func(request, *args, **kwargs)
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
weblate_1  |     return view_func(*args, **kwargs)
weblate_1  |   File "/app/local/lib/python2.7/site-packages/social/apps/django_app/utils.py", line 51, in wrapper
weblate_1  |     return func(request, backend, *args, **kwargs)
weblate_1  |   File "/app/local/lib/python2.7/site-packages/social/apps/django_app/views.py", line 28, in complete
weblate_1  |     redirect_name=REDIRECT_FIELD_NAME, *args, **kwargs)
weblate_1  |   File "/app/local/lib/python2.7/site-packages/social/actions.py", line 43, in do_complete
weblate_1  |     user = backend.complete(user=user, *args, **kwargs)
weblate_1  |   File "/app/local/lib/python2.7/site-packages/social/backends/base.py", line 41, in complete
weblate_1  |     return self.auth_complete(*args, **kwargs)
weblate_1  |   File "/app/local/lib/python2.7/site-packages/social/backends/legacy.py", line 25, in auth_complete
weblate_1  |     return self.strategy.authenticate(*args, **kwargs)
weblate_1  |   File "/app/local/lib/python2.7/site-packages/social/strategies/django_strategy.py", line 96, in authenticate
weblate_1  |     return authenticate(*args, **kwargs)
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 74, in authenticate
weblate_1  |     user = backend.authenticate(**credentials)
weblate_1  |   File "/app/local/lib/python2.7/site-packages/social/backends/base.py", line 82, in authenticate
weblate_1  |     return self.pipeline(pipeline, *args, **kwargs)
weblate_1  |   File "/app/local/lib/python2.7/site-packages/social/backends/base.py", line 85, in pipeline
weblate_1  |     out = self.run_pipeline(pipeline, pipeline_index, *args, **kwargs)
weblate_1  |   File "/app/local/lib/python2.7/site-packages/social/backends/base.py", line 112, in run_pipeline
weblate_1  |     result = func(*args, **out) or {}
weblate_1  |   File "/app/local/lib/python2.7/site-packages/social/pipeline/partial.py", line 15, in wrapper
weblate_1  |     *args, **kwargs) or {}
weblate_1  |   File "/app/local/lib/python2.7/site-packages/social/pipeline/mail.py", line 19, in mail_validation
weblate_1  |     backend.strategy.send_email_validation(backend, details['email'])
weblate_1  |   File "/app/local/lib/python2.7/site-packages/social/strategies/base.py", line 127, in send_email_validation
weblate_1  |     send_email(self, backend, code)
weblate_1  |   File "/app/local/lib/python2.7/site-packages/weblate/accounts/pipeline.py", line 114, in send_validation
weblate_1  |     'url': url
weblate_1  |   File "/app/local/lib/python2.7/site-packages/weblate/accounts/models.py", line 359, in send_notification_email
weblate_1  |     send_mails([email])
weblate_1  |   File "/app/local/lib/python2.7/site-packages/weblate/accounts/models.py", line 54, in send_mails
weblate_1  |     connection.send_messages(mails)
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 100, in send_messages
weblate_1  |     new_conn_created = self.open()
weblate_1  |   File "/app/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 58, in open
weblate_1  |     self.connection = connection_class(self.host, self.port, **connection_params)
weblate_1  |   File "/usr/lib/python2.7/smtplib.py", line 256, in __init__
weblate_1  |     (code, msg) = self.connect(host, port)
weblate_1  |   File "/usr/lib/python2.7/smtplib.py", line 316, in connect
weblate_1  |     self.sock = self._get_socket(host, port, self.timeout)
weblate_1  |   File "/usr/lib/python2.7/smtplib.py", line 291, in _get_socket
weblate_1  |     return socket.create_connection((host, port), timeout)
weblate_1  |   File "/usr/lib/python2.7/socket.py", line 571, in create_connection
weblate_1  |     raise err

How change settings.py?

I have changed, but nothing after restart.

docker-compose up -d and docker-compose up -d --build

same result - same settings.

Set "WEBLATE_SIMPLIFY_LANGUAGES=0" not working

I run the weblate image version 3.1.1-6 on a Kubernetes cluster. On the Web-UI, I get the message "Multiple translations were mapped to a single language code (en). You should disable SIMPLIFY_LANGUAGES to prevent Weblate mapping similar languages to one." while saving a new component.

So I followed the given advice and set the "WEBLATE_SIMPLIFY_LANGUAGES" to 0 to disable SIMPLIFY_LANGUAGES. I restarted the Kubernetes pod and tried it again. But still I get the above message. I also verified that the environment variable WEBLATE_SIMPLIFY_LANGUAGES inside the pod is really set to 0.

Could you give me a hint what I do wrong?

DB insert error at startup

When I start weblate with a docker container I see the following errors at startup. In version 3.3 the errors happens in a loop.

weblate_1   | Postgres is up
weblate_1   | Operations to perform:                                                                                                                                                    [0/1899]
weblate_1   |   Apply all migrations: accounts, addons, admin, auth, authtoken, checks, contenttypes, gitexport, lang, memory, screenshots, sessions, sites, social_django, trans, weblate_auth,
 wladmin
weblate_1   | Running migrations:
weblate_1   |   No migrations to apply.
weblate_1   | ERROR Handled exception error: cannot add item to database
weblate_1   | Traceback (most recent call last):
weblate_1   |   File "/usr/lib/python3.6/shelve.py", line 111, in __getitem__
weblate_1   |     value = self.cache[key]
weblate_1   | KeyError: 'entries'
weblate_1   |
weblate_1   | During handling of the above exception, another exception occurred:
weblate_1   |
weblate_1   | Traceback (most recent call last):
weblate_1   |   File "/usr/local/lib/python3.6/dist-packages/celery/beat.py", line 515, in _create_schedule
weblate_1   |     self._store[str('entries')]
weblate_1   |   File "/usr/lib/python3.6/shelve.py", line 113, in __getitem__
weblate_1   |     f = BytesIO(self.dict[key.encode(self.keyencoding)])
weblate_1   | KeyError: b'entries'
weblate_1   |
weblate_1   | During handling of the above exception, another exception occurred:
weblate_1   |
weblate_1   | Traceback (most recent call last):
weblate_1   |   File "/usr/local/bin/weblate", line 11, in <module>
weblate_1   |     sys.exit(main())
weblate_1   |   File "/usr/local/lib/python3.6/dist-packages/weblate/runner.py", line 34, in main
weblate_1   |     execute_from_command_line(argv)
weblate_1   |   File "/usr/local/lib/python3.6/dist-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
weblate_1   |     utility.execute()
weblate_1   |   File "/usr/local/lib/python3.6/dist-packages/django/core/management/__init__.py", line 375, in execute
weblate_1   |     self.fetch_command(subcommand).run_from_argv(self.argv)
weblate_1   |   File "/usr/local/lib/python3.6/dist-packages/django/core/management/base.py", line 316, in run_from_argv
weblate_1   |     self.execute(*args, **cmd_options)
weblate_1   |   File "/usr/local/lib/python3.6/dist-packages/django/core/management/base.py", line 353, in execute
weblate_1   |     output = self.handle(*args, **options)
weblate_1   |   File "/usr/local/lib/python3.6/dist-packages/weblate/utils/management/commands/cleanup_celery.py", line 35, in handle
weblate_1   |     app=app
weblate_1   |   File "/usr/local/lib/python3.6/dist-packages/celery/beat.py", line 458, in __init__
weblate_1   |     Scheduler.__init__(self, *args, **kwargs)
weblate_1   |   File "/usr/local/lib/python3.6/dist-packages/celery/beat.py", line 225, in __init__
weblate_1   |     self.setup_schedule()
weblate_1   |   File "/usr/local/lib/python3.6/dist-packages/celery/beat.py", line 486, in setup_schedule
weblate_1   |     self._create_schedule()
weblate_1   |   File "/usr/local/lib/python3.6/dist-packages/celery/beat.py", line 519, in _create_schedule
weblate_1   |     self._store[str('entries')] = {}
weblate_1   |   File "/usr/lib/python3.6/shelve.py", line 125, in __setitem__
weblate_1   |     self.dict[key.encode(self.keyencoding)] = f.getvalue()
weblate_1   | _dbm.error: cannot add item to database
weblate_1   | Exception ignored in: <bound method Shelf.__del__ of <shelve.DbfilenameShelf object at 0x7f0f3f198908>>
weblate_1   | Traceback (most recent call last):
weblate_1   |   File "/usr/lib/python3.6/shelve.py", line 162, in __del__
weblate_1   |     self.close()
weblate_1   |   File "/usr/lib/python3.6/shelve.py", line 144, in close
weblate_1   |     self.sync()
weblate_1   |   File "/usr/lib/python3.6/shelve.py", line 168, in sync
weblate_1   |     self[key] = entry
weblate_1   |   File "/usr/lib/python3.6/shelve.py", line 125, in __setitem__
weblate_1   |     self.dict[key.encode(self.keyencoding)] = f.getvalue()
weblate_1   | _dbm.error: cannot add item to database

Set SSH fingerprints manually

Hello,

As you know, ssh fingerprints for known_hosts need to be configured via the django admin panel in Weblate, which apparently is pointing at /app/data/ssh.

Is there any setting currently to set those externally to Weblate for automated environments? I've tried to CP files to this path with Docker, but apparently they keep getting removed on application execution (by Weblate itself?).

Maybe this issue would make more sense in Weblate (not Docker), but since you are the same author I'll put it here for now.

Thanks again for this project


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Internal Server Error when login with facebook

Is it a django bug? django/django#8505

Internal Server Error: /accounts/complete/facebook/

TypeError at /accounts/complete/facebook/
clean_authenticate_args() got multiple values for keyword argument 'request'

Request Method: GET
Request URL: https://xxx.com/accounts/complete/facebook/?redirect_state=qTTDUGTHjDouvFi2qgEzLn2VZOE5cNX&granted_scopes=email%2Cpublic_profile&denied_scopes&code=AQDpcnwLmtt0rJosU73t-xuOyU1fGmu1i3Ybsntk3Be3h1EyRtKXFld79mLnzaVde-Ptf8himxq-59T_15wMoVahcf_e1kENmeIitFju0cqE-EzlHWRwj9d7jJB6FDRVUj1BFXPxTVw9B67xOmCT5nxhufgYuvwrrYDM8i0FrjAMEdq3aG8y_wXHLLhjZRH0w2kkPeHe7zhVelzcf4xgnFDaGJOUW4RlUYseZ2-YxFcGzSe-FQeVDzUKQEjJWI2d-RArViQ0_hzXtWLQfSL0hrCschKuoFbcW4cNXyW2PUp0_xDp57mrVqaZWoEnhaBOXMk2pLysvhkBi41GVunSJ&state=qTTDUGT
Django Version: 1.11.1
Python Executable: /usr/bin/python
Python Version: 2.7.13
Python Path: ['/usr/local/bin', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']
Server time: Mon, 22 May 2017 04:27:15 +0000
Installed Applications:
(u'django.contrib.auth',
u'django.contrib.contenttypes',
u'django.contrib.sessions',
u'django.contrib.sites',
u'django.contrib.messages',
u'django.contrib.staticfiles',
u'django.contrib.admin.apps.SimpleAdminConfig',
u'django.contrib.admindocs',
u'django.contrib.sitemaps',
u'social_django',
u'crispy_forms',
u'compressor',
u'rest_framework',
u'rest_framework.authtoken',
u'weblate.trans',
u'weblate.lang',
u'weblate.permissions',
u'weblate.screenshots',
u'weblate.accounts',
u'weblate.utils',
u'weblate.gitexport',
u'weblate')
Installed Middleware:
(u'django.contrib.sessions.middleware.SessionMiddleware',
u'django.middleware.common.CommonMiddleware',
u'django.middleware.locale.LocaleMiddleware',
u'django.middleware.csrf.CsrfViewMiddleware',
u'weblate.accounts.middleware.AuthenticationMiddleware',
u'django.contrib.messages.middleware.MessageMiddleware',
u'django.middleware.clickjacking.XFrameOptionsMiddleware',
u'social_django.middleware.SocialAuthExceptionMiddleware',
u'weblate.accounts.middleware.RequireLoginMiddleware',
u'weblate.middleware.SecurityMiddleware')


Traceback:  

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py" in inner
 41.             response = get_response(request)

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _legacy_get_response
 249.             response = self._get_response(request)

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response
 187.                 response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response
 185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func
 57.         response = view_func(request, *args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py" in wrapped_view
 58.         return view_func(*args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/social_django/utils.py" in wrapper
 50.             return func(request, backend, *args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/social_django/views.py" in complete
 32.                        redirect_name=REDIRECT_FIELD_NAME, *args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/social_core/actions.py" in do_complete
 39.         user = backend.continue_pipeline(partial)

File "/usr/local/lib/python2.7/dist-packages/social_core/backends/base.py" in continue_pipeline
 190.                                           **partial.kwargs)

File "/usr/local/lib/python2.7/dist-packages/social_django/strategy.py" in authenticate
 115.         return authenticate(*args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/__init__.py" in authenticate
 100.             user = backend.authenticate(*args, **credentials)

File "/usr/local/lib/python2.7/dist-packages/social_core/backends/base.py" in authenticate
 78.         args, kwargs = self.strategy.clean_authenticate_args(*args, **kwargs)

Exception Type: TypeError at /accounts/complete/facebook/
Exception Value: clean_authenticate_args() got multiple values for keyword argument 'request'
Request information:
USER: anonymous

docker-compose up is not work

when I restart the weblate docker, I got the error message form weblate container. I didn't upgrade my postgres, and I used 9.4.

weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 204, in handle
weblate_1   |     fake_initial=fake_initial,
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 115, in migrate
weblate_1   |     state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 145, in _migrate_all_forwards
weblate_1   |     state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 244, in apply_migration
weblate_1   |     state = migration.apply(state, schema_editor)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/migration.py", line 129, in apply
weblate_1   |     operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/operations/special.py", line 193, in database_forwards
weblate_1   |     self.code(from_state.apps, schema_editor)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/weblate/permissions/migrations/0006_auto_20170404_1637.py", line 19, in migrate_acl
weblate_1   |     emit_post_migrate_signal(0, False, schema_editor.connection.alias)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/core/management/sql.py", line 53, in emit_post_migrate_signal
weblate_1   |     **kwargs
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 193, in send
weblate_1   |     for receiver in self._live_receivers(sender)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/weblate/permissions/models.py", line 163, in sync_create_groups
weblate_1   |     create_groups(False)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/weblate/permissions/models.py", line 141, in create_groups
weblate_1   |     settings.ANONYMOUS_USER_NAME,
weblate_1   | ValueError: Anonymous user (anonymous) already exists and enabled, please change ANONYMOUS_USER_NAME setting.
weblate_1   |   Applying permissions.0006_auto_20170404_1637...
weblate_1   | Postgres is up
weblate_1   | Operations to perform:
weblate_1   |   Apply all migrations: accounts, admin, auth, authtoken, contenttypes, gitexport, lang, permissions, screenshots, sessions, sites, social_django, trans
weblate_1   | Running migrations:
weblate_1   | Traceback (most recent call last):
weblate_1   |   File "/usr/local/bin/weblate", line 11, in <module>
weblate_1   |     sys.exit(main())
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/weblate/runner.py", line 33, in main
weblate_1   |     execute_from_command_line(argv)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
weblate_1   |     utility.execute()
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 355, in execute
weblate_1   |     self.fetch_command(subcommand).run_from_argv(self.argv)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 283, in run_from_argv
weblate_1   |     self.execute(*args, **cmd_options)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 330, in execute
weblate_1   |     output = self.handle(*args, **options)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 204, in handle
weblate_1   |     fake_initial=fake_initial,
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 115, in migrate
weblate_1   |     state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 145, in _migrate_all_forwards
weblate_1   |     state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 244, in apply_migration
weblate_1   |     state = migration.apply(state, schema_editor)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/migration.py", line 129, in apply
weblate_1   |     operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/operations/special.py", line 193, in database_forwards
weblate_1   |     self.code(from_state.apps, schema_editor)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/weblate/permissions/migrations/0006_auto_20170404_1637.py", line 19, in migrate_acl
weblate_1   |     emit_post_migrate_signal(0, False, schema_editor.connection.alias)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/core/management/sql.py", line 53, in emit_post_migrate_signal
weblate_1   |     **kwargs
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 193, in send
weblate_1   |     for receiver in self._live_receivers(sender)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/weblate/permissions/models.py", line 163, in sync_create_groups
weblate_1   |     create_groups(False)
weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/weblate/permissions/models.py", line 141, in create_groups
weblate_1   |     settings.ANONYMOUS_USER_NAME,
weblate_1   | ValueError: Anonymous user (anonymous) already exists and enabled, please change ANONYMOUS_USER_NAME setting.
weblate_1   |   Applying permissions.0006_auto_20170404_1637...

This is my docker-compse.yml

version: '2'
services:
  weblate:
    image: weblate/weblate
    links:
      - database
      - cache
    volumes:
      - weblate-data:/app/data
    env_file:
      - ./weblate/environment
    restart: always
    depends_on:
      - database
      - cache
  web:
    build: nginx
    links:
      - weblate
    ports:
      - "9112:80"
    volumes_from:
      - weblate:ro
    restart: always
    depends_on:
      - weblate
  database:
    image: postgres:9.4
    env_file:
      - ./weblate/environment
    volumes:
      - postgres-data:/var/lib/postgresql/data
    restart: always
  cache:
    image: memcached:1.4
    restart: always
volumes:
  weblate-data: {}
  postgres-data: {}

Configuration updates?

I updated some environmental variables (Google OAUTH, etc) but seems that restarting with docker-compose (stop/start) it's not enough to taking into account these new environmental variables.

Any tip? Because I have configured a project & components and I'm worry to lost that part.

TIA,

Startup: "ProgrammingError: relation "trans_project" does not exist"

Just cloned the project & following error appears:

[18/Aug/2015 17:40:47]"GET / HTTP/1.1" 500 59
Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "/app/local/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 63, in __call__
    return self.application(environ, start_response)
  File "/app/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 170, in __call__
    self.load_middleware()
  File "/app/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 52, in load_middleware
    mw_instance = mw_class()
  File "/app/local/lib/python2.7/site-packages/django/middleware/locale.py", line 24, in __init__
    for url_pattern in get_resolver(None).url_patterns:
  File "/app/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 402, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/app/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 396, in urlconf_module
    self._urlconf_module = import_module(self.urlconf_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/app/local/lib/python2.7/site-packages/weblate/urls.py", line 31, in <module>
    from weblate.sitemaps import SITEMAPS
  File "/app/local/lib/python2.7/site-packages/weblate/sitemaps.py", line 27, in <module>
    'queryset': Project.objects.all_acl(None),
  File "/app/local/lib/python2.7/site-packages/weblate/trans/models/project.py", line 45, in all_acl
    return self.get_acl_status(user)[0]
  File "/app/local/lib/python2.7/site-packages/weblate/trans/models/project.py", line 61, in get_acl_status
    project.id for project in projects if project.has_acl(user)
  File "/app/local/lib/python2.7/site-packages/django/db/models/query.py", line 162, in __iter__
    self._fetch_all()
  File "/app/local/lib/python2.7/site-packages/django/db/models/query.py", line 965, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/app/local/lib/python2.7/site-packages/django/db/models/query.py", line 238, in iterator
    results = compiler.execute_sql()
  File "/app/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 840, in execute_sql
    cursor.execute(sql, params)
  File "/app/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/app/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/app/local/lib/python2.7/site-packages/django/db/utils.py", line 97, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/app/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
ProgrammingError: relation "trans_project" does not exist
LINE 1: ..."."enable_hooks", "trans_project"."owner_id" FROM "trans_pro...
                                                             ^

[18/Aug/2015 17:41:03]"GET / HTTP/1.1" 500 59

Add rollbar integration

Weblate comes with rollbar integration and it would be useful to have it in the docker container as well.

Error when I login

Hey,

I got that error when I login: http://dpaste.com/0FVQ21X

File "/usr/local/lib/python2.7/dist-packages/weblate/accounts/forms.py" in clean
  575.                         try_get_user(username),

File "/usr/local/lib/python2.7/dist-packages/weblate/accounts/auth.py" in try_get_user
  31.         return User.objects.get(email=username)

File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py" in manager_method
  85.                 return getattr(self.get_queryset(), name)(*args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py" in get
  384.             (self.model._meta.object_name, num)

Exception Type: MultipleObjectsReturned at /accounts/login/
Exception Value: get() returned more than one User -- it returned 2!

Someone can help me?

Machine translation is not working

I've try to add env variable WEBLATE_MT_MICROSOFT_COGNITIVE_KEY
But it's seems to me, that settings.py populated with MACHINE_TRANSLATION_SERVICES but not with MT_SERVICES

MACHINE_TRANSLATION_SERVICES | ('weblate.trans.machine.weblatetm.WeblateTranslation',  'weblate.memory.machine.WeblateMemory',  'weblate.trans.machine.microsoft.MicrosoftCognitiveTranslation')
-- | --
MEDIA_ROOT | '/app/data/media'
MEDIA_URL | '/media/'
MESSAGE_STORAGE | 'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE | ['django.middleware.security.SecurityMiddleware',  'django.contrib.sessions.middleware.SessionMiddleware',  'django.middleware.common.CommonMiddleware',  'django.middleware.locale.LocaleMiddleware',  'django.middleware.csrf.CsrfViewMiddleware',  'weblate.accounts.middleware.AuthenticationMiddleware',  'django.contrib.messages.middleware.MessageMiddleware',  'django.middleware.clickjacking.XFrameOptionsMiddleware',  'social_django.middleware.SocialAuthExceptionMiddleware',  'weblate.accounts.middleware.RequireLoginMiddleware',  'weblate.middleware.SecurityMiddleware',  'weblate.wladmin.middleware.ConfigurationErrorsMiddleware']
MIGRATION_MODULES | {}
MONTH_DAY_FORMAT | 'F j'
MT_APERTIUM_APY | None
MT_AWS_ACCESS_KEY_ID | '********************'
MT_AWS_REGION | None
MT_AWS_SECRET_ACCESS_KEY | '********************'
MT_DEEPL_KEY | '********************'
MT_GOOGLE_KEY | '********************'
MT_MICROSOFT_COGNITIVE_KEY | '********************'
MT_MICROSOFT_ID | None
MT_MICROSOFT_SECRET | '********************'

MT_MYMEMORY_KEY | '********************'
MT_MYMEMORY_USER | None
MT_SAP_BASE_URL | None
MT_SAP_PASSWORD | '********************'
MT_SAP_SANDBOX_APIKEY | '********************'
MT_SAP_USERNAME | None
MT_SAP_USE_MT | True
MT_SERVICES | ('weblate.machinery.weblatetm.WeblateTranslation',  'weblate.memory.machine.WeblateMemory')

Could not create directory '/home/weblate/.ssh'

It looks like the docker image does not have the folder /home/weblate

When I redeploy the docker image and I try to commit something in the UI, I get the following error:

INFO cubica/ui: updating repository
ERROR cubica/ui: failed to update repository: Could not create directory '/home/weblate/.ssh'.
GitLab: The project you were looking for could not be found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists. (128)

the workaround for me is to ssh into my image and issue these commands:

cd /home
mkdir weblate
chown weblate:weblate weblate

skipping extra steps on first run

Is there reason why these are left as manual steps?

Setup the environment

docker-compose run --rm weblate migrate
docker-compose run --rm weblate collectstatic --noinput
# Note the admin password from this setp.
docker-compose run --rm weblate createadmin

these could be embeded into weblate entrypoint, or use some ephemeral container

createadmin supports specifying password, so could use it as another env as default admin pass:

  --password PASSWORD   Password to set, random is generated if not specified

Image does not start because of old Postgres version

When trying to bringing up an image with the current configuration I get the following error:

database_1 | FATAL: database files are incompatible with server
database_1 | DETAIL: The data directory was initialized by PostgreSQL version 9.4, which is not compatible with this version 9.6.3.

Github pull requests support

Hello,

I'm trying to add support for github pull requests to this image but unfortunately I'm stuck in the last and most important part of the process, ie the actual use of that feature. I know this has been discussed several times in the issue tracker of https://github.com/WeblateOrg/weblate but none of the answers helped me to solve my problem. Here's the situation:

  • I have a working install of weblate based on this image
  • I've tweaked weblate/Dockerfile so that hub is installed and available inside the weblate container
  • Once I enter that container, I can perform hub commands like hub clone user/repo; a /home/weblate/.config/hub config file holds the associated credentials
  • I've set GITHUB_USERNAME in weblate/settings.py to the same user written in .config/hub
  • When I create a component, I can select "Github" in the vcs field as expected

From this point, however, all the push operations result in a failed to push on repo: Permission denied (publickey). fatal: Could not read from remote repository. error. I've tried various combinations of protocols/urls in the "Push url" field without success.

Could you please provide some guidance? What I'm really missing in the documentation is a simple working example of that feature. I don't even know if it's bound to the "push" button or if I should see a "pull request" available somewhere in the UI. Any help would really be appreciated!

Move to Python 3 and Django 2

There should not be any blockers for switching to Pytho 3 and Django 2 as both are fully supported, so it should be just replacing of all python packages with python3 variants and maybe some changes in the uwsgi setup.

Pull requests welcome :-).

Not working on OSX

I have been running weblate via docker on osx for a while over the past months; I now wanted to set up an instance on a mac mini.
Unfortunately, it seems that the latest version of the containers no longer works.
They start, the log shows no errors, but there are no open ports, and I can not access weblate.

After running into these issues I tried the new current version on my macbook (where it was working before) => same problem.

Am I missing some new configuration options, or is there something else that I could try?

Inconsistencies in variables

If you want to set environment variables that are a boolean, you should set them like:

OFFLOAD=1 or 0 (not True/False)

and if you want to set a string you set SERVER_EMAIL=[email protected] (without quotes)

for allowed_hosts nothing seems to work :(

Took me an hour to find out *-)

Allow disabling email auth

In some cases only external auth is desired so it should be possible to disable social_core.backends.email.EmailAuth for the docker image.

Override LOGIN_REQUIRED_URLS_EXCEPTIONS for Docker

See #57 (comment) by @chteuchteu:

@nijel Hi there! Sorry to dig an old issue (but I'd rather dig a very related old one than opening a new one - or should I?) - we would like to override the LOGIN_REQUIRED_URLS_EXCEPTIONS from a Docker environment variable...

I guess that it wouldn't be as easy to implement as WEBLATE_SIMPLIFY_LANGUAGES since it's an array (of regexes)

2.12 upgrade issues

Hi,

I'm having a hard time upgrading from 2.11 to 2.12. Since there's a few things in this process I'm not familiar with, I might be doing noob mistakes, but here are the problems I encountered so far:

  1. Usual docker workflow suggests to replace the current container with an up-to-date version and then perform upgrade commands, however that's not possible in this case due to the Postgres 9.4/9.6 bump (BTW was there a particular reason to make that upgrade?). This isn't strictly related to weblate but I thought it would be worth mentionning because there's no way to know beforehand that a Postgres upgrade is required and because that operation is quite painful (docker-library/postgres#37).

  2. If I use the 2.12-2 version of this repo and just keep Postgres version to 9.4 (by overriding the corresponding line in docker-compose.yml), I can get the containers up and running, but any attempt to access the weblate container with docker-compose exec makes it crash. In this case, it seems to be necessary to run the commands from outside, like the cron tasks described in https://docs.weblate.org/en/latest/admin/deployments.html#maintenance-tasks:

    docker-compose run --rm weblate migrate

    (This could be a good addition to the weblate/docker doc)

  3. The command above seems to be successful:

    Postgres is up
    Operations to perform:
      Apply all migrations: accounts, admin, auth, authtoken, contenttypes, gitexport, lang, screenshots, sessions, sites, social_django, trans
    Running migrations:
      Applying accounts.0025_auto_20170211_1609... OK
      Applying accounts.0026_profile_special_chars... OK
      Applying trans.0072_auto_20170209_1234... OK
      Applying trans.0073_auto_20170209_1359... OK
      Applying trans.0074_auto_20170209_1412... OK
      Applying screenshots.0001_initial... OK
      Applying screenshots.0002_auto_20170215_0849... OK
      Applying screenshots.0003_auto_20170215_1633... OK
      Applying trans.0075_auto_20170215_1750... OK
    

    However, the app is still not accessible and I can see this exception in the logs:

    weblate_1   |   File "/usr/local/bin/weblate", line 11, in <module>
    weblate_1   |     sys.exit(main())
    weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/weblate/runner.py", line 33, in main
    weblate_1   |     execute_from_command_line(argv)
    weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    weblate_1   |     utility.execute()
    weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 359, in execute
    weblate_1   |     self.fetch_command(subcommand).run_from_argv(self.argv)
    weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 294, in run_from_argv
    weblate_1   |     self.execute(*args, **cmd_options)
    weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 345, in execute
    weblate_1   |     output = self.handle(*args, **options)
    weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 83, in handle
    weblate_1   |     executor = MigrationExecutor(connection, self.migration_progress_callback)
    weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 20, in __init__
    weblate_1   |     self.loader = MigrationLoader(self.connection)
    weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/loader.py", line 52, in __init__
    weblate_1   |     self.build_graph()
    weblate_1   |   File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/loader.py", line 268, in build_graph
    weblate_1   |     raise exc
    weblate_1   | django.db.migrations.exceptions.NodeNotFoundError: Migration trans.0075_auto_20170215_1750 dependencies reference nonexistent parent node (u'screenshots', u'0002_auto_20170215_0849')
    
  4. From this point I'm not sure what I'm supposed to do, but running weblate migrate once again yields the following output, that you might find interesting:

    No migrations to apply.
    Your models have changes that are not yet reflected in a migration, and so won't be applied.
    Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
    

    Executing the suggested makemigrations command also ends up with an error:

     Migrations for 'trans':
     usr/local/lib/python2.7/dist-packages/weblate/trans/migrations/0076_auto_20170313_1125.py:
        - Alter field check on check
        - Alter field commit_message on subproject
        - Alter field vcs on subproject
     Traceback (most recent call last):
       File "/usr/local/bin/weblate", line 11, in <module>
         sys.exit(main())
       File "/usr/local/lib/python2.7/dist-packages/weblate/runner.py", line 33, in main
         execute_from_command_line(argv)
       File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
         utility.execute()
       File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 359, in execute
         self.fetch_command(subcommand).run_from_argv(self.argv)
       File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 294, in run_from_argv
         self.execute(*args, **cmd_options)
       File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 345, in execute
     output = self.handle(*args, **options)
       File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/makemigrations.py", line 192, in handle
     self.write_migration_files(changes)
       File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/makemigrations.py", line 228, in write_migration_files
     with open(writer.path, "wb") as fh:
     IOError: [Errno 13] Permission denied: u'/usr/local/lib/python2.7/dist-packages/weblate/trans/migrations/0076_auto_20170313_1125.py'
    

Any help would be greatly appreciated!

ssl sertificate expired

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:-- 0curl: (60) SSL certificate problem: certificate has expired
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.

gzip: stdin: unexpected end of file
tar: Child returned status 1

ERROR: Service 'weblate' failed to build: The command '/bin/sh -c curl https://dl.cihar.com/weblate/Weblate-2.9.tar.gz | tar xzf - --strip-components=1 --no-same-owner -C /app Weblate-2.9/examples' returned a non-zero code: 2

Use custom addins, checks and fixups scripts

In the case of using Weblate with Docker I haven't been able to find a way to use my custom checks scripts.

I'm not sure how to do that because according to the documentation there are the following options:

  • Copy the files to the default Python site-packages. The one from the user's home directory should work also.
  • Copy the files to the Weblate installation weblate/trans/checks/.
  • Create a Python package and install it in your (virtual) environment.
  • I haven't tested this option but I guess that adding the directory to the PYTHONPATH environment variable should work also.

I think these options won't work in Docker because the Python directory (including Weblate) aren't permanent. They get reset every time we start the image. And I would like to avoid creating my custom Docker image every time I want to add a script.

I don't much about Docker but I have some ideas:

  • Mount an external folder as a volume with Weblate customization files like addins, checks and fixups. Then the entrypoint script ("start") will copy from that volume to the Weblate installation or set the PYTHONPATH environment variable to there.

  • Create a Python package, add the list of additional packages to install in docker.override.yml and in the entrypoint script ("start"), run pip install -U pkg1 pkg2. So we have always the latest version of the scripts. I think we should provide also a way to specify custom PyPi repositories just in case you can't publish your package in the public PyPi repository or you are testing locally.

In any case, we will need to make modifications in the environment and settings.py files to modify theCHECK_LIST option.

Do you have more ideas? What would you recommend?
I am happy to contribute with a pull request.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Invalid HTTP_HOST header: ''

I keep getting this email from weblate running in docker. Any clue what is causing this or how to fix it?
Seems to happen at random times, maybe once or twice per hour.

subject: [Weblate] ERROR (EXTERNAL IP): Invalid HTTP_HOST header: ''. The domain name provided is not valid according to RFC 1034/1035.

Invalid HTTP_HOST header: ''. The domain name provided is not valid according to RFC 1034/1035.

Report at / Invalid HTTP_HOST header: ''. The domain name provided is not valid according to RFC 1034/1035.

Request Method: GET Request URL: http:/// Django Version: 2.1.3 Python Executable: /usr/bin/uwsgi-core Python Version: 3.6.7 Python Path: ['/usr/local/lib/python3.6/dist-packages/', ‘.’, '', ‘/usr/lib/python36.zip’, ‘/usr/lib/python3.6’, ‘/usr/lib/python3.6/lib-dynload’, ‘/usr/local/lib/python3.6/dist-packages’, ‘/usr/lib/python3/dist-packages’, ‘/’] Server time: Ср, 12 Дек 2018 09:52:23 -0600 Installed Applications: ['django.contrib.auth',

'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin.apps.SimpleAdminConfig',
'django.contrib.admindocs',
'django.contrib.sitemaps',
'social_django',
'crispy_forms',
'compressor',
'rest_framework',
'rest_framework.authtoken',
'weblate.addons',
'weblate.auth',
'weblate.checks',
'weblate.formats',
'weblate.machinery',
'weblate.trans',
'weblate.lang',
'weblate.langdata',
'weblate.memory',
'weblate.screenshots',
'weblate.accounts',
'weblate.utils',
'weblate.vcs',
'weblate.wladmin',
'weblate',
'weblate.gitexport']
Installed Middleware: ['weblate.middleware.ProxyMiddleware',

'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'weblate.accounts.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'social_django.middleware.SocialAuthExceptionMiddleware',
'weblate.accounts.middleware.RequireLoginMiddleware',
'weblate.middleware.SecurityMiddleware']
Request information: USER: [unable to retrieve the current user]

GET: No GET data

POST: No POST data

FILES: No FILES data

COOKIES: No cookie data

Any plans to make this ready for docker swarm mode?

This is a feature request.

Hi, deploying this with '''docker stack''' is not ready yet. Docker swarm mode needs

  • docker-compose file version 3.x
  • replacing docker legacy links with docker network features

That would be great. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.