Skip to content

Commit

Permalink
Use yarn, add eslint, add to Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
wlonk committed Jan 21, 2020
1 parent 04b1875 commit 33abf0c
Show file tree
Hide file tree
Showing 23 changed files with 11,375 additions and 12,631 deletions.
19 changes: 19 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true
},
extends: [
'standard'
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parserOptions: {
ecmaVersion: 2018
},
rules: {
}
}
65 changes: 65 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,68 @@ The code is uploaded here in the hopes it can be made more secure, more efficien
If you see a serious safety breach, particularly one involving user data, please submit an issue or - even better - a fix, and I'll upload the updated code to the server as soon as I can. Your support is genuinely appreciated.

sweet has been an extremely uphill learning experience for me - I'm entirely self-taught, and am acutely aware that this code is a mess in need of major editing and potentially re-writing. If you'd like to help out, you can find some planned and in-progress work on the [Trello](https://trello.com/b/wzCmHAqi/sweet-development) and more current stuff on the incomplete [functional specification](https://docs.google.com/document/d/1R6jw7jHLAzM-PkLaNzbyalOqKVmUIEzNyhNHpMMlj10/edit?usp=sharing) - get in touch, because I'd love your help.

## Running in local dev

Install mongodb however you prefer. On OS X with Homebrew, that's:

```
brew install mongodb-community
brew services start mongodb-community
```

Then run `yarn` to install dependencies, then `yarn start` to start the server. Go to `http://localhost:8686` to see it running!

If you do anything that triggers an email, it won't get sent for real in local dev, it'll just get output into your console.

You need to prepopulate the users collection with Sweetbot to let logins work. Something like:

```
db.users.insert({
_id: ObjectId("5c962bccf0b0d14286e99b68"),
joined: Date.now(),
lastOnline: Date.now(),
lastUpdated: Date.now(),
isVerified: false,
verificationToken: '',
verificationTokenExpiry: Date.now(),
email: '[email protected]',
username: 'sweetbot',
password: 'invalid password hash',
passwordResetToken: '',
passwordResetTokenExpiry: Date.now(),
image: '',
imageEnabled: false,
displayName: 'SweetBot',
pronouns: 'bot/bot',
aboutRaw: '',
aboutParsed: '',
websiteRaw: '',
websiteParsed: '',
location: '',
notifications: [],
pushNotifSubscriptions: [],
communities: [],
bannedCommunities: [],
mutedCommunities: [],
hiddenRecommendedUsers: [],
hiddenRecommendedCommunities: [],
settings: {
timezone: "auto",
autoDetectedTimeZone: "",
profileVisibility: "invisible",
newPostPrivacy: "public",
imageQuality: "standard",
homeTagTimelineSorting: "fluid",
userTimelineSorting: "chronological",
communityTimelineSorting: "fluid",
flashRecentComments: true,
digestEmailFrequency: "off",
emailTime: "17:00",
emailDay: "Sunday",
showRecommendations: true,
showHashtags: true,
sendMentionEmails: true,
}
})
```
412 changes: 206 additions & 206 deletions app/emailer.js

Large diffs are not rendered by default.

Loading

0 comments on commit 33abf0c

Please sign in to comment.