Commit graph

61 commits

Author SHA1 Message Date
David Mehren
f606a7825f refactor(migrations): move cleanup code into migration
We cannot execute the cleanup script as a subprocess with sqlite,
as we now wrap the migrations in a SAVEPOINT, which blocks a second
process.

This moves the cleanup code into the migration file, so it can be
executed in-process.

Signed-off-by: David Mehren <git@herrmehren.de>
2022-11-06 22:24:48 +01:00
David Mehren
e222225866 Drop support for Node.js 12
Signed-off-by: David Mehren <git@herrmehren.de>
2022-05-01 21:03:19 +02:00
Sheogorath
3d7bf464d9
docs(manual): Adjust instructions to use only pinned dependencies
This patch adds `--frozen-lockfile` to our regular `yarn install` calls
during manual set up. This should ensure people get the expected
versions and not any newer or older versions that might behave
unexpectedly.

References:
https://github.com/yarnpkg/yarn/issues/5847#issuecomment-537521943
https://classic.yarnpkg.com/en/docs/cli/install#toc-yarn-install-frozen-lockfile

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2022-04-12 20:16:33 +02:00
David Mehren
445a3787d9 bin/manage_users: fix formatting
Signed-off-by: David Mehren <git@herrmehren.de>
2022-04-03 22:14:27 +02:00
David Mehren
337173bb38 bin/manage_users: Don't allow empty passwords
Signed-off-by: David Mehren <git@herrmehren.de>
2022-04-03 22:14:27 +02:00
David Mehren
101bedaecd bin/manage_users: Always treat pass argument as string
Fixes #1945

Signed-off-by: David Mehren <git@herrmehren.de>
2022-04-03 22:14:27 +02:00
David Mehren
87c83dcba5
Merge pull request #1246 from hedgedoc/fix/heroku_pg_ssl
Ignore Postgres SSL errors on Heroku
2021-05-09 14:59:29 +02:00
Philip Molares
a4b4ebd80c Docs: Add mention to install devDependencies
Before `yarn build` can be succesfully run, we need to install the devDependencies.
This is necessary, because `bin/setup` does not install the devDependencies…

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-05-08 13:47:31 +02:00
David Mehren
86be1243f8
Ignore Postgres SSL errors on Heroku
The connection to Heroku's Postgres instances must use SSL,
 but not check the certificate.

 This adds the necessary configuration to the Heroku setup script.

Fixes #1245

Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-07 21:43:06 +02:00
David Mehren
926493a983
Only install production dependencies in bin/setup
Signed-off-by: David Mehren <git@herrmehren.de>
2021-05-05 15:38:00 +02:00
David Mehren
d52a43e811
Fix version error wording in bin/setup
The previous error message stated that the version of Node or
Yarn is "outdated", which might be accurate coincidentally,
but is not what the script checks.

This commit changes the wording to use "not supported", which
is more accurate to the true check in the script.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-04-22 22:52:53 +02:00
David Mehren
e1df30bd5c
Raise minimum required Node.js version to 12
As Node 10 will be EOL at April 30th, we should stop supporting
and/or promoting the usage of that version.

See also https://endoflife.date/nodejs

Signed-off-by: David Mehren <git@herrmehren.de>
2021-04-22 22:52:38 +02:00
David Mehren
4e5ff6f075
Update link to config docs in setup script
Signed-off-by: David Mehren <git@herrmehren.de>
2021-03-06 10:36:24 +01:00
David Mehren
bf0a7ebee7
Remove .sequelizerc
After https://github.com/hedgedoc/hedgedoc/pull/969 was merged,
a separate configuration file for the sequelize-cli is no longer
required.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-03-06 10:34:22 +01:00
David Mehren
252141560f
Switch to minio v7 API
The secure parameter is now called useSSL
https://github.com/minio/minio-js/releases/tag/7.0.0

Signed-off-by: David Mehren <git@herrmehren.de>
2021-02-12 23:11:37 +01:00
David Mehren
ac7dd2982f
Fix inconsistent spacing in bin/setup
Signed-off-by: David Mehren <git@herrmehren.de>
2020-11-17 21:29:54 +01:00
David Mehren
cbce0caa84
Fix shellcheck error in bin/setup
Signed-off-by: David Mehren <git@herrmehren.de>
2020-11-17 21:22:48 +01:00
David Mehren
64d6073aa1
Improve wording of yarn version error in setup script
Signed-off-by: David Mehren <git@herrmehren.de>
2020-11-17 20:53:58 +01:00
David Mehren
ca0f1f9a4e
Prettify messages in setup script
Signed-off-by: David Mehren <git@herrmehren.de>
2020-11-17 20:47:18 +01:00
David Mehren
1529d54b43
Update checks for correct Node.js and Yarn versions
Signed-off-by: David Mehren <git@herrmehren.de>
2020-11-17 20:46:43 +01:00
Sheogorath
0ad434a69a
Add some version checks to setup script
There are some distros out there, shipping quite outdated packages with
them, which results in weird issues. Let's check that we have a more or
less up to date version of node and yarn installed.

