A website selling shadowsocks services, using Wordpress and WooCommerce.
Mainstream Linux distributions are supported. Mac OS and Windows are not supported yet.
cd ~ git clone https://github.com/shadowsocks/shadow-shop.git
cd ~/shadow-shop sudo sh init.sh
During this step, you have to specify the
doamin name of your website. You may choose to run your website either in
production state. Then you need input the
domain name to be used by the your website.
Before proceeding to this step, if you plan to choose
production state, then you have to make sure that the
domain name you are going to input indeed points to the IP address of the server that is running this software. Otherwise, the sofeware will NOT be able to get a valid digital certificate for you website later on.
Create and run website:
cd ~/shadow-shop docker-compose up -d
cd ~/shadow-shop docker-compose stop
Start previously stopped website:
cd ~/shadow-shop docker-compose start
cd ~/shadow-shop docker-compose restart
Stop and remove website:
cd ~/shadow-shop docker-compose down
Show website running status:
cd ~/shadow-shop docker-compose ps
Once you have brought up your website for the first time, you may install Wordpress by typing in a web browser the domain name that your provided during the
If you selected
development state during the
Initialize step, the website digital certificate is self-signed. Thus your website will show you a warning. You have to accept the digital certificate before proceeding.
Then the famous Wordpress 5-minute install process will guide you to customize the installation of Wordpress as you like.
Now you can log in to your site by clicking the Log In button and entering the admin credentials you provided when you were installing WordPress. Then you may go to its admin panel by typing in the web browser the url:
After that, you may perform any admin tasks, including setting up and configuring WooCommerce, in the admin panel. Official documentation for configuring WooCommerce settings can be found here.
By default, the theme StoreFront is installed and activiated as the active theme. You may choose a different theme as you wish. However it is highly recommanded to choose a WooCommerce-compatable theme.
Once you have chosen a theme, you may start to customize how your website looks as you wish.
There are two compulsory plugins - WooCommerce and Shadow Shop - for this website to function properly. They are installed and activiated by default. Do not deactiviate or delete them, or the website will malfunction. If you are not familiar with WooCommerce before, then you might need a bit of googling.
You may install and activiate other plugins as you wish to customize your website functionality. In effect, WooCommerce may automatically install and activiate a few plugins for you during the previous configuration step, such as Jetpack, Mailchimp, and etc.
If you are familiar with Wordpress, then you should be comforatble with finding and using plugins that will help to meet your requierments.
If you are new to Wordpress, then there might be a learning curve. But in all honesty, they are fairly intuitive and easy to learn.
Once you have setup WooCommerce, you may start to create your products. It is IMPORTANT that for EVERY product, you have to choose one and only one value for each of following attributes:
Encryption Method. It is IMPORTANT that failure to comply will result in no creation of shadowsocks account for paid orders.
Life Span attribute of a product specifies how long the shadowsocks accounts created for the product will last for. The options are:
Annually. Once a shadowsocks account has reached its life span, it will be stopped and deleted.
Traffic attribute of a product specifies the maximum number of bits that a user can consume by using the product. The traffic is calculated as the sum of the usages from all the shadowsocks acccounts created for the product for the user. The options are:
10T. Once a product has reached its life span, unused traffic will NOT be carried forward to the next product. It will simply be discarded.
Encryption Method attribute of a product specifies the default encryption algorithm to be used by all the shadowsocks accounts created for this account. The options are:
Management of shadowsocks related resources can be done from the
Shadow Shop menu of the admin panel.
server is a remote machine acting as a shadowsocks exit point. A
server may have more than one
node (see below). Admin has to provide its IP address or domain name when adding a
server. Admin may add, edit, and delete a
server. Note that a
server cannot be deleted if a
node has been created using this
server. Admin has to delete all its
nodes before successfully deleting the
node is a virtual shadowsocks exit point. The difference between
node is that a
server is an indpendent machine where a
node is a logical machine that relies on
server. There can be multiple
nodes residing on a single
server. From users' perspective,
nodes using the same
server are different shadowsocks exit points. Before adding a
node, the underlying
server has to be added into the system first. When adding a new
node, the admin has to select a server, give it a descriptive name, and provide its managing port, managing password, and a range of port numbers to be used in a form of lower and upper bound of port numbers. Admin may also edit and delete a
node. Note that a
node cannot be deleted if an
account has been created using this
node. Admin has to delete all its
accounts before successfully deleting the
Shadow Shop uses shadowsocks-restful-api to manage nodes. Install it on every server acting as a node. The managing port number and managing password chosen for shadowsocks-restful-api for a node have to be consistent with the managing port number and managing password fields for the node in Shadow Shop, so that Shadow Shop will be able to control the node. Otherwise, Shadow Shop will not be able to manage the node.
account is a shadowsocks account. The admin may manually add a new
account by selecting a user, a node, the life span of this account, the ecryption method to be used by this account, and inputing the maximum traffic to be allocated to this account.
When a user has made a payment for a product, an order will be created. The system then will create a shadowsocks account from every existing node for the user for this order.
Note the system currently does not backtrack previous orders. When a new node is added into the system, no new shadowsocks account will be created from this new node for previously created orders.
In order to support guest user payment, go to WooCommerce > Settings > Accounts & Privacy, then configure the settings as the following screen shot:
Wordpress, WooCommerce, and Storefront support multi-language, and have been translated into many languages. Shadow Shop supports multi-language but has not been translated into other languages (due to my lack of language skills). So if you want to use other languages, you may contribute some translation as follows:
Create a fork of this repository.
Locate the language file in your forked repository. The file is located in
website/wp-content/plugins/shadowsocks-hub/languages directory. This directory contains several
.po files with each file corresponding to a language. The names of
.po files have a pattern of
locale is the language code of the file. Find the
.po file corresponding to the language of your interest. If your language file does not exist in the directory, please feel free to create an issue to let me know the language you want to translate. I will add the corresponding
.po file. The file contains all the strings for translation. Each translatable string is formatted like this:
#: admin/class-shadowsocks-hub-accounts-list-table.php:35 msgid "No account found." msgstr ""
The translated string should be put into
pull request and I will merge your translation into the project.
The system will perform daily automatic update of code for Wordpress core files, the theme StoreFront, and the plugins WooCommerce and Shadow Shop. Ohter themes and plugins installed by users have to be updated by yourself from the Wordpress admin panel.
The system will perform daily local backup of all the code. In addition, when the website is up running, the system will perform daily local backup of the entire database.
Please do not hesitate to raise an issue if you would like make a feature request, bug report or provide some feedback. Bugs have a high priority to get addressed while feedback and feature requests will be considered depending on their popularity and importance.