isso-comments / isso

a Disqus alternative
https://isso-comments.de
MIT License
5.04k stars 438 forks source link

Document how to switch from prebuilt package to from-source #464

Closed hamoid closed 3 years ago

hamoid commented 6 years ago

Hi! I see tons of useful features merged in the repo, but no new releases.

To be able to benefit from those new features, it would be great to have some documentation about how to switch from a running isso installed with pip install isso to the version at GitHub.

Would it be something like cd into the isso folder, delete the content, do git clone, and then pip install .? Using virtualenv, right? Is there a way to go back? (probably backup the database and the folder first?). Are there new required/important config settings?

Thank you :)

vincentbernat commented 6 years ago

Once you activated the virtualenv, you can install or upgrade isso from the directory it is cloned with python setup.py install (or /path/to/your/venv/bin/python setup.py install if you do not want to activate the virtualenv). You can dismiss the clone after that.

For downgrade, it is safer to just wipe your virtualenv and restart from scratch.

hamoid commented 6 years ago

Thank you @vincentbernat but I need more details :) My current isso folder is not cloned, it was installed as a package. The folder contains bin/, include/, lib/, local/, pip-selfcheck.json and share/. Do you mean I can run python setup.py install and it will let me switch to the version in GitHub? Sorry if this is trivial, but I'm not experienced in installing python packages. I just managed to make isso work a few years ago and it's been there undisturbed :)

vincentbernat commented 6 years ago

Did you run pip install isso inside or outside a virtualenv?

vincentbernat commented 6 years ago

I assume the folder you mention is your virtualenv. You can update it by:

  1. cloning Isso into some directory (outside the virtualenv) with git clone https://github.com/posativ/isso.git.
  2. installing the cloned version with cd isso; /path/to/your/folder/bin/python setup.py install.

You can discard the isso directory you got from the clone. You can repeat the step to upgrade. You can also downgrade, but Isso won't handle the database changes, so it's better to save the database and restart from scratch.

hamoid commented 6 years ago

How can I figure out if i used virtualenv? I assume I did, because it was recommended in the instructions.

Does setup.py need to run as root? Or can I specify --install-dir somewhere to not write into /usr/local?

Thank you!

hamoid commented 6 years ago

I think you forgot to mention

virtualenv .
source ./bin/activate

and that's why it was failing. With them setup is completed successfully. Continuing...

hamoid commented 6 years ago

Once more I can't make it work :( First I had CORS errors for an hour, due to having the same domain with and without www. After that, when I call the init.d/isso stop, it does not stop, but I did not realize, so it kept running for another hour confusing me with the lack of changes. Now it seems to run (I see it with top), the pid file shows the right pid, but embed.min.js is not found.

Update: I installed bower, requirejs, uglify-js, jade, did make init, make js, but still same result

hamoid commented 6 years ago

So this is what I did:

cd ~
mkdir new
cd new
git clone https://github.com/posativ/isso.git
cd isso
virtualenv .
source ./bin/activate
python setup.py install
npm install bower requirejs uglify-js jade
make init
make js
sudo killall isso -9
sudo rm /var/run/isso.pid
sudo /etc/init.d/isso start

/etc/nginx/sites-enabled/x.org

# 301 redirect 80 to https
# 301 redirect www to non-www
location /isso {
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Script-Name /isso;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_pass http://localhost:8080;
}

/w/isso/isso.cfg

Added admin_password, reply-notifications = true, rss base = . , limit = 100

html

Added

data-isso-reply-notifications="true"
data-isso-feed="true"

In ~/isso/ I have the old setup and it still works fine if I change my init.d script to use it. The new isso from GitHub returns 404 for the js file.

blatinier commented 6 years ago

I think some of your commands have failed. Please include the terminal response too.

For exemple you should not do npm install like you did. My guess is that it failed at compiling js in some way

hamoid commented 6 years ago

Thanks. I didn't want to install the npm packages as root, so I did it locally, and then added the 4 bin folders of those packages to the path temporarily, so the make commands would complete successfully. They finished without any errors. Are those npm packages required while isso runs? Or only to run make?

hamoid commented 6 years ago
PATH=$PATH:/home/abe/new/isso/node_modules/jade/bin/
PATH=$PATH:/home/abe/new/isso/node_modules/uglify-js/bin/
PATH=$PATH:/home/abe/new/isso/node_modules/requirejs/bin/
PATH=$PATH:/home/abe/new/isso/node_modules/bower/bin/