This patch adds those checks and this way should provide some helpful
error messages to people who try to install CodiMD.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2020-11-17 20:46:42 +01:00
Tilman Vatteroth
978538c0de
Correct repo name
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2020-11-14 22:24:44 +01:00
Erik Michelson
b28839484d
Replace CodiMD with HedgeDoc
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: References in public/views

Signed-off-by: David Mehren <git@herrmehren.de>
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: Update links in README

Signed-off-by: David Mehren <git@herrmehren.de>
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: Update links in SECURITY.md

Signed-off-by: David Mehren <git@herrmehren.de>
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: Update links in LICENSE

Signed-off-by: David Mehren <git@herrmehren.de>
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: Update links in docs/configuration.md

Signed-off-by: David Mehren <git@herrmehren.de>
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: Update links in bin/setup

Signed-off-by: David Mehren <git@herrmehren.de>
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: References in docs/guides

Signed-off-by: David Mehren <git@herrmehren.de>
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: References in docs/dev

Signed-off-by: David Mehren <git@herrmehren.de>
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: References in docs/guides/auth

Signed-off-by: David Mehren <git@herrmehren.de>
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: References in docs/setup

Signed-off-by: David Mehren <git@herrmehren.de>
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: Update various links in code to the new GitHub org.

Signed-off-by: David Mehren <git@herrmehren.de>
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: codiMDVersion.js is now hedgeDocVersion.js

Signed-off-by: David Mehren <git@herrmehren.de>
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: References in docs/setup/yunohost

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rebrand to HedgeDoc: Add banner and logo

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: Update links in docs/guides/migrate-etherpad

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: Remove note in docs/guides/auth/github

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: Replace links in public/docs/features

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: Add todo placeholder in docs/history

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: Replace github link in public/views/index/body

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: Replace github link in README

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: Add logo to README

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Rename to HedgeDoc: Add note about the renaming to the front page

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>

Removed Travis from README.md and change CodiMD to HedgeDoc in some places

Signed-off-by: Yannick Bungers <git@innay.de>

Some more renaming to HedgeDoc
- Fixed capitalization of HedgeDoc
- Added renaming for etherpad migration doc

Signed-off-by: Yannick Bungers <git@innay.de>

Changed Repo name to hedgedoc

Signed-off-by: Yannick Bungers <git@innay.de>
2020-11-14 21:18:36 +01:00
pierreozoux
47427a1b88 Adds convenience script to migrate to minio.
Signed-off-by: pierreozoux <pierre@ozoux.net>
2020-11-12 21:14:27 +01:00
Erik Michelson
e0f729e014
Fixed eslint errors (whitespaces)
Signed-off-by: Erik Michelson <erik@liltv.de>
2020-03-21 23:27:00 +01:00
Sheogorath
f42304c967
Clean up all foreign-key constraints
This patch cleans up the remaining possible foreign-key constraint. This
case seem to appear, when notes are deleted, but due to missing database
contraints not their authroships.

This function should clean that up as well and complete the preparation
for the new db contraints.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2020-03-21 21:05:52 +01:00
Sheogorath
41b13e71b6
Reduce requested arguments on cleanup
In order to prevent OOM situations due to large databases, this patch
should reduce the amount of data requested from the database
drastically.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2020-03-21 19:30:44 +01:00
Sheogorath
4884292b68
fixup! Add fix for missing deletion of notes on user-deletion request 2020-03-21 18:13:20 +01:00
Sheogorath
a9d98d4b52
Add fix for missing deletion of notes on user-deletion request
Depending on how the system was setup, this bug lead to keep user's data
around even after a successful deletion of user'S account. This patch
will make sure the missing database constraints are implemented and
missed out deletions are executed.

This bug was introduced to insufficent testing after implementing the
feature initially. It was well tested, using the app process itself, but
the migrations where missed out. I'm currently not sure, if there was
also a change in how sequelize handles cassaded deletion, since I'm
unter the impression that before switching to sequelize 5, this feature
has worked. But I haven't verified this.

No matter what, the cleanup process is rather straight forward and will
be invoked on migration, but can also be done manually using the new
`bin/cleanup` script.

