在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):toptal/haste-server开源软件地址(OpenSource Url):https://github.com/toptal/haste-server开源编程语言(OpenSource Language):JavaScript 84.4%开源软件介绍(OpenSource Introduction):HasteHaste is an open-source pastebin software written in node.js, which is easily installable in any network. It can be backed by either redis or filesystem, and has a very easy adapter interface for other stores. A publicly available version can be found at hastebin.com Major design objectives:
Haste works really well with a little utility called haste-client, allowing you to do things like:
which will output a URL to share containing the contents of Tested Browsers
Installation
Settings
Rate LimitingWhen present, the See the README for connect-ratelimit for more information! Key GenerationPhoneticAttempts to generate phonetic keys, similar to {
"type": "phonetic"
} RandomGenerates a random key {
"type": "random",
"keyspace": "abcdef"
} The optional keySpace argument is a string of acceptable characters for the key. StorageFileTo use file storage (the default) change the storage section in {
"path": "./data",
"type": "file"
} where File storage currently does not support paste expiration, you can follow #191 for status updates. RedisTo use redis storage you must install the
Once you've done that, your config section should look like: {
"type": "redis",
"host": "localhost",
"port": 6379,
"db": 2
} You can also set an All of which are optional except If your Redis server is configured for password authentification, use the PostgresTo use postgres storage you must install the
Once you've done that, your config section should look like: {
"type": "postgres",
"connectionUrl": "postgres://user:password@host:5432/database"
} You can also just set the environment variable for You will have to manually add a table to your postgres database:
You can also set an All of which are optional except MongoDBTo use mongodb storage you must install the 'mongodb' package in npm
Once you've done that, your config section should look like: {
"type": "mongo",
"connectionUrl": "mongodb://localhost:27017/database"
} You can also just set the environment variable for Unlike with postgres you do NOT have to create the table in your mongo database prior to running. You can also set an MemcachedTo use memcache storage you must install the
Once you've done that, your config section should look like: {
"type": "memcached",
"host": "127.0.0.1",
"port": 11211
} You can also set an All of which are optional except RethinkDBTo use the RethinkDB storage system, you must install the
Once you've done that, your config section should look like this: {
"type": "rethinkdb",
"host": "127.0.0.1",
"port": 28015,
"db": "haste"
} In order for this to work, the database must be pre-created before the script is ran.
Also, you must create an You can optionally add the Google DatastoreTo use the Google Datastore storage system, you must install the
Once you've done that, your config section should look like this: {
"type": "google-datastore"
} Authentication is handled automatically by Google Cloud service account credentials, by providing authentication details to the GOOGLE_APPLICATION_CREDENTIALS environmental variable. Amazon S3To use Amazon S3 as a storage system, you must
install the
Once you've done that, your config section should look like this: {
"type": "amazon-s3",
"bucket": "your-bucket-name",
"region": "us-east-1"
} Authentication is handled automatically by the client. Check Amazon's documentation for more information. You will need to grant your role these permissions to your bucket: {
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:GetObject",
"s3:PutObject"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::your-bucket-name-goes-here/*"
}
]
} DockerBuild imagedocker build --tag haste-server . Run containerFor this example we will run haste-server, and connect it to a redis server docker run --name haste-server-container --env STORAGE_TYPE=redis --env STORAGE_HOST=redis-server --env STORAGE_PORT=6379 haste-server Use docker-compose exampleThere is an example docker-compose up ConfigurationThe docker image is configured using environmental variables as you can see in the example above. Here is a list of all the environment variables Storage
Logging
Basics
Rate limits
AuthorJohn Crepezzi [email protected] License(The MIT License) Copyright © 2011-2012 John Crepezzi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE Other components:
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论