An easy to use to-do list and task scheduler webapp.
Note: Large portions of the front-end app's styling and scripting is hosted separately. Those resources can be found in the CyberGen49/web-resources repository.
While the intention isn't for others to be hosting copies of CyberTasks, hosting a local server may be useful for development.
- Install Node.js
- Everything is tested and working on Node v17.9.0
- Clone the repository to a directory on your computer
- Open your terminal and
cdinto the new directory - Run
npm installto install the required dependencies - Create a Discord application to use for sign-in
- In the OAuth2 tab, add a redirect URL for your domain, followed by
/discord-callback, likehttps://tasks.example.com/discord-callback
- In the OAuth2 tab, add a redirect URL for your domain, followed by
- Create a file in the project folder named
credentials.json, and paste the following contents within:{ "client_id": "...", "client_secret": "...", "redirect_url": "...", "allow_new_users": false } - Update each field of the file by replacing
...:client_idis your application's client IDclient_secretis your application's client secretredirect_urlis the same URL that you added to your applicationallow_new_usersdefines whether unapproved users are allowed to sign in or not
- If
allow_new_usersis set tofalse, create another file namedallowedUsers.jsonand list the Discord user IDs of the users you want to grant access to, like so:[ "id1", "id2", "id3", "..." ]- To copy user IDs, enable developer mode in Settings > Advanced, then right-click on a user and click "Copy ID"
- User IDs must be enclosed in quotes to work properly
- Download and install SQLite
- In your terminal (still in the project directory), create and structure the database with this command:
sqlite3 main.db ".read database-schema.sql" - Start the server with
npm start- Alternatively, run
node wrapper.jsto make sure the server restarts if it crashes. The wrapper is also capable of sending logs to a Discord channel using a bot. To enable this functionality, create a bot account on your Discord application, copy its token, and set it tobot_tokenincredentials.json, then setlog_channelto the ID of the text channel that you want logs to be sent in. Make sure the bot has the Message content intent enabled, and join it to your server by selecting bot under OAuth2 > URL Generator.
- Alternatively, run
The server is hosted on a nonstandard port, as it's meant to be proxied through a virtual host on a parent webserver like Apache or using a service like Cloudflare Tunnel.
