Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added flag to enable htaccess rewritebase #15

Closed
wants to merge 2 commits into from
Closed

Added flag to enable htaccess rewritebase #15

wants to merge 2 commits into from

Conversation

PVince81
Copy link

Fixes #14

@PVince81
Copy link
Author

PVince81 commented Nov 29, 2019

  • TODO: how to regenerate README.md => seems it's done in Drone
  • BUG: some errors when running grep

@PVince81
Copy link
Author

PVince81 commented Nov 30, 2019

  • what to do in migration cases, for setups that exist before this change ?
    • because the default was false (no htaccess.rewritebase) but now the default becomes true ?
    • should we also set the default to false ?
    • ⚠️ note that this setting will change the format of the URLs, so formerly shared public links might not work any more if they contained no index.php but now index.php is needed

@PVince81
Copy link
Author

I have some issues with the condition for running "occ maintenance:update:htaccess":
The debug output does show that the two values / conditions are different, however when used in a when statement, it doesn't seem to detect the difference.

This is the output:

TASK [owncloud : Get current htaccess rewrite state from .htaccess file] *******
ok: [owncloud1] => {"changed": false, "cmd": ["/bin/grep", "RewriteBase /", "/var/www/owncloud/.htaccess"], "delta": "0:00:00.005805", "end": "2019-11-30 21:07:03.277409", "failed_when_result": false, "msg": "non-zero return code", "rc": 1, "start": "2019-11-30 21:07:03.271604", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}                                                          

TASK [owncloud : debug] ********************************************************
ok: [owncloud1] => {
    "msg": [
        "### owncloud_register_htaccess_rewrite_check = {'stderr_lines': [], u'cmd': [u'/bin/grep', u'RewriteBase /', u'/var/www/owncloud/.htaccess'], u'end': u'2019-11-30 21:07:03.277409', u'stdout': u'', u'changed': False, u'rc': 1, u'failed': False, u'stderr': u'', u'delta': u'0:00:00.005805', u'msg': u'non-zero return code', 'stdout_lines': [], 'failed_when_result': False, u'start': u'2019-11-30 21:07:03.271604'}",                                                                                                                      
        "### RewriteBase present ? False", 
        "### owncloud_rewrite_base_enabled = True"
    ]
}

TASK [owncloud : Update htaccess rewrite rules] ********************************
skipping: [owncloud1] => {"changed": false, "skip_reason": "Conditional result was False"}

Then when condition is here: https://github.com/owncloud-ansible/owncloud/pull/15/files#diff-8f75a630e519e3c8689f860696b06c61R50

According to the debug output above that uses the same conditions, the "when" condition should evaluate to False != True so it should run the command.

If I explicitly write False != True it works... So maybe something is weird in my expression ?

@PVince81
Copy link
Author

  • TODO: adjust molecule tests and remove "index.php" there ? (assuming removing index.php is by default)

@PVince81
Copy link
Author

problem with the condition solved: I was assuming that the value of "owncloud_rewrite_base_enabled" was a boolean but it was actually a string...

@PVince81 PVince81 marked this pull request as ready for review November 30, 2019 21:56
@TheRealBro
Copy link

I guess this needs a complete rewrite to fix #14

@TheRealBro TheRealBro closed this Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option for removing "index.php" from URL (aka rewritebase)
3 participants