THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
a809cafa80 fix 7 months ago
bin Initial commit 2 years ago
config Initial commit 2 years ago
deploy Add npm install command to docker file 2 years ago
lib Initial commit 2 years ago
modules Initial commit 2 years ago
providers Initial commit 2 years ago
public Initial commit 2 years ago
secrets Initial commit 2 years ago
views Initial commit 2 years ago
.gitignore Initial commit 2 years ago
LICENSE.md Initial commit 2 years ago
README.md Add installation tutorial to readme 2 years ago
app.js Initial commit 2 years ago
package.json fix 7 months ago

README.md

Atom Package Sync Server

Server side for hosting the synchronization service of atom-package-sync.

How to install

1. Install prerequisites

The service uses NodeJs for the server, MongoDB as its database and Redis for caching. On Ubutun/Debian, you can install them like this:

sudo apt-get install nodejs mongodb redis-server

2. Clone atom-package-sync-server

git clone https://github.com/macor161/atom-package-sync-server.git

3. Configure the server

Before running the server, two files must be created:

  • config/production.json
  • secrets/production.json

The first one contains the configuration settings and the second one contains more sensitive data, like passwords and secret keys.

A basic template exists for both:

mv config/default.json.example config/production.json

In the config file:

  • serverPort: Listening port of the server (default 80)
  • database: Url for connecting to MongoDB (default mongodb://localhost:27017/atom-package-sync)
  • cacheHost: Redis server host (default localhost)
  • cachePort: Redis port (default 6379)
  • cacheDb: Redis database number (default 0)
  • googleClientAppId: Google Id
  • googleClientWebId: Not currently used, you can keep it blank

To copy the second config template:

mv secrets/default.json.example secrets/production.json
  • tokens: Private key for token generation
  • googleClientAppSecret: Private key for Google Auth

4. Install NPM modules

npm install --production

5. Setup NODE_ENV environment variable

For production use, the server needs NODE_ENV environment variable to be set to production:

export NODE_ENV=production

6. Run the server

npm start

Last notes

A docker file is available for easy setup. It doesn’t contain MongoDb nor Redis, only the node server.

docker build -t atom-package-sync-server -f deploy/Dockerfile .
docker run -d -p 80:80 atom-package-sync-server