make init
(cd isso/js; bower --allow-root install almond requirejs requirejs-text jade)
bower almond#*                  cached https://github.com/jrburke/almond.git#0.3.3
bower almond#*                validate 0.3.3 against https://github.com/jrburke/almond.git#*
bower requirejs-text#*          cached https://github.com/requirejs/text.git#2.0.15
bower requirejs-text#*        validate 2.0.15 against https://github.com/requirejs/text.git#*
bower jade#*                    cached https://github.com/visionmedia/jade.git#1.11.0
bower jade#*                  validate 1.11.0 against https://github.com/visionmedia/jade.git#*
bower requirejs#*               cached https://github.com/jrburke/requirejs-bower.git#2.3.5
bower requirejs#*             validate 2.3.5 against https://github.com/jrburke/requirejs-bower.git#*

make js
make: Nothing to be done for 'js'.
List files in isso/js/ ``` $ ls -R isso/js/ .: app build.count.js build.embed.js components config.js count.dev.js count.js count.min.js embed.dev.js embed.js embed.min.js lib ./app: api.js config.js count.js dom.js globals.js i18n i18n.js isso.js jade.js lib lib.js text utils.js ./app/i18n: bg.js cs.js da.js de.js el_GR.js en.js eo.js es.js fa.js fi.js fr.js hr.js hu.js it.js nl.js pl.js ru.js sv.js vi.js zh_CN.js zh_TW.js ./app/lib: editor.js identicons.js promise.js ready.js ./app/text: arrow-down.svg arrow-up.svg comment.jade comment-loader.jade css.js dummy.js postbox.jade svg.js ./components: almond jade requirejs text ./components/almond: almond.js bower.json LICENSE package.json README.md ./components/jade: bin block-code.html component.json docs examples History.md jade.js lib LICENSE package.json README.md Readme_zh-cn.md release.js runtime.js support test ./components/jade/bin: jade.js ./components/jade/docs: client server.js stop.js style versions.json views ./components/jade/docs/client: index.js ./components/jade/docs/style: bg@2X.jpg bg.jpg footer.less highlighting.less index.less jade-logo-header.svg jade-logo.svg parameter-lists.less ./components/jade/docs/views: api.jade command-line.jade history.jade home.jade includes layout.jade reference reference.jade ./components/jade/docs/views/includes: ga.jade mixins.jade ./components/jade/docs/views/reference: attributes.jade case.jade code.jade comments.jade conditionals.jade doctype.jade extends.jade filters.jade includes.jade inheritance.jade interpolation.jade iteration.jade mixins.jade plain-text.jade tags.jade ./components/jade/examples: attributes.jade attributes.js client-compilation.jade client-compilation.js code.jade code.js dynamicscript.jade dynamicscript.js each.jade each.js extend.jade extend.js extend-layout.jade form.jade form.js includes includes.jade includes.js layout-debug.js layout.jade layout.js mixins mixins.jade mixins.js pet.jade README.md rss.jade rss.js text.jade text.js whitespace.jade whitespace.js ./components/jade/examples/includes: foot.jade head.jade scripts.jade style.css ./components/jade/examples/mixins: dialog.jade profile.jade ./components/jade/lib: compiler.js doctypes.js filters-client.js filters.js index.js inline-tags.js lexer.js nodes parser.js runtime.js utils.js ./components/jade/lib/nodes: attrs.js block-comment.js block.js case.js code.js comment.js doctype.js each.js filter.js index.js literal.js mixin-block.js mixin.js node.js tag.js text.js ./components/jade/support: benchmark.js ./components/jade/test: anti-cases browser cases command-line.js dependencies deprecated.js error.reporting.js examples.js fixtures jade.test.js mocha.opts README.md run.js unit.js ./components/jade/test/anti-cases: attrs.unescaped.jade case-when.jade case-without-with.jade doctype-5.jade else-condition.jade else-without-if.jade inlining-a-mixin-after-a-tag.jade key-char-ending-badly.jade key-ending-badly.jade mixin-args-syntax-error.jade mixins-blocks-with-bodies.jade multiple-non-nested-tags-on-a-line.jade non-existant-filter.jade non-mixin-block.jade open-brace-in-attributes.jade readme.md self-closing.jade self-closing-tag-with-body.jade tabs-and-spaces.jade unclosed-interpolated-call.jade unclosed-interpolated-tag.jade unclosed-interpolation.jade ./components/jade/test/browser: index.html index.jade ./components/jade/test/cases: attrs-data.html attrs-data.jade attrs.html attrs.interpolation.html attrs.interpolation.jade attrs.jade attrs.js.html attrs.js.jade attrs.unescaped.html attrs.unescaped.jade auxiliary basic.html basic.jade blanks.html blanks.jade block-code.html block-code.jade block-expansion.html block-expansion.jade block-expansion.shorthands.html block-expansion.shorthands.jade blockquote.html blockquote.jade blocks-in-blocks.html blocks-in-blocks.jade blocks-in-if.html blocks-in-if.jade case-blocks.html case-blocks.jade case.html case.jade classes-empty.html classes-empty.jade classes.html classes.jade code.conditionals.html code.conditionals.jade code.escape.html code.escape.jade code.html code.iteration.html code.iteration.jade code.jade comments.html comments-in-case.html comments-in-case.jade comments.jade comments.source.html comments.source.jade custom-filter.html custom-filter.jade doctype.custom.html doctype.custom.jade doctype.default.html doctype.default.jade doctype.keyword.html doctype.keyword.jade each.else.html each.else.jade escape-chars.html escape-chars.jade escape-test.html escape-test.jade escaping-class-attribute.html escaping-class-attribute.jade filters.cdata.html filters.cdata.jade filters.coffeescript.html filters.coffeescript.jade filters-empty.html filters-empty.jade filters.less.html filters.less.jade filters.markdown.html filters.markdown.jade filters.stylus.html filters.stylus.jade html5.html html5.jade html.html html.jade include-extends-from-root.html include-extends-from-root.jade include-extends-of-common-template.html include-extends-of-common-template.jade include-filter-coffee.coffee include-filter.html include-filter.jade include-filter-stylus.html include-filter-stylus.jade include-only-text-body.html include-only-text-body.jade include-only-text.html include-only-text.jade include.script.html include.script.jade includes.html includes.jade includes-with-ext-js.html includes-with-ext-js.jade include-with-text-head.html include-with-text-head.jade include-with-text.html include-with-text.jade include.yield.nested.html include.yield.nested.jade inheritance.alert-dialog.html inheritance.alert-dialog.jade inheritance.defaults.html inheritance.defaults.jade inheritance.extend.html inheritance.extend.include.html inheritance.extend.include.jade inheritance.extend.jade inheritance.extend.mixins.block.html inheritance.extend.mixins.block.jade inheritance.extend.mixins.html inheritance.extend.mixins.jade inheritance.extend.recursive.html inheritance.extend.recursive.jade inheritance.extend.whitespace.html inheritance.extend.whitespace.jade inheritance.html inheritance.jade inline-tag.html inline-tag.jade interpolation.escape.html interpolation.escape.jade javascript-new-lines.js layout.append.html layout.append.jade layout.append.without-block.html layout.append.without-block.jade layout.multi.append.prepend.block.html layout.multi.append.prepend.block.jade layout.prepend.html layout.prepend.jade layout.prepend.without-block.html layout.prepend.without-block.jade mixin-at-end-of-file.html mixin-at-end-of-file.jade mixin.attrs.html mixin.attrs.jade mixin.blocks.html mixin.blocks.jade mixin.block-tag-behaviour.html mixin.block-tag-behaviour.jade mixin-hoist.html mixin-hoist.jade mixin.merge.html mixin.merge.jade mixins.html mixins.jade mixins.rest-args.html mixins.rest-args.jade mixins-unused.html mixins-unused.jade mixin-via-include.html mixin-via-include.jade namespaces.html namespaces.jade nesting.html nesting.jade pre.html pre.jade quotes.html quotes.jade regression.1794.html regression.1794.jade regression.784.html regression.784.jade scripts.html scripts.jade scripts.non-js.html scripts.non-js.jade script.whitespace.html script.whitespace.jade single-period.html single-period.jade some-included.styl some.md some.styl source.html source.jade styles.html styles.jade tag.interpolation.html tag.interpolation.jade tags.self-closing.html tags.self-closing.jade template.html template.jade text-block.html text-block.jade text.html text.jade utf8bom.html utf8bom.jade vars.html vars.jade while.html while.jade xml.html xml.jade yield-before-conditional-head.html yield-before-conditional-head.jade yield-before-conditional.html yield-before-conditional.jade yield-head.html yield-head.jade yield.html yield.jade yield-title-head.html yield-title-head.jade yield-title.html yield-title.jade ./components/jade/test/cases/auxiliary: 1794-extends.jade 1794-include.jade blocks-in-blocks-layout.jade dialog.jade empty-block.jade escapes.html extends-empty-block-1.jade extends-empty-block-2.jade extends-from-root.jade includable.js include-from-root.jade inheritance.extend.mixin.block.jade inheritance.extend.recursive-grand-grandparent.jade inheritance.extend.recursive-grandparent.jade inheritance.extend.recursive-parent.jade layout.include.jade layout.jade mixin-at-end-of-file.jade mixins.jade pet.jade smile.html window.jade yield-nested.jade ./components/jade/test/dependencies: dependency1.jade dependency2.jade dependency3.jade extends1.jade extends2.jade include1.jade include2.jade ./components/jade/test/fixtures: append append-without-block compile.with.include.locals.error.jade compile.with.include.syntax.error.jade compile.with.layout.locals.error.jade compile.with.layout.syntax.error.jade compile.with.layout.with.include.locals.error.jade compile.with.layout.with.include.syntax.error.jade element-with-multiple-attributes.jade include.locals.error.jade include.syntax.error.jade invalid-block-in-extends.jade issue-1593 layout.jade layout.locals.error.jade layout.syntax.error.jade layout.with.runtime.error.jade mixin.error.jade mixin-include.jade multi-append-prepend-block perf.jade prepend prepend-without-block runtime.error.jade runtime.layout.error.jade runtime.with.mixin.error.jade scripts.jade ./components/jade/test/fixtures/append: app-layout.jade layout.jade page.html page.jade ./components/jade/test/fixtures/append-without-block: app-layout.jade layout.jade page.jade ./components/jade/test/fixtures/issue-1593: include.jade include-layout.jade index.jade layout.jade ./components/jade/test/fixtures/multi-append-prepend-block: redefine.jade root.jade ./components/jade/test/fixtures/prepend: app-layout.jade layout.jade page.html page.jade ./components/jade/test/fixtures/prepend-without-block: app-layout.jade layout.jade page.html page.jade ./components/requirejs: bower.json LICENSE README.md require.js ./components/text: bower.json LICENSE package.json README.md text.js ./lib: requirejs-jade ./lib/requirejs-jade: jade.js ```
hamoid commented 6 years ago