This change will result in a release 1.6.1.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2020-03-21 16:14:43 +01:00
Claudius
ebe67298fc heroku complains about dialect
Signed-off-by: Claudius <opensource@amenthes.de>
2020-01-11 23:51:52 +01:00
Soeren Wegener
bb1c150698
Check for falsy existing_user variable. Fixes #234
Use another return code for "User already exist"
This allows external scripts to differentiate between failure reasons.

Signed-off-by: Soeren Wegener <wegener92@gmail.com>
2019-12-09 17:46:25 +01:00
Claudius
5c607c4f80 cleanup of the heroku configuration
this removes the general `postinstall` call to `bin/heroku` and instead
puts it into a heroku-prebuild hook. At the same time, env vars get
updated to use the `CMD` prefix. The configured buildpacks were not used.
Finally, npm run build is now automatically
done by Heroku.

Signed-off-by: Claudius <opensource@amenthes.de>
2019-03-31 01:29:34 +01:00
Sheogorath
7cde6958f3
Update links to new repositories
After a long discussion, it turned out that CodiMD as community project
and HackMD as a company, have fundamental different views on the project
governance.

Due to this, it came to point where the decision for a fork was made.
After the fork and move towards an own organisation, this patch updates
all links inside the project to the new repositories.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2019-03-27 19:31:34 +01:00
Daan Sprenkels
7c144ac7a9 Fix broken manage_users after Winston upgrade
Commit c3584770 upgrades Winston and with that version
`logger.transports.console` becomes undefined. This commit
updates the code to prevent the crash.

Signed-off-by: Daan Sprenkels <hello@dsprenkels.com>
2019-01-10 14:05:12 +01:00
Christoph (Sheogorath) Kern
6f7fd74b1a
Merge pull request #943 from SISheogorath/feature/improveSetup
Some minor improvements for setup script
2018-11-17 12:42:24 +01:00
Erona
3abf1f04ed
feat(bin): ensure email exists
Signed-off-by: Erona <erona@loli.bz>
2018-10-29 23:11:32 +08:00
Erona
e90d4d824b
feat(bin): add option --reset to reset user password
Signed-off-by: Erona <erona@loli.bz>
2018-10-29 23:11:32 +08:00
Erona
79842b82e8
refactor(bin): add function getPass in bin/manage_users
Signed-off-by: Erona <erona@loli.bz>
2018-10-29 23:11:32 +08:00
Erona
63626b1267
refactor(bin): eliminate var and use template string refactor string things
Signed-off-by: Erona <erona@loli.bz>
2018-10-29 23:11:32 +08:00
Erona
2f82e0c86a
refactor(bin): add function showUsage to refactor usage things
Signed-off-by: Erona <erona@loli.bz>
2018-10-29 23:11:19 +08:00
Erona
7b12945c49
refactor(bin): refactor check args in bin/manage_users
Signed-off-by: Erona <erona@loli.bz>
2018-10-29 22:34:45 +08:00
Sheogorath
5aec047a3e
Some minor improvements for setup script
Since we use `yarn` for our container setup and try to enforce
dependencies, we should also use yarn in the setup script.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-09-06 15:04:20 +01:00
Sheogorath
4b060c7dba
Rebrand HackMD to CodiMD
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-24 13:24:12 +02:00
Sheogorath
a40dcdd222
Prevent "wrong type"-issue
The argument is may interpreted as number which causes the "pass"
parameter of the user creation to fail. Probably the same applies to the
mail address. But mail addresses are by definition not allowed to start
by a number (iirc) which makes it less a problem. This is mainly a quick
fix. Should be refactored a bit in future.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-01-29 22:41:12 +01:00
Dario Ernst
9e0359e079 Add simple user-management tool for emailsignin …
Currently, administrators of closed instances need to manually fiddle in
their databases for user-management.
This commit adds a small commandline utility that allows to create and
delete users.

Signed-off-by: Dario Ernst <dario@kanojo.de>
2018-01-29 19:49:04 +01:00
Sheogorath
6ed44f0864
Prevent argument breaking by spaces 2017-10-10 13:36:37 +02:00
Yukai Huang
1af3727fef Remove npm install in heroku build
since heroku detects yarn.lock automatically
2017-05-07 18:54:18 +08:00
Sheogorath
9122ccd1b8 Add fail fast option
Fail the script if a command inside it fails to prevent a install with exitcode 0 even when commands in it are failing.
2017-01-23 06:11:20 +01:00
Yukai Huang
1ed1996639 Remove config.js from setup files 2017-01-13 23:37:16 +08:00
bananaappletw
78c51e5e88 Revert "Rename npm script"
This reverts commit ed83dfc862.
2017-01-04 14:30:47 +08:00