I think some of your commands have failed. Please include the terminal response too.

It seems like no commands failed, right? What would be the way to debug a 404 for the embed.js?

blatinier commented 6 years ago

First we see the file is present in your listing so the problem il probably in the http server configuration.

Check the full path to the embed.js file, check your nginx configuration to ensure they allow to serve such paths. Ensure isso is running. Check isso logfiles to search for errors.

404 probably means nginx cannot reach isso (an isso fail would be a 5XX, a forbidden path would be 403) Or that isso cannot find the embed.js (file not existing, file in the wrong location…)

I hope this will help

hamoid commented 6 years ago

The server runs without any errors. In the ngnix log I see this:

50.84.190.226 - - [13/Aug/2018:16:40:42 +0200] "GET /isso/js/embed.min.js HTTP/1.1" 404 209 "https://foo.org/bar.html" "Mozilla/5.0 (X11; Lin
ux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"

With the new isso I access embed.js and it returns 404. I stop the new server, start the old one, access the same URL, and the file is suddenly there.

Do I need to make any changes to nginx when upgrading isso? May the public-endpoint setting be related to this? I don't know what to try...

This is the diff between the new/old config files:

3c3
< dbpath = /w/isso/foo.db
---
> dbpath = /w/isso/fooNEW.db
13a14,16
> reply-notifications = true
> log-file = /w/isso/issoNew.log
> admin_password = *************
31a35,36
> public-endpoint = 
> ; https://foo.org/isso/
51a57,59
> [rss]
> base = .
> limit = 100
jsxzljx commented 6 years ago

I have solved the problem, just change the python setup.py install to python setup develop. (09/06/2018)

Here is the previous comments:

I have the same problem, here is my steps

# git clone and generate a virtual environment.
cd isso
python setup.py install
make init
npm install -g requirejs uglify-js jade
make js
ls isso/js
# app  build.count.js  build.embed.js  components  config.js  count.dev.js 
# count.js  count.min.js  embed.dev.js  embed.js  embed.min.js  lib
# here we can see the embed.min.js
isso -c my_isso_config run
#  it shows INFO: connected to ...

However, I cannot find the embed.min.js or embed.js by either visit http://commet.example.com/js/embed.min.js or just curl http://localhost:1234/js/embed.min.js in the bash, it returns 404.

If I install isso by pip, I can reach the embed.min.js by just curl http://localhost:1234/js/embed.min.js. Thus, I think something must be wrong in my source code installation steps.

ix5 commented 3 years ago

I think installing from source is well-documented now. @hamoid do you want to close this?

hamoid commented 3 years ago

Right. I'll close it and a new issue could be opened if there's any issues upgrading. Thank